Rerun C++ SDK
Loading...
Searching...
No Matches
pinhole.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_sdk_types/definitions/rerun/archetypes/pinhole.fbs".
3
4#pragma once
5
6#include "../collection.hpp"
7#include "../component_batch.hpp"
8#include "../component_column.hpp"
9#include "../components/color.hpp"
10#include "../components/image_plane_distance.hpp"
11#include "../components/pinhole_projection.hpp"
12#include "../components/radius.hpp"
13#include "../components/resolution.hpp"
14#include "../components/transform_frame_id.hpp"
15#include "../components/view_coordinates.hpp"
16#include "../result.hpp"
17
18#include <cmath>
19#include <cstdint>
20#include <limits>
21#include <optional>
22#include <utility>
23#include <vector>
24
25namespace rerun::archetypes {
26 /// **Archetype**: Camera perspective projection (a.k.a. intrinsics).
27 ///
28 /// If `archetypes::Transform3D` is logged for the same child/parent relationship (e.g. for the camera extrinsics), it takes precedence over `archetypes::Pinhole`.
29 ///
30 /// If you use named transform frames via the `child_frame` and `parent_frame` fields, you don't have to use `archetypes::CoordinateFrame`
31 /// as it is the case with other visualizations: for any entity with an `archetypes::Pinhole` the viewer will always visualize it
32 /// directly without needing a `archetypes::CoordinateFrame` to refer to the pinhole's child/parent frame.
33 ///
34 /// ## Examples
35 ///
36 /// ### Simple pinhole camera
37 /// ![image](https://static.rerun.io/pinhole_simple/9af9441a94bcd9fd54e1fea44fb0c59ff381a7f2/full.png)
38 ///
39 /// ```cpp
40 /// #include <rerun.hpp>
41 ///
42 /// #include <algorithm> // std::generate
43 /// #include <cstdlib> // std::rand
44 /// #include <vector>
45 ///
46 /// int main() {
47 /// const auto rec = rerun::RecordingStream("rerun_example_pinhole");
48 /// rec.spawn().exit_on_failure();
49 ///
50 /// rec.log("world/image", rerun::Pinhole::from_focal_length_and_resolution(3.0f, {3.0f, 3.0f}));
51 ///
52 /// std::vector<uint8_t> random_data(3 * 3 * 3);
53 /// std::generate(random_data.begin(), random_data.end(), [] {
54 /// return static_cast<uint8_t>(std::rand());
55 /// });
56 ///
57 /// rec.log("world/image", rerun::Image::from_rgb24(random_data, {3, 3}));
58 /// }
59 /// ```
60 ///
61 /// ### Perspective pinhole camera
62 /// ![image](https://static.rerun.io/pinhole_perspective/317e2de6d212b238dcdad5b67037e9e2a2afafa0/full.png)
63 ///
64 /// ```cpp
65 /// #include <rerun.hpp>
66 ///
67 /// int main() {
68 /// const auto rec = rerun::RecordingStream("rerun_example_pinhole_perspective");
69 /// rec.spawn().exit_on_failure();
70 ///
71 /// const float fov_y = 0.7853982f;
72 /// const float aspect_ratio = 1.7777778f;
73 /// rec.log(
74 /// "world/cam",
75 /// rerun::Pinhole::from_fov_and_aspect_ratio(fov_y, aspect_ratio)
76 /// .with_camera_xyz(rerun::components::ViewCoordinates::RUB)
77 /// .with_image_plane_distance(0.1f)
78 /// .with_color(rerun::Color(255, 128, 0))
79 /// .with_line_width(0.003f)
80 /// );
81 ///
82 /// rec.log(
83 /// "world/points",
84 /// rerun::Points3D({{0.0f, 0.0f, -0.5f}, {0.1f, 0.1f, -0.5f}, {-0.1f, -0.1f, -0.5f}}
85 /// ).with_radii({0.025f})
86 /// );
87 /// }
88 /// ```
89 struct Pinhole {
90 /// Camera projection, from image coordinates to view coordinates.
91 ///
92 /// Any update to this field will reset all other transform properties that aren't changed in the same log call or `send_columns` row.
93 std::optional<ComponentBatch> image_from_camera;
94
95 /// Pixel resolution (usually integers) of child image space. Width and height.
96 ///
97 /// Example:
98 /// ```text
99 /// [1920.0, 1440.0]
100 /// ```
101 ///
102 /// `image_from_camera` project onto the space spanned by `(0,0)` and `resolution - 1`.
103 ///
104 /// Any update to this field will reset all other transform properties that aren't changed in the same log call or `send_columns` row.
105 std::optional<ComponentBatch> resolution;
106
107 /// Sets the view coordinates for the camera.
108 ///
109 /// All common values are available as constants on the `components::ViewCoordinates` class.
110 ///
111 /// The default is `ViewCoordinates::RDF`, i.e. X=Right, Y=Down, Z=Forward, and this is also the recommended setting.
112 /// This means that the camera frustum will point along the positive Z axis of the parent space,
113 /// and the cameras "up" direction will be along the negative Y axis of the parent space.
114 ///
115 /// The camera frustum will point whichever axis is set to `F` (or the opposite of `B`).
116 /// When logging a depth image under this entity, this is the direction the point cloud will be projected.
117 /// With `RDF`, the default forward is +Z.
118 ///
119 /// The frustum's "up" direction will be whichever axis is set to `U` (or the opposite of `D`).
120 /// This will match the negative Y direction of pixel space (all images are assumed to have xyz=RDF).
121 /// With `RDF`, the default is up is -Y.
122 ///
123 /// The frustum's "right" direction will be whichever axis is set to `R` (or the opposite of `L`).
124 /// This will match the positive X direction of pixel space (all images are assumed to have xyz=RDF).
125 /// With `RDF`, the default right is +x.
126 ///
127 /// Other common formats are `RUB` (X=Right, Y=Up, Z=Back) and `FLU` (X=Forward, Y=Left, Z=Up).
128 ///
129 /// NOTE: setting this to something else than `RDF` (the default) will change the orientation of the camera frustum,
130 /// and make the pinhole matrix not match up with the coordinate system of the pinhole entity.
131 ///
132 /// The pinhole matrix (the `image_from_camera` argument) always project along the third (Z) axis,
133 /// but will be re-oriented to project along the forward axis of the `camera_xyz` argument.
134 std::optional<ComponentBatch> camera_xyz;
135
136 /// The child frame this transform transforms from.
137 ///
138 /// The entity at which the transform relationship of any given child frame is specified mustn't change over time, but is allowed to be different for static time.
139 /// E.g. if you specified the child frame `"robot_arm"` on an entity named `"my_transforms"`, you may not log transforms
140 /// with the child frame `"robot_arm"` on any other entity than `"my_transforms"` unless one of them was logged with static time.
141 ///
142 /// If not specified, this is set to the implicit transform frame of the current entity path.
143 /// This means that if a `archetypes::Transform3D` is set on an entity called `/my/entity/path` then this will default to `tf#/my/entity/path`.
144 ///
145 /// To set the frame an entity is part of see `archetypes::CoordinateFrame`.
146 ///
147 /// Any update to this field will reset all other transform properties that aren't changed in the same log call or `send_columns` row.
148 std::optional<ComponentBatch> child_frame;
149
150 /// The parent frame this transform transforms into.
151 ///
152 /// If not specified, this is set to the implicit transform frame of the current entity path's parent.
153 /// This means that if a `archetypes::Transform3D` is set on an entity called `/my/entity/path` then this will default to `tf#/my/entity`.
154 ///
155 /// To set the frame an entity is part of see `archetypes::CoordinateFrame`.
156 ///
157 /// Any update to this field will reset all other transform properties that aren't changed in the same log call or `send_columns` row.
158 std::optional<ComponentBatch> parent_frame;
159
160 /// The distance from the camera origin to the image plane when the projection is shown in a 3D viewer.
161 ///
162 /// This is only used for visualization purposes, and does not affect the projection itself.
163 std::optional<ComponentBatch> image_plane_distance;
164
165 /// Color of the camera wireframe.
166 std::optional<ComponentBatch> color;
167
168 /// Width of the camera wireframe lines.
169 std::optional<ComponentBatch> line_width;
170
171 public:
172 /// The name of the archetype as used in `ComponentDescriptor`s.
173 static constexpr const char ArchetypeName[] = "rerun.archetypes.Pinhole";
174
175 /// `ComponentDescriptor` for the `image_from_camera` field.
177 ArchetypeName, "Pinhole:image_from_camera",
179 );
180 /// `ComponentDescriptor` for the `resolution` field.
182 ArchetypeName, "Pinhole:resolution",
184 );
185 /// `ComponentDescriptor` for the `camera_xyz` field.
187 ArchetypeName, "Pinhole:camera_xyz",
189 );
190 /// `ComponentDescriptor` for the `child_frame` field.
192 ArchetypeName, "Pinhole:child_frame",
194 );
195 /// `ComponentDescriptor` for the `parent_frame` field.
197 ArchetypeName, "Pinhole:parent_frame",
199 );
200 /// `ComponentDescriptor` for the `image_plane_distance` field.
202 ArchetypeName, "Pinhole:image_plane_distance",
204 );
205 /// `ComponentDescriptor` for the `color` field.
206 static constexpr auto Descriptor_color = ComponentDescriptor(
208 );
209 /// `ComponentDescriptor` for the `line_width` field.
212 );
213
214 public: // START of extensions from pinhole_ext.cpp:
215 /// Creates a pinhole from the camera focal length and resolution, both specified in pixels.
216 ///
217 /// The focal length is the diagonal of the projection matrix.
218 /// Set the same value for x & y value for symmetric cameras, or two values for anamorphic
219 /// cameras.
220 ///
221 /// Assumes the principal point to be in the middle of the sensor.
223 const datatypes::Vec2D& focal_length, const datatypes::Vec2D& resolution
224 );
225
226 /// Creates a symmetric pinhole from the camera focal length and resolution, both specified
227 /// in pixels.
228 ///
229 /// The focal length is the diagonal of the projection matrix.
230 ///
231 /// Assumes the principal point to be in the middle of the sensor.
233 float focal_length, const datatypes::Vec2D& resolution
234 ) {
235 return from_focal_length_and_resolution({focal_length, focal_length}, resolution);
236 }
237
238 /// Creates a pinhole from the camera vertical field of view (in radians) and aspect ratio (width/height).
239 ///
240 /// Assumes the principal point to be in the middle of the sensor.
241 static Pinhole from_fov_and_aspect_ratio(float fov_y, float aspect_ratio) {
242 const float EPSILON = std::numeric_limits<float>::epsilon();
243 // `max` has explicit template args to avoid preprocessor replacement when <windows.h> is included without NOMINMAX.
244 const float focal_length_y = 0.5f / std::tan(std::max<float>(fov_y * 0.5f, EPSILON));
246 {focal_length_y, focal_length_y},
247 {aspect_ratio, 1.0}
248 );
249 }
250
251 /// Pixel resolution (usually integers) of child image space. Width and height.
252 ///
253 /// `image_from_camera` project onto the space spanned by `(0,0)` and `resolution - 1`.
254 Pinhole with_resolution(float width, float height) && {
255 return std::move(*this).with_resolution(rerun::components::Resolution(width, height));
256 }
257
258 /// Pixel resolution (usually integers) of child image space. Width and height.
259 ///
260 /// `image_from_camera` project onto the space spanned by `(0,0)` and `resolution - 1`.
261 Pinhole with_resolution(int width, int height) && {
262 return std::move(*this).with_resolution(rerun::components::Resolution(width, height));
263 }
264
265 // END of extensions from pinhole_ext.cpp, start of generated code:
266
267 public:
268 Pinhole() = default;
269 Pinhole(Pinhole&& other) = default;
270 Pinhole(const Pinhole& other) = default;
271 Pinhole& operator=(const Pinhole& other) = default;
272 Pinhole& operator=(Pinhole&& other) = default;
273
274 explicit Pinhole(rerun::components::PinholeProjection _image_from_camera)
275 : image_from_camera(ComponentBatch::from_loggable(
276 std::move(_image_from_camera), Descriptor_image_from_camera
277 )
278 .value_or_throw()) {}
279
280 /// Update only some specific fields of a `Pinhole`.
282 return Pinhole();
283 }
284
285 /// Clear all the fields of a `Pinhole`.
287
288 /// Camera projection, from image coordinates to view coordinates.
289 ///
290 /// Any update to this field will reset all other transform properties that aren't changed in the same log call or `send_columns` row.
292 const rerun::components::PinholeProjection& _image_from_camera
293 ) && {
296 .value_or_throw();
297 return std::move(*this);
298 }
299
300 /// This method makes it possible to pack multiple `image_from_camera` in a single component batch.
301 ///
302 /// This only makes sense when used in conjunction with `columns`. `with_image_from_camera` should
303 /// be used when logging a single row's worth of data.
306 ) && {
309 .value_or_throw();
310 return std::move(*this);
311 }
312
313 /// Pixel resolution (usually integers) of child image space. Width and height.
314 ///
315 /// Example:
316 /// ```text
317 /// [1920.0, 1440.0]
318 /// ```
319 ///
320 /// `image_from_camera` project onto the space spanned by `(0,0)` and `resolution - 1`.
321 ///
322 /// Any update to this field will reset all other transform properties that aren't changed in the same log call or `send_columns` row.
324 resolution =
325 ComponentBatch::from_loggable(_resolution, Descriptor_resolution).value_or_throw();
326 return std::move(*this);
327 }
328
329 /// This method makes it possible to pack multiple `resolution` in a single component batch.
330 ///
331 /// This only makes sense when used in conjunction with `columns`. `with_resolution` should
332 /// be used when logging a single row's worth of data.
334 ) && {
335 resolution =
336 ComponentBatch::from_loggable(_resolution, Descriptor_resolution).value_or_throw();
337 return std::move(*this);
338 }
339
340 /// Sets the view coordinates for the camera.
341 ///
342 /// All common values are available as constants on the `components::ViewCoordinates` class.
343 ///
344 /// The default is `ViewCoordinates::RDF`, i.e. X=Right, Y=Down, Z=Forward, and this is also the recommended setting.
345 /// This means that the camera frustum will point along the positive Z axis of the parent space,
346 /// and the cameras "up" direction will be along the negative Y axis of the parent space.
347 ///
348 /// The camera frustum will point whichever axis is set to `F` (or the opposite of `B`).
349 /// When logging a depth image under this entity, this is the direction the point cloud will be projected.
350 /// With `RDF`, the default forward is +Z.
351 ///
352 /// The frustum's "up" direction will be whichever axis is set to `U` (or the opposite of `D`).
353 /// This will match the negative Y direction of pixel space (all images are assumed to have xyz=RDF).
354 /// With `RDF`, the default is up is -Y.
355 ///
356 /// The frustum's "right" direction will be whichever axis is set to `R` (or the opposite of `L`).
357 /// This will match the positive X direction of pixel space (all images are assumed to have xyz=RDF).
358 /// With `RDF`, the default right is +x.
359 ///
360 /// Other common formats are `RUB` (X=Right, Y=Up, Z=Back) and `FLU` (X=Forward, Y=Left, Z=Up).
361 ///
362 /// NOTE: setting this to something else than `RDF` (the default) will change the orientation of the camera frustum,
363 /// and make the pinhole matrix not match up with the coordinate system of the pinhole entity.
364 ///
365 /// The pinhole matrix (the `image_from_camera` argument) always project along the third (Z) axis,
366 /// but will be re-oriented to project along the forward axis of the `camera_xyz` argument.
368 camera_xyz =
369 ComponentBatch::from_loggable(_camera_xyz, Descriptor_camera_xyz).value_or_throw();
370 return std::move(*this);
371 }
372
373 /// This method makes it possible to pack multiple `camera_xyz` in a single component batch.
374 ///
375 /// This only makes sense when used in conjunction with `columns`. `with_camera_xyz` should
376 /// be used when logging a single row's worth of data.
379 ) && {
380 camera_xyz =
381 ComponentBatch::from_loggable(_camera_xyz, Descriptor_camera_xyz).value_or_throw();
382 return std::move(*this);
383 }
384
385 /// The child frame this transform transforms from.
386 ///
387 /// The entity at which the transform relationship of any given child frame is specified mustn't change over time, but is allowed to be different for static time.
388 /// E.g. if you specified the child frame `"robot_arm"` on an entity named `"my_transforms"`, you may not log transforms
389 /// with the child frame `"robot_arm"` on any other entity than `"my_transforms"` unless one of them was logged with static time.
390 ///
391 /// If not specified, this is set to the implicit transform frame of the current entity path.
392 /// This means that if a `archetypes::Transform3D` is set on an entity called `/my/entity/path` then this will default to `tf#/my/entity/path`.
393 ///
394 /// To set the frame an entity is part of see `archetypes::CoordinateFrame`.
395 ///
396 /// Any update to this field will reset all other transform properties that aren't changed in the same log call or `send_columns` row.
399 .value_or_throw();
400 return std::move(*this);
401 }
402
403 /// This method makes it possible to pack multiple `child_frame` in a single component batch.
404 ///
405 /// This only makes sense when used in conjunction with `columns`. `with_child_frame` should
406 /// be used when logging a single row's worth of data.
409 ) && {
411 .value_or_throw();
412 return std::move(*this);
413 }
414
415 /// The parent frame this transform transforms into.
416 ///
417 /// If not specified, this is set to the implicit transform frame of the current entity path's parent.
418 /// This means that if a `archetypes::Transform3D` is set on an entity called `/my/entity/path` then this will default to `tf#/my/entity`.
419 ///
420 /// To set the frame an entity is part of see `archetypes::CoordinateFrame`.
421 ///
422 /// Any update to this field will reset all other transform properties that aren't changed in the same log call or `send_columns` row.
425 .value_or_throw();
426 return std::move(*this);
427 }
428
429 /// This method makes it possible to pack multiple `parent_frame` in a single component batch.
430 ///
431 /// This only makes sense when used in conjunction with `columns`. `with_parent_frame` should
432 /// be used when logging a single row's worth of data.
435 ) && {
437 .value_or_throw();
438 return std::move(*this);
439 }
440
441 /// The distance from the camera origin to the image plane when the projection is shown in a 3D viewer.
442 ///
443 /// This is only used for visualization purposes, and does not affect the projection itself.
445 const rerun::components::ImagePlaneDistance& _image_plane_distance
446 ) && {
448 _image_plane_distance,
450 )
451 .value_or_throw();
452 return std::move(*this);
453 }
454
455 /// This method makes it possible to pack multiple `image_plane_distance` in a single component batch.
456 ///
457 /// This only makes sense when used in conjunction with `columns`. `with_image_plane_distance` should
458 /// be used when logging a single row's worth of data.
460 const Collection<rerun::components::ImagePlaneDistance>& _image_plane_distance
461 ) && {
463 _image_plane_distance,
465 )
466 .value_or_throw();
467 return std::move(*this);
468 }
469
470 /// Color of the camera wireframe.
472 color = ComponentBatch::from_loggable(_color, Descriptor_color).value_or_throw();
473 return std::move(*this);
474 }
475
476 /// This method makes it possible to pack multiple `color` in a single component batch.
477 ///
478 /// This only makes sense when used in conjunction with `columns`. `with_color` should
479 /// be used when logging a single row's worth of data.
481 color = ComponentBatch::from_loggable(_color, Descriptor_color).value_or_throw();
482 return std::move(*this);
483 }
484
485 /// Width of the camera wireframe lines.
487 line_width =
488 ComponentBatch::from_loggable(_line_width, Descriptor_line_width).value_or_throw();
489 return std::move(*this);
490 }
491
492 /// This method makes it possible to pack multiple `line_width` in a single component batch.
493 ///
494 /// This only makes sense when used in conjunction with `columns`. `with_line_width` should
495 /// be used when logging a single row's worth of data.
497 line_width =
498 ComponentBatch::from_loggable(_line_width, Descriptor_line_width).value_or_throw();
499 return std::move(*this);
500 }
501
502 /// Partitions the component data into multiple sub-batches.
503 ///
504 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
505 /// instead, via `ComponentBatch::partitioned`.
506 ///
507 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
508 ///
509 /// The specified `lengths` must sum to the total length of the component batch.
511
512 /// Partitions the component data into unit-length sub-batches.
513 ///
514 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
515 /// where `n` is automatically guessed.
517 };
518
519} // namespace rerun::archetypes
520
521namespace rerun {
522 /// \private
523 template <typename T>
524 struct AsComponents;
525
526 /// \private
527 template <>
528 struct AsComponents<archetypes::Pinhole> {
529 /// Serialize all set component batches.
530 static Result<Collection<ComponentBatch>> as_batches(const archetypes::Pinhole& archetype);
531 };
532} // namespace rerun
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
A class for representing either a usable value, or an error.
Definition result.hpp:14
All built-in archetypes. See Types in the Rerun manual.
Definition rerun.hpp:76
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
Arrow-encoded data of a single batch of components together with a component descriptor.
Definition component_batch.hpp:28
static Result< ComponentBatch > from_loggable(const rerun::Collection< T > &components, const ComponentDescriptor &descriptor)
Creates a new component batch from a collection of component instances.
Definition component_batch.hpp:46
A ComponentDescriptor fully describes the semantics of a column of data.
Definition component_descriptor.hpp:16
The Loggable trait is used by all built-in implementation of rerun::AsComponents to serialize a colle...
Definition loggable.hpp:11
Archetype: Camera perspective projection (a.k.a.
Definition pinhole.hpp:89
Pinhole with_many_child_frame(const Collection< rerun::components::TransformFrameId > &_child_frame) &&
This method makes it possible to pack multiple child_frame in a single component batch.
Definition pinhole.hpp:407
Pinhole with_resolution(const rerun::components::Resolution &_resolution) &&
Pixel resolution (usually integers) of child image space.
Definition pinhole.hpp:323
Pinhole with_parent_frame(const rerun::components::TransformFrameId &_parent_frame) &&
The parent frame this transform transforms into.
Definition pinhole.hpp:423
Pinhole with_many_color(const Collection< rerun::components::Color > &_color) &&
This method makes it possible to pack multiple color in a single component batch.
Definition pinhole.hpp:480
std::optional< ComponentBatch > color
Color of the camera wireframe.
Definition pinhole.hpp:166
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition pinhole.hpp:173
Pinhole with_resolution(float width, float height) &&
Pixel resolution (usually integers) of child image space.
Definition pinhole.hpp:254
static constexpr auto Descriptor_color
ComponentDescriptor for the color field.
Definition pinhole.hpp:206
static constexpr auto Descriptor_resolution
ComponentDescriptor for the resolution field.
Definition pinhole.hpp:181
std::optional< ComponentBatch > image_from_camera
Camera projection, from image coordinates to view coordinates.
Definition pinhole.hpp:93
Pinhole with_resolution(int width, int height) &&
Pixel resolution (usually integers) of child image space.
Definition pinhole.hpp:261
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
Pinhole with_camera_xyz(const rerun::components::ViewCoordinates &_camera_xyz) &&
Sets the view coordinates for the camera.
Definition pinhole.hpp:367
Pinhole with_many_image_plane_distance(const Collection< rerun::components::ImagePlaneDistance > &_image_plane_distance) &&
This method makes it possible to pack multiple image_plane_distance in a single component batch.
Definition pinhole.hpp:459
std::optional< ComponentBatch > line_width
Width of the camera wireframe lines.
Definition pinhole.hpp:169
Pinhole with_child_frame(const rerun::components::TransformFrameId &_child_frame) &&
The child frame this transform transforms from.
Definition pinhole.hpp:397
Pinhole with_many_camera_xyz(const Collection< rerun::components::ViewCoordinates > &_camera_xyz) &&
This method makes it possible to pack multiple camera_xyz in a single component batch.
Definition pinhole.hpp:377
static Pinhole update_fields()
Update only some specific fields of a Pinhole.
Definition pinhole.hpp:281
std::optional< ComponentBatch > image_plane_distance
The distance from the camera origin to the image plane when the projection is shown in a 3D viewer.
Definition pinhole.hpp:163
Pinhole with_color(const rerun::components::Color &_color) &&
Color of the camera wireframe.
Definition pinhole.hpp:471
static constexpr auto Descriptor_camera_xyz
ComponentDescriptor for the camera_xyz field.
Definition pinhole.hpp:186
static Pinhole from_fov_and_aspect_ratio(float fov_y, float aspect_ratio)
Creates a pinhole from the camera vertical field of view (in radians) and aspect ratio (width/height)...
Definition pinhole.hpp:241
static Pinhole clear_fields()
Clear all the fields of a Pinhole.
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
static constexpr auto Descriptor_image_plane_distance
ComponentDescriptor for the image_plane_distance field.
Definition pinhole.hpp:201
Pinhole with_many_parent_frame(const Collection< rerun::components::TransformFrameId > &_parent_frame) &&
This method makes it possible to pack multiple parent_frame in a single component batch.
Definition pinhole.hpp:433
static Pinhole from_focal_length_and_resolution(const datatypes::Vec2D &focal_length, const datatypes::Vec2D &resolution)
Creates a pinhole from the camera focal length and resolution, both specified in pixels.
std::optional< ComponentBatch > parent_frame
The parent frame this transform transforms into.
Definition pinhole.hpp:158
static constexpr auto Descriptor_parent_frame
ComponentDescriptor for the parent_frame field.
Definition pinhole.hpp:196
std::optional< ComponentBatch > camera_xyz
Sets the view coordinates for the camera.
Definition pinhole.hpp:134
static Pinhole from_focal_length_and_resolution(float focal_length, const datatypes::Vec2D &resolution)
Creates a symmetric pinhole from the camera focal length and resolution, both specified in pixels.
Definition pinhole.hpp:232
std::optional< ComponentBatch > child_frame
The child frame this transform transforms from.
Definition pinhole.hpp:148
static constexpr auto Descriptor_line_width
ComponentDescriptor for the line_width field.
Definition pinhole.hpp:210
Pinhole with_many_line_width(const Collection< rerun::components::Radius > &_line_width) &&
This method makes it possible to pack multiple line_width in a single component batch.
Definition pinhole.hpp:496
std::optional< ComponentBatch > resolution
Pixel resolution (usually integers) of child image space.
Definition pinhole.hpp:105
Pinhole with_line_width(const rerun::components::Radius &_line_width) &&
Width of the camera wireframe lines.
Definition pinhole.hpp:486
Pinhole with_many_image_from_camera(const Collection< rerun::components::PinholeProjection > &_image_from_camera) &&
This method makes it possible to pack multiple image_from_camera in a single component batch.
Definition pinhole.hpp:304
Pinhole with_image_from_camera(const rerun::components::PinholeProjection &_image_from_camera) &&
Camera projection, from image coordinates to view coordinates.
Definition pinhole.hpp:291
Pinhole with_many_resolution(const Collection< rerun::components::Resolution > &_resolution) &&
This method makes it possible to pack multiple resolution in a single component batch.
Definition pinhole.hpp:333
Pinhole with_image_plane_distance(const rerun::components::ImagePlaneDistance &_image_plane_distance) &&
The distance from the camera origin to the image plane when the projection is shown in a 3D viewer.
Definition pinhole.hpp:444
static constexpr auto Descriptor_image_from_camera
ComponentDescriptor for the image_from_camera field.
Definition pinhole.hpp:176
static constexpr auto Descriptor_child_frame
ComponentDescriptor for the child_frame field.
Definition pinhole.hpp:191
Component: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition color.hpp:17
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
Component: Camera projection, from image coordinates to view coordinates.
Definition pinhole_projection.hpp:25
Component: The radius of something, e.g.
Definition radius.hpp:21
Component: Pixel resolution width & height, e.g.
Definition resolution.hpp:18
Component: A string identifier for a transform frame.
Definition transform_frame_id.hpp:24
Component: How we interpret the coordinate system of an entity/space.
Definition view_coordinates.hpp:35
Datatype: A vector in 2D space.
Definition vec2d.hpp:20