Skip to content

Commit

Permalink
Added debug output to FrameType::translatePixelFormat()
Browse files Browse the repository at this point in the history
Summary: Just a simple debug output in case a pixel format cannot be translated.

Differential Revision: D67652309

fbshipit-source-id: 283580c7259df695adbda8b88fcb549290eaf768
  • Loading branch information
janherling authored and facebook-github-bot committed Dec 26, 2024
1 parent d050be0 commit 0951261
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions impl/ocean/base/Frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

#include "ocean/base/Frame.h"
#include "ocean/base/Messenger.h"
#include "ocean/base/String.h"

namespace Ocean
Expand Down Expand Up @@ -1492,6 +1493,13 @@ std::string FrameType::translatePixelFormat(const PixelFormat pixelFormat)
return "B_G_R24";
}

#ifdef OCEAN_DEBUG
const DataType pixelFormatDataType = dataType(pixelFormat);
const unsigned int pixelFormatChannels = channels(pixelFormat);

Log::debug() << "The pixel format is generic and thus cannot be translated, the format has " << pixelFormatChannels << " channels and holds " << translateDataType(pixelFormatDataType) << " values per channel";
#endif

ocean_assert(false && "Invalid pixel format.");
return "UNDEFINED";
}
Expand Down

0 comments on commit 0951261

Please sign in to comment.