13 #ifndef GIL_PIXEL_ITERATOR_H
14 #define GIL_PIXEL_ITERATOR_H
31 namespace boost {
namespace gil {
34 template <
typename Iterator>
35 class memory_based_step_iterator;
37 template <
typename Iterator>
struct dynamic_x_step_type;
41 template <
typename It>
42 struct is_iterator_adaptor :
public mpl::false_{};
45 template <
typename It>
46 struct iterator_adaptor_get_base;
49 template <
typename It,
typename NewBaseIt>
50 struct iterator_adaptor_rebind;
53 template <
typename It>
54 struct const_iterator_type;
57 template <
typename T>
struct const_iterator_type< T*> {
typedef const T* type; };
58 template <
typename T>
struct const_iterator_type<const T*> {
typedef const T* type; };
62 template <
typename It>
63 struct iterator_is_mutable{};
66 template <
typename T>
struct iterator_is_mutable< T*> :
public mpl::true_{};
67 template <
typename T>
struct iterator_is_mutable<const T*> :
public mpl::false_{};
81 template <
typename Pixel>
82 struct dynamic_x_step_type<Pixel*> {
83 typedef memory_based_step_iterator<Pixel*> type;
87 template <
typename Pixel>
88 struct dynamic_x_step_type<const Pixel*> {
89 typedef memory_based_step_iterator<const Pixel*> type;
97 template <
typename Pixel>
struct color_space_type< Pixel*> :
public color_space_type<Pixel> {};
98 template <
typename Pixel>
struct color_space_type<const Pixel*> :
public color_space_type<Pixel> {};
100 template <
typename Pixel>
struct channel_mapping_type< Pixel*> :
public channel_mapping_type<Pixel> {};
101 template <
typename Pixel>
struct channel_mapping_type<const Pixel*> :
public channel_mapping_type<Pixel> {};
103 template <
typename Pixel>
struct is_planar< Pixel*> :
public is_planar<Pixel> {};
104 template <
typename Pixel>
struct is_planar<const Pixel*> :
public is_planar<Pixel> {};
110 template <
typename Pixel>
struct channel_type<Pixel*> :
public channel_type<Pixel> {};
111 template <
typename Pixel>
struct channel_type<const Pixel*> :
public channel_type<Pixel> {};
124 template <
typename T>
127 template <
typename P>
128 inline std::ptrdiff_t memunit_step(
const P*) {
return sizeof(P); }
130 template <
typename P>
131 inline std::ptrdiff_t memunit_distance(
const P* p1,
const P* p2) {
132 return (gil_reinterpret_cast_c<const unsigned char*>(p2)-gil_reinterpret_cast_c<const unsigned char*>(p1));
135 template <
typename P>
136 inline void memunit_advance(P* &p, std::ptrdiff_t diff) {
137 p=(P*)((
unsigned char*)(p)+diff);
140 template <
typename P>
141 inline P* memunit_advanced(
const P* p, std::ptrdiff_t diff) {
142 return (P*)((
char*)(p)+diff);
148 template <
typename P>
149 inline P& memunit_advanced_ref(P* p, std::ptrdiff_t diff) {
150 return *memunit_advanced(p,diff);
Definition: pixel_iterator.hpp:125
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 ...