6#include "../component_descriptor.hpp"
7#include "../datatypes/mat3x3.hpp"
8#include "../result.hpp"
41 : image_from_camera(image_from_camera_) {}
44 image_from_camera = image_from_camera_;
48 PinholeProjection(std::array<float, 9> flat_columns_) : image_from_camera(flat_columns_) {}
50 PinholeProjection& operator=(std::array<float, 9> flat_columns_) {
51 image_from_camera = flat_columns_;
57 return image_from_camera;
67 struct Loggable<components::PinholeProjection> {
68 static constexpr ComponentDescriptor Descriptor =
"rerun.components.PinholeProjection";
71 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
72 return Loggable<rerun::datatypes::Mat3x3>::arrow_datatype();
76 static Result<std::shared_ptr<arrow::Array>> to_arrow(
77 const components::PinholeProjection* instances,
size_t num_instances
79 if (num_instances == 0) {
80 return Loggable<rerun::datatypes::Mat3x3>::to_arrow(
nullptr, 0);
81 }
else if (instances ==
nullptr) {
83 ErrorCode::UnexpectedNullArgument,
84 "Passed array instances is null when num_elements> 0."
87 return Loggable<rerun::datatypes::Mat3x3>::to_arrow(
88 &instances->image_from_camera,
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:95
All built-in components. See Types in the Rerun manual.
Definition rerun.hpp:80
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
Component: Camera projection, from image coordinates to view coordinates.
Definition pinhole_projection.hpp:26
static PinholeProjection from_mat3x3(const float *elements)
Construct a new 3x3 pinhole matrix from a pointer to 9 floats (in column major order).
Definition pinhole_projection.hpp:31
Datatype: A 3x3 Matrix.
Definition mat3x3.hpp:32