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