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

| NeighborOffsetCirculator [Utilities to manage pixel neighborhoods] |

Circulator that walks around a given location. More...

`#include <vigra/pixelneighborhood.hxx>`

List of all members.

## Public Types

typedef int | difference_type
typedef NEIGHBORCODE::Direction | Direction
typedef value_type const & | index_reference
typedef random_access_circulator_tag | iterator_category
typedef value_type const * | pointer
typedef value_type const & | reference
typedef NEIGHBORCODE::difference_type | value_type

## Public Member Functions

reference | diff () const
Direction | direction (difference_type offset) const
Direction | direction () const
unsigned int | directionBit () const
int | dX () const
int | dY () const
bool | isDiagonal () const
| NeighborOffsetCirculator (Direction dir=NEIGHBORCODE::InitialDirection)
bool | operator!= (NeighborOffsetCirculator const &o) const
reference | operator* () const
NeighborOffsetCirculator | operator+ (difference_type d) const
NeighborOffsetCirculator | operator++ (int)
NeighborOffsetCirculator & | operator++ ()
NeighborOffsetCirculator & | operator+= (difference_type d)
difference_type | operator- (NeighborOffsetCirculator const &o) const
NeighborOffsetCirculator | operator- (difference_type d) const
NeighborOffsetCirculator | operator-- (int)
NeighborOffsetCirculator & | operator-- ()
NeighborOffsetCirculator & | operator-= (difference_type d)
pointer | operator-> () const
bool | operator== (NeighborOffsetCirculator const &o) const
index_reference | operator[] (difference_type d) const
Direction | opposite () const
unsigned int | oppositeDirectionBit () const
value_type | relativeDiff (difference_type offset) const
NeighborOffsetCirculator & | turnLeft ()
NeighborOffsetCirculator & | turnRight ()
NeighborOffsetCirculator & | turnRound ()
NeighborOffsetCirculator & | turnTo (Direction d)

## Static Public Member Functions

static reference | diff (Direction dir)

## Detailed Description

### template<class NEIGHBORCODE>
class vigra::NeighborOffsetCirculator< NEIGHBORCODE >

Circulator that walks around a given location.

The template parameter defines the kind of neighborhood used, e.g.

        NeighborOffsetCirculator<EightNeighborCode> eight_circulator;
        NeighborOffsetCirculator<FourNeighborCode>  four_circulator;

Since this circulator doesn't now about the pixels in any particular image, you usually doesn't use it directly but rather as a base class or helper for neighborhood circulators refering to a particular image (e.g. NeighborhoodCirculator)

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

## Member Typedef Documentation

typedef int difference_type

the circulator's difference type (argument type of `circ[diff]`)

typedef NEIGHBORCODE::Direction Direction

return type of direction()

typedef value_type const& index_reference

the circulator's index reference type (return type of `circ[n]`)

typedef random_access_circulator_tag iterator_category

the circulator tag (random access iterator)

typedef value_type const* pointer

the circulator's pointer type (return type of `operator->`)

typedef value_type const& reference

the circulator's reference type (return type of `*circ`)

typedef NEIGHBORCODE::difference_type value_type

the circulator's value type

## Constructor & Destructor Documentation

NeighborOffsetCirculator | ( | Direction | dir = `NEIGHBORCODE::InitialDirection` | ) |

Create circulator refering to the given direction.

## Member Function Documentation

static reference diff | ( | Direction | dir | ) | `[static]`

Get offset to given direction.

reference diff | ( |  | ) | const

Get offset from center to current neighbor.

Direction direction | ( | difference_type | offset | ) | const

Get direction code at offset of current direction.

Direction direction | ( |  | ) | const

Get current direction.

unsigned int directionBit | ( |  | ) | const

Get current direction bit.

int dX | ( |  | ) | const

X-component of diff()

int dY | ( |  | ) | const

Y-component of diff()

bool isDiagonal | ( |  | ) | const

Check whether current direction is a diagonal one.

bool operator!= | ( | NeighborOffsetCirculator< NEIGHBORCODE > const & | o | ) | const

unequality

reference operator* | ( |  | ) | const

dereference

NeighborOffsetCirculator operator+ | ( | difference_type | d | ) | const

addition

NeighborOffsetCirculator operator++ | ( | int |  | ) |

post-increment

NeighborOffsetCirculator& operator++ | ( |  | ) |

pre-increment

NeighborOffsetCirculator& operator+= | ( | difference_type | d | ) |

add-assignment

difference_type operator- | ( | NeighborOffsetCirculator< NEIGHBORCODE > const & | o | ) | const

subtraction

NeighborOffsetCirculator operator- | ( | difference_type | d | ) | const

subtraction

NeighborOffsetCirculator operator-- | ( | int |  | ) |

post-decrement

NeighborOffsetCirculator& operator-- | ( |  | ) |

pre-decrement

NeighborOffsetCirculator& operator-= | ( | difference_type | d | ) |

subtract-assignment

pointer operator-> | ( |  | ) | const

member access

bool operator== | ( | NeighborOffsetCirculator< NEIGHBORCODE > const & | o | ) | const

equality

index_reference operator[] | ( | difference_type | d | ) | const

index

Direction opposite | ( |  | ) | const

Get opposite of current direction.

unsigned int oppositeDirectionBit | ( |  | ) | const

Get opposite bit of current direction.

value_type relativeDiff | ( | difference_type | offset | ) | const

Get relative distance from current neighbor to neighbor at given offset.

NeighborOffsetCirculator& turnLeft | ( |  | ) |

Move to the direction that is 'left' relative to the current direction. This is equivalent to `four_circulator++` and `eight_circulator += 2` respectively.

NeighborOffsetCirculator& turnRight | ( |  | ) |

Move to the direction that is 'right' relative to the current direction. This is equivalent to `four_circulator--` and `eight_circulator -= 2` respectively.

NeighborOffsetCirculator& turnRound | ( |  | ) |

Move to the opposite direction of the current direction. This is equivalent to `four_circulator += 2` and `eight_circulator += 4` respectively.

NeighborOffsetCirculator& turnTo | ( | Direction | d | ) |

Move to the given direction.

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

- vigra/pixelneighborhood.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.6.0 (13 Aug 2008)