File indexing completed on 2025-01-18 09:36:56
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_GIL_EXTENSION_IO_JPEG_DETAIL_IS_ALLOWED_HPP
0009 #define BOOST_GIL_EXTENSION_IO_JPEG_DETAIL_IS_ALLOWED_HPP
0010
0011 #include <boost/gil/extension/io/jpeg/tags.hpp>
0012
0013 #include <type_traits>
0014
0015 namespace boost { namespace gil { namespace detail {
0016
0017 template< typename View >
0018 bool is_allowed( const image_read_info< jpeg_tag >& info
0019 , std::true_type
0020 )
0021 {
0022 if( info._color_space == JCS_YCbCr )
0023 {
0024
0025 return ( is_read_supported< typename View::value_type
0026 , jpeg_tag
0027 >::_color_space == JCS_RGB );
0028 }
0029
0030 return ( is_read_supported< typename View::value_type
0031 , jpeg_tag
0032 >::_color_space == info._color_space );
0033 }
0034
0035 template< typename View >
0036 bool is_allowed( const image_read_info< jpeg_tag >&
0037 , std::false_type
0038 )
0039 {
0040 return true;
0041 }
0042
0043 }
0044 }
0045 }
0046
0047 #endif