L4T Multimedia API Reference

28.2 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-2017, 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 
36 #ifndef _ARGUS_TYPES_H
37 #define _ARGUS_TYPES_H
38 
39 #include <stdint.h>
40 #include <vector>
41 #include <string>
42 #include <assert.h>
43 
44 #include <EGL/egl.h>
45 #include <EGL/eglext.h>
46 
47 // Some versions of the Xlib.h header file define 'Status' to 'int'.
48 // This collides with the libargus 'Status' type.
49 // If 'Status' is defined then undefine it and use a typedef instead.
50 #ifdef Status
51 #undef Status
52 typedef int Status;
53 #endif // Status
54 
55 namespace Argus
56 {
57 
58 /*
59  * Forward declaration of standard objects
60  */
61 class CameraDevice;
62 class CameraProvider;
63 class CaptureSession;
64 class CaptureMetadata;
65 class CaptureMetadataContainer;
66 class Event;
67 class EventQueue;
68 class InputStream;
69 class OutputStream;
70 class OutputStreamSettings;
71 class Request;
72 class SensorMode;
73 
74 /*
75  * Forward declaration of standard interfaces
76  */
77 class ICameraProperties;
78 class ICameraProvider;
79 class ICaptureSession;
80 class IAutoControlSettings;
81 class IRequest;
82 class IStream;
83 class IStreamSettings;
84 
88 const uint64_t TIMEOUT_INFINITE = 0xFFFFFFFFFFFFFFFF;
89 
93 class ExtensionName : public NamedUUID
94 {
95 public:
96  ExtensionName(uint32_t time_low_
97  , uint16_t time_mid_
98  , uint16_t time_hi_and_version_
99  , uint16_t clock_seq_
100  , uint8_t c0, uint8_t c1, uint8_t c2, uint8_t c3, uint8_t c4, uint8_t c5
101  , const char* name)
102  : NamedUUID(time_low_, time_mid_, time_hi_and_version_, clock_seq_,
103  c0, c1, c2, c3, c4, c5, name)
104  {}
105 
107  : NamedUUID(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "EXT_UNSPECIFIED")
108  {}
109 };
110 
111 /*
112  * Named UUID classes.
113  */
114 
115 DEFINE_NAMED_UUID_CLASS(AwbMode);
116 DEFINE_NAMED_UUID_CLASS(CaptureIntent);
117 DEFINE_NAMED_UUID_CLASS(DenoiseMode);
118 DEFINE_NAMED_UUID_CLASS(EdgeEnhanceMode);
119 DEFINE_NAMED_UUID_CLASS(SensorModeType);
120 DEFINE_NAMED_UUID_CLASS(VideoStabilizationMode);
121 
122 /*
123  * Named UUIDs sorted alphabetically.
124  */
125 
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);
136 
137 DEFINE_UUID(CaptureIntent, CAPTURE_INTENT_MANUAL,
138  FB3F3663,CC62,11E5,9956,62,56,62,87,07,61);
139 DEFINE_UUID(CaptureIntent, CAPTURE_INTENT_PREVIEW,
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);
147 
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);
151 
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);
155 
156 DEFINE_UUID(SensorModeType, SENSOR_MODE_TYPE_DEPTH,
157  64483464,4b91,11e6,bbbd,40,16,7e,ab,86,92);
158 DEFINE_UUID(SensorModeType, SENSOR_MODE_TYPE_YUV,
159  6453e00c,4b91,11e6,871d,40,16,7e,ab,86,92);
160 DEFINE_UUID(SensorModeType, SENSOR_MODE_TYPE_RGB,
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);
164 
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);
169 
170 /*
171  * Camera settings constants - sorted alphabetically.
172  */
173 
175 {
180 
182 };
183 
185 {
191 
193 };
194 
196 {
201 
203 };
204 
206 {
211 
213 };
214 
218 enum Status
219 {
222 
225 
228 
231 
234 
237 
240 
243 
246 
247  // Number of elements in this enum.
249 };
250 
252 {
256 
258 };
259 
261 {
265 
268 };
269 
270 
274 class PixelFormat : public NamedUUID
275 {
276 public:
277  PixelFormat(uint32_t time_low_
278  , uint16_t time_mid_
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
282  , const char* name)
283  : NamedUUID(time_low_, time_mid_, time_hi_and_version_, clock_seq_,
284  c0, c1, c2, c3, c4, c5, name)
285  {}
286 
287 private:
288  PixelFormat(); // No default c'tor please use PIXEL_FMT_UNKNOWN
289 };
290 
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);
299 
304 {
305 protected:
307 
308 private:
309  NonCopyable(NonCopyable& other);
310  NonCopyable& operator=(NonCopyable& other);
311 };
312 
321 {
322 protected:
325 };
326 
330 class InterfaceID : public NamedUUID
331 {
332 public:
333  InterfaceID(uint32_t time_low_
334  , uint16_t time_mid_
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
338  , const char* name)
339  : NamedUUID(time_low_, time_mid_, time_hi_and_version_, clock_seq_,
340  c0, c1, c2, c3, c4, c5, name)
341  {}
342 
344  : NamedUUID(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "IID_UNSPECIFIED")
345  {}
346 };
347 
352 {
353 public:
354 
360  virtual Interface* getInterface(const InterfaceID& interfaceId) = 0;
361 
362 protected:
364 };
365 
370 template <typename TheInterface>
371 inline TheInterface* interface_cast(InterfaceProvider* obj)
372 {
373  return static_cast<TheInterface*>(obj ? obj->getInterface(TheInterface::id()): 0);
374 }
375 
376 template <typename TheInterface>
377 inline TheInterface* interface_cast(const InterfaceProvider* obj)
378 {
379  return static_cast<TheInterface*>(
380  obj ? const_cast<const Interface*>(
381  const_cast<InterfaceProvider*>(obj)->getInterface(TheInterface::id())): 0);
382 }
383 
389 {
390 public:
391 
396  virtual void destroy() = 0;
397 
398 protected:
400 };
401 
406 template<typename T>
407 class rv : public T
408 {
409  rv();
410  ~rv();
411  rv(const rv&);
412  void operator=(const rv&);
413 };
414 
415 template<typename T>
416  rv<T>& move(T& self)
417 {
418  return *static_cast<rv<T>*>(&self);
419 }
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>
435 {
436 public:
437  explicit UniqueObj(T* obj=NULL): m_obj(obj) {}
438 
439  void reset(T* obj=NULL)
440  { if (m_obj) const_cast<typename remove_const<T*>::type>(m_obj)->destroy(); m_obj = obj; }
441  T* release()
442  { T* obj = m_obj; m_obj = NULL; return obj; }
443 
444  UniqueObj( rv<UniqueObj>& moved ): m_obj(moved.release()) {}
445  UniqueObj& operator=( rv<UniqueObj>& moved ){ reset( moved.release()); return *this; }
446 
447  ~UniqueObj() { reset(); }
448 
449  T& operator*() const { return *m_obj; }
450  T* get() const { return m_obj; }
451 
452  operator bool() const { return !!m_obj; }
453 
454  operator rv<UniqueObj>&() { return *static_cast< rv<UniqueObj>*>(this); }
455  operator const rv<UniqueObj>&() const { return *static_cast<const rv<UniqueObj>*>(this); }
456 
457 private:
458  T* m_obj;
459 
460  T* operator->() const; // Prevent calling destroy() directly.
461  // Note: For getInterface functionality use interface_cast.
462 };
463 
464 template <typename TheInterface, typename TObject>
465 inline TheInterface* interface_cast(const UniqueObj<TObject>& obj)
466 {
467  return interface_cast<TheInterface>( obj.get());
468 }
469 
473 template <unsigned int N, typename T>
474 class Tuple
475 {
476 public:
477  Tuple() {}
478 
480  Tuple(T init)
481  {
482  for (unsigned int i = 0; i < N; i++)
483  m_data[i] = init;
484  }
485 
487  bool operator==(const Tuple<N,T>& rhs) const
488  {
489  return !memcmp(m_data, rhs.m_data, sizeof(m_data));
490  }
491 
493  bool operator!=(const Tuple<N,T>& rhs) const
494  {
495  return !(*this == rhs);
496  }
497 
500  {
501  for (unsigned int i = 0; i < N; i++)
502  m_data[i] += rhs.m_data[i];
503  return *this;
504  }
505 
508  {
509  for (unsigned int i = 0; i < N; i++)
510  m_data[i] -= rhs.m_data[i];
511  return *this;
512  }
513 
515  Tuple<N, T>& operator*=(const T& rhs)
516  {
517  for (unsigned int i = 0; i < N; i++)
518  m_data[i] *= rhs;
519  return *this;
520  }
521 
523  Tuple<N, T>& operator/=(const T& rhs)
524  {
525  for (unsigned int i = 0; i < N; i++)
526  m_data[i] /= rhs;
527  return *this;
528  }
529 
531  const Tuple<N, T> operator+(const Tuple<N, T>& rhs) const
532  {
533  return Tuple<N, T>(*this) += rhs;
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 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 
554  T& operator[](unsigned int i) { assert(i < N); return m_data[i]; }
555  const T& operator[](unsigned int i) const { assert(i < N); return m_data[i]; }
556 
558  static unsigned int tupleSize() { return N; }
559 
560 protected:
561  T m_data[N];
562 };
563 
569 template <typename T>
570 class BayerTuple : public Tuple<BAYER_CHANNEL_COUNT, T>
571 {
572 public:
575 
576  BayerTuple(T init)
577  {
578  r() = gEven() = gOdd() = b() = init;
579  }
580 
581  BayerTuple(T _r, T _gEven, T _gOdd, T _b)
582  {
583  r() = _r;
584  gEven() = _gEven;
585  gOdd() = _gOdd;
586  b() = _b;
587  }
588 
597 };
598 
604 template <typename T>
605 class RGBTuple : public Tuple<RGB_CHANNEL_COUNT, T>
606 {
607 public:
608  RGBTuple() {}
610 
611  RGBTuple(T init)
612  {
613  r() = g() = b() = init;
614  }
615 
616  RGBTuple(T _r, T _g, T _b)
617  {
618  r() = _r;
619  g() = _g;
620  b() = _b;
621  }
622 
629 };
630 
636 template <typename T>
637 class Point2D : public Tuple<COORDINATE_2D_COUNT, T>
638 {
639 public:
640  Point2D() {}
642 
643  Point2D(T init)
644  {
645  x() = y() = init;
646  }
647 
648  Point2D(T _x, T _y)
649  {
650  x() = _x;
651  y() = _y;
652  }
653 
658 };
659 
664 template <typename T>
665 class Size2D : public Tuple<2, T>
666 {
667 public:
668  Size2D() {}
669  Size2D(const Tuple<2, T>& other) : Tuple<2, T>(other) {}
670 
671  Size2D(T init)
672  {
673  width() = height() = init;
674  }
675 
676  Size2D(T _width, T _height)
677  {
678  width() = _width;
679  height() = _height;
680  }
681 
682  T& width() { return Tuple<2, T>::m_data[0]; }
683  const T& width() const { return Tuple<2, T>::m_data[0]; }
684  T& height() { return Tuple<2, T>::m_data[1]; }
685  const T& height() const { return Tuple<2, T>::m_data[1]; }
686 
688  T area() const { return width() * height(); }
689 };
690 
696 template <typename T>
697 class Rectangle : public Tuple<4, T>
698 {
699 public:
701  Rectangle(const Tuple<4, T>& other) : Tuple<4, T>(other) {}
702 
703  Rectangle(T init)
704  {
705  left() = top() = right() = bottom() = init;
706  }
707 
708  Rectangle(T _left, T _top, T _right, T _bottom)
709  {
710  left() = _left;
711  top() = _top;
712  right() = _right;
713  bottom() = _bottom;
714  }
715 
716  T& left() { return Tuple<4, T>::m_data[0]; }
717  const T& left() const { return Tuple<4, T>::m_data[0]; }
718  T& top() { return Tuple<4, T>::m_data[1]; }
719  const T& top() const { return Tuple<4, T>::m_data[1]; }
720  T& right() { return Tuple<4, T>::m_data[2]; }
721  const T& right() const { return Tuple<4, T>::m_data[2]; }
722  T& bottom() { return Tuple<4, T>::m_data[3]; }
723  const T& bottom() const { return Tuple<4, T>::m_data[3]; }
724 
726  T width() const { return right() - left(); }
727 
729  T height() const { return bottom() - top(); }
730 
732  T area() const { return width() * height(); }
733 };
734 
739 template <typename T>
740 class Range : public Tuple<2, T>
741 {
742 public:
743  Range() {}
744  Range(const Tuple<2, T>& other) : Tuple<2, T>(other) {}
745 
746  Range(T init)
747  {
748  min() = max() = init;
749  }
750 
751  Range(T _min, T _max)
752  {
753  min() = _min;
754  max() = _max;
755  }
756 
757  T& min() { return Tuple<2, T>::m_data[0]; }
758  const T& min() const { return Tuple<2, T>::m_data[0]; }
759  T& max() { return Tuple<2, T>::m_data[1]; }
760  const T& max() const { return Tuple<2, T>::m_data[1]; }
761 
762  bool empty() const { return max() < min(); }
763 };
764 
769 class AcRegion : public Rectangle<uint32_t>
770 {
771 public:
773  : Rectangle<uint32_t>(0, 0, 0, 0)
774  , m_weight(1.0f)
775  {}
776 
777  AcRegion(uint32_t _left, uint32_t _top, uint32_t _right, uint32_t _bottom, float _weight)
778  : Rectangle<uint32_t>(_left, _top, _right, _bottom)
779  , m_weight(_weight)
780  {}
781 
782  float& weight() { return m_weight; }
783  const float& weight() const { return m_weight; }
784 
785 protected:
786  float m_weight;
787 };
788 
796 template <typename T>
797 class Array2D
798 {
799 public:
800  // Iterator types.
801  typedef T* iterator;
802  typedef const T* const_iterator;
803 
805  Array2D() : m_size(0, 0) {}
806 
808  Array2D(const Size2D<uint32_t>& size) : m_size(size)
809  {
810  m_data.resize(size.width() * size.height());
811  }
812 
814  Array2D(const Size2D<uint32_t>& size, const T& value) : m_size(size)
815  {
816  m_data.resize(size.width() * size.height(), value);
817  }
818 
820  Array2D(const Array2D<T>& other)
821  {
822  m_data = other.m_data;
823  m_size = other.m_size;
824  }
825 
828  {
829  m_data = other.m_data;
830  m_size = other.m_size;
831  return *this;
832  }
833 
835  bool operator== (const Array2D<T>& other) const
836  {
837  return (m_size == other.m_size && m_data == other.m_data);
838  }
839 
841  Size2D<uint32_t> size() const { return m_size; }
842 
846  {
847  uint32_t s = size.width() * size.height();
848  m_data.resize(s);
849  if (m_data.size() != s)
850  return false;
851  m_size = size;
852  return true;
853  }
854 
856  inline const_iterator begin() const { return m_data.data(); }
857  inline const_iterator end() const { return m_data.data() + m_data.size(); }
858  inline iterator begin() { return m_data.data(); }
859  inline iterator end() { return m_data.data() + m_data.size(); }
860 
862  T& operator[](unsigned int i) { return m_data[checkIndex(i)]; }
863  const T& operator[](unsigned int i) const { return m_data[checkIndex(i)]; }
864 
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)]; }
868  inline const T& operator() (const Point2D<uint32_t>& p) const
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)]; }
872  inline T& operator() (const Point2D<uint32_t>& p)
873  { return m_data[checkIndex(p.x(), p.y())]; }
874 
875  // Get pointers to data.
876  inline const T* data() const { return m_data.data(); }
877  inline T* data() { return m_data.data(); }
878 
879 private:
880  inline uint32_t checkIndex(uint32_t i) const
881  {
882  assert(i < m_data.size());
883  return i;
884  }
885 
886  inline uint32_t checkIndex(uint32_t x, uint32_t y) const
887  {
888  assert(x < m_size.width());
889  assert(y < m_size.height());
890  return x + (y * m_size.width());
891  }
892 
893  std::vector<T> m_data;
894  Size2D<uint32_t> m_size;
895 };
896 
897 typedef uint32_t AutoControlId;
898 
899 } // namespace Argus
900 
901 #endif // _ARGUS_TYPES_H
Extension name UUID.
Definition: Types.h:93
Range(const Tuple< 2, T > &other)
Definition: Types.h:744
Tuple< N, T > & operator/=(const T &rhs)
Divides every element in the tuple by a single value.
Definition: Types.h:523
The base interface for a class that provides libargus Interfaces.
Definition: Types.h:351
Tuple template class.
Definition: Types.h:474
DEFINE_UUID(ExtensionName, EXT_BAYER_AVERAGE_MAP, 12c3de20, 64c5, 11e6, bdf4, 08, 00, 20, 0c, 9a, 66)
const T & max() const
Definition: Types.h:760
T * release()
Definition: Types.h:441
void reset(T *obj=NULL)
Definition: Types.h:439
T height() const
Returns the height of the rectangle.
Definition: Types.h:729
The stream or other resource has been disconnected.
Definition: Types.h:245
bool operator==(const Tuple< N, T > &rhs) const
Returns true when every element in the two tuples are identical.
Definition: Types.h:487
const T * const_iterator
Definition: Types.h:802
Status
Status values returned by API function calls.
Definition: Types.h:218
T & right()
Definition: Types.h:720
iterator end()
Definition: Types.h:859
float & weight()
Definition: Types.h:782
T & operator[](unsigned int i)
Definition: Types.h:554
AcRegion(uint32_t _left, uint32_t _top, uint32_t _right, uint32_t _bottom, float _weight)
Definition: Types.h:777
TheInterface * interface_cast(InterfaceProvider *obj)
Interface-casting helper similar to dynamic_cast.
Definition: Types.h:371
Size2D(T init)
Definition: Types.h:671
The top-level interface class.
Definition: Types.h:320
Size2D(T _width, T _height)
Definition: Types.h:676
Function succeeded.
Definition: Types.h:221
const T & width() const
Definition: Types.h:683
Pixel formats.
Definition: Types.h:274
const T & g() const
Definition: Types.h:626
Tuple(T init)
Initialize every element of the tuple to a single value.
Definition: Types.h:480
UniqueObj(rv< UniqueObj > &moved)
Definition: Types.h:444
const T & b() const
Definition: Types.h:628
AeState
Definition: Types.h:184
AwbState
Definition: Types.h:195
An operation timed out.
Definition: Types.h:239
A template class to hold a 2-dimensional array of data.
Definition: Types.h:797
const Tuple< N, T > operator*(const T &rhs) const
Returns the result of multiplying this tuple by a single value.
Definition: Types.h:543
const float & weight() const
Definition: Types.h:783
const Tuple< N, T > operator/(const T &rhs) const
Returns the result of dividing this tuple by a single value.
Definition: Types.h:549
const T & bottom() const
Definition: Types.h:723
const T & x() const
Definition: Types.h:655
T & x()
Definition: Types.h:654
const T * data() const
Definition: Types.h:876
Array2D(const Array2D< T > &other)
Copy constructor.
Definition: Types.h:820
const T & r() const
Definition: Types.h:590
Size2D template class.
Definition: Types.h:665
T m_data[N]
Definition: Types.h:561
const T & left() const
Definition: Types.h:717
bool operator==(const Array2D< T > &other) const
Equality operator.
Definition: Types.h:835
const T & top() const
Definition: Types.h:719
T & width()
Definition: Types.h:682
Point2D(T _x, T _y)
Definition: Types.h:648
Range(T _min, T _max)
Definition: Types.h:751
T area() const
Returns the area of the size (width * height).
Definition: Types.h:688
Rectangle template class.
Definition: Types.h:697
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:333
T area() const
Returns the area of the rectangle (width * height).
Definition: Types.h:732
Array2D & operator=(const Array2D< T > &other)
Assignment operator.
Definition: Types.h:827
const Tuple< N, T > operator-(const Tuple< N, T > &rhs) const
Returns the result of subtracting another tuple from this tuple.
Definition: Types.h:537
A universally unique identifier with a name (used for debugging purposes).
Definition: UUID.h:72
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:507
const T & min() const
Definition: Types.h:758
The capture was aborted.
Definition: Types.h:242
T width() const
Returns the width of the rectangle.
Definition: Types.h:726
T * iterator
Definition: Types.h:801
const T & operator[](unsigned int i) const
Definition: Types.h:555
const T & b() const
Definition: Types.h:596
const T & gEven() const
Definition: Types.h:592
T * data()
Definition: Types.h:877
const Tuple< N, T > operator+(const Tuple< N, T > &rhs) const
Returns the result of adding another tuple to this tuple.
Definition: Types.h:531
Array2D()
Default Constructor.
Definition: Types.h:805
BayerTuple(const Tuple< BAYER_CHANNEL_COUNT, T > &other)
Definition: Types.h:574
RGBTuple(const Tuple< RGB_CHANNEL_COUNT, T > &other)
Definition: Types.h:609
BayerTuple(T init)
Definition: Types.h:576
bool operator!=(const Tuple< N, T > &rhs) const
Returns true if there are any differences between the two tuples.
Definition: Types.h:493
Tuple< N, T > & operator*=(const T &rhs)
Multiplies every element in the tuple by a single value.
Definition: Types.h:515
BayerTuple template class.
Definition: Types.h:570
T & min()
Definition: Types.h:757
const T & gOdd() const
Definition: Types.h:594
AeAntibandingMode
Definition: Types.h:174
const T & operator()(uint32_t i) const
Array indexing using () operator.
Definition: Types.h:866
const T & y() const
Definition: Types.h:657
Point2D template class.
Definition: Types.h:637
const uint64_t TIMEOUT_INFINITE
Constant used for infinite timeouts.
Definition: Types.h:88
iterator begin()
Definition: Types.h:858
T & y()
Definition: Types.h:656
Range template class.
Definition: Types.h:740
float m_weight
Definition: Types.h:786
RGBTuple(T _r, T _g, T _b)
Definition: Types.h:616
Size2D(const Tuple< 2, T > &other)
Definition: Types.h:669
DEFINE_NAMED_UUID_CLASS(StreamMode)
RGBTuple template class.
Definition: Types.h:605
The requested settings are invalid.
Definition: Types.h:227
Template helper emulating C++11 rvalue semantics.
Definition: Types.h:434
Rectangle(T _left, T _top, T _right, T _bottom)
Definition: Types.h:708
Array2D(const Size2D< uint32_t > &size)
Constructor given initial array size.
Definition: Types.h:808
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:96
Point2D(const Tuple< COORDINATE_2D_COUNT, T > &other)
Definition: Types.h:641
A unique identifier for a libargus Interface.
Definition: Types.h:330
T & bottom()
Definition: Types.h:722
Rectangle(T init)
Definition: Types.h:703
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:277
Tuple< N, T > & operator+=(const Tuple< N, T > &rhs)
Adds every element of another tuple to the elements of this tuple.
Definition: Types.h:499
BayerTuple(T _r, T _gEven, T _gOdd, T _b)
Definition: Types.h:581
const T & r() const
Definition: Types.h:624
T * get() const
Definition: Types.h:450
The requested device is unavailable.
Definition: Types.h:230
T & operator*() const
Definition: Types.h:449
A top level object class for libargus objects that are created and owned by the client.
Definition: Types.h:388
Defines an autocontrol region of interest (in pixel space).
Definition: Types.h:769
const T & right() const
Definition: Types.h:721
Coordinate
Definition: Types.h:260
Range(T init)
Definition: Types.h:746
Size2D< uint32_t > size() const
Returns the size (dimensions) of the array.
Definition: Types.h:841
bool resize(const Size2D< uint32_t > &size)
Resize the array.
Definition: Types.h:845
uint32_t AutoControlId
Definition: Types.h:897
The set of parameters passed was invalid.
Definition: Types.h:224
This method has not been implemented.
Definition: Types.h:236
const_iterator begin() const
STL style iterators.
Definition: Types.h:856
const T & operator[](unsigned int i) const
Definition: Types.h:863
Point2D(T init)
Definition: Types.h:643
BayerChannel
Definition: Types.h:205
UniqueObj & operator=(rv< UniqueObj > &moved)
Definition: Types.h:445
const T & height() const
Definition: Types.h:685
const_iterator end() const
Definition: Types.h:857
RGBTuple(T init)
Definition: Types.h:611
Rectangle(const Tuple< 4, T > &other)
Definition: Types.h:701
bool empty() const
Definition: Types.h:762
T & left()
Definition: Types.h:716
T & operator[](unsigned int i)
Array indexing using [] operator.
Definition: Types.h:862
virtual Interface * getInterface(const InterfaceID &interfaceId)=0
Acquire the interface specified by interfaceId.
An operation failed because of insufficient mavailable memory.
Definition: Types.h:233
UniqueObj(T *obj=NULL)
Definition: Types.h:437
T & max()
Definition: Types.h:759
Utility class for libargus interfaces.
Definition: Types.h:303
static unsigned int tupleSize()
Returns the number of elements in the tuple.
Definition: Types.h:558
RGBChannel
Definition: Types.h:251
T & height()
Definition: Types.h:684
Array2D(const Size2D< uint32_t > &size, const T &value)
Constructor given initial array size and initial fill value.
Definition: Types.h:814