MXA2DArray< T > Class Template Reference

This class represents a generic 2D array of data. More...

Inherits MXAArrayTemplate< T >< T >.

Inheritance diagram for MXA2DArray< T >:

Inheritance graph
[legend]
Collaboration diagram for MXA2DArray< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ~MXA2DArray ()
virtual int32 getNumberOfDimensions ()
 Returns the number of dimensions the data has.
virtual void getDimensions (uint64 *dims)
 Returns the sizes of the dimensions.
virtual int32 getWidth ()
 Returns the width of the array.
virtual int32 getHeight ()
 Returns the height of the array.
T * getPointer (int32 x, int32 y)
 Returns the a pointer to the data value located at pixel (x,y).
virtual int32 resize (uint64 size)
 Resizes the array.
int32 resizeArray (int32 width, int32 height)
 Resizes the data array to the specified width and height.
virtual void initialize ()
 Initializes the array to width and height = 0.
virtual std::string valueToString (char delimiter= ' ')
 Converts the data array into a string delimited by the supplied delimiter.

Static Public Member Functions

static IMXAArray::Pointer CreateAbstractDataArray (int32 width, int32 height)
 Creates a MXA2DArray wrapped in a Boost::SharedPointer that represents a 2D array typically used for images. The memory is allocated immediately. If the memory can not be allocated then a NULL wrapped pointer is returned.
static MXA2DArrayNew (int32 width, int32 height)
 Creates and allocates an MXA2DArray object. You are repsonsible for cleaning up the memory if you select to allocate the array in this way.

Protected Member Functions

 MXA2DArray (int32 width, int32 height)

Private Member Functions

 MXA2DArray (const MXA2DArray &)
void operator= (const MXA2DArray &)

Private Attributes

int32 _width
int32 _height

Detailed Description

template<typename T>
class MXA2DArray< T >

This class represents a generic 2D array of data.

Author:
mjackson
Date:
Jan 9, 2008
Version:
Revision
1.2


Constructor & Destructor Documentation

template<typename T>
virtual MXA2DArray< T >::~MXA2DArray (  )  [inline, virtual]

template<typename T>
MXA2DArray< T >::MXA2DArray ( int32  width,
int32  height 
) [inline, protected]

template<typename T>
MXA2DArray< T >::MXA2DArray ( const MXA2DArray< T > &   )  [private]


Member Function Documentation

template<typename T>
static IMXAArray::Pointer MXA2DArray< T >::CreateAbstractDataArray ( int32  width,
int32  height 
) [inline, static]

Creates a MXA2DArray wrapped in a Boost::SharedPointer that represents a 2D array typically used for images. The memory is allocated immediately. If the memory can not be allocated then a NULL wrapped pointer is returned.

Parameters:
width The width of the array
height The height of the array.
Returns:
Boost::shared_pointer wrapped MXA2DArray pointer

template<typename T>
static MXA2DArray* MXA2DArray< T >::New ( int32  width,
int32  height 
) [inline, static]

Creates and allocates an MXA2DArray object. You are repsonsible for cleaning up the memory if you select to allocate the array in this way.

Parameters:
width The width of the array
height The height of the array.
Returns:
Pointer to an MXA2DArray Object

template<typename T>
virtual int32 MXA2DArray< T >::getNumberOfDimensions (  )  [inline, virtual]

Returns the number of dimensions the data has.

Reimplemented from MXAArrayTemplate< T >.

template<typename T>
virtual void MXA2DArray< T >::getDimensions ( uint64 *  dims  )  [inline, virtual]

Returns the sizes of the dimensions.

Parameters:
dims A pointer to an array of at least size=2.

Reimplemented from MXAArrayTemplate< T >.

template<typename T>
virtual int32 MXA2DArray< T >::getWidth (  )  [inline, virtual]

Returns the width of the array.

Returns:

template<typename T>
virtual int32 MXA2DArray< T >::getHeight (  )  [inline, virtual]

Returns the height of the array.

Returns:

template<typename T>
T* MXA2DArray< T >::getPointer ( int32  x,
int32  y 
) [inline]

Returns the a pointer to the data value located at pixel (x,y).

Parameters:
x The x location of the pixel
y The y location of the pixel
Returns:
A pointer to the value.

template<typename T>
virtual int32 MXA2DArray< T >::resize ( uint64  size  )  [inline, virtual]

Resizes the array.

Parameters:
size The new size of the array
Returns:
1 if the resize succeeded, 0 on error

Reimplemented from MXAArrayTemplate< T >.

template<typename T>
int32 MXA2DArray< T >::resizeArray ( int32  width,
int32  height 
) [inline]

Resizes the data array to the specified width and height.

Parameters:
width The new width of the array
height The new height of the array
Returns:
1 on success and Zero (0) on failure

template<typename T>
virtual void MXA2DArray< T >::initialize (  )  [inline, virtual]

Initializes the array to width and height = 0.

Reimplemented from MXAArrayTemplate< T >.

template<typename T>
virtual std::string MXA2DArray< T >::valueToString ( char  delimiter = ' '  )  [inline, virtual]

Converts the data array into a string delimited by the supplied delimiter.

Parameters:
delimiter The delimiter to use between each value. Default is a single space
Returns:
The generated string

Reimplemented from MXAArrayTemplate< T >.

template<typename T>
void MXA2DArray< T >::operator= ( const MXA2DArray< T > &   )  [private]


Member Data Documentation

template<typename T>
int32 MXA2DArray< T >::_width [private]

template<typename T>
int32 MXA2DArray< T >::_height [private]


The documentation for this class was generated from the following file:
Generated on Tue Nov 17 18:43:14 2009 for MXADataModel by  doxygen 1.5.2