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 "../component_descriptor.hpp"
7#include "../result.hpp"
8
9#include <cstdint>
10#include <memory>
11
12namespace arrow {
13 /// \private
14 template <typename T>
15 class NumericBuilder;
16
17 class Array;
18 class DataType;
19 class UInt8Type;
20 using UInt8Builder = NumericBuilder<UInt8Type>;
21} // namespace arrow
22
23namespace rerun::datatypes {
24 /// **Datatype**: Specifieds a particular format of an `archetypes::Image`.
25 ///
26 /// Most images can be described by a `datatypes::ColorModel` and a `datatypes::ChannelDatatype`,
27 /// e.g. `RGB` and `U8` respectively.
28 ///
29 /// However, some image formats has chroma downsampling and/or
30 /// use differing number of bits per channel, and that is what this `datatypes::PixelFormat` is for.
31 ///
32 /// All these formats support random access.
33 ///
34 /// For more compressed image formats, see `archetypes::EncodedImage`.
35 enum class PixelFormat : uint8_t {
36
37 /// `Y_U_V12` is a YUV 4:2:0 fully planar YUV format without chroma downsampling, also known as `I420`.
38 ///
39 /// This uses limited range YUV, i.e. Y is expected to be within [16, 235] and U/V within [16, 240].
40 ///
41 /// First comes entire image in Y in one plane, followed by the U and V planes, which each only have half
42 /// the resolution of the Y plane.
44
45 /// `NV12` (aka `Y_UV12`) is a YUV 4:2:0 chroma downsampled form at with 12 bits per pixel and 8 bits per channel.
46 ///
47 /// This uses limited range YUV, i.e. Y is expected to be within [16, 235] and U/V within [16, 240].
48 ///
49 /// First comes entire image in Y in one plane,
50 /// followed by a plane with interleaved lines ordered as U0, V0, U1, V1, etc.
51 NV12 = 26,
52
53 /// `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.
54 ///
55 /// This uses limited range YUV, i.e. Y is expected to be within [16, 235] and U/V within [16, 240].
56 ///
57 /// The order of the channels is Y0, U0, Y1, V0, all in the same plane.
58 YUY2 = 27,
59
60 /// Monochrome Y plane only, essentially a YUV 4:0:0 planar format.
61 ///
62 /// Also known as just "gray". This is virtually identical to a 8bit luminance/grayscale (see `datatypes::ColorModel`).
63 ///
64 /// This uses entire range YUV, i.e. Y is expected to be within [0, 255].
65 /// (as opposed to "limited range" YUV as used e.g. in NV12).
66 Y8_FullRange = 30,
67
68 /// `Y_U_V24` is a YUV 4:4:4 fully planar YUV format without chroma downsampling, also known as `I444`.
69 ///
70 /// This uses limited range YUV, i.e. Y is expected to be within [16, 235] and U/V within [16, 240].
71 ///
72 /// First comes entire image in Y in one plane, followed by the U and V planes.
74
75 /// `Y_U_V24` is a YUV 4:4:4 fully planar YUV format without chroma downsampling, also known as `I444`.
76 ///
77 /// This uses full range YUV with all components ranging from 0 to 255
78 /// (as opposed to "limited range" YUV as used e.g. in NV12).
79 ///
80 /// First comes entire image in Y in one plane, followed by the U and V planes.
82
83 /// Monochrome Y plane only, essentially a YUV 4:0:0 planar format.
84 ///
85 /// Also known as just "gray".
86 ///
87 /// This uses limited range YUV, i.e. Y is expected to be within [16, 235].
88 /// If not for this range limitation/remapping, this is almost identical to 8bit luminace/grayscale (see `datatypes::ColorModel`).
89 Y8_LimitedRange = 41,
90
91 /// `Y_U_V12` is a YUV 4:2:0 fully planar YUV format without chroma downsampling, also known as `I420`.
92 ///
93 /// This uses full range YUV with all components ranging from 0 to 255
94 /// (as opposed to "limited range" YUV as used e.g. in NV12).
95 ///
96 /// First comes entire image in Y in one plane, followed by the U and V planes, which each only have half
97 /// the resolution of the Y plane.
99
100 /// `Y_U_V16` is a YUV 4:2:2 fully planar YUV format without chroma downsampling, also known as `I422`.
101 ///
102 /// This uses limited range YUV, i.e. Y is expected to be within [16, 235] and U/V within [16, 240].
103 ///
104 /// First comes entire image in Y in one plane, followed by the U and V planes, which each only have half
105 /// the horizontal resolution of the Y plane.
107
108 /// `Y_U_V16` is a YUV 4:2:2 fully planar YUV format without chroma downsampling, also known as `I422`.
109 ///
110 /// This uses full range YUV with all components ranging from 0 to 255
111 /// (as opposed to "limited range" YUV as used e.g. in NV12).
112 ///
113 /// First comes entire image in Y in one plane, followed by the U and V planes, which each only have half
114 /// the horizontal resolution of the Y plane.
116 };
117} // namespace rerun::datatypes
118
119namespace rerun {
120 template <typename T>
121 struct Loggable;
122
123 /// \private
124 template <>
125 struct Loggable<datatypes::PixelFormat> {
126 static constexpr ComponentDescriptor Descriptor = "rerun.datatypes.PixelFormat";
127
128 /// Returns the arrow data type this type corresponds to.
129 static const std::shared_ptr<arrow::DataType>& arrow_datatype();
130
131 /// Serializes an array of `rerun::datatypes::PixelFormat` into an arrow array.
132 static Result<std::shared_ptr<arrow::Array>> to_arrow(
133 const datatypes::PixelFormat* instances, size_t num_instances
134 );
135
136 /// Fills an arrow array builder with an array of this type.
137 static rerun::Error fill_arrow_array_builder(
138 arrow::UInt8Builder* builder, const datatypes::PixelFormat* elements,
139 size_t num_elements
140 );
141 };
142} // 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:83
PixelFormat
Datatype: Specifieds a particular format of an archetypes::Image.
Definition pixel_format.hpp:35
@ 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 pixe...
@ 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:23