#include <iter2d.hh>
Inheritance diagram for oln::abstract::iter2d< Exact >:
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 | |
static 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). | |
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 > |
Allow iterable object (like image, window, ...) of 2 dimensions traversing.
Definition at line 70 of file iter2d.hh.
oln::abstract::iter2d< Exact >::iter2d | ( | const image2d_size & | size | ) | [inline, protected] |
Construct an iterator (2d) on an inamge (2d).
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 } };
coord oln::abstract::iter2d< Exact >::row | ( | ) | const [inline] |
coord oln::abstract::iter2d< Exact >::col | ( | ) | const [inline] |
point2d oln::abstract::iter2d< Exact >::to_point | ( | ) | const [inline, protected] |
Get the current point viewed by the iterator.
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 }