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.
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... | |
Array2D & | operator= (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 |
typedef T* Argus::Array2D< T >::iterator |
|
inline |
|
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().
|
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().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 929 of file Types.h.
References Argus::Point2D< T >::x(), and Argus::Point2D< T >::y().
|
inline |
Definition at line 925 of file Types.h.
References Argus::Point2D< T >::x(), and Argus::Point2D< T >::y().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
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().
|
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().
const typedef T* Argus::Array2D< T >::const_iterator |