color_spaces_are_compatible.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // Copyright 2019 Mateusz Loskot <mateusz at loskot dot net>
  3. //
  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
  7. //
  8. #include <boost/gil/color_base.hpp>
  9. #include <boost/gil/concepts.hpp>
  10. #include <boost/gil/device_n.hpp>
  11. #include <boost/gil/gray.hpp>
  12. #include <boost/gil/rgb.hpp>
  13. #include <boost/gil/rgba.hpp>
  14. #include <boost/gil/cmyk.hpp>
  15. #include <boost/gil/typedefs.hpp>
  16. #include <boost/mp11.hpp>
  17. #include <type_traits>
  18. namespace gil = boost::gil;
  19. using namespace boost::mp11;
  20. template <typename T>
  21. using test_self_compatible = gil::color_spaces_are_compatible<T, T>;
  22. int main()
  23. {
  24. using color_spaces = mp_list
  25. <
  26. gil::devicen_t<2>,
  27. gil::devicen_t<3>,
  28. gil::devicen_t<4>,
  29. gil::devicen_t<5>,
  30. gil::gray_t,
  31. gil::cmyk_t,
  32. gil::rgb_t,
  33. gil::rgba_t
  34. >;
  35. static_assert(std::is_same
  36. <
  37. mp_all_of<color_spaces, test_self_compatible>,
  38. std::true_type
  39. >::value,
  40. "color_spaces_are_compatible should yield true for the same types");
  41. }