Sophie

Sophie

distrib > * > 2010.0 > * > by-pkgid > b36c97ff723e66f0f38bce83645c99dc > files > 215

exiv2-doc-0.18.2-1mdv2010.0.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Exiv2: Exiv2::ExifParser Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    <li>
      <form action="search.php" method="get">
        <table cellspacing="0" cellpadding="0" border="0">
          <tr>
            <td><label>&nbsp;<u>S</u>earch&nbsp;for&nbsp;</label></td>
            <td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
          </tr>
        </table>
      </form>
    </li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="classes.html"><span>Class&nbsp;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="namespaceExiv2.html">Exiv2</a>::<a class="el" href="classExiv2_1_1ExifParser.html">ExifParser</a>
  </div>
</div>
<div class="contents">
<h1>Exiv2::ExifParser Class Reference</h1><!-- doxytag: class="Exiv2::ExifParser" -->Stateless parser class for Exif data. Images use this class to decode and encode binary Exif data.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;exif.hpp&gt;</code>
<p>

<p>
<a href="classExiv2_1_1ExifParser-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="namespaceExiv2.html#94c225faf6d6c611a3828fae1c28efa6">ByteOrder</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1ExifParser.html#0a1965f73e968b9b9b26ba254585f0de">decode</a> (<a class="el" href="classExiv2_1_1ExifData.html">ExifData</a> &amp;exifData, const <a class="el" href="namespaceExiv2.html#16f60a5bd4207fe155f6cf93a15efa72">byte</a> *pData, uint32_t size)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Decode metadata from a buffer <em>pData</em> of length <em>size</em> with binary Exif data to the provided metadata container.  <a href="#0a1965f73e968b9b9b26ba254585f0de"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="namespaceExiv2.html#abfd4f86ce5d686323498c42cfd6cde7">WriteMethod</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1ExifParser.html#adab9ea4fdff24670cd8a973aa0690f8">encode</a> (<a class="el" href="namespaceExiv2.html#6e7b9a2ef47caec919b15f1ae6ff4872">Blob</a> &amp;blob, const <a class="el" href="namespaceExiv2.html#16f60a5bd4207fe155f6cf93a15efa72">byte</a> *pData, uint32_t size, <a class="el" href="namespaceExiv2.html#94c225faf6d6c611a3828fae1c28efa6">ByteOrder</a> byteOrder, const <a class="el" href="classExiv2_1_1ExifData.html">ExifData</a> &amp;exifData)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Encode Exif metadata from the provided metadata to binary Exif format.  <a href="#adab9ea4fdff24670cd8a973aa0690f8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1ExifParser.html#2109bba0b2b538470d3f0c2f25dd471a">encode</a> (<a class="el" href="namespaceExiv2.html#6e7b9a2ef47caec919b15f1ae6ff4872">Blob</a> &amp;blob, <a class="el" href="namespaceExiv2.html#94c225faf6d6c611a3828fae1c28efa6">ByteOrder</a> byteOrder, const <a class="el" href="classExiv2_1_1ExifData.html">ExifData</a> &amp;exifData)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Encode metadata from the provided metadata to Exif format.  <a href="#2109bba0b2b538470d3f0c2f25dd471a"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Stateless parser class for Exif data. Images use this class to decode and encode binary Exif data. 
<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>Encode is lossy and is not the inverse of decode. </dd></dl>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="0a1965f73e968b9b9b26ba254585f0de"></a><!-- doxytag: member="Exiv2::ExifParser::decode" ref="0a1965f73e968b9b9b26ba254585f0de" args="(ExifData &amp;exifData, const byte *pData, uint32_t size)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespaceExiv2.html#94c225faf6d6c611a3828fae1c28efa6">ByteOrder</a> Exiv2::ExifParser::decode           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classExiv2_1_1ExifData.html">ExifData</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>exifData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="namespaceExiv2.html#16f60a5bd4207fe155f6cf93a15efa72">byte</a> *&nbsp;</td>
          <td class="paramname"> <em>pData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&nbsp;</td>
          <td class="paramname"> <em>size</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Decode metadata from a buffer <em>pData</em> of length <em>size</em> with binary Exif data to the provided metadata container. 
<p>
The buffer must start with a TIFF header. Return byte order in which the data is encoded.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>exifData</em>&nbsp;</td><td>Exif metadata container. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pData</em>&nbsp;</td><td>Pointer to the data buffer. Must point to data in binary Exif format; no checks are performed. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>Length of the data buffer </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Byte order in which the data is encoded. </dd></dl>

<p>References <a class="el" href="xmp_8cpp_source.html#l00347">Exiv2::XmpData::empty()</a>, and <a class="el" href="iptc_8hpp_source.html#l00300">Exiv2::IptcData::empty()</a>.</p>

</div>
</div><p>
<a class="anchor" name="2109bba0b2b538470d3f0c2f25dd471a"></a><!-- doxytag: member="Exiv2::ExifParser::encode" ref="2109bba0b2b538470d3f0c2f25dd471a" args="(Blob &amp;blob, ByteOrder byteOrder, const ExifData &amp;exifData)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void Exiv2::ExifParser::encode           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespaceExiv2.html#6e7b9a2ef47caec919b15f1ae6ff4872">Blob</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>blob</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceExiv2.html#94c225faf6d6c611a3828fae1c28efa6">ByteOrder</a>&nbsp;</td>
          <td class="paramname"> <em>byteOrder</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classExiv2_1_1ExifData.html">ExifData</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>exifData</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Encode metadata from the provided metadata to Exif format. 
