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