Libargus API
Libargus Camera API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
CameraDevice.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2016-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * * Redistributions of source code must retain the above copyright
16  * notice, this list of conditions and the following disclaimer.
17  * * Redistributions in binary form must reproduce the above copyright
18  * notice, this list of conditions and the following disclaimer in the
19  * documentation and/or other materials provided with the distribution.
20  * * Neither the name of NVIDIA CORPORATION nor the names of its
21  * contributors may be used to endorse or promote products derived
22  * from this software without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
25  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
28  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
30  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
31  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
32  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35  */
36 
37 /**
38  * @file
39  * <b>Libargus API: Camera Device API</b>
40  *
41  * @b Description: This file defines objects representing a single camera device.
42  */
43 
44 #ifndef _ARGUS_CAMERA_DEVICE_H
45 #define _ARGUS_CAMERA_DEVICE_H
46 
47 namespace Argus
48 {
49 
50 /**
51  * Object representing a single camera device.
52  *
53  * CameraDevices are provided by a CameraProvider and are used to
54  * access the camera devices available within the system.
55  * Each device is based on a single sensor or a set of synchronized sensors.
56  *
57  * @see ICameraProvider::getCameraDevices
58  *
59  * @defgroup ArgusCameraDevice CameraDevice
60  * @ingroup ArgusObjects
61  */
63 {
64 protected:
66 };
67 
68 /**
69  * @class ICameraProperties
70  *
71  * Interface to the core CameraDevice properties.
72  *
73  * @ingroup ArgusCameraDevice
74  */
75 DEFINE_UUID(InterfaceID, IID_CAMERA_PROPERTIES, 436d2a73,c85b,4a29,bce5,15,60,6e,35,86,91);
77 {
78 public:
79  static const InterfaceID& id() { return IID_CAMERA_PROPERTIES; }
80 
81  /**
82  * Returns the camera UUID.
83  *
84  * In UUID, clock_seq contains low 16 bits of GUID,
85  * node[6] contains high 48 bits of GUID.
86  */
87  virtual UUID getUUID() const = 0;
88 
89  /**
90  * Returns the camera sensor placement position on the module.
91  */
92  virtual SensorPlacement getSensorPlacement() const = 0;
93 
94  /**
95  * Returns the maximum number of regions of interest supported by AE.
96  * A value of 0 means that the entire image is the only supported region of interest.
97  *
98  * @see IAutoControlSettings::setAeRegions()
99  */
100  virtual uint32_t getMaxAeRegions() const = 0;
101 
102  /**
103  * Returns the minimum size of resultant region required by AE.
104  *
105  * @see IAutoControlSettings::setAeRegions()
106  */
107  virtual Size2D<uint32_t> getMinAeRegionSize() const = 0;
108 
109  /**
110  * Returns the maximum number of regions of interest supported by AWB.
111  * A value of 0 means that the entire image is the only supported region of interest.
112  *
113  * @see IAutoControlSettings::setAwbRegions()
114  */
115  virtual uint32_t getMaxAwbRegions() const = 0;
116 
117  /**
118  * Returns the maximum number of regions of interest supported by AF.
119  * A value of 0 means that the entire image is the only supported region of interest.
120  *
121  * @see IAutoControlSettings::setAfRegions()
122  */
123  virtual uint32_t getMaxAfRegions() const = 0;
124 
125  /**
126  * Returns only the basic available sensor modes that do not have an associated
127  * extension. Basic mode types include Depth, RGB, YUV and Bayer types.
128  *
129  * @param[out] modes A vector that will be populated with the sensor modes.
130  *
131  * @returns success/status of the call.
132  */
133  virtual Status getBasicSensorModes(std::vector<SensorMode*>* modes) const = 0;
134 
135  /**
136  * Returns all the available sensor modes including the ones that have extensions.
137  * The extended modes support some form of Wide Dynamic Range (WDR) technology.
138  *
139  * All the returned modes will support the basic sensor mode interface.
140  * @see ISensorMode
141  *
142  * @param[out] modes A vector that will be populated with the sensor modes.
143  *
144  * @returns success/status of the call.
145  */
146  virtual Status getAllSensorModes(std::vector<SensorMode*>* modes) const = 0;
147 
148  /**
149  * Returns all the recommended aperture positions.
150  *
151  * @param[out] positions a vector that will be populated with the aperture positions.
152  *
153  * @returns success/status of the call.
154  */
155  virtual Status getAperturePositions(std::vector<int32_t>* positions) const = 0;
156 
157  /**
158  * Returns all the available aperture f-numbers.
159  *
160  * @param[out] fnumbers A pointer to a vector to be populated with the
161  * aperture f-numbers.
162  *
163  * @returns success/status of the call.
164  */
165  virtual Status getAvailableApertureFNumbers(std::vector<float>* fnumbers) const = 0;
166 
167  /**
168  * Returns the valid range of focuser positions.
169  * The units are focuser steps.
170  */
171  virtual Range<int32_t> getFocusPositionRange() const = 0;
172 
173  /**
174  * Returns the valid range of aperture positions.
175  * The units are aperture positions.
176  */
177  virtual Range<int32_t> getAperturePositionRange() const = 0;
178 
179  /**
180  * Returns the valid range of aperture step positions per second.
181  * The units are aperture motor steps/second.
182  */
183  virtual Range<float> getApertureMotorSpeedRange() const = 0;
184 
185  /**
186  * Returns the supported range of ISP digital gain.
187  */
188  virtual Range<float> getIspDigitalGainRange() const = 0;
189 
190  /**
191  * Returns the supported range of Exposure Compensation.
192  */
193  virtual Range<float> getExposureCompensationRange() const = 0;
194 
195  /**
196  * Returns the model name of the device.
197  */
198  virtual const std::string& getModelName() const = 0;
199 
200  /**
201  * Returns the module string for the device.
202  * Contains the device's name, position, and partial model number.
203  * This string is unique for each device on the system.
204  */
205  virtual const std::string& getModuleString() const = 0;
206 
207 protected:
209 };
210 
211 /**
212  * Child object representing a CameraDevice's sensor mode, returned by
213  * ICameraProperties::getAllSensorModes
214  *
215  * @defgroup ArgusSensorMode SensorMode
216  * @ingroup ArgusCameraDevice
217  */
219 {
220 protected:
222 };
223 
224 /**
225  * @class ISensorMode
226  *
227  * Interface to the core properties of a SensorMode.
228  *
229  * @ingroup ArgusSensorMode
230  */
231 DEFINE_UUID(InterfaceID, IID_SENSOR_MODE, e69015e0,db2a,11e5,a837,18,00,20,0c,9a,66);
232 class ISensorMode : public Interface
233 {
234 public:
235  static const InterfaceID& id() { return IID_SENSOR_MODE; }
236 
237  /**
238  * Returns the image resolution, in pixels.
239  */
240  virtual Size2D<uint32_t> getResolution() const = 0;
241 
242  /**
243  * Returns the sensor crop region
244  */
245  virtual Rectangle<uint32_t> getCrop() const = 0;
246 
247  /**
248  * Returns the binning factor
249  */
250  virtual float getBinningFactor() const = 0;
251 
252  /**
253  * Returns the supported exposure time range (in nanoseconds).
254  */
255  virtual Range<uint64_t> getExposureTimeRange() const = 0;
256 
257  /**
258  * Returns the hdr ratio range, it is the ratio of long exposure vs short exposure.
259  * When min and/or max is greater than 1, long exposure range is given by getExposureTimeRange()
260  * and short exposure range is computed as following:
261  * short exposure min = getExposureTimeRange().min() / getHdrRatioRange().max()
262  * short exposure max = getExposureTimeRange().max() / getHdrRatioRange().min().
263  */
264  virtual Range<float> getHdrRatioRange() const = 0;
265 
266  /**
267  * Returns the supported frame duration range (in nanoseconds).
268  */
269  virtual Range<uint64_t> getFrameDurationRange() const = 0;
270 
271  /**
272  * Returns the supported analog gain range.
273  */
274  virtual Range<float> getAnalogGainRange() const = 0;
275 
276  /**
277  * Returns the bit depth of the image captured by the image sensor in the
278  * current mode. For example, a wide dynamic range image sensor capturing
279  * 16 bits per pixel would have an input bit depth of 16.
280  */
281  virtual uint32_t getInputBitDepth() const = 0;
282 
283  /**
284  * Returns the bit depth of the image returned from the image sensor in the
285  * current mode. For example, a wide dynamic range image sensor capturing
286  * 16 bits per pixel might be connected through a Camera Serial Interface
287  * (CSI-3) which is limited to 12 bits per pixel. The sensor would have to
288  * compress the image internally and would have an output bit depth not
289  * exceeding 12.
290  */
291  virtual uint32_t getOutputBitDepth() const = 0;
292 
293  /**
294  * Describes the type of the sensor (Bayer, Yuv, etc.) and key modes of
295  * operation which are enabled in the sensor mode (Wide-dynamic range,
296  * Piecewise Linear Compressed output, etc.)
297  */
298  virtual SensorModeType getSensorModeType() const = 0;
299 
300  /**
301  * Describes the bayer phase of Bayer mode
302  */
303  virtual BayerPhase getBayerPhase() const = 0;
304 
305  /**
306  * Checks if the buffer provided is supported by the camera device.
307  */
308  virtual bool isBufferFormatSupported(Buffer* buffer) const = 0;
309 protected:
311 };
312 
313 } // namespace Argus
314 
315 #endif // _ARGUS_CAMERA_DEVICE_H