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>
19namespace boost {
namespace gil {
22template <
typename Iterator>
23class memory_based_step_iterator;
35template <
typename It,
typename NewBaseIt>
56struct iterator_is_mutable<T const*> : std::false_type {};
70template <
typename Pixel>
71struct dynamic_x_step_type<Pixel*> {
72 using type = memory_based_step_iterator<Pixel *>;
76template <
typename Pixel>
77struct dynamic_x_step_type<const Pixel*> {
78 using type = memory_based_step_iterator<const Pixel *>;
86template <
typename Pixel>
87struct color_space_type<Pixel*> : color_space_type<Pixel> {};
89template <
typename Pixel>
90struct color_space_type<Pixel const*> : color_space_type<Pixel> {};
92template <
typename Pixel>
93struct channel_mapping_type<Pixel*> : channel_mapping_type<Pixel> {};
95template <
typename Pixel>
96struct channel_mapping_type<Pixel const*> : channel_mapping_type<Pixel> {};
98template <
typename Pixel>
99struct is_planar<Pixel*> : is_planar<Pixel> {};
101template <
typename Pixel>
102struct is_planar<Pixel const*> : is_planar<Pixel> {};
108template <
typename Pixel>
109struct channel_type<Pixel*> : channel_type<Pixel> {};
111template <
typename Pixel>
112struct channel_type<Pixel const*> : channel_type<Pixel> {};
127inline std::ptrdiff_t memunit_step(P
const*) {
return sizeof(P); }
130inline 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));
138inline void memunit_advance(P* &p, std::ptrdiff_t diff)
140 p = (P*)((
unsigned char*)(p)+diff);
144inline P* memunit_advanced(
const P* p, std::ptrdiff_t diff)
146 return (P*)((
char*)(p)+diff);
153inline P& memunit_advanced_ref(P* p, std::ptrdiff_t diff) {
154 return *memunit_advanced(p,diff);
defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
Definition algorithm.hpp:36
Definition pixel_iterator.hpp:124
Returns the type of an iterator just like the input iterator, except operating over immutable values.
Definition pixel_iterator.hpp:40
metafunction predicate determining whether the given iterator is a plain one or an adaptor over anoth...
Definition pixel_iterator.hpp:28
returns the base iterator for a given iterator adaptor. Provide an specialization when introducing ne...
Definition metafunctions.hpp:36
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