1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Exiv2: Exiv2::MakerNoteFactory Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.6 -->
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li id="current"><a href="classes.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>
</ul></div>
<div class="tabs">
<ul>
<li><a href="classes.html"><span>Alphabetical List</span></a></li>
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul></div>
<div class="nav">
<a class="el" href="namespaceExiv2.html">Exiv2</a>::<a class="el" href="classExiv2_1_1MakerNoteFactory.html">MakerNoteFactory</a></div>
<h1>Exiv2::MakerNoteFactory Class Reference</h1><!-- doxytag: class="Exiv2::MakerNoteFactory" -->Factory for <a class="el" href="classExiv2_1_1MakerNote.html">MakerNote</a> objects.
<a href="#_details">More...</a>
<p>
<code>#include <makernote.hpp></code>
<p>
Collaboration diagram for Exiv2::MakerNoteFactory:<p><center><img src="classExiv2_1_1MakerNoteFactory__coll__graph.png" border="0" usemap="#Exiv2_1_1MakerNoteFactory__coll__map" alt="Collaboration graph"></center>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classExiv2_1_1MakerNoteFactory-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"><a class="anchor" name="1c896b274b2bdf1d4d40cc9dbaec231f"></a><!-- doxytag: member="Exiv2::MakerNoteFactory::cleanup" ref="1c896b274b2bdf1d4d40cc9dbaec231f" args="()" -->
static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1MakerNoteFactory.html#1c896b274b2bdf1d4d40cc9dbaec231f">cleanup</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1MakerNoteFactory.html#7bbd37a91827199e03bbfaa0c564da95">registerMakerNote</a> (const std::string &make, const std::string &model, <a class="el" href="namespaceExiv2.html#c75cc09b2587146f5b0689dca9ec5b88">CreateFct</a> createMakerNote)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Register a MakerNote create function for a camera make and model. <a href="#7bbd37a91827199e03bbfaa0c564da95"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5b860d2624b27a69942e0c57c7e15495"></a><!-- doxytag: member="Exiv2::MakerNoteFactory::registerMakerNote" ref="5b860d2624b27a69942e0c57c7e15495" args="(IfdId ifdId, MakerNote::AutoPtr makerNote)" -->
static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1MakerNoteFactory.html#5b860d2624b27a69942e0c57c7e15495">registerMakerNote</a> (<a class="el" href="namespaceExiv2.html#1615152767a506a955c9d13443b56b62">IfdId</a> ifdId, <a class="el" href="classExiv2_1_1MakerNote.html#75c707e4233b5c8cea97e9ff3a32a4df">MakerNote::AutoPtr</a> makerNote)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Register a MakerNote prototype in the IFD id registry. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classExiv2_1_1MakerNote.html#75c707e4233b5c8cea97e9ff3a32a4df">MakerNote::AutoPtr</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1MakerNoteFactory.html#c4ee184d581ecdbd241815b0b401ac34">create</a> (const std::string &make, const std::string &model, bool alloc, const <a class="el" href="namespaceExiv2.html#16f60a5bd4207fe155f6cf93a15efa72">byte</a> *buf, long len, <a class="el" href="namespaceExiv2.html#94c225faf6d6c611a3828fae1c28efa6">ByteOrder</a> byteOrder, long offset)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create the appropriate MakerNote based on camera make and model and possibly the contents of the makernote itself, return an auto-pointer to the newly created <a class="el" href="classExiv2_1_1MakerNote.html">MakerNote</a> instance. Return 0 if no MakerNote is defined for the camera model. <a href="#c4ee184d581ecdbd241815b0b401ac34"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="144fe2cc1d05b96340d1973e5a45d25d"></a><!-- doxytag: member="Exiv2::MakerNoteFactory::create" ref="144fe2cc1d05b96340d1973e5a45d25d" args="(IfdId ifdId, bool alloc=true)" -->
static <a class="el" href="classExiv2_1_1MakerNote.html#75c707e4233b5c8cea97e9ff3a32a4df">MakerNote::AutoPtr</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1MakerNoteFactory.html#144fe2cc1d05b96340d1973e5a45d25d">create</a> (<a class="el" href="namespaceExiv2.html#1615152767a506a955c9d13443b56b62">IfdId</a> ifdId, bool alloc=true)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a MakerNote for an IFD id. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1MakerNoteFactory.html#9a924f4df202193ce3de1072c6bd88e0">match</a> (const std::string &regEntry, const std::string &key)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Match a registry entry with a key (used for make and model). <a href="#9a924f4df202193ce3de1072c6bd88e0"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Classes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1MakerNoteFactory_1_1Init.html">Init</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Class <a class="el" href="classExiv2_1_1MakerNoteFactory_1_1Init.html">Init</a> is used to execute initialisation and termination code exactly once, at the begin and end of the program. <a href="classExiv2_1_1MakerNoteFactory_1_1Init.html#_details">More...</a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Factory for <a class="el" href="classExiv2_1_1MakerNote.html">MakerNote</a> objects.
<p>
Maintains an associative list (tree) of camera makes/models and corresponding MakerNote create functions. Creates an instance of the MakerNote for one camera make/model. The factory is implemented as a static class.
<p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="c4ee184d581ecdbd241815b0b401ac34"></a><!-- doxytag: member="Exiv2::MakerNoteFactory::create" ref="c4ee184d581ecdbd241815b0b401ac34" args="(const std::string &make, const std::string &model, bool alloc, const byte *buf, long len, ByteOrder byteOrder, long offset)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="el" href="classExiv2_1_1MakerNote.html#75c707e4233b5c8cea97e9ff3a32a4df">MakerNote::AutoPtr</a> Exiv2::MakerNoteFactory::create </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const std::string & </td>
<td class="mdname" nowrap> <em>make</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const std::string & </td>
<td class="mdname" nowrap> <em>model</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>bool </td>
<td class="mdname" nowrap> <em>alloc</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const <a class="el" href="namespaceExiv2.html#16f60a5bd4207fe155f6cf93a15efa72">byte</a> * </td>
<td class="mdname" nowrap> <em>buf</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>long </td>
<td class="mdname" nowrap> <em>len</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="namespaceExiv2.html#94c225faf6d6c611a3828fae1c28efa6">ByteOrder</a> </td>
<td class="mdname" nowrap> <em>byteOrder</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>long </td>
<td class="mdname" nowrap> <em>offset</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Create the appropriate MakerNote based on camera make and model and possibly the contents of the makernote itself, return an auto-pointer to the newly created <a class="el" href="classExiv2_1_1MakerNote.html">MakerNote</a> instance. Return 0 if no MakerNote is defined for the camera model.
<p>
The method searches the make-model tree for a make and model combination in the registry that matches the search key. The search is case insensitive (Todo: implement case-insensitive comparisons) and wildcards in the registry entries are supported. First the best matching make is searched, then the best matching model for this make is searched. If there is no matching make or no matching model within the models registered for the best matching make, then no makernote is created and the function returns 0. If a match is found, the function invokes the registered create function and returns an auto-pointer to the newly created <a class="el" href="classExiv2_1_1MakerNote.html">MakerNote</a>. The makernote pointed to is owned by the caller of the function and the auto-pointer ensures that it is deleted. The best match is an exact match, then a match is rated according to the number of matching characters. The makernote buffer is passed on to the create function, which can based on its content, automatically determine the correct version or flavour of the makernote required. This is used, e.g., to determine which of the three Nikon makernotes to create.<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>make</em> </td><td>Camera manufacturer. (Typically the string from the Exif make tag.) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>model</em> </td><td>Camera model. (Typically the string from the Exif model tag.) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>alloc</em> </td><td>Memory management model for the new <a class="el" href="classExiv2_1_1MakerNote.html">MakerNote</a>. Determines if memory required to store data should be allocated and deallocated (true) or not (false). If false, only pointers to the buffer provided to read() will be kept. See <a class="el" href="classExiv2_1_1Ifd.html">Ifd</a> for more background on this concept. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>buf</em> </td><td>Pointer to the makernote character buffer. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>len</em> </td><td>Length of the makernote character buffer. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>byteOrder</em> </td><td>Byte order in which the Exif data (and possibly the makernote) is encoded. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>offset</em> </td><td>Offset from the start of the TIFF header of the makernote buffer.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>An auto-pointer that owns a MakerNote for the camera model. If the camera is not supported, the pointer is 0. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="9a924f4df202193ce3de1072c6bd88e0"></a><!-- doxytag: member="Exiv2::MakerNoteFactory::match" ref="9a924f4df202193ce3de1072c6bd88e0" args="(const std::string &regEntry, const std::string &key)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int Exiv2::MakerNoteFactory::match </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const std::string & </td>
<td class="mdname" nowrap> <em>regEntry</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const std::string & </td>
<td class="mdname" nowrap> <em>key</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Match a registry entry with a key (used for make and model).
<p>
The matching algorithm is case insensitive and wildcards ('*') in the registry entry are supported. The best match is an exact match, then a match is rated according to the number of matching characters.<p>
<dl compact><dt><b>Returns:</b></dt><dd>A score value indicating how good the key and registry entry match. 0 means no match, values greater than 0 indicate a match, larger values are better matches:<br>
0: key and registry entry do not match<br>
1: a pure wildcard match, i.e., the registry entry is just a wildcard.<br>
Score values greater than 1 are computed by adding 1 to the number of matching characters, except for an exact match, which scores 2 plus the number of matching characters. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="7bbd37a91827199e03bbfaa0c564da95"></a><!-- doxytag: member="Exiv2::MakerNoteFactory::registerMakerNote" ref="7bbd37a91827199e03bbfaa0c564da95" args="(const std::string &make, const std::string &model, CreateFct createMakerNote)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void Exiv2::MakerNoteFactory::registerMakerNote </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const std::string & </td>
<td class="mdname" nowrap> <em>make</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const std::string & </td>
<td class="mdname" nowrap> <em>model</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="namespaceExiv2.html#c75cc09b2587146f5b0689dca9ec5b88">CreateFct</a> </td>
<td class="mdname" nowrap> <em>createMakerNote</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Register a MakerNote create function for a camera make and model.
<p>
Registers a create function for a MakerNote for a given make and model combination with the factory. Both the make and model strings may contain wildcards ('*', e.g., "Canon*"). If the make already exists in the registry, then a new branch for the model is added. If the model also already exists, then the new create function replaces the old one.<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>make</em> </td><td>Camera manufacturer. (Typically the string from the Exif make tag.) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>model</em> </td><td>Camera model. (Typically the string from the Exif model tag.) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>createMakerNote</em> </td><td>Pointer to a function to create a new MakerNote of a particular type. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="makernote_8hpp.html">makernote.hpp</a><li>makernote.cpp</ul>
<hr size="1"><address style="align: right;"><small>Generated on Fri Jun 2 23:55:05 2006 for Exiv2 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6 </small></address>
</body>
</html>
|