6#include "../result.hpp"
19 using UInt32Builder = NumericBuilder<UInt32Type>;
32 Rgba32(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255)
33 :
Rgba32(static_cast<uint32_t>((r << 24) | (g << 16) | (b << 8) | a)) {}
36 Rgba32(
const uint8_t (&_rgba)[4]) :
Rgba32(_rgba[0], _rgba[1], _rgba[2], _rgba[3]) {}
39 Rgba32(
const uint8_t (&_rgb)[3]) :
Rgba32(_rgb[0], _rgb[1], _rgb[2]) {}
42 return static_cast<uint8_t
>((rgba >> 24) & 0xFF);
46 return static_cast<uint8_t
>((rgba >> 16) & 0xFF);
50 return static_cast<uint8_t
>((rgba >> 8) & 0xFF);
54 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();
84 static Result<std::shared_ptr<arrow::Array>> to_arrow(
85 const datatypes::Rgba32* instances,
size_t num_instances
90 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:82
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22
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:39
Rgba32(uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Construct Rgba32 from unmultiplied RGBA values.
Definition rgba32.hpp:32
Rgba32(const uint8_t(&_rgba)[4])
Construct Rgba32 from unmultiplied RGBA values.
Definition rgba32.hpp:36