claw::graphic::image::base_iterator< Image, Pixel > Class Template Reference

Base class for iterators on an image. More...

`#include <image.hpp>`

Inheritance diagram for claw::graphic::image::base_iterator< Image, Pixel >:

## Public Types

typedef pixel_type | value_type
| The type of the values accessed by the iterator.
typedef pixel_type & | reference
| The type of the references to the values accesssed by the iterator.
typedef pixel_type * | pointer
| The type of the pointers to the values accesssed by the iterator.
typedef ptrdiff_t | difference_type
| The type of the distance between two iterators.
typedef std::random_access_iterator_tag | iterator_category
| The type of this category.

## Public Member Functions

| base_iterator ()
| Constructor.
| base_iterator (image_type &owner, unsigned int x=0, unsigned int y=0)
| Constructor, from an image. More...
bool | operator== (const self_type &that) const
| Tell if two iterator point to the same address. More...
bool | operator!= (const self_type &that) const
| Tell if two iterator points to different addresses. More...
bool | operator< (const self_type &that) const
| Tell if the current iterator is before an other. More...
bool | operator> (const self_type &that) const
| Tell if the current iterator is after an other. More...
bool | operator<= (const self_type &that) const
| Tell if the current iterator is before an other, or on the same address. More...
bool | operator>= (const self_type &that) const
| Tell if the current iterator is after an other, or on the same address. More...
self_type & | operator+= (int n)
| Move the iterator. More...
self_type & | operator-= (int n)
| Move the iterator. More...
self_type | operator+ (int n) const
| Get an iterator at a specific distance of the current iterator. More...
self_type | operator- (int n) const
| Get an iterator at a specific distance of the current iterator. More...
difference_type | operator- (const self_type &that) const
| Get the distance between two iterators. More...
self_type & | operator++ ()
| Preincrement.
self_type | operator++ (int)
| Postincrement.
self_type & | operator-- ()
| Predecrement.
self_type | operator-- (int)
| Postdecrement.
reference | operator* () const
| Get a reference on the pointed pixel.
pointer | operator-> () const
| Get a pointer on the pointed pixel.
reference | operator[] (int n) const
| Get a pixel, using the iterator like an array. More...

## Friends

template<typename ImageT , typename PixelT >
self_type | operator+ (int n, const self_type &self)
| Get an iterator at a specific distance of the current iterator. More...

## Detailed Description

### template<typename Image, typename Pixel>
class claw::graphic::image::base_iterator< Image, Pixel >

Base class for iterators on an image.

Author
  Julien Jorge.

Definition at line 106 of file image.hpp.

## Constructor & Destructor Documentation

## base_iterator()

template<typename Image , typename Pixel >

claw::graphic::image::base_iterator< Image, Pixel >::base_iterator | ( | image_type & | owner,
|  | unsigned int | x = `0`,
|  | unsigned int | y = `0`
| ) |  |

inline

Constructor, from an image.

Parameters

  owner | The image we will iterate through.
  x | X-coordinate of the pointed pixel.
  y | Y-coordinate of the pointed pixel.

Definition at line 77 of file image.ipp.

## Member Function Documentation

## operator!=()

template<typename Image , typename Pixel >

bool claw::graphic::image::base_iterator< Image, Pixel >::operator!= | ( | const self_type & | that | ) | const

inline

Tell if two iterator points to different addresses.

Parameters

  that | The other operand.

Definition at line 109 of file image.ipp.

## operator+()

template<typename Image , typename Pixel >

claw::graphic::image::base_iterator< Image, Pixel >::self_type claw::graphic::image::base_iterator< Image, Pixel >::operator+ | ( | int | n | ) | const

inline

Get an iterator at a specific distance of the current iterator.

Parameters

  n | The distance of the wanted iterator.

Definition at line 231 of file image.ipp.

## operator+=()

template<typename Image , typename Pixel >

claw::graphic::image::base_iterator< Image, Pixel >::self_type & claw::graphic::image::base_iterator< Image, Pixel >::operator+= | ( | int | n | ) |

inline

Move the iterator.

