Boost GIL


read_image_info.hpp
1//
2// Copyright 2007-2012 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_READ_IMAGE_INFO_HPP
9#define BOOST_GIL_IO_READ_IMAGE_INFO_HPP
10
11#include <boost/gil/io/base.hpp>
12#include <boost/gil/io/device.hpp>
13#include <boost/gil/io/get_reader.hpp>
14#include <boost/gil/io/path_spec.hpp>
15#include <boost/gil/detail/mp11.hpp>
16
17#include <type_traits>
18
19namespace boost{ namespace gil {
20
22
28template <typename Device, typename FormatTag>
29inline
30auto read_image_info(Device& file, image_read_settings<FormatTag> const& settings,
31 typename std::enable_if
32 <
33 mp11::mp_and
34 <
35 detail::is_adaptable_input_device<FormatTag, Device>,
36 is_format_tag<FormatTag>
37 >::value
38 >::type* /*dummy*/ = nullptr)
40{
41 return make_reader_backend(file, settings);
42}
43
52template <typename Device, typename FormatTag>
53inline
54auto read_image_info(Device& file, FormatTag const&,
55 typename std::enable_if
56 <
57 mp11::mp_and
58 <
59 detail::is_adaptable_input_device<FormatTag, Device>,
60 is_format_tag<FormatTag>
61 >::value
62 >::type* /*dummy*/ = nullptr)
63 -> typename get_reader_backend<Device, FormatTag>::type
64{
65 return read_image_info(file, image_read_settings<FormatTag>());
66}
67
73template <typename String, typename FormatTag>
74inline
76 String const& file_name, image_read_settings<FormatTag> const& settings,
77 typename std::enable_if
78 <
79 mp11::mp_and
80 <
81 is_format_tag<FormatTag>,
82 detail::is_supported_path_spec<String>
83 >::value
84 >::type* /*dummy*/ = nullptr)
85 -> typename get_reader_backend<String, FormatTag>::type
86{
87 return make_reader_backend(file_name, settings);
88}
89
98template <typename String, typename FormatTag>
99inline
100auto read_image_info(String const& file_name, FormatTag const&,
101 typename std::enable_if
102 <
103 mp11::mp_and
104 <
105 is_format_tag<FormatTag>,
106 detail::is_supported_path_spec<String>
107 >::value
108 >::type* /*dummy*/ = nullptr)
110{
111 return read_image_info(file_name, image_read_settings<FormatTag>());
112}
113
114}} // namespace boost::gil
115
116#endif
auto read_image_info(Device &file, image_read_settings< FormatTag > const &settings, typename std::enable_if< mp11::mp_and< detail::is_adaptable_input_device< FormatTag, Device >, is_format_tag< FormatTag > >::value >::type *=nullptr) -> typename get_reader_backend< Device, FormatTag >::type
Returns the image format backend. Backend is format specific.
Definition read_image_info.hpp:30
defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
Definition algorithm.hpp:36
Helper metafunction to generate image backend type.
Definition get_reader.hpp:115