8 #ifndef BOOST_GIL_PIXEL_ITERATOR_HPP 9 #define BOOST_GIL_PIXEL_ITERATOR_HPP 11 #include <boost/gil/concepts.hpp> 12 #include <boost/gil/dynamic_step.hpp> 13 #include <boost/gil/utilities.hpp> 14 #include <boost/gil/pixel.hpp> 17 #include <type_traits> 19 namespace boost {
namespace gil {
22 template <
typename Iterator>
23 class memory_based_step_iterator;
27 template <
typename It>
28 struct is_iterator_adaptor :
public std::false_type {};
31 template <
typename It>
32 struct iterator_adaptor_get_base;
35 template <
typename It,
typename NewBaseIt>
39 template <
typename It>
48 template <
typename It>
56 struct iterator_is_mutable<T const*> : std::false_type {};
70 template <
typename Pixel>
71 struct dynamic_x_step_type<Pixel*> {
72 using type = memory_based_step_iterator<Pixel *>;
76 template <
typename Pixel>
77 struct dynamic_x_step_type<const Pixel*> {
78 using type = memory_based_step_iterator<const Pixel *>;
86 template <
typename Pixel>
87 struct color_space_type<Pixel*> : color_space_type<Pixel> {};
89 template <
typename Pixel>
90 struct color_space_type<Pixel const*> : color_space_type<Pixel> {};
92 template <
typename Pixel>
93 struct channel_mapping_type<Pixel*> : channel_mapping_type<Pixel> {};
95 template <
typename Pixel>
96 struct channel_mapping_type<Pixel const*> : channel_mapping_type<Pixel> {};
98 template <
typename Pixel>
99 struct is_planar<Pixel*> : is_planar<Pixel> {};
101 template <
typename Pixel>
102 struct is_planar<Pixel const*> : is_planar<Pixel> {};
108 template <
typename Pixel>
109 struct channel_type<Pixel*> : channel_type<Pixel> {};
111 template <
typename Pixel>
112 struct channel_type<Pixel const*> : channel_type<Pixel> {};
123 template <
typename T>
126 template <
typename P>
127 inline std::ptrdiff_t memunit_step(P
const*) {
return sizeof(P); }
129 template <
typename P>
130 inline std::ptrdiff_t memunit_distance(P
const* p1, P
const* p2)
133 gil_reinterpret_cast_c<unsigned char const*>(p2) -
134 gil_reinterpret_cast_c<unsigned char const*>(p1));
137 template <
typename P>
138 inline void memunit_advance(P* &p, std::ptrdiff_t diff)
140 p = (P*)((
unsigned char*)(p)+diff);
143 template <
typename P>
144 inline P* memunit_advanced(
const P* p, std::ptrdiff_t diff)
146 return (P*)((
char*)(p)+diff);
152 template <
typename P>
153 inline P& memunit_advanced_ref(P* p, std::ptrdiff_t diff) {
154 return *memunit_advanced(p,diff);
Definition: pixel_iterator.hpp:124
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