Parameters

  n | Number of steps of the move.

Definition at line 178 of file image.ipp.

References CLAW_PRECOND, claw::math::coordinate_2d< T >::x, and claw::math::coordinate_2d< T >::y.

## operator-() [1/2]

template<typename Image , typename Pixel >

claw::graphic::image::base_iterator< Image, Pixel >::self_type claw::graphic::image::base_iterator< Image, Pixel >::operator- | ( | int | n | ) | const

inline

Get an iterator at a specific distance of the current iterator.

Parameters

  n | The distance of the wanted iterator.

Definition at line 245 of file image.ipp.

## operator-() [2/2]

template<typename Image , typename Pixel >

claw::graphic::image::base_iterator< Image, Pixel >::difference_type claw::graphic::image::base_iterator< Image, Pixel >::operator- | ( | const self_type & | that | ) | const

inline

Get the distance between two iterators.

Parameters

  that | The other operand.

Definition at line 277 of file image.ipp.

References CLAW_PRECOND, claw::math::coordinate_2d< T >::x, and claw::math::coordinate_2d< T >::y.

## operator-=()

template<typename Image , typename Pixel >

claw::graphic::image::base_iterator< Image, Pixel >::self_type & claw::graphic::image::base_iterator< Image, Pixel >::operator-= | ( | int | n | ) |

inline

Move the iterator.

Parameters

  n | Number of steps of the move.

Definition at line 203 of file image.ipp.

References CLAW_PRECOND, claw::math::coordinate_2d< T >::x, and claw::math::coordinate_2d< T >::y.

## operator<()

template<typename Image , typename Pixel >

bool claw::graphic::image::base_iterator< Image, Pixel >::operator< | ( | const self_type & | that | ) | const

inline

Tell if the current iterator is before an other.

Parameters

  that | The other operand.

Definition at line 122 of file image.ipp.

References claw::math::coordinate_2d< T >::x, and claw::math::coordinate_2d< T >::y.

## operator<=()

template<typename Image , typename Pixel >

bool claw::graphic::image::base_iterator< Image, Pixel >::operator<= | ( | const self_type & | that | ) | const

inline

Tell if the current iterator is before an other, or on the same address.

Parameters

  that | The other operand.

Definition at line 152 of file image.ipp.

## operator==()

template<typename Image , typename Pixel >

bool claw::graphic::image::base_iterator< Image, Pixel >::operator== | ( | const self_type & | that | ) | const

inline

Tell if two iterator point to the same address.

Parameters

  that | The other operand.

Definition at line 91 of file image.ipp.

## operator>()

template<typename Image , typename Pixel >

bool claw::graphic::image::base_iterator< Image, Pixel >::operator> | ( | const self_type & | that | ) | const

inline

Tell if the current iterator is after an other.

Parameters

  that | The other operand.

Definition at line 138 of file image.ipp.

## operator>=()

template<typename Image , typename Pixel >

bool claw::graphic::image::base_iterator< Image, Pixel >::operator>= | ( | const self_type & | that | ) | const

inline

Tell if the current iterator is after an other, or on the same address.

Parameters

  that | The other operand.

Definition at line 166 of file image.ipp.

## operator[]()

template<typename Image , typename Pixel >

claw::graphic::image::base_iterator< Image, Pixel >::reference claw::graphic::image::base_iterator< Image, Pixel >::operator[] | ( | int | n | ) | const

inline

Get a pixel, using the iterator like an array.

Parameters

  n | Index of the cell from which we want the pixel.

Definition at line 398 of file image.ipp.

References claw::math::coordinate_2d< T >::x, and claw::math::coordinate_2d< T >::y.

## Friends And Related Function Documentation

## operator+

template<typename Image, typename Pixel>
template<typename ImageT , typename PixelT >

self_type operator+ | ( | int | n,
|  | const self_type & | self
| ) |  |

friend

Get an iterator at a specific distance of the current iterator.

Parameters

  n | The distance of the wanted iterator.
  self | The reference iterator.

The documentation for this class was generated from the following files:

- image.hpp
- impl/image.ipp