AGX Dynamics 2.42.1.1
Loading...
Searching...
No Matches
CameraLensSingleElement.h
Go to the documentation of this file.
1/*
2Copyright 2007-2026. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16#pragma once
21
22#include <optional>
23
24namespace agxSensor
25{
26 using OptionalFocusDistance = std::optional<agx::Real>;
27 using OptionalFocusMinimumDistance = std::optional<agx::Real>;
28
30 {
31 };
32
34
39 {
40 public:
49 agx::Real focalLength = 1.88e-3, agx::Real fStop = 2.0, agx::Real minimumFocusDistance = 0.1,
50 LensDistortionRef distortion = nullptr);
51
60 CameraLensSingleElementManualFocusFlag, agx::Real focalLength = 1.88e-3, agx::Real fStop = 2.0,
61 agx::Real focusDistance = 1.5, LensDistortionRef distortion = nullptr);
62
67 void setFocalLength(agx::Real focalLength);
68
73
78 void setFStop(agx::Real fStop);
79
84
90 void setAutofocus(agx::Real minimumFocusDistance);
91
97 void setFocusDistance(agx::Real focusDistance);
98
102 bool isAutofocusEnabled() const;
103
108
113
119
124
133 virtual agx::Real getFieldOfView(const agx::Vec2& sensorExtents, const agx::Vec2& point) const override;
134
136
137 public:
138 virtual void synchronizeParameters(Camera* camera, const CameraBackend& backend) override;
139 virtual void resetSynchronizationState() override;
140
142
144
145 private:
147 LensDistortionRef m_distortion;
148 LazyTrigger m_dirty;
149 };
150}
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:207
#define AGXSENSOR_EXPORT
A standard (non-anamorphic) camera lens (system) approximated as a single lens element.
CameraLensSingleElement(CameraLensSingleElementManualFocusFlag, agx::Real focalLength=1.88e-3, agx::Real fStop=2.0, agx::Real focusDistance=1.5, LensDistortionRef distortion=nullptr)
Constructs a single element camera lens (system) with manual focus control based on the given paramet...
CameraLensSingleElement(agx::Real focalLength=1.88e-3, agx::Real fStop=2.0, agx::Real minimumFocusDistance=0.1, LensDistortionRef distortion=nullptr)
Constructs a single element camera lens (system) with autofocus based on the given parameters.
void setFStop(agx::Real fStop)
Set the lens-aperture f-stop value.
virtual agx::Real getFieldOfView(const agx::Vec2 &sensorExtents, const agx::Vec2 &point) const override
Calculate the (full) field of view angle in the specified point, given the extents of the capturing s...
void setLensDistortion(LensDistortionRef distortion)
Set the distortion model for the lens.
void setAutofocus(agx::Real minimumFocusDistance)
Set the minimum focus distance for lens autofocus.
OptionalFocusDistance getFocusDistance() const
void setFocalLength(agx::Real focalLength)
Set the lens focal length.
void setFocusDistance(agx::Real focusDistance)
Set the focus distance for manual focus control.
OptionalFocusMinimumDistance getMinimumFocusDistance() const
LensDistortion * getDistortion() const
Base type for a camera lens systems attached to a camera.
Definition: CameraLens.h:37
Camera instance class defined by a frame/transform and a model.
Type for triggering effects at a later point in time.
Definition: LazyTrigger.h:28
Base type for a lens distortion model specification.
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:89
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:88
The agxSensor namespace contains components to model real-time sensors connected to the physics of AG...
std::optional< agx::Real > OptionalFocusMinimumDistance
std::optional< agx::Real > OptionalFocusDistance
double Real
Definition: Real.h:41