Rerun C++ SDK
Loading...
Searching...
No Matches
spherical_harmonics3rgb.hpp
1// DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/cpp/mod.rs
2// Based on "crates/build/re_type_definitions/rerun/components/spherical_harmonics3rgb.def.rs".
3
4#pragma once
5
6#include "../datatypes/spherical_harmonics3rgb.hpp"
7#include "../half.hpp"
8#include "../result.hpp"
9
10#include <array>
11#include <cstdint>
12#include <memory>
13
14namespace rerun::components {
15 /// **Component**: View-dependent color, expressed as spherical harmonics coefficients of degrees 1 through 3.
16 ///
17 /// The view-independent (degree-0) base color is represented as a separate `components::Color`.
18 ///
19 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
20 ///
23
24 public:
25 SphericalHarmonics3Rgb() = default;
26
28 : coefficients(coefficients_) {}
29
31 coefficients = coefficients_;
32 return *this;
33 }
34
35 SphericalHarmonics3Rgb(std::array<std::array<rerun::half, 3>, 15> coefficients_)
36 : coefficients(coefficients_) {}
37
38 SphericalHarmonics3Rgb& operator=(std::array<std::array<rerun::half, 3>, 15> coefficients_
39 ) {
40 coefficients = coefficients_;
41 return *this;
42 }
43
44 /// Cast to the underlying SphericalHarmonics3Rgb datatype
46 return coefficients;
47 }
48 };
49} // namespace rerun::components
50
51namespace rerun {
52 static_assert(
54 sizeof(components::SphericalHarmonics3Rgb)
55 );
56
57 /// \private
58 template <>
59 struct Loggable<components::SphericalHarmonics3Rgb> {
60 static constexpr std::string_view ComponentType = "rerun.components.SphericalHarmonics3Rgb";
61
62 /// Returns the arrow data type this type corresponds to.
63 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
64 return Loggable<rerun::datatypes::SphericalHarmonics3Rgb>::arrow_datatype();
65 }
66
67 /// Serializes an array of `rerun::components::SphericalHarmonics3Rgb` into an arrow array.
68 static Result<std::shared_ptr<arrow::Array>> to_arrow(
69 const components::SphericalHarmonics3Rgb* instances, size_t num_instances
70 ) {
71 if (num_instances == 0) {
72 return Loggable<rerun::datatypes::SphericalHarmonics3Rgb>::to_arrow(nullptr, 0);
73 } else if (instances == nullptr) {
74 return rerun::Error(
75 ErrorCode::UnexpectedNullArgument,
76 "Passed array instances is null when num_elements> 0."
77 );
78 } else {
79 return Loggable<rerun::datatypes::SphericalHarmonics3Rgb>::to_arrow(
80 &instances->coefficients,
81 num_instances
82 );
83 }
84 }
85 };
86} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:103
All built-in components. 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:23
Component: View-dependent color, expressed as spherical harmonics coefficients of degrees 1 through 3...
Definition spherical_harmonics3rgb.hpp:21
Datatype: Spherical harmonics coefficients of degrees 1 through 3 for RGB, as 15 half-precision RGB t...
Definition spherical_harmonics3rgb.hpp:43