Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::gil::memory_based_2d_locator< StepIterator > Class Template Reference

Memory-based pixel locator. More...

#include <locator.hpp>

Inheritance diagram for boost::gil::memory_based_2d_locator< StepIterator >:
Collaboration diagram for boost::gil::memory_based_2d_locator< StepIterator >:

Classes

struct  add_deref
 

Public Types

typedef pixel_2d_locator_base
< memory_based_2d_locator
< StepIterator >, typename
iterator_adaptor_get_base
< StepIterator >::type,
StepIterator > 
parent_t
 
typedef
memory_based_2d_locator
< typename const_iterator_type
< StepIterator >::type
const_t
 
typedef parent_t::coord_t coord_t
 
typedef parent_t::x_coord_t x_coord_t
 
typedef parent_t::y_coord_t y_coord_t
 
typedef parent_t::x_iterator x_iterator
 
typedef parent_t::y_iterator y_iterator
 
typedef parent_t::difference_type difference_type
 
typedef parent_t::reference reference
 
typedef std::ptrdiff_t cached_location_t
 
typedef std::iterator_traits
< x_iterator >::value_type 
value_type
 
typedef difference_type point_t
 

Public Member Functions

 memory_based_2d_locator ()
 
 memory_based_2d_locator (const StepIterator &yit)
 
template<typename SI >
 memory_based_2d_locator (const memory_based_2d_locator< SI > &loc, coord_t y_step)
 
template<typename SI >
 memory_based_2d_locator (const memory_based_2d_locator< SI > &loc, coord_t x_step, coord_t y_step, bool transpose=false)
 
 memory_based_2d_locator (x_iterator xit, std::ptrdiff_t row_bytes)
 
template<typename X >
 memory_based_2d_locator (const memory_based_2d_locator< X > &pl)
 
 memory_based_2d_locator (const memory_based_2d_locator &pl)
 
bool operator== (const this_t &p) const
 
x_iterator const & x () const
 
y_iterator const & y () const
 
x_iteratorx ()
 
y_iteratory ()
 
x_iterator x_at (x_coord_t dx, y_coord_t dy) const
 
x_iterator x_at (const difference_type &d) const
 
this_t xy_at (x_coord_t dx, y_coord_t dy) const
 
this_t xy_at (const difference_type &d) const
 
reference operator() (x_coord_t dx, y_coord_t dy) const
 
reference operator[] (const difference_type &d) const
 
this_toperator+= (const difference_type &d)
 
this_toperator-= (const difference_type &d)
 
cached_location_t cache_location (const difference_type &d) const
 
cached_location_t cache_location (x_coord_t dx, y_coord_t dy) const
 
reference operator[] (const cached_location_t &loc) const
 
std::ptrdiff_t row_size () const
 
std::ptrdiff_t pixel_size () const
 
bool is_1d_traversable (x_coord_t width) const
 
std::ptrdiff_t y_distance_to (const this_t &p2, x_coord_t xDiff) const
 
bool operator!= (const memory_based_2d_locator< StepIterator > &p) const
 
y_iterator y_at (x_coord_t dx, y_coord_t dy) const
 
y_iterator y_at (const difference_type &d) const
 
axis< D >::iterator & axis_iterator ()
 
axis< D >::iterator const & axis_iterator () const
 
axis< D >::iterator axis_iterator (const point_t &p) const
 
reference operator* () const
 
memory_based_2d_locator
< StepIterator > 
operator+ (const difference_type &d) const
 
memory_based_2d_locator
< StepIterator > 
operator- (const difference_type &d) const
 

Static Public Attributes

static const std::size_t num_dimensions
 

Friends

template<typename X >
class memory_based_2d_locator
 

Detailed Description

template<typename StepIterator>
class boost::gil::memory_based_2d_locator< StepIterator >

Memory-based pixel locator.

Models: PixelLocatorConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept

The class takes a step iterator as a parameter. The step iterator provides navigation along the vertical axis while its base iterator provides horizontal navigation.

