Boost GIL


base.hpp
1 //
2 // Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev
3 //
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
7 //
8 #ifndef BOOST_GIL_IO_BASE_HPP
9 #define BOOST_GIL_IO_BASE_HPP
10 
11 #include <boost/gil/extension/toolbox/toolbox.hpp>
12 
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>
19 
20 #include <boost/type_traits/is_base_of.hpp>
21 
22 #include <istream>
23 #include <ostream>
24 #include <vector>
25 
26 namespace boost { namespace gil {
27 
28 struct format_tag {};
29 
30 template< typename Property >
31 struct property_base
32 {
33  using type = Property;
34 };
35 
36 template<typename FormatTag> struct is_format_tag : is_base_and_derived< format_tag
37  , FormatTag
38  > {};
39 
40 struct image_read_settings_base
41 {
42 protected:
43 
44  image_read_settings_base()
45  : _top_left( 0, 0 )
46  , _dim ( 0, 0 )
47  {}
48 
49  image_read_settings_base( const point_t& top_left
50  , const point_t& dim
51  )
52  : _top_left( top_left )
53  , _dim ( dim )
54  {}
55 
56 
57 public:
58 
59  void set( const point_t& top_left
60  , const point_t& dim
61  )
62  {
63  _top_left = top_left;
64  _dim = dim;
65  }
66 
67 public:
68 
69  point_t _top_left;
70  point_t _dim;
71 };
72 
78 // Depending on image type the parameter Pixel can be a reference type
79 // for bit_aligned images or a pixel for byte images.
80 template< typename Pixel, typename FormatTag > struct is_read_supported {};
81 template< typename Pixel, typename FormatTag > struct is_write_supported {};
82 
83 
84 namespace detail {
85 
86 template< typename Property >
87 struct property_base
88 {
89  using type = Property;
90 };
91 
92 } // namespace detail
93 
94 struct read_support_true { static constexpr bool is_supported = true; };
95 struct read_support_false { static constexpr bool is_supported = false; };
96 struct write_support_true { static constexpr bool is_supported = true; };
97 struct write_support_false{ static constexpr bool is_supported = false; };
98 
99 class no_log {};
100 
101 template< typename Device, typename FormatTag > struct reader_backend;
102 template< typename Device, typename FormatTag > struct writer_backend;
103 
104 template< typename FormatTag > struct image_read_info;
105 template< typename FormatTag > struct image_read_settings;
106 template< typename FormatTag, typename Log = no_log > struct image_write_info;
107 
108 } // namespace gil
109 } // namespace boost
110 
111 #endif
Definition: algorithm.hpp:30
Definition: base.hpp:80