2 // Copyright 2008 Christian Henning
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_IO_RAW_DETAIL_SUPPORTED_TYPES_HPP
9 #define BOOST_GIL_EXTENSION_IO_RAW_DETAIL_SUPPORTED_TYPES_HPP
11 #include <boost/gil/extension/io/raw/tags.hpp>
13 #include <boost/gil/channel.hpp>
14 #include <boost/gil/color_base.hpp>
15 #include <boost/gil/io/base.hpp>
17 #include <type_traits>
19 namespace boost { namespace gil { namespace detail {
23 template< typename Channel
26 struct raw_read_support : read_support_false {};
29 struct raw_read_support<uint8_t
31 > : read_support_true {};
34 struct raw_read_support<uint16_t
36 > : read_support_true {};
39 struct raw_read_support<uint8_t
41 > : read_support_true {};
44 struct raw_read_support<uint16_t
46 > : read_support_true {};
50 struct raw_write_support : write_support_false {};
54 template<typename Pixel>
55 struct is_read_supported<Pixel,raw_tag>
56 : std::integral_constant
59 detail::raw_read_support
61 typename channel_type<Pixel>::type,
62 typename color_space_type<Pixel>::type
67 template<typename Pixel>
68 struct is_write_supported<Pixel, raw_tag>
69 : std::integral_constant<bool, detail::raw_write_support::is_supported>
72 }} // namespace boost::gil