Libargus API Libargus Camera API

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes
Argus::Array2D< T > Class Template Reference

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

`#include <Types.h>`

List of all members.

## Public Types
typedef T * | iterator
typedef const T * | const_iterator

## Public Member Functions
| Array2D ()
| Default Constructor.
| Array2D (const Size2D< uint32_t > &size)
| Constructor given initial array size.
| Array2D (const Size2D< uint32_t > &size, const T &value)
| Constructor given initial array size and initial fill value.
| Array2D (const Array2D< T > &other)
| Copy constructor.
Array2D & | operator= (const Array2D< T > &other)
| Assignment operator.
bool | operator== (const Array2D< T > &other) const
| Equality operator.
Size2D< uint32_t > | size () const
| Returns the size (dimensions) of the array.
bool | resize (const Size2D< uint32_t > &size)
| Resize the array.
const_iterator | begin () const
| STL style iterators.
const_iterator | end () const
iterator | begin ()
iterator | end ()
T & | operator[] (unsigned int i)
| Array indexing using [] operator.
const T & | operator[] (unsigned int i) const
const T & | operator() (uint32_t i) const
| Array indexing using () operator.
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 ()

## Private Member Functions
uint32_t | checkIndex (uint32_t i) const
uint32_t | checkIndex (uint32_t x, uint32_t y) const

## Private Attributes
std::vector< T > | m_data
Size2D< uint32_t > | m_size

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

## Member Typedef Documentation

template<typename T>

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

Definition at line 772 of file Types.h.

template<typename T>

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

Definition at line 771 of file Types.h.

## Constructor & Destructor Documentation

template<typename T>

Argus::Array2D< T >::Array2D | ( |  | ) |
| inline

Default Constructor.

Definition at line 775 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 778 of file Types.h.

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

template<typename T>

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

Copy constructor.

Definition at line 790 of file Types.h.

## Member Function Documentation

template<typename T>

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

STL style iterators.

Definition at line 826 of file Types.h.

template<typename T>

iterator Argus::Array2D< T >::begin | ( |  | ) |
| inline

Definition at line 828 of file Types.h.

template<typename T>

uint32_t Argus::Array2D< T >::checkIndex | ( | uint32_t | i | ) | const
| inline private

Definition at line 850 of file Types.h.

template<typename T>

uint32_t Argus::Array2D< T >::checkIndex | ( | uint32_t | x,
|  | uint32_t | y
| ) |  | const
| inline private

Definition at line 856 of file Types.h.

template<typename T>

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

Definition at line 846 of file Types.h.

template<typename T>

T* Argus::Array2D< T >::data | ( |  | ) |
| inline

Definition at line 847 of file Types.h.

template<typename T>

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

Definition at line 827 of file Types.h.

template<typename T>

iterator Argus::Array2D< T >::end | ( |  | ) |
| inline

Definition at line 829 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 836 of file Types.h.

template<typename T>

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

Definition at line 837 of file Types.h.

template<typename T>

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

Definition at line 838 of file Types.h.

template<typename T>

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

Definition at line 840 of file Types.h.

template<typename T>

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

Definition at line 841 of file Types.h.

template<typename T>

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

Definition at line 842 of file Types.h.

template<typename T>

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

Assignment operator.

Definition at line 797 of file Types.h.

template<typename T>

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

Equality operator.

Definition at line 805 of file Types.h.

template<typename T>

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

Array indexing using [] operator.

Definition at line 832 of file Types.h.

template<typename T>

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

Definition at line 833 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 815 of file Types.h.

template<typename T>

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

Returns the size (dimensions) of the array.

Definition at line 811 of file Types.h.

## Member Data Documentation

template<typename T>

std::vector<T> Argus::Array2D< T >::m_data
| private

Definition at line 863 of file Types.h.

template<typename T>

Size2D<uint32_t> Argus::Array2D< T >::m_size
| private

Definition at line 864 of file Types.h.

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

- include/Argus/Types.h