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

| NeighborOffsetCirculator Class Template Reference |
--- | --- | ---

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

`#include "vigra/pixelneighborhood.hxx"`

## Public Types

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

## Public Methods

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

## Static Public Methods

Diff2D const & | 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 Diff2D 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 Diff2D const* pointer

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

typedef Diff2D const& reference

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

typedef Diff2D value_type

| the circulator's value type

## Constructor & Destructor Documentation

NeighborOffsetCirculator | ( | Direction | dir = NEIGHBORCODE::East | ) | `[inline]`

| Create circulator refering to the given direction.

## Member Function Documentation

Diff2D const& diff | ( | Direction | dir | ) | `[inline, static]`

| Get Diff2D offset to given direction.

Diff2D const& diff | ( |  | ) | const`[inline]`

| Get Diff2D offset from center to current neighbor.

Direction direction | ( | difference_type | offset | ) | const`[inline]`

| Get direction code at offset of current direction.

Direction direction | ( |  | ) | const`[inline]`

| Get current direction.

unsigned int directionBit | ( |  | ) | const`[inline]`

| Get current direction bit.

int dX | ( |  | ) | const`[inline]`

| X-component of diff()

int dY | ( |  | ) | const`[inline]`

| Y-component of diff()

bool isDiagonal | ( |  | ) | const`[inline]`

| Check whether current direction is a diagonal one.

reference operator * | ( |  | ) | const`[inline]`

| dereference

bool operator!= | ( | NeighborOffsetCirculator< NEIGHBORCODE > const & | o | ) | const`[inline]`

| unequality

NeighborOffsetCirculator operator+ | ( | difference_type | d | ) | const`[inline]`

| addition

NeighborOffsetCirculator operator++ | ( | int |  | ) | `[inline]`

| post-increment

NeighborOffsetCirculator& operator++ | ( |  | ) | `[inline]`

| pre-increment

NeighborOffsetCirculator& operator+= | ( | difference_type | d | ) | `[inline]`

| add-assignment

difference_type operator- | ( | NeighborOffsetCirculator< NEIGHBORCODE > const & | o | ) | const`[inline]`

| subtraction

NeighborOffsetCirculator operator- | ( | difference_type | d | ) | const`[inline]`

| subtraction

NeighborOffsetCirculator operator-- | ( | int |  | ) | `[inline]`

| post-decrement

NeighborOffsetCirculator& operator-- | ( |  | ) | `[inline]`

| pre-decrement

NeighborOffsetCirculator& operator-= | ( | difference_type | d | ) | `[inline]`

| subtract-assignment

pointer operator-> | ( |  | ) | const`[inline]`

| member access

bool operator== | ( | NeighborOffsetCirculator< NEIGHBORCODE > const & | o | ) | const`[inline]`

| equality

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

| index

Direction opposite | ( |  | ) | const`[inline]`

| Get opposite of current direction.

unsigned int oppositeDirectionBit | ( |  | ) | const`[inline]`

| Get opposite bit of current direction.

Diff2D const& relativeDiff | ( | difference_type | offset | ) | const`[inline]`

| Get relative distance (Diff2D) from current neighbor to neighbor at given offset.

NeighborOffsetCirculator& turnLeft | ( |  | ) | `[inline]`

| 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 | ( |  | ) | `[inline]`

| 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 | ( |  | ) | `[inline]`

| 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 | ) | `[inline]`

| Move to the given direction.

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

- vigra/pixelneighborhood.hxx

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