base class for models of PixelLocatorConceptPixel locator is similar to a pixel iterator, but allows for 2D navigation of pixels within an image view. It has a 2D difference_type and supports random access operations like: More...
#include <locator.hpp>
Public Types | |
| typedef XIterator | x_iterator |
| typedef YIterator | y_iterator |
|
typedef std::iterator_traits < x_iterator >::value_type | value_type |
|
typedef std::iterator_traits < x_iterator >::reference | reference |
|
typedef std::iterator_traits < x_iterator > ::difference_type | coord_t |
| typedef point< coord_t > | difference_type |
| typedef difference_type | point_t |
|
typedef point_t::template axis < 0 >::coord_t | x_coord_t |
|
typedef point_t::template axis < 1 >::coord_t | y_coord_t |
| typedef difference_type | cached_location_t |
Public Member Functions | |
| bool | operator!= (const Loc &p) const |
| x_iterator | x_at (x_coord_t dx, y_coord_t dy) const |
| x_iterator | x_at (const difference_type &d) const |
| y_iterator | y_at (x_coord_t dx, y_coord_t dy) const |
| y_iterator | y_at (const difference_type &d) const |
| Loc | xy_at (x_coord_t dx, y_coord_t dy) const |
| Loc | xy_at (const difference_type &d) const |
| template<std::size_t D> | |
| axis< D >::iterator & | axis_iterator () |
| template<std::size_t D> | |
| axis< D >::iterator const & | axis_iterator () const |
| template<std::size_t D> | |
| axis< D >::iterator | axis_iterator (const point_t &p) const |
| reference | operator() (x_coord_t dx, y_coord_t dy) const |
| reference | operator[] (const difference_type &d) const |
| reference | operator* () const |
| Loc & | operator+= (const difference_type &d) |
| Loc & | operator-= (const difference_type &d) |
| Loc | operator+ (const difference_type &d) const |
| Loc | operator- (const difference_type &d) const |
| cached_location_t | cache_location (const difference_type &d) const |
| cached_location_t | cache_location (x_coord_t dx, y_coord_t dy) const |
Static Public Attributes | |
| static const std::size_t | num_dimensions =2 |
Friends | |
| template<typename X > | |
| class | pixel_2d_locator |
base class for models of PixelLocatorConcept
Pixel locator is similar to a pixel iterator, but allows for 2D navigation of pixels within an image view. It has a 2D difference_type and supports random access operations like:
In addition, each coordinate acts as a random-access iterator that can be modified separately: "++locator.x()" or "locator.y()+=10" thereby moving the locator horizontally or vertically.
It is called a locator because it doesn't implement the complete interface of a random access iterator. For example, increment and decrement operations don't make sense (no way to specify dimension). Also 2D difference between two locators cannot be computed without knowledge of the X position within the image.
This base class provides most of the methods and typedefs needed to create a model of a locator. GIL provides two locator models as subclasses of pixel_2d_locator_base. A memory-based locator, memory_based_2d_locator and a virtual locator, virtual_2d_locator. The minimum functionality a subclass must provide is this:
Models may choose to override some of the functions in the base class with more efficient versions.