[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]

ConstStridedImageIterator< PIXELTYPE > Class Template Reference

Const iterator to be used when pixels are to be skipped. More...

`#include <vigra/imageiterator.hxx>`

Inheritance diagram for ConstStridedImageIterator< PIXELTYPE >:

## Public Member Functions

| ConstStridedImageIterator ()
| ConstStridedImageIterator (pointer base, std::ptrdiff_t ystride, std::ptrdiff_t xskip, std::ptrdiff_t yskip)
| ConstStridedImageIterator (StridedImageIterator< PIXELTYPE > const &o)
ConstStridedImageIterator & | operator= (StridedImageIterator< PIXELTYPE > const &o)
Public Member Functions inherited from ImageIteratorBase< ConstStridedImageIterator< PIXELTYPE >, PIXELTYPE, PIXELTYPE const &, PIXELTYPE const *, StridedArrayTag >
bool | operator== (ImageIteratorBase const &rhs) const
bool | operator!= (ImageIteratorBase const &rhs) const
difference_type | operator- (ImageIteratorBase const &rhs) const
ConstStridedImageIterator< PIXELTYPE > | operator- (difference_type const &s) const
ConstStridedImageIterator< PIXELTYPE > & | operator+= (difference_type const &s)
ConstStridedImageIterator< PIXELTYPE > & | operator-= (difference_type const &s)
ConstStridedImageIterator< PIXELTYPE > | operator+ (difference_type const &s) const
reference | operator* () const
pointer | operator-> () const
index_reference | operator[] (Diff2D const &d) const
pointer | operator[] (std::ptrdiff_t dy) const
index_reference | operator() (std::ptrdiff_t dx, std::ptrdiff_t dy) const

## Additional Inherited Members

Public Types inherited from ImageIteratorBase< ConstStridedImageIterator< PIXELTYPE >, PIXELTYPE, PIXELTYPE const &, PIXELTYPE const *, StridedArrayTag >
typedef ColumnIteratorSelector::res | column_iterator
typedef Diff2D | difference_type
typedef PIXELTYPE const & | index_reference
typedef image_traverser_tag | iterator_category
typedef vigra::detail::DirectionSelector< StridedArrayTag >::template type< pointer > | MoveX
typedef vigra::detail::DirectionSelector< StridedArrayTag >::template type< std::ptrdiff_t > | MoveY
typedef PIXELTYPE | PixelType
typedef PIXELTYPE const * | pointer
typedef PIXELTYPE const & | reference
typedef RowIteratorSelector::res | row_iterator
typedef PIXELTYPE | value_type
Public Attributes inherited from ImageIteratorBase< ConstStridedImageIterator< PIXELTYPE >, PIXELTYPE, PIXELTYPE const &, PIXELTYPE const *, StridedArrayTag >
MoveX | x
MoveY | y
Protected Member Functions inherited from ImageIteratorBase< ConstStridedImageIterator< PIXELTYPE >, PIXELTYPE, PIXELTYPE const &, PIXELTYPE const *, StridedArrayTag >
| ImageIteratorBase (pointer base, std::ptrdiff_t ystride)
| ImageIteratorBase (pointer base, std::ptrdiff_t xstride, std::ptrdiff_t ystride)
| ImageIteratorBase (ImageIteratorBase const &rhs)
| ImageIteratorBase ()
ImageIteratorBase & | operator= (ImageIteratorBase const &rhs)

## Detailed Description

template<class PIXELTYPE>
class vigra::ConstStridedImageIterator< PIXELTYPE >

Const iterator to be used when pixels are to be skipped.

This iterator can be used when some pixels shall be automatically skipped, for example if an image is to be sub-sampled: instead of advancing to the next pixel, `++iterator.x` jumps to the pixel at a horizontal offset of `xskip`. Likewise with `yskip` in vertical direction. Most functions and local types are inherited from ImageIteratorBase.

Usage:

BImage img(w,h);
...
int xskip = 2, yskip = 2;
int wskip = w / xskip + 1, hskip = h / yskip + 1;
ConstStridedImageIterator<BImage::value_type> upperLeft(&img(0,0), w, xskip, yskip);
ConstStridedImageIterator<BImage::value_type> lowerRight = upperLeft + Diff2D(wskip, hskip);
// now navigation with upperLeft and lowerRight lets the image appear to have half
// the original resolution in either dimension
vigra::Diff2D
Two dimensional difference vector.
Definition diff2d.hxx:186
vigra::RGBValue
Class for a single RGB value.
Definition rgbvalue.hxx:128

#include <vigra/imageiterator.hxx>
Namespace: vigra

## Constructor & Destructor Documentation

## ◆ ConstStridedImageIterator() [1/3]

template<class PIXELTYPE >

ConstStridedImageIterator | ( | pointer | base,
|  | std::ptrdiff_t | ystride,
|  | std::ptrdiff_t | xskip,
|  | std::ptrdiff_t | yskip
| ) |  |

Construct from raw memory with a vertical stride of `ystride`, jumping by `xskip` horizontally and `yskip` vertically. `ystride` must be the physical width (row length) of the image.

## ◆ ConstStridedImageIterator() [2/3]

template<class PIXELTYPE >

ConstStridedImageIterator | ( | StridedImageIterator< PIXELTYPE > const & | o | ) |

Copy-construct from mutable iterator

## ◆ ConstStridedImageIterator() [3/3]

template<class PIXELTYPE >

ConstStridedImageIterator | ( |  | ) |

Default constructor

## Member Function Documentation

## ◆ operator=()

template<class PIXELTYPE >

ConstStridedImageIterator & operator= | ( | StridedImageIterator< PIXELTYPE > const & | o | ) |

Assign mutable iterator

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

- vigra/imageiterator.hxx

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany | html generated using doxygen and Python vigra 1.12.1