pfs::Array2DImpl Class Reference

#include <array2d.h>

Inheritance diagram for pfs::Array2DImpl:

pfs::Array2D

List of all members.

Public Member Functions

 Array2DImpl (int cols, int rows)
 ~Array2DImpl ()
int getCols () const
 Get number of columns or, in case of an image, width.
int getRows () const
 Get number of rows or, in case of an image, height.
float & operator() (int col, int row)
 Access an element of the array for reading and writing.
const float & operator() (int col, int row) const
 Access an element of the array for reading.
float & operator() (int index)
 Access an element of the array for reading and writing.
const float & operator() (int index) const
 Access an element of the array for reading.
float * getRawData ()


Detailed Description

Two dimensional array of floats Holds 2D data in column-major oder. Allows easy indexing and retrieving array dimensions.

Definition at line 152 of file array2d.h.


Member Function Documentation

float& pfs::Array2DImpl::operator() ( int  col,
int  row 
) [inline, virtual]

Access an element of the array for reading and writing.

Whether the given row and column are checked against array bounds depends on an implementing class.

Note, that if an Array2D object is passed as a pointer (what is usually the case), to access its elements, you have to use somewhat strange syntax: (*array)(row, column).

Parameters:
col number of a column (x) within the range 0..(getCols()-1)
row number of a row (y) within the range 0..(getRows()-1)

Implements pfs::Array2D.

Definition at line 172 of file array2d.h.

const float& pfs::Array2DImpl::operator() ( int  col,
int  row 
) const [inline, virtual]

Access an element of the array for reading.

Whether the given row and column are checked against array bounds depends on an implementing class.

Note, that if an Array2D object is passed as a pointer (what is usually the case), to access its elements, you have to use somewhat strange syntax: (*array)(row, column).

Parameters:
col number of a column (x) within the range 0..(getCols()-1)
row number of a row (y) within the range 0..(getRows()-1)

Implements pfs::Array2D.

Definition at line 177 of file array2d.h.

float& pfs::Array2DImpl::operator() ( int  index  )  [inline, virtual]

Access an element of the array for reading and writing.

This is probably faster way of accessing elements than operator(col, row). However there is no guarantee on the order of elements as it usually depends on an implementing class. The only assumption that can be make is that there are exactly columns*rows elements and they are all unique.

Whether the given index is checked against array bounds depends on an implementing class.

Note, that if an Array2D object is passed as a pointer (what is usually the case), to access its elements, you have to use somewhat strange syntax: (*array)(index).

Parameters:
index index of an element within the range 0..(getCols()*getRows()-1)

Implements pfs::Array2D.

Definition at line 183 of file array2d.h.

const float& pfs::Array2DImpl::operator() ( int  index  )  const [inline, virtual]

Access an element of the array for reading.

This is probably faster way of accessing elements than operator(col, row). However there is no guarantee on the order of elements as it usually depends on an implementing class. The only assumption that can be make is that there are exactly columns*rows elements and they are all unique.

Whether the given index is checked against array bounds depends on an implementing class.

Note, that if an Array2D object is passed as a pointer (what is usually the case), to access its elements, you have to use somewhat strange syntax: (*array)(index).

Parameters:
index index of an element within the range 0..(getCols()*getRows()-1)

Implements pfs::Array2D.

Definition at line 187 of file array2d.h.


The documentation for this class was generated from the following file:
Generated on Tue Nov 25 17:23:48 2008 for Portable Floating-point Streams (pfstools) by  doxygen 1.5.3