18#include <peak_common_c/detail/peak_common_defines.h>
19#include <peak_common_c/types/peak_common_pixel_format.h>
20#include <unordered_map>
36 return static_cast<uint32_t
>(
static_cast<std::underlying_type_t<peak_common_pixel_format>
>(pixelFormat));
53 BayerGR8 = PEAK_COMMON_PIXEL_FORMAT_BAYER_GR_8,
54 BayerGR10 = PEAK_COMMON_PIXEL_FORMAT_BAYER_GR_10,
55 BayerGR12 = PEAK_COMMON_PIXEL_FORMAT_BAYER_GR_12,
57 BayerRG8 = PEAK_COMMON_PIXEL_FORMAT_BAYER_RG_8,
58 BayerRG10 = PEAK_COMMON_PIXEL_FORMAT_BAYER_RG_10,
59 BayerRG12 = PEAK_COMMON_PIXEL_FORMAT_BAYER_RG_12,
61 BayerGB8 = PEAK_COMMON_PIXEL_FORMAT_BAYER_GB_8,
62 BayerGB10 = PEAK_COMMON_PIXEL_FORMAT_BAYER_GB_10,
63 BayerGB12 = PEAK_COMMON_PIXEL_FORMAT_BAYER_GB_12,
65 BayerBG8 = PEAK_COMMON_PIXEL_FORMAT_BAYER_BG_8,
66 BayerBG10 = PEAK_COMMON_PIXEL_FORMAT_BAYER_BG_10,
67 BayerBG12 = PEAK_COMMON_PIXEL_FORMAT_BAYER_BG_12,
69 Mono8 = PEAK_COMMON_PIXEL_FORMAT_MONO_8,
70 Mono10 = PEAK_COMMON_PIXEL_FORMAT_MONO_10,
71 Mono12 = PEAK_COMMON_PIXEL_FORMAT_MONO_12,
72 Mono16 = PEAK_COMMON_PIXEL_FORMAT_MONO_16,
74 Confidence8 = PEAK_COMMON_PIXEL_FORMAT_CONFIDENCE_8,
77 Coord3D_C8 = PEAK_COMMON_PIXEL_FORMAT_COORD3D_C8,
88 RGB8 = PEAK_COMMON_PIXEL_FORMAT_RGB_8,
89 RGB10 = PEAK_COMMON_PIXEL_FORMAT_RGB_10,
90 RGB12 = PEAK_COMMON_PIXEL_FORMAT_RGB_12,
92 BGR8 = PEAK_COMMON_PIXEL_FORMAT_BGR_8,
93 BGR10 = PEAK_COMMON_PIXEL_FORMAT_BGR_10,
94 BGR12 = PEAK_COMMON_PIXEL_FORMAT_BGR_12,
96 RGBa8 = PEAK_COMMON_PIXEL_FORMAT_RGBA_8,
97 RGBa10 = PEAK_COMMON_PIXEL_FORMAT_RGBA_10,
98 RGBa12 = PEAK_COMMON_PIXEL_FORMAT_RGBA_12,
100 BGRa8 = PEAK_COMMON_PIXEL_FORMAT_BGRA_8,
101 BGRa10 = PEAK_COMMON_PIXEL_FORMAT_BGRA_10,
102 BGRa12 = PEAK_COMMON_PIXEL_FORMAT_BGRA_12,
104 BayerBG10p = PEAK_COMMON_PIXEL_FORMAT_BAYER_BG_10_PACKED,
105 BayerBG12p = PEAK_COMMON_PIXEL_FORMAT_BAYER_BG_12_PACKED,
107 BayerGB10p = PEAK_COMMON_PIXEL_FORMAT_BAYER_GB_10_PACKED,
108 BayerGB12p = PEAK_COMMON_PIXEL_FORMAT_BAYER_GB_12_PACKED,
110 BayerGR10p = PEAK_COMMON_PIXEL_FORMAT_BAYER_GR_10_PACKED,
111 BayerGR12p = PEAK_COMMON_PIXEL_FORMAT_BAYER_GR_12_PACKED,
113 BayerRG10p = PEAK_COMMON_PIXEL_FORMAT_BAYER_RG_10_PACKED,
114 BayerRG12p = PEAK_COMMON_PIXEL_FORMAT_BAYER_RG_12_PACKED,
116 Mono10p = PEAK_COMMON_PIXEL_FORMAT_MONO_10_PACKED,
117 Mono12p = PEAK_COMMON_PIXEL_FORMAT_MONO_12_PACKED,
119 RGB10p32 = PEAK_COMMON_PIXEL_FORMAT_RGB_10_PACKED_32,
120 BGR10p32 = PEAK_COMMON_PIXEL_FORMAT_BGR_10_PACKED_32,
132 Mono10g40IDS = PEAK_COMMON_PIXEL_FORMAT_MONO_10_GROUPED_40_IDS,
133 Mono12g24IDS = PEAK_COMMON_PIXEL_FORMAT_MONO_12_GROUPED_24_IDS,
211 return static_cast<peak_common_pixel_format
>(
static_cast<uint32_t
>(pixelFormat));
250 template <
typename T =
size_t>
260 template <
typename T =
size_t>
285 PEAK_COMMON_NO_DISCARD std::string
GetName()
const;
293 PEAK_COMMON_NO_DISCARD std::vector<Channel>
GetChannels()
const;
368 PEAK_COMMON_NO_DISCARD
bool IsPacked()
const;
417 PEAK_COMMON_NO_DISCARD
bool IsFloat()
const;
434 : m_pixelFormat{ pixelFormat }
445 const auto it = std::find(channels.cbegin(), channels.cend(), channel);
446 if (it == channels.end())
451 return static_cast<size_t>(std::distance(channels.begin(), it));
467 return std::find(channels.cbegin(), channels.cend(), channel) != channels.cend();
472 return m_pixelFormat;
Thrown when a function receives an invalid parameter.
Represents a two-dimensional size with non-negative width and height.
Channel
Represents the various data channels in image or spatial data formats.
PixelFormat
Enum listing all supported pixel formats and their internal IDs.
@ RGB32fIDS
RGB 32-Bit float format (IDS)
@ BayerGR12p_I_A_B
BayerGR 12-Bit packed format line Interleaved Components A, B.
@ BayerGB12_AB
BayerGB 12-Bit pixel format Components A, B.
@ BayerRG12g24IDS
BayerRG 12-Bit grouped 24-bit (IDS)
@ BayerBG12p_I_A_B
BayerBG 12-Bit packed format line Interleaved Components A, B.
@ Coord3D_C8
3D coordinate C 8-Bit format
@ Mono10g40IDS_I_A_B
Mono 10-Bit grouped 40-bit (IDS) line Interleaved Components A, B.
@ RGBa10
RGBA 10-Bit pixel format.
@ RGB8
RGB 8-Bit pixel format.
@ Mono10_I_AB_CD
Mono 10-Bit pixel format pixel Interleaved Components A, B, C, D.
@ Mono12p
Mono 12-Bit packed format.
@ Mono12
Mono 12-Bit pixel format.
@ BGR10p32
BGR 10-Bit packed 32-bit format.
@ BayerGR12_AB
BayerGR 12-Bit pixel format Components A, B.
@ BayerGB10
BayerGB 10-Bit pixel format.
@ BayerBG8_I_A_B
BayerBG 8-Bit pixel format line Interleaved Components A, B.
@ BayerGB12p_I_A_B
BayerGB 12-Bit packed format line Interleaved Components A, B.
@ BayerRG12p
BayerRG 12-Bit packed format.
@ BayerBG10
BayerBG 10-Bit pixel format.
@ BayerGR10_I_A_B
BayerGR 10-Bit pixel format line Interleaved Components A, B.
@ RGBa8
RGBA 8-Bit pixel format.
@ Mono10g40IDS
Mono 10-Bit grouped 40-bit (IDS)
@ BayerRG8_I_A_B
BayerRG 8-Bit pixel format line Interleaved Components A, B.
@ BayerGB10g40IDS_I_A_B
BayerGB 10-Bit grouped 40-bit (IDS) line Interleaved Components A, B.
@ BayerGR10g40IDS
BayerGR 10-Bit grouped 40-bit (IDS)
@ BayerGR12_I_A_B
BayerGR 12-Bit pixel format line Interleaved Components A, B.
@ BayerBG8_AB
BayerBG 8-Bit pixel format Components A, B.
@ BayerBG10p
BayerBG 10-Bit packed format.
@ BayerRG10p_I_A_B
BayerRG 10-Bit packed format line Interleaved Components A, B.
@ Mono10_ABCD
Mono 10-Bit pixel format Components A, B, C, D.
@ RGBa12
RGBA 12-Bit pixel format.
@ BayerGB10p_I_A_B
BayerGB 10-Bit packed format line Interleaved Components A, B.
@ BayerGB12p
BayerGB 12-Bit packed format.
@ BGRa12
BGRA 12-Bit pixel format.
@ BayerGR12
BayerGR 12-Bit pixel format.
@ Mono10p_I_A_B
Mono 10-Bit packed format line Interleaved Components A, B.
@ BayerRG10p
BayerRG 10-Bit packed format.
@ BayerGR8_I_A_B
BayerGR 8-Bit pixel format line Interleaved Components A, B.
@ BayerGR10p_I_A_B
BayerGR 10-Bit packed format line Interleaved Components A, B.
@ BayerRG12
BayerRG 12-Bit pixel format.
@ BayerBG10g40IDS_I_A_B
BayerBG 10-Bit grouped 40-bit (IDS) line Interleaved Components A, B.
@ BayerGR12p
BayerGR 12-Bit packed format.
@ BayerGR8
BayerGR 8-Bit pixel format.
@ BayerBG12p
BayerBG 12-Bit packed format.
@ BayerBG8
BayerBG 8-Bit pixel format.
@ BayerBG12_AB
BayerBG 12-Bit pixel format Components A, B.
@ Confidence16
Confidence 16-Bit format.
@ BayerGB12_I_A_B
BayerGB 12-Bit pixel format line Interleaved Components A, B.
@ Mono12g24IDS
Mono 12-Bit grouped 24-bit (IDS)
@ BayerRG10
BayerRG 10-Bit pixel format.
@ BayerGB12
BayerGB 12-Bit pixel format.
@ Mono8_I_AB_CD
Mono 8-Bit pixel format pixel Interleaved Components A, B, C, D.
@ BayerRG8
BayerRG 8-Bit pixel format.
@ BayerGR10p
BayerGR 10-Bit packed format.
@ BayerBG12_I_A_B
BayerBG 12-Bit pixel format line Interleaved Components A, B.
@ BayerBG10_AB
BayerBG 10-Bit pixel format Components A, B.
@ YUV422_8_UYVY
UYVY 4:2:2 8-Bit format.
@ YUV420_8_YY_VU_SemiplanarIDS
YUV4:2:0 8-Bit YY/VU semiplanar (IDS)
@ BayerRG12g24IDS_I_A_B
BayerRG 10-Bit grouped 40-bit (IDS) line Interleaved Components A, B.
@ Mono8_ABCD
Mono 8-Bit pixel format Components A, B, C, D.
@ Mono12p_I_AB_CD
Mono 12-Bit packed format pixel Interleaved Components A, B, C, D.
@ BayerGB8
BayerGB 8-Bit pixel format.
@ Mono12_I_AB_CD
Mono 12-Bit pixel format pixel Interleaved Components A, B, C, D.
@ Mono10_I_A_B
Mono 10-Bit pixel format line Interleaved Components A, B.
@ BGR12
BGR 12-Bit pixel format.
@ Mono8_AB
Mono 8-Bit pixel format Components A, B.
@ Confidence8
Confidence 8-Bit format.
@ Mono10g40IDS_I_AB_CD
Mono 10-Bit grouped 40-bit (IDS) pixel Interleaved Components A, B, C, D.
@ BayerRG10g40IDS_I_A_B
BayerRG 10-Bit grouped 40-bit (IDS) line Interleaved Components A, B.
@ BayerGR12g24IDS_I_A_B
BayerGR 10-Bit grouped 40-bit (IDS) line Interleaved Components A, B.
@ RGB10
RGB 10-Bit pixel format.
@ BayerGR12g24IDS
BayerGR 12-Bit grouped 24-bit (IDS)
@ YUV420_8_YY_UV_SemiplanarIDS
YUV4:2:0 8-Bit YY/UV semiplanar (IDS)
@ BayerGR10
BayerGR 10-Bit pixel format.
@ Coord3D_C32f
3D coordinate C 32-Bit float format
@ Mono16
Mono 16-Bit pixel format.
@ Mono10
Mono 10-Bit pixel format.
@ BayerRG12_AB
BayerRG 12-Bit pixel format Components A, B.
@ Mono10p_I_AB_CD
Mono 10-Bit packed format pixel Interleaved Components A, B, C, D.
@ Mono12g24IDS_I_A_B
Mono 12-Bit grouped 24-bit (IDS) line Interleaved Components A, B.
@ BayerRG10_AB
BayerRG 10-Bit pixel format Components A, B.
@ Mono8
Mono 8-Bit pixel format.
@ Mono12_I_A_B
Mono 12-Bit pixel format line Interleaved Components A, B.
@ BGR10
BGR 10-Bit pixel format.
@ BayerBG10_I_A_B
BayerBG 10-Bit pixel format line Interleaved Components A, B.
@ Mono12p_I_A_B
Mono 12-Bit packed format line Interleaved Components A, B.
@ BayerGB12g24IDS_I_A_B
BayerGB 10-Bit grouped 40-bit (IDS) line Interleaved Components A, B.
@ Coord3D_ABC32f
3D coordinates A, B, C 32-Bit float format
@ RGB12
RGB 12-Bit pixel format.
@ BayerGB10_I_A_B
BayerGB 10-Bit pixel format line Interleaved Components A, B.
@ BayerBG10p_I_A_B
BayerBG 10-Bit packed format line Interleaved Components A, B.
@ BayerGR10_AB
BayerGR 10-Bit pixel format Components A, B.
@ BayerBG12
BayerBG 12-Bit pixel format.
@ BayerBG10g40IDS
BayerBG 10-Bit grouped 40-bit (IDS)
@ BayerGR8_AB
BayerGR 8-Bit pixel format Components A, B.
@ BayerGB10p
BayerGB 10-Bit packed format.
@ Mono12g24IDS_I_AB_CD
Mono 12-Bit grouped 24-bit (IDS) pixel Interleaved Components A, B, C, D.
@ Mono32fIDS
Mono 32-Bit float format (IDS)
@ BayerRG8_AB
BayerRG 8-Bit pixel format Components A, B.
@ BGRa8
BGRA 8-Bit pixel format.
@ BayerGB8_AB
BayerGB 8-Bit pixel format Components A, B.
@ BayerGB10_AB
BayerGB 10-Bit pixel format Components A, B.
@ BGRa10
BGRA 10-Bit pixel format.
@ Coord3D_C16
3D coordinate C 16-Bit format
@ BayerRG12_I_A_B
BayerRG 12-Bit pixel format line Interleaved Components A, B.
@ BGR8
BGR 8-Bit pixel format.
@ BayerBG12g24IDS_I_A_B
BayerBG 10-Bit grouped 40-bit (IDS) line Interleaved Components A, B.
@ BayerBG12g24IDS
BayerBG 12-Bit grouped 24-bit (IDS)
@ Mono8_I_A_B
Mono 8-Bit pixel format line Interleaved Components A, B.
@ Mono12_AB
Mono 12-Bit pixel format Components A, B.
@ Mono10_AB
Mono 10-Bit pixel format Components A, B.
@ BayerGR10g40IDS_I_A_B
BayerGR 10-Bit grouped 40-bit (IDS) line Interleaved Components A, B.
@ Mono10p
Mono 10-Bit packed format.
@ BayerRG10g40IDS
BayerRG 10-Bit grouped 40-bit (IDS)
@ BayerGB8_I_A_B
BayerGB 8-Bit pixel format line Interleaved Components A, B.
@ BayerRG12p_I_A_B
BayerRG 12-Bit packed format line Interleaved Components A, B.
@ Mono12_ABCD
Mono 12-Bit pixel format Components A, B, C, D.
@ BayerRG10_I_A_B
BayerRG 10-Bit pixel format line Interleaved Components A, B.
@ RGB10p32
RGB 10-Bit packed 32-bit format.
@ BayerGB10g40IDS
BayerGB 10-Bit grouped 40-bit (IDS)
@ BayerGB12g24IDS
BayerGB 12-Bit grouped 24-bit (IDS)
constexpr peak_common_pixel_format CppPixelFormatToCPixelFormat(PixelFormat pixelFormat) noexcept
constexpr uint64_t CPixelFormatCast(peak_common_pixel_format pixelFormat) noexcept
constexpr PixelFormat CPixelFormatToCppPixelFormat(peak_common_pixel_format pixelFormat) noexcept