AGX Dynamics 2.42.1.1
Loading...
Searching...
No Matches
CameraColorOutput.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
19
20#include <agx/Matrix4x4.h>
21
22#include <array>
23
24namespace agxSensor
25{
27
32 {
33 public:
37 enum ChannelType : int32_t
38 {
39 I8 = 1,
40 U8 = 2,
41 I16 = 4,
42 U16 = 5,
43 I32 = 7,
44 U32 = 8,
45 F32 = 9,
46 I64 = 10,
47 U64 = 11,
48 F64 = 12
49 };
50
51 public:
56 static size_t sizeOf(ChannelType type);
57
62
67
72
77
82
83 public:
88
94
99
105
110
115 void setChannelCount(size_t channels);
116
120 size_t getChannelCount() const;
121
126 void setGamma(agx::Real gamma);
127
132
137 virtual void setResolution(const agx::Vec2i& resolution) override;
138
142 virtual agx::Vec2i getResolution() const override;
143
148 virtual void setConstantCapture(agx::Real framerate) override;
149
153 virtual void setManualCapture() override;
154
158 virtual bool isConstantlyCapturing() const override;
159
163 virtual OptionalFramerate getFramerate() const override;
164
168 virtual void capture() override;
169
174 virtual size_t getElementSize() const override;
175
181 virtual const BinaryOutputBuffer& getData() override;
182
189 virtual bool hasUnreadData(bool markAsRead = true) override;
190
192
193 public:
194 virtual ~CameraColorOutput() = default;
195
196 virtual void cleanup() override;
197
198 virtual void synchronizeParameters(Camera* camera, const CameraBackend& backend) override;
199 virtual void resetSynchronizationState() override;
200
202
204
205 private:
206 void ensureOutputBufferSize();
207
208 private:
209 CameraColorOutputParameters m_parameters;
210 std::array<BinaryOutputBuffer, 2u> m_output;
211 size_t m_activeOutput;
212 LazyTrigger m_dirty;
213 LazyTrigger m_addressChange;
214 LazyTrigger m_capture;
215 };
216}
#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
Buffer used for sensor output of a wide range of output element types.
Color image, or frame-by-frame video, output specification for a camera.
agx::Real getGamma() const
ChannelType getChannelType() const
static agx::Matrix4x4 makeBGRColorMappnigMatrix()
static size_t sizeOf(ChannelType type)
static agx::Matrix4x4 makeRGBColorMappingMatrix()
static agx::Matrix4x4 makeLuminanceColorMappingMatrix()
virtual size_t getElementSize() const override
Element size is the data size of one pixel of the camera output frame.
void setChannelType(ChannelType type)
Set the type for the output channel elements.
virtual void setManualCapture() override
Set the output to use manual capture.
CameraColorOutput()
Default constructor.
ChannelType
Allowed output type of each channel element.
void setColorMappingMatrix(const agx::Matrix4x4 &matrix)
Set the matrix for remapping color channels from linear RGB to the output linear space.
virtual bool isConstantlyCapturing() const override
virtual void setConstantCapture(agx::Real framerate) override
Set the output to constantly capture at the specified framerate.
agx::Matrix4x4 getColorMappingMatrix() const
size_t getChannelCount() const
virtual void capture() override
Tell the output to capture a frame.
void setGamma(agx::Real gamma)
Set the output gamma correction value.
virtual void setResolution(const agx::Vec2i &resolution) override
Set the horizontal and vertical resolution of the camera output.
virtual const BinaryOutputBuffer & getData() override
Returns access to the sensor output data.
static agx::Matrix4x4 makeBayerRGBWColorMappingMatrix()
static agx::Matrix4x4 makeBayerRGGBColorMappingMatrix()
virtual OptionalFramerate getFramerate() const override
void setChannelCount(size_t channels)
Set the number of active output channels.
virtual bool hasUnreadData(bool markAsRead=true) override
virtual agx::Vec2i getResolution() const override
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
Type for triggering effects at a later point in time.
Definition: LazyTrigger.h:28
#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
STL namespace.