Rerun C++ SDK
Loading...
Searching...
No Matches
pixel_format.hpp
1// DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/cpp/mod.rs
2// Based on "crates/build/re_type_definitions/rerun/encodings/pixel_format.def.rs".
3
4#pragma once
5
6#include "../result.hpp"
7
8#include <cstdint>
9#include <memory>
10
11namespace arrow {
12 /// \private
13 template <typename T>
14 class NumericBuilder;
15
16 class Array;
17 class DataType;
18 class UInt8Type;
19 using UInt8Builder = NumericBuilder<UInt8Type>;
20} // namespace arrow
21
22namespace rerun::encodings {
23 /// **Encoding**: Specifieds a particular format of an `archetypes::Image`.
24 ///
25 /// Most images can be described by a `encodings::ColorModel` and a `encodings::ChannelDatatype`,
26 /// e.g. `RGB` and `U8` respectively.
27 ///
28 /// However, some image formats has chroma downsampling and/or
29 /// use differing number of bits per channel, and that is what this `encodings::PixelFormat` is for.
30 ///
31 /// All these formats support random access.
32 ///
33 /// For more compressed image formats, see `archetypes::EncodedImage`.
34 enum class PixelFormat : uint8_t {
35
36 /// `Y_U_V12` is a YUV 4:2:0 fully planar YUV format without chroma downsampling, also known as `I420`.
37 ///
38 /// This uses limited range YUV, i.e. Y is expected to be within [16, 235] and U/V within [16, 240].
39 ///
40 /// First comes entire image in Y in one plane, followed by the U and V planes, which each only have half
41 /// the resolution of the Y plane.
43
44 /// `NV12` (aka `Y_UV12`) is a YUV 4:2:0 chroma downsampled form at with 12 bits per pixel and 8 bits per channel.
45 ///
46 /// This uses limited range YUV, i.e. Y is expected to be within [16, 235] and U/V within [16, 240].
47 ///
48 /// First comes entire image in Y in one plane,
49 /// followed by a plane with interleaved lines ordered as U0, V0, U1, V1, etc.
50 NV12 = 26,
51
52 /// `YUY2` (aka 'YUYV', 'YUYV16' or 'NV21'), is a YUV 4:2:2 chroma downsampled format with 16 bits per pixel and 8 bits per channel.
53 ///
54 /// This uses limited range YUV, i.e. Y is expected to be within [16, 235] and U/V within [16, 240].
55 ///
56 /// The order of the channels is Y0, U0, Y1, V0, all in the same plane.
57 YUY2 = 27,
58
59 /// Monochrome Y plane only, essentially a YUV 4:0:0 planar format.
60 ///
61 /// Also known as just "gray". This is virtually identical to a 8bit luminance/grayscale (see `encodings::ColorModel`).
62 ///
63 /// This uses entire range YUV, i.e. Y is expected to be within [0, 255].
64 /// (as opposed to "limited range" YUV as used e.g. in NV12).
65 Y8_FullRange = 30,
66
67 /// `Y_U_V24` is a YUV 4:4:4 fully planar YUV format without chroma downsampling, also known as `I444`.
68 ///
69 /// This uses limited range YUV, i.e. Y is expected to be within [16, 235] and U/V within [16, 240].
70 ///
71 /// First comes entire image in Y in one plane, followed by the U and V planes.
73
74 /// `Y_U_V24` is a YUV 4:4:4 fully planar YUV format without chroma downsampling, also known as `I444`.
75 ///
76 /// This uses full range YUV with all components ranging from 0 to 255
77 /// (as opposed to "limited range" YUV as used e.g. in NV12).
78 ///
79 /// First comes entire image in Y in one plane, followed by the U and V planes.
81
82 /// Monochrome Y plane only, essentially a YUV 4:0:0 planar format.
83 ///
84 /// Also known as just "gray".
85 ///
86 /// This uses limited range YUV, i.e. Y is expected to be within [16, 235].
87 /// If not for this range limitation/remapping, this is almost identical to 8bit luminace/grayscale (see `encodings::ColorModel`).
88 Y8_LimitedRange = 41,
89
90 /// `Y_U_V12` is a YUV 4:2:0 fully planar YUV format without chroma downsampling, also known as `I420`.
91 ///
92 /// This uses full range YUV with all components ranging from 0 to 255
93 /// (as opposed to "limited range" YUV as used e.g. in NV12).
94 ///
95 /// First comes entire image in Y in one plane, followed by the U and V planes, which each only have half
96 /// the resolution of the Y plane.
98
99 /// `Y_U_V16` is a YUV 4:2:2 fully planar YUV format without chroma downsampling, also known as `I422`.
100 ///
101 /// This uses limited range YUV, i.e. Y is expected to be within [16, 235] and U/V within [16, 240].
102 ///
103 /// First comes entire image in Y in one plane, followed by the U and V planes, which each only have half
104 /// the horizontal resolution of the Y plane.
106
107 /// `Y_U_V16` is a YUV 4:2:2 fully planar YUV format without chroma downsampling, also known as `I422`.
108 ///
109 /// This uses full range YUV with all components ranging from 0 to 255
110 /// (as opposed to "limited range" YUV as used e.g. in NV12).
111 ///
112 /// First comes entire image in Y in one plane, followed by the U and V planes, which each only have half
113 /// the horizontal resolution of the Y plane.
115
116 /// Raw Bayer image with 8 bits per pixel, using the RGGB color filter pattern.
117 ///
118 /// Every pixel holds a single color sample, in one plane. The pattern repeats every 2x2 pixels,
119 /// with red and green in even rows, and green and blue in odd rows.
120 ///
121 /// The viewer reconstructs RGB using bilinear demosaicing.
122 BayerRGGB8 = 128,
123
124 /// Raw Bayer image with 8 bits per pixel, using the BGGR color filter pattern.
125 ///
126 /// Every pixel holds a single color sample, in one plane. The pattern repeats every 2x2 pixels,
127 /// with blue and green in even rows, and green and red in odd rows.
128 ///
129 /// The viewer reconstructs RGB using bilinear demosaicing.
130 BayerBGGR8 = 129,
131
132 /// Raw Bayer image with 8 bits per pixel, using the GBRG color filter pattern.
133 ///
134 /// Every pixel holds a single color sample, in one plane. The pattern repeats every 2x2 pixels,
135 /// with green and blue in even rows, and red and green in odd rows.
136 ///
137 /// The viewer reconstructs RGB using bilinear demosaicing.
138 BayerGBRG8 = 130,
139
140 /// Raw Bayer image with 8 bits per pixel, using the GRBG color filter pattern.
141 ///
142 /// Every pixel holds a single color sample, in one plane. The pattern repeats every 2x2 pixels,
143 /// with green and red in even rows, and blue and green in odd rows.
144 ///
145 /// The viewer reconstructs RGB using bilinear demosaicing.
146 BayerGRBG8 = 131,
147 };
148} // namespace rerun::encodings
149
150namespace rerun {
151 template <typename T>
152 struct Loggable;
153
154 /// \private
155 template <>
156 struct Loggable<encodings::PixelFormat> {
157 static constexpr std::string_view ComponentType = "rerun.encodings.PixelFormat";
158
159 /// Returns the arrow data type this type corresponds to.
160 static const std::shared_ptr<arrow::DataType>& arrow_data_type();
161
162 /// Serializes an array of `rerun::encodings::PixelFormat` into an arrow array.
163 static Result<std::shared_ptr<arrow::Array>> to_arrow(
164 const encodings::PixelFormat* instances, size_t num_instances
165 );
166
167 /// Fills an arrow array builder with an array of this type.
168 static rerun::Error fill_arrow_array_builder(
169 arrow::UInt8Builder* builder, const encodings::PixelFormat* elements,
170 size_t num_elements
171 );
172 };
173} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:104
All built-in encodings. See Types in the Rerun manual.
Definition rerun.hpp:96
PixelFormat
Encoding: Specifieds a particular format of an archetypes::Image.
Definition pixel_format.hpp:34
@ Y_U_V12_FullRange
Y_U_V12 is a YUV 4:2:0 fully planar YUV format without chroma downsampling, also known as I420.
@ BayerGBRG8
Raw Bayer image with 8 bits per pixel, using the GBRG color filter pattern.
@ NV12
NV12 (aka Y_UV12) is a YUV 4:2:0 chroma downsampled form at with 12 bits per pixel and 8 bits per cha...
@ Y_U_V12_LimitedRange
Y_U_V12 is a YUV 4:2:0 fully planar YUV format without chroma downsampling, also known as I420.
@ Y_U_V24_FullRange
Y_U_V24 is a YUV 4:4:4 fully planar YUV format without chroma downsampling, also known as I444.
@ Y8_LimitedRange
Monochrome Y plane only, essentially a YUV 4:0:0 planar format.
@ Y_U_V24_LimitedRange
Y_U_V24 is a YUV 4:4:4 fully planar YUV format without chroma downsampling, also known as I444.
@ Y_U_V16_FullRange
Y_U_V16 is a YUV 4:2:2 fully planar YUV format without chroma downsampling, also known as I422.
@ Y_U_V16_LimitedRange
Y_U_V16 is a YUV 4:2:2 fully planar YUV format without chroma downsampling, also known as I422.
@ BayerGRBG8
Raw Bayer image with 8 bits per pixel, using the GRBG color filter pattern.
@ BayerBGGR8
Raw Bayer image with 8 bits per pixel, using the BGGR color filter pattern.
@ YUY2
YUY2 (aka 'YUYV', 'YUYV16' or 'NV21'), is a YUV 4:2:2 chroma downsampled format with 16 bits per pixe...
@ Y8_FullRange
Monochrome Y plane only, essentially a YUV 4:0:0 planar format.
@ BayerRGGB8
Raw Bayer image with 8 bits per pixel, using the RGGB color filter pattern.
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:26