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