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>
18 namespace boost {
namespace gil {
21 template <
typename Iterator>
22 class memory_based_step_iterator;
24 template <
typename Iterator>
struct dynamic_x_step_type;
28 template <
typename It>
29 struct is_iterator_adaptor :
public mpl::false_{};
32 template <
typename It>
33 struct iterator_adaptor_get_base;
36 template <
typename It,
typename NewBaseIt>
37 struct iterator_adaptor_rebind;
40 template <
typename It>
41 struct const_iterator_type;
44 template <
typename T>
struct const_iterator_type< T*> {
typedef const T* type; };
45 template <
typename T>
struct const_iterator_type<const T*> {
typedef const T* type; };
49 template <
typename It>
50 struct iterator_is_mutable{};
53 template <
typename T>
struct iterator_is_mutable< T*> :
public mpl::true_{};
54 template <
typename T>
struct iterator_is_mutable<const T*> :
public mpl::false_{};
68 template <
typename Pixel>
69 struct dynamic_x_step_type<Pixel*> {
70 typedef memory_based_step_iterator<Pixel*> type;
74 template <
typename Pixel>
75 struct dynamic_x_step_type<const Pixel*> {
76 typedef memory_based_step_iterator<const Pixel*> type;
84 template <
typename Pixel>
struct color_space_type< Pixel*> :
public color_space_type<Pixel> {};
85 template <
typename Pixel>
struct color_space_type<const Pixel*> :
public color_space_type<Pixel> {};
87 template <
typename Pixel>
struct channel_mapping_type< Pixel*> :
public channel_mapping_type<Pixel> {};
88 template <
typename Pixel>
struct channel_mapping_type<const Pixel*> :
public channel_mapping_type<Pixel> {};
90 template <
typename Pixel>
struct is_planar< Pixel*> :
public is_planar<Pixel> {};
91 template <
typename Pixel>
struct is_planar<const Pixel*> :
public is_planar<Pixel> {};
97 template <
typename Pixel>
struct channel_type<Pixel*> :
public channel_type<Pixel> {};
98 template <
typename Pixel>
struct channel_type<const Pixel*> :
public channel_type<Pixel> {};
111 template <
typename T>
114 template <
typename P>
115 inline std::ptrdiff_t memunit_step(
const P*) {
return sizeof(P); }
117 template <
typename P>
118 inline std::ptrdiff_t memunit_distance(
const P* p1,
const P* p2) {
119 return (gil_reinterpret_cast_c<const unsigned char*>(p2)-gil_reinterpret_cast_c<const unsigned char*>(p1));
122 template <
typename P>
123 inline void memunit_advance(P* &p, std::ptrdiff_t diff) {
124 p=(P*)((
unsigned char*)(p)+diff);
127 template <
typename P>
128 inline P* memunit_advanced(
const P* p, std::ptrdiff_t diff) {
129 return (P*)((
char*)(p)+diff);
135 template <
typename P>
136 inline P& memunit_advanced_ref(P* p, std::ptrdiff_t diff) {
137 return *memunit_advanced(p,diff);
Definition: pixel_iterator.hpp:112