Each instantiation is optimal in terms of size and efficiency. For example, xy locator over interleaved rgb image results in a step iterator consisting of one std::ptrdiff_t for the row size and one native pointer (8 bytes total). ++locator.x() resolves to pointer increment. At the other extreme, a 2D navigation of the even pixels of a planar CMYK image results in a step iterator consisting of one std::ptrdiff_t for the doubled row size, and one step iterator consisting of one std::ptrdiff_t for the horizontal step of two and a CMYK planar_pixel_iterator consisting of 4 pointers (24 bytes). In this case ++locator.x() results in four native pointer additions.

Note also that memory_based_2d_locator does not require that its element type be a pixel. It could be instantiated with an iterator whose value_type models only Regular. In this case the locator models the weaker RandomAccess2DLocatorConcept, and does not model PixelBasedConcept. Many generic algorithms don't require the elements to be pixels.

Member Typedef Documentation

template<typename StepIterator>
typedef std::ptrdiff_t boost::gil::memory_based_2d_locator< StepIterator >::cached_location_t
template<typename StepIterator>
typedef memory_based_2d_locator<typename const_iterator_type<StepIterator>::type> boost::gil::memory_based_2d_locator< StepIterator >::const_t
template<typename StepIterator>
typedef parent_t::coord_t boost::gil::memory_based_2d_locator< StepIterator >::coord_t
template<typename StepIterator>
typedef parent_t::difference_type boost::gil::memory_based_2d_locator< StepIterator >::difference_type
template<typename StepIterator>
typedef pixel_2d_locator_base<memory_based_2d_locator<StepIterator>, typename iterator_adaptor_get_base<StepIterator>::type, StepIterator> boost::gil::memory_based_2d_locator< StepIterator >::parent_t
typedef difference_type boost::gil::pixel_2d_locator_base< memory_based_2d_locator< StepIterator > , iterator_adaptor_get_base< StepIterator >::type , StepIterator >::point_t
inherited
template<typename StepIterator>
typedef parent_t::reference boost::gil::memory_based_2d_locator< StepIterator >::reference
typedef std::iterator_traits<x_iterator>::value_type boost::gil::pixel_2d_locator_base< memory_based_2d_locator< StepIterator > , iterator_adaptor_get_base< StepIterator >::type , StepIterator >::value_type
inherited
template<typename StepIterator>
typedef parent_t::x_coord_t boost::gil::memory_based_2d_locator< StepIterator >::x_coord_t
template<typename StepIterator>
typedef parent_t::x_iterator boost::gil::memory_based_2d_locator< StepIterator >::x_iterator
template<typename StepIterator>
typedef parent_t::y_coord_t boost::gil::memory_based_2d_locator< StepIterator >::y_coord_t
template<typename StepIterator>
typedef parent_t::y_iterator boost::gil::memory_based_2d_locator< StepIterator >::y_iterator

Constructor & Destructor Documentation

template<typename StepIterator>
boost::gil::memory_based_2d_locator< StepIterator >::memory_based_2d_locator ( )
inline
template<typename StepIterator>
boost::gil::memory_based_2d_locator< StepIterator >::memory_based_2d_locator ( const StepIterator &  yit)
inline
template<typename StepIterator>
template<typename SI >
boost::gil::memory_based_2d_locator< StepIterator >::memory_based_2d_locator ( const memory_based_2d_locator< SI > &  loc,
coord_t  y_step 
)
inline
template<typename StepIterator>
template<typename SI >
boost::gil::memory_based_2d_locator< StepIterator >::memory_based_2d_locator ( const memory_based_2d_locator< SI > &  loc,
coord_t  x_step,
coord_t  y_step,
bool  transpose = false 
)
inline
template<typename StepIterator>
boost::gil::memory_based_2d_locator< StepIterator >::memory_based_2d_locator ( x_iterator  xit,
std::ptrdiff_t  row_bytes 
)
inline
template<typename StepIterator>
template<typename X >
boost::gil::memory_based_2d_locator< StepIterator >::memory_based_2d_locator ( const memory_based_2d_locator< X > &  pl)
inline
template<typename StepIterator>
boost::gil::memory_based_2d_locator< StepIterator >::memory_based_2d_locator ( const memory_based_2d_locator< StepIterator > &  pl)
inline

