Dirac - A Video Codec

Created by the British Broadcasting Corporation.


dirac::TwoDArray< T > Class Template Reference

A template class for two-dimensional arrays. More...

#include <arrays.h>

Inheritance diagram for dirac::TwoDArray< T >:

Inheritance graph
[legend]

List of all members.

Public Member Functions

Private Types

Private Member Functions

Private Attributes


Detailed Description

template<class T>
class dirac::TwoDArray< T >

A template class to do two-d arrays, so that explicit memory (de-)allocation is not required. Only zero-based arrays are currently supported so that access is fast. Accessing elements along a row is therefore much faster than accessing them along a column. Rows are contiguous in memory, so array[y][x] is equivalent to array[0][x+y*LengthX()].

Member Typedef Documentation

template<class T>
typedef T* dirac::TwoDArray< T >::element_type [private]


Constructor & Destructor Documentation

template<class T>
dirac::TwoDArray< T >::TwoDArray (  )  [inline]

Default constructor creates an empty array.

template<class T>
dirac::TwoDArray< T >::TwoDArray ( const int  height,
const int  width 
) [inline]

The constructor creates an array of given width height.

template<class T>
dirac::TwoDArray< T >::TwoDArray ( const int  height,
const int  width,
val 
) [inline]

The constructor creates an array of given width and length height and initialises it to a value

template<class T>
virtual dirac::TwoDArray< T >::~TwoDArray (  )  [inline, virtual]

Destructor frees the data allocated in the constructor.

template<class T>
dirac::TwoDArray< T >::TwoDArray ( const TwoDArray< T > &  Cpy  )  [inline]

Copy constructor copies data and metadata.


Member Function Documentation

template<class T>
TwoDArray< T > & dirac::TwoDArray< T >::operator= ( const TwoDArray< T > &  rhs  )  [inline]

Assignement = assigns both data and metadata.

template<class T>
bool dirac::TwoDArray< T >::CopyContents ( TwoDArray< T > &  out  )  const [inline]

Copy contents of array into output array retaining the dimensions of the output array. If output array is larger that array then pad with last true value. Return true is copy was successful

template<class T>
void dirac::TwoDArray< T >::Fill ( val  )  [inline]

Initialise the array with the val provided.

template<class T>
void dirac::TwoDArray< T >::Resize ( const int  height,
const int  width 
) [inline]

template<class T>
element_type& dirac::TwoDArray< T >::operator[] ( const int  pos  )  [inline]

Accesses the rows of the arrays, which are returned in the form of pointers to the row data NOT OneDArray objects.

template<class T>
const element_type& dirac::TwoDArray< T >::operator[] ( const int  pos  )  const [inline]

Accesses the rows of the arrays, which are returned in the form of pointers to the row data NOT OneDArray objects.

template<class T>
int dirac::TwoDArray< T >::LengthX (  )  const [inline]

template<class T>
int dirac::TwoDArray< T >::LengthY (  )  const [inline]

template<class T>
int dirac::TwoDArray< T >::FirstX (  )  const [inline]

template<class T>
int dirac::TwoDArray< T >::FirstY (  )  const [inline]

template<class T>
int dirac::TwoDArray< T >::LastX (  )  const [inline]

template<class T>
int dirac::TwoDArray< T >::LastY (  )  const [inline]

template<class T>
void dirac::TwoDArray< T >::Init ( const int  height,
const int  width 
) [inline, private]

template<class T>
void dirac::TwoDArray< T >::FreeData (  )  [inline, private]


Member Data Documentation

template<class T>
int dirac::TwoDArray< T >::m_first_x [private]

template<class T>
int dirac::TwoDArray< T >::m_first_y [private]

template<class T>
int dirac::TwoDArray< T >::m_last_x [private]

template<class T>
int dirac::TwoDArray< T >::m_last_y [private]

template<class T>
int dirac::TwoDArray< T >::m_length_x [private]

template<class T>
int dirac::TwoDArray< T >::m_length_y [private]

template<class T>
element_type* dirac::TwoDArray< T >::m_array_of_rows [private]


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

© 2004 British Broadcasting Corporation. Dirac code licensed under the Mozilla Public License (MPL) Version 1.1.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.