Libargus API Libargus Camera API

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
AlternatingExposure.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of NVIDIA CORPORATION nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29 /**
30 * @file
31 * <b>Libargus Extension: Alternating Exposure API</b>
32 *
33 * @b Description: This file defines the Alternating Exposure extension.
34 */
35
36 #ifndef _ARGUS_ALTERNATING_EXPOSURE_H
37 #define _ARGUS_ALTERNATING_EXPOSURE_H
38
39 namespace Argus
40 {
41
42 /**
43 * Adds interfaces for hardware based alternating exposure fuctionality.
44 *
45 * It introduces two new interfaces:
46 * - Ext::IAlternatingExposureCaps: Determines whether a device provides alternating
47 * exposure support
48 * - Ext::IAlternatingExposureSettings: configure alternating exposure settings.
49 *
50 * @defgroup ArgusExtAlternatingExposure Ext::AlternatingExposure
51 * @ingroup ArgusExtensions
52 */
53 DEFINE_UUID(ExtensionName, EXT_ALTERNATING_EXPOSURE, 5d887620,d087,11ed,b16f,08,00,20,0c,9a,66);
54
55 namespace Ext
56 {
57
58 /**
59 * @class IAlternatingExposureCaps
60 *
61 * Interface used to query the availability of hardware based alternating exposure support.
62 *
63 * @ingroup ArgusCameraDevice ArgusExtAlternatingExposure
64 */
65 DEFINE_UUID(InterfaceID, IID_ALTERNATING_EXPOSURE_CAPS, 5d887621,d087,11ed,b16f,08,00,20,0c,9a,66);
66 class IAlternatingExposureCaps : public Interface
67 {
68 public:
69 static const InterfaceID& id() { return IID_ALTERNATING_EXPOSURE_CAPS; }
70
71 /**
72 * Returns whether alternating exposure support is available or not.
73 */
74 virtual bool supportsAlternatingExposure() const = 0;
75
76 protected:
77 ~IAlternatingExposureCaps() {}
78 };
79
80 /**
81 * @class IAlternatingExposureSettings
82 *
83 * Interface used to configure alternating exposure support provided by sensor hardware.
84 * If alternating exposure is enabled, then two sets of exposure time and analog gain
85 * values are used by the sensor in an alternating manner. One of the sets of exposure
86 * time and analog gain values are applied by the sensor for every even frame and the
87 * other set of values are applied for every odd frame.
88 *
89 * @ingroup ArgusCameraDevice ArgusExtAlternatingExposure
90 */
91 DEFINE_UUID(InterfaceID, IID_ALTERNATING_EXPOSURE_SETTINGS, 5d887622,d087,11ed,b16f,08,00,20,0c,9a,66);
92 class IAlternatingExposureSettings : public Interface
93 {
94 public:
95 static const InterfaceID& id() { return IID_ALTERNATING_EXPOSURE_SETTINGS; }
96
97 /**
98 * Used to enable or disable alternating exposure mode.
99 * @param[in] enable whether to enable alternating exposure mode.
100 */
101 virtual void setAlternatingExposureEnable(bool enable) = 0;
102
103 /**
104 * Returns if alternating exposure is enabled or not.
105 */
106 virtual bool getAlternatingExposureEnable() const = 0;
107
108 /**
109 * Sets the two exposure time values (in nanoseconds) to be used for capturing frames
110 * using alternating exposure. The first two elements of the vector @a exposure_times
111 * are used for fetching the exposure time values.
112 * @param [in] exposure_times Vector of exposure times.
113 */
114 virtual Status setAltExpExposureTimes(const std::vector<uint64_t>& exposure_times) = 0;
115
116 /**
117 * Sets the two analog gain values that will be alternately applied by the sensor
118 * on frames captured by it. The first two elements of the vector @a analog_gains
119 * are used for fetching the sensor analog gain values.
120 * @param [in] analog_gains Vector of sensor analog gain values.
121 */
122 virtual Status setAltExpAnalogGains(const std::vector<float>& analog_gains) = 0;
123
124 protected:
125 ~IAlternatingExposureSettings() {}
126 };
127
128 } // namespace Ext
129
130 } // namespace Argus
131
132 #endif // _ARGUS_ALTERNATING_EXPOSURE_H