Rerun C++ SDK
Loading...
Searching...
No Matches
aggregation_policy.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/aggregation_policy.def.rs".
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**: Policy for aggregation of multiple scalar plot values.
24 ///
25 /// This is used for lines in plots when the X axis distance of individual points goes below a single pixel,
26 /// i.e. a single pixel covers more than one tick worth of data. It can greatly improve performance
27 /// (and readability) in such situations as it prevents overdraw.
28 enum class AggregationPolicy : uint8_t {
29
30 /// No aggregation.
31 Off = 1,
32
33 /// Average all points in the range together.
34 ///
35 /// This can wash out outliers (spikes).
36 Average = 2,
37
38 /// Keep only the maximum values in the range.
39 Max = 3,
40
41 /// Keep only the minimum values in the range.
42 Min = 4,
43
44 /// Keep both the minimum and maximum values in the range.
45 ///
46 /// This will yield two aggregated points instead of one, effectively creating a vertical line.
47 /// In practice this often leads to a rather ugly zig-zag look.
48 MinMax = 5,
49
50 /// Find both the minimum and maximum values in the range, then use the average of those.
51 ///
52 /// This yields a single point per range, so it does not draw a vertical line per pixel,
53 /// while still letting a lone outlier move the plotted value, which averaging all the
54 /// points in the range would wash out.
55 MinMaxAverage = 6,
56 };
57} // namespace rerun::components
58
59namespace rerun {
60 template <typename T>
61 struct Loggable;
62
63 /// \private
64 template <>
65 struct Loggable<components::AggregationPolicy> {
66 static constexpr std::string_view ComponentType = "rerun.components.AggregationPolicy";
67
68 /// Returns the arrow data type this type corresponds to.
69 static const std::shared_ptr<arrow::DataType>& arrow_data_type();
70
71 /// Serializes an array of `rerun::components::AggregationPolicy` into an arrow array.
72 static Result<std::shared_ptr<arrow::Array>> to_arrow(
73 const components::AggregationPolicy* instances, size_t num_instances
74 );
75
76 /// Fills an arrow array builder with an array of this type.
77 static rerun::Error fill_arrow_array_builder(
78 arrow::UInt8Builder* builder, const components::AggregationPolicy* elements,
79 size_t num_elements
80 );
81 };
82} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:104
All built-in components. See Types in the Rerun manual.
Definition rerun.hpp:93
AggregationPolicy
Component: Policy for aggregation of multiple scalar plot values.
Definition aggregation_policy.hpp:28
@ MinMaxAverage
Find both the minimum and maximum values in the range, then use the average of those.
@ Max
Keep only the maximum values in the range.
@ Min
Keep only the minimum values in the range.
@ Average
Average all points in the range together.
@ MinMax
Keep both the minimum and maximum values in the range.
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:26