123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- //
- // Copyright 2019 Mateusz Loskot <mateusz at loskot dot net>
- //
- // Distributed under the Boost Software License, Version 1.0
- // See accompanying file LICENSE_1_0.txt or copy at
- // http://www.boost.org/LICENSE_1_0.txt
- //
- // FIXME: Avoid Clang's flooding of non-disableable warnings like:
- // "T does not declare any constructor to initialize its non-modifiable members"
- // when compiling with concepts check enabled.
- // See https://bugs.llvm.org/show_bug.cgi?id=41759
- #if !defined(BOOST_GIL_USE_CONCEPT_CHECK) && !defined(__clang__)
- #error Compile with BOOST_GIL_USE_CONCEPT_CHECK defined
- #endif
- #include <boost/gil/concepts.hpp>
- #include <boost/gil/color_base.hpp> // kth_element_type
- #include <boost/gil/pixel.hpp> // kth_element_type
- #include <boost/gil/pixel_iterator.hpp>
- #include <boost/gil/pixel_iterator_adaptor.hpp>
- #include <boost/gil/planar_pixel_iterator.hpp> // kth_element_type
- #include <boost/gil/planar_pixel_reference.hpp> // kth_element_type
- #include <boost/gil/typedefs.hpp>
- #include <boost/concept_check.hpp>
- namespace gil = boost::gil;
- using boost::function_requires;
- template <typename Iterator>
- void test_immutable()
- {
- function_requires<gil::PixelIteratorConcept<Iterator>>();
- function_requires<gil::HasDynamicXStepTypeConcept<Iterator>>();
- // NOTE: Pixel iterator does not model Y-step
- //function_requires<gil::HasDynamicYStepTypeConcept<Iterator>>();
- }
- template <typename Iterator>
- void test_mutable()
- {
- function_requires<gil::MutablePixelIteratorConcept<Iterator>>();
- function_requires<gil::HasDynamicXStepTypeConcept<Iterator>>();
- // NOTE: Pixel iterator does not model Y-step
- //function_requires<gil::HasDynamicYStepTypeConcept<Iterator>>();
- }
- int main()
- {
- test_mutable<gil::gray8_ptr_t>();
- test_mutable<gil::gray8_step_ptr_t>();
- test_mutable<gil::gray16_ptr_t>();
- test_mutable<gil::gray16_step_ptr_t>();
- test_mutable<gil::gray32_ptr_t>();
- test_mutable<gil::gray32_step_ptr_t>();
- test_mutable<gil::gray32f_ptr_t>();
- test_mutable<gil::gray32f_step_ptr_t>();
- test_immutable<gil::gray8c_ptr_t>();
- test_immutable<gil::gray8c_step_ptr_t>();
- test_immutable<gil::gray16c_ptr_t>();
- test_immutable<gil::gray16c_step_ptr_t>();
- test_immutable<gil::gray32c_ptr_t>();
- test_immutable<gil::gray32c_step_ptr_t>();
- test_immutable<gil::gray32fc_ptr_t>();
- test_immutable<gil::gray32fc_step_ptr_t>();
- test_mutable<gil::abgr8_ptr_t>();
- test_mutable<gil::abgr8_step_ptr_t>();
- test_mutable<gil::abgr16_ptr_t>();
- test_mutable<gil::abgr16_step_ptr_t>();
- test_mutable<gil::abgr32_ptr_t>();
- test_mutable<gil::abgr32_step_ptr_t>();
- test_mutable<gil::abgr32f_ptr_t>();
- test_mutable<gil::abgr32f_step_ptr_t>();
- test_immutable<gil::abgr8c_ptr_t>();
- test_immutable<gil::abgr8c_step_ptr_t>();
- test_immutable<gil::abgr16c_ptr_t>();
- test_immutable<gil::abgr16c_step_ptr_t>();
- test_immutable<gil::abgr32c_ptr_t>();
- test_immutable<gil::abgr32c_step_ptr_t>();
- test_immutable<gil::abgr32fc_ptr_t>();
- test_immutable<gil::abgr32fc_step_ptr_t>();
- test_mutable<gil::argb8_ptr_t>();
- test_mutable<gil::argb8_step_ptr_t>();
- test_mutable<gil::argb16_ptr_t>();
- test_mutable<gil::argb16_step_ptr_t>();
- test_mutable<gil::argb32_ptr_t>();
- test_mutable<gil::argb32_step_ptr_t>();
- test_mutable<gil::argb32f_ptr_t>();
- test_mutable<gil::argb32f_step_ptr_t>();
- test_mutable<gil::bgr8_ptr_t>();
- test_mutable<gil::bgr8_step_ptr_t>();
- test_mutable<gil::bgr16_ptr_t>();
- test_mutable<gil::bgr16_step_ptr_t>();
- test_mutable<gil::bgr32_ptr_t>();
- test_mutable<gil::bgr32_step_ptr_t>();
- test_mutable<gil::bgr32f_ptr_t>();
- test_mutable<gil::bgr32f_step_ptr_t>();
- test_mutable<gil::bgra8_ptr_t>();
- test_mutable<gil::bgra8_step_ptr_t>();
- test_mutable<gil::bgra16_ptr_t>();
- test_mutable<gil::bgra16_step_ptr_t>();
- test_mutable<gil::bgra32_ptr_t>();
- test_mutable<gil::bgra32_step_ptr_t>();
- test_mutable<gil::bgra32f_ptr_t>();
- test_mutable<gil::bgra32f_step_ptr_t>();
- test_mutable<gil::rgb8_ptr_t>();
- test_mutable<gil::rgb8_step_ptr_t>();
- test_mutable<gil::rgb8_planar_ptr_t>();
- test_mutable<gil::rgb8_planar_step_ptr_t>();
- test_mutable<gil::rgb16_ptr_t>();
- test_mutable<gil::rgb16_step_ptr_t>();
- test_mutable<gil::rgb16_planar_ptr_t>();
- test_mutable<gil::rgb16_planar_step_ptr_t>();
- test_mutable<gil::rgb32_ptr_t>();
- test_mutable<gil::rgb32_step_ptr_t>();
- test_mutable<gil::rgb32_planar_ptr_t>();
- test_mutable<gil::rgb32_planar_step_ptr_t>();
- test_mutable<gil::rgb32f_ptr_t>();
- test_mutable<gil::rgb32f_step_ptr_t>();
- test_mutable<gil::rgb32f_planar_ptr_t>();
- test_mutable<gil::rgb32f_planar_step_ptr_t>();
- test_immutable<gil::rgb8c_ptr_t>();
- test_immutable<gil::rgb8c_step_ptr_t>();
- test_immutable<gil::rgb16c_ptr_t>();
- test_immutable<gil::rgb16c_step_ptr_t>();
- test_immutable<gil::rgb32c_ptr_t>();
- test_immutable<gil::rgb32c_step_ptr_t>();
- test_immutable<gil::rgb32fc_ptr_t>();
- test_immutable<gil::rgb32fc_step_ptr_t>();
- test_mutable<gil::rgba8_ptr_t>();
- test_mutable<gil::rgba8_step_ptr_t>();
- test_mutable<gil::rgba8_planar_ptr_t>();
- test_mutable<gil::rgba8_planar_step_ptr_t>();
- test_mutable<gil::rgba16_ptr_t>();
- test_mutable<gil::rgba16_step_ptr_t>();
- test_mutable<gil::rgba16_planar_ptr_t>();
- test_mutable<gil::rgba16_planar_step_ptr_t>();
- test_mutable<gil::rgba32_ptr_t>();
- test_mutable<gil::rgba32_step_ptr_t>();
- test_mutable<gil::rgba32_planar_ptr_t>();
- test_mutable<gil::rgba32_planar_step_ptr_t>();
- test_mutable<gil::rgba32f_ptr_t>();
- test_mutable<gil::rgba32f_step_ptr_t>();
- test_mutable<gil::rgba32f_planar_ptr_t>();
- test_mutable<gil::rgba32f_planar_step_ptr_t>();
- test_mutable<gil::cmyk8_ptr_t>();
- test_mutable<gil::cmyk8_step_ptr_t>();
- test_mutable<gil::cmyk8_planar_ptr_t>();
- test_mutable<gil::cmyk8_planar_step_ptr_t>();
- test_mutable<gil::cmyk16_ptr_t>();
- test_mutable<gil::cmyk16_step_ptr_t>();
- test_mutable<gil::cmyk16_planar_ptr_t>();
- test_mutable<gil::cmyk16_planar_step_ptr_t>();
- test_mutable<gil::cmyk32_ptr_t>();
- test_mutable<gil::cmyk32_step_ptr_t>();
- test_mutable<gil::cmyk32_planar_ptr_t>();
- test_mutable<gil::cmyk32_planar_step_ptr_t>();
- test_mutable<gil::cmyk32f_ptr_t>();
- test_mutable<gil::cmyk32f_step_ptr_t>();
- test_mutable<gil::cmyk32f_planar_ptr_t>();
- test_mutable<gil::cmyk32f_planar_step_ptr_t>();
- test_immutable<gil::cmyk8c_ptr_t>();
- test_immutable<gil::cmyk8c_step_ptr_t>();
- test_immutable<gil::cmyk8c_planar_ptr_t>();
- test_immutable<gil::cmyk8c_planar_step_ptr_t>();
- }
|