L4T Multimedia API Reference

28.1 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Argus::Array2D< T > Class Template Reference

Detailed Description

template<typename T>
class Argus::Array2D< T >

A template class to hold a 2-dimensional array of data.

Data in this array is tightly packed in a 1-dimensional vector in row-major order; that is, the vector index for any value given its 2-dimensional location (Point2D) is index = location.x() + (location.y() * size.x()); Indexing operators using iterators, 1-dimensional, or 2-dimensional coordinates are provided.

Definition at line 797 of file Types.h.

Public Types

typedef T * iterator
 
typedef const T * const_iterator
 

Public Member Functions

 Array2D ()
 Default Constructor. More...
 
 Array2D (const Size2D< uint32_t > &size)
 Constructor given initial array size. More...
 
 Array2D (const Size2D< uint32_t > &size, const T &value)
 Constructor given initial array size and initial fill value. More...
 
 Array2D (const Array2D< T > &other)
 Copy constructor. More...
 
Array2Doperator= (const Array2D< T > &other)
 Assignment operator. More...
 
bool operator== (const Array2D< T > &other) const
 Equality operator. More...
 
Size2D< uint32_t > size () const
 Returns the size (dimensions) of the array. More...
 
bool resize (const Size2D< uint32_t > &size)
 Resize the array. More...
 
const_iterator begin () const
 STL style iterators. More...
 
const_iterator end () const
 
iterator begin ()
 
iterator end ()
 
T & operator[] (unsigned int i)
 Array indexing using [] operator. More...
 
const T & operator[] (unsigned int i) const
 
const T & operator() (uint32_t i) const
 Array indexing using () operator. More...
 
const T & operator() (uint32_t x, uint32_t y) const
 
const T & operator() (const Point2D< uint32_t > &p) const
 
T & operator() (uint32_t i)
 
T & operator() (uint32_t x, uint32_t y)
 
T & operator() (const Point2D< uint32_t > &p)
 
const T * data () const
 
T * data ()
 

Member Typedef Documentation

template<typename T>
typedef const T* Argus::Array2D< T >::const_iterator

Definition at line 802 of file Types.h.

template<typename T>
typedef T* Argus::Array2D< T >::iterator

Definition at line 801 of file Types.h.

Constructor & Destructor Documentation

template<typename T>
Argus::Array2D< T >::Array2D ( )
inline

Default Constructor.

Definition at line 805 of file Types.h.

template<typename T>
Argus::Array2D< T >::Array2D ( const Size2D< uint32_t > &  size)
inline

Constructor given initial array size.

Definition at line 808 of file Types.h.

References Argus::Size2D< T >::height(), and Argus::Size2D< T >::width().

template<typename T>
Argus::Array2D< T >::Array2D ( const Size2D< uint32_t > &  size,
const T &  value 
)
inline

Constructor given initial array size and initial fill value.

Definition at line 814 of file Types.h.

References Argus::Size2D< T >::height(), and Argus::Size2D< T >::width().

template<typename T>
Argus::Array2D< T >::Array2D ( const Array2D< T > &  other)
inline

Copy constructor.

Definition at line 820 of file Types.h.

Member Function Documentation

template<typename T>
const_iterator Argus::Array2D< T >::begin ( ) const
inline

STL style iterators.

Definition at line 856 of file Types.h.

template<typename T>
iterator Argus::Array2D< T >::begin ( )
inline

Definition at line 858 of file Types.h.

template<typename T>
const T* Argus::Array2D< T >::data ( ) const
inline

Definition at line 876 of file Types.h.

template<typename T>
T* Argus::Array2D< T >::data ( )
inline

Definition at line 877 of file Types.h.

template<typename T>
const_iterator Argus::Array2D< T >::end ( ) const
inline

Definition at line 857 of file Types.h.

template<typename T>
iterator Argus::Array2D< T >::end ( )
inline

Definition at line 859 of file Types.h.

template<typename T>
const T& Argus::Array2D< T >::operator() ( uint32_t  i) const
inline

Array indexing using () operator.

Definition at line 866 of file Types.h.

template<typename T>
const T& Argus::Array2D< T >::operator() ( uint32_t  x,
uint32_t  y 
) const
inline

Definition at line 867 of file Types.h.

template<typename T>
const T& Argus::Array2D< T >::operator() ( const Point2D< uint32_t > &  p) const
inline

Definition at line 868 of file Types.h.

References Argus::Point2D< T >::x(), and Argus::Point2D< T >::y().

template<typename T>
T& Argus::Array2D< T >::operator() ( uint32_t  i)
inline

Definition at line 870 of file Types.h.

template<typename T>
T& Argus::Array2D< T >::operator() ( uint32_t  x,
uint32_t  y 
)
inline

Definition at line 871 of file Types.h.

template<typename T>
T& Argus::Array2D< T >::operator() ( const Point2D< uint32_t > &  p)
inline

Definition at line 872 of file Types.h.

References Argus::Point2D< T >::x(), and Argus::Point2D< T >::y().

template<typename T>
Array2D& Argus::Array2D< T >::operator= ( const Array2D< T > &  other)
inline

Assignment operator.

Definition at line 827 of file Types.h.

template<typename T>
bool Argus::Array2D< T >::operator== ( const Array2D< T > &  other) const
inline

Equality operator.

Definition at line 835 of file Types.h.

template<typename T>
T& Argus::Array2D< T >::operator[] ( unsigned int  i)
inline

Array indexing using [] operator.

Definition at line 862 of file Types.h.

template<typename T>
const T& Argus::Array2D< T >::operator[] ( unsigned int  i) const
inline

Definition at line 863 of file Types.h.

template<typename T>
bool Argus::Array2D< T >::resize ( const Size2D< uint32_t > &  size)
inline

Resize the array.

Array contents after resize are undefined. Boolean return value enables error checking when exceptions are not available.

Definition at line 845 of file Types.h.

References Argus::Size2D< T >::height(), Argus::Array2D< T >::size(), and Argus::Size2D< T >::width().

template<typename T>
Size2D<uint32_t> Argus::Array2D< T >::size ( ) const
inline

Returns the size (dimensions) of the array.

Definition at line 841 of file Types.h.

Referenced by Argus::Array2D< T >::resize().


The documentation for this class was generated from the following file: