Boost GIL


iterator_from_2d< Loc2 > Class Template Reference

Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept. More...

#include <iterator_from_2d.hpp>

Public Types

using parent_t
 
using reference = typename parent_t::reference
 
using difference_type = typename parent_t::difference_type
 
using x_iterator = typename Loc2::x_iterator
 
using point_t = typename Loc2::point_t
 

Public Member Functions

std::ptrdiff_t width () const
 
std::ptrdiff_t x_pos () const
 
std::ptrdiff_t y_pos () const
 
reference operator[] (difference_type d) const
 
bool is_1d_traversable () const
 
x_iterator & x ()
 
 iterator_from_2d (const Loc2 &p, std::ptrdiff_t width, std::ptrdiff_t x=0, std::ptrdiff_t y=0)
 
 iterator_from_2d (const iterator_from_2d &pit)
 
template<typename Loc >
 iterator_from_2d (const iterator_from_2d< Loc > &pit)
 
iterator_from_2doperator= (iterator_from_2d const &other)=default
 

Friends

class boost::iterator_core_access
 

Detailed Description

template<typename Loc2>
class boost::gil::iterator_from_2d< Loc2 >

Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept.

Pixels are traversed from the top to the bottom row and from the left to the right within each row

Member Typedef Documentation

◆ parent_t

template<typename Loc2 >
using parent_t
Initial value:
iterator_facade<iterator_from_2d<Loc2>,
typename Loc2::value_type,
std::random_access_iterator_tag,
typename Loc2::reference,
typename Loc2::coord_t>

Member Function Documentation

◆ operator[]()

template<typename Loc2 >
reference operator[] ( difference_type d) const
inline

For some reason operator[] provided by iterator_adaptor returns a custom class that is convertible to reference We require our own reference because it is registered in iterator_traits


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