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

RestrictedNeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE > Class Template Reference

Circulator that walks around a given location in a given image, using a restricted neighborhood. More...

#include <vigra/pixelneighborhood.hxx>

Inheritance diagram for RestrictedNeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >:
NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >

Public Types

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

Public Member Functions

base_type constbase () const
 
base_type center () const
 
NeighborCode::difference_type constdiff () const
 
Direction direction () const
 
unsigned int directionBit () const
 
bool isDiagonal () const
 
bool operator!= (RestrictedNeighborhoodCirculator const &rhs) const
 
reference operator* () const
 
RestrictedNeighborhoodCirculator operator+ (difference_type d) const
 
RestrictedNeighborhoodCirculatoroperator++ ()
 
RestrictedNeighborhoodCirculator operator++ (int)
 
RestrictedNeighborhoodCirculatoroperator+= (difference_type d)
 
RestrictedNeighborhoodCirculator operator- (difference_type d) const
 
difference_type operator- (RestrictedNeighborhoodCirculator const &rhs) const
 
RestrictedNeighborhoodCirculatoroperator-- ()
 
RestrictedNeighborhoodCirculator operator-- (int)
 
RestrictedNeighborhoodCirculatoroperator-= (difference_type d)
 
pointer operator-> () const
 
bool operator== (RestrictedNeighborhoodCirculator const &rhs) const
 
 RestrictedNeighborhoodCirculator (IMAGEITERATOR const &center=IMAGEITERATOR(), AtImageBorder atBorder=NotAtBorder)
 

Detailed Description

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

Circulator that walks around a given location in a given image, using a restricted neighborhood.

This circulator behaves essentially like vigra::NeighborhoodCirculator, but can also be used near the image border, where some of the neighbor points would be outside the image und must not be accessed. The template parameters define the kind of neighborhood used (four or eight) and the underlying image, whereas the required neighborhood restriction is given by the last constructor argument. This below for typical usage.

The access functions return the value of the current neighbor pixel. Use center() to access the center pixel of the neighborhood.

Usage:

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

BImage::traverser upperleft(...), lowerright(...);
int width = lowerright.x - upperleft.x;
int height = lowerright.y - upperleft.y;
for(int y=0; y<height; ++y, ++upperleft.y)
{
BImage::traverser ix = upperleft;
for(int x=0; x<width; ++x, ++ix.x)
{
// use FourNeighborCode instead of EightNeighborCode for 4-neighborhood
circulator(ix, isAtImageBorder(x, y, width, height)),
end(circulator);
do
{
... // do something with the circulator
}
while(++circulator != end); // out-of-range pixels will be automatically skipped
}
}
Class for a single RGB value.
Definition rgbvalue.hxx:128
AtImageBorder isAtImageBorder(int x, int y, int width, int height)
Find out whether a point is at the image border.
Definition pixelneighborhood.hxx:111

Member Typedef Documentation

◆ base_type

template<class IMAGEITERATOR , class NEIGHBORCODE >
typedef IMAGEITERATOR base_type

type of the underlying image iterator

◆ NeighborCode

template<class IMAGEITERATOR , class NEIGHBORCODE >
typedef NEIGHBORCODE NeighborCode

type of the used neighbor code

◆ value_type

template<class IMAGEITERATOR , class NEIGHBORCODE >
typedef BaseType::value_type value_type

the circulator's value type

◆ Direction

template<class IMAGEITERATOR , class NEIGHBORCODE >
typedef BaseType::Direction Direction

type of the direction code

◆ reference

template<class IMAGEITERATOR , class NEIGHBORCODE >
typedef BaseType::reference reference

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

◆ index_reference

template<class IMAGEITERATOR , class NEIGHBORCODE >
typedef BaseType::index_reference index_reference

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

◆ pointer

template<class IMAGEITERATOR , class NEIGHBORCODE >
typedef BaseType::pointer pointer

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

