Rerun C++ SDK
Loading...
Searching...
No Matches
image_plane_distance.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/image_plane_distance.fbs".
3
4#pragma once
5
6#include "../datatypes/float32.hpp"
7#include "../result.hpp"
8
9#include <cstdint>
10#include <memory>
11
12namespace rerun::components {
13 /// **Component**: The distance from the camera origin to the image plane when the projection is shown in a 3D viewer.
14 ///
15 /// This is only used for visualization purposes, and does not affect the projection itself.
17 rerun::datatypes::Float32 image_from_camera;
18
19 public:
20 ImagePlaneDistance() = default;
21
23 : image_from_camera(image_from_camera_) {}
24
25 ImagePlaneDistance& operator=(rerun::datatypes::Float32 image_from_camera_) {
26 image_from_camera = image_from_camera_;
27 return *this;
28 }
29
30 ImagePlaneDistance(float value_) : image_from_camera(value_) {}
31
32 ImagePlaneDistance& operator=(float value_) {
33 image_from_camera = value_;
34 return *this;
35 }
36
37 /// Cast to the underlying Float32 datatype
38 operator rerun::datatypes::Float32() const {
39 return image_from_camera;
40 }
41 };
42} // namespace rerun::components
43
44namespace rerun {
45 static_assert(sizeof(rerun::datatypes::Float32) == sizeof(components::ImagePlaneDistance));
46
47 /// \private
48 template <>
49 struct Loggable<components::ImagePlaneDistance> {
50 static constexpr const char Name[] = "rerun.components.ImagePlaneDistance";
51
52 /// Returns the arrow data type this type corresponds to.
53 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
54 return Loggable<rerun::datatypes::Float32>::arrow_datatype();
55 }
56
57 /// Serializes an array of `rerun::components::ImagePlaneDistance` into an arrow array.
58 static Result<std::shared_ptr<arrow::Array>> to_arrow(
59 const components::ImagePlaneDistance* instances, size_t num_instances
60 ) {
61 return Loggable<rerun::datatypes::Float32>::to_arrow(
62 &instances->image_from_camera,
63 num_instances
64 );
65 }
66 };
67} // namespace rerun
All built-in components. See Types in the Rerun manual.
Definition rerun.hpp:75
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22
Component: The distance from the camera origin to the image plane when the projection is shown in a 3...
Definition image_plane_distance.hpp:16
Datatype: A single-precision 32-bit IEEE 754 floating point number.
Definition float32.hpp:24