AGX Dynamics 2.42.1.1
Loading...
Searching...
No Matches
CameraOutput.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
20
21#include <agx/Vec2.h>
22
23#include <optional>
24
25namespace agxSensor
26{
27 using OptionalFramerate = std::optional<agx::Real>;
28
30
35 : public SystemNode
36 , public ISensorOutput
37 {
38 public:
42 ICameraOutput() = default;
43
48 virtual void setResolution(const agx::Vec2i& resolution) = 0;
49
53 virtual agx::Vec2i getResolution() const = 0;
54
59 virtual void setConstantCapture(agx::Real framerate) = 0;
60
64 virtual void setManualCapture() = 0;
65
69 virtual bool isConstantlyCapturing() const = 0;
70
74 virtual OptionalFramerate getFramerate() const = 0;
75
79 virtual void capture() = 0;
80
85 virtual size_t getElementSize() const override = 0;
86
92 virtual const BinaryOutputBuffer& getData() override = 0;
93
100 virtual bool hasUnreadData( bool markAsRead = true ) override = 0;
101
103
104 public:
105 virtual void synchronizeParameters(Camera* camera, const CameraBackend& backend) = 0;
106 virtual void resetSynchronizationState() = 0;
107
109
111 };
112
114
115#pragma pack(push, 1)
116 template <typename Type, size_t Size>
117 struct CameraOutputValue
118 {
119 Type channels[Size];
120
121 inline CameraOutputValue() = default;
122 inline CameraOutputValue(const CameraOutputValue&) = default;
123
124 inline Type operator[](size_t i) const noexcept { return channels[i]; }
125
126 inline Type& operator[](size_t i) noexcept { return channels[i]; }
127 };
128#pragma pack(pop)
129
131}
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(T)
Use this in a pure abstract Serializable class to add the required methods Important: Use full namesp...
Definition: Serializable.h:221
#define AGXSENSOR_EXPORT
Buffer used for sensor output of a wide range of output element types.
Camera instance class defined by a frame/transform and a model.
Common interface for camera outputs containing the basics that can be assumed about a frame-based cam...
Definition: CameraOutput.h:37
virtual void setResolution(const agx::Vec2i &resolution)=0
Set the horizontal and vertical resolution of the camera output.
virtual const BinaryOutputBuffer & getData() override=0
Returns access to the sensor output data.
virtual void capture()=0
Tell the output to capture a frame.
virtual size_t getElementSize() const override=0
"Element size" is the summed data size of the currently added sensor output fields.
virtual void setConstantCapture(agx::Real framerate)=0
Set the output to constantly capture at the specified framerate.
virtual OptionalFramerate getFramerate() const =0
virtual agx::Vec2i getResolution() const =0
virtual bool isConstantlyCapturing() const =0
ICameraOutput()=default
Default constructor.
virtual void setManualCapture()=0
Set the output to use manual capture.
virtual bool hasUnreadData(bool markAsRead=true) override=0
Common interface for sensor output data.
Definition: SensorOutput.h:27
System node is a separate step/operation in an execution tree representing a sensor (or such) in a se...
Definition: SystemNode.h:44
#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 > OptionalFramerate
Definition: CameraOutput.h:27
double Real
Definition: Real.h:41