13 #ifndef GIL_PIXEL_ITERATOR_H
14 #define GIL_PIXEL_ITERATOR_H
32 namespace boost {
namespace gil {
35 template <
typename Iterator>
36 class memory_based_step_iterator;
38 template <
typename Iterator>
struct dynamic_x_step_type;
42 template <
typename It>
43 struct is_iterator_adaptor :
public mpl::false_{};
46 template <
typename It>
47 struct iterator_adaptor_get_base;
50 template <
typename It,
typename NewBaseIt>
51 struct iterator_adaptor_rebind;
54 template <
typename It>
55 struct const_iterator_type;
58 template <
typename T>
struct const_iterator_type< T*> {
typedef const T* type; };
59 template <
typename T>
struct const_iterator_type<const T*> {
typedef const T* type; };
63 template <
typename It>
64 struct iterator_is_mutable{};
67 template <
typename T>
struct iterator_is_mutable< T*> :
public mpl::true_{};
68 template <
typename T>
struct iterator_is_mutable<const T*> :
public mpl::false_{};
82 template <
typename Pixel>
83 struct dynamic_x_step_type<Pixel*> {
84 typedef memory_based_step_iterator<Pixel*> type;
88 template <
typename Pixel>
89 struct dynamic_x_step_type<const Pixel*> {
90 typedef memory_based_step_iterator<const Pixel*> type;
98 template <
typename Pixel>
struct color_space_type< Pixel*> :
public color_space_type<Pixel> {};
99 template <
typename Pixel>
struct color_space_type<const Pixel*> :
public color_space_type<Pixel> {};
101 template <
typename Pixel>
struct channel_mapping_type< Pixel*> :
public channel_mapping_type<Pixel> {};
102 template <
typename Pixel>
struct channel_mapping_type<const Pixel*> :
public channel_mapping_type<Pixel> {};
104 template <
typename Pixel>
struct is_planar< Pixel*> :
public is_planar<Pixel> {};
105 template <
typename Pixel>
struct is_planar<const Pixel*> :
public is_planar<Pixel> {};
111 template <
typename Pixel>
struct channel_type<Pixel*> :
public channel_type<Pixel> {};
112 template <
typename Pixel>
struct channel_type<const Pixel*> :
public channel_type<Pixel> {};
125 template <
typename T>
128 template <
typename P>
129 inline std::ptrdiff_t memunit_step(
const P*) {
return sizeof(P); }
131 template <
typename P>
132 inline std::ptrdiff_t memunit_distance(
const P* p1,
const P* p2) {
133 return (gil_reinterpret_cast_c<const unsigned char*>(p2)-gil_reinterpret_cast_c<const unsigned char*>(p1));
136 template <
typename P>
137 inline void memunit_advance(P* &p, std::ptrdiff_t diff) {
138 p=(P*)((
unsigned char*)(p)+diff);
141 template <
typename P>
142 inline P* memunit_advanced(
const P* p, std::ptrdiff_t diff) {
143 return (P*)((
char*)(p)+diff);
149 template <
typename P>
150 inline P& memunit_advanced_ref(P* p, std::ptrdiff_t diff) {
151 return *memunit_advanced(p,diff);
Definition: pixel_iterator.hpp:126
Concept check classes for GIL concepts.
pixel class and related utilities
Various utilities not specific to the image library. Some are non-standard STL extensions or generic ...