ContRap-Libraries
Public Member Functions | Protected Attributes

crp::Image< T >::PrimitiveIterator Class Reference

PrimitiveIterator iterates over the pixels of a primitive. More...

#include <image.h>

Inheritance diagram for crp::Image< T >::PrimitiveIterator:
crp::Image< T >::LineIterator crp::Image< T >::RectIterator

Public Member Functions

 PrimitiveIterator (Image< T > &image, int x, int y)
 Default constructor.
virtual ~PrimitiveIterator ()
 Virtual destructor.
virtual PrimitiveIteratoroperator++ (int)=0
 Takes the next pixel.
virtual PrimitiveIteratoroperator-- (int)=0
 Takes the previous pixel.
T & operator* ()
 Returns the reference to the data.
virtual bool at_end ()=0
 Returns true if the operator is at the end.
virtual bool at_begin ()=0
 Returns true if the operator is at the beginning.
int get_x ()
 Returns the coordinate of the iterator.
int get_y ()
 Returns the coordinate of the iterator.

Protected Attributes

int x
 Current position.
int y
Image< T > & image
 Current image.

Detailed Description

template<class T>
class crp::Image< T >::PrimitiveIterator

PrimitiveIterator iterates over the pixels of a primitive.


Constructor & Destructor Documentation

template<class T >
crp::Image< T >::PrimitiveIterator::PrimitiveIterator ( Image< T > &  image,
int  x,
int  y 
) [inline]

Default constructor.

Parameters:
imageAssociated image
xStart coordinate
yStart coordinate
template<class T >
virtual crp::Image< T >::PrimitiveIterator::~PrimitiveIterator ( ) [inline, virtual]

Virtual destructor.


Member Function Documentation

template<class T >
virtual bool crp::Image< T >::PrimitiveIterator::at_begin ( ) [pure virtual]

Returns true if the operator is at the beginning.

Returns:
True if the operator will not move backwards

Implemented in crp::Image< T >::RectIterator, and crp::Image< T >::LineIterator.

template<class T >
virtual bool crp::Image< T >::PrimitiveIterator::at_end ( ) [pure virtual]

Returns true if the operator is at the end.

Returns:
True if the operator will not move any further

Implemented in crp::Image< T >::RectIterator, and crp::Image< T >::LineIterator.

template<class T >
int crp::Image< T >::PrimitiveIterator::get_x ( ) [inline]

Returns the coordinate of the iterator.

Returns:
x-Coordinate
template<class T >
int crp::Image< T >::PrimitiveIterator::get_y ( ) [inline]

Returns the coordinate of the iterator.

Returns:
x-Coordinate
template<class T >
T& crp::Image< T >::PrimitiveIterator::operator* ( ) [inline]

Returns the reference to the data.

Returns:
Value of the pixel
template<class T >
virtual PrimitiveIterator& crp::Image< T >::PrimitiveIterator::operator++ ( int  ) [pure virtual]

Takes the next pixel.

Implemented in crp::Image< T >::RectIterator, and crp::Image< T >::LineIterator.

template<class T >
virtual PrimitiveIterator& crp::Image< T >::PrimitiveIterator::operator-- ( int  ) [pure virtual]

Takes the previous pixel.

Implemented in crp::Image< T >::RectIterator, and crp::Image< T >::LineIterator.


Field Documentation

template<class T >
Image<T>& crp::Image< T >::PrimitiveIterator::image [protected]

Current image.

template<class T >
int crp::Image< T >::PrimitiveIterator::x [protected]

Current position.

template<class T >
int crp::Image< T >::PrimitiveIterator::y [protected]

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