8 #ifndef BOOST_GIL_IO_READ_VIEW_HPP 9 #define BOOST_GIL_IO_READ_VIEW_HPP 11 #include <boost/gil/io/base.hpp> 12 #include <boost/gil/io/conversion_policies.hpp> 13 #include <boost/gil/io/device.hpp> 14 #include <boost/gil/io/get_reader.hpp> 15 #include <boost/gil/io/path_spec.hpp> 17 #include <boost/mpl/and.hpp> 18 #include <boost/type_traits/is_base_and_derived.hpp> 20 #include <type_traits> 22 namespace boost {
namespace gil {
31 template <
typename Reader,
typename View>
34 typename std::enable_if
38 detail::is_reader<Reader>,
39 typename is_format_tag<typename Reader::format_tag_t>::type,
42 typename get_pixel_type<View>::type,
43 typename Reader::format_tag_t
48 reader.check_image_size(view.dimensions());
49 reader.init_view(view, reader._settings);
58 template <
typename Device,
typename View,
typename FormatTag>
63 image_read_settings<FormatTag>
const& settings,
64 typename std::enable_if
69 typename is_format_tag<FormatTag>::type,
72 typename get_pixel_type<View>::type,
81 reader_t reader = make_reader(file, settings, detail::read_and_no_convert());
90 template <
typename Device,
typename View,
typename FormatTag>
92 void read_view(Device& file, View
const& view, FormatTag
const& tag,
93 typename std::enable_if
97 typename is_format_tag<FormatTag>::type,
101 typename get_pixel_type<View>::type,
104 >::value>::type* =
nullptr)
109 reader_t reader = make_reader(file, tag, detail::read_and_no_convert());
118 template <
typename String,
typename View,
typename FormatTag>
121 String
const& file_name,
123 image_read_settings<FormatTag>
const& settings,
124 typename std::enable_if
128 typename detail::is_supported_path_spec<String>::type,
129 typename is_format_tag<FormatTag>::type,
132 typename get_pixel_type<View>::type,
141 reader_t reader = make_reader(file_name, settings, detail::read_and_no_convert());
150 template <
typename String,
typename View,
typename FormatTag>
152 void read_view(String
const& file_name, View
const& view, FormatTag
const& tag,
153 typename std::enable_if
157 typename detail::is_supported_path_spec<String>::type,
158 typename is_format_tag<FormatTag>::type,
161 typename get_pixel_type<View>::type,
170 reader_t reader = make_reader(file_name, tag, detail::read_and_no_convert());
Definition: algorithm.hpp:30
Definition: device.hpp:592
void read_view(Reader reader, View const &view, typename std::enable_if< mpl::and_< detail::is_reader< Reader >, typename is_format_tag< typename Reader::format_tag_t >::type, typename is_read_supported< typename get_pixel_type< View >::type, typename Reader::format_tag_t >::type >::value >::type *=nullptr)
Reads an image view without conversion. No memory is allocated.
Definition: read_view.hpp:33
const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
Returns the non-constant-pixel view of an image.
Definition: image.hpp:460
Helper metafunction to generate image reader type.
Definition: get_reader.hpp:27