36 #ifndef _ARGUS_TYPES_H
37 #define _ARGUS_TYPES_H
45 #include <EGL/eglext.h>
64 class CaptureMetadata;
65 class CaptureMetadataContainer;
70 class OutputStreamSettings;
77 class ICameraProperties;
78 class ICameraProvider;
79 class ICaptureSession;
80 class IAutoControlSettings;
83 class IStreamSettings;
98 , uint16_t time_hi_and_version_
100 , uint8_t c0, uint8_t c1, uint8_t c2, uint8_t c3, uint8_t c4, uint8_t c5
102 :
NamedUUID(time_low_, time_mid_, time_hi_and_version_, clock_seq_,
103 c0, c1, c2, c3, c4, c5, name)
107 :
NamedUUID(0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
"EXT_UNSPECIFIED")
126 DEFINE_UUID(AwbMode, AWB_MODE_OFF, FB3F365A,CC62,11E5,9956,62,56,62,87,07,61);
127 DEFINE_UUID(AwbMode, AWB_MODE_AUTO, FB3F365B,CC62,11E5,9956,62,56,62,87,07,61);
128 DEFINE_UUID(AwbMode, AWB_MODE_INCANDESCENT, FB3F365C,CC62,11E5,9956,62,56,62,87,07,61);
129 DEFINE_UUID(AwbMode, AWB_MODE_FLUORESCENT, FB3F365D,CC62,11E5,9956,62,56,62,87,07,61);
130 DEFINE_UUID(AwbMode, AWB_MODE_WARM_FLUORESCENT, FB3F365E,CC62,11E5,9956,62,56,62,87,07,61);
131 DEFINE_UUID(AwbMode, AWB_MODE_DAYLIGHT, FB3F365F,CC62,11E5,9956,62,56,62,87,07,61);
132 DEFINE_UUID(AwbMode, AWB_MODE_CLOUDY_DAYLIGHT, FB3F3660,CC62,11E5,9956,62,56,62,87,07,61);
133 DEFINE_UUID(AwbMode, AWB_MODE_TWILIGHT, FB3F3661,CC62,11E5,9956,62,56,62,87,07,61);
134 DEFINE_UUID(AwbMode, AWB_MODE_SHADE, FB3F3662,CC62,11E5,9956,62,56,62,87,07,61);
135 DEFINE_UUID(AwbMode, AWB_MODE_MANUAL, 20FB45DA,C49F,4293,AB02,13,3F,8C,CA,DD,69);
138 FB3F3663,CC62,11E5,9956,62,56,62,87,07,61);
140 FB3F3664,CC62,11E5,9956,62,56,62,87,07,61);
141 DEFINE_UUID(CaptureIntent, CAPTURE_INTENT_STILL_CAPTURE,
142 FB3F3665,CC62,11E5,9956,62,56,62,87,07,61);
143 DEFINE_UUID(CaptureIntent, CAPTURE_INTENT_VIDEO_RECORD,
144 FB3F3666,CC62,11E5,9956,62,56,62,87,07,61);
145 DEFINE_UUID(CaptureIntent, CAPTURE_INTENT_VIDEO_SNAPSHOT,
146 FB3F3667,CC62,11E5,9956,62,56,62,87,07,61);
148 DEFINE_UUID(DenoiseMode, DENOISE_MODE_OFF, FB3F3668,CC62,11E5,9956,62,56,62,87,07,61);
149 DEFINE_UUID(DenoiseMode, DENOISE_MODE_FAST, FB3F3669,CC62,11E5,9956,62,56,62,87,07,61);
150 DEFINE_UUID(DenoiseMode, DENOISE_MODE_HIGH_QUALITY, FB3F366A,CC62,11E5,9956,62,56,62,87,07,61);
152 DEFINE_UUID(EdgeEnhanceMode, EDGE_ENHANCE_MODE_OFF, F7100B40,6A5F,11E6,BDF4,08,00,20,0C,9A,66);
153 DEFINE_UUID(EdgeEnhanceMode, EDGE_ENHANCE_MODE_FAST, F7100B41,6A5F,11E6,BDF4,08,00,20,0C,9A,66);
154 DEFINE_UUID(EdgeEnhanceMode, EDGE_ENHANCE_MODE_HIGH_QUALITY, F7100B42,6A5F,11E6,BDF4,08,00,20,0C,9A,66);
156 DEFINE_UUID(SensorModeType, SENSOR_MODE_TYPE_DEPTH,
157 64483464,4b91,11e6,bbbd,40,16,7e,ab,86,92);
159 6453e00c,4b91,11e6,871d,40,16,7e,ab,86,92);
161 6463d4c6,4b91,11e6,88a3,40,16,7e,ab,86,92);
162 DEFINE_UUID(SensorModeType, SENSOR_MODE_TYPE_BAYER,
163 646f04ea,4b91,11e6,9c06,40,16,7e,ab,86,92);
165 DEFINE_UUID(VideoStabilizationMode, VIDEO_STABILIZATION_MODE_OFF,
166 FB3F366E,CC62,11E5,9956,62,56,62,87,07,61);
167 DEFINE_UUID(VideoStabilizationMode, VIDEO_STABILIZATION_MODE_ON,
168 FB3F366F,CC62,11E5,9956,62,56,62,87,07,61);
279 , uint16_t time_hi_and_version_
280 , uint16_t clock_seq_
281 , uint8_t c0, uint8_t c1, uint8_t c2, uint8_t c3, uint8_t c4, uint8_t c5
283 :
NamedUUID(time_low_, time_mid_, time_hi_and_version_, clock_seq_,
284 c0, c1, c2, c3, c4, c5, name)
291 DEFINE_UUID(PixelFormat, PIXEL_FMT_UNKNOWN, 00000000,93d5,11e5,0000,1c,b7,2c,ef,d4,1e);
292 DEFINE_UUID(PixelFormat, PIXEL_FMT_Y8, 569be14a,93d5,11e5,91bc,1c,b7,2c,ef,d4,1e);
293 DEFINE_UUID(PixelFormat, PIXEL_FMT_Y16, 56ddb19c,93d5,11e5,8e2c,1c,b7,2c,ef,d4,1e);
294 DEFINE_UUID(PixelFormat, PIXEL_FMT_YCbCr_420_888, 570c10e6,93d5,11e5,8ff3,1c,b7,2c,ef,d4,1e);
295 DEFINE_UUID(PixelFormat, PIXEL_FMT_YCbCr_422_888, 573a7940,93d5,11e5,99c2,1c,b7,2c,ef,d4,1e);
296 DEFINE_UUID(PixelFormat, PIXEL_FMT_YCbCr_444_888, 576043dc,93d5,11e5,8983,1c,b7,2c,ef,d4,1e);
297 DEFINE_UUID(PixelFormat, PIXEL_FMT_JPEG_BLOB, 578b08c4,93d5,11e5,9686,1c,b7,2c,ef,d4,1e);
298 DEFINE_UUID(PixelFormat, PIXEL_FMT_RAW16, 57b484d8,93d5,11e5,aeb6,1c,b7,2c,ef,d4,1e);
335 , uint16_t time_hi_and_version_
336 , uint16_t clock_seq_
337 , uint8_t c0, uint8_t c1, uint8_t c2, uint8_t c3, uint8_t c4, uint8_t c5
339 :
NamedUUID(time_low_, time_mid_, time_hi_and_version_, clock_seq_,
340 c0, c1, c2, c3, c4, c5, name)
344 :
NamedUUID(0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
"IID_UNSPECIFIED")
370 template <
typename TheInterface>
373 return static_cast<TheInterface*
>(obj ? obj->
getInterface(TheInterface::id()): 0);
376 template <
typename TheInterface>
379 return static_cast<TheInterface*
>(
412 void operator=(
const rv&);
418 return *
static_cast<rv<T>*
>(&
self);
426 template <
typename T>
struct remove_const;
427 template <
typename T>
struct remove_const<const T&>{
typedef T& type; };
428 template <
typename T>
struct remove_const<const T*>{
typedef T* type; };
429 template <
typename T>
struct remove_const<const T >{
typedef T type; };
430 template <
typename T>
struct remove_const {
typedef T type; };
433 template <
typename T>
440 {
if (m_obj)
const_cast<typename remove_const<T*>::type
>(m_obj)->destroy(); m_obj = obj; }
442 { T* obj = m_obj; m_obj = NULL;
return obj; }
450 T*
get()
const {
return m_obj; }
452 operator bool()
const {
return !!m_obj; }
454 operator rv<UniqueObj>&() {
return *
static_cast< rv<UniqueObj>*
>(
this); }
455 operator const rv<UniqueObj>&()
const {
return *
static_cast<const rv<UniqueObj>*
>(
this); }
460 T* operator->()
const;
464 template <
typename TheInterface,
typename TObject>
473 template <
unsigned int N,
typename T>
482 for (
unsigned int i = 0; i < N; i++)
495 return !(*
this == rhs);
501 for (
unsigned int i = 0; i < N; i++)
509 for (
unsigned int i = 0; i < N; i++)
517 for (
unsigned int i = 0; i < N; i++)
525 for (
unsigned int i = 0; i < N; i++)
569 template <
typename T>
604 template <
typename T>
613 r() =
g() =
b() = init;
636 template <
typename T>
664 template <
typename T>
696 template <
typename T>
739 template <
typename T>
777 AcRegion(uint32_t _left, uint32_t _top, uint32_t _right, uint32_t _bottom,
float _weight)
778 :
Rectangle<uint32_t>(_left, _top, _right, _bottom)
796 template <
typename T>
816 m_data.resize(size.
width() * size.
height(), value);
822 m_data = other.m_data;
823 m_size = other.m_size;
829 m_data = other.m_data;
830 m_size = other.m_size;
837 return (m_size == other.m_size && m_data == other.m_data);
849 if (m_data.size() != s)
862 T&
operator[](
unsigned int i) {
return m_data[checkIndex(i)]; }
863 const T&
operator[](
unsigned int i)
const {
return m_data[checkIndex(i)]; }
866 inline const T&
operator() (uint32_t i)
const {
return m_data[checkIndex(i)]; }
867 inline const T&
operator() (uint32_t x, uint32_t y)
const {
return m_data[checkIndex(x, y)]; }
869 {
return m_data[checkIndex(p.
x(), p.
y())]; }
870 inline T&
operator() (uint32_t i) {
return m_data[checkIndex(i)]; }
871 inline T&
operator() (uint32_t x, uint32_t y) {
return m_data[checkIndex(x, y)]; }
873 {
return m_data[checkIndex(p.
x(), p.
y())]; }
876 inline const T*
data()
const {
return m_data.data(); }
877 inline T*
data() {
return m_data.data(); }
880 inline uint32_t checkIndex(uint32_t i)
const
882 assert(i < m_data.size());
886 inline uint32_t checkIndex(uint32_t x, uint32_t y)
const
888 assert(x < m_size.
width());
889 assert(y < m_size.
height());
890 return x + (y * m_size.
width());
893 std::vector<T> m_data;
894 Size2D<uint32_t> m_size;
901 #endif // _ARGUS_TYPES_H
Range(const Tuple< 2, T > &other)
Tuple< N, T > & operator/=(const T &rhs)
Divides every element in the tuple by a single value.
The base interface for a class that provides libargus Interfaces.
DEFINE_UUID(ExtensionName, EXT_BAYER_AVERAGE_MAP, 12c3de20, 64c5, 11e6, bdf4, 08, 00, 20, 0c, 9a, 66)
T height() const
Returns the height of the rectangle.
The stream or other resource has been disconnected.
bool operator==(const Tuple< N, T > &rhs) const
Returns true when every element in the two tuples are identical.
Status
Status values returned by API function calls.
T & operator[](unsigned int i)
AcRegion(uint32_t _left, uint32_t _top, uint32_t _right, uint32_t _bottom, float _weight)
TheInterface * interface_cast(InterfaceProvider *obj)
Interface-casting helper similar to dynamic_cast.
The top-level interface class.
Size2D(T _width, T _height)
Tuple(T init)
Initialize every element of the tuple to a single value.
UniqueObj(rv< UniqueObj > &moved)
A template class to hold a 2-dimensional array of data.
const Tuple< N, T > operator*(const T &rhs) const
Returns the result of multiplying this tuple by a single value.
const float & weight() const
const Tuple< N, T > operator/(const T &rhs) const
Returns the result of dividing this tuple by a single value.
Array2D(const Array2D< T > &other)
Copy constructor.
bool operator==(const Array2D< T > &other) const
Equality operator.
T area() const
Returns the area of the size (width * height).
Rectangle template class.
InterfaceID(uint32_t time_low_, uint16_t time_mid_, uint16_t time_hi_and_version_, uint16_t clock_seq_, uint8_t c0, uint8_t c1, uint8_t c2, uint8_t c3, uint8_t c4, uint8_t c5, const char *name)
T area() const
Returns the area of the rectangle (width * height).
Array2D & operator=(const Array2D< T > &other)
Assignment operator.
const Tuple< N, T > operator-(const Tuple< N, T > &rhs) const
Returns the result of subtracting another tuple from this tuple.
A universally unique identifier with a name (used for debugging purposes).
virtual void destroy()=0
Destroy this object.
Tuple< N, T > & operator-=(const Tuple< N, T > &rhs)
Subtracts every element of another tuple from the elements of this tuple.
T width() const
Returns the width of the rectangle.
const T & operator[](unsigned int i) const
const Tuple< N, T > operator+(const Tuple< N, T > &rhs) const
Returns the result of adding another tuple to this tuple.
Array2D()
Default Constructor.
BayerTuple(const Tuple< BAYER_CHANNEL_COUNT, T > &other)
RGBTuple(const Tuple< RGB_CHANNEL_COUNT, T > &other)
bool operator!=(const Tuple< N, T > &rhs) const
Returns true if there are any differences between the two tuples.
Tuple< N, T > & operator*=(const T &rhs)
Multiplies every element in the tuple by a single value.
BayerTuple template class.
const T & operator()(uint32_t i) const
Array indexing using () operator.
const uint64_t TIMEOUT_INFINITE
Constant used for infinite timeouts.
RGBTuple(T _r, T _g, T _b)
Size2D(const Tuple< 2, T > &other)
DEFINE_NAMED_UUID_CLASS(StreamMode)
The requested settings are invalid.
Template helper emulating C++11 rvalue semantics.
Rectangle(T _left, T _top, T _right, T _bottom)
Array2D(const Size2D< uint32_t > &size)
Constructor given initial array size.
ExtensionName(uint32_t time_low_, uint16_t time_mid_, uint16_t time_hi_and_version_, uint16_t clock_seq_, uint8_t c0, uint8_t c1, uint8_t c2, uint8_t c3, uint8_t c4, uint8_t c5, const char *name)
Point2D(const Tuple< COORDINATE_2D_COUNT, T > &other)
A unique identifier for a libargus Interface.
Tuple< N, T > & operator+=(const Tuple< N, T > &rhs)
Adds every element of another tuple to the elements of this tuple.
BayerTuple(T _r, T _gEven, T _gOdd, T _b)
The requested device is unavailable.
A top level object class for libargus objects that are created and owned by the client.
Defines an autocontrol region of interest (in pixel space).
Size2D< uint32_t > size() const
Returns the size (dimensions) of the array.
bool resize(const Size2D< uint32_t > &size)
Resize the array.
The set of parameters passed was invalid.
This method has not been implemented.
const_iterator begin() const
STL style iterators.
const T & operator[](unsigned int i) const
UniqueObj & operator=(rv< UniqueObj > &moved)
const_iterator end() const
Rectangle(const Tuple< 4, T > &other)
T & operator[](unsigned int i)
Array indexing using [] operator.
virtual Interface * getInterface(const InterfaceID &interfaceId)=0
Acquire the interface specified by interfaceId.
An operation failed because of insufficient mavailable memory.
Utility class for libargus interfaces.
static unsigned int tupleSize()
Returns the number of elements in the tuple.
Array2D(const Size2D< uint32_t > &size, const T &value)
Constructor given initial array size and initial fill value.