Jetson Linux API Reference

32.7.5 Release
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 854 of file Types.h.

Public Types

typedef T * 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 ()
 

Data Fields

const typedef T * const_iterator
 

Member Typedef Documentation

◆ iterator

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

Definition at line 858 of file Types.h.

Constructor & Destructor Documentation

◆ Array2D() [1/4]

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

Default Constructor.

Definition at line 862 of file Types.h.

◆ Array2D() [2/4]

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

Constructor given initial array size.

Definition at line 865 of file Types.h.

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

◆ Array2D() [3/4]

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 871 of file Types.h.

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

◆ Array2D() [4/4]

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

Copy constructor.

Definition at line 877 of file Types.h.

Member Function Documentation

◆ begin() [1/2]

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

Definition at line 915 of file Types.h.

◆ begin() [2/2]

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

STL style iterators.

Definition at line 913 of file Types.h.

◆ data() [1/2]

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

Definition at line 934 of file Types.h.

◆ data() [2/2]

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

Definition at line 933 of file Types.h.

◆ end() [1/2]

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

Definition at line 916 of file Types.h.

◆ end() [2/2]

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

Definition at line 914 of file Types.h.

◆ operator()() [1/6]

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

Definition at line 929 of file Types.h.

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

◆ operator()() [2/6]

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

Definition at line 925 of file Types.h.

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

◆ operator()() [3/6]

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

Definition at line 927 of file Types.h.

◆ operator()() [4/6]

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

Array indexing using () operator.

Definition at line 923 of file Types.h.

◆ operator()() [5/6]

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

Definition at line 928 of file Types.h.

◆ operator()() [6/6]

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

Definition at line 924 of file Types.h.

◆ operator=()

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

Assignment operator.

Definition at line 884 of file Types.h.

◆ operator==()

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

Equality operator.

Definition at line 892 of file Types.h.

◆ operator[]() [1/2]

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

Array indexing using [] operator.

Definition at line 919 of file Types.h.

◆ operator[]() [2/2]

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

Definition at line 920 of file Types.h.

◆ resize()

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 902 of file Types.h.

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

◆ size()

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

Returns the size (dimensions) of the array.

Definition at line 898 of file Types.h.

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

Field Documentation

◆ const_iterator

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

Definition at line 859 of file Types.h.


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