2 // Copyright 2019 Mateusz Loskot <mateusz at loskot dot net>
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/channel.hpp>
9 #include <boost/gil/typedefs.hpp>
11 namespace gil = boost::gil;
15 static_assert(boost::is_integral<gil::packed_channel_value<1>>::value,
16 "1-bit packed_channel_value should be recognized as integral");
18 static_assert(boost::is_integral<gil::packed_channel_value<8>>::value,
19 "8-bit packed_channel_value should be recognized as integral");
21 static_assert(boost::is_integral
23 gil::packed_channel_reference
25 std::uint8_t, 0, 3, true
28 "3-bit packed_channel_reference should be recognized as integral");
30 static_assert(boost::is_integral
32 gil::packed_dynamic_channel_reference
37 "2-bit packed_dynamic_channel_reference should be recognized as integral");
39 static_assert(boost::is_integral
41 gil::packed_dynamic_channel_reference
43 std::uint16_t, 15, true
46 "15-bit packed_dynamic_channel_reference should be recognized as integral");
49 struct int_minus_value { static std::int8_t apply() { return -64; } };
50 struct int_plus_value { static std::int8_t apply() { return 64; } };
51 static_assert(boost::is_integral
53 gil::scoped_channel_value
55 std::uint8_t, int_minus_value, int_plus_value
58 "integer-based scoped_channel_value should be recognized as integral");
60 static_assert(!boost::is_integral<gil::float32_t>::value,
61 "float-based packed_channel_value should not be recognized as integral");
63 static_assert(!boost::is_integral<gil::float64_t>::value,
64 "float-based packed_channel_value should not be recognized as integral");