]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/gil/test/extension/toolbox/channel_type.cpp
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>
12 #include <boost/gil/detail/is_channel_integral.hpp>
14 #include <boost/test/unit_test.hpp>
16 #include <type_traits>
18 namespace bg
= boost::gil
;
20 BOOST_AUTO_TEST_SUITE(toolbox_tests
)
22 BOOST_AUTO_TEST_CASE(channel_type_test
)
24 static_assert(std::is_same
27 bg::channel_type
<bg::rgb8_pixel_t
>::type
30 // float32_t is a scoped_channel_value object
31 static_assert(std::is_same
34 bg::channel_type
<bg::rgba32f_pixel_t
>::type
37 // channel_type for bit_aligned images doesn't work with standard gil.
38 using image_t
= bg::bit_aligned_image4_type
<4, 4, 4, 4, bg::rgb_layout_t
>::type
;
39 using channel_t
= bg::channel_type
<image_t::view_t::reference
>::type
;
40 static_assert(bg::detail::is_channel_integral
<channel_t
>::value
, "");
43 BOOST_AUTO_TEST_SUITE_END()