8 #ifndef BOOST_GIL_PIXEL_ITERATOR_HPP
9 #define BOOST_GIL_PIXEL_ITERATOR_HPP
11 #include <boost/gil/concepts.hpp>
12 #include <boost/gil/utilities.hpp>
13 #include <boost/gil/pixel.hpp>
17 namespace boost {
namespace gil {
20 template <
typename Iterator>
21 class memory_based_step_iterator;
23 template <
typename Iterator>
struct dynamic_x_step_type;
27 template <
typename It>
28 struct is_iterator_adaptor :
public mpl::false_{};
31 template <
typename It>
32 struct iterator_adaptor_get_base;
35 template <
typename It,
typename NewBaseIt>
39 template <
typename It>
48 template <
typename It>
53 template <
typename T>
struct iterator_is_mutable<const T*> :
public mpl::false_{};
67 template <
typename Pixel>
68 struct dynamic_x_step_type<Pixel*> {
69 using type = memory_based_step_iterator<Pixel *>;
73 template <
typename Pixel>
74 struct dynamic_x_step_type<const Pixel*> {
75 using type = memory_based_step_iterator<const Pixel *>;
83 template <
typename Pixel>
struct color_space_type< Pixel*> :
public color_space_type<Pixel> {};
84 template <
typename Pixel>
struct color_space_type<const Pixel*> :
public color_space_type<Pixel> {};
86 template <
typename Pixel>
struct channel_mapping_type< Pixel*> :
public channel_mapping_type<Pixel> {};
87 template <
typename Pixel>
struct channel_mapping_type<const Pixel*> :
public channel_mapping_type<Pixel> {};
89 template <
typename Pixel>
struct is_planar< Pixel*> :
public is_planar<Pixel> {};
90 template <
typename Pixel>
struct is_planar<const Pixel*> :
public is_planar<Pixel> {};
96 template <
typename Pixel>
struct channel_type<Pixel*> :
public channel_type<Pixel> {};
97 template <
typename Pixel>
struct channel_type<const Pixel*> :
public channel_type<Pixel> {};
110 template <
typename T>
113 template <
typename P>
114 inline std::ptrdiff_t memunit_step(
const P*) {
return sizeof(P); }
116 template <
typename P>
117 inline std::ptrdiff_t memunit_distance(
const P* p1,
const P* p2) {
118 return (gil_reinterpret_cast_c<const unsigned char*>(p2)-gil_reinterpret_cast_c<const unsigned char*>(p1));
121 template <
typename P>
122 inline void memunit_advance(P* &p, std::ptrdiff_t diff) {
123 p=(P*)((
unsigned char*)(p)+diff);
126 template <
typename P>
127 inline P* memunit_advanced(
const P* p, std::ptrdiff_t diff) {
128 return (P*)((
char*)(p)+diff);
134 template <
typename P>
135 inline P& memunit_advanced_ref(P* p, std::ptrdiff_t diff) {
136 return *memunit_advanced(p,diff);
Definition: pixel_iterator.hpp:111
Changes the base iterator of an iterator adaptor. Provide an specialization when introducing new iter...
Definition: pixel_iterator.hpp:36
Metafunction predicate returning whether the given iterator allows for changing its values...
Definition: pixel_iterator.hpp:49
Returns the type of an iterator just like the input iterator, except operating over immutable values...
Definition: pixel_iterator.hpp:40