IDS peak ICV v1.0.0
Loading...
Searching...
No Matches
peak_icv_debayer_channel_layout.hpp
Go to the documentation of this file.
1
11#pragma once
12
15
16#include <unordered_map>
17#include <string>
18
19namespace peak
20{
21namespace pipeline
22{
30{
31 RGB = 0,
32 BGR,
33 RGBA,
34 BGRA
35};
36
46{
47 switch (layout)
48 {
50 return "RGB";
52 return "BGR";
54 return "RGBA";
56 return "BGRA";
57 }
58 const auto layoutStr = std::to_string(static_cast<int>(layout));
59 throw peak::icv::NotSupportedException("The given debayer channel layout " + layoutStr + " is unknown!");
60}
61
70inline std::ostream& operator<<(std::ostream& os, DebayerChannelLayout layout)
71{
72 return os << ToString(layout);
73}
74
75namespace detail
76{
86{
87 static const std::unordered_map<std::string, DebayerChannelLayout> channelLayoutMap{ { "RGB", DebayerChannelLayout::RGB },
89
90 auto it = channelLayoutMap.find(layout);
91 if (it == channelLayoutMap.end())
92 {
93 throw peak::icv::NotSupportedException("The given debayer channel layout " + layout + " is unknown!");
94 }
95 return it->second;
96}
97} // namespace detail
98
99} // namespace pipeline
100} // namespace peak
Thrown when a requested operation is not implemented or supported.
#define PEAK_COMMON_NO_DISCARD
Compatability macro for the nodiscard attribute.
DebayerChannelLayout
Specifies the desired channel layout of the output image.
@ BGR
Blue-Green-Red format with 3 channels.
@ BGRA
Blue-Green-Red-Alpha format with 4 channels.
@ RGB
Red-Green-Blue format with 3 channels.
@ RGBA
Red-Green-Blue-Alpha format with 4 channels.
DebayerChannelLayout ToDebayerChannelLayout(const std::string &layout)
Converts a string representation to a DebayerChannelLayout enum value.
std::string ToString(BinningMode mode)
Converts a BinningMode enum value to its string representation.
std::ostream & operator<<(std::ostream &os, BinningMode mode)
Stream output operator for BinningMode enum.