VIGRA - TemplateConstStridedImageIterator class Reference

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

| ConstStridedImageIterator Class Template Reference |
--- | --- | ---

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

`#include "vigra/imageiterator.hxx"`

Inheritance diagram for ConstStridedImageIterator:

## Public Types
typedef Base::pointer | pointer
typedef Base::difference_type | difference_type
## Public Methods
| ConstStridedImageIterator (pointer base, int ystride, int xskip, int yskip)
| ConstStridedImageIterator (StridedImageIterator< PIXELTYPE > const &o)
| ConstStridedImageIterator ()
ConstStridedImageIterator & | operator= (StridedImageIterator< PIXELTYPE > const &o)

## 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

#include "vigra/imageiterator.hxx"

Namespace: vigra

## Member Typedef Documentation

typedef Base::difference_type difference_type

| the iterator's difference type (argument type of `iter[diff]`) Reimplemented from ImageIteratorBase< ConstStridedImageIterator< PIXELTYPE >, PIXELTYPE, PIXELTYPE const &, PIXELTYPE const *, StridedArrayTag >.

typedef Base::pointer pointer

| the iterator's pointer type (return type of `iter.operator->()`) Reimplemented from ImageIteratorBase< ConstStridedImageIterator< PIXELTYPE >, PIXELTYPE, PIXELTYPE const &, PIXELTYPE const *, StridedArrayTag >.

## Constructor & Destructor Documentation

ConstStridedImageIterator | ( | pointer | base,
|  | int | ystride,
|  | int | xskip,
|  | int | yskip
| ) | `[inline]`

| 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 | ( | StridedImageIterator< PIXELTYPE > const & | o | ) | `[inline]`

| Copy-construct from mutable iterator

ConstStridedImageIterator | ( |  | ) | `[inline]`

| Default constructor

## Member Function Documentation

ConstStridedImageIterator& operator= | ( | StridedImageIterator< PIXELTYPE > const & | o | ) | `[inline]`

| Assign mutable iterator

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

- vigra/imageiterator.hxx

© Ullrich Köthe (koethe@informatik.uni-hamburg.de) Cognitive Systems Group, University of Hamburg, Germany | html generated using doxygen and Python VIGRA 1.5.0 (7 Dec 2006)