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/store/re_types/definitions/rerun/datatypes/pixel_format.fbs".
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::datatypes {
23 /// **Datatype**: Specifieds a particular format of an `archetypes::Image`.
24 ///
25 /// Most images can be described by a `datatypes::ColorModel` and a `datatypes::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 `datatypes::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 `datatypes::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 `datatypes::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} // namespace rerun::datatypes
117
118namespace rerun {
119 template <typename T>
120 struct Loggable;
121
122 /// \private
123 template <>
124 struct Loggable<datatypes::PixelFormat> {
125 static constexpr const char Name[] = "rerun.datatypes.PixelFormat";
126
127 /// Returns the arrow data type this type corresponds to.
128 static const std::shared_ptr<arrow::DataType>& arrow_datatype();
129
130 /// Serializes an array of `rerun::datatypes::PixelFormat` into an arrow array.
131 static Result<std::shared_ptr<arrow::Array>> to_arrow(
132 const datatypes::PixelFormat* instances, size_t num_instances
133 );
134
135 /// Fills an arrow array builder with an array of this type.
136 static rerun::Error fill_arrow_array_builder(
137 arrow::UInt8Builder* builder, const datatypes::PixelFormat* elements,
138 size_t num_elements
139 );
140 };
141} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:95
All built-in datatypes. See Types in the Rerun manual.
Definition rerun.hpp:82
PixelFormat
Datatype: 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.
@ 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.
@ YUY2
YUY2 (aka YUYV, YUYV16 or NV21), is a YUV 4:2:2 chroma downsampled format with 16 bits per pixel and ...
@ Y8_FullRange
Monochrome Y plane only, essentially a YUV 4:0:0 planar format.
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22