File indexing completed on 2025-01-18 09:37:03
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_GIL_IO_READ_IMAGE_INFO_HPP
0009 #define BOOST_GIL_IO_READ_IMAGE_INFO_HPP
0010
0011 #include <boost/gil/io/base.hpp>
0012 #include <boost/gil/io/device.hpp>
0013 #include <boost/gil/io/get_reader.hpp>
0014 #include <boost/gil/io/path_spec.hpp>
0015 #include <boost/gil/detail/mp11.hpp>
0016
0017 #include <type_traits>
0018
0019 namespace boost{ namespace gil {
0020
0021
0022
0023
0024
0025
0026
0027
0028 template <typename Device, typename FormatTag>
0029 inline
0030 auto read_image_info(Device& file, image_read_settings<FormatTag> const& settings,
0031 typename std::enable_if
0032 <
0033 mp11::mp_and
0034 <
0035 detail::is_adaptable_input_device<FormatTag, Device>,
0036 is_format_tag<FormatTag>
0037 >::value
0038 >::type* = nullptr)
0039 -> typename get_reader_backend<Device, FormatTag>::type
0040 {
0041 return make_reader_backend(file, settings);
0042 }
0043
0044
0045
0046
0047
0048
0049 template <typename Device, typename FormatTag>
0050 inline
0051 auto read_image_info(Device& file, FormatTag const&,
0052 typename std::enable_if
0053 <
0054 mp11::mp_and
0055 <
0056 detail::is_adaptable_input_device<FormatTag, Device>,
0057 is_format_tag<FormatTag>
0058 >::value
0059 >::type* = nullptr)
0060 -> typename get_reader_backend<Device, FormatTag>::type
0061 {
0062 return read_image_info(file, image_read_settings<FormatTag>());
0063 }
0064
0065
0066
0067
0068
0069
0070 template <typename String, typename FormatTag>
0071 inline
0072 auto read_image_info(
0073 String const& file_name, image_read_settings<FormatTag> const& settings,
0074 typename std::enable_if
0075 <
0076 mp11::mp_and
0077 <
0078 is_format_tag<FormatTag>,
0079 detail::is_supported_path_spec<String>
0080 >::value
0081 >::type* = nullptr)
0082 -> typename get_reader_backend<String, FormatTag>::type
0083 {
0084 return make_reader_backend(file_name, settings);
0085 }
0086
0087
0088
0089
0090
0091
0092 template <typename String, typename FormatTag>
0093 inline
0094 auto read_image_info(String const& file_name, FormatTag const&,
0095 typename std::enable_if
0096 <
0097 mp11::mp_and
0098 <
0099 is_format_tag<FormatTag>,
0100 detail::is_supported_path_spec<String>
0101 >::value
0102 >::type* = nullptr)
0103 -> typename get_reader_backend<String, FormatTag>::type
0104 {
0105 return read_image_info(file_name, image_read_settings<FormatTag>());
0106 }
0107
0108 }}
0109
0110 #endif