3#include "datatypes/channel_datatype.hpp"
4#include "datatypes/color_model.hpp"
5#include "datatypes/pixel_format.hpp"
17 WidthHeight(uint32_t width_, uint32_t height_) : width{width_}, height{height_} {}
57 assert(
false &&
"unreachable");
64 return (resolution.width * resolution.height *
datatype_bits(datatype) + 7) / 8;
67 template <
typename TElement>
140 switch (color_model) {
150 assert(
false &&
"unreachable");
155 inline size_t pixel_format_num_bytes(
158 auto num_pixels = resolution.width * resolution.height;
159 switch (pixel_format) {
163 return num_pixels * 4;
169 return 16 * num_pixels / 8;
175 return 12 * num_pixels / 8;
183 assert(
false &&
"unreachable");
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.
ColorModel
Datatype: Specified what color components are present in an archetypes::Image.
Definition color_model.hpp:26
@ BGRA
Blue, Green, Red, Alpha.
@ L
Grayscale luminance intencity/brightness/value, sometimes called Y
@ RGBA
Red, Green, Blue, Alpha.
ChannelDatatype
Datatype: The innermost datatype of an image.
Definition channel_datatype.hpp:26
@ F64
64-bit IEEE-754 floating point, also known as double.
@ U64
64-bit unsigned integer.
@ F32
32-bit IEEE-754 floating point, also known as float or single.
@ F16
16-bit IEEE-754 floating point, also known as half.
@ I8
8-bit signed integer.
@ U8
8-bit unsigned integer.
@ I16
16-bit signed integer.
@ U32
32-bit unsigned integer.
@ I32
32-bit signed integer.
@ I64
64-bit signed integer.
@ U16
16-bit unsigned integer.
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22
size_t datatype_bits(datatypes::ChannelDatatype value)
Number of bits used by this element type.
Definition image_utils.hpp:21
size_t color_model_channel_count(datatypes::ColorModel color_model)
Returns the number of channels for a given color model.
Definition image_utils.hpp:139
The width and height of an image.
Definition image_utils.hpp:13
IEEE 754 16-bit half-precision floating point number.
Definition half.hpp:7