Boost GIL


Public Types | Public Member Functions | List of all members
virtual_2d_locator< DerefFn, IsTransposed > Class Template Reference

A 2D locator over a virtual image Upon dereferencing, invokes a given function object passing it its coordinates. Models: PixelLocatorConcept, HasDynamicXStepTypeConcept, HasDynamicYStepTypeConcept, HasTransposedTypeConcept. More...

#include <virtual_locator.hpp>

Inheritance diagram for virtual_2d_locator< DerefFn, IsTransposed >:
pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >

Public Types

using parent_t = pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >
 
using const_t = virtual_2d_locator< typename DerefFn::const_t, IsTransposed >
 
using deref_fn_t = DerefFn
 
using point_t = typename parent_t::point_t
 
using coord_t = typename parent_t::coord_t
 
using x_coord_t = typename parent_t::x_coord_t
 
using y_coord_t = typename parent_t::y_coord_t
 
using x_iterator = typename parent_t::x_iterator
 
using y_iterator = typename parent_t::y_iterator
 
- Public Types inherited from pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >
using x_iterator = position_iterator< DerefFn, IsTransposed >
 
using y_iterator = position_iterator< DerefFn, 1-IsTransposed >
 
using value_type = typename std::iterator_traits< x_iterator >::value_type
 
using reference = typename std::iterator_traits< x_iterator >::reference
 
using coord_t = typename std::iterator_traits< x_iterator >::difference_type
 
using difference_type = point< coord_t >
 
using point_t = difference_type
 
using x_coord_t = typename point_t::template axis< 0 >::coord_t
 
using y_coord_t = typename point_t::template axis< 1 >::coord_t
 
using cached_location_t = difference_type
 

Public Member Functions

 virtual_2d_locator (point_t const &p={0, 0}, point_t const &step={1, 1}, deref_fn_t const &deref_fn=deref_fn_t())
 
template<typename D , bool TR>
 virtual_2d_locator (virtual_2d_locator< D, TR > const &loc, coord_t y_step)
 
template<typename D , bool TR>
 virtual_2d_locator (virtual_2d_locator< D, TR > const &loc, coord_t x_step, coord_t y_step, bool transpose=false)
 
template<typename D , bool TR>
 virtual_2d_locator (virtual_2d_locator< D, TR > const &other)
 
 virtual_2d_locator (virtual_2d_locator const &other)
 
virtual_2d_locatoroperator= (virtual_2d_locator const &other)=default
 
bool operator== (const this_t &p) const
 
auto x () -> x_iterator &
 
auto x () const -> x_iterator const &
 
auto y () -> y_iterator &
 
auto y () const -> y_iterator const &
 
auto y_distance_to (this_t const &it2, x_coord_t) const -> y_coord_t
 Returns the y distance between two x_iterators given the difference of their x positions.
 
bool is_1d_traversable (x_coord_t) const
 
auto pos () const -> point_t const &
 
auto step () const -> point_t const &
 
auto deref_fn () const -> deref_fn_t const &
 
- Public Member Functions inherited from pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >
bool operator!= (const virtual_2d_locator< DerefFn, IsTransposed > &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
 
virtual_2d_locator< DerefFn, IsTransposed > xy_at (x_coord_t dx, y_coord_t dy) const
 
virtual_2d_locator< DerefFn, IsTransposed > xy_at (const difference_type &d) const
 
axis< D >::iterator & axis_iterator ()
 
axis< D >::iterator const & axis_iterator () const
 
axis< D >::iterator axis_iterator (point_t const &p) const
 
reference operator() (x_coord_t dx, y_coord_t dy) const
 
reference operator[] (const difference_type &d) const
 
reference operator* () const
 
virtual_2d_locator< DerefFn, IsTransposed > & operator+= (const difference_type &d)
 
virtual_2d_locator< DerefFn, IsTransposed > & operator-= (const difference_type &d)
 
virtual_2d_locator< DerefFn, IsTransposed > operator+ (const difference_type &d) const
 
virtual_2d_locator< DerefFn, IsTransposed > 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
 

Additional Inherited Members

- Static Public Attributes inherited from pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >
static const std::size_t num_dimensions
 

Detailed Description

template<typename DerefFn, bool IsTransposed>
class boost::gil::virtual_2d_locator< DerefFn, IsTransposed >

A 2D locator over a virtual image Upon dereferencing, invokes a given function object passing it its coordinates. Models: PixelLocatorConcept, HasDynamicXStepTypeConcept, HasDynamicYStepTypeConcept, HasTransposedTypeConcept.

Template Parameters
DerefFnFunction object that given a point returns a reference. Models PixelDereferenceAdaptorConcept.
IsTransposedIndicates if locator should navigate in transposed mode.

Member Function Documentation

◆ is_1d_traversable()

bool is_1d_traversable ( x_coord_t  ) const
inline
Todo:
TODO: is there no gap at the end of each row? i.e. can we use x_iterator to visit every pixel instead of nested loops?

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