6#include "../../archetype_utils.hpp"
7#include "../../blueprint/components/background_kind.hpp"
8#include "../../collection.hpp"
9#include "../../component_batch.hpp"
10#include "../../component_column.hpp"
11#include "../../components/color.hpp"
12#include "../../result.hpp"
19namespace rerun::blueprint::archetypes {
26 std::optional<ComponentBatch>
kind;
29 std::optional<ComponentBatch>
color;
33 static constexpr const char ArchetypeName[] =
"rerun.blueprint.archetypes.Background";
52 explicit Background(rerun::blueprint::components::BackgroundKind _kind)
67 return std::move(*
this);
73 return std::move(*
this);
85 return detail::partition_batches({&
kind, &
color}, lengths_).value_or_throw();
93 return detail::partition_batches_of_unit_length({&
kind, &
color}).value_or_throw();
101 template <
typename T>
106 struct AsComponents<blueprint::archetypes::Background> {
111 return detail::collect_batches({&archetype.
kind, &archetype.
color});
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
A class for representing either a usable value, or an error.
Definition result.hpp:14
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:26
Arrow-encoded data of a single batch of components together with a component descriptor.
Definition component_batch.hpp:28
static Result< ComponentBatch > from_loggable(const rerun::Collection< T > &components, const ComponentDescriptor &descriptor)
Creates a new component batch from a collection of component instances.
Definition component_batch.hpp:46
A ComponentDescriptor fully describes the semantics of a column of data.
Definition component_descriptor.hpp:16
The Loggable trait is used by all built-in implementation of rerun::AsComponents to serialize a colle...
Definition loggable.hpp:11
Archetype: Configuration for the background of a spatial view.
Definition background.hpp:24
Background with_kind(const rerun::blueprint::components::BackgroundKind &_kind) &&
The type of the background.
Definition background.hpp:65
Background with_color(const rerun::components::Color &_color) &&
Color used for the solid background type.
Definition background.hpp:71
static constexpr auto Descriptor_color
ComponentDescriptor for the color field.
Definition background.hpp:41
static Background clear_fields()
Clear all the fields of a Background.
static constexpr auto Descriptor_kind
ComponentDescriptor for the kind field.
Definition background.hpp:36
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
Definition background.hpp:84
std::optional< ComponentBatch > kind
The type of the background.
Definition background.hpp:26
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
Definition background.hpp:92
static Background update_fields()
Update only some specific fields of a Background.
Definition background.hpp:57
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition background.hpp:33
std::optional< ComponentBatch > color
Color used for the solid background type.
Definition background.hpp:29
Component: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition color.hpp:17