Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:51:51

0001 //
0002 // Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev
0003 //
0004 // Distributed under the Boost Software License, Version 1.0
0005 // See accompanying file LICENSE_1_0.txt or copy at
0006 // http://www.boost.org/LICENSE_1_0.txt
0007 //
0008 #ifndef BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_PIXEL_BIT_SIZE_HPP
0009 #define BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_PIXEL_BIT_SIZE_HPP
0010 
0011 #include <boost/gil/bit_aligned_pixel_reference.hpp>
0012 #include <boost/gil/packed_pixel.hpp>
0013 
0014 namespace boost{ namespace gil {
0015 
0016 /// pixel_bit_size metafunctions
0017 /// \brief Accumulates the all channel size.
0018 ///
0019 /// \code
0020 /// using image_t = bit_aligned_image5_type<16, 16, 16, 8, 8, devicen_layout_t<5>>::type;
0021 /// const int size = pixel_bit_size<image_t::view_t::reference>::value;
0022 /// \endcode
0023 template< typename PixelRef>
0024 struct pixel_bit_size : std::integral_constant<int, 0> {};
0025 
0026 template <typename B, typename C, typename L, bool M>
0027 struct pixel_bit_size<bit_aligned_pixel_reference<B, C, L, M>>
0028     : mp11::mp_fold
0029     <
0030         C,
0031         std::integral_constant<int, 0>,
0032         mp11::mp_plus
0033     >
0034 {};
0035 
0036 template <typename B, typename C, typename L, bool M>
0037 struct pixel_bit_size<bit_aligned_pixel_reference<B, C, L, M> const>
0038     : mp11::mp_fold
0039     <
0040         C,
0041         std::integral_constant<int, 0>,
0042         mp11::mp_plus
0043     >
0044 {};
0045 
0046 template <typename B, typename C, typename L>
0047 struct pixel_bit_size<packed_pixel<B, C, L>>
0048     : mp11::mp_fold
0049     <
0050         C,
0051         std::integral_constant<int, 0>,
0052         mp11::mp_plus
0053     >
0054 
0055 {};
0056 
0057 template <typename B, typename C, typename L>
0058 struct pixel_bit_size<const packed_pixel<B,C,L> >
0059     : mp11::mp_fold
0060     <
0061         C,
0062         std::integral_constant<int, 0>,
0063         mp11::mp_plus
0064     >
0065 {};
0066 
0067 }} // namespace boost::gil
0068 
0069 #endif