6#include "../result.hpp"
19 using UInt32Builder = NumericBuilder<UInt32Type>;
34 Rgba32(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255)
35 :
Rgba32(static_cast<uint32_t>((r << 24) | (g << 16) | (b << 8) | a)) {}
38 Rgba32(
const uint8_t (&_rgba)[4]) :
Rgba32(_rgba[0], _rgba[1], _rgba[2], _rgba[3]) {}
41 Rgba32(
const uint8_t (&_rgb)[3]) :
Rgba32(_rgb[0], _rgb[1], _rgb[2]) {}
44 return static_cast<uint8_t
>((rgba >> 24) & 0xFF);
48 return static_cast<uint8_t
>((rgba >> 16) & 0xFF);
52 return static_cast<uint8_t
>((rgba >> 8) & 0xFF);
56 return static_cast<uint8_t
>(rgba & 0xFF);
62 Rgba32(uint32_t rgba_) : rgba(rgba_) {}
64 Rgba32& operator=(uint32_t rgba_) {
77 struct Loggable<datatypes::Rgba32> {
78 static constexpr const char Name[] =
"rerun.datatypes.Rgba32";
81 static const std::shared_ptr<arrow::DataType>& arrow_datatype();
85 arrow::UInt32Builder* builder,
const datatypes::Rgba32* elements,
size_t num_elements
89 static Result<std::shared_ptr<arrow::Array>> to_arrow(
90 const datatypes::Rgba32* instances,
size_t num_instances
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:87
All built-in datatypes. See Types in the Rerun manual.
Definition rerun.hpp:72
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:20
Datatype: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition rgba32.hpp:27
Rgba32(const uint8_t(&_rgb)[3])
Construct Rgba32 from RGB values, setting alpha to 255.
Definition rgba32.hpp:41
Rgba32(uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Construct Rgba32 from unmultiplied RGBA values.
Definition rgba32.hpp:34
Rgba32(const uint8_t(&_rgba)[4])
Construct Rgba32 from unmultiplied RGBA values.
Definition rgba32.hpp:38