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

details NeighborhoodCirculator Class Template Reference VIGRA

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

#include "vigra/pixelneighborhood.hxx"


Public Types

typedef IMAGEITERATOR base_type
typedef NEIGHBORCODE NeighborCode
typedef IMAGEITERATOR::value_type value_type
typedef NEIGHBORCODE::Direction Direction
typedef IMAGEITERATOR::reference reference
typedef IMAGEITERATOR::index_reference index_reference
typedef IMAGEITERATOR::pointer pointer
typedef NEIGHBOROFFSETCIRCULATOR::difference_type difference_type
typedef NEIGHBOROFFSETCIRCULATOR::iterator_category iterator_category

Public Methods

 NeighborhoodCirculator (IMAGEITERATOR const &center=IMAGEITERATOR(), Direction d=NEIGHBOROFFSETCIRCULATOR::East)
NeighborhoodCirculator & operator++ ()
NeighborhoodCirculator operator++ (int)
NeighborhoodCirculator & operator-- ()
NeighborhoodCirculator operator-- (int)
NeighborhoodCirculator & operator+= (difference_type d)
NeighborhoodCirculator & operator-= (difference_type d)
NeighborhoodCirculator operator+ (difference_type d) const
NeighborhoodCirculator operator- (difference_type d) const
NeighborhoodCirculator & turnRight ()
NeighborhoodCirculator & turnLeft ()
NeighborhoodCirculator & turnRound ()
NeighborhoodCirculator & turnTo (Direction d)
NeighborhoodCirculator & moveCenterToNeighbor ()
NeighborhoodCirculator & swapCenterNeighbor ()
bool operator== (NeighborhoodCirculator const &rhs) const
bool operator!= (NeighborhoodCirculator const &rhs) const
difference_type operator- (NeighborhoodCirculator const &rhs) const
reference operator * () const
index_reference operator[] (difference_type d) const
pointer operator-> () const
base_type const & base () const
base_type center () const
Direction direction () const
Diff2D const & diff () const
bool isDiagonal () const


Detailed Description


template<class IMAGEITERATOR, class NEIGHBORCODE>
class vigra::NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >

Circulator that walks around a given location in a given image.

The template parameters define the kind of neighborhood used and the underlying image, e.g.

    NeighborhoodCirculator<BImage::traverser, EightNeighborCode> eight_circulator(image.upperLeft()+Diff2D(2,2));
    NeighborhoodCirculator<BImage::traverser, FourNeighborCode>  four_circulator(image.upperLeft()+Diff2D(2,2));

The access functions return the value of the current neighbor pixel. Use center() to access the center pixel of the neighborhood. The center can be changed by calling moveCenterToNeighbor() or swapCenterNeighbor().

#include "vigra/pixelneighborhood.hxx"
Namespace: vigra


Member Typedef Documentation


typedef IMAGEITERATOR base_type

 

type of the underlying image iterator


typedef NEIGHBOROFFSETCIRCULATOR::difference_type difference_type

 

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


typedef NEIGHBORCODE::Direction Direction

 

type of the direction code


typedef IMAGEITERATOR::index_reference index_reference

 

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


typedef NEIGHBOROFFSETCIRCULATOR::iterator_category iterator_category

 

the circulator tag (random_access_circulator_tag)


typedef NEIGHBORCODE NeighborCode

 

type of the used neighbor code


typedef IMAGEITERATOR::pointer pointer

 

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


typedef IMAGEITERATOR::reference reference

 

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


typedef IMAGEITERATOR::value_type value_type

 

the circulator's value type


Constructor & Destructor Documentation


NeighborhoodCirculator IMAGEITERATOR const &    center = IMAGEITERATOR(),
Direction    d = NEIGHBOROFFSETCIRCULATOR::East
[inline]

 

Construct circulator with given center pixel, pointing to the neighbor at the given direction d.


Member Function Documentation


base_type const& base   const [inline]

 

Get the base iterator for the current neighbor.


base_type center   const [inline]

 

Get the base iterator for the center of the circulator.


Diff2D const& diff   const [inline]

 

Get the difference vector (Diff2D) from the center to the current neighbor.


Direction direction   const [inline]

 

Get the current direction.


bool isDiagonal   const [inline]

 

Is the current neighbor a diagonal neighbor?


NeighborhoodCirculator& moveCenterToNeighbor   [inline]

 

Move the center in the current direction. The current neighbor becomes the new center, the direction does not change.


reference operator *   const [inline]

 

dereference


bool operator!= NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE > const &    rhs const [inline]

 

inequality


NeighborhoodCirculator operator+ difference_type    d const [inline]

 

addition


NeighborhoodCirculator operator++ int    [inline]

 

pre-decrement


NeighborhoodCirculator& operator++   [inline]

 

pre-increment


NeighborhoodCirculator& operator+= difference_type    d [inline]

 

add-assignment


difference_type operator- NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE > const &    rhs const [inline]

 

subtraction


NeighborhoodCirculator operator- difference_type    d const [inline]

 

subtraction


NeighborhoodCirculator operator-- int    [inline]

 

post-decrement


NeighborhoodCirculator& operator--   [inline]

 

post-increment


NeighborhoodCirculator& operator-= difference_type    d [inline]

 

subtract-assignment


pointer operator->   const [inline]

 

member access


bool operator== NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE > const &    rhs const [inline]

 

equality


index_reference operator[] difference_type    d const [inline]

 

index


NeighborhoodCirculator& swapCenterNeighbor   [inline]

 

Exchange the center with the current neighbor. Equivalent to circ.moveCenterToNeighbor().turnRound() (but shorter and more efficient).


NeighborhoodCirculator& 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.


NeighborhoodCirculator& 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.


NeighborhoodCirculator& turnRound   [inline]

 

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


NeighborhoodCirculator& turnTo Direction    d [inline]

 

Move to the given direction.


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

© Ullrich Köthe (koethe@informatik.uni-hamburg.de)
Cognitive Systems Group, University of Hamburg, Germany

html generated using doxygen and Python
VIGRA 1.3.3 (18 Aug 2005)