L4T Multimedia API Reference

27.1 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Types.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016, 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 
37 #ifndef _ARGUS_TYPES_H
38 #define _ARGUS_TYPES_H
39 
49 #include <stdint.h>
50 #include <vector>
51 #include <string>
52 #include <assert.h>
53 
54 #include <EGL/egl.h>
55 #include <EGL/eglext.h>
56 
57 // Some versions of the Xlib.h header file define 'Status' to 'int'. This collides with the libargus
58 // 'Status' type.
59 // If 'Status' is defined then undefine it and use a typedef instead.
60 #ifdef Status
61 #undef Status
62 typedef int Status;
63 #endif // Status
64 
65 namespace Argus
66 {
67 
68 /*
69  * Forward declaration of standard objects
70  */
71 class CameraDevice;
72 class CameraProvider;
73 class CaptureSession;
74 class CaptureMetadata;
75 class CaptureMetadataContainer;
76 class Event;
77 class EventQueue;
78 class InputStream;
79 class OutputStream;
80 class OutputStreamSettings;
81 class Request;
82 class SensorMode;
83 
84 /*
85  * Forward declaration of standard interfaces
86  */
87 class ICameraProperties;
88 class ICameraProvider;
89 class ICaptureSession;
90 class IAutoControlSettings;
91 class IRequest;
92 class IStream;
93 class IStreamSettings;
94 
98 const uint64_t TIMEOUT_INFINITE = 0xFFFFFFFFFFFFFFFF;
99 
103 class ExtensionName : public NamedUUID
104 {
105 public:
106  ExtensionName(uint32_t time_low_
107  , uint16_t time_mid_
108  , uint16_t time_hi_and_version_
109  , uint16_t clock_seq_
110  , uint8_t c0, uint8_t c1, uint8_t c2, uint8_t c3, uint8_t c4, uint8_t c5
111  , const char* name)
112  : NamedUUID(time_low_, time_mid_, time_hi_and_version_, clock_seq_,
113  c0, c1, c2, c3, c4, c5, name)
114  {}
115 
117  : NamedUUID(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "EXT_UNSPECIFIED")
118  {}
119 };
120 
121 /*
122  * Named UUID classes.
123  */
124 
125 DEFINE_NAMED_UUID_CLASS(AwbMode);
126 DEFINE_NAMED_UUID_CLASS(CaptureIntent);
127 DEFINE_NAMED_UUID_CLASS(DenoiseMode);
128 DEFINE_NAMED_UUID_CLASS(EdgeEnhanceMode);
129 DEFINE_NAMED_UUID_CLASS(SensorModeType);
130 DEFINE_NAMED_UUID_CLASS(VideoStabilizationMode);
131 
132 /*
133  * Named UUIDs sorted alphabetically.
134  */
135 
136 DEFINE_UUID(AwbMode, AWB_MODE_OFF, FB3F365A,CC62,11E5,9956,62,56,62,87,07,61);
137 DEFINE_UUID(AwbMode, AWB_MODE_AUTO, FB3F365B,CC62,11E5,9956,62,56,62,87,07,61);
138 DEFINE_UUID(AwbMode, AWB_MODE_INCANDESCENT, FB3F365C,CC62,11E5,9956,62,56,62,87,07,61);
139 DEFINE_UUID(AwbMode, AWB_MODE_FLUORESCENT, FB3F365D,CC62,11E5,9956,62,56,62,87,07,61);
140 DEFINE_UUID(AwbMode, AWB_MODE_WARM_FLUORESCENT, FB3F365E,CC62,11E5,9956,62,56,62,87,07,61);
141 DEFINE_UUID(AwbMode, AWB_MODE_DAYLIGHT, FB3F365F,CC62,11E5,9956,62,56,62,87,07,61);
142 DEFINE_UUID(AwbMode, AWB_MODE_CLOUDY_DAYLIGHT, FB3F3660,CC62,11E5,9956,62,56,62,87,07,61);
143 DEFINE_UUID(AwbMode, AWB_MODE_TWILIGHT, FB3F3661,CC62,11E5,9956,62,56,62,87,07,61);
144 DEFINE_UUID(AwbMode, AWB_MODE_SHADE, FB3F3662,CC62,11E5,9956,62,56,62,87,07,61);
145 DEFINE_UUID(AwbMode, AWB_MODE_MANUAL, 20FB45DA,C49F,4293,AB02,13,3F,8C,CA,DD,69);
146 
147 DEFINE_UUID(CaptureIntent, CAPTURE_INTENT_MANUAL,
148  FB3F3663,CC62,11E5,9956,62,56,62,87,07,61);
149 DEFINE_UUID(CaptureIntent, CAPTURE_INTENT_PREVIEW,
150  FB3F3664,CC62,11E5,9956,62,56,62,87,07,61);
151 DEFINE_UUID(CaptureIntent, CAPTURE_INTENT_STILL_CAPTURE,
152  FB3F3665,CC62,11E5,9956,62,56,62,87,07,61);
153 DEFINE_UUID(CaptureIntent, CAPTURE_INTENT_VIDEO_RECORD,
154  FB3F3666,CC62,11E5,9956,62,56,62,87,07,61);
155 DEFINE_UUID(CaptureIntent, CAPTURE_INTENT_VIDEO_SNAPSHOT,
156  FB3F3667,CC62,11E5,9956,62,56,62,87,07,61);
157 
158 DEFINE_UUID(DenoiseMode, DENOISE_MODE_OFF, FB3F3668,CC62,11E5,9956,62,56,62,87,07,61);
159 DEFINE_UUID(DenoiseMode, DENOISE_MODE_FAST, FB3F3669,CC62,11E5,9956,62,56,62,87,07,61);
160 DEFINE_UUID(DenoiseMode, DENOISE_MODE_HIGH_QUALITY, FB3F366A,CC62,11E5,9956,62,56,62,87,07,61);
161 
162 DEFINE_UUID(EdgeEnhanceMode, EDGE_ENHANCE_MODE_OFF, F7100B40,6A5F,11E6,BDF4,08,00,20,0C,9A,66);
163 DEFINE_UUID(EdgeEnhanceMode, EDGE_ENHANCE_MODE_FAST, F7100B41,6A5F,11E6,BDF4,08,00,20,0C,9A,66);
164 DEFINE_UUID(EdgeEnhanceMode, EDGE_ENHANCE_MODE_HIGH_QUALITY, F7100B42,6A5F,11E6,BDF4,08,00,20,0C,9A,66);
165 
166 DEFINE_UUID(SensorModeType, SENSOR_MODE_TYPE_DEPTH,
167  64483464,4b91,11e6,bbbd,40,16,7e,ab,86,92);
168 DEFINE_UUID(SensorModeType, SENSOR_MODE_TYPE_YUV,
169  6453e00c,4b91,11e6,871d,40,16,7e,ab,86,92);
170 DEFINE_UUID(SensorModeType, SENSOR_MODE_TYPE_RGB,
171  6463d4c6,4b91,11e6,88a3,40,16,7e,ab,86,92);
172 DEFINE_UUID(SensorModeType, SENSOR_MODE_TYPE_BAYER,
173  646f04ea,4b91,11e6,9c06,40,16,7e,ab,86,92);
174 
175 DEFINE_UUID(VideoStabilizationMode, VIDEO_STABILIZATION_MODE_OFF,
176  FB3F366E,CC62,11E5,9956,62,56,62,87,07,61);
177 DEFINE_UUID(VideoStabilizationMode, VIDEO_STABILIZATION_MODE_ON,
178  FB3F366F,CC62,11E5,9956,62,56,62,87,07,61);
179 
180 /*
181  * Camera settings constants - sorted alphabetically.
182  */
183 
185 {
190 
192 };
193 
195 {
201 
203 };
204 
206 {
211 
213 };
214 
216 {
221 
223 };
224 
228 enum Status
229 {
232 
235 
238 
241 
244 
247 
250 
253 
256 
257  // Number of elements in this enum.
259 };
260 
262 {
266 
268 };
269 
271 {
275 
278 };
279 
280 
284 class PixelFormat : public NamedUUID
285 {
286 public:
287  PixelFormat(uint32_t time_low_
288  , uint16_t time_mid_
289  , uint16_t time_hi_and_version_
290  , uint16_t clock_seq_
291  , uint8_t c0, uint8_t c1, uint8_t c2, uint8_t c3, uint8_t c4, uint8_t c5
292  , const char* name)
293  : NamedUUID(time_low_, time_mid_, time_hi_and_version_, clock_seq_,
294  c0, c1, c2, c3, c4, c5, name)
295  {}
296 
297 private:
298  PixelFormat(); // No default c'tor please use PIXEL_FMT_UNKNOWN
299 };
300 
301 DEFINE_UUID(PixelFormat, PIXEL_FMT_UNKNOWN, 00000000,93d5,11e5,0000,1c,b7,2c,ef,d4,1e);
302 DEFINE_UUID(PixelFormat, PIXEL_FMT_Y8, 569be14a,93d5,11e5,91bc,1c,b7,2c,ef,d4,1e);
303 DEFINE_UUID(PixelFormat, PIXEL_FMT_Y16, 56ddb19c,93d5,11e5,8e2c,1c,b7,2c,ef,d4,1e);
304 DEFINE_UUID(PixelFormat, PIXEL_FMT_YCbCr_420_888, 570c10e6,93d5,11e5,8ff3,1c,b7,2c,ef,d4,1e);
305 DEFINE_UUID(PixelFormat, PIXEL_FMT_YCbCr_422_888, 573a7940,93d5,11e5,99c2,1c,b7,2c,ef,d4,1e);
306 DEFINE_UUID(PixelFormat, PIXEL_FMT_YCbCr_444_888, 576043dc,93d5,11e5,8983,1c,b7,2c,ef,d4,1e);
307 DEFINE_UUID(PixelFormat, PIXEL_FMT_JPEG_BLOB, 578b08c4,93d5,11e5,9686,1c,b7,2c,ef,d4,1e);
308 DEFINE_UUID(PixelFormat, PIXEL_FMT_RAW16, 57b484d8,93d5,11e5,aeb6,1c,b7,2c,ef,d4,1e);
309 
314 {
315 protected:
317 
318 private:
319  NonCopyable(NonCopyable& other);
320  NonCopyable& operator=(NonCopyable& other);
321 };
322 
331 {
332 protected:
335 };
336 
340 class InterfaceID : public NamedUUID
341 {
342 public:
343  InterfaceID(uint32_t time_low_
344  , uint16_t time_mid_
345  , uint16_t time_hi_and_version_
346  , uint16_t clock_seq_
347  , uint8_t c0, uint8_t c1, uint8_t c2, uint8_t c3, uint8_t c4, uint8_t c5
348  , const char* name)
349  : NamedUUID(time_low_, time_mid_, time_hi_and_version_, clock_seq_,
350  c0, c1, c2, c3, c4, c5, name)
351  {}
352 
354  : NamedUUID(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "IID_UNSPECIFIED")
355  {}
356 };
357 
362 {
363 public:
364 
370  virtual Interface* getInterface(const InterfaceID& interfaceId) = 0;
371 
372 protected:
374 };
375 
380 template <typename TheInterface>
381 inline TheInterface* interface_cast(InterfaceProvider* obj)
382 {
383  return static_cast<TheInterface*>(obj ? obj->getInterface(TheInterface::id()): 0);
384 }
385 
386 template <typename TheInterface>
387 inline TheInterface* interface_cast(const InterfaceProvider* obj)
388 {
389  return static_cast<TheInterface*>(
390  obj ? const_cast<const Interface*>(
391  const_cast<InterfaceProvider*>(obj)->getInterface(TheInterface::id())): 0);
392 }
393 
399 {
400 public:
401 
406  virtual void destroy() = 0;
407 
408 protected:
410 };
411 
415 template<typename T>
416 class rv : public T
417 {
418  rv();
419  ~rv();
420  rv(const rv&);
421  void operator=(const rv&);
422 };
423 
424 template<typename T>
425  rv<T>& move(T& self)
426 {
427  return *static_cast<rv<T>*>(&self);
428 }
429 
433 template <typename T> struct remove_const;
434 template <typename T> struct remove_const<const T&>{ typedef T& type; };
435 template <typename T> struct remove_const<const T*>{ typedef T* type; };
436 template <typename T> struct remove_const<const T >{ typedef T type; };
437 template <typename T> struct remove_const { typedef T type; };
438 
439 template <typename T>
441 {
442 public:
443  explicit UniqueObj(T* obj=NULL): m_obj(obj) {}
444 
445  void reset(T* obj=NULL)
446  { if (m_obj) const_cast<typename remove_const<T*>::type>(m_obj)->destroy(); m_obj = obj; }
447  T* release()
448  { T* obj = m_obj; m_obj = NULL; return obj; }
449 
450  UniqueObj( rv<UniqueObj>& moved ): m_obj(moved.release()) {}
451  UniqueObj& operator=( rv<UniqueObj>& moved ){ reset( moved.release()); return *this; }
452 
453  ~UniqueObj() { reset(); }
454 
455  T& operator*() const { return *m_obj; }
456  T* get() const { return m_obj; }
457 
458  operator bool() const { return !!m_obj; }
459 
460  operator rv<UniqueObj>&() { return *static_cast< rv<UniqueObj>*>(this); }
461  operator const rv<UniqueObj>&() const { return *static_cast<const rv<UniqueObj>*>(this); }
462 
463 private:
464  T* m_obj;
465 
466  T* operator->() const; // Prevent calling destroy() directly.
467  // Note: For getInterface functionality use interface_cast.
468 };
469 
470 template <typename TheInterface, typename TObject>
471 inline TheInterface* interface_cast(const UniqueObj<TObject>& obj)
472 {
473  return interface_cast<TheInterface>( obj.get());
474 }
475 
479 template <unsigned int N, typename T>
480 class Tuple
481 {
482 public:
483  Tuple() {}
484 
486  Tuple(T init)
487  {
488  for (unsigned int i = 0; i < N; i++)
489  m_data[i] = init;
490  }
491 
493  bool operator==(const Tuple<N,T>& rhs) const
494  {
495  return !memcmp(m_data, rhs.m_data, sizeof(m_data));
496  }
497 
499  bool operator!=(const Tuple<N,T>& rhs) const
500  {
501  return !(*this == rhs);
502  }
503 
506  {
507  for (unsigned int i = 0; i < N; i++)
508  m_data[i] += rhs.m_data[i];
509  return *this;
510  }
511 
514  {
515  for (unsigned int i = 0; i < N; i++)
516  m_data[i] -= rhs.m_data[i];
517  return *this;
518  }
519 
521  Tuple<N, T>& operator*=(const T& rhs)
522  {
523  for (unsigned int i = 0; i < N; i++)
524  m_data[i] *= rhs;
525  return *this;
526  }
527 
529  Tuple<N, T>& operator/=(const T& rhs)
530  {
531  for (unsigned int i = 0; i < N; i++)
532  m_data[i] /= rhs;
533  return *this;
534  }
535 
537  const Tuple<N, T> operator+(const Tuple<N, T>& rhs) const
538  {
539  return Tuple<N, T>(*this) += rhs;
540  }
541 
543  const Tuple<N, T> operator-(const Tuple<N, T>& rhs) const
544  {
545  return Tuple<N, T>(*this) -= rhs;
546  }
547 
549  const Tuple<N, T> operator*(const T& rhs) const
550  {
551  return Tuple<N, T>(*this) *= rhs;
552  }
553 
555  const Tuple<N, T> operator/(const T& rhs) const
556  {
557  return Tuple<N, T>(*this) /= rhs;
558  }
559 
560  T& operator[](unsigned int i) { assert(i < N); return m_data[i]; }
561  const T& operator[](unsigned int i) const { assert(i < N); return m_data[i]; }
562 
564  static unsigned int tupleSize() { return N; }
565 
566 protected:
567  T m_data[N];
568 };
569 
575 template <typename T>
576 class BayerTuple : public Tuple<BAYER_CHANNEL_COUNT, T>
577 {
578 public:
581 
582  BayerTuple(T init)
583  {
584  r() = gEven() = gOdd() = b() = init;
585  }
586 
587  BayerTuple(T _r, T _gEven, T _gOdd, T _b)
588  {
589  r() = _r;
590  gEven() = _gEven;
591  gOdd() = _gOdd;
592  b() = _b;
593  }
594 
603 };
604 
610 template <typename T>
611 class RGBTuple : public Tuple<RGB_CHANNEL_COUNT, T>
612 {
613 public:
614  RGBTuple() {}
616 
617  RGBTuple(T init)
618  {
619  r() = g() = b() = init;
620  }
621 
622  RGBTuple(T _r, T _g, T _b)
623  {
624  r() = _r;
625  g() = _g;
626  b() = _b;
627  }
628 
635 };
636 
642 template <typename T>
643 class Point2D : public Tuple<COORDINATE_2D_COUNT, T>
644 {
645 public:
646  Point2D() {}
648 
649  Point2D(T init)
650  {
651  x() = y() = init;
652  }
653 
654  Point2D(T _x, T _y)
655  {
656  x() = _x;
657  y() = _y;
658  }
659 
664 };
665 
670 template <typename T>
671 class Size2D : public Tuple<2, T>
672 {
673 public:
674  Size2D() {}
675  Size2D(const Tuple<2, T>& other) : Tuple<2, T>(other) {}
676 
677  Size2D(T init)
678  {
679  width() = height() = init;
680  }
681 
682  Size2D(T _width, T _height)
683  {
684  width() = _width;
685  height() = _height;
686  }
687 
688  T& width() { return Tuple<2, T>::m_data[0]; }
689  const T& width() const { return Tuple<2, T>::m_data[0]; }
690  T& height() { return Tuple<2, T>::m_data[1]; }
691  const T& height() const { return Tuple<2, T>::m_data[1]; }
692 
694  T area() const { return width() * height(); }
695 };
696 
702 template <typename T>
703 class Rectangle : public Tuple<4, T>
704 {
705 public:
707  Rectangle(const Tuple<4, T>& other) : Tuple<4, T>(other) {}
708 
709  Rectangle(T init)
710  {
711  left() = top() = right() = bottom() = init;
712  }
713 
714  Rectangle(T _left, T _top, T _right, T _bottom)
715  {
716  left() = _left;
717  top() = _top;
718  right() = _right;
719  bottom() = _bottom;
720  }
721 
722  T& left() { return Tuple<4, T>::m_data[0]; }
723  const T& left() const { return Tuple<4, T>::m_data[0]; }
724  T& top() { return Tuple<4, T>::m_data[1]; }
725  const T& top() const { return Tuple<4, T>::m_data[1]; }
726  T& right() { return Tuple<4, T>::m_data[2]; }
727  const T& right() const { return Tuple<4, T>::m_data[2]; }
728  T& bottom() { return Tuple<4, T>::m_data[3]; }
729  const T& bottom() const { return Tuple<4, T>::m_data[3]; }
730 
732  T width() const { return right() - left(); }
733 
735  T height() const { return bottom() - top(); }
736 
738  T area() const { return width() * height(); }
739 };
740 
745 template <typename T>
746 class Range : public Tuple<2, T>
747 {
748 public:
749  Range() {}
750  Range(const Tuple<2, T>& other) : Tuple<2, T>(other) {}
751 
752  Range(T init)
753  {
754  min() = max() = init;
755  }
756 
757  Range(T _min, T _max)
758  {
759  min() = _min;
760  max() = _max;
761  }
762 
763  T& min() { return Tuple<2, T>::m_data[0]; }
764  const T& min() const { return Tuple<2, T>::m_data[0]; }
765  T& max() { return Tuple<2, T>::m_data[1]; }
766  const T& max() const { return Tuple<2, T>::m_data[1]; }
767 
768  bool empty() const { return max() < min(); }
769 };
770 
775 class AcRegion : public Rectangle<uint32_t>
776 {
777 public:
779  : Rectangle<uint32_t>(0, 0, 0, 0)
780  , m_weight(1.0f)
781  {}
782 
783  AcRegion(uint32_t _left, uint32_t _top, uint32_t _right, uint32_t _bottom, float _weight)
784  : Rectangle<uint32_t>(_left, _top, _right, _bottom)
785  , m_weight(_weight)
786  {}
787 
788  float& weight() { return m_weight; }
789  const float& weight() const { return m_weight; }
790 
791 protected:
792  float m_weight;
793 };
794 
802 template <typename T>
803 class Array2D
804 {
805 public:
806  // Iterator types.
807  typedef T* iterator;
808  typedef const T* const_iterator;
809 
811  Array2D() : m_size(0, 0) {}
812 
814  Array2D(const Size2D<uint32_t>& size) : m_size(size)
815  {
816  m_data.resize(size.width() * size.height());
817  }
818 
820  Array2D(const Size2D<uint32_t>& size, const T& value) : m_size(size)
821  {
822  m_data.resize(size.width() * size.height(), value);
823  }
824 
826  Array2D(const Array2D<T>& other)
827  {
828  m_data = other.m_data;
829  m_size = other.m_size;
830  }
831 
834  {
835  m_data = other.m_data;
836  m_size = other.m_size;
837  return *this;
838  }
839 
841  bool operator== (const Array2D<T>& other) const
842  {
843  return (m_size == other.m_size && m_data == other.m_data);
844  }
845 
847  Size2D<uint32_t> size() const { return m_size; }
848 
852  {
853  uint32_t s = size.width() * size.height();
854  m_data.resize(s);
855  if (m_data.size() != s)
856  return false;
857  m_size = size;
858  return true;
859  }
860 
862  inline const_iterator begin() const { return m_data.data(); }
863  inline const_iterator end() const { return m_data.data() + m_data.size(); }
864  inline iterator begin() { return m_data.data(); }
865  inline iterator end() { return m_data.data() + m_data.size(); }
866 
868  T& operator[](unsigned int i) { return m_data[checkIndex(i)]; }
869  const T& operator[](unsigned int i) const { return m_data[checkIndex(i)]; }
870 
872  inline const T& operator() (uint32_t i) const { return m_data[checkIndex(i)]; }
873  inline const T& operator() (uint32_t x, uint32_t y) const { return m_data[checkIndex(x, y)]; }
874  inline const T& operator() (const Point2D<uint32_t>& p) const
875  { return m_data[checkIndex(p.x(), p.y())]; }
876  inline T& operator() (uint32_t i) { return m_data[checkIndex(i)]; }
877  inline T& operator() (uint32_t x, uint32_t y) { return m_data[checkIndex(x, y)]; }
878  inline T& operator() (const Point2D<uint32_t>& p)
879  { return m_data[checkIndex(p.x(), p.y())]; }
880 
881  // Get pointers to data.
882  inline const T* data() const { return m_data.data(); }
883  inline T* data() { return m_data.data(); }
884 
885 private:
886  inline uint32_t checkIndex(uint32_t i) const
887  {
888  assert(i < m_data.size());
889  return i;
890  }
891 
892  inline uint32_t checkIndex(uint32_t x, uint32_t y) const
893  {
894  assert(x < m_size.width());
895  assert(y < m_size.height());
896  return x + (y * m_size.width());
897  }
898 
899  std::vector<T> m_data;
900  Size2D<uint32_t> m_size;
901 };
902 
903 typedef uint32_t AutoControlId;
904 
905 } // namespace Argus
907 #endif // _ARGUS_TYPES_H
Extension name UUID.
Definition: Types.h:103
Range(const Tuple< 2, T > &other)
Definition: Types.h:750
Tuple< N, T > & operator/=(const T &rhs)
Divides every element in the tuple by a single value.
Definition: Types.h:529
The base interface for a class that provides libargus Interfaces.
Definition: Types.h:361
Tuple template class.
Definition: Types.h:480
const T & max() const
Definition: Types.h:766
T * release()
Definition: Types.h:447
void reset(T *obj=NULL)
Definition: Types.h:445
T height() const
Returns the height of the rectangle.
Definition: Types.h:735
The stream or other resource has been disconnected.
Definition: Types.h:255
bool operator==(const Tuple< N, T > &rhs) const
Returns true when every element in the two tuples are identical.
Definition: Types.h:493
const T * const_iterator
Definition: Types.h:808
Status
Status values returned by API function calls.
Definition: Types.h:228
T & right()
Definition: Types.h:726
iterator end()
Definition: Types.h:865
float & weight()
Definition: Types.h:788
T & operator[](unsigned int i)
Definition: Types.h:560
AcRegion(uint32_t _left, uint32_t _top, uint32_t _right, uint32_t _bottom, float _weight)
Definition: Types.h:783
TheInterface * interface_cast(InterfaceProvider *obj)
Interface-casting helper similar to dynamic_cast.
Definition: Types.h:381
Size2D(T init)
Definition: Types.h:677
The top-level interface class.
Definition: Types.h:330
Size2D(T _width, T _height)
Definition: Types.h:682
Function succeeded.
Definition: Types.h:231
const T & width() const
Definition: Types.h:689
Pixel formats.
Definition: Types.h:284
const T & g() const
Definition: Types.h:632
Tuple(T init)
Initialize every element of the tuple to a single value.
Definition: Types.h:486
UniqueObj(rv< UniqueObj > &moved)
Definition: Types.h:450
const T & b() const
Definition: Types.h:634
AeState
Definition: Types.h:194
AwbState
Definition: Types.h:205
An operation timed out.
Definition: Types.h:249
A template class to hold a 2-dimensional array of data.
Definition: Types.h:803
const Tuple< N, T > operator*(const T &rhs) const
Returns the result of multiplying this tuple by a single value.
Definition: Types.h:549
const float & weight() const
Definition: Types.h:789
const Tuple< N, T > operator/(const T &rhs) const
Returns the result of dividing this tuple by a single value.
Definition: Types.h:555
const T & bottom() const
Definition: Types.h:729
const T & x() const
Definition: Types.h:661
T & x()
Definition: Types.h:660
const T * data() const
Definition: Types.h:882
Array2D(const Array2D< T > &other)
Copy constructor.
Definition: Types.h:826
const T & r() const
Definition: Types.h:596
Size2D template class.
Definition: Types.h:671
T m_data[N]
Definition: Types.h:567
const T & left() const
Definition: Types.h:723
bool operator==(const Array2D< T > &other) const
Equality operator.
Definition: Types.h:841
const T & top() const
Definition: Types.h:725
T & width()
Definition: Types.h:688
Point2D(T _x, T _y)
Definition: Types.h:654
Range(T _min, T _max)
Definition: Types.h:757
T area() const
Returns the area of the size (width * height).
Definition: Types.h:694
Rectangle template class.
Definition: Types.h:703
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)
Definition: Types.h:343
T area() const
Returns the area of the rectangle (width * height).
Definition: Types.h:738
Array2D & operator=(const Array2D< T > &other)
Assignment operator.
Definition: Types.h:833
const Tuple< N, T > operator-(const Tuple< N, T > &rhs) const
Returns the result of subtracting another tuple from this tuple.
Definition: Types.h:543
DEFINE_UUID(ExtensionName, EXT_BAYER_SHARPNESS_MAP, 7d5e0470, 4ea6, 11e6, bdf4, 08, 00, 20, 0c, 9a, 66)
The Ext::BayerSharpnessMap extension adds internally-generated sharpness metrics to CaptureMetadata r...
A unique identifier with a name (primarily for debugging purposes).
Definition: UUID.h:75
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.
Definition: Types.h:513
const T & min() const
Definition: Types.h:764
The capture was aborted.
Definition: Types.h:252
T width() const
Returns the width of the rectangle.
Definition: Types.h:732
T * iterator
Definition: Types.h:807
const T & operator[](unsigned int i) const
Definition: Types.h:561
const T & b() const
Definition: Types.h:602
const T & gEven() const
Definition: Types.h:598
T * data()
Definition: Types.h:883
const Tuple< N, T > operator+(const Tuple< N, T > &rhs) const
Returns the result of adding another tuple to this tuple.
Definition: Types.h:537
Array2D()
Default Constructor.
Definition: Types.h:811
BayerTuple(const Tuple< BAYER_CHANNEL_COUNT, T > &other)
Definition: Types.h:580
RGBTuple(const Tuple< RGB_CHANNEL_COUNT, T > &other)
Definition: Types.h:615
BayerTuple(T init)
Definition: Types.h:582
bool operator!=(const Tuple< N, T > &rhs) const
Returns true if there are any differences between the two tuples.
Definition: Types.h:499
Tuple< N, T > & operator*=(const T &rhs)
Multiplies every element in the tuple by a single value.
Definition: Types.h:521
BayerTuple template class.
Definition: Types.h:576
T & min()
Definition: Types.h:763
const T & gOdd() const
Definition: Types.h:600
AeAntibandingMode
Definition: Types.h:184
const T & operator()(uint32_t i) const
Array indexing using () operator.
Definition: Types.h:872
const T & y() const
Definition: Types.h:663
Point2D template class.
Definition: Types.h:643
const uint64_t TIMEOUT_INFINITE
Constant used for infinite timeouts.
Definition: Types.h:98
iterator begin()
Definition: Types.h:864
T & y()
Definition: Types.h:662
Range template class.
Definition: Types.h:746
float m_weight
Definition: Types.h:792
RGBTuple(T _r, T _g, T _b)
Definition: Types.h:622
Size2D(const Tuple< 2, T > &other)
Definition: Types.h:675
DEFINE_NAMED_UUID_CLASS(StreamMode)
RGBTuple template class.
Definition: Types.h:611
The requested settings are invalid.
Definition: Types.h:237
Rectangle(T _left, T _top, T _right, T _bottom)
Definition: Types.h:714
Array2D(const Size2D< uint32_t > &size)
Constructor given initial array size.
Definition: Types.h:814
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)
Definition: Types.h:106
Point2D(const Tuple< COORDINATE_2D_COUNT, T > &other)
Definition: Types.h:647
A unique identifier for an libargus Interface.
Definition: Types.h:340
T & bottom()
Definition: Types.h:728
Rectangle(T init)
Definition: Types.h:709
PixelFormat(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)
Definition: Types.h:287
Tuple< N, T > & operator+=(const Tuple< N, T > &rhs)
Adds every element of another tuple to the elements of this tuple.
Definition: Types.h:505
BayerTuple(T _r, T _gEven, T _gOdd, T _b)
Definition: Types.h:587
const T & r() const
Definition: Types.h:630
T * get() const
Definition: Types.h:456
The requested device is unavailable.
Definition: Types.h:240
T & operator*() const
Definition: Types.h:455
A top level object class for libargus objects that are created and owned by the client.
Definition: Types.h:398
Defines an autocontrol region of interest (in pixel space).
Definition: Types.h:775
const T & right() const
Definition: Types.h:727
Coordinate
Definition: Types.h:270
Range(T init)
Definition: Types.h:752
Size2D< uint32_t > size() const
Returns the size (dimensions) of the array.
Definition: Types.h:847
bool resize(const Size2D< uint32_t > &size)
Resize the array.
Definition: Types.h:851
uint32_t AutoControlId
Definition: Types.h:903
The set of parameters passed was invalid.
Definition: Types.h:234
This method has not been implemented.
Definition: Types.h:246
const_iterator begin() const
STL style iterators.
Definition: Types.h:862
rv< T > & move(T &self)
Definition: Types.h:425
Movable smart pointer mimicking std::unique_ptr.
Definition: Types.h:433
const T & operator[](unsigned int i) const
Definition: Types.h:869
Point2D(T init)
Definition: Types.h:649
BayerChannel
Definition: Types.h:215
UniqueObj & operator=(rv< UniqueObj > &moved)
Definition: Types.h:451
const T & height() const
Definition: Types.h:691
const_iterator end() const
Definition: Types.h:863
RGBTuple(T init)
Definition: Types.h:617
Rectangle(const Tuple< 4, T > &other)
Definition: Types.h:707
bool empty() const
Definition: Types.h:768
T & left()
Definition: Types.h:722
Template helper emulating C++11 rvalue semantics.
Definition: Types.h:416
T & operator[](unsigned int i)
Array indexing using [] operator.
Definition: Types.h:868
virtual Interface * getInterface(const InterfaceID &interfaceId)=0
Acquire the interface specified by interfaceId.
An operation failed because of insufficient mavailable memory.
Definition: Types.h:243
UniqueObj(T *obj=NULL)
Definition: Types.h:443
T & max()
Definition: Types.h:765
Utility class for libargus interfaces.
Definition: Types.h:313
static unsigned int tupleSize()
Returns the number of elements in the tuple.
Definition: Types.h:564
RGBChannel
Definition: Types.h:261
T & height()
Definition: Types.h:690
Array2D(const Size2D< uint32_t > &size, const T &value)
Constructor given initial array size and initial fill value.
Definition: Types.h:820