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> 18 namespace boost {
namespace gil {
21 template <
typename Iterator>
22 class memory_based_step_iterator;
26 template <
typename It>
27 struct is_iterator_adaptor :
public mpl::false_{};
30 template <
typename It>
31 struct iterator_adaptor_get_base;
34 template <
typename It,
typename NewBaseIt>
38 template <
typename It>
47 template <
typename It>
52 template <
typename T>
struct iterator_is_mutable<const T*> :
public mpl::false_{};
66 template <
typename Pixel>
67 struct dynamic_x_step_type<Pixel*> {
68 using type = memory_based_step_iterator<Pixel *>;
72 template <
typename Pixel>
73 struct dynamic_x_step_type<const Pixel*> {
74 using type = memory_based_step_iterator<const Pixel *>;
82 template <
typename Pixel>
struct color_space_type< Pixel*> :
public color_space_type<Pixel> {};
83 template <
typename Pixel>
struct color_space_type<const Pixel*> :
public color_space_type<Pixel> {};
85 template <
typename Pixel>
struct channel_mapping_type< Pixel*> :
public channel_mapping_type<Pixel> {};
86 template <
typename Pixel>
struct channel_mapping_type<const Pixel*> :
public channel_mapping_type<Pixel> {};
88 template <
typename Pixel>
struct is_planar< Pixel*> :
public is_planar<Pixel> {};
89 template <
typename Pixel>
struct is_planar<const Pixel*> :
public is_planar<Pixel> {};
95 template <
typename Pixel>
struct channel_type<Pixel*> :
public channel_type<Pixel> {};
96 template <
typename Pixel>
struct channel_type<const Pixel*> :
public channel_type<Pixel> {};
109 template <
typename T>
112 template <
typename P>
113 inline std::ptrdiff_t memunit_step(
const P*) {
return sizeof(P); }
115 template <
typename P>
116 inline std::ptrdiff_t memunit_distance(
const P* p1,
const P* p2) {
117 return (gil_reinterpret_cast_c<const unsigned char*>(p2)-gil_reinterpret_cast_c<const unsigned char*>(p1));
120 template <
typename P>
121 inline void memunit_advance(P* &p, std::ptrdiff_t diff) {
122 p=(P*)((
unsigned char*)(p)+diff);
125 template <
typename P>
126 inline P* memunit_advanced(
const P* p, std::ptrdiff_t diff) {
127 return (P*)((
char*)(p)+diff);
133 template <
typename P>
134 inline P& memunit_advanced_ref(P* p, std::ptrdiff_t diff) {
135 return *memunit_advanced(p,diff);
Definition: pixel_iterator.hpp:110
Changes the base iterator of an iterator adaptor. Provide an specialization when introducing new iter...
Definition: pixel_iterator.hpp:35
Metafunction predicate returning whether the given iterator allows for changing its values.
Definition: pixel_iterator.hpp:48
Returns the type of an iterator just like the input iterator, except operating over immutable values.
Definition: pixel_iterator.hpp:39