8 #ifndef BOOST_GIL_IO_WRITE_VIEW_HPP 9 #define BOOST_GIL_IO_WRITE_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_writer.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 {
25 template<
typename Writer,
typename View>
27 void write_view(Writer& writer, View
const&
view,
28 typename std::enable_if
32 typename detail::is_writer<Writer>::type,
33 typename is_format_tag<typename Writer::format_tag_t>::type,
34 typename is_write_supported
36 typename get_pixel_type<View>::type,
37 typename Writer::format_tag_t
46 template<
typename Device,
typename View,
typename FormatTag>
48 void write_view(Device& device, View
const& view, FormatTag
const& tag,
49 typename std::enable_if
53 typename detail::is_write_device<FormatTag, Device>::type,
54 typename is_format_tag<FormatTag>::type,
55 typename is_write_supported
57 typename get_pixel_type<View>::type,
63 using writer_t =
typename get_writer<Device, FormatTag>::type;
64 writer_t writer = make_writer(device, tag);
65 write_view(writer, view);
69 template<
typename String,
typename View,
typename FormatTag>
71 void write_view(String
const& file_name, View
const& view, FormatTag
const& tag,
72 typename std::enable_if
76 typename detail::is_supported_path_spec<String>::type,
77 typename is_format_tag<FormatTag>::type,
78 typename is_write_supported
80 typename get_pixel_type<View>::type,
86 using writer_t =
typename get_writer<String, FormatTag>::type;
87 writer_t writer = make_writer(file_name, tag);
88 write_view(writer, view);
92 template<
typename Device,
typename View,
typename FormatTag,
typename Log>
95 Device& device, View
const& view, image_write_info<FormatTag, Log>
const& info,
96 typename std::enable_if
100 typename detail::is_write_device<FormatTag, Device>::type,
101 typename is_format_tag<FormatTag>::type,
102 typename is_write_supported
104 typename get_pixel_type<View>::type,
110 using writer_t =
typename get_writer<Device, FormatTag>::type;
111 writer_t writer = make_writer(device, info);
112 write_view(writer, view);
116 template<
typename String,
typename View,
typename FormatTag,
typename Log>
119 String
const& file_name, View
const& view, image_write_info<FormatTag, Log>
const& info,
120 typename std::enable_if
124 typename detail::is_supported_path_spec<String>::type,
125 typename is_format_tag<FormatTag>::type,
126 typename is_write_supported
128 typename get_pixel_type<View>::type,
134 using writer_t =
typename get_writer<String, FormatTag>::type;
135 writer_t writer = make_writer(file_name, info);
136 write_view(writer, view);
142 template <
typename Writer,
typename Views>
144 void write_view(Writer& writer, any_image_view<Views>
const& view,
145 typename std::enable_if
149 typename detail::is_dynamic_image_writer<Writer>::type,
150 typename is_format_tag<typename Writer::format_tag_t>::type
158 template <
typename Device,
typename Views,
typename FormatTag>
161 Device& device, any_image_view<Views>
const& views, FormatTag
const& tag,
162 typename std::enable_if
166 typename detail::is_write_device<FormatTag, Device>::type,
167 typename is_format_tag<FormatTag>::type
171 using writer_t =
typename get_dynamic_image_writer<Device, FormatTag>::type;
172 writer_t writer = make_dynamic_image_writer(device, tag);
173 write_view(writer, views);
176 template <
typename String,
typename Views,
typename FormatTag>
179 String
const& file_name, any_image_view<Views>
const& views, FormatTag
const& tag,
180 typename std::enable_if
184 typename detail::is_supported_path_spec<String>::type,
185 typename is_format_tag<FormatTag>::type
189 using writer_t =
typename get_dynamic_image_writer<String, FormatTag>::type;
190 writer_t writer = make_dynamic_image_writer(file_name, tag);
191 write_view(writer, views);
196 template <
typename Device,
typename Views,
typename FormatTag,
typename Log>
199 Device& device, any_image_view<Views>
const& views, image_write_info<FormatTag, Log>
const& info,
200 typename std::enable_if
204 typename detail::is_write_device<FormatTag, Device>::type,
205 typename is_format_tag<FormatTag>::type
209 using writer_t =
typename get_dynamic_image_writer<Device, FormatTag>::type;
210 writer_t writer = make_dynamic_image_writer(device, info);
211 write_view(writer, views);
214 template <
typename String,
typename Views,
typename FormatTag,
typename Log>
217 String
const& file_name, any_image_view<Views>
const& views, image_write_info<FormatTag, Log>
const& info,
218 typename std::enable_if
222 typename detail::is_supported_path_spec<String>::type,
223 typename is_format_tag<FormatTag>::type
227 using writer_t =
typename get_dynamic_image_writer<String, FormatTag>::type;
228 writer_t writer = make_dynamic_image_writer(file_name, info);
229 write_view(writer, views);
Definition: algorithm.hpp:30
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