6#include "../component_descriptor.hpp"
7#include "../datatypes/rgba32.hpp"
8#include "../result.hpp"
23 Color(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255) : rgba(r, g, b, a) {}
53 Color(uint32_t rgba_) : rgba(rgba_) {}
55 Color& operator=(uint32_t rgba_) {
72 struct Loggable<components::Color> {
73 static constexpr ComponentDescriptor Descriptor =
"rerun.components.Color";
76 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
77 return Loggable<rerun::datatypes::Rgba32>::arrow_datatype();
81 static Result<std::shared_ptr<arrow::Array>> to_arrow(
82 const components::Color* instances,
size_t num_instances
84 if (num_instances == 0) {
85 return Loggable<rerun::datatypes::Rgba32>::to_arrow(
nullptr, 0);
86 }
else if (instances ==
nullptr) {
88 ErrorCode::UnexpectedNullArgument,
89 "Passed array instances is null when num_elements> 0."
92 return Loggable<rerun::datatypes::Rgba32>::to_arrow(
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:95
All built-in components. See Types in the Rerun manual.
Definition rerun.hpp:80
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
Component: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition color.hpp:18
Color(uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Construct Color from unmultiplied RGBA values.
Definition color.hpp:23
Datatype: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition rgba32.hpp:28