[ 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>
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 RestrictedNeighborhoodCirculator<BImage::traverser, EightNeighborCode> 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 } }
typedef IMAGEITERATOR base_type |
type of the underlying image iterator
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
typedef NEIGHBORCODE NeighborCode |
type of the used neighbor code
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
typedef BaseType::value_type value_type |
the circulator's value type
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
typedef BaseType::Direction Direction |
type of the direction code
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
typedef BaseType::reference reference |
the circulator's reference type (return type of *circ
)
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
the circulator's index reference type (return type of circ[n]
)
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
typedef BaseType::pointer pointer |
the circulator's pointer type (return type of operator->
)
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
the circulator's difference type (argument type of circ[diff]
)
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
the circulator tag (random_access_circulator_tag)
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
RestrictedNeighborhoodCirculator | ( | IMAGEITERATOR const & | center = IMAGEITERATOR() , |
AtImageBorder | atBorder = NotAtBorder |
||
) |
Construct circulator with given center
pixel, using the restricted neighborhood given by atBorder.
RestrictedNeighborhoodCirculator& operator++ | ( | ) |
pre-increment
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
RestrictedNeighborhoodCirculator operator++ | ( | int | ) |
post-increment
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
RestrictedNeighborhoodCirculator& operator-- | ( | ) |
pre-decrement
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
RestrictedNeighborhoodCirculator operator-- | ( | int | ) |
post-decrement
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
RestrictedNeighborhoodCirculator& operator+= | ( | difference_type | d | ) |
add-assignment
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
RestrictedNeighborhoodCirculator& operator-= | ( | difference_type | d | ) |
subtract-assignment
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
RestrictedNeighborhoodCirculator operator+ | ( | difference_type | d | ) | const |
addition
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
RestrictedNeighborhoodCirculator operator- | ( | difference_type | d | ) | const |
subtraction
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
bool operator== | ( | RestrictedNeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE > const & | rhs | ) | const |
equality
bool operator!= | ( | RestrictedNeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE > const & | rhs | ) | const |
inequality
difference_type operator- | ( | RestrictedNeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE > const & | rhs | ) | const |
subtraction
reference operator* | ( | ) | const |
dereference
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
pointer operator-> | ( | ) | const |
member access
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
Get the base iterator for the current neighbor.
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
Get the base iterator for the center of the circulator.
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
Get the current direction.
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
unsigned int directionBit | ( | ) | const |
Get the current direction bit.
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
NeighborCode::difference_type const& diff | ( | ) | const |
Get the difference vector (Diff2D) from the center to the current neighbor.
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
bool isDiagonal | ( | ) | const |
Is the current neighbor a diagonal neighbor?
Reimplemented from NeighborhoodCirculator< IMAGEITERATOR, NEIGHBORCODE >.
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |
html generated using doxygen and Python
|