2 // Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev
4 // Distributed under the Boost Software License, Version 1.0
5 // See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt
8 #ifndef BOOST_GIL_IO_BASE_HPP
9 #define BOOST_GIL_IO_BASE_HPP
11 #include <boost/gil/extension/toolbox/toolbox.hpp>
13 #include <boost/gil/bit_aligned_pixel_reference.hpp>
14 #include <boost/gil/bit_aligned_pixel_iterator.hpp>
15 #include <boost/gil/color_convert.hpp>
16 #include <boost/gil/utilities.hpp>
17 #include <boost/gil/io/error.hpp>
18 #include <boost/gil/io/typedefs.hpp>
22 #include <type_traits>
25 namespace boost { namespace gil {
29 template< typename Property >
32 using type = Property;
35 template<typename FormatTag>
36 struct is_format_tag : std::is_base_of<format_tag, FormatTag> {};
38 struct image_read_settings_base
42 image_read_settings_base()
47 image_read_settings_base( const point_t& top_left
50 : _top_left( top_left )
57 void set( const point_t& top_left
72 * Boolean meta function, std::true_type if the pixel type \a PixelType is supported
73 * by the image format identified with \a FormatTag.
74 * \todo the name is_supported is to generic, pick something more IO realted.
76 // Depending on image type the parameter Pixel can be a reference type
77 // for bit_aligned images or a pixel for byte images.
78 template< typename Pixel, typename FormatTag > struct is_read_supported {};
79 template< typename Pixel, typename FormatTag > struct is_write_supported {};
84 template< typename Property >
87 using type = Property;
92 struct read_support_true { static constexpr bool is_supported = true; };
93 struct read_support_false { static constexpr bool is_supported = false; };
94 struct write_support_true { static constexpr bool is_supported = true; };
95 struct write_support_false{ static constexpr bool is_supported = false; };
99 template< typename Device, typename FormatTag > struct reader_backend;
100 template< typename Device, typename FormatTag > struct writer_backend;
102 template< typename FormatTag > struct image_read_info;
103 template< typename FormatTag > struct image_read_settings;
104 template< typename FormatTag, typename Log = no_log > struct image_write_info;