Member Function Documentation

axis<D>::iterator& boost::gil::pixel_2d_locator_base< memory_based_2d_locator< StepIterator > , iterator_adaptor_get_base< StepIterator >::type , StepIterator >::axis_iterator ( )
inlineinherited
axis<D>::iterator const& boost::gil::pixel_2d_locator_base< memory_based_2d_locator< StepIterator > , iterator_adaptor_get_base< StepIterator >::type , StepIterator >::axis_iterator ( ) const
inlineinherited
axis<D>::iterator boost::gil::pixel_2d_locator_base< memory_based_2d_locator< StepIterator > , iterator_adaptor_get_base< StepIterator >::type , StepIterator >::axis_iterator ( const point_t p) const
inlineinherited
template<typename StepIterator>
cached_location_t boost::gil::memory_based_2d_locator< StepIterator >::cache_location ( const difference_type d) const
inline
template<typename StepIterator>
cached_location_t boost::gil::memory_based_2d_locator< StepIterator >::cache_location ( x_coord_t  dx,
y_coord_t  dy 
) const
inline
template<typename StepIterator>
bool boost::gil::memory_based_2d_locator< StepIterator >::is_1d_traversable ( x_coord_t  width) const
inline
bool boost::gil::pixel_2d_locator_base< memory_based_2d_locator< StepIterator > , iterator_adaptor_get_base< StepIterator >::type , StepIterator >::operator!= ( const memory_based_2d_locator< StepIterator > &  p) const
inlineinherited
template<typename StepIterator>
reference boost::gil::memory_based_2d_locator< StepIterator >::operator() ( x_coord_t  dx,
y_coord_t  dy 
) const
inline
reference boost::gil::pixel_2d_locator_base< memory_based_2d_locator< StepIterator > , iterator_adaptor_get_base< StepIterator >::type , StepIterator >::operator* ( ) const
inlineinherited
memory_based_2d_locator< StepIterator > boost::gil::pixel_2d_locator_base< memory_based_2d_locator< StepIterator > , iterator_adaptor_get_base< StepIterator >::type , StepIterator >::operator+ ( const difference_type d) const
inlineinherited
memory_based_2d_locator< StepIterator > boost::gil::pixel_2d_locator_base< memory_based_2d_locator< StepIterator > , iterator_adaptor_get_base< StepIterator >::type , StepIterator >::operator- ( const difference_type d) const
inlineinherited
template<typename StepIterator>
bool boost::gil::memory_based_2d_locator< StepIterator >::operator== ( const this_t p) const
inline
template<typename StepIterator>
reference boost::gil::memory_based_2d_locator< StepIterator >::operator[] ( const cached_location_t loc) const
inline
template<typename StepIterator>
x_iterator& boost::gil::memory_based_2d_locator< StepIterator >::x ( )
inline
template<typename StepIterator>
y_iterator& boost::gil::memory_based_2d_locator< StepIterator >::y ( )
inline
y_iterator boost::gil::pixel_2d_locator_base< memory_based_2d_locator< StepIterator > , iterator_adaptor_get_base< StepIterator >::type , StepIterator >::y_at ( x_coord_t  dx,
y_coord_t  dy 
) const
inlineinherited
y_iterator boost::gil::pixel_2d_locator_base< memory_based_2d_locator< StepIterator > , iterator_adaptor_get_base< StepIterator >::type , StepIterator >::y_at ( const difference_type d) const
inlineinherited

Friends And Related Function Documentation

template<typename StepIterator>
template<typename X >
friend class memory_based_2d_locator
friend

Member Data Documentation

const std::size_t boost::gil::pixel_2d_locator_base< memory_based_2d_locator< StepIterator > , iterator_adaptor_get_base< StepIterator >::type , StepIterator >::num_dimensions
staticinherited

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