◆ difference_type

template<class IMAGEITERATOR , class NEIGHBORCODE >
typedef BaseType::difference_type difference_type

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

◆ iterator_category

template<class IMAGEITERATOR , class NEIGHBORCODE >
typedef BaseType::iterator_category iterator_category

the circulator tag (random_access_circulator_tag)

Constructor & Destructor Documentation

◆ RestrictedNeighborhoodCirculator()

template<class IMAGEITERATOR , class NEIGHBORCODE >
RestrictedNeighborhoodCirculator ( IMAGEITERATOR const center = IMAGEITERATOR(),
AtImageBorder  atBorder = NotAtBorder 
)

Construct circulator with given center pixel, using the restricted neighborhood given by atBorder.

Member Function Documentation

◆ operator++() [1/2]

template<class IMAGEITERATOR , class NEIGHBORCODE >
RestrictedNeighborhoodCirculator & operator++ ( )

pre-increment

◆ operator++() [2/2]

template<class IMAGEITERATOR , class NEIGHBORCODE >
RestrictedNeighborhoodCirculator operator++ ( int  )

post-increment

◆ operator--() [1/2]

template<class IMAGEITERATOR , class NEIGHBORCODE >
RestrictedNeighborhoodCirculator & operator-- ( )

pre-decrement

◆ operator--() [2/2]

template<class IMAGEITERATOR , class NEIGHBORCODE >
RestrictedNeighborhoodCirculator operator-- ( int  )

post-decrement

◆ operator+=()

template<class IMAGEITERATOR , class NEIGHBORCODE >
RestrictedNeighborhoodCirculator & operator+= ( difference_type  d)

add-assignment

◆ operator-=()

template<class IMAGEITERATOR , class NEIGHBORCODE >
RestrictedNeighborhoodCirculator & operator-= ( difference_type  d)

subtract-assignment

◆ operator+()

template<class IMAGEITERATOR , class NEIGHBORCODE >
RestrictedNeighborhoodCirculator operator+ ( difference_type  d) const

addition

◆ operator-() [1/2]

template<class IMAGEITERATOR , class NEIGHBORCODE >
RestrictedNeighborhoodCirculator operator- ( difference_type  d) const

subtraction

◆ operator==()

template<class IMAGEITERATOR , class NEIGHBORCODE >
bool operator== ( RestrictedNeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE > const rhs) const

equality

◆ operator!=()

template<class IMAGEITERATOR , class NEIGHBORCODE >
bool operator!= ( RestrictedNeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE > const rhs) const

inequality

◆ operator-() [2/2]

template<class IMAGEITERATOR , class NEIGHBORCODE >
difference_type operator- ( RestrictedNeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE > const rhs) const

subtraction

◆ operator*()

template<class IMAGEITERATOR , class NEIGHBORCODE >
reference operator* ( ) const

dereference

◆ operator->()

template<class IMAGEITERATOR , class NEIGHBORCODE >
pointer operator-> ( ) const

member access

◆ base()

template<class IMAGEITERATOR , class NEIGHBORCODE >
base_type const & base ( ) const

Get the base iterator for the current neighbor.

◆ center()

template<class IMAGEITERATOR , class NEIGHBORCODE >
base_type center ( ) const

Get the base iterator for the center of the circulator.

◆ direction()

template<class IMAGEITERATOR , class NEIGHBORCODE >
Direction direction ( ) const

Get the current direction.

◆ directionBit()

template<class IMAGEITERATOR , class NEIGHBORCODE >
unsigned int directionBit ( ) const

Get the current direction bit.

◆ diff()

template<class IMAGEITERATOR , class NEIGHBORCODE >
NeighborCode::difference_type const & diff ( ) const

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

◆ isDiagonal()

template<class IMAGEITERATOR , class NEIGHBORCODE >
bool isDiagonal ( ) const

Is the current neighbor a diagonal neighbor?


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

© 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