Rerun C++ SDK
Loading...
Searching...
No Matches
pinhole_projection.hpp
1// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/cpp/mod.rs
2// Based on "crates/re_types/definitions/rerun/components/pinhole_projection.fbs".
3
4#pragma once
5
6#include "../datatypes/mat3x3.hpp"
7#include "../result.hpp"
8
9#include <array>
10#include <cstdint>
11#include <memory>
12
13namespace arrow {
14 class Array;
15 class DataType;
16 class FixedSizeListBuilder;
17} // namespace arrow
18
19namespace rerun::components {
20 /// **Component**: Camera projection, from image coordinates to view coordinates.
21 ///
22 /// Child from parent.
23 /// Image coordinates from camera view coordinates.
24 ///
25 /// Example:
26 /// ```text
27 /// 1496.1 0.0 980.5
28 /// 0.0 1496.1 744.5
29 /// 0.0 0.0 1.0
30 /// ```
32 rerun::datatypes::Mat3x3 image_from_camera;
33
34 public:
35 // Extensions to generated type defined in 'pinhole_projection_ext.cpp'
36
37 /// Construct a new 3x3 pinhole matrix from a pointer to 9 floats (in row major order).
38 static PinholeProjection from_mat3x3(const float* elements) {
40 }
41
42 public:
43 PinholeProjection() = default;
44
46 : image_from_camera(image_from_camera_) {}
47
48 PinholeProjection& operator=(rerun::datatypes::Mat3x3 image_from_camera_) {
49 image_from_camera = image_from_camera_;
50 return *this;
51 }
52
53 PinholeProjection(std::array<float, 9> flat_columns_) : image_from_camera(flat_columns_) {}
54
55 PinholeProjection& operator=(std::array<float, 9> flat_columns_) {
56 image_from_camera = flat_columns_;
57 return *this;
58 }
59
60 /// Cast to the underlying Mat3x3 datatype
61 operator rerun::datatypes::Mat3x3() const {
62 return image_from_camera;
63 }
64 };
65} // namespace rerun::components
66
67namespace rerun {
68 template <typename T>
69 struct Loggable;
70
71 /// \private
72 template <>
73 struct Loggable<components::PinholeProjection> {
74 static constexpr const char Name[] = "rerun.components.PinholeProjection";
75
76 /// Returns the arrow data type this type corresponds to.
77 static const std::shared_ptr<arrow::DataType>& arrow_datatype();
78
79 /// Fills an arrow array builder with an array of this type.
80 static rerun::Error fill_arrow_array_builder(
81 arrow::FixedSizeListBuilder* builder, const components::PinholeProjection* elements,
82 size_t num_elements
83 );
84
85 /// Serializes an array of `rerun::components::PinholeProjection` into an arrow array.
86 static Result<std::shared_ptr<arrow::Array>> to_arrow(
87 const components::PinholeProjection* instances, size_t num_instances
88 );
89 };
90} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:87
All built-in components. See Types in the Rerun manual.
Definition rerun.hpp:69
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:20
Component: Camera projection, from image coordinates to view coordinates.
Definition pinhole_projection.hpp:31
static PinholeProjection from_mat3x3(const float *elements)
Construct a new 3x3 pinhole matrix from a pointer to 9 floats (in row major order).
Definition pinhole_projection.hpp:38
Datatype: A 3x3 Matrix.
Definition mat3x3.hpp:30