8 #ifndef BOOST_GIL_CONCEPTS_IMAGE_VIEW_HPP 9 #define BOOST_GIL_CONCEPTS_IMAGE_VIEW_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.hpp> 15 #include <boost/gil/concepts/pixel_dereference.hpp> 16 #include <boost/gil/concepts/pixel_iterator.hpp> 17 #include <boost/gil/concepts/pixel_locator.hpp> 18 #include <boost/gil/concepts/point.hpp> 19 #include <boost/gil/concepts/detail/utility.hpp> 24 #if defined(BOOST_CLANG) 25 #pragma clang diagnostic push 26 #pragma clang diagnostic ignored "-Wunused-local-typedefs" 29 #if defined(BOOST_GCC) && (BOOST_GCC >= 40600) 30 #pragma GCC diagnostic push 31 #pragma GCC diagnostic ignored "-Wunused-local-typedefs" 32 #pragma GCC diagnostic ignored "-Wunused-but-set-variable" 35 namespace boost {
namespace gil {
100 template <
typename View>
105 gil_function_requires<Regular<View>>();
107 using value_type =
typename View::value_type;
108 using reference =
typename View::reference;
109 using pointer =
typename View::pointer;
110 using difference_type =
typename View::difference_type;
111 using const_t =
typename View::const_t;
112 using point_t =
typename View::point_t;
113 using locator =
typename View::locator;
114 using iterator =
typename View::iterator;
115 using const_iterator =
typename View::const_iterator;
116 using reverse_iterator =
typename View::reverse_iterator;
117 using size_type =
typename View::size_type;
118 static const std::size_t N=View::num_dimensions;
120 gil_function_requires<RandomAccessNDLocatorConcept<locator>>();
121 gil_function_requires<boost_concepts::RandomAccessTraversalConcept<iterator>>();
122 gil_function_requires<boost_concepts::RandomAccessTraversalConcept<reverse_iterator>>();
124 using first_it_type =
typename View::template axis<0>::iterator;
125 using last_it_type =
typename View::template axis<N-1>::iterator;
126 gil_function_requires<boost_concepts::RandomAccessTraversalConcept<first_it_type>>();
127 gil_function_requires<boost_concepts::RandomAccessTraversalConcept<last_it_type>>();
133 gil_function_requires<PointNDConcept<point_t>>();
134 static_assert(point_t::num_dimensions == N,
"");
135 static_assert(is_same
137 typename std::iterator_traits<first_it_type>::difference_type,
138 typename point_t::template axis<0>::coord_t
140 static_assert(is_same
142 typename std::iterator_traits<last_it_type>::difference_type,
143 typename point_t::template axis<N-1>::coord_t
149 reverse_iterator rit;
150 difference_type d; detail::initialize_it(d); ignore_unused_variable_warning(d);
154 p = view.dimensions();
156 size_type sz = view.size(); ignore_unused_variable_warning(sz);
157 bool is_contiguous = view.is_1d_traversable();
158 ignore_unused_variable_warning(is_contiguous);
165 reference r1 = view[d]; ignore_unused_variable_warning(r1);
166 reference r2 = view(p); ignore_unused_variable_warning(r2);
169 first_it_type fi = view.template axis_iterator<0>(p);
170 ignore_unused_variable_warning(fi);
171 last_it_type li = view.template axis_iterator<N-1>(p);
172 ignore_unused_variable_warning(li);
174 using deref_t = PixelDereferenceAdaptorArchetype<typename View::value_type>;
175 using dtype =
typename View::template add_deref<deref_t>::type;
218 template <
typename View>
223 gil_function_requires<RandomAccessNDImageViewConcept<View>>();
224 static_assert(View::num_dimensions == 2,
"");
227 gil_function_requires<RandomAccess2DLocatorConcept<typename View::locator>>();
231 using transposed_t =
typename transposed_type<View>::type;
232 using x_iterator =
typename View::x_iterator;
233 using y_iterator =
typename View::y_iterator;
234 using x_coord_t =
typename View::x_coord_t;
235 using y_coord_t =
typename View::y_coord_t;
236 using xy_locator =
typename View::xy_locator;
238 x_coord_t xd = 0; ignore_unused_variable_warning(xd);
239 y_coord_t yd = 0; ignore_unused_variable_warning(yd);
242 typename View::point_t d;
244 View(xd, yd, xy_locator());
246 xy_locator lc =
view.xy_at(xd, yd);
249 typename View::reference r =
view(xd, yd);
250 ignore_unused_variable_warning(r);
255 xit =
view.x_at(xd,yd);
256 xit =
view.row_begin(xd);
257 xit =
view.row_end(xd);
260 yit =
view.y_at(xd,yd);
261 yit =
view.col_begin(xd);
262 yit =
view.col_end(xd);
271 template <
typename View>
276 using value_type =
typename View::value_type;
277 using iterator =
typename View::iterator;
278 using const_iterator =
typename View::const_iterator;
279 using reference =
typename View::reference;
280 using const_reference =
typename View::const_reference;
281 using pointer =
typename View::pointer;
282 using difference_type =
typename View::difference_type;
283 using size_type=
typename View::size_type;
296 ignore_unused_variable_warning(s);
310 template <
typename View>
315 gil_function_requires<CollectionImageViewConcept<View>>();
317 using reference =
typename View::reference;
318 using const_reference =
typename View::const_reference;
320 reference r =
view.front();
321 ignore_unused_variable_warning(r);
323 const_reference cr =
view.front();
324 ignore_unused_variable_warning(cr);
333 template <
typename View>
338 gil_function_requires<CollectionImageViewConcept<View>>();
340 using reverse_iterator =
typename View::reverse_iterator;
341 using reference =
typename View::reference;
342 using const_reference =
typename View::const_reference;
348 reference r =
view.back();
349 ignore_unused_variable_warning(r);
351 const_reference cr =
view.back();
352 ignore_unused_variable_warning(cr);
372 template <
typename View>
377 gil_function_requires<RandomAccess2DImageViewConcept<View>>();
380 gil_function_requires<PixelLocatorConcept<typename View::xy_locator>>();
382 static_assert(is_same<typename View::x_coord_t, typename View::y_coord_t>::value,
"");
384 using coord_t =
typename View::coord_t;
385 std::size_t num_chan =
view.num_channels(); ignore_unused_variable_warning(num_chan);
393 template <
typename View>
398 gil_function_requires<detail::RandomAccessNDLocatorIsMutableConcept<typename View::locator>>();
400 gil_function_requires<detail::RandomAccessIteratorIsMutableConcept<typename View::iterator>>();
402 gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
404 typename View::reverse_iterator
407 gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
409 typename View::template axis<0>::iterator
412 gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
414 typename View::template axis<View::num_dimensions - 1>::iterator
417 typename View::difference_type diff;
419 ignore_unused_variable_warning(diff);
421 typename View::point_t pt;
422 typename View::value_type v;
432 template <
typename View>
437 gil_function_requires<detail::RandomAccessNDImageViewIsMutableConcept<View>>();
438 typename View::x_coord_t xd = 0; ignore_unused_variable_warning(xd);
439 typename View::y_coord_t yd = 0; ignore_unused_variable_warning(yd);
440 typename View::value_type v; initialize_it(v);
447 template <
typename View>
452 gil_function_requires<detail::RandomAccess2DImageViewIsMutableConcept<View>>();
467 template <
typename View>
472 gil_function_requires<RandomAccessNDImageViewConcept<View>>();
473 gil_function_requires<detail::RandomAccessNDImageViewIsMutableConcept<View>>();
484 template <
typename View>
489 gil_function_requires<RandomAccess2DImageViewConcept<View>>();
490 gil_function_requires<detail::RandomAccess2DImageViewIsMutableConcept<View>>();
501 template <
typename View>
506 gil_function_requires<ImageViewConcept<View>>();
507 gil_function_requires<detail::PixelImageViewIsMutableConcept<View>>();
519 template <
typename V1,
typename V2>
536 template <
typename V1,
typename V2>
547 #if defined(BOOST_CLANG) 548 #pragma clang diagnostic pop 551 #if defined(BOOST_GCC) && (BOOST_GCC >= 40600) 552 #pragma GCC diagnostic pop 2-dimensional view over mutable values
Definition: concepts/image_view.hpp:485
Definition: algorithm.hpp:30
Definition: concepts/image_view.hpp:394
N-dimensional view over mutable values.
Definition: concepts/image_view.hpp:468
GIL view as Collection.
Definition: concepts/image_view.hpp:272
Returns whether two views are compatible.
Definition: concepts/image_view.hpp:520
GIL view as ReversibleCollection.
Definition: concepts/image_view.hpp:334
Definition: concepts/image_view.hpp:433
Base template for types that model HasDynamicYStepTypeConcept.
Definition: dynamic_step.hpp:21
GIL's 2-dimensional view over mutable GIL pixels.
Definition: concepts/image_view.hpp:502
Returns whether two pixels are compatible Pixels are compatible if their channels and color space typ...
Definition: concepts/pixel.hpp:231
GIL's 2-dimensional view over immutable GIL pixels.
Definition: concepts/image_view.hpp:373
const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
Returns the non-constant-pixel view of an image.
Definition: image.hpp:460
2-dimensional view over immutable values
Definition: concepts/image_view.hpp:219
GIL view as ForwardCollection.
Definition: concepts/image_view.hpp:311
Views are compatible if they have the same color spaces and compatible channel values.
Definition: concepts/image_view.hpp:537
N-dimensional view over immutable values.
Definition: concepts/image_view.hpp:101
Definition: concepts/image_view.hpp:448
Base template for types that model HasDynamicXStepTypeConcept.
Definition: dynamic_step.hpp:17