MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / rawEncodingInfo

Function rawEncodingInfo

pj_scene2D/core/src/image_pipeline_source.cpp:73–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71};
72
73std::optional<RawEncodingInfo> rawEncodingInfo(std::string_view encoding) noexcept {
74 if (encoding == "rgb8") {
75 return RawEncodingInfo{PixelFormat::kRGB888, 3};
76 }
77 if (encoding == "rgba8") {
78 return RawEncodingInfo{PixelFormat::kRGBA8888, 4};
79 }
80 if (encoding == "bgr8") {
81 return RawEncodingInfo{PixelFormat::kBGR888, 3};
82 }
83 if (encoding == "bgra8") {
84 return RawEncodingInfo{PixelFormat::kBGRA8888, 4};
85 }
86 if (encoding == "mono8") {
87 return RawEncodingInfo{PixelFormat::kMono8, 1};
88 }
89 if (encoding == "mono16" || encoding == "16UC1") {
90 return RawEncodingInfo{PixelFormat::kMono16, 2};
91 }
92 return std::nullopt;
93}
94
95std::optional<DecodedFrame> imageToDecodedFrame(const sdk::Image& img, const RawEncodingInfo& info, int64_t pts) {
96 if (img.width == 0 || img.height == 0 || img.data.empty()) {

Callers 2

decodeRawOrBayerImageFunction · 0.85
decodeCanonicalImageMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected