Argus API Argus Camera API

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

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

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros 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 (Size size)
| Constructor given initial array size.
| Array2D (Size 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.
Size | size () const
| Returns the size (dimensions) of the array.
bool | resize (Size 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() (Location l) const
T & | operator() (uint32_t i)
T & | operator() (uint32_t x, uint32_t y)
T & | operator() (Location l)
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
Size | 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 is index = location.x + (location.y * size.x); Indexing operators using iterators, 1-dimensional, or 2-dimensional coordinates are provided.

Definition at line 642 of file Types.h.

## Member Typedef Documentation

template<typename T>

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

Definition at line 647 of file Types.h.

template<typename T>

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

Definition at line 646 of file Types.h.

## Constructor & Destructor Documentation

template<typename T>

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

inline

Default Constructor.

Definition at line 650 of file Types.h.

template<typename T>

Argus::Array2D< T >::Array2D | ( | Size | size | ) |

inline

Constructor given initial array size.

Definition at line 653 of file Types.h.

template<typename T>

Argus::Array2D< T >::Array2D | ( | Size | size,
|  | const T & | value
| ) |  |

inline

Constructor given initial array size and initial fill value.

Definition at line 659 of file Types.h.

template<typename T>

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

inline

Copy constructor.

Definition at line 665 of file Types.h.

## Member Function Documentation

template<typename T>

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

inline

STL style iterators.

Definition at line 701 of file Types.h.

template<typename T>

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

inline

Definition at line 703 of file Types.h.

template<typename T>

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

inlineprivate

Definition at line 723 of file Types.h.

template<typename T>

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

inlineprivate

Definition at line 729 of file Types.h.

template<typename T>

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

inline

Definition at line 719 of file Types.h.

template<typename T>

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

inline

Definition at line 720 of file Types.h.

template<typename T>

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

inline

Definition at line 702 of file Types.h.

template<typename T>

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

inline

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

template<typename T>

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

inline

Definition at line 712 of file Types.h.

template<typename T>

const T& Argus::Array2D< T >::operator() | ( | Location | l | ) | const

inline

Definition at line 713 of file Types.h.

template<typename T>

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

inline

Definition at line 714 of file Types.h.

template<typename T>

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

inline

Definition at line 715 of file Types.h.

template<typename T>

T& Argus::Array2D< T >::operator() | ( | Location | l | ) |

inline

Definition at line 716 of file Types.h.

template<typename T>

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

inline

Assignment operator.

Definition at line 672 of file Types.h.

template<typename T>

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

inline

Equality operator.

Definition at line 680 of file Types.h.

template<typename T>

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

inline

Array indexing using [] operator.

Definition at line 707 of file Types.h.

template<typename T>

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

inline

Definition at line 708 of file Types.h.

template<typename T>

bool Argus::Array2D< T >::resize | ( | Size | 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 690 of file Types.h.

template<typename T>

Size Argus::Array2D< T >::size | ( |  | ) | const

inline

Returns the size (dimensions) of the array.

Definition at line 686 of file Types.h.

## Member Data Documentation

template<typename T>

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

private

Definition at line 736 of file Types.h.

template<typename T>

Size Argus::Array2D< T >::m_size

private

Definition at line 737 of file Types.h.

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

- include/Argus/Types.h