8 #ifndef BOOST_GIL_CONCEPTS_PIXEL_LOCATOR_HPP 9 #define BOOST_GIL_CONCEPTS_PIXEL_LOCATOR_HPP 11 #include <boost/gil/concepts/basic.hpp> 12 #include <boost/gil/concepts/concept_check.hpp> 13 #include <boost/gil/concepts/fwd.hpp> 14 #include <boost/gil/concepts/pixel_dereference.hpp> 15 #include <boost/gil/concepts/pixel_iterator.hpp> 16 #include <boost/gil/concepts/point.hpp> 17 #include <boost/gil/concepts/detail/utility.hpp> 22 #if defined(BOOST_CLANG) 23 #pragma clang diagnostic push 24 #pragma clang diagnostic ignored "-Wunused-local-typedefs" 27 #if defined(BOOST_GCC) && (BOOST_GCC >= 40600) 28 #pragma GCC diagnostic push 29 #pragma GCC diagnostic ignored "-Wunused-local-typedefs" 30 #pragma GCC diagnostic ignored "-Wunused-but-set-variable" 33 namespace boost {
namespace gil {
100 template <
typename Loc>
105 gil_function_requires<Regular<Loc>>();
109 using value_type =
typename Loc::value_type;
110 ignore_unused_variable_warning(value_type{});
113 using reference =
typename Loc::reference;
117 using difference_type =
typename Loc::difference_type;
118 ignore_unused_variable_warning(difference_type{});
121 using cached_location_t =
typename Loc::cached_location_t;
122 ignore_unused_variable_warning(cached_location_t{});
125 using const_t =
typename Loc::const_t;
126 ignore_unused_variable_warning(const_t{});
129 using point_t =
typename Loc::point_t;
130 ignore_unused_variable_warning(point_t{});
132 static std::size_t
const N = Loc::num_dimensions; ignore_unused_variable_warning(N);
134 using first_it_type =
typename Loc::template axis<0>::iterator;
135 using last_it_type =
typename Loc::template axis<N-1>::iterator;
136 gil_function_requires<boost_concepts::RandomAccessTraversalConcept<first_it_type>>();
137 gil_function_requires<boost_concepts::RandomAccessTraversalConcept<last_it_type>>();
141 gil_function_requires<PointNDConcept<point_t>>();
142 static_assert(point_t::num_dimensions == N,
"");
143 static_assert(is_same
145 typename std::iterator_traits<first_it_type>::difference_type,
146 typename point_t::template axis<0>::coord_t
148 static_assert(is_same
150 typename std::iterator_traits<last_it_type>::difference_type,
151 typename point_t::template axis<N-1>::coord_t
159 reference r1 = loc[d]; ignore_unused_variable_warning(r1);
160 reference r2 = *loc; ignore_unused_variable_warning(r2);
161 cached_location_t cl = loc.cache_location(d); ignore_unused_variable_warning(cl);
162 reference r3 = loc[d]; ignore_unused_variable_warning(r3);
164 first_it_type fi = loc.template axis_iterator<0>();
165 fi = loc.template axis_iterator<0>(d);
166 last_it_type li = loc.template axis_iterator<N-1>();
167 li = loc.template axis_iterator<N-1>(d);
169 using deref_t = PixelDereferenceAdaptorArchetype<typename Loc::value_type>;
170 using dtype =
typename Loc::template add_deref<deref_t>::type;
217 template <
typename Loc>
222 gil_function_requires<RandomAccessNDLocatorConcept<Loc>>();
223 static_assert(Loc::num_dimensions == 2,
"");
227 using transposed_t =
typename transposed_type<Loc>::type;
229 using cached_location_t =
typename Loc::cached_location_t;
230 gil_function_requires<Point2DConcept<typename Loc::point_t>>();
232 using x_iterator =
typename Loc::x_iterator;
233 using y_iterator =
typename Loc::y_iterator;
234 using x_coord_t =
typename Loc::x_coord_t;
235 using y_coord_t =
typename Loc::y_coord_t;
237 x_coord_t xd = 0; ignore_unused_variable_warning(xd);
238 y_coord_t yd = 0; ignore_unused_variable_warning(yd);
240 typename Loc::difference_type d;
241 typename Loc::reference r=loc(xd,yd); ignore_unused_variable_warning(r);
243 dynamic_x_step_t loc2(dynamic_x_step_t(), yd);
244 dynamic_x_step_t loc3(dynamic_x_step_t(), xd, yd);
250 dynamic_xy_step_transposed_t loc4(loc, xd,yd,
true);
252 bool is_contiguous = loc.is_1d_traversable(xd);
253 ignore_unused_variable_warning(is_contiguous);
255 loc.y_distance_to(loc, xd);
258 loc = loc.xy_at(xd, yd);
260 x_iterator xit = loc.x_at(d);
261 xit = loc.x_at(xd, yd);
264 y_iterator yit = loc.y_at(d);
265 yit = loc.y_at(xd, yd);
268 cached_location_t cl = loc.cache_location(xd, yd);
269 ignore_unused_variable_warning(cl);
287 template <
typename Loc>
292 gil_function_requires<RandomAccess2DLocatorConcept<Loc>>();
293 gil_function_requires<PixelIteratorConcept<typename Loc::x_iterator>>();
294 gil_function_requires<PixelIteratorConcept<typename Loc::y_iterator>>();
295 using coord_t =
typename Loc::coord_t;
296 static_assert(is_same<typename Loc::x_coord_t, typename Loc::y_coord_t>::value,
"");
304 template <
typename Loc>
309 gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
311 typename Loc::template axis<0>::iterator
313 gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
315 typename Loc::template axis<Loc::num_dimensions-1>::iterator
318 typename Loc::difference_type d; initialize_it(d);
319 typename Loc::value_type v; initialize_it(v);
320 typename Loc::cached_location_t cl = loc.cache_location(d);
329 template <
typename Loc>
330 struct RandomAccess2DLocatorIsMutableConcept
334 gil_function_requires<detail::RandomAccessNDLocatorIsMutableConcept<Loc>>();
335 typename Loc::x_coord_t xd = 0; ignore_unused_variable_warning(xd);
336 typename Loc::y_coord_t yd = 0; ignore_unused_variable_warning(yd);
337 typename Loc::value_type v; initialize_it(v);
354 template <
typename Loc>
359 gil_function_requires<RandomAccessNDLocatorConcept<Loc>>();
360 gil_function_requires<detail::RandomAccessNDLocatorIsMutableConcept<Loc>>();
371 template <
typename Loc>
376 gil_function_requires<RandomAccess2DLocatorConcept<Loc>>();
377 gil_function_requires<detail::RandomAccess2DLocatorIsMutableConcept<Loc>>();
388 template <
typename Loc>
393 gil_function_requires<PixelLocatorConcept<Loc>>();
394 gil_function_requires<detail::RandomAccess2DLocatorIsMutableConcept<Loc>>();
400 #if defined(BOOST_CLANG) 401 #pragma clang diagnostic pop 404 #if defined(BOOST_GCC) && (BOOST_GCC >= 40600) 405 #pragma GCC diagnostic pop N-dimensional locator over mutable pixels.
Definition: pixel_locator.hpp:355
Definition: pixel_locator.hpp:305
Definition: algorithm.hpp:30
2-dimensional locator over mutable pixels
Definition: pixel_locator.hpp:372
2-dimensional locator over immutable values
Definition: pixel_locator.hpp:218
GIL's 2-dimensional locator over immutable GIL pixels.
Definition: pixel_locator.hpp:288
Base template for types that model HasDynamicYStepTypeConcept.
Definition: dynamic_step.hpp:21
N-dimensional locator over immutable values.
Definition: pixel_locator.hpp:101
Base template for types that model HasDynamicXStepTypeConcept.
Definition: dynamic_step.hpp:17
GIL's 2-dimensional locator over mutable GIL pixels.
Definition: pixel_locator.hpp:389