[ VIGRA Homepage |
Class Index |
Function Index |
File Index |
Main Page ]
|
ImageIteratorBase Class Template Reference
|
 |
Base class for 2D random access iterators.
More...
#include "vigra/imageiterator.hxx"
template<class IMAGEITERATOR, class PIXELTYPE, class REFERENCE, class POINTER, class StridedOrUnstrided = UnstridedArrayTag>
class vigra::ImageIteratorBase< IMAGEITERATOR, PIXELTYPE, REFERENCE, POINTER, StridedOrUnstrided >
Base class for 2D random access iterators.
This class contains the navigational part of the iterator. It is usually not constructed directly, but via some derived class such as ImageIterator or StridedImageIterator.
#include "vigra/imageiterator.hxx"
Namespace: vigra
The usage examples assume that you constructed two iterators like this:
See the paper: U. Koethe: Reusable Algorithms in Image Processing for a discussion of the concepts behind ImageIterators.
Member Typedef Documentation
typedef ColumnIteratorSelector::res column_iterator
|
|
|
The associated column iterator. |
typedef Diff2D difference_type
|
|
typedef REFERENCE index_reference
|
|
|
the iterator's index reference type (return type of iter[diff] ) |
typedef image_traverser_tag iterator_category
|
|
|
the iterator tag (image traverser) |
typedef detail::DirectionSelector<StridedOrUnstrided>::template type<pointer> MoveX
|
|
|
Let operations act in X direction |
typedef detail::DirectionSelector<StridedArrayTag>::template type<int> MoveY
|
|
|
Let operations act in Y direction |
typedef PIXELTYPE PixelType
|
|
|
deprecated, use value_type instead. |
typedef REFERENCE reference
|
|
|
the iterator's reference type (return type of *iter ) |
typedef RowIteratorSelector::res row_iterator
|
|
|
The associated row iterator. |
typedef PIXELTYPE value_type
|
|
|
The underlying image's pixel type. |
Constructor & Destructor Documentation
ImageIteratorBase |
( |
pointer |
base, |
|
|
int |
ystride |
|
) |
[inline, protected] |
|
|
Construct from raw memory with a vertical stride of ystride . ystride must equal the physical image width (row length), even if the iterator will only be used for a sub image. This constructor must only be called for unstrided iterators (StridedOrUnstrided == UnstridedArrayTag ) |
ImageIteratorBase |
( |
pointer |
base, |
|
|
int |
xstride, |
|
|
int |
ystride |
|
) |
[inline, protected] |
|
|
Construct from raw memory with a horizontal stride of xstride and a vertical stride of ystride . This constructor may be used for iterators that shall skip pixels. Thus, it must only be called for strided iterators (StridedOrUnstrided == StridedArrayTag ) |
ImageIteratorBase |
( |
ImageIteratorBase< IMAGEITERATOR, PIXELTYPE, REFERENCE, POINTER, StridedOrUnstrided > const & |
rhs |
) |
[inline, protected] |
|
ImageIteratorBase |
( |
|
) |
[inline, protected] |
|
Member Function Documentation
|
Access current pixel.
usage: SomePixelType value = *iterator |
bool operator!= |
( |
ImageIteratorBase< IMAGEITERATOR, PIXELTYPE, REFERENCE, POINTER, StridedOrUnstrided > const & |
rhs |
) |
const [inline] |
|
|
usage: iterator != iterator1 |
|
Access pixel at offset (dx, dy) from current location.
usage: SomePixelType value = iterator(dx, dy) |
difference_type operator- |
( |
ImageIteratorBase< IMAGEITERATOR, PIXELTYPE, REFERENCE, POINTER, StridedOrUnstrided > const & |
rhs |
) |
const [inline] |
|
|
usage: Diff2D dist = iterator - iterator1 |
pointer operator-> |
( |
|
) |
const [inline] |
|
|
Call member of current pixel.
usage: iterator->pixelMemberFunction() |
ImageIteratorBase& operator= |
( |
ImageIteratorBase< IMAGEITERATOR, PIXELTYPE, REFERENCE, POINTER, StridedOrUnstrided > const & |
rhs |
) |
[inline, protected] |
|
bool operator== |
( |
ImageIteratorBase< IMAGEITERATOR, PIXELTYPE, REFERENCE, POINTER, StridedOrUnstrided > const & |
rhs |
) |
const [inline] |
|
|
usage: iterator == iterator1 |
pointer operator[] |
( |
int |
dy |
) |
const [inline] |
|
|
Read pixel with offset [dy][dx] from current pixel. Note that the 'x' index is the trailing index.
usage: SomePixelType value = iterator[dy][dx] |
|
Access pixel at offset from current location.
usage: SomePixelType value = iterator[Diff2D(1,1)] |
Member Data Documentation
|
Refer to iterator's x coordinate. Usage examples:
++iterator.x;
--iterator.x;
iterator.x += dx;
iterator.x -= dx;
bool notAtEndOfRow = iterator.x < lowerRight.x;
int width = lowerRight.x - upperLeft.x;
|
|
Refer to iterator's y coordinate. Usage examples:
++iterator.y;
--iterator.y;
iterator.y += dy;
iterator.y -= dy;
bool notAtEndOfColumn = iterator.y < lowerRight.y;
int height = lowerRight.y - upperLeft.y;
|
The documentation for this class was generated from the following file: