2 // Copyright 2019 Mateusz Loskot <mateusz at loskot dot net>
4 // Distributed under the Boost Software License, Version 1.0
5 // See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt
8 #include <boost/gil/dynamic_step.hpp>
9 #include <boost/gil/color_base.hpp> // kth_element_type
10 #include <boost/gil/pixel.hpp> // kth_element_type
11 #include <boost/gil/locator.hpp>
12 #include <boost/gil/pixel_iterator.hpp>
13 #include <boost/gil/typedefs.hpp>
15 #include <type_traits>
17 namespace gil
= boost::gil
;
19 template <typename Locator
>
20 void test_locator_from_iterator()
22 // The `memory_based_2d_locator` for X-step is calculated based on adapted iterator
23 // Only verify `type` member is available (i.e. specialization defined).
24 static_assert(std::is_class
26 typename
gil::dynamic_x_step_type
<Locator
>::type
29 static_assert(std::is_same
32 typename
gil::dynamic_y_step_type
<Locator
>::type
33 >::value
, "locator does not model HasDynamicYStepTypeConcept");
38 test_locator_from_iterator
<gil::gray8_loc_t
>();
39 test_locator_from_iterator
<gil::gray8c_loc_t
>();
40 test_locator_from_iterator
<gil::gray16_loc_t
>();
41 test_locator_from_iterator
<gil::gray16c_loc_t
>();
42 test_locator_from_iterator
<gil::gray32_loc_t
>();
43 test_locator_from_iterator
<gil::gray32c_loc_t
>();
44 test_locator_from_iterator
<gil::gray32f_loc_t
>();
46 test_locator_from_iterator
<gil::abgr8_loc_t
>();
47 test_locator_from_iterator
<gil::abgr16_loc_t
>();
48 test_locator_from_iterator
<gil::abgr32_loc_t
>();
49 test_locator_from_iterator
<gil::abgr32f_loc_t
>();
51 test_locator_from_iterator
<gil::argb8_loc_t
>();
52 test_locator_from_iterator
<gil::argb16_loc_t
>();
53 test_locator_from_iterator
<gil::argb32_loc_t
>();
54 test_locator_from_iterator
<gil::argb32f_loc_t
>();
56 test_locator_from_iterator
<gil::bgr8_loc_t
>();
57 test_locator_from_iterator
<gil::bgr16_loc_t
>();
58 test_locator_from_iterator
<gil::bgr32_loc_t
>();
59 test_locator_from_iterator
<gil::bgr32f_loc_t
>();
61 test_locator_from_iterator
<gil::bgra8_loc_t
>();
62 test_locator_from_iterator
<gil::bgra16_loc_t
>();
63 test_locator_from_iterator
<gil::bgra32_loc_t
>();
64 test_locator_from_iterator
<gil::bgra32f_loc_t
>();
66 test_locator_from_iterator
<gil::rgb8_loc_t
>();
67 test_locator_from_iterator
<gil::rgb8_planar_loc_t
>();
68 test_locator_from_iterator
<gil::rgb16_loc_t
>();
69 test_locator_from_iterator
<gil::rgb16_planar_loc_t
>();
70 test_locator_from_iterator
<gil::rgb32_loc_t
>();
71 test_locator_from_iterator
<gil::rgb32_planar_loc_t
>();
72 test_locator_from_iterator
<gil::rgb32f_loc_t
>();
73 test_locator_from_iterator
<gil::rgb32f_planar_loc_t
>();
75 test_locator_from_iterator
<gil::rgba8_loc_t
>();
76 test_locator_from_iterator
<gil::rgba8_planar_loc_t
>();
77 test_locator_from_iterator
<gil::rgba16_loc_t
>();
78 test_locator_from_iterator
<gil::rgba16_planar_loc_t
>();
79 test_locator_from_iterator
<gil::rgba32_loc_t
>();
80 test_locator_from_iterator
<gil::rgba32_planar_loc_t
>();
81 test_locator_from_iterator
<gil::rgba32f_loc_t
>();
82 test_locator_from_iterator
<gil::rgba32f_planar_loc_t
>();
84 test_locator_from_iterator
<gil::cmyk8_loc_t
>();
85 test_locator_from_iterator
<gil::cmyk8_planar_loc_t
>();
86 test_locator_from_iterator
<gil::cmyk16_loc_t
>();
87 test_locator_from_iterator
<gil::cmyk16_planar_loc_t
>();
88 test_locator_from_iterator
<gil::cmyk32_loc_t
>();
89 test_locator_from_iterator
<gil::cmyk32_planar_loc_t
>();
90 test_locator_from_iterator
<gil::cmyk32f_loc_t
>();
91 test_locator_from_iterator
<gil::cmyk32f_planar_loc_t
>();