6#include "../collection.hpp"
7#include "../compiler_utils.hpp"
8#include "../component_batch.hpp"
9#include "../components/image_plane_distance.hpp"
10#include "../components/pinhole_projection.hpp"
11#include "../components/resolution.hpp"
12#include "../components/view_coordinates.hpp"
13#include "../indicator_component.hpp"
14#include "../result.hpp"
120 std::optional<rerun::components::ViewCoordinates>
camera_xyz;
128 static constexpr const char IndicatorComponentName[] =
"rerun.components.PinholeIndicator";
161 const float EPSILON = std::numeric_limits<float>::epsilon();
163 const float focal_length_y = 0.5f / std::tan(std::max<float>(fov_y * 0.5f, EPSILON));
165 {focal_length_y, focal_length_y},
175 return std::move(*
this);
183 return std::move(*
this);
206 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(
return std::move(*
this);)
239 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(
return std::move(*
this);)
250 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(
return std::move(*
this);)
258 template <
typename T>
263 struct AsComponents<archetypes::Pinhole> {
265 static Result<std::vector<ComponentBatch>> serialize(
const archetypes::Pinhole& archetype);
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:22
Archetype: Camera perspective projection (a.k.a.
Definition pinhole.hpp:79
rerun::components::PinholeProjection image_from_camera
Camera projection, from image coordinates to view coordinates.
Definition pinhole.hpp:81
Pinhole with_resolution(float width, float height) &&
Pixel resolution (usually integers) of child image space.
Definition pinhole.hpp:173
Pinhole with_resolution(int width, int height) &&
Pixel resolution (usually integers) of child image space.
Definition pinhole.hpp:181
std::optional< rerun::components::ViewCoordinates > camera_xyz
Sets the view coordinates for the camera.
Definition pinhole.hpp:120
std::optional< rerun::components::Resolution > resolution
Pixel resolution (usually integers) of child image space.
Definition pinhole.hpp:91
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:160
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.
Pinhole with_image_plane_distance(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:245
std::optional< 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:125
Pinhole with_resolution(rerun::components::Resolution _resolution) &&
Pixel resolution (usually integers) of child image space.
Definition pinhole.hpp:203
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:151
Pinhole with_camera_xyz(rerun::components::ViewCoordinates _camera_xyz) &&
Sets the view coordinates for the camera.
Definition pinhole.hpp:236
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
Indicator component used by archetypes when converting them to component lists.
Definition indicator_component.hpp:30
Component: Camera projection, from image coordinates to view coordinates.
Definition pinhole_projection.hpp:25
Component: Pixel resolution width & height, e.g.
Definition resolution.hpp:18
Component: How we interpret the coordinate system of an entity/space.
Definition view_coordinates.hpp:32
Datatype: A vector in 2D space.
Definition vec2d.hpp:20