2 // Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev
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 #ifndef BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_PIXEL_BIT_SIZE_HPP
9 #define BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_PIXEL_BIT_SIZE_HPP
11 #include <boost/gil/bit_aligned_pixel_reference.hpp>
12 #include <boost/gil/packed_pixel.hpp>
14 namespace boost{ namespace gil {
16 /// pixel_bit_size metafunctions
17 /// \brief Accumulates the all channel size.
20 /// using image_t = bit_aligned_image5_type<16, 16, 16, 8, 8, devicen_layout_t<5>>::type;
21 /// const int size = pixel_bit_size<image_t::view_t::reference>::value;
23 template< typename PixelRef>
24 struct pixel_bit_size : std::integral_constant<int, 0> {};
26 template <typename B, typename C, typename L, bool M>
27 struct pixel_bit_size<bit_aligned_pixel_reference<B, C, L, M>>
31 std::integral_constant<int, 0>,
36 template <typename B, typename C, typename L, bool M>
37 struct pixel_bit_size<bit_aligned_pixel_reference<B, C, L, M> const>
41 std::integral_constant<int, 0>,
46 template <typename B, typename C, typename L>
47 struct pixel_bit_size<packed_pixel<B, C, L>>
51 std::integral_constant<int, 0>,
57 template <typename B, typename C, typename L>
58 struct pixel_bit_size<const packed_pixel<B,C,L> >
62 std::integral_constant<int, 0>,
67 }} // namespace boost::gil