Rerun C++ SDK
Loading...
Searching...
No Matches
annotation_info.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/datatypes/annotation_info.fbs".
3
4#pragma once
5
6#include "../component_descriptor.hpp"
7#include "../result.hpp"
8#include "rgba32.hpp"
9#include "utf8.hpp"
10
11#include <cstdint>
12#include <memory>
13#include <optional>
14
15namespace arrow {
16 class Array;
17 class DataType;
18 class StructBuilder;
19} // namespace arrow
20
21namespace rerun::datatypes {
22 /// **Datatype**: Annotation info annotating a class id or key-point id.
23 ///
24 /// Color and label will be used to annotate entities/keypoints which reference the id.
25 /// The id refers either to a class or key-point id
27 /// `datatypes::ClassId` or `datatypes::KeypointId` to which this annotation info belongs.
28 uint16_t id;
29
30 /// The label that will be shown in the UI.
31 std::optional<rerun::datatypes::Utf8> label;
32
33 /// The color that will be applied to the annotated entity.
34 std::optional<rerun::datatypes::Rgba32> color;
35
36 public: // START of extensions from annotation_info_ext.cpp:
38 uint16_t _id, std::optional<std::string> _label = std::nullopt,
39 std::optional<datatypes::Rgba32> _color = std::nullopt
40 )
41 : id(_id), label(std::move(_label)), color(_color) {}
42
43 AnnotationInfo(uint16_t _id, datatypes::Rgba32 _color)
44 : id(_id), label(std::nullopt), color(_color) {}
45
46 // END of extensions from annotation_info_ext.cpp, start of generated code:
47
48 public:
49 AnnotationInfo() = default;
50 };
51} // namespace rerun::datatypes
52
53namespace rerun {
54 template <typename T>
55 struct Loggable;
56
57 /// \private
58 template <>
59 struct Loggable<datatypes::AnnotationInfo> {
60 static constexpr ComponentDescriptor Descriptor = "rerun.datatypes.AnnotationInfo";
61
62 /// Returns the arrow data type this type corresponds to.
63 static const std::shared_ptr<arrow::DataType>& arrow_datatype();
64
65 /// Serializes an array of `rerun::datatypes::AnnotationInfo` into an arrow array.
66 static Result<std::shared_ptr<arrow::Array>> to_arrow(
67 const datatypes::AnnotationInfo* instances, size_t num_instances
68 );
69
70 /// Fills an arrow array builder with an array of this type.
71 static rerun::Error fill_arrow_array_builder(
72 arrow::StructBuilder* builder, const datatypes::AnnotationInfo* elements,
73 size_t num_elements
74 );
75 };
76} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:95
All built-in datatypes. See Types in the Rerun manual.
Definition rerun.hpp:83
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
Datatype: Annotation info annotating a class id or key-point id.
Definition annotation_info.hpp:26
uint16_t id
datatypes::ClassId or datatypes::KeypointId to which this annotation info belongs.
Definition annotation_info.hpp:28
std::optional< rerun::datatypes::Rgba32 > color
The color that will be applied to the annotated entity.
Definition annotation_info.hpp:34
std::optional< rerun::datatypes::Utf8 > label
The label that will be shown in the UI.
Definition annotation_info.hpp:31
Datatype: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition rgba32.hpp:28