Rerun C++ SDK
Loading...
Searching...
No Matches
tensor_scalar_mapping.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/store/re_types/definitions/rerun/blueprint/archetypes/tensor_scalar_mapping.fbs".
3
4#pragma once
5
6#include "../../collection.hpp"
7#include "../../compiler_utils.hpp"
8#include "../../component_batch.hpp"
9#include "../../components/colormap.hpp"
10#include "../../components/gamma_correction.hpp"
11#include "../../components/magnification_filter.hpp"
12#include "../../indicator_component.hpp"
13#include "../../result.hpp"
14
15#include <cstdint>
16#include <optional>
17#include <utility>
18#include <vector>
19
20namespace rerun::blueprint::archetypes {
21 /// **Archetype**: Configures how tensor scalars are mapped to color.
23 /// Filter used when zooming in on the tensor.
24 ///
25 /// Note that the filter is applied to the scalar values *before* they are mapped to color.
26 std::optional<rerun::components::MagnificationFilter> mag_filter;
27
28 /// How scalar values map to colors.
29 std::optional<rerun::components::Colormap> colormap;
30
31 /// Gamma exponent applied to normalized values before mapping to color.
32 ///
33 /// Raises the normalized values to the power of this value before mapping to color.
34 /// Acts like an inverse brightness. Defaults to 1.0.
35 ///
36 /// The final value for display is set as:
37 /// `colormap( ((value - data_display_range.min) / (data_display_range.max - data_display_range.min)) ** gamma )`
38 std::optional<rerun::components::GammaCorrection> gamma;
39
40 public:
41 static constexpr const char IndicatorComponentName[] =
42 "rerun.blueprint.components.TensorScalarMappingIndicator";
43
44 /// Indicator component, used to identify the archetype when converting to a list of components.
46
47 public:
48 TensorScalarMapping() = default;
50
51 /// Filter used when zooming in on the tensor.
52 ///
53 /// Note that the filter is applied to the scalar values *before* they are mapped to color.
55 mag_filter = std::move(_mag_filter);
56 // See: https://github.com/rerun-io/rerun/issues/4027
57 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
58 }
59
60 /// How scalar values map to colors.
62 colormap = std::move(_colormap);
63 // See: https://github.com/rerun-io/rerun/issues/4027
64 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
65 }
66
67 /// Gamma exponent applied to normalized values before mapping to color.
68 ///
69 /// Raises the normalized values to the power of this value before mapping to color.
70 /// Acts like an inverse brightness. Defaults to 1.0.
71 ///
72 /// The final value for display is set as:
73 /// `colormap( ((value - data_display_range.min) / (data_display_range.max - data_display_range.min)) ** gamma )`
75 gamma = std::move(_gamma);
76 // See: https://github.com/rerun-io/rerun/issues/4027
77 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
78 }
79 };
80
81} // namespace rerun::blueprint::archetypes
82
83namespace rerun {
84 /// \private
85 template <typename T>
86 struct AsComponents;
87
88 /// \private
89 template <>
90 struct AsComponents<blueprint::archetypes::TensorScalarMapping> {
91 /// Serialize all set component batches.
92 static Result<std::vector<ComponentBatch>> serialize(
94 );
95 };
96} // namespace rerun
A class for representing either a usable value, or an error.
Definition result.hpp:14
Colormap
Component: Colormap for mapping scalar values within a given range to a color.
Definition colormap.hpp:28
MagnificationFilter
Component: Filter used when magnifying an image/texture such that a single pixel/texel is displayed a...
Definition magnification_filter.hpp:24
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22
Archetype: Configures how tensor scalars are mapped to color.
Definition tensor_scalar_mapping.hpp:22
std::optional< rerun::components::Colormap > colormap
How scalar values map to colors.
Definition tensor_scalar_mapping.hpp:29
TensorScalarMapping with_gamma(rerun::components::GammaCorrection _gamma) &&
Gamma exponent applied to normalized values before mapping to color.
Definition tensor_scalar_mapping.hpp:74
TensorScalarMapping with_colormap(rerun::components::Colormap _colormap) &&
How scalar values map to colors.
Definition tensor_scalar_mapping.hpp:61
TensorScalarMapping with_mag_filter(rerun::components::MagnificationFilter _mag_filter) &&
Filter used when zooming in on the tensor.
Definition tensor_scalar_mapping.hpp:54
std::optional< rerun::components::GammaCorrection > gamma
Gamma exponent applied to normalized values before mapping to color.
Definition tensor_scalar_mapping.hpp:38
std::optional< rerun::components::MagnificationFilter > mag_filter
Filter used when zooming in on the tensor.
Definition tensor_scalar_mapping.hpp:26
Component: A gamma correction value to be used with a scalar value or color.
Definition gamma_correction.hpp:20
Indicator component used by archetypes when converting them to component lists.
Definition indicator_component.hpp:30