2 // Copyright 2010 Kenneth Riddile
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_TARGA_DETAIL_SUPPORTED_TYPES_HPP
9 #define BOOST_GIL_EXTENSION_IO_TARGA_DETAIL_SUPPORTED_TYPES_HPP
11 #include <boost/gil/extension/io/targa/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 targa_read_support : read_support_false
28 static const targa_depth::type bpp = 0;
32 struct targa_read_support<uint8_t
36 static const targa_depth::type bpp = 24;
41 struct targa_read_support<uint8_t
45 static const targa_depth::type bpp = 32;
51 template< typename Channel
54 struct targa_write_support : write_support_false
58 struct targa_write_support<uint8_t
60 > : write_support_true {};
63 struct targa_write_support<uint8_t
65 > : write_support_true {};
69 template<typename Pixel>
70 struct is_read_supported<Pixel, targa_tag>
71 : std::integral_constant
74 detail::targa_read_support
76 typename channel_type<Pixel>::type,
77 typename color_space_type<Pixel>::type
81 using parent_t = detail::targa_read_support
83 typename channel_type<Pixel>::type,
84 typename color_space_type<Pixel>::type
87 static const typename targa_depth::type bpp = parent_t::bpp;
90 template<typename Pixel>
91 struct is_write_supported<Pixel, targa_tag>
92 : std::integral_constant
95 detail::targa_write_support
97 typename channel_type<Pixel>::type,
98 typename color_space_type<Pixel>::type
103 }} // namespace boost::gil