26#include <osg/Texture2D>
31#include <unordered_map>
163 static std::unordered_map<NeoCameraOutput*, osg::Geometry*>& previews();
166 bool m_parametersUpdated;
174 std::unique_ptr<Pipeline> m_pipeline;
175 osg::Matrixd m_viewMatrix;
187 DISTORTION_BROWN_CONRADY
287 DistortionModel m_distortionModel;
468 bool m_constantCapture;
510 osg::ref_ptr<osg::Texture2D> m_texture;
631 template <
typename T>
632 const T* viewData()
const;
635 void ensureDataSize();
639 void* m_externalData;
642 osg::Matrixd m_colorMapping;
647 template <
typename T>
651 return reinterpret_cast<const T*
>(
getData());
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGX_DECLARE_VECTOR_TYPES(type)
Outputs the NeoCamera color feed to an image buffer of the specified format and color mapping matrix.
size_t getDataSize() const
agx::Real getGamma() const
ChannelElementType
Available per-channel type.
static size_t sizeOf(ChannelElementType type)
const void * getData() const
void setImageSize(const agx::Vec2i &size)
Set the size of the output image.
const osg::Matrixd & getColorMappingMatrix() const
void setOutputChannels(agx::UInt8 channels)
Set the number of active output channels in the image.
void setExternalData(void *externalAddress=nullptr)
Set the color image output to write to the given external data instead of the internal buffer.
const agx::Vec2i & getImageSize() const
void setColorMappingMatrix(const osg::Matrixd &colorMapping)
Set the matrix mapping input colors into each output channel.
void setOutputChannelType(ChannelElementType type)
Set the element type for the channels.
size_t getElementSize() const
const T * viewData() const
NeoCameraColorImageOutput()
Initializes a color image output with a set of default parameters and an internal memory buffer.
ChannelElementType getOutputChannelType() const
agx::UInt8 getOutputChannels() const
void setGamma(agx::Real gamma)
Set the value for gamma correction of the post-mapping output.
Outputs the NeoCamera color feed to an OpenSceneGraph texture.
NeoCameraColorTextureOutput()
Initializes a color texture output writing to an internal texture.
osg::Texture * getTexture() const
agx::Vec2i getTextureSize() const
agx::Real getGamma() const
void setTextureSize(const agx::Vec2i &size)
Set the size of the output texture.
void setGamma(agx::Real gamma)
Set the value for gamma correction of the output.
Lens parameter specification for the NeoCamera.
OptionalFocusMinimumDistance getMinimumFocusDistance() const
void setDistortionModelBrownConrady(agx::Real k1, agx::Real k2, agx::Real k3, agx::Real p1, agx::Real p2)
Set the distortion model to the five parameter Brown-Conrady model.
void setFocusDistance(agx::Real focusDistance)
Set the focus distance for manual focus control.
agx::Real getFStop() const
void setAutofocus(agx::Real minimumFocusDistance)
Set the minimum focus distance for lens autofocus.
void setFStop(agx::Real fStop)
Set the lens-aperture f-stop value.
void setFocalLength(agx::Real focalLength)
Set the lens focal length.
NeoCameraLens(NeoCamera *camera)
Initializes a camera lens with a default configuration of parameters.
OptionalFocusDistance getFocusDistance() const
const DistortionModelParameters & getDistortionModelParameters() const
DistortionModel getDistortionModel() const
agx::Real getFocalLength() const
void setDistortionModelNone()
Set the distortion model to no distortion.
bool isAutofocusEnabled() const
Base type for the outputs of the NeoCamera.
bool hasUnreadData(bool markAsRead=true)
NeoCamera * getCamera() const
void setConstantCapture(agx::Real framerate)
Set the output to constantly capture as a stream.
bool isConstantlyCapturing() const
void capture()
Tell the output to capture a frame.
OptionalFramerate getFramerate() const
NeoCameraOutput()
Default initialization of an output.
void setManualCapture()
Set the output to use manual frame-by-frame capture.
Sensor parameter specification for the NeoCamera.
agx::Real getShutterSpeed() const
void setAutoExposure(agx::Real dynamicRange)
Set the sensor to use automatic exposure control.
void setResolution(const agx::Vec2i &resolution)
Set the sensor resolution.
OptionalExposureCompensation getExposureCompensation() const
agx::Vec2 getSize() const
void setCircleOfConfusion(agx::Real circleOfConfusion)
Set the acceptable circle of confusion for the sensor.
agx::Real getCircleOfConfusion() const
void setShutterSpeed(agx::Real shutterSpeed)
Set the shutter speed of the sensor electronic shutter.
agx::Vec2i getResolution() const
void setManualExposureCompensation(agx::Real exposureCompensation)
Set the exposure compensation value for manual exposure control.
OptionalDynamicRange getDynamicRange() const
void setSize(const agx::Vec2 &size)
Set the sensor rectangular (physical) size.
bool hasAutoExposureEnabled() const
void setISO(agx::Real iso)
Set the amplifier ISO value for the sensor.
NeoCameraSensor(NeoCamera *camera)
Initializes a camera sensor with a set of default parameters.
A new (as of 2026) extended camera type, allowing for more "cinematic"-like effects.
void setConnectedSimulation(agxSDK::Simulation *simulation)
Set the simulation to which this camera is connected and will sample the time from.
static void addPreviewTo(agxOSG::SceneDecorator *sceneDecorator, NeoCameraColorTextureOutput *output, const agx::Vec2 &position, const agx::Vec2 &size)
Add a preview of the given camera output in the given scene decorator.
bool add(NeoCameraOutput *output)
Add the given output to the camera.
void setReferenceIlluminance(agx::Real illuminance)
Set the reference illuminance value that a fully white pixel will correspond to.
NeoCameraLens * getLens() const
static void removePreviewFrom(agxOSG::SceneDecorator *sceneDecorator, NeoCameraColorTextureOutput *output)
Removes the preview of the given output from the given scene decorator.
agxSDK::Simulation * getConnectedSimulation() const
void registerToSceneGraph(osg::Group *sceneGraph, osg::Node *sceneNode)
Registers this camera to the given scene graph for processing.
NeoCamera()
Initializes the camera with a set of default parameters.
NeoCameraSensor * getSensor() const
agx::Real getReferenceIlluminance() const
void setViewMatrix(const osg::Matrixd &viewMatrix)
Set the view matrix of the camera.
bool remove(NeoCameraOutput *output)
Remove the given output from the camera.
static bool isSupported()
Decorates a scene with a specific AGX Rendering Style.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Base class providing referencing counted objects.
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
std::optional< agx::Real > OptionalFramerate
std::optional< agx::Real > OptionalFocusDistance
std::optional< agx::Real > OptionalExposureCompensation
std::optional< agx::Real > OptionalDynamicRange
std::array< agx::Real, 5 > DistortionModelParameters
std::optional< agx::Real > OptionalFocusMinimumDistance