8 #ifndef BOOST_GIL_IO_MAKE_SCANLINE_READER_HPP
9 #define BOOST_GIL_IO_MAKE_SCANLINE_READER_HPP
11 #include <boost/gil/detail/mp11.hpp>
12 #include <boost/gil/io/get_reader.hpp>
14 #include <type_traits>
16 namespace boost {
namespace gil {
18 template <
typename String,
typename FormatTag>
20 auto make_scanline_reader(String
const& file_name, FormatTag
const&,
21 typename std::enable_if
25 detail::is_supported_path_spec<String>,
26 is_format_tag<FormatTag>
29 ->
typename get_scanline_reader<String, FormatTag>::type
31 using device_t =
typename get_read_device<String, FormatTag>::type;
33 detail::convert_to_native_string(file_name),
34 typename detail::file_stream_device<FormatTag>::read_tag());
36 return typename get_scanline_reader<String, FormatTag>::type(
37 device, image_read_settings<FormatTag>());
40 template <
typename FormatTag>
42 auto make_scanline_reader(std::wstring
const& file_name, FormatTag
const&)
43 ->
typename get_scanline_reader<std::wstring, FormatTag>::type
45 const char* str = detail::convert_to_native_string( file_name );
47 typename get_read_device< std::wstring
50 ,
typename detail::file_stream_device< FormatTag >::read_tag()
55 return typename get_scanline_reader< std::wstring
58 , image_read_settings< FormatTag >()
62 template <
typename FormatTag>
64 auto make_scanline_reader(detail::filesystem::path
const& path, FormatTag
const&)
65 ->
typename get_scanline_reader<std::wstring, FormatTag>::type
67 return make_scanline_reader(path.wstring(), image_read_settings<FormatTag>());
70 template <
typename Device,
typename FormatTag>
72 auto make_scanline_reader(Device& io_dev, FormatTag
const&,
73 typename std::enable_if
77 detail::is_adaptable_input_device<FormatTag, Device>,
78 is_format_tag<FormatTag>
81 ->
typename get_scanline_reader<Device, FormatTag>::type
83 return make_scanline_reader(io_dev, image_read_settings<FormatTag>());
defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
Definition: algorithm.hpp:36