Rerun C++ SDK
Loading...
Searching...
No Matches
colormap.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/components/colormap.fbs".
3
4#pragma once
5
6#include "../component_descriptor.hpp"
7#include "../result.hpp"
8
9#include <cstdint>
10#include <memory>
11
12namespace arrow {
13 /// \private
14 template <typename T>
15 class NumericBuilder;
16
17 class Array;
18 class DataType;
19 class UInt8Type;
20 using UInt8Builder = NumericBuilder<UInt8Type>;
21} // namespace arrow
22
23namespace rerun::components {
24 /// **Component**: Colormap for mapping scalar values within a given range to a color.
25 ///
26 /// This provides a number of popular pre-defined colormaps.
27 /// In the future, the Rerun Viewer will allow users to define their own colormaps,
28 /// but currently the Viewer is limited to the types defined here.
29 enum class Colormap : uint8_t {
30
31 /// A simple black to white gradient.
32 ///
33 /// This is a sRGB gray gradient which is perceptually uniform.
34 Grayscale = 1,
35
36 /// The Inferno colormap from Matplotlib.
37 ///
38 /// This is a perceptually uniform colormap.
39 /// It interpolates from black to red to bright yellow.
40 Inferno = 2,
41
42 /// The Magma colormap from Matplotlib.
43 ///
44 /// This is a perceptually uniform colormap.
45 /// It interpolates from black to purple to white.
46 Magma = 3,
47
48 /// The Plasma colormap from Matplotlib.
49 ///
50 /// This is a perceptually uniform colormap.
51 /// It interpolates from dark blue to purple to yellow.
52 Plasma = 4,
53
54 /// Google's Turbo colormap map.
55 ///
56 /// This is a perceptually non-uniform rainbow colormap addressing many issues of
57 /// more traditional rainbow colormaps like Jet.
58 /// It is more perceptually uniform without sharp transitions and is more colorblind-friendly.
59 /// Details: <https://research.google/blog/turbo-an-improved-rainbow-colormap-for-visualization/>
60 Turbo = 5,
61
62 /// The Viridis colormap from Matplotlib
63 ///
64 /// This is a perceptually uniform colormap which is robust to color blindness.
65 /// It interpolates from dark purple to green to yellow.
66 Viridis = 6,
67
68 /// Rasmusgo's Cyan to Yellow colormap
69 ///
70 /// This is a perceptually uniform colormap which is robust to color blindness.
71 /// It is especially suited for visualizing signed values.
72 /// It interpolates from cyan to blue to dark gray to brass to yellow.
73 CyanToYellow = 7,
74 };
75} // namespace rerun::components
76
77namespace rerun {
78 template <typename T>
79 struct Loggable;
80
81 /// \private
82 template <>
83 struct Loggable<components::Colormap> {
84 static constexpr ComponentDescriptor Descriptor = "rerun.components.Colormap";
85
86 /// Returns the arrow data type this type corresponds to.
87 static const std::shared_ptr<arrow::DataType>& arrow_datatype();
88
89 /// Serializes an array of `rerun::components::Colormap` into an arrow array.
90 static Result<std::shared_ptr<arrow::Array>> to_arrow(
91 const components::Colormap* instances, size_t num_instances
92 );
93
94 /// Fills an arrow array builder with an array of this type.
95 static rerun::Error fill_arrow_array_builder(
96 arrow::UInt8Builder* builder, const components::Colormap* elements, size_t num_elements
97 );
98 };
99} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:95
All built-in components. See Types in the Rerun manual.
Definition rerun.hpp:80
Colormap
Component: Colormap for mapping scalar values within a given range to a color.
Definition colormap.hpp:29
@ Magma
The Magma colormap from Matplotlib.
@ Turbo
Google's Turbo colormap map.
@ Inferno
The Inferno colormap from Matplotlib.
@ Viridis
The Viridis colormap from Matplotlib.
@ Plasma
The Plasma colormap from Matplotlib.
@ Grayscale
A simple black to white gradient.
@ CyanToYellow
Rasmusgo's Cyan to Yellow colormap.
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23