[ VIGRA Homepage |
Class Index |
Function Index |
File Index |
Main Page ]
|
NeighborhoodCirculator Class Template Reference
|
 |
Circulator that walks around a given location in a given image.
More...
#include "vigra/pixelneighborhood.hxx"
Inheritance diagram for NeighborhoodCirculator:
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. 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()
. Note that this circulator cannot when the center is at the image border. You must then use vigra::RestrictedNeighborhoodCirculator
Usage:
#include "vigra/pixelneighborhood.hxx"
Namespace: vigra
BImage::traverser upperleft(...), lowerright(...);
int width = lowerright.x - upperleft.x;
int height = lowerright.y - upperleft.y;
++upperleft.y;
for(int y=1; y<height-1; ++y, ++upperleft.y)
{
BImage::traverser ix = upperleft + Diff2D(1,0);
for(int x=1; x<width-1; ++x, ++ix.x)
{
NeighborhoodCirculator<BImage::traverser, EightNeighborCode>
circulator(ix),
end(circulator);
do
{
analysisFunc(*circulator, ...);
}
while(++circulator != end);
}
}
Member Typedef Documentation
typedef IMAGEITERATOR base_type
|
|
typedef NEIGHBOROFFSETCIRCULATOR::difference_type difference_type
|
|
typedef NEIGHBORCODE::Direction Direction
|
|
typedef IMAGEITERATOR::index_reference index_reference
|
|
typedef NEIGHBOROFFSETCIRCULATOR::iterator_category iterator_category
|
|
typedef NEIGHBORCODE NeighborCode
|
|
typedef IMAGEITERATOR::pointer pointer
|
|
typedef IMAGEITERATOR::reference reference
|
|
typedef IMAGEITERATOR::value_type 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
Diff2D const& diff |
( |
|
) |
const [inline] |
|
unsigned int directionBit |
( |
|
) |
const [inline] |
|
bool isDiagonal |
( |
|
) |
const [inline] |
|
NeighborhoodCirculator& moveCenterToNeighbor |
( |
|
) |
[inline] |
|
|
Move the center in the current direction. The current neighbor becomes the new center, the direction does not change. |
bool operator!= |
( |
NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE > const & |
rhs |
) |
const [inline] |
|
NeighborhoodCirculator operator++ |
( |
int |
|
) |
[inline] |
|
NeighborhoodCirculator& operator++ |
( |
|
) |
[inline] |
|
difference_type operator- |
( |
NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE > const & |
rhs |
) |
const [inline] |
|
NeighborhoodCirculator operator-- |
( |
int |
|
) |
[inline] |
|
NeighborhoodCirculator& operator-- |
( |
|
) |
[inline] |
|
pointer operator-> |
( |
|
) |
const [inline] |
|
bool operator== |
( |
NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE > const & |
rhs |
) |
const [inline] |
|
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: