oln::abstract::iter2d< Exact > Class Template Reference

Iterator on image of 2 dimensions. More...

#include <iter2d.hh>

Inheritance diagram for oln::abstract::iter2d< Exact >:

Inheritance graph
[legend]
Collaboration diagram for oln::abstract::iter2d< Exact >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef iter< Exact > super_type
 The exact type of the object.


Public Member Functions

coord row () const
 Get the coordinates (rows) of iterator's current point.

coord col () const
 Get the coordinates (columns) of iterator's current point.


Static Public Member Functions

std::string name ()
 Return the name of the type.


Protected Member Functions

point2d to_point () const
 Get the current point viewed by the iterator.

 iter2d ()
 Constructor.

 iter2d (const image2d_size &size)
 Construct an iterator (2d) on an inamge (2d).
  • size The size of the image to iterate.



Protected Attributes

const coord nrows_
 The number of rows of the image you are iterating.

const coord ncols_
 The number of columns of the image you are iterating.


Friends

class iter< Exact >

Detailed Description

template<class Exact>
class oln::abstract::iter2d< Exact >

Iterator on image of 2 dimensions.

Allow iterable object (like image, window, ...) of 2 dimensions traversing.

See also:
iter

Definition at line 70 of file iter2d.hh.


Constructor & Destructor Documentation

template<class Exact>
oln::abstract::iter2d< Exact >::iter2d const image2d_size size  )  [inline, protected]
 

Construct an iterator (2d) on an inamge (2d).

  • size The size of the image to iterate.

Precondition:
size.ncols() > 0.

size.nrows() > 0.

Definition at line 143 of file iter2d.hh.

00143                                        :
00144         super_type(),
00145         nrows_(size.nrows()),
00146         ncols_(size.ncols())
00147       {
00148         precondition(size.nrows() > 0 &&
00149                      size.ncols() > 0);
00150         this->exact().goto_begin_();
00151       }
    };


Member Function Documentation

template<class Exact>
coord oln::abstract::iter2d< Exact >::col  )  const [inline]
 

Get the coordinates (columns) of iterator's current point.

Returns:
The column number.
On this kind of image (i.e. 2 dimensions), you are able to get the column number and the row number.

Definition at line 99 of file iter2d.hh.

00100       {
00101         return this->p_.col();
00102       }

template<class Exact>
coord oln::abstract::iter2d< Exact >::row  )  const [inline]
 

Get the coordinates (rows) of iterator's current point.

Returns:
The row number.
On this kind of image (i.e. 2 dimensions), you are able to get the column number and the row number.

Definition at line 86 of file iter2d.hh.

00087       {
00088         return this->p_.row();
00089       }

template<class Exact>
point2d oln::abstract::iter2d< Exact >::to_point  )  const [inline, protected]
 

Get the current point viewed by the iterator.

Returns:
The point (2 dimensions) viewed by the iterator.
Precondition:
Instance != end.

Definition at line 121 of file iter2d.hh.

00122       {
00123         precondition(*this != end);
00124         invariant(this->p_.row() >= 0 &&
00125                   (this->p_.row() < nrows_ || this->p_.row() == nrows_) &&
00126                   this->p_.col() >= 0 &&
00127                   this->p_.col() < ncols_);
00128         return this->p_;
00129       }


The documentation for this class was generated from the following file:
Generated on Thu Apr 15 20:15:09 2004 for Olena by doxygen 1.3.6-20040222