6#include "../archetype_utils.hpp"
7#include "../collection.hpp"
8#include "../component_batch.hpp"
9#include "../component_column.hpp"
10#include "../components/color.hpp"
11#include "../components/position3d.hpp"
12#include "../components/rotation_quat.hpp"
13#include "../components/scale3d.hpp"
14#include "../components/spherical_harmonics3rgb.hpp"
15#include "../components/spherical_harmonics_degree.hpp"
16#include "../result.hpp"
129 static constexpr const char ArchetypeName[] =
"rerun.archetypes.GaussianSplats3D";
158 ArchetypeName,
"GaussianSplats3D:spherical_harmonics_degree",
171 .value_or_throw()) {}
185 return std::move(*
this);
191 return std::move(*
this);
200 return std::move(*
this);
209 return std::move(*
this);
219 return std::move(*
this);
230 _spherical_harmonics_degree,
234 return std::move(*
this);
243 _spherical_harmonics_degree
246 _spherical_harmonics_degree,
250 return std::move(*
this);
262 return detail::partition_batches(
279 return detail::partition_batches_of_unit_length({&
centers,
293 template <
typename T>
298 struct AsComponents<archetypes::GaussianSplats3D> {
300 static Result<Collection<ComponentBatch>> as_batches(
301 const archetypes::GaussianSplats3D& archetype
303 return detail::collect_batches(
306 &archetype.quaternions,
308 &archetype.sh_coefficients,
309 &archetype.spherical_harmonics_degree}
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
All built-in archetypes. See Types in the Rerun manual.
Definition rerun.hpp:90
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: 3D gaussian splats, e.g.
Definition gaussian_splats3d.hpp:102
GaussianSplats3D with_centers(const Collection< rerun::components::Position3D > &_centers) &&
The centers (means) of the gaussians.
Definition gaussian_splats3d.hpp:182
static GaussianSplats3D update_fields()
Update only some specific fields of a GaussianSplats3D.
Definition gaussian_splats3d.hpp:174
std::optional< ComponentBatch > centers
The centers (means) of the gaussians.
Definition gaussian_splats3d.hpp:104
std::optional< ComponentBatch > colors
The base colors and opacities of the gaussians.
Definition gaussian_splats3d.hpp:116
std::optional< ComponentBatch > sh_coefficients
Higher-order spherical harmonics coefficients for view-dependent color.
Definition gaussian_splats3d.hpp:119
GaussianSplats3D with_colors(const Collection< rerun::components::Color > &_colors) &&
The base colors and opacities of the gaussians.
Definition gaussian_splats3d.hpp:207
std::optional< ComponentBatch > spherical_harmonics_degree
The highest spherical harmonics degree to evaluate when rendering, 0-3.
Definition gaussian_splats3d.hpp:125
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition gaussian_splats3d.hpp:129
static constexpr auto Descriptor_sh_coefficients
ComponentDescriptor for the sh_coefficients field.
Definition gaussian_splats3d.hpp:152
std::optional< ComponentBatch > scales
Per-axis standard deviations of the gaussians, in scene units.
Definition gaussian_splats3d.hpp:107
GaussianSplats3D with_spherical_harmonics_degree(const rerun::components::SphericalHarmonicsDegree &_spherical_harmonics_degree) &&
The highest spherical harmonics degree to evaluate when rendering, 0-3.
Definition gaussian_splats3d.hpp:226
static constexpr auto Descriptor_colors
ComponentDescriptor for the colors field.
Definition gaussian_splats3d.hpp:147
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
Definition gaussian_splats3d.hpp:278
static constexpr auto Descriptor_quaternions
ComponentDescriptor for the quaternions field.
Definition gaussian_splats3d.hpp:142
static constexpr auto Descriptor_spherical_harmonics_degree
ComponentDescriptor for the spherical_harmonics_degree field.
Definition gaussian_splats3d.hpp:157
GaussianSplats3D with_sh_coefficients(const Collection< rerun::components::SphericalHarmonics3Rgb > &_sh_coefficients) &&
Higher-order spherical harmonics coefficients for view-dependent color.
Definition gaussian_splats3d.hpp:213
GaussianSplats3D with_scales(const Collection< rerun::components::Scale3D > &_scales) &&
Per-axis standard deviations of the gaussians, in scene units.
Definition gaussian_splats3d.hpp:189
static GaussianSplats3D clear_fields()
Clear all the fields of a GaussianSplats3D.
static constexpr auto Descriptor_centers
ComponentDescriptor for the centers field.
Definition gaussian_splats3d.hpp:132
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
Definition gaussian_splats3d.hpp:261
GaussianSplats3D with_many_spherical_harmonics_degree(const Collection< rerun::components::SphericalHarmonicsDegree > &_spherical_harmonics_degree) &&
This method makes it possible to pack multiple spherical_harmonics_degree in a single component batch...
Definition gaussian_splats3d.hpp:241
static constexpr auto Descriptor_scales
ComponentDescriptor for the scales field.
Definition gaussian_splats3d.hpp:137
GaussianSplats3D with_quaternions(const Collection< rerun::components::RotationQuat > &_quaternions) &&
The orientations of the gaussians.
Definition gaussian_splats3d.hpp:195
std::optional< ComponentBatch > quaternions
The orientations of the gaussians.
Definition gaussian_splats3d.hpp:110
Component: The highest spherical harmonics degree to evaluate when rendering, 0-3.
Definition spherical_harmonics_degree.hpp:26