Rerun C++ SDK
Loading...
Searching...
No Matches
spherical_harmonics_degree.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_harmonics_degree.def.rs".
3
4#pragma once
5
6#include "../datatypes/uint32.hpp"
7#include "../result.hpp"
8
9#include <cstdint>
10#include <memory>
11
12namespace rerun::components {
13 /// **Component**: The highest spherical harmonics degree to evaluate when rendering, 0-3.
14 ///
15 /// `0` renders the view-independent base color only, and is the fastest.
16 /// Each higher degree brings in more view-dependent detail, at the cost of fetching and
17 /// evaluating more coefficients (`components::SphericalHarmonics3Rgb`):
18 /// 3 of them for degree 1, 8 for degree 2, and all 15 for degree 3.
19 ///
20 /// Lowering this in the blueprint can make the rendering a lot faster.
21 ///
22 /// Defaults to 3, i.e. every coefficient the data has.
23 ///
24 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
25 ///
28
29 public:
30 SphericalHarmonicsDegree() = default;
31
32 SphericalHarmonicsDegree(rerun::datatypes::UInt32 degree_) : degree(degree_) {}
33
35 degree = degree_;
36 return *this;
37 }
38
39 SphericalHarmonicsDegree(uint32_t value_) : degree(value_) {}
40
41 SphericalHarmonicsDegree& operator=(uint32_t value_) {
42 degree = value_;
43 return *this;
44 }
45
46 /// Cast to the underlying UInt32 datatype
47 operator rerun::datatypes::UInt32() const {
48 return degree;
49 }
50 };
51} // namespace rerun::components
52
53namespace rerun {
54 static_assert(sizeof(rerun::datatypes::UInt32) == sizeof(components::SphericalHarmonicsDegree));
55
56 /// \private
57 template <>
58 struct Loggable<components::SphericalHarmonicsDegree> {
59 static constexpr std::string_view ComponentType =
60 "rerun.components.SphericalHarmonicsDegree";
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::UInt32>::arrow_datatype();
65 }
66
67 /// Serializes an array of `rerun::components::SphericalHarmonicsDegree` into an arrow array.
68 static Result<std::shared_ptr<arrow::Array>> to_arrow(
69 const components::SphericalHarmonicsDegree* instances, size_t num_instances
70 ) {
71 if (num_instances == 0) {
72 return Loggable<rerun::datatypes::UInt32>::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::UInt32>::to_arrow(
80 &instances->degree,
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: The highest spherical harmonics degree to evaluate when rendering, 0-3.
Definition spherical_harmonics_degree.hpp:26
Datatype: A 32bit unsigned integer.
Definition uint32.hpp:24