2 // Copyright 2013 Christian Henning
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/extension/toolbox/metafunctions/channel_type.hpp>
9 #include <boost/gil/extension/toolbox/metafunctions/is_bit_aligned.hpp>
11 #include <boost/gil/channel.hpp> // boost::is_integral<packed_dynamic_channel_reference<...>>
13 #include <boost/test/unit_test.hpp>
15 #include <type_traits>
17 namespace bg = boost::gil;
19 BOOST_AUTO_TEST_SUITE(toolbox_tests)
21 BOOST_AUTO_TEST_CASE(channel_type_test)
23 static_assert(std::is_same
26 bg::channel_type<bg::rgb8_pixel_t>::type
29 // float32_t is a scoped_channel_value object
30 static_assert(std::is_same
33 bg::channel_type<bg::rgba32f_pixel_t>::type
36 // channel_type for bit_aligned images doesn't work with standard gil.
37 using image_t = bg::bit_aligned_image4_type<4, 4, 4, 4, bg::rgb_layout_t>::type;
38 using channel_t = bg::channel_type<image_t::view_t::reference>::type;
39 static_assert(boost::is_integral<channel_t>::value, "");
42 BOOST_AUTO_TEST_SUITE_END()