6#include "../datatypes/rgba32.hpp"
7#include "../result.hpp"
22 Color(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255) : rgba(r, g, b, a) {}
52 Color(uint32_t rgba_) : rgba(rgba_) {}
54 Color& operator=(uint32_t rgba_) {
71 struct Loggable<components::Color> {
72 static constexpr const char Name[] =
"rerun.components.Color";
75 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
76 return Loggable<rerun::datatypes::Rgba32>::arrow_datatype();
80 static Result<std::shared_ptr<arrow::Array>> to_arrow(
81 const components::Color* instances,
size_t num_instances
83 if (num_instances == 0) {
84 return Loggable<rerun::datatypes::Rgba32>::to_arrow(
nullptr, 0);
85 }
else if (instances ==
nullptr) {
87 ErrorCode::UnexpectedNullArgument,
88 "Passed array instances is null when num_elements> 0."
91 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:79
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22
Component: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition color.hpp:17
Color(uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Construct Color from unmultiplied RGBA values.
Definition color.hpp:22
Datatype: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition rgba32.hpp:27