TerraLib 4.1
TeRaster::iterator Class Reference

A raster iterator. More...

#include <TeRaster.h>

Inheritance diagram for TeRaster::iterator:
TeRaster::iteratorPoly

List of all members.

Public Member Functions

 iterator (int c0=0, int l0=0, int nc=0, int nl=0, int nb=0, TeRaster *pt=0)
 Constructor.
virtual ~iterator ()
 Destructor.
virtual void moveForward ()
 Move iterator forward.
iteratoroperator++ ()
 Prefix move forward operator.
iterator operator++ (int)
 Posfix move forward operator.
int currentLine ()
 Returns iterator current line.
int currentColumn ()
 Returns iterator current column.
int nBands (void)
 Returns the number of bands.
vector< double > operator* ()
 Iterator de-referencing operator.
double operator* (int band)
 Returns the value in a given band of a element pointed by the iterator.
bool operator== (const iterator &rhs) const
 Returns whether two iterators point to the same element.
bool operator!= (const iterator &rhs) const
 Returns whether two iterators point to the different elements.

Protected Attributes

int linCurrent_
int colCurrent_
int nLines_
int nCols_
int nBands_
TeRasterraster_

Detailed Description

A raster iterator.

An strucuture that allows the traversal over the raster elements (pixels) in a similar way as the STL iterators.


Constructor & Destructor Documentation

TeRaster::iterator::iterator ( int  c0 = 0,
int  l0 = 0,
int  nc = 0,
int  nl = 0,
int  nb = 0,
TeRaster pt = 0 
) [inline]

Constructor.

Parameters:
c0initial column
l0initial line
ncnumber of columns
nlnumber of lines
nbnumber of bands
ptpointer to the raster to iterate
virtual TeRaster::iterator::~iterator ( ) [inline, virtual]

Destructor.


Member Function Documentation

int TeRaster::iterator::currentColumn ( ) [inline]

Returns iterator current column.

int TeRaster::iterator::currentLine ( ) [inline]

Returns iterator current line.

void TeRaster::iterator::moveForward ( ) [virtual]

Move iterator forward.

Reimplemented in TeRaster::iteratorPoly.

int TeRaster::iterator::nBands ( void  ) [inline]

Returns the number of bands.

bool TeRaster::iterator::operator!= ( const iterator rhs) const

Returns whether two iterators point to the different elements.

double TeRaster::iterator::operator* ( int  band)

Returns the value in a given band of a element pointed by the iterator.

Reimplemented in TeRaster::iteratorPoly.

vector< double > TeRaster::iterator::operator* ( )

Iterator de-referencing operator.

Returns:
a vector (with nbands_ size) with the values in each band, of the element pointed by the iterator

Reimplemented in TeRaster::iteratorPoly.

TeRaster::iterator & TeRaster::iterator::operator++ ( )

Prefix move forward operator.

Reimplemented in TeRaster::iteratorPoly.

TeRaster::iterator TeRaster::iterator::operator++ ( int  )

Posfix move forward operator.

Reimplemented in TeRaster::iteratorPoly.

bool TeRaster::iterator::operator== ( const iterator rhs) const

Returns whether two iterators point to the same element.


Member Data Documentation

int TeRaster::iterator::nBands_ [protected]
int TeRaster::iterator::nCols_ [protected]
int TeRaster::iterator::nLines_ [protected]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines