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