<p>
Encode Exif metadata from the <em><a class="el" href="classExiv2_1_1ExifData.html" title="A container for Exif data. This is a top-level class of the Exiv2 library. The container...">ExifData</a></em> container to binary Exif format in the <em>blob</em>, encoded in <em>byteOrder</em>.<p>
This simpler encode method uses "intrusive" writing, i.e., it builds the binary representation of the metadata from scratch. It does not attempt "non-intrusive", i.e., in-place updating. It's better to use the other <a class="el" href="classExiv2_1_1ExifParser.html#adab9ea4fdff24670cd8a973aa0690f8" title="Encode Exif metadata from the provided metadata to binary Exif format.">encode()</a> method, if the metadata is already available in binary format, in order to allow for "non-intrusive" updating of the existing binary representation.<p>
This is just an inline wrapper for ExifParser::encode(blob, 0, 0, byteOrder, exifData).<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>blob</em>&nbsp;</td><td>Container for the binary Exif data if "intrusive" writing is necessary. Empty otherwise. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>byteOrder</em>&nbsp;</td><td>Byte order to use. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>exifData</em>&nbsp;</td><td>Exif metadata container. </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="adab9ea4fdff24670cd8a973aa0690f8"></a><!-- doxytag: member="Exiv2::ExifParser::encode" ref="adab9ea4fdff24670cd8a973aa0690f8" args="(Blob &amp;blob, const byte *pData, uint32_t size, ByteOrder byteOrder, const ExifData &amp;exifData)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespaceExiv2.html#abfd4f86ce5d686323498c42cfd6cde7">WriteMethod</a> Exiv2::ExifParser::encode           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespaceExiv2.html#6e7b9a2ef47caec919b15f1ae6ff4872">Blob</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>blob</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="namespaceExiv2.html#16f60a5bd4207fe155f6cf93a15efa72">byte</a> *&nbsp;</td>
          <td class="paramname"> <em>pData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&nbsp;</td>
          <td class="paramname"> <em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceExiv2.html#94c225faf6d6c611a3828fae1c28efa6">ByteOrder</a>&nbsp;</td>
          <td class="paramname"> <em>byteOrder</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classExiv2_1_1ExifData.html">ExifData</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>exifData</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Encode Exif metadata from the provided metadata to binary Exif format. 
<p>
The original binary Exif data in the memory block <em>pData</em>, <em>size</em> is parsed and updated in-place if possible ("non-intrusive" writing). If that is not possible (e.g., if new tags were added), the entire Exif structure is re-written to the <em>blob</em> ("intrusive" writing). The return value indicates which write method was used. If it is <code>wmNonIntrusive</code>, the original memory <em>pData</em>, <em>size</em> contains the result and <em>blob</em> is empty. If the return value is <code>wmIntrusive</code>, a new Exif structure was created and returned in <em>blob</em>. The memory block <em>pData</em>, <em>size</em> may be partly updated in this case and should not be used anymore.<p>
Encode is a lossy operation. It attempts to fit the Exif data into a binary block suitable as the payload of a JPEG APP1 Exif segment, which can be at most 65527 bytes large. Encode omits IFD0 tags that are "not recorded" in compressed images according to the Exif 2.2 specification. It also doesn't write tags in groups which do not occur in JPEG images. If the resulting binary block is larger than allowed, it further deletes specific large preview tags and unknown tags. The operation succeeds even if the end result is still larger than the allowed size. Application should therefore always check the size of the <em>blob</em>.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>blob</em>&nbsp;</td><td>Container for the binary Exif data if "intrusive" writing is necessary. Empty otherwise. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pData</em>&nbsp;</td><td>Pointer to the binary Exif data buffer. Must point to data in Exif format; no checks are performed. Will be modified if "non-intrusive" writing is possible. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>Length of the data buffer. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>byteOrder</em>&nbsp;</td><td>Byte order to use. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>exifData</em>&nbsp;</td><td>Exif metadata container.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Write method used. </dd></dl>

<p>References <a class="el" href="exif_8hpp_source.html#l00486">Exiv2::ExifData::begin()</a>, <a class="el" href="exif_8hpp_source.html#l00488">Exiv2::ExifData::end()</a>, <a class="el" href="exif_8cpp_source.html#l00418">Exiv2::ExifData::erase()</a>, <a class="el" href="types_8hpp_source.html#l00458">EXV_COUNTOF</a>, <a class="el" href="tiffimage_8cpp_source.html#l00643">Exiv2::Internal::TiffMapping::findEncoder()</a>, <a class="el" href="exif_8cpp_source.html#l00392">Exiv2::ExifData::findKey()</a>, <a class="el" href="tags_8cpp_source.html#l01749">Exiv2::ExifTags::ifdIdByIfdItem()</a>, and <a class="el" href="tiffcomposite__int_8hpp_source.html#l00108">Exiv2::Internal::Tag::root</a>.</p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="exif_8hpp.html">exif.hpp</a><li>exif.cpp</ul>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Thu Jun 25 15:17:56 2009 for Exiv2 by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>