Public Types | Public Member Functions
sal3d::Array2D< T > Class Template Reference

Wrapper template over 2D memory objects. More...

#include <Common.hpp>

List of all members.

Public Types

typedef Array1D< T > Row

Public Member Functions

 Array2D (T *values, int width, int height, ptrdiff_t pitch)
 Constructor.
int height () const
 Gets the number of rows in the array.
const Row operator[] (int y) const
 Gets an array's const row.
Row operator[] (int y)
 Gets an array's row.
int width () const
 The length of each row.

Detailed Description

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

Wrapper template over 2D memory objects.

A 2D array used as an interface to get the values from the COP and the ZMap.

It expects the objects layed out in memory where consecutive objects mean consecutive columns. And there is a pitch spacing between the first object of each row.


Constructor & Destructor Documentation

template<typename T >
sal3d::Array2D< T >::Array2D ( T *  values,
int  width,
int  height,
ptrdiff_t  pitch 
) [inline]

Constructor.

Parameters:
[in]valuesThe pointer to the array's values.
[in]widthThe array's width. Must be greater than 0.
[in]heightThe array's height. Must be greater than 0.
[in]pitchThe distance, in number of elements, between two rows in values.

Member Function Documentation

template<typename T >
int sal3d::Array2D< T >::height ( ) const [inline]

Gets the number of rows in the array.

Returns:
The number of rows in the array.

Referenced by sal3d::Array2D< T >::operator[]().

template<typename T >
const Row sal3d::Array2D< T >::operator[] ( int  y) const [inline]

Gets an array's const row.

Parameters:
[in]yThe row index to get. The allowed range is 0..height () - 1.
Returns:
The const row at index y.

References sal3d::Array2D< T >::height(), and sal3d::Array2D< T >::width().

template<typename T >
Row sal3d::Array2D< T >::operator[] ( int  y) [inline]

Gets an array's row.

Parameters:
[in]yThe row index to get. The allowed range is 0..height() - 1.
Returns:
The row at index y.
template<typename T >
int sal3d::Array2D< T >::width ( ) const [inline]

The length of each row.

Returns:
The length of each row. All rows have the same length.

Referenced by sal3d::Array2D< T >::operator[]().


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