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_GET_PIXEL_TYPE_HPP
9 #define BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_GET_PIXEL_TYPE_HPP
11 #include <boost/gil/extension/toolbox/dynamic_images.hpp>
12 #include <boost/gil/extension/toolbox/metafunctions/is_bit_aligned.hpp>
14 #include <boost/gil/detail/mp11.hpp>
16 namespace boost{ namespace gil {
18 /// get_pixel_type metafunction
19 /// \brief Depending on Image this function generates either
20 /// the pixel type or the reference type in case
21 /// the image is bit_aligned.
22 template<typename View>
25 using type = mp11::mp_if
27 is_bit_aligned<typename View::value_type>,
28 typename View::reference,
29 typename View::value_type
33 template<typename Views>
34 struct get_pixel_type<any_image_view<Views>>
36 using type = any_image_pixel_t;
39 }} // namespace boost::gil