6#include "../component_descriptor.hpp"
7#include "../result.hpp"
20 using UInt32Builder = NumericBuilder<UInt32Type>;
33 Rgba32(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255)
34 :
Rgba32(static_cast<uint32_t>((r << 24) | (g << 16) | (b << 8) | a)) {}
37 Rgba32(
const uint8_t (&_rgba)[4]) :
Rgba32(_rgba[0], _rgba[1], _rgba[2], _rgba[3]) {}
40 Rgba32(
const uint8_t (&_rgb)[3]) :
Rgba32(_rgb[0], _rgb[1], _rgb[2]) {}
43 return static_cast<uint8_t
>((rgba >> 24) & 0xFF);
47 return static_cast<uint8_t
>((rgba >> 16) & 0xFF);
51 return static_cast<uint8_t
>((rgba >> 8) & 0xFF);
55 return static_cast<uint8_t
>(rgba & 0xFF);
63 Rgba32(uint32_t rgba_) : rgba(rgba_) {}
65 Rgba32& operator=(uint32_t rgba_) {
78 struct Loggable<datatypes::Rgba32> {
79 static constexpr ComponentDescriptor Descriptor =
"rerun.datatypes.Rgba32";
82 static const std::shared_ptr<arrow::DataType>& arrow_datatype();
85 static Result<std::shared_ptr<arrow::Array>> to_arrow(
86 const datatypes::Rgba32* instances,
size_t num_instances
91 arrow::UInt32Builder* builder,
const datatypes::Rgba32* elements,
size_t num_elements
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
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
Datatype: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition rgba32.hpp:28
Rgba32(const uint8_t(&_rgb)[3])
Construct Rgba32 from RGB values, setting alpha to 255.
Definition rgba32.hpp:40
Rgba32(uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Construct Rgba32 from unmultiplied RGBA values.
Definition rgba32.hpp:33
Rgba32(const uint8_t(&_rgba)[4])
Construct Rgba32 from unmultiplied RGBA values.
Definition rgba32.hpp:37