2 // Copyright 2009 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_JPEG_DETAIL_IS_ALLOWED_HPP
9 #define BOOST_GIL_EXTENSION_IO_JPEG_DETAIL_IS_ALLOWED_HPP
11 #include <boost/gil/extension/io/jpeg/tags.hpp>
13 #include <type_traits>
15 namespace boost { namespace gil { namespace detail {
17 template< typename View >
18 bool is_allowed( const image_read_info< jpeg_tag >& info
19 , std::true_type // is read_and_no_convert
22 if( info._color_space == JCS_YCbCr )
24 // We read JCS_YCbCr files as rgb.
25 return ( is_read_supported< typename View::value_type
27 >::_color_space == JCS_RGB );
30 return ( is_read_supported< typename View::value_type
32 >::_color_space == info._color_space );
35 template< typename View >
36 bool is_allowed( const image_read_info< jpeg_tag >& /* info */
37 , std::false_type // is read_and_convert