2 // Copyright 2019 Mateusz Loskot <mateusz at loskot dot net>
3 // Copyright 2005-2007 Adobe Systems Incorporated
5 // Distributed under the Boost Software License, Version 1.0
6 // See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt
9 #ifndef BOOST_GIL_DETAIL_IS_CHANNEL_INTEGRAL_HPP
10 #define BOOST_GIL_DETAIL_IS_CHANNEL_INTEGRAL_HPP
12 #include <boost/gil/channel.hpp>
14 #include <type_traits>
16 namespace boost { namespace gil { namespace detail {
18 template <typename ChannelValue>
19 struct is_channel_integral : std::is_integral<ChannelValue> {};
21 template <int NumBits>
22 struct is_channel_integral<boost::gil::packed_channel_value<NumBits>> : std::true_type {};
24 template <typename BitField, int FirstBit, int NumBits, bool IsMutable>
25 struct is_channel_integral
27 boost::gil::packed_channel_reference<BitField, FirstBit, NumBits, IsMutable>
31 template <typename BitField, int NumBits, bool IsMutable>
32 struct is_channel_integral
34 boost::gil::packed_dynamic_channel_reference<BitField, NumBits, IsMutable>
38 template <typename BaseChannelValue, typename MinVal, typename MaxVal>
39 struct is_channel_integral
41 boost::gil::scoped_channel_value<BaseChannelValue, MinVal, MaxVal>
42 > : std::is_integral<BaseChannelValue>
45 }}} //namespace boost::gil::detail