get_pixel_type.cpp 1010 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // Copyright 2013 Christian Henning
  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.hpp>
  9. #include <boost/gil/extension/toolbox/metafunctions/get_pixel_type.hpp>
  10. #include <boost/test/unit_test.hpp>
  11. #include <type_traits>
  12. using namespace boost;
  13. using namespace gil;
  14. BOOST_AUTO_TEST_SUITE( toolbox_tests )
  15. BOOST_AUTO_TEST_CASE( get_pixel_type_test )
  16. {
  17. {
  18. using image_t = bit_aligned_image3_type<4, 15, 4, rgb_layout_t>::type;
  19. static_assert(std::is_same
  20. <
  21. get_pixel_type<image_t::view_t>::type,
  22. image_t::view_t::reference
  23. >::value, "");
  24. }
  25. {
  26. using image_t = rgb8_image_t;
  27. static_assert(std::is_same
  28. <
  29. get_pixel_type<image_t::view_t>::type,
  30. image_t::view_t::value_type
  31. >::value, "");
  32. }
  33. }
  34. BOOST_AUTO_TEST_SUITE_END()