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/build/re_type_definitions/rerun/archetypes/pinhole.def.rs".
3
4#pragma once
5
6#include "../archetype_utils.hpp"
7#include "../collection.hpp"
8#include "../component_batch.hpp"
9#include "../component_column.hpp"
10#include "../components/color.hpp"
11#include "../components/image_plane_distance.hpp"
12#include "../components/pinhole_projection.hpp"
13#include "../components/radius.hpp"
14#include "../components/resolution.hpp"
15#include "../components/transform_frame_id.hpp"
16#include "../components/view_coordinates.hpp"
17#include "../result.hpp"
18
19#include <cmath>
20#include <cstdint>
21#include <limits>
22#include <optional>
23#include <utility>
24#include <vector>
25
26namespace rerun::archetypes {
27 /// **Archetype**: Camera perspective projection (a.k.a. intrinsics).
28 ///
29 /// A `archetypes::Transform3D` logged for the same child/parent relationship (e.g. for the camera extrinsics) is applied first, then the pinhole projection.
30 ///
31 /// If you use named transform frames via the `child_frame` and `parent_frame` fields, you don't have to use `archetypes::CoordinateFrame`
32 /// as it is the case with other visualizations: for any entity with an `archetypes::Pinhole` the viewer will always visualize it
33 /// directly without needing a `archetypes::CoordinateFrame` to refer to the pinhole's child/parent frame.
34 ///
35 /// ## Examples
36 ///
37 /// ### Simple pinhole camera
38 /// ![image](https://static.rerun.io/pinhole_simple/9af9441a94bcd9fd54e1fea44fb0c59ff381a7f2/full.png)
39 ///
40 /// ```cpp
41 /// #include <rerun.hpp>
42 ///
43 /// #include <algorithm> // std::generate
44 /// #include <cstdlib> // std::rand
45 /// #include <vector>
46 ///
47 /// int main(int argc, char* argv[]) {
48 /// const auto rec = rerun::RecordingStream("rerun_example_pinhole");
49 /// rec.spawn().exit_on_failure();
50 ///
51 /// rec.log(
52 /// "world/image",
53 /// rerun::Pinhole::from_focal_length_and_resolution(3.0f, {3.0f, 3.0f})
54 /// );
55 ///
56 /// std::vector<uint8_t> random_data(3 * 3 * 3);
57 /// std::generate(random_data.begin(), random_data.end(), [] {
58 /// return static_cast<uint8_t>(std::rand());
59 /// });
60 ///
61 /// rec.log("world/image", rerun::Image::from_rgb24(random_data, {3, 3}));
62 /// }
63 /// ```
64 ///
65 /// ### Perspective pinhole camera
66 /// ![image](https://static.rerun.io/pinhole_perspective/317e2de6d212b238dcdad5b67037e9e2a2afafa0/full.png)
67 ///
68 /// ```cpp
69 /// #include <rerun.hpp>
70 ///
71 /// int main(int argc, char* argv[]) {
72 /// const auto rec =
73 /// rerun::RecordingStream("rerun_example_pinhole_perspective");
74 /// rec.spawn().exit_on_failure();
75 ///
76 /// const float fov_y = 0.7853982f;
77 /// const float aspect_ratio = 1.7777778f;
78 /// rec.log(
79 /// "world/cam",
80 /// rerun::Pinhole::from_fov_and_aspect_ratio(fov_y, aspect_ratio)
81 /// .with_camera_xyz(rerun::components::ViewCoordinates::RUB)
82 /// .with_image_plane_distance(0.1f)
83 /// .with_color(rerun::Color(255, 128, 0))
84 /// .with_line_width(0.003f)
85 /// );
86 ///
87 /// rec.log(
88 /// "world/points",
89 /// rerun::Points3D(
90 /// {{0.0f, 0.0f, -0.5f}, {0.1f, 0.1f, -0.5f}, {-0.1f, -0.1f, -0.5f}}
91 /// )
92 /// .with_radii({0.025f})
93 /// );
94 /// }
95 /// ```
96 struct Pinhole {
97 /// Camera projection, from image coordinates to view coordinates.
98 ///
99 /// Any update to this field will reset all other transform properties that aren't changed in the same log call or `send_columns` row.
100 std::optional<ComponentBatch> image_from_camera;
101
102 /// Pixel resolution (usually integers) of child image space. Width and height.
103 ///
104 /// Example:
105 /// ```text
106 /// [1920.0, 1440.0]
107 /// ```
108 ///
109 /// `image_from_camera` project onto the space spanned by `(0,0)` and `resolution - 1`.
110 ///
111 /// Any update to this field will reset all other transform properties that aren't changed in the same log call or `send_columns` row.
112 std::optional<ComponentBatch> resolution;
113
114 /// Sets the camera orientation convention.
115 ///
116 /// All common values are available as constants on the `components::ViewCoordinates` class.
117 ///
118 /// The default is `ViewCoordinates::RDF`: +X is right, +Y is down, and +Z is forward.
119 /// This makes the camera frustum point along +Z in the parent space, with its up direction along -Y.
120 ///
121 /// The camera frustum points along the axis set to `F`, or opposite the axis set to `B`.
122 /// When logging a depth image under this entity, this is the direction in which the point cloud is projected.
123 ///
124 /// The frustum's up direction is the axis set to `U`, or opposite the axis set to `D`.
125 /// This matches the -Y direction of pixel space, where all images use RDF coordinates.
126 ///
127 /// The frustum's right direction is the axis set to `R`, or opposite the axis set to `L`.
128 /// This matches the +X direction of pixel space.
129 ///
130 /// Other common formats are `RUB` (X=Right, Y=Up, Z=Back) and `FLU` (X=Forward, Y=Left, Z=Up).
131 ///
132 /// `image_from_camera` is always defined to project along +Z in camera coordinates.
133 /// `camera_xyz` reorients that projection to the forward axis of the pinhole entity.
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 encodings::Vec2D& focal_length, const encodings::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 encodings::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 camera orientation convention.
341 ///
342 /// All common values are available as constants on the `components::ViewCoordinates` class.
343 ///
344 /// The default is `ViewCoordinates::RDF`: +X is right, +Y is down, and +Z is forward.
345 /// This makes the camera frustum point along +Z in the parent space, with its up direction along -Y.
346 ///
347 /// The camera frustum points along the axis set to `F`, or opposite the axis set to `B`.
348 /// When logging a depth image under this entity, this is the direction in which the point cloud is projected.
349 ///
350 /// The frustum's up direction is the axis set to `U`, or opposite the axis set to `D`.
351 /// This matches the -Y direction of pixel space, where all images use RDF coordinates.
352 ///
353 /// The frustum's right direction is the axis set to `R`, or opposite the axis set to `L`.
354 /// This matches the +X direction of pixel space.
355 ///
356 /// Other common formats are `RUB` (X=Right, Y=Up, Z=Back) and `FLU` (X=Forward, Y=Left, Z=Up).
357 ///
358 /// `image_from_camera` is always defined to project along +Z in camera coordinates.
359 /// `camera_xyz` reorients that projection to the forward axis of the pinhole entity.
361 camera_xyz =
362 ComponentBatch::from_loggable(_camera_xyz, Descriptor_camera_xyz).value_or_throw();
363 return std::move(*this);
364 }
365
366 /// This method makes it possible to pack multiple `camera_xyz` in a single component batch.
367 ///
368 /// This only makes sense when used in conjunction with `columns`. `with_camera_xyz` should
369 /// be used when logging a single row's worth of data.
372 ) && {
373 camera_xyz =
374 ComponentBatch::from_loggable(_camera_xyz, Descriptor_camera_xyz).value_or_throw();
375 return std::move(*this);
376 }
377
378 /// The child frame this transform transforms from.
379 ///
380 /// 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.
381 /// E.g. if you specified the child frame `"robot_arm"` on an entity named `"my_transforms"`, you may not log transforms
382 /// with the child frame `"robot_arm"` on any other entity than `"my_transforms"` unless one of them was logged with static time.
383 ///
384 /// If not specified, this is set to the implicit transform frame of the current entity path.
385 /// 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`.
386 ///
387 /// To set the frame an entity is part of see `archetypes::CoordinateFrame`.
388 ///
389 /// Any update to this field will reset all other transform properties that aren't changed in the same log call or `send_columns` row.
392 .value_or_throw();
393 return std::move(*this);
394 }
395
396 /// This method makes it possible to pack multiple `child_frame` in a single component batch.
397 ///
398 /// This only makes sense when used in conjunction with `columns`. `with_child_frame` should
399 /// be used when logging a single row's worth of data.
402 ) && {
404 .value_or_throw();
405 return std::move(*this);
406 }
407
408 /// The parent frame this transform transforms into.
409 ///
410 /// If not specified, this is set to the implicit transform frame of the current entity path's parent.
411 /// This means that if a `archetypes::Transform3D` is set on an entity called `/my/entity/path` then this will default to `tf#/my/entity`.
412 ///
413 /// To set the frame an entity is part of see `archetypes::CoordinateFrame`.
414 ///
415 /// Any update to this field will reset all other transform properties that aren't changed in the same log call or `send_columns` row.
418 .value_or_throw();
419 return std::move(*this);
420 }
421
422 /// This method makes it possible to pack multiple `parent_frame` in a single component batch.
423 ///
424 /// This only makes sense when used in conjunction with `columns`. `with_parent_frame` should
425 /// be used when logging a single row's worth of data.
428 ) && {
430 .value_or_throw();
431 return std::move(*this);
432 }
433
434 /// The distance from the camera origin to the image plane when the projection is shown in a 3D viewer.
435 ///
436 /// This is only used for visualization purposes, and does not affect the projection itself.
438 const rerun::components::ImagePlaneDistance& _image_plane_distance
439 ) && {
441 _image_plane_distance,
443 )
444 .value_or_throw();
445 return std::move(*this);
446 }
447
448 /// This method makes it possible to pack multiple `image_plane_distance` in a single component batch.
449 ///
450 /// This only makes sense when used in conjunction with `columns`. `with_image_plane_distance` should
451 /// be used when logging a single row's worth of data.
453 const Collection<rerun::components::ImagePlaneDistance>& _image_plane_distance
454 ) && {
456 _image_plane_distance,
458 )
459 .value_or_throw();
460 return std::move(*this);
461 }
462
463 /// Color of the camera wireframe.
465 color = ComponentBatch::from_loggable(_color, Descriptor_color).value_or_throw();
466 return std::move(*this);
467 }
468
469 /// This method makes it possible to pack multiple `color` in a single component batch.
470 ///
471 /// This only makes sense when used in conjunction with `columns`. `with_color` should
472 /// be used when logging a single row's worth of data.
474 color = ComponentBatch::from_loggable(_color, Descriptor_color).value_or_throw();
475 return std::move(*this);
476 }
477
478 /// Width of the camera wireframe lines.
480 line_width =
481 ComponentBatch::from_loggable(_line_width, Descriptor_line_width).value_or_throw();
482 return std::move(*this);
483 }
484
485 /// This method makes it possible to pack multiple `line_width` in a single component batch.
486 ///
487 /// This only makes sense when used in conjunction with `columns`. `with_line_width` should
488 /// be used when logging a single row's worth of data.
490 line_width =
491 ComponentBatch::from_loggable(_line_width, Descriptor_line_width).value_or_throw();
492 return std::move(*this);
493 }
494
495 /// Partitions the component data into multiple sub-batches.
496 ///
497 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
498 /// instead, via `ComponentBatch::partitioned`.
499 ///
500 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
501 ///
502 /// The specified `lengths` must sum to the total length of the component batch.
504 return detail::partition_batches(
506 &resolution,
507 &camera_xyz,
511 &color,
512 &line_width},
513 lengths_
514 )
515 .value_or_throw();
516 }
517
518 /// Partitions the component data into unit-length sub-batches.
519 ///
520 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
521 /// where `n` is automatically guessed.
523 return detail::partition_batches_of_unit_length({&image_from_camera,
524 &resolution,
525 &camera_xyz,
529 &color,
530 &line_width})
531 .value_or_throw();
532 }
533 };
534
535} // namespace rerun::archetypes
536
537namespace rerun {
538 /// \private
539 template <typename T>
540 struct AsComponents;
541
542 /// \private
543 template <>
544 struct AsComponents<archetypes::Pinhole> {
545 /// Serialize all set component batches.
546 static Result<Collection<ComponentBatch>> as_batches(const archetypes::Pinhole& archetype) {
547 return detail::collect_batches(
548 {&archetype.image_from_camera,
549 &archetype.resolution,
550 &archetype.camera_xyz,
551 &archetype.child_frame,
552 &archetype.parent_frame,
553 &archetype.image_plane_distance,
554 &archetype.color,
555 &archetype.line_width}
556 );
557 }
558 };
559} // namespace rerun
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
All built-in archetypes. See Types in the Rerun manual.
Definition rerun.hpp:90
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:26
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:96
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:400
Pinhole with_resolution(const rerun::components::Resolution &_resolution) &&
Pixel resolution (usually integers) of child image space.
Definition pinhole.hpp:323
static Pinhole from_focal_length_and_resolution(float focal_length, const encodings::Vec2D &resolution)
Creates a symmetric pinhole from the camera focal length and resolution, both specified in pixels.
Definition pinhole.hpp:232
Pinhole with_parent_frame(const rerun::components::TransformFrameId &_parent_frame) &&
The parent frame this transform transforms into.
Definition pinhole.hpp:416
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:473
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:100
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.
Definition pinhole.hpp:522
static Pinhole from_focal_length_and_resolution(const encodings::Vec2D &focal_length, const encodings::Vec2D &resolution)
Creates a pinhole from the camera focal length and resolution, both specified in pixels.
Pinhole with_camera_xyz(const rerun::components::ViewCoordinates &_camera_xyz) &&
Sets the camera orientation convention.
Definition pinhole.hpp:360
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:452
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:390
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:370
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:464
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.
Definition pinhole.hpp:503
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:426
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 camera orientation convention.
Definition pinhole.hpp:134
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:489
std::optional< ComponentBatch > resolution
Pixel resolution (usually integers) of child image space.
Definition pinhole.hpp:112
Pinhole with_line_width(const rerun::components::Radius &_line_width) &&
Width of the camera wireframe lines.
Definition pinhole.hpp:479
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:437
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: An orientation convention for a camera or 3D view.
Definition view_coordinates.hpp:28
Encoding: A vector in 2D space.
Definition vec2d.hpp:20