]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | <!-- Copyright 2008 Lubomir Bourdev and Hailin Jin |
2 | ||
3 | Distributed under the Boost Software License, Version 1.0. | |
4 | (See accompanying file LICENSE_1_0.txt or copy at | |
5 | http://www.boost.org/LICENSE_1_0.txt) | |
6 | --> | |
7 | ||
8 | <!-- | |
9 | Copyright 2005-2007 Adobe Systems Incorporated | |
10 | Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt | |
11 | or a copy at http://stlab.adobe.com/licenses.html) | |
12 | ||
13 | Some files are held under additional license. | |
14 | Please see "http://stlab.adobe.com/licenses.html" for more information. | |
15 | --> | |
16 | ||
17 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
18 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
19 | <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> | |
20 | ||
21 | <head> | |
22 | <TITLE>Generic Image Library: jpeg_io.hpp Source File</TITLE> | |
23 | <META HTTP-EQUIV="content-type" CONTENT="text/html;charset=ISO-8859-1"/> | |
24 | <LINK TYPE="text/css" REL="stylesheet" HREF="adobe_source.css"/> | |
25 | </head> | |
26 | <body> | |
27 | <table border="0" cellspacing="0" cellpadding="0" style='width: 100%; margin: 0; padding: 0'><tr> | |
28 | <td width="100%" valign="top" style='padding-left: 10px; padding-right: 10px; padding-bottom: 10px'> | |
29 | <div class="qindex"><a class="qindex" href="index.html">Modules</a> | |
30 | | <a class="qindex" href="classes.html">Alphabetical List</a> | |
31 | | <a class="qindex" href="annotated.html">Class List</a> | |
32 | | <a class="qindex" href="dirs.html">Directories</a> | |
33 | | <a class="qindex" href="files.html">File List</a> | |
34 | | <a class="qindex" href="../index.html">GIL Home Page</a> | |
35 | </div> | |
36 | <!-- End Header --> | |
37 | <!-- Generated by Doxygen 1.5.6 --> | |
38 | <div class="navpath"><a class="el" href="g_i_l_0076.html">boost</a> » <a class="el" href="g_i_l_0079.html">gil</a> » <a class="el" href="g_i_l_0078.html">extension</a> » <a class="el" href="g_i_l_0077.html">io</a> | |
39 | </div> | |
40 | <div class="contents"> | |
41 | <h1>jpeg_io.hpp</h1><a href="jpeg__io_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> | |
42 | <a name="l00002"></a>00002 <span class="comment"> Copyright 2005-2007 Adobe Systems Incorporated</span> | |
43 | <a name="l00003"></a>00003 <span class="comment"> </span> | |
44 | <a name="l00004"></a>00004 <span class="comment"> Use, modification and distribution are subject to the Boost Software License,</span> | |
45 | <a name="l00005"></a>00005 <span class="comment"> Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at</span> | |
46 | <a name="l00006"></a>00006 <span class="comment"> http://www.boost.org/LICENSE_1_0.txt).</span> | |
47 | <a name="l00007"></a>00007 <span class="comment"></span> | |
48 | <a name="l00008"></a>00008 <span class="comment"> See http://opensource.adobe.com/gil for most recent version including documentation.</span> | |
49 | <a name="l00009"></a>00009 <span class="comment">*/</span> | |
50 | <a name="l00010"></a>00010 | |
51 | <a name="l00011"></a>00011 <span class="comment">/*************************************************************************************************/</span> | |
52 | <a name="l00012"></a>00012 | |
53 | <a name="l00013"></a>00013 <span class="preprocessor">#ifndef GIL_JPEG_IO_H</span> | |
54 | <a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define GIL_JPEG_IO_H</span> | |
55 | <a name="l00015"></a>00015 <span class="preprocessor"></span> | |
56 | <a name="l00022"></a>00022 | |
57 | <a name="l00023"></a>00023 <span class="preprocessor">#include <cstdio></span> | |
58 | <a name="l00024"></a>00024 <span class="preprocessor">#include <algorithm></span> | |
59 | <a name="l00025"></a>00025 <span class="preprocessor">#include <string></span> | |
60 | <a name="l00026"></a>00026 <span class="preprocessor">#include <boost/static_assert.hpp></span> | |
61 | <a name="l00027"></a>00027 <span class="preprocessor">#include <boost/shared_ptr.hpp></span> | |
62 | <a name="l00028"></a>00028 <span class="keyword">extern</span> <span class="stringliteral">"C"</span> { | |
63 | <a name="l00029"></a>00029 <span class="preprocessor">#include <jpeglib.h></span> | |
64 | <a name="l00030"></a>00030 } | |
65 | <a name="l00031"></a>00031 <span class="preprocessor">#include "<a class="code" href="io__error_8hpp.html" title="Handle input-output errors.">io_error.hpp</a>"</span> | |
66 | <a name="l00032"></a>00032 <span class="preprocessor">#include "<a class="code" href="g_i_l_0235.html" title="Internal support for reading and writing JPEG files.">jpeg_io_private.hpp</a>"</span> | |
67 | <a name="l00033"></a>00033 | |
68 | <a name="l00034"></a>00034 <span class="keyword">namespace </span>boost { <span class="keyword">namespace </span>gil { | |
69 | <a name="l00035"></a>00035 | |
70 | <a name="l00038"></a>00038 <span class="keyword">template</span> <<span class="keyword">typename</span> View> | |
71 | <a name="l00039"></a><a class="code" href="g_i_l_0555.html">00039</a> <span class="keyword">struct </span><a class="code" href="g_i_l_0555.html" title="Determines whether the given view type is supported for reading.">jpeg_read_support</a> { | |
72 | <a name="l00040"></a>00040 BOOST_STATIC_CONSTANT(<span class="keywordtype">bool</span>,is_supported= | |
73 | <a name="l00041"></a>00041 (detail::jpeg_read_support_private<<span class="keyword">typename</span> channel_type<View>::type, | |
74 | <a name="l00042"></a>00042 <span class="keyword">typename</span> color_space_type<View>::type>::is_supported)); | |
75 | <a name="l00043"></a>00043 BOOST_STATIC_CONSTANT(J_COLOR_SPACE,color_type= | |
76 | <a name="l00044"></a>00044 (detail::jpeg_read_support_private<<span class="keyword">typename</span> channel_type<View>::type, | |
77 | <a name="l00045"></a>00045 <span class="keyword">typename</span> color_space_type<View>::type>::color_type)); | |
78 | <a name="l00046"></a>00046 BOOST_STATIC_CONSTANT(<span class="keywordtype">bool</span>, value=is_supported); | |
79 | <a name="l00047"></a>00047 }; | |
80 | <a name="l00048"></a>00048 | |
81 | <a name="l00052"></a><a class="code" href="g_i_l_0169.html#g10d06211a2d4ba61145b50cf04f3ad85">00052</a> <span class="keyword">inline</span> <a class="code" href="g_i_l_0060.html" title="2D point both axes of which have the same dimension typeModels: Point2DConcept">point2<std::ptrdiff_t></a> <a class="code" href="g_i_l_0169.html#g21fa19b7e1fe494fcfc2ed43d8592f8c" title="Returns the width and height of the JPEG file at the specified location. Throws std::ios_base::failu...">jpeg_read_dimensions</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* filename) { | |
82 | <a name="l00053"></a>00053 detail::jpeg_reader m(filename); | |
83 | <a name="l00054"></a>00054 <span class="keywordflow">return</span> m.get_dimensions(); | |
84 | <a name="l00055"></a>00055 } | |
85 | <a name="l00056"></a>00056 | |
86 | <a name="l00060"></a><a class="code" href="g_i_l_0169.html#g21fa19b7e1fe494fcfc2ed43d8592f8c">00060</a> <span class="keyword">inline</span> <a class="code" href="g_i_l_0060.html" title="2D point both axes of which have the same dimension typeModels: Point2DConcept">point2<std::ptrdiff_t></a> <a class="code" href="g_i_l_0169.html#g21fa19b7e1fe494fcfc2ed43d8592f8c" title="Returns the width and height of the JPEG file at the specified location. Throws std::ios_base::failu...">jpeg_read_dimensions</a>(<span class="keyword">const</span> std::string& filename) { | |
87 | <a name="l00061"></a>00061 <span class="keywordflow">return</span> <a class="code" href="g_i_l_0169.html#g21fa19b7e1fe494fcfc2ed43d8592f8c" title="Returns the width and height of the JPEG file at the specified location. Throws std::ios_base::failu...">jpeg_read_dimensions</a>(filename.c_str()); | |
88 | <a name="l00062"></a>00062 } | |
89 | <a name="l00063"></a>00063 | |
90 | <a name="l00069"></a>00069 <span class="keyword">template</span> <<span class="keyword">typename</span> View> | |
91 | <a name="l00070"></a><a class="code" href="g_i_l_0169.html#g4e8ae7c617147cf99f7a2aa37e44f28c">00070</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="g_i_l_0169.html#gb5a415b1f4ef559bf78affc4b9ce0358" title="Loads the image specified by the given jpeg image file name into the given view.">jpeg_read_view</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* filename,<span class="keyword">const</span> View& <a class="code" href="g_i_l_0135.html#g55e45a15dddfc0d870c2f7fb9739cb2e" title="Returns the non-constant-pixel view of any image. The returned view is any view.">view</a>) { | |
92 | <a name="l00071"></a>00071 BOOST_STATIC_ASSERT(<a class="code" href="g_i_l_0555.html" title="Determines whether the given view type is supported for reading.">jpeg_read_support<View>::is_supported</a>); | |
93 | <a name="l00072"></a>00072 | |
94 | <a name="l00073"></a>00073 detail::jpeg_reader m(filename); | |
95 | <a name="l00074"></a>00074 m.apply(view); | |
96 | <a name="l00075"></a>00075 } | |
97 | <a name="l00076"></a>00076 | |
98 | <a name="l00079"></a>00079 <span class="keyword">template</span> <<span class="keyword">typename</span> View> | |
99 | <a name="l00080"></a><a class="code" href="g_i_l_0169.html#gb5a415b1f4ef559bf78affc4b9ce0358">00080</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="g_i_l_0169.html#gb5a415b1f4ef559bf78affc4b9ce0358" title="Loads the image specified by the given jpeg image file name into the given view.">jpeg_read_view</a>(<span class="keyword">const</span> std::string& filename,<span class="keyword">const</span> View& <a class="code" href="g_i_l_0135.html#g55e45a15dddfc0d870c2f7fb9739cb2e" title="Returns the non-constant-pixel view of any image. The returned view is any view.">view</a>) { | |
100 | <a name="l00081"></a>00081 <a class="code" href="g_i_l_0169.html#gb5a415b1f4ef559bf78affc4b9ce0358" title="Loads the image specified by the given jpeg image file name into the given view.">jpeg_read_view</a>(filename.c_str(),view); | |
101 | <a name="l00082"></a>00082 } | |
102 | <a name="l00083"></a>00083 | |
103 | <a name="l00089"></a>00089 <span class="keyword">template</span> <<span class="keyword">typename</span> Image> | |
104 | <a name="l00090"></a><a class="code" href="g_i_l_0169.html#gfb203fbcc1d3e5ea247068b404b58e91">00090</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="g_i_l_0169.html#g02171bdd359b1fb5fc89ad34a0732494" title="Allocates a new image whose dimensions are determined by the given jpeg image file...">jpeg_read_image</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* filename,Image& im) { | |
105 | <a name="l00091"></a>00091 BOOST_STATIC_ASSERT(<a class="code" href="g_i_l_0555.html" title="Determines whether the given view type is supported for reading.">jpeg_read_support<typename Image::view_t>::is_supported</a>); | |
106 | <a name="l00092"></a>00092 | |
107 | <a name="l00093"></a>00093 detail::jpeg_reader m(filename); | |
108 | <a name="l00094"></a>00094 m.read_image(im); | |
109 | <a name="l00095"></a>00095 } | |
110 | <a name="l00096"></a>00096 | |
111 | <a name="l00099"></a>00099 <span class="keyword">template</span> <<span class="keyword">typename</span> Image> | |
112 | <a name="l00100"></a><a class="code" href="g_i_l_0169.html#g02171bdd359b1fb5fc89ad34a0732494">00100</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="g_i_l_0169.html#g02171bdd359b1fb5fc89ad34a0732494" title="Allocates a new image whose dimensions are determined by the given jpeg image file...">jpeg_read_image</a>(<span class="keyword">const</span> std::string& filename,Image& im) { | |
113 | <a name="l00101"></a>00101 <a class="code" href="g_i_l_0169.html#g02171bdd359b1fb5fc89ad34a0732494" title="Allocates a new image whose dimensions are determined by the given jpeg image file...">jpeg_read_image</a>(filename.c_str(),im); | |
114 | <a name="l00102"></a>00102 } | |
115 | <a name="l00103"></a>00103 | |
116 | <a name="l00107"></a>00107 <span class="keyword">template</span> <<span class="keyword">typename</span> View,<span class="keyword">typename</span> CC> | |
117 | <a name="l00108"></a><a class="code" href="g_i_l_0169.html#ged18c0f8084bedab8804d2cd1b0b284d">00108</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="g_i_l_0169.html#ga30345368e41c777d30351666ce7e93b" title="Loads and color-converts the image specified by the given jpeg image file name into...">jpeg_read_and_convert_view</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* filename,<span class="keyword">const</span> View& <a class="code" href="g_i_l_0135.html#g55e45a15dddfc0d870c2f7fb9739cb2e" title="Returns the non-constant-pixel view of any image. The returned view is any view.">view</a>,CC cc) { | |
118 | <a name="l00109"></a>00109 detail::jpeg_reader_color_convert<CC> m(filename,cc); | |
119 | <a name="l00110"></a>00110 m.apply(view); | |
120 | <a name="l00111"></a>00111 } | |
121 | <a name="l00112"></a>00112 | |
122 | <a name="l00116"></a>00116 <span class="keyword">template</span> <<span class="keyword">typename</span> View> | |
123 | <a name="l00117"></a><a class="code" href="g_i_l_0169.html#g78a3eed977abde42c3402a88a5f11e10">00117</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="g_i_l_0169.html#ga30345368e41c777d30351666ce7e93b" title="Loads and color-converts the image specified by the given jpeg image file name into...">jpeg_read_and_convert_view</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* filename,<span class="keyword">const</span> View& <a class="code" href="g_i_l_0135.html#g55e45a15dddfc0d870c2f7fb9739cb2e" title="Returns the non-constant-pixel view of any image. The returned view is any view.">view</a>) { | |
124 | <a name="l00118"></a>00118 detail::jpeg_reader_color_convert<default_color_converter> m(filename,<a class="code" href="g_i_l_0452.html" title="class for color-converting one pixel to another">default_color_converter</a>()); | |
125 | <a name="l00119"></a>00119 m.apply(view); | |
126 | <a name="l00120"></a>00120 } | |
127 | <a name="l00121"></a>00121 | |
128 | <a name="l00124"></a>00124 <span class="keyword">template</span> <<span class="keyword">typename</span> View,<span class="keyword">typename</span> CC> | |
129 | <a name="l00125"></a><a class="code" href="g_i_l_0169.html#gf162e38328791b405a57e079eecc6a54">00125</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="g_i_l_0169.html#ga30345368e41c777d30351666ce7e93b" title="Loads and color-converts the image specified by the given jpeg image file name into...">jpeg_read_and_convert_view</a>(<span class="keyword">const</span> std::string& filename,<span class="keyword">const</span> View& <a class="code" href="g_i_l_0135.html#g55e45a15dddfc0d870c2f7fb9739cb2e" title="Returns the non-constant-pixel view of any image. The returned view is any view.">view</a>,CC cc) { | |
130 | <a name="l00126"></a>00126 <a class="code" href="g_i_l_0169.html#ga30345368e41c777d30351666ce7e93b" title="Loads and color-converts the image specified by the given jpeg image file name into...">jpeg_read_and_convert_view</a>(filename.c_str(),view); | |
131 | <a name="l00127"></a>00127 } | |
132 | <a name="l00128"></a>00128 | |
133 | <a name="l00131"></a>00131 <span class="keyword">template</span> <<span class="keyword">typename</span> View> | |
134 | <a name="l00132"></a><a class="code" href="g_i_l_0169.html#ga30345368e41c777d30351666ce7e93b">00132</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="g_i_l_0169.html#ga30345368e41c777d30351666ce7e93b" title="Loads and color-converts the image specified by the given jpeg image file name into...">jpeg_read_and_convert_view</a>(<span class="keyword">const</span> std::string& filename,<span class="keyword">const</span> View& <a class="code" href="g_i_l_0135.html#g55e45a15dddfc0d870c2f7fb9739cb2e" title="Returns the non-constant-pixel view of any image. The returned view is any view.">view</a>) { | |
135 | <a name="l00133"></a>00133 <a class="code" href="g_i_l_0169.html#ga30345368e41c777d30351666ce7e93b" title="Loads and color-converts the image specified by the given jpeg image file name into...">jpeg_read_and_convert_view</a>(filename.c_str(),view); | |
136 | <a name="l00134"></a>00134 } | |
137 | <a name="l00135"></a>00135 | |
138 | <a name="l00139"></a>00139 <span class="keyword">template</span> <<span class="keyword">typename</span> Image,<span class="keyword">typename</span> CC> | |
139 | <a name="l00140"></a><a class="code" href="g_i_l_0169.html#gbe915826a254db40e74e783255b502e4">00140</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="g_i_l_0169.html#g6de4bc4d35308da0326b98b0e52aa335" title="Allocates a new image whose dimensions are determined by the given jpeg image file...">jpeg_read_and_convert_image</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* filename,Image& im,CC cc) { | |
140 | <a name="l00141"></a>00141 detail::jpeg_reader_color_convert<CC> m(filename,cc); | |
141 | <a name="l00142"></a>00142 m.read_image(im); | |
142 | <a name="l00143"></a>00143 } | |
143 | <a name="l00144"></a>00144 | |
144 | <a name="l00148"></a>00148 <span class="keyword">template</span> <<span class="keyword">typename</span> Image> | |
145 | <a name="l00149"></a><a class="code" href="g_i_l_0169.html#g9aca5b2912f7e52f6c10d30be27b051d">00149</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="g_i_l_0169.html#g6de4bc4d35308da0326b98b0e52aa335" title="Allocates a new image whose dimensions are determined by the given jpeg image file...">jpeg_read_and_convert_image</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* filename,Image& im) { | |
146 | <a name="l00150"></a>00150 detail::jpeg_reader_color_convert<default_color_converter> m(filename,<a class="code" href="g_i_l_0452.html" title="class for color-converting one pixel to another">default_color_converter</a>()); | |
147 | <a name="l00151"></a>00151 m.read_image(im); | |
148 | <a name="l00152"></a>00152 } | |
149 | <a name="l00153"></a>00153 | |
150 | <a name="l00156"></a>00156 <span class="keyword">template</span> <<span class="keyword">typename</span> Image,<span class="keyword">typename</span> CC> | |
151 | <a name="l00157"></a><a class="code" href="g_i_l_0169.html#g689d32dffbcddd731b7314362a85a7ee">00157</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="g_i_l_0169.html#g6de4bc4d35308da0326b98b0e52aa335" title="Allocates a new image whose dimensions are determined by the given jpeg image file...">jpeg_read_and_convert_image</a>(<span class="keyword">const</span> std::string& filename,Image& im,CC cc) { | |
152 | <a name="l00158"></a>00158 <a class="code" href="g_i_l_0169.html#g6de4bc4d35308da0326b98b0e52aa335" title="Allocates a new image whose dimensions are determined by the given jpeg image file...">jpeg_read_and_convert_image</a>(filename.c_str(),im); | |
153 | <a name="l00159"></a>00159 } | |
154 | <a name="l00160"></a>00160 | |
155 | <a name="l00163"></a>00163 <span class="keyword">template</span> <<span class="keyword">typename</span> Image> | |
156 | <a name="l00164"></a><a class="code" href="g_i_l_0169.html#g6de4bc4d35308da0326b98b0e52aa335">00164</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="g_i_l_0169.html#g6de4bc4d35308da0326b98b0e52aa335" title="Allocates a new image whose dimensions are determined by the given jpeg image file...">jpeg_read_and_convert_image</a>(<span class="keyword">const</span> std::string& filename,Image& im) { | |
157 | <a name="l00165"></a>00165 <a class="code" href="g_i_l_0169.html#g6de4bc4d35308da0326b98b0e52aa335" title="Allocates a new image whose dimensions are determined by the given jpeg image file...">jpeg_read_and_convert_image</a>(filename.c_str(),im); | |
158 | <a name="l00166"></a>00166 } | |
159 | <a name="l00167"></a>00167 | |
160 | <a name="l00170"></a>00170 <span class="keyword">template</span> <<span class="keyword">typename</span> View> | |
161 | <a name="l00171"></a><a class="code" href="g_i_l_0557.html">00171</a> <span class="keyword">struct </span><a class="code" href="g_i_l_0557.html" title="Determines whether the given view type is supported for writing.">jpeg_write_support</a> { | |
162 | <a name="l00172"></a>00172 BOOST_STATIC_CONSTANT(<span class="keywordtype">bool</span>,is_supported= | |
163 | <a name="l00173"></a>00173 (detail::jpeg_write_support_private<<span class="keyword">typename</span> channel_type<View>::type, | |
164 | <a name="l00174"></a>00174 <span class="keyword">typename</span> color_space_type<View>::type>::is_supported)); | |
165 | <a name="l00175"></a>00175 BOOST_STATIC_CONSTANT(J_COLOR_SPACE,color_type= | |
166 | <a name="l00176"></a>00176 (detail::jpeg_write_support_private<<span class="keyword">typename</span> channel_type<View>::type, | |
167 | <a name="l00177"></a>00177 <span class="keyword">typename</span> color_space_type<View>::type>::color_type)); | |
168 | <a name="l00178"></a>00178 BOOST_STATIC_CONSTANT(<span class="keywordtype">bool</span>, value=is_supported); | |
169 | <a name="l00179"></a>00179 }; | |
170 | <a name="l00180"></a>00180 | |
171 | <a name="l00185"></a>00185 <span class="keyword">template</span> <<span class="keyword">typename</span> View> | |
172 | <a name="l00186"></a><a class="code" href="g_i_l_0169.html#g565d99caa50193f98f49728c8b9d807e">00186</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="g_i_l_0169.html#g63405962170c1f94d6318d46134db7f4" title="Saves the view to a jpeg file specified by the given jpeg image file name.">jpeg_write_view</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* filename,<span class="keyword">const</span> View& <a class="code" href="g_i_l_0135.html#g55e45a15dddfc0d870c2f7fb9739cb2e" title="Returns the non-constant-pixel view of any image. The returned view is any view.">view</a>,<span class="keywordtype">int</span> quality=100) { | |
173 | <a name="l00187"></a>00187 BOOST_STATIC_ASSERT(<a class="code" href="g_i_l_0557.html" title="Determines whether the given view type is supported for writing.">jpeg_write_support<View>::is_supported</a>); | |
174 | <a name="l00188"></a>00188 | |
175 | <a name="l00189"></a>00189 detail::jpeg_writer m(filename); | |
176 | <a name="l00190"></a>00190 m.apply(view,quality); | |
177 | <a name="l00191"></a>00191 } | |
178 | <a name="l00192"></a>00192 | |
179 | <a name="l00195"></a>00195 <span class="keyword">template</span> <<span class="keyword">typename</span> View> | |
180 | <a name="l00196"></a><a class="code" href="g_i_l_0169.html#g63405962170c1f94d6318d46134db7f4">00196</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="g_i_l_0169.html#g63405962170c1f94d6318d46134db7f4" title="Saves the view to a jpeg file specified by the given jpeg image file name.">jpeg_write_view</a>(<span class="keyword">const</span> std::string& filename,<span class="keyword">const</span> View& <a class="code" href="g_i_l_0135.html#g55e45a15dddfc0d870c2f7fb9739cb2e" title="Returns the non-constant-pixel view of any image. The returned view is any view.">view</a>,<span class="keywordtype">int</span> quality=100) { | |
181 | <a name="l00197"></a>00197 <a class="code" href="g_i_l_0169.html#g63405962170c1f94d6318d46134db7f4" title="Saves the view to a jpeg file specified by the given jpeg image file name.">jpeg_write_view</a>(filename.c_str(),view,quality); | |
182 | <a name="l00198"></a>00198 } | |
183 | <a name="l00199"></a>00199 | |
184 | <a name="l00200"></a>00200 } } <span class="comment">// namespace boost::gil</span> | |
185 | <a name="l00201"></a>00201 | |
186 | <a name="l00202"></a>00202 <span class="preprocessor">#endif</span> | |
187 | </pre></div></div> | |
188 | <hr size="1"><address style="text-align: right;"><small>Generated on Sat May 2 13:50:14 2009 for Generic Image Library by | |
189 | <a href="http://www.doxygen.org/index.html"> | |
190 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address> | |
191 | </body> | |
192 | </html> |