claw 1.9.0
 
Loading...
Searching...
No Matches
claw::graphic::image::base_iterator< Image, Pixel > Class Template Reference

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

#include <image.hpp>

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.
 
bool operator== (const self_type &that) const
 Tell if two iterator point to the same address.
 
bool operator!= (const self_type &that) const
 Tell if two iterator points to different addresses.
 
bool operator< (const self_type &that) const
 Tell if the current iterator is before an other.
 
bool operator> (const self_type &that) const
 Tell if the current iterator is after an other.
 
bool operator<= (const self_type &that) const
 Tell if the current iterator is before an other, or on the same address.
 
bool operator>= (const self_type &that) const
 Tell if the current iterator is after an other, or on the same address.
 
self_typeoperator+= (int n)
 Move the iterator.
 
self_typeoperator-= (int n)
 Move the iterator.
 
self_type operator+ (int n) const
 Get an iterator at a specific distance of the current iterator.
 
self_type operator- (int n) const
 Get an iterator at a specific distance of the current iterator.
 
difference_type operator- (const self_type &that) const
 Get the distance between two iterators.
 
self_typeoperator++ ()
 Preincrement.
 
self_type operator++ (int)
 Postincrement.
 
self_typeoperator-- ()
 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.
 

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.
 

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 107 of file image.hpp.

Member Typedef Documentation

◆ difference_type

template<typename Image, typename Pixel>
typedef ptrdiff_t claw::graphic::image::base_iterator< Image, Pixel >::difference_type

The type of the distance between two iterators.

Definition at line 132 of file image.hpp.

◆ iterator_category

template<typename Image, typename Pixel>
typedef std::random_access_iterator_tag claw::graphic::image::base_iterator< Image, Pixel >::iterator_category

The type of this category.

Definition at line 135 of file image.hpp.

◆ pointer

template<typename Image, typename Pixel>
typedef pixel_type* claw::graphic::image::base_iterator< Image, Pixel >::pointer

The type of the pointers to the values accesssed by the iterator.

Definition at line 129 of file image.hpp.

◆ reference

template<typename Image, typename Pixel>
typedef pixel_type& claw::graphic::image::base_iterator< Image, Pixel >::reference

The type of the references to the values accesssed by the iterator.

Definition at line 125 of file image.hpp.

◆ value_type

template<typename Image, typename Pixel>
typedef pixel_type claw::graphic::image::base_iterator< Image, Pixel >::value_type

The type of the values accessed by the iterator.

Definition at line 121 of file image.hpp.

Constructor & Destructor Documentation

◆ base_iterator() [1/2]

template<typename Image, typename Pixel>
claw::graphic::image::base_iterator< Image, Pixel >::base_iterator ( )
inline

Constructor.

Definition at line 62 of file image.ipp.

◆ base_iterator() [2/2]

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
ownerThe image we will iterate through.
xX-coordinate of the pointed pixel.
yY-coordinate of the pointed pixel.

Definition at line 76 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
thatThe other operand.

Definition at line 108 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* ( ) const
inline

Get a reference on the pointed pixel.

Definition at line 371 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
nThe distance of the wanted iterator.

Definition at line 231 of file image.ipp.

◆ 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++ ( )
inline

Preincrement.

Definition at line 302 of file image.ipp.

◆ operator++() [2/2]

template<typename Image, typename Pixel>
claw::graphic::image::base_iterator< Image, Pixel >::self_type claw::graphic::image::base_iterator< Image, Pixel >::operator++ ( int )
inline

Postincrement.

Definition at line 323 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
nNumber of steps of the move.

Definition at line 178 of file image.ipp.

◆ operator-() [1/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
thatThe other operand.

Definition at line 276 of file image.ipp.

◆ operator-() [2/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
nThe distance of the wanted iterator.

Definition at line 245 of file image.ipp.

◆ 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-- ( )
inline

Predecrement.

Definition at line 336 of file image.ipp.

◆ operator--() [2/2]

template<typename Image, typename Pixel>
claw::graphic::image::base_iterator< Image, Pixel >::self_type claw::graphic::image::base_iterator< Image, Pixel >::operator-- ( int )
inline

Postdecrement.

Definition at line 358 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
nNumber of steps of the move.

Definition at line 203 of file image.ipp.

◆ operator->()

template<typename Image, typename Pixel>
claw::graphic::image::base_iterator< Image, Pixel >::pointer claw::graphic::image::base_iterator< Image, Pixel >::operator-> ( ) const
inline

Get a pointer on the pointed pixel.

Definition at line 384 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 before an other.

Parameters
thatThe other operand.

Definition at line 120 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 before an other, or on the same address.

Parameters
thatThe other operand.

Definition at line 150 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
thatThe other operand.

Definition at line 90 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
thatThe other operand.

Definition at line 137 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
thatThe other operand.

Definition at line 165 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
nIndex of the cell from which we want the pixel.

Definition at line 398 of file image.ipp.

Friends And Related Symbol 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
nThe distance of the wanted iterator.
selfThe reference iterator.

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