blob: 7f6fc26a7a6c05c200264a3cdf3541b47a3d7875 [file] [log] [blame]
<!-- Copyright 2008 Lubomir Bourdev and Hailin Jin
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
-->
<!--
Copyright 2005-2007 Adobe Systems Incorporated
Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
or a copy at http://stlab.adobe.com/licenses.html)
Some files are held under additional license.
Please see "http://stlab.adobe.com/licenses.html" for more information.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<TITLE>Generic Image Library: jpeg_io.hpp File Reference</TITLE>
<META HTTP-EQUIV="content-type" CONTENT="text/html;charset=ISO-8859-1"/>
<LINK TYPE="text/css" REL="stylesheet" HREF="adobe_source.css"/>
</head>
<body>
<table border="0" cellspacing="0" cellpadding="0" style='width: 100%; margin: 0; padding: 0'><tr>
<td width="100%" valign="top" style='padding-left: 10px; padding-right: 10px; padding-bottom: 10px'>
<div class="qindex"><a class="qindex" href="index.html">Modules</a>
| <a class="qindex" href="classes.html">Alphabetical List</a>
| <a class="qindex" href="annotated.html">Class List</a>
| <a class="qindex" href="dirs.html">Directories</a>
| <a class="qindex" href="files.html">File List</a>
| <a class="qindex" href="../index.html">GIL Home Page</a>
</div>
<!-- End Header -->
<!-- Generated by Doxygen 1.5.6 -->
<div class="navpath"><a class="el" href="g_i_l_0076.html">boost</a>&nbsp;&raquo&nbsp;<a class="el" href="g_i_l_0079.html">gil</a>&nbsp;&raquo&nbsp;<a class="el" href="g_i_l_0078.html">extension</a>&nbsp;&raquo&nbsp;<a class="el" href="g_i_l_0077.html">io</a>
</div>
<div class="contents">
<h1>jpeg_io.hpp File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
Support for reading and writing JPEG files Requires libjpeg.
<p>
<dl class="author" compact><dt><b>Author:</b></dt><dd>Hailin Jin and Lubomir Bourdev <br>
Adobe Systems Incorporated </dd></dl>
<dl class="date" compact><dt><b>Date:</b></dt><dd>2005-2007 <br>
Last updated September 24, 2006 </dd></dl>
<p>
<code>#include &lt;cstdio&gt;</code><br>
<code>#include &lt;algorithm&gt;</code><br>
<code>#include &lt;string&gt;</code><br>
<code>#include &lt;boost/static_assert.hpp&gt;</code><br>
<code>#include &lt;boost/shared_ptr.hpp&gt;</code><br>
<code>#include &lt;jpeglib.h&gt;</code><br>
<code>#include &quot;<a class="el" href="g_i_l_0228.html">io_error.hpp</a>&quot;</code><br>
<code>#include &quot;<a class="el" href="g_i_l_0234.html">jpeg_io_private.hpp</a>&quot;</code><br>
<p>
<a href="g_i_l_0233.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Namespaces</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">namespace &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceboost.html">boost</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">namespace &nbsp;</td><td class="memItemRight" valign="bottom"><b>boost::gil</b></td></tr>
<tr><td colspan="2"><br><h2>Classes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="g_i_l_0555.html">jpeg_read_support</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Determines whether the given view type is supported for reading. <a href="g_i_l_0555.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="g_i_l_0557.html">jpeg_write_support</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Determines whether the given view type is supported for writing. <a href="g_i_l_0557.html#_details">More...</a><br></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g10d06211a2d4ba61145b50cf04f3ad85"></a><!-- doxytag: member="jpeg_io.hpp::jpeg_read_dimensions" ref="g10d06211a2d4ba61145b50cf04f3ad85" args="(const char *filename)" -->
point2&lt; std::ptrdiff_t &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="g_i_l_0169.html#g10d06211a2d4ba61145b50cf04f3ad85">jpeg_read_dimensions</a> (const char *filename)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the width and height of the JPEG file at the specified location. Throws std::ios_base::failure if the location does not correspond to a valid JPEG file. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g21fa19b7e1fe494fcfc2ed43d8592f8c"></a><!-- doxytag: member="jpeg_io.hpp::jpeg_read_dimensions" ref="g21fa19b7e1fe494fcfc2ed43d8592f8c" args="(const std::string &amp;filename)" -->
point2&lt; std::ptrdiff_t &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="g_i_l_0169.html#g21fa19b7e1fe494fcfc2ed43d8592f8c">jpeg_read_dimensions</a> (const std::string &amp;filename)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the width and height of the JPEG file at the specified location. Throws std::ios_base::failure if the location does not correspond to a valid JPEG file. <br></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="g4e8ae7c617147cf99f7a2aa37e44f28c"></a><!-- doxytag: member="jpeg_io.hpp::jpeg_read_view" ref="g4e8ae7c617147cf99f7a2aa37e44f28c" args="(const char *filename, const View &amp;view)" -->
template&lt;typename View&gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="g_i_l_0169.html#g4e8ae7c617147cf99f7a2aa37e44f28c">jpeg_read_view</a> (const char *filename, const View &amp;view)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Loads the <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> specified by the given jpeg <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> file name into the given view. Triggers a compile assert if the view color space and channel depth are not supported by the JPEG library or by the I/O extension. Throws std::ios_base::failure if the file is not a valid JPEG file, or if its color space or channel depth are not compatible with the ones specified by View, or if its dimensions don't match the ones of the view. <br></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="gb5a415b1f4ef559bf78affc4b9ce0358"></a><!-- doxytag: member="jpeg_io.hpp::jpeg_read_view" ref="gb5a415b1f4ef559bf78affc4b9ce0358" args="(const std::string &amp;filename, const View &amp;view)" -->
template&lt;typename View&gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="g_i_l_0169.html#gb5a415b1f4ef559bf78affc4b9ce0358">jpeg_read_view</a> (const std::string &amp;filename, const View &amp;view)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Loads the <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> specified by the given jpeg <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> file name into the given view. <br></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="gfb203fbcc1d3e5ea247068b404b58e91"></a><!-- doxytag: member="jpeg_io.hpp::jpeg_read_image" ref="gfb203fbcc1d3e5ea247068b404b58e91" args="(const char *filename, Image &amp;im)" -->
template&lt;typename Image&gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="g_i_l_0169.html#gfb203fbcc1d3e5ea247068b404b58e91">jpeg_read_image</a> (const char *filename, Image &amp;im)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allocates a new <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> whose dimensions are determined by the given jpeg <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> file, and loads the pixels into it. Triggers a compile assert if the <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> color space or channel depth are not supported by the JPEG library or by the I/O extension. Throws std::ios_base::failure if the file is not a valid JPEG file, or if its color space or channel depth are not compatible with the ones specified by Image. <br></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="g02171bdd359b1fb5fc89ad34a0732494"></a><!-- doxytag: member="jpeg_io.hpp::jpeg_read_image" ref="g02171bdd359b1fb5fc89ad34a0732494" args="(const std::string &amp;filename, Image &amp;im)" -->
template&lt;typename Image&gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="g_i_l_0169.html#g02171bdd359b1fb5fc89ad34a0732494">jpeg_read_image</a> (const std::string &amp;filename, Image &amp;im)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allocates a new <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> whose dimensions are determined by the given jpeg <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> file, and loads the pixels into it. <br></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="ged18c0f8084bedab8804d2cd1b0b284d"></a><!-- doxytag: member="jpeg_io.hpp::jpeg_read_and_convert_view" ref="ged18c0f8084bedab8804d2cd1b0b284d" args="(const char *filename, const View &amp;view, CC cc)" -->
template&lt;typename View, typename CC&gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="g_i_l_0169.html#ged18c0f8084bedab8804d2cd1b0b284d">jpeg_read_and_convert_view</a> (const char *filename, const View &amp;view, CC cc)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Loads and color-converts the <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> specified by the given jpeg <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> file name into the given view. Throws std::ios_base::failure if the file is not a valid JPEG file, or if its dimensions don't match the ones of the view. <br></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="g78a3eed977abde42c3402a88a5f11e10"></a><!-- doxytag: member="jpeg_io.hpp::jpeg_read_and_convert_view" ref="g78a3eed977abde42c3402a88a5f11e10" args="(const char *filename, const View &amp;view)" -->
template&lt;typename View&gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="g_i_l_0169.html#g78a3eed977abde42c3402a88a5f11e10">jpeg_read_and_convert_view</a> (const char *filename, const View &amp;view)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Loads and color-converts the <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> specified by the given jpeg <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> file name into the given view. Throws std::ios_base::failure if the file is not a valid JPEG file, or if its dimensions don't match the ones of the view. <br></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="gf162e38328791b405a57e079eecc6a54"></a><!-- doxytag: member="jpeg_io.hpp::jpeg_read_and_convert_view" ref="gf162e38328791b405a57e079eecc6a54" args="(const std::string &amp;filename, const View &amp;view, CC cc)" -->
template&lt;typename View, typename CC&gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="g_i_l_0169.html#gf162e38328791b405a57e079eecc6a54">jpeg_read_and_convert_view</a> (const std::string &amp;filename, const View &amp;view, CC cc)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Loads and color-converts the <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> specified by the given jpeg <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> file name into the given view. <br></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="ga30345368e41c777d30351666ce7e93b"></a><!-- doxytag: member="jpeg_io.hpp::jpeg_read_and_convert_view" ref="ga30345368e41c777d30351666ce7e93b" args="(const std::string &amp;filename, const View &amp;view)" -->
template&lt;typename View&gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="g_i_l_0169.html#ga30345368e41c777d30351666ce7e93b">jpeg_read_and_convert_view</a> (const std::string &amp;filename, const View &amp;view)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Loads and color-converts the <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> specified by the given jpeg <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> file name into the given view. <br></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="gbe915826a254db40e74e783255b502e4"></a><!-- doxytag: member="jpeg_io.hpp::jpeg_read_and_convert_image" ref="gbe915826a254db40e74e783255b502e4" args="(const char *filename, Image &amp;im, CC cc)" -->
template&lt;typename Image, typename CC&gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="g_i_l_0169.html#gbe915826a254db40e74e783255b502e4">jpeg_read_and_convert_image</a> (const char *filename, Image &amp;im, CC cc)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allocates a new <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> whose dimensions are determined by the given jpeg <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> file, loads and color-converts the pixels into it. Throws std::ios_base::failure if the file is not a valid JPEG file. <br></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="g9aca5b2912f7e52f6c10d30be27b051d"></a><!-- doxytag: member="jpeg_io.hpp::jpeg_read_and_convert_image" ref="g9aca5b2912f7e52f6c10d30be27b051d" args="(const char *filename, Image &amp;im)" -->
template&lt;typename Image&gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="g_i_l_0169.html#g9aca5b2912f7e52f6c10d30be27b051d">jpeg_read_and_convert_image</a> (const char *filename, Image &amp;im)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allocates a new <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> whose dimensions are determined by the given jpeg <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> file, loads and color-converts the pixels into it. Throws std::ios_base::failure if the file is not a valid JPEG file. <br></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="g689d32dffbcddd731b7314362a85a7ee"></a><!-- doxytag: member="jpeg_io.hpp::jpeg_read_and_convert_image" ref="g689d32dffbcddd731b7314362a85a7ee" args="(const std::string &amp;filename, Image &amp;im, CC cc)" -->
template&lt;typename Image, typename CC&gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="g_i_l_0169.html#g689d32dffbcddd731b7314362a85a7ee">jpeg_read_and_convert_image</a> (const std::string &amp;filename, Image &amp;im, CC cc)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allocates a new <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> whose dimensions are determined by the given jpeg <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> file, loads and color-converts the pixels into it. <br></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="g6de4bc4d35308da0326b98b0e52aa335"></a><!-- doxytag: member="jpeg_io.hpp::jpeg_read_and_convert_image" ref="g6de4bc4d35308da0326b98b0e52aa335" args="(const std::string &amp;filename, Image &amp;im)" -->
template&lt;typename Image&gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="g_i_l_0169.html#g6de4bc4d35308da0326b98b0e52aa335">jpeg_read_and_convert_image</a> (const std::string &amp;filename, Image &amp;im)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allocates a new <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> whose dimensions are determined by the given jpeg <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> file, loads and color-converts the pixels into it. <br></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="g565d99caa50193f98f49728c8b9d807e"></a><!-- doxytag: member="jpeg_io.hpp::jpeg_write_view" ref="g565d99caa50193f98f49728c8b9d807e" args="(const char *filename, const View &amp;view, int quality=100)" -->
template&lt;typename View&gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="g_i_l_0169.html#g565d99caa50193f98f49728c8b9d807e">jpeg_write_view</a> (const char *filename, const View &amp;view, int quality=100)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Saves the view to a jpeg file specified by the given jpeg <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> file name. Triggers a compile assert if the view color space and channel depth are not supported by the JPEG library or by the I/O extension. Throws std::ios_base::failure if it fails to create the file. <br></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="g63405962170c1f94d6318d46134db7f4"></a><!-- doxytag: member="jpeg_io.hpp::jpeg_write_view" ref="g63405962170c1f94d6318d46134db7f4" args="(const std::string &amp;filename, const View &amp;view, int quality=100)" -->
template&lt;typename View&gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="g_i_l_0169.html#g63405962170c1f94d6318d46134db7f4">jpeg_write_view</a> (const std::string &amp;filename, const View &amp;view, int quality=100)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Saves the view to a jpeg file specified by the given jpeg <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> file name. <br></td></tr>
</table>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sat May 2 13:50:16 2009 for Generic Image Library by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>