cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <meta http-equiv="Content-Type" |
| 5 | content="text/html; charset=iso-8859-1"> |
| 6 | <meta name="GENERATOR" |
| 7 | content="Mozilla/4.78 [en] (X11; U; SunOS 5.6 sun4u) [Netscape]"> |
| 8 | <meta name="Author" content="Bob Friesenhahn"> |
| 9 | <meta name="Description" |
| 10 | content="Documentation on Magick++'s STL support templates."> |
| 11 | <meta name="Keywords" content="STL,Magick++,ImageMagick"> |
| 12 | <title>Magick++ STL Support</title> |
| 13 | </head> |
| 14 | <body text="#000000" bgcolor="#ffffff" link="#0000ff" vlink="#ff0000" |
| 15 | alink="#000088"> |
| 16 | <center> |
| 17 | <h1> Magick++ STL Support</h1> |
| 18 | </center> |
| 19 | Magick++ provides a set of <a href="http://www.sgi.com/tech/stl/">Standard |
| 20 | Template Libary</a> (<a href="http://www.sgi.com/tech/stl/">STL</a> ) |
| 21 | algorithms for operating across ranges of image frames in a container. |
| 22 | It also provides a set of STL unary function objects to apply an |
| 23 | operation on image frames in a container via an algorithm which uses |
| 24 | unary function objects. A good example of a standard algorithm which is |
| 25 | useful for processing containers of image frames is the STL <i><a |
| 26 | href="http://www.sgi.com/tech/stl/for_each.html"> for_each</a> </i> |
| 27 | algorithm which invokes a unary function object on a range of container |
| 28 | elements. |
| 29 | <p>Magick++ uses a limited set of template argument types. The current |
| 30 | template argument types are: </p> |
| 31 | <blockquote><a href="http://www.sgi.com/tech/stl/Container.html">Container</a> |
| 32 | <blockquote>A container having the properties of a <a |
| 33 | href="http://www.sgi.com/tech/stl/BackInsertionSequence.html"> Back |
| 34 | Insertion Sequence</a> . Sequences support forward iterators and Back |
| 35 | Insertion Sequences support the additional abilty to append an element |
| 36 | via push_back(). Common compatable container types are the STL <<a |
| 37 | href="http://www.sgi.com/tech/stl/Vector.html"> vector</a> > and <<a |
| 38 | href="http://www.sgi.com/tech/stl/List.html">list</a> > template |
| 39 | containers. This template argument is usually used to represent an |
| 40 | output container in which one or more image frames may be appended. |
| 41 | Containers like STL <<a href="http://www.sgi.com/tech/stl/Vector.html">vector</a> |
| 42 | > which have a given default <i>capacity</i> may need to have their <i> |
| 43 | capacity</i> adjusted via r<i>eserve() </i>to a larger <i>capacity</i> |
| 44 | in order to support the expected final <i>size</i> . Since Magick++ |
| 45 | images are very small, it is likely that the default capacity of STL <<a |
| 46 | href="http://www.sgi.com/tech/stl/Vector.html"> vector</a> > is |
| 47 | sufficient for most situations.</blockquote> |
| 48 | <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a> |
| 49 | <blockquote>An input iterator used to express a position in a |
| 50 | container. These template arguments are typically used to represent a |
| 51 | range of elements with f<i>irst_</i> representing the first element to |
| 52 | be processed and <i> last_</i> representing the element to stop at. When |
| 53 | processing the entire contents of a container, it is handy to know that |
| 54 | STL containers usually provide the begin() and end() methods to return |
| 55 | input interators which correspond with the first and last elements, |
| 56 | respectively.</blockquote> |
| 57 | </blockquote> |
| 58 | The following is an example of how frames from a GIF animation <font |
| 59 | color="#000000"> "test_image_anim.gif" may be appended horizontally |
| 60 | with the resulting image written to the file "appended_image.miff":</font> |
| 61 | <p><tt><font color="#000066">#include <list></font></tt> <br> |
| 62 | <tt><font color="#000066">#include <Magick++.h></font></tt> <br> |
| 63 | <tt><font color="#000066">using namespace std;</font></tt> <br> |
| 64 | <tt><font color="#000066">using namespace Magick;</font></tt> </p> |
| 65 | <p><tt><font color="#000066">int main(int /*argc*/,char **/*argv*/)</font></tt> <br> |
| 66 | <tt><font color="#000066">{</font></tt> <br> |
| 67 | <tt><font color="#000066"> list<Image> imageList;</font></tt> <br> |
| 68 | <tt><font color="#000066"> readImages( &imageList, |
| 69 | "test_image_anim.gif" );</font></tt> </p> |
| 70 | <p><tt><font color="#000066"> Image appended;</font></tt> <br> |
| 71 | <tt><font color="#000066"> appendImages( &appended, |
| 72 | imageList.begin(), imageList.end() );</font></tt> <br> |
| 73 | <tt><font color="#000066"> appended.write( |
| 74 | "appended_image.miff" );</font></tt> <br> |
| 75 | <tt><font color="#000066"> return 0;</font></tt> <br> |
| 76 | <tt><font color="#000066">}</font></tt> </p> |
| 77 | <p>The available Magick++ specific STL algorithms for operating on |
| 78 | sequences of image frames are shown in the following table: <br> |
| 79 | |
| 80 | <table border="1" width="100%"> |
| 81 | <caption><b>Magick++ STL Algorithms For Image Sequences</b></caption> <tbody> |
| 82 | <tr> |
| 83 | <td> |
| 84 | <center><b>Algorithm</b></center> |
| 85 | </td> |
| 86 | <td> |
| 87 | <center><b>Signature</b></center> |
| 88 | </td> |
| 89 | <td> |
| 90 | <center><b>Description</b></center> |
| 91 | </td> |
| 92 | </tr> |
| 93 | <tr> |
| 94 | <td> |
| 95 | <center><a name="animateImages"></a> <font size="-1">animateImages</font></center> |
| 96 | </td> |
| 97 | <td><font size="-1"><a |
| 98 | href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a> |
| 99 | first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a> |
| 100 | last_</font></td> |
| 101 | <td><font size="-1">Animate a sequence of image frames. Image |
| 102 | frames are displayed in succession, creating an animated effect. The |
| 103 | animation options are taken from the first image frame. This feature is |
| 104 | only supported under X11 at the moment.</font></td> |
| 105 | </tr> |
| 106 | <tr> |
| 107 | <td> |
| 108 | <center><a name="appendImages"></a> <font size="-1">appendImages</font></center> |
| 109 | </td> |
| 110 | <td><font size="-1"><a href="Image.html">Image</a> |
| 111 | *appendedImage_, <a |
| 112 | href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a> |
| 113 | first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a> |
| 114 | last_, bool stack_ = false</font></td> |
| 115 | <td><font size="-1">Append a sequence of image frames, writing |
| 116 | the result to <i>appendedImage_.</i> All the input image frames must |
| 117 | have the same width or height. Image frames of the same width are |
| 118 | stacked top-to-bottom. Image frames of the same height are stacked |
| 119 | left-to-right. If the <i>stack_</i> parameter is false, rectangular |
| 120 | image frames are stacked left-to-right otherwise top-to-bottom.</font></td> |
| 121 | </tr> |
| 122 | <tr> |
| 123 | <td> |
| 124 | <center><a name="averageImages"></a> <font size="-1">averageImages</font></center> |
| 125 | </td> |
| 126 | <td><font size="-1"><a href="Image.html">Image</a> |
| 127 | *averagedImage_, <a |
| 128 | href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a> |
| 129 | first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a> |
| 130 | last_</font></td> |
| 131 | <td><font size="-1">Average a sequence of image frames, writing |
| 132 | the result to <i>averagedImage_</i>. All the input image frames must |
| 133 | be the same size in pixels.</font></td> |
| 134 | </tr> |
| 135 | <tr> |
| 136 | <td> |
| 137 | <center><a name="coalesceImages"></a> <font size="-1">coalesceImages</font></center> |
| 138 | </td> |
| 139 | <td><font size="-1"><a |
| 140 | href="http://www.sgi.com/tech/stl/Container.html"> Container</a> |
| 141 | *coalescedImages_, <a |
| 142 | href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a> |
| 143 | first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a> |
| 144 | last_</font><br> |
| 145 | </td> |
| 146 | <td><font size="-1">Create a coalesced image sequence obtained by |
| 147 | "playing" the image sequence (observing page offsets and disposal |
| 148 | methods) to create a new image sequence in which all frames are full |
| 149 | size and completely rendered. Note that if the original image sequence |
| 150 | relied on page offsets and disposal methods that the resulting sequence |
| 151 | will be larger (perhaps much larger) then the original. This is useful |
| 152 | for GIF animation sequences that have page offsets and disposal methods. |
| 153 | The resuting image sequence is returned via <i>coalescedImages_.</i></font></td> |
| 154 | </tr> |
| 155 | <tr> |
| 156 | <td> |
| 157 | <center><a name="deconstructImages"></a> <font size="-1">deconstructImages</font></center> |
| 158 | </td> |
| 159 | <td><font size="-1"><a |
| 160 | href="http://www.sgi.com/tech/stl/Container.html"> Container</a> |
| 161 | *deconstructedImages_, <a |
| 162 | href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a> |
| 163 | first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a> |
| 164 | last_</font></td> |
| 165 | <td><font size="-1">Break down an image sequence into constituent |
| 166 | parts. This is useful for creating GIF or MNG animation sequences. |
| 167 | The input sequence is specified by <i>first_</i> and <i>last_</i>, and |
| 168 | the deconstruted images are returned via <i>deconstructedImages_</i>.</font></td> |
| 169 | </tr> |
| 170 | <tr> |
| 171 | <td> |
| 172 | <center><a name="displayImages"></a> <font size="-1">displayImages</font></center> |
| 173 | </td> |
| 174 | <td><font size="-1"><a |
| 175 | href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a> |
| 176 | first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a> |
| 177 | last_</font></td> |
| 178 | <td><font size="-1">Display a sequence of image frames. Through |
| 179 | use of a pop-up menu, image frames may be selected in succession. This |
| 180 | feature is fully supported under X11 but may have only limited support |
| 181 | in other environments.</font> <br> |
| 182 | <font size="-1"><b><font color="#ff0000">Caution: </font></b> if |
| 183 | an image format is not compatable with the display visual (e.g. JPEG |
| 184 | on a colormapped display) then the original image will be altered. Use a |
| 185 | copy of the original if this is a problem.</font></td> |
| 186 | </tr> |
| 187 | <tr> |
| 188 | <td> |
| 189 | <center><a name="flattenImages"></a> <font size="-1">flattenImages</font></center> |
| 190 | </td> |
| 191 | <td><font size="-1"><a href="Image.html">Image</a> |
| 192 | *flattendImage_, <a |
| 193 | href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a> |
| 194 | first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a> |
| 195 | last_</font></td> |
| 196 | <td><font size="-1">Merge a sequence of image frames which |
| 197 | represent image layers into a single composited representation. The <i>flattendImage_</i> |
| 198 | parameter points to an existing Image to update with the flattened |
| 199 | image. This function is useful for combining Photoshop layers into a |
| 200 | single image.</font></td> |
| 201 | </tr> |
| 202 | <tr> |
| 203 | <td> |
| 204 | <center><a name="mapImages"></a> <font size="-1">mapImages</font></center> |
| 205 | </td> |
| 206 | <td><font size="-1"><a |
| 207 | href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a> |
| 208 | first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a> |
| 209 | last_, const <a href="Image.html">Image</a> & mapImage_, bool |
| 210 | dither_, bool measureError_ = false</font></td> |
| 211 | <td><font size="-1">Replace the colors of a sequence of images |
| 212 | with the closest color from a reference image. Set <i>dither_</i> to <i>true</i> |
| 213 | to enable dithering. Set <i>measureError_</i> to <i>true</i> in |
| 214 | order to evaluate quantization error.</font></td> |
| 215 | </tr> |
| 216 | <tr> |
| 217 | <td> |
| 218 | <center><a name="montageImages"></a> <font size="-1">montageImages</font></center> |
| 219 | </td> |
| 220 | <td><font size="-1"><a |
| 221 | href="http://www.sgi.com/tech/stl/Container.html"> Container</a> |
| 222 | *montageImages_, <a |
| 223 | href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a> |
| 224 | first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a> |
| 225 | last_, const <a href="Montage.html">Montage</a> &montageOpts_</font></td> |
| 226 | <td><font size="-1">Create a composite image by combining several |
| 227 | separate image frames. Multiple frames may be generated in the output |
| 228 | container <i> montageImages_ </i>depending on the tile setting and the |
| 229 | number of image frames montaged. Montage options are provided via the |
| 230 | parameter <i>montageOpts_</i> . Options set in the first image frame (<a |
| 231 | href="Image.html#backgroundColor"> backgroundColor,</a> <a |
| 232 | href="Image.html#borderColor">borderColor</a> , <a |
| 233 | href="Image.html#matteColor">matteColor</a> , <a |
| 234 | href="Image.html#penColor">penColor,</a> <a href="Image.html#font">font,</a> |
| 235 | and <a href="Image.html#fontPointsize">fontPointsize</a> ) are also used |
| 236 | as options by <i>montageImages().</i></font></td> |
| 237 | </tr> |
| 238 | <tr> |
| 239 | <td> |
| 240 | <center><a name="morphImages"></a> <font size="-1">morphImages</font></center> |
| 241 | </td> |
| 242 | <td><font size="-1"><a |
| 243 | href="http://www.sgi.com/tech/stl/Container.html"> Container</a> |
| 244 | *morphedImages_, <a |
| 245 | href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a> |
| 246 | first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a> |
| 247 | last_, unsigned int frames_</font></td> |
| 248 | <td><font size="-1">Morph a seqence of image frames. This |
| 249 | algorithm expands the number of image frames (output to the |
| 250 | container <i>morphedImages_)</i> by adding the number of intervening |
| 251 | frames specified by <i>frames_</i> such that the original frames morph |
| 252 | (blend) into each other when played as an animation.</font></td> |
| 253 | </tr> |
| 254 | <tr> |
| 255 | <td> |
| 256 | <center><a name="mosaicImages"></a> <font size="-1">mosaicImages</font></center> |
| 257 | </td> |
| 258 | <td><font size="-1"><a href="Image.html">Image</a> *mosaicImage_, <a |
| 259 | href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a> |
| 260 | first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a> |
| 261 | last_</font></td> |
| 262 | <td><font size="-1">Inlay a number of images to form a single |
| 263 | coherent picture. The <i>mosicImage_</i> argument is updated with a |
| 264 | mosaic constructed from the image sequence represented by <i>first_</i> |
| 265 | through <i>last_</i> .</font></td> |
| 266 | </tr> |
| 267 | <tr> |
| 268 | <td rowspan="2"> |
| 269 | <center><a name="readImages"></a> <font size="-1">readImages</font></center> |
| 270 | </td> |
| 271 | <td><font size="-1"><a |
| 272 | href="http://www.sgi.com/tech/stl/Container.html"> Container</a> |
| 273 | *sequence_, const std::string &imageSpec_</font></td> |
| 274 | <td><font size="-1">Read a sequence of image frames into existing |
| 275 | container (appending to container <i>sequence_</i>) with image names |
| 276 | specified in the string <i>imageSpec_</i>.</font></td> |
| 277 | </tr> |
| 278 | <tr> |
| 279 | <td><font size="-1"><a |
| 280 | href="http://www.sgi.com/tech/stl/Container.html"> Container</a> |
| 281 | *sequence_, const <a href="Blob.html">Blob</a> &blob_</font></td> |
| 282 | <td><font size="-1">Read a sequence of image frames into existing |
| 283 | container (appending to container sequence_) from <a href="Blob.html">Blob</a> |
| 284 | blob_.</font></td> |
| 285 | </tr> |
| 286 | <tr> |
| 287 | <td rowspan="2"> |
| 288 | <center><a name="writeImages"></a> <font size="-1">writeImages</font></center> |
| 289 | </td> |
| 290 | <td><font size="-1"><a |
| 291 | href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a> |
| 292 | first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a> |
| 293 | last_, const std::string &imageSpec_, bool adjoin_ = true</font></td> |
| 294 | <td><font size="-1">Write images in container to file specified |
| 295 | by string <i>imageSpec_</i>. Set <i>adjoin_ </i>to false to write a |
| 296 | set of image frames via a wildcard <i>imageSpec_ </i>(e.g. |
| 297 | image%02d.miff).</font> <br> |
| 298 | The wildcard must be one of <tt>%0Nd, %0No, or %0Nx</tt>. <br> |
| 299 | <font size="-1"><b><font color="#ff0000">Caution: </font></b> if |
| 300 | an image format is selected which is capable of supporting fewer colors |
| 301 | than the original image or quantization has been requested, the original |
| 302 | image will be quantized to fewer colors. Use a copy of the original if |
| 303 | this is a problem.</font></td> |
| 304 | </tr> |
| 305 | <tr> |
| 306 | <td><font size="-1"><a |
| 307 | href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a> |
| 308 | first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a> |
| 309 | last_, <a href="Blob.html">Blob</a> *blob_, bool adjoin_ = true</font></td> |
| 310 | <td><font size="-1">Write images in container to in-memory BLOB |
| 311 | specified by <a href="Blob.html">Blob</a> blob_. Set adjoin_ to false to |
| 312 | write a set of image frames via a wildcard imageSpec_ (e.g. |
| 313 | image%02d.miff).</font> <br> |
| 314 | <font size="-1"><b><font color="#ff0000">Caution:</font></b> if an |
| 315 | image format is selected which is capable of supporting fewer colors |
| 316 | than the original image or quantization has been requested, the original |
| 317 | image will be quantized to fewer colors. Use a copy of the original if |
| 318 | this is a problem.</font></td> |
| 319 | </tr> |
| 320 | <tr> |
| 321 | <td><a name="quantizeImages"></a> <font size="-1">quantizeImages</font></td> |
| 322 | <td><font size="-1"><a |
| 323 | href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a> |
| 324 | first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a> |
| 325 | last_, bool measureError_ = false</font></td> |
| 326 | <td><font size="-1">Quantize colors in images using current |
| 327 | quantization settings. Set <i>measureError_</i> to <i>true</i> in order |
| 328 | to measure quantization error.</font></td> |
| 329 | </tr> |
| 330 | </tbody> |
| 331 | </table> |
| 332 | <br> |
| 333 | </p> |
| 334 | <center> |
| 335 | <h3> Magick++ Unary Function Objects</h3> |
| 336 | </center> |
| 337 | Magick++ unary function objects inherit from the STL unary_function |
| 338 | template class . The STL unary_function template class is of the form |
| 339 | <blockquote><tt><font color="#000099">unary_function<Arg, Result></font></tt></blockquote> |
| 340 | and expects that derived classes implement a method of the form: |
| 341 | <blockquote><tt><font color="#000099">Result operator()( Arg argument_ |
| 342 | );</font></tt></blockquote> |
| 343 | which is invoked by algorithms using the function object. In the case |
| 344 | of unary function objects defined by Magick++, the invoked function |
| 345 | looks like: |
| 346 | <blockquote><tt><font color="#000099">void operator()( Image |
| 347 | &image_);</font></tt></blockquote> |
| 348 | with a typical implementation looking similar to: |
| 349 | <blockquote><tt><font color="#000099">void operator()( Image |
| 350 | &image_ )</font></tt> <br> |
| 351 | <tt><font color="#000099"> {</font></tt> <br> |
| 352 | <tt><font color="#000099"> image_.contrast( |
| 353 | _sharpen );</font></tt> <br> |
| 354 | <tt><font color="#000099"> }</font></tt></blockquote> |
| 355 | where <i>contrast</i> is an Image method and <i>_sharpen </i>is an |
| 356 | argument stored within the function object by its contructor. Since |
| 357 | constructors may be polymorphic, a given function object may have |
| 358 | several constructors and selects the appropriate Image method based on |
| 359 | the arguments supplied. |
| 360 | <p>In essence, unary function objects (as provided by Magick++) simply |
| 361 | provide the means to construct an object which caches arguments for |
| 362 | later use by an algorithm designed for use with unary function objects. |
| 363 | There is a unary function object corresponding each algorithm provided |
| 364 | by the <a href="Image.html"> Image</a> class and there is a contructor |
| 365 | available compatable with each synonymous method in the Image class. </p> |
| 366 | <p>The unary function objects that Magick++ provides to support |
| 367 | manipulating images are shown in the following table: <br> |
| 368 | |
| 369 | <table border="1"> |
| 370 | <caption><b>Magick++ Unary Function Objects For Image Manipulation</b></caption> <tbody> |
| 371 | <tr align="center"> |
| 372 | <td><b>Function Object</b></td> |
| 373 | <td><b>Constructor Signatures(s)</b></td> |
| 374 | <td><b>Description</b></td> |
| 375 | </tr> |
| 376 | <tr> |
| 377 | <td valign="middle"> |
| 378 | <div align="center"><a name="adaptiveThresholdImage"></a> <font |
| 379 | size="-1">adaptiveThresholdImage</font><br> |
| 380 | </div> |
| 381 | </td> |
| 382 | <td valign="middle"><font size="-1">unsigned int width, unsigned |
| 383 | int height, unsigned offset = 0</font><br> |
| 384 | </td> |
| 385 | <td valign="top"><font size="-1">Apply adaptive thresholding to |
| 386 | the image. Adaptive thresholding is useful if the ideal threshold level |
| 387 | is not known in advance, or if the illumination gradient is not constant |
| 388 | across the image. Adaptive thresholding works by evaulating the mean |
| 389 | (average) of a pixel region (size specified by <i>width</i> and <i>height</i>) |
| 390 | and using the mean as the thresholding value. In order to remove |
| 391 | residual noise from the background, the threshold may be adjusted by |
| 392 | subtracting a constant <i>offset</i> (default zero) from the mean to |
| 393 | compute the threshold.</font><br> |
| 394 | </td> |
| 395 | </tr> |
| 396 | <tr> |
| 397 | <td> |
| 398 | <center><a name="addNoiseImage"></a> <font size="-1">addNoiseImage</font></center> |
| 399 | </td> |
| 400 | <td><font size="-1"><a href="Enumerations.html#NoiseType">NoiseType</a> |
| 401 | noiseType_</font></td> |
| 402 | <td><font size="-1">Add noise to image with specified noise type.</font></td> |
| 403 | </tr> |
| 404 | <tr> |
| 405 | <td style="vertical-align: middle;"><small><a |
| 406 | name="affineTransformImage"></a>affineTransformImage<br> |
| 407 | </small></td> |
| 408 | <td style="vertical-align: middle;"><small>const DrawableAffine |
| 409 | &affine_<br> |
| 410 | </small></td> |
| 411 | <td style="vertical-align: middle;"><small>Transform image by |
| 412 | specified affine (or free transform) matrix.<br> |
| 413 | </small></td> |
| 414 | </tr> |
| 415 | <tr> |
| 416 | <td rowspan="4"> |
| 417 | <center><a name="annotateImage"></a> <font size="-1">annotateImage</font></center> |
| 418 | </td> |
| 419 | <td><font size="-1">const std::string &text_, const <a |
| 420 | href="Geometry.html"> Geometry</a> &location_</font></td> |
| 421 | <td><font size="-1">Annotate with text using specified text, |
| 422 | bounding area, placement gravity, and rotation. If <i>boundingArea_</i> |
| 423 | is invalid, then bounding area is entire image.</font></td> |
| 424 | </tr> |
| 425 | <tr> |
| 426 | <td><font size="-1">std::string text_, const <a |
| 427 | href="Geometry.html">Geometry</a> &boundingArea_, <a |
| 428 | href="Enumerations.html#GravityType">GravityType</a> gravity_</font></td> |
| 429 | <td><font size="-1">Annotate using specified text, bounding area, |
| 430 | and placement gravity. If <i>boundingArea_</i> is invalid, then |
| 431 | bounding area is entire image.</font></td> |
| 432 | </tr> |
| 433 | <tr> |
| 434 | <td><font size="-1">const std::string &text_, const <a |
| 435 | href="Geometry.html"> Geometry</a> &boundingArea_, <a |
| 436 | href="Enumerations.html#GravityType">GravityType</a> gravity_, double |
| 437 | degrees_, </font></td> |
| 438 | <td><font size="-1">Annotate with text using specified text, |
| 439 | bounding area, placement gravity, and rotation. If <i>boundingArea_</i> |
| 440 | is invalid, then bounding area is entire image.</font></td> |
| 441 | </tr> |
| 442 | <tr> |
| 443 | <td><font size="-1">const std::string &text_, <a |
| 444 | href="Enumerations.html#GravityType"> GravityType</a> gravity_</font></td> |
| 445 | <td><font size="-1">Annotate with text (bounding area is entire |
| 446 | image) and placement gravity.</font></td> |
| 447 | </tr> |
| 448 | <tr> |
| 449 | <td> |
| 450 | <center><a name="blurImage"></a> <font size="-1">blurImage</font></center> |
| 451 | </td> |
| 452 | <td><font size="-1">const double radius_ = 1, const double sigma_ |
| 453 | = 0.5</font></td> |
| 454 | <td><font size="-1">Blur image. The radius_ parameter specifies |
| 455 | the radius of the Gaussian, in pixels, not counting the center |
| 456 | pixel. The sigma_ parameter specifies the standard deviation of |
| 457 | the Laplacian, in pixels.</font></td> |
| 458 | </tr> |
| 459 | <tr> |
| 460 | <td> |
| 461 | <center><a name="borderImage"></a> <font size="-1">borderImage</font></center> |
| 462 | </td> |
| 463 | <td><font size="-1">const <a href="Geometry.html">Geometry</a> |
| 464 | &geometry_ = "6x6+0+0"</font></td> |
| 465 | <td><font size="-1">Border image (add border to image). The |
| 466 | color of the border is specified by the <i>borderColor</i> attribute.</font></td> |
| 467 | </tr> |
| 468 | <tr> |
| 469 | <td> |
| 470 | <center><a name="charcoalImage"></a> <font size="-1">charcoalImage</font></center> |
| 471 | </td> |
| 472 | <td><font size="-1">const double radius_ = 1, const double sigma_ |
| 473 | = 0.5</font></td> |
| 474 | <td><font size="-1">Charcoal effect image (looks like charcoal |
| 475 | sketch). The radius_ parameter specifies the radius of the Gaussian, in |
| 476 | pixels, not counting the center pixel. The sigma_ parameter |
| 477 | specifies the standard deviation of the Laplacian, in pixels.</font></td> |
| 478 | </tr> |
| 479 | <tr> |
| 480 | <td> |
| 481 | <center><a name="chopImage"></a> <font size="-1">chopImage</font></center> |
| 482 | </td> |
| 483 | <td><font size="-1">const <a href="Geometry.html">Geometry</a> |
| 484 | &geometry_</font></td> |
| 485 | <td><font size="-1">Chop image (remove vertical or horizontal |
| 486 | subregion of image)</font></td> |
| 487 | </tr> |
| 488 | <tr> |
| 489 | <td rowspan="2"> |
| 490 | <center><a name="colorizeImage"></a> <font size="-1">colorizeImage</font></center> |
| 491 | </td> |
| 492 | <td><font size="-1">const unsigned int opacityRed_, const |
| 493 | unsigned int opacityGreen_, const unsigned int opacityBlue_, const Color |
| 494 | &penColor_</font></td> |
| 495 | <td><font size="-1">Colorize image with pen color, using |
| 496 | specified percent opacity for red, green, and blue quantums.</font></td> |
| 497 | </tr> |
| 498 | <tr> |
| 499 | <td><font size="-1">const unsigned int opacity_, const <a |
| 500 | href="Color.html"> Color</a> &penColor_</font></td> |
| 501 | <td><font size="-1">Colorize image with pen color, using |
| 502 | specified percent opacity.</font></td> |
| 503 | </tr> |
| 504 | <tr> |
| 505 | <td> |
| 506 | <center><a name="commentImage"></a> <font size="-1">commentImage</font></center> |
| 507 | </td> |
| 508 | <td><font size="-1">const std::string &comment_</font></td> |
| 509 | <td><font size="-1">Comment image (add comment string to |
| 510 | image). By default, each image is commented with its file name. |
| 511 | Use this method to assign a specific comment to the |
| 512 | image. Optionally you can include the image filename, type, width, |
| 513 | height, or other image attributes by embedding <a |
| 514 | href="FormatCharacters.html">special format characters.</a> </font></td> |
| 515 | </tr> |
| 516 | <tr> |
| 517 | <td rowspan="2"> |
| 518 | <center><a name="compositeImage"></a> <font size="-1">compositeImage</font></center> |
| 519 | </td> |
| 520 | <td><font size="-1">const <a href="Image.html">Image</a> |
| 521 | &compositeImage_, int xOffset_, int yOffset_, <a |
| 522 | href="Enumerations.html#CompositeOperator"> CompositeOperator</a> |
| 523 | compose_ = <i>InCompositeOp</i></font></td> |
| 524 | <td rowspan="2"><font size="-1">Compose an image onto another at |
| 525 | specified offset and using specified algorithm</font></td> |
| 526 | </tr> |
| 527 | <tr> |
| 528 | <td><font size="-1">const <a href="Image.html">Image</a> |
| 529 | &compositeImage_, const Geometry &offset_, <a |
| 530 | href="Enumerations.html#CompositeOperator"> CompositeOperator</a> |
| 531 | compose_ = <i>InCompositeOp</i></font></td> |
| 532 | </tr> |
| 533 | <tr> |
| 534 | <td> |
| 535 | <center><a name="condenseImage"></a> <font size="-1">condenseImage</font></center> |
| 536 | </td> |
| 537 | <td><font size="-1">void</font></td> |
| 538 | <td><font size="-1">Condense image (Re-run-length encode image in |
| 539 | memory).</font></td> |
| 540 | </tr> |
| 541 | <tr> |
| 542 | <td> |
| 543 | <center><a name="contrastImage"></a> <font size="-1">contrastImage</font></center> |
| 544 | </td> |
| 545 | <td><font size="-1">unsigned int sharpen_</font></td> |
| 546 | <td><font size="-1">Contrast image (enhance intensity differences |
| 547 | in image)</font></td> |
| 548 | </tr> |
| 549 | <tr> |
| 550 | <td> |
| 551 | <center><a name="cropImage"></a> <font size="-1">cropImage</font></center> |
| 552 | </td> |
| 553 | <td><font size="-1">const <a href="Geometry.html">Geometry</a> |
| 554 | &geometry_</font></td> |
| 555 | <td><font size="-1">Crop image (subregion of original image)</font></td> |
| 556 | </tr> |
| 557 | <tr> |
| 558 | <td> |
| 559 | <center><a name="cycleColormapImage"></a> <font size="-1">cycleColormap-</font> <br> |
| 560 | <font size="-1">Image</font></center> |
| 561 | </td> |
| 562 | <td><font size="-1">int amount_</font></td> |
| 563 | <td><font size="-1">Cycle image colormap</font></td> |
| 564 | </tr> |
| 565 | <tr> |
| 566 | <td> |
| 567 | <center><a name="despeckleImage"></a> <font size="-1">despeckleImage</font></center> |
| 568 | </td> |
| 569 | <td><font size="-1">void</font></td> |
| 570 | <td><font size="-1">Despeckle image (reduce speckle noise)</font></td> |
| 571 | </tr> |
| 572 | <tr> |
| 573 | <td rowspan="2"> |
| 574 | <center><a name="drawImage"></a> <font size="-1">drawImage</font></center> |
| 575 | </td> |
| 576 | <td><font size="-1">const <a href="Drawable.html">Drawable</a> |
| 577 | &drawable_</font></td> |
| 578 | <td><font size="-1">Draw shape or text on image.</font></td> |
| 579 | </tr> |
| 580 | <tr> |
| 581 | <td><font size="-1">const std::list<<a href="Drawable.html">Drawable</a> |
| 582 | > &drawable_</font></td> |
| 583 | <td><font size="-1">Draw shapes or text on image using a set of |
| 584 | Drawable objects contained in an STL list. Use of this method improves |
| 585 | drawing performance and allows batching draw objects together in a list |
| 586 | for repeated use.</font></td> |
| 587 | </tr> |
| 588 | <tr> |
| 589 | <td> |
| 590 | <center><a name="edgeImage"></a> <font size="-1">edgeImage</font></center> |
| 591 | </td> |
| 592 | <td><font size="-1">unsigned int radius_ = 0.0</font></td> |
| 593 | <td><font size="-1">Edge image (hilight edges in image). |
| 594 | The radius is the radius of the pixel neighborhood.. Specify a radius |
| 595 | of zero for automatic radius selection.</font></td> |
| 596 | </tr> |
| 597 | <tr> |
| 598 | <td> |
| 599 | <center><a name="embossImage"></a> <font size="-1">embossImage</font></center> |
| 600 | </td> |
| 601 | <td><font size="-1">const double radius_ = 1, const double sigma_ |
| 602 | = 0.5</font></td> |
| 603 | <td><font size="-1">Emboss image (hilight edges with 3D effect). |
| 604 | The radius_ parameter specifies the radius of the Gaussian, in pixels, |
| 605 | not counting the center pixel. The sigma_ parameter specifies the |
| 606 | standard deviation of the Laplacian, in pixels.</font></td> |
| 607 | </tr> |
| 608 | <tr> |
| 609 | <td> |
| 610 | <center><a name="enhanceImage"></a> <font size="-1">enhanceImage</font></center> |
| 611 | </td> |
| 612 | <td><font size="-1">void</font></td> |
| 613 | <td><font size="-1">Enhance image (minimize noise)</font></td> |
| 614 | </tr> |
| 615 | <tr> |
| 616 | <td> |
| 617 | <center><a name="equalizeImage"></a> <font size="-1">equalizeImage</font></center> |
| 618 | </td> |
| 619 | <td><font size="-1">void</font></td> |
| 620 | <td><font size="-1">Equalize image (histogram equalization)</font></td> |
| 621 | </tr> |
| 622 | <tr> |
| 623 | <td> |
| 624 | <center><a name="flipImage"></a> <font size="-1">flipImage</font></center> |
| 625 | </td> |
| 626 | <td><font size="-1">void</font></td> |
| 627 | <td><font size="-1">Flip image (reflect each scanline in the |
| 628 | vertical direction)</font></td> |
| 629 | </tr> |
| 630 | <tr> |
| 631 | <td rowspan="4"> |
| 632 | <center><a name="floodFillColorImage"></a> <font size="-1">floodFill-</font> <br> |
| 633 | <font size="-1">ColorImage</font></center> |
| 634 | </td> |
| 635 | <td><font size="-1">unsigned int x_, unsigned int y_, const <a |
| 636 | href="Color.html"> Color</a> &fillColor_</font></td> |
| 637 | <td rowspan="2"><font size="-1">Flood-fill color across pixels |
| 638 | that match the color of the target pixel and are neighbors of the |
| 639 | target pixel. Uses current fuzz setting when determining color match.</font></td> |
| 640 | </tr> |
| 641 | <tr> |
| 642 | <td><font size="-1">const <a href="Geometry.html">Geometry</a> |
| 643 | &point_, const <a href="Color.html">Color</a> &fillColor_</font></td> |
| 644 | </tr> |
| 645 | <tr> |
| 646 | <td><font size="-1">unsigned int x_, unsigned int y_, const <a |
| 647 | href="Color.html"> Color</a> &fillColor_, const <a href="Color.html">Color</a> |
| 648 | &borderColor_</font></td> |
| 649 | <td rowspan="2"><font size="-1">Flood-fill color across pixels |
| 650 | starting at target-pixel and stopping at pixels matching specified |
| 651 | border color. Uses current fuzz setting when determining color match.</font></td> |
| 652 | </tr> |
| 653 | <tr> |
| 654 | <td><font size="-1">const <a href="Geometry.html">Geometry</a> |
| 655 | &point_, const <a href="Color.html">Color</a> &fillColor_, const <a |
| 656 | href="Color.html">Color</a> &borderColor_</font></td> |
| 657 | </tr> |
| 658 | <tr> |
| 659 | <td rowspan="4"> |
| 660 | <center><a name="floodFillTextureImage"></a> <font size="-1">floodFill-</font> <br> |
| 661 | <font size="-1">TextureImage</font></center> |
| 662 | </td> |
| 663 | <td><font size="-1">unsigned int x_, unsigned int y_, const <a |
| 664 | href="Image.html"> Image</a> &texture_</font></td> |
| 665 | <td rowspan="2"><font size="-1">Flood-fill texture across pixels |
| 666 | that match the color of the target pixel and are neighbors of the |
| 667 | target pixel. Uses current fuzz setting when determining color match.</font></td> |
| 668 | </tr> |
| 669 | <tr> |
| 670 | <td><font size="-1">const <a href="Geometry.html">Geometry</a> |
| 671 | &point_, const Image &texture_</font></td> |
| 672 | </tr> |
| 673 | <tr> |
| 674 | <td><font size="-1">unsigned int x_, unsigned int y_, const Image |
| 675 | &texture_, const <a href="Color.html">Color</a> &borderColor_</font></td> |
| 676 | <td rowspan="2"><font size="-1">Flood-fill texture across pixels |
| 677 | starting at target-pixel and stopping at pixels matching specified |
| 678 | border color. Uses current fuzz setting when determining color match.</font></td> |
| 679 | </tr> |
| 680 | <tr> |
| 681 | <td><font size="-1">const <a href="Geometry.html">Geometry</a> |
| 682 | &point_, const Image &texture_, const <a href="Color.html">Color</a> |
| 683 | &borderColor_</font></td> |
| 684 | </tr> |
| 685 | <tr> |
| 686 | <td> |
| 687 | <center><a name="flopImage"></a> <font size="-1">flopImage</font></center> |
| 688 | </td> |
| 689 | <td><font size="-1">void </font></td> |
| 690 | <td><font size="-1">Flop image (reflect each scanline in the |
| 691 | horizontal direction)</font></td> |
| 692 | </tr> |
| 693 | <tr> |
| 694 | <td rowspan="2"> |
| 695 | <center><a name="frameImage"></a> <font size="-1">frameImage</font></center> |
| 696 | </td> |
| 697 | <td><font size="-1">const <a href="Geometry.html">Geometry</a> |
| 698 | &geometry_ = "25x25+6+6"</font></td> |
| 699 | <td rowspan="2"><font size="-1">Add decorative frame around image</font></td> |
| 700 | </tr> |
| 701 | <tr> |
| 702 | <td><font size="-1">unsigned int width_, unsigned int height_, |
| 703 | int x_, int y_, int innerBevel_ = 0, int outerBevel_ = 0</font></td> |
| 704 | </tr> |
| 705 | <tr> |
| 706 | <td rowspan="2"> |
| 707 | <center><a name="gammaImage"></a> <font size="-1">gammaImage</font></center> |
| 708 | </td> |
| 709 | <td><font size="-1">double gamma_</font></td> |
| 710 | <td><font size="-1">Gamma correct image (uniform red, green, and |
| 711 | blue correction).</font></td> |
| 712 | </tr> |
| 713 | <tr> |
| 714 | <td><font size="-1">double gammaRed_, double gammaGreen_, double |
| 715 | gammaBlue_</font></td> |
| 716 | <td><font size="-1">Gamma correct red, green, and blue channels |
| 717 | of image.</font></td> |
| 718 | </tr> |
| 719 | <tr> |
| 720 | <td> |
| 721 | <center><a name="gaussianBlur"></a> <font size="-1">gaussianBlurImage</font></center> |
| 722 | </td> |
| 723 | <td><font size="-1">double width_, double sigma_</font></td> |
| 724 | <td><font size="-1">Gaussian blur image. The number of neighbor |
| 725 | pixels to be included in the convolution mask is specified by |
| 726 | 'width_'. For example, a width of one gives a (standard) 3x3 |
| 727 | convolution mask. The standard deviation of the gaussian bell curve is |
| 728 | specified by 'sigma_'.</font></td> |
| 729 | </tr> |
| 730 | <tr> |
| 731 | <td> |
| 732 | <center><a name="implodeImage"></a> <font size="-1">implodeImage</font></center> |
| 733 | </td> |
| 734 | <td><font size="-1">double factor_</font></td> |
| 735 | <td><font size="-1">Implode image (special effect)</font></td> |
| 736 | </tr> |
| 737 | <tr> |
| 738 | <td> |
| 739 | <center><a name="labelImage"></a> <font size="-1">labelImage</font></center> |
| 740 | </td> |
| 741 | <td><font size="-1">const string &label_</font></td> |
| 742 | <td><font size="-1">Assign a label to an image. Use this option |
| 743 | to assign a specific label to the image. Optionally |
| 744 | you can include the image filename, type, width, height, or scene |
| 745 | number in the label by embedding <a href="FormatCharacters.html">special |
| 746 | format characters.</a> If the first character of string is @, the image |
| 747 | label is read from a file titled by the remaining characters in the |
| 748 | string. When converting to Postscript, use this option to specify |
| 749 | a header string to print above the image.</font></td> |
| 750 | </tr> |
| 751 | <tr> |
| 752 | <td style="text-align: center; vertical-align: middle;"><small><a |
| 753 | name="levelImage"></a>levelImage<br> |
| 754 | </small></td> |
| 755 | <td style="vertical-align: top;"><small>const double black_point, |
| 756 | const double white_point, const double mid_point=1.0<br> |
| 757 | </small></td> |
| 758 | <td style="vertical-align: top;"><small>Level image. Adjust the |
| 759 | levels of the image by scaling the colors falling between specified |
| 760 | white and black points to the full available quantum range. The |
| 761 | parameters provided represent the black, mid (gamma), and white |
| 762 | points. The black point specifies the darkest color in the image. |
| 763 | Colors darker than the black point are set to zero. Mid point (gamma) |
| 764 | specifies a gamma correction to apply to the image. White point |
| 765 | specifies the lightest color in the image. Colors brighter than |
| 766 | the white point are set to the maximum quantum value. The black and |
| 767 | white point have the valid range 0 to QuantumRange while mid (gamma) has a |
| 768 | useful range of 0 to ten.</small></td> |
| 769 | </tr> |
| 770 | <tr> |
| 771 | <td style="text-align: center; vertical-align: middle;"><small><a |
| 772 | name="levelChannelImage"></a>levelChannelImage<br> |
| 773 | </small></td> |
| 774 | <td style="vertical-align: top;"><small>const Magick::ChannelType |
| 775 | channel, const double black_point, const double white_point, const |
| 776 | double mid_point=1.0<br> |
| 777 | </small></td> |
| 778 | <td style="vertical-align: top;"><small>Level image channel. |
| 779 | Adjust the levels of the image channel by scaling the values falling |
| 780 | between specified white and black points to the full available quantum |
| 781 | range. The parameters provided represent the black, mid (gamma), and |
| 782 | white points. The black point specifies the darkest color in the image. |
| 783 | Colors darker than the black point are set to zero. Mid point (gamma) |
| 784 | specifies a gamma correction to apply to the image. White point |
| 785 | specifies the lightest color in the image. Colors brighter than the |
| 786 | white point are set to the maximum quantum value. The black and white |
| 787 | point have the valid range 0 to QuantumRange while mid (gamma) has a useful |
| 788 | range of 0 to ten.</small></td> |
| 789 | </tr> |
| 790 | <tr> |
| 791 | <td> |
| 792 | <center><a name="layerImage"></a> <font size="-1">layerImage</font></center> |
| 793 | </td> |
| 794 | <td><font size="-1"><a href="Enumerations.html#ChannelType">ChannelType</a> |
| 795 | layer_</font></td> |
| 796 | <td><font size="-1">Extract layer from image. Use this option to |
| 797 | extract a particular layer from the image. <i>MatteLayer</i>, |
| 798 | for example, is useful for extracting the opacity values from an |
| 799 | image.</font></td> |
| 800 | </tr> |
| 801 | <tr> |
| 802 | <td> |
| 803 | <center><a name="magnifyImage"></a> <font size="-1">magnifyImage</font></center> |
| 804 | </td> |
| 805 | <td><font size="-1">void</font></td> |
| 806 | <td><font size="-1">Magnify image by integral size</font></td> |
| 807 | </tr> |
| 808 | <tr> |
| 809 | <td> |
| 810 | <center><a name="mapImage"></a> <font size="-1">mapImage</font></center> |
| 811 | </td> |
| 812 | <td><font size="-1">const <a href="Image.html">Image</a> |
| 813 | &mapImage_ , bool dither_ = false</font></td> |
| 814 | <td><font size="-1">Remap image colors with closest color from |
| 815 | reference image. Set dither_ to <i>true</i> in to apply Floyd/Steinberg |
| 816 | error diffusion to the image. By default, color reduction chooses an |
| 817 | optimal set of colors that best represent the original |
| 818 | image. Alternatively, you can choose a |
| 819 | particular set of colors from an image file |
| 820 | with this option.</font></td> |
| 821 | </tr> |
| 822 | <tr> |
| 823 | <td> |
| 824 | <center><a name="matteFloodfillImage"></a> <font size="-1">matteFloodfill-</font> <br> |
| 825 | <font size="-1">Image</font></center> |
| 826 | </td> |
| 827 | <td><font size="-1">const <a href="Color.html">Color</a> |
| 828 | &target_, unsigned int matte_, int x_, int y_, <a |
| 829 | href="Enumerations.html#PaintMethod"> PaintMethod</a> method_</font></td> |
| 830 | <td><font size="-1">Floodfill designated area with a matte value</font></td> |
| 831 | </tr> |
| 832 | <tr> |
| 833 | <td><a name="medianFilterImage"></a> <font size="-1">medianFilterImage</font></td> |
| 834 | <td><font size="-1">const double radius_ = 0.0</font></td> |
| 835 | <td><font size="-1">Filter image by replacing each pixel |
| 836 | component with the median color in a circular neighborhood</font></td> |
| 837 | </tr> |
| 838 | <tr> |
| 839 | <td> |
| 840 | <center><a name="minifyImage"></a> <font size="-1">minifyImage</font></center> |
| 841 | </td> |
| 842 | <td><font size="-1">void</font></td> |
| 843 | <td><font size="-1">Reduce image by integral size</font></td> |
| 844 | </tr> |
| 845 | <tr> |
| 846 | <td> |
| 847 | <center><a name="modulateImage"></a> <font size="-1">modulateImage</font></center> |
| 848 | </td> |
| 849 | <td><font size="-1">double brightness_, double saturation_, |
| 850 | double hue_</font></td> |
| 851 | <td><font size="-1">Modulate percent hue, saturation, and |
| 852 | brightness of an image. </font><font size="-1">Modulation of |
| 853 | saturation and brightness is as a ratio of the current value (1.0 for no |
| 854 | change). Modulation of hue is an absolute rotation of -180 degrees to |
| 855 | +180 degrees from the current position corresponding to an argument |
| 856 | range of 0 to 2.0 (1.0 for no change).</font></td> |
| 857 | </tr> |
| 858 | <tr> |
| 859 | <td> |
| 860 | <center><a name="negateImage"></a> <font size="-1">negateImage</font></center> |
| 861 | </td> |
| 862 | <td><font size="-1">bool grayscale_ = false</font></td> |
| 863 | <td><font size="-1">Negate colors in image. Replace every |
| 864 | pixel with its complementary color (white becomes black, yellow becomes |
| 865 | blue, etc.). Set grayscale to only negate grayscale values in |
| 866 | image.</font></td> |
| 867 | </tr> |
| 868 | <tr> |
| 869 | <td> |
| 870 | <center><a name="normalizeImage"></a> <font size="-1">normalizeImage</font></center> |
| 871 | </td> |
| 872 | <td><font size="-1">void</font></td> |
| 873 | <td><font size="-1">Normalize image (increase contrast by |
| 874 | normalizing the pixel values to span the full range of color values).</font></td> |
| 875 | </tr> |
| 876 | <tr> |
| 877 | <td> |
| 878 | <center><a name="oilPaintImage"></a> <font size="-1">oilPaintImage</font></center> |
| 879 | </td> |
| 880 | <td><font size="-1">unsigned int radius_ = 3</font></td> |
| 881 | <td><font size="-1">Oilpaint image (image looks like oil painting)</font></td> |
| 882 | </tr> |
| 883 | <tr> |
| 884 | <td> |
| 885 | <center><a name="opacityImage"></a> <font size="-1">opacityImage</font></center> |
| 886 | </td> |
| 887 | <td><font size="-1">unsigned int opacity_</font></td> |
| 888 | <td><font size="-1">Set or attenuate the opacity channel in the |
| 889 | image. If the image pixels are opaque then they are set to the specified |
| 890 | opacity value, otherwise they are blended with the supplied opacity |
| 891 | value. The value of opacity_ ranges from 0 (completely opaque) to <i>QuantumRange</i>. |
| 892 | The defines <i>OpaqueOpacity</i> and <i>TransparentOpacity</i> are |
| 893 | available to specify completely opaque or completely transparent, |
| 894 | respectively.</font></td> |
| 895 | </tr> |
| 896 | <tr> |
| 897 | <td> |
| 898 | <center><a name="opaqueImage"></a> <font size="-1">opaqueImage</font></center> |
| 899 | </td> |
| 900 | <td><font size="-1">const <a href="Color.html">Color</a> |
| 901 | &opaqueColor_, const <a href="Color.html">Color</a> &penColor_</font></td> |
| 902 | <td><font size="-1">Change color of pixels matching opaqueColor_ |
| 903 | to specified penColor_.</font></td> |
| 904 | </tr> |
| 905 | <tr> |
| 906 | <td> |
| 907 | <center><a name="quantizeImage"></a> <font size="-1">quantizeImage</font></center> |
| 908 | </td> |
| 909 | <td><font size="-1">bool measureError_ = false</font></td> |
| 910 | <td><font size="-1">Quantize image (reduce number of colors). Set |
| 911 | measureError_ to true in order to calculate error attributes.</font></td> |
| 912 | </tr> |
| 913 | <tr> |
| 914 | <td> |
| 915 | <center><a name="raiseImage"></a> <font size="-1">raiseImage</font></center> |
| 916 | </td> |
| 917 | <td><font size="-1">const <a href="Geometry.html">Geometry</a> |
| 918 | &geometry_ = "6x6+0+0", bool raisedFlag_ = false</font></td> |
| 919 | <td><font size="-1">Raise image (lighten or darken the edges of |
| 920 | an image to give a 3-D raised or lowered effect)</font></td> |
| 921 | </tr> |
| 922 | <tr> |
| 923 | <td rowspan="2"> |
| 924 | <center><a name="reduceNoiseImage"></a> <font size="-1">reduceNoise-</font> <br> |
| 925 | <font size="-1">Image</font></center> |
| 926 | </td> |
| 927 | <td><font size="-1">void</font></td> |
| 928 | <td rowspan="2"><font size="-1">Reduce noise in image using a |
| 929 | noise peak elimination filter.</font></td> |
| 930 | </tr> |
| 931 | <tr> |
| 932 | <td><font size="-1">unsigned int order_</font></td> |
| 933 | </tr> |
| 934 | <tr> |
| 935 | <td> |
| 936 | <center><a name="rollImage"></a> <font size="-1">rollImage</font></center> |
| 937 | </td> |
| 938 | <td><font size="-1">int columns_, int rows_</font></td> |
| 939 | <td><font size="-1">Roll image (rolls image vertically and |
| 940 | horizontally) by specified number of columnms and rows)</font></td> |
| 941 | </tr> |
| 942 | <tr> |
| 943 | <td> |
| 944 | <center><a name="rotateImage"></a> <font size="-1">rotateImage</font></center> |
| 945 | </td> |
| 946 | <td><font size="-1">double degrees_</font></td> |
| 947 | <td><font size="-1">Rotate image counter-clockwise by specified |
| 948 | number of degrees</font></td> |
| 949 | </tr> |
| 950 | <tr> |
| 951 | <td> |
| 952 | <center><a name="sampleImage"></a> <font size="-1">sampleImage</font></center> |
| 953 | </td> |
| 954 | <td><font size="-1">const <a href="Geometry.html">Geometry</a> |
| 955 | &geometry_ </font></td> |
| 956 | <td><font size="-1">Resize image by using pixel sampling algorithm</font></td> |
| 957 | </tr> |
| 958 | <tr> |
| 959 | <td> |
| 960 | <center><a name="scaleImage"></a> <font size="-1">scaleImage</font></center> |
| 961 | </td> |
| 962 | <td><font size="-1">const <a href="Geometry.html">Geometry</a> |
| 963 | &geometry_</font></td> |
| 964 | <td><font size="-1">Resize image by using simple ratio algorithm</font></td> |
| 965 | </tr> |
| 966 | <tr> |
| 967 | <td> |
| 968 | <center><a name="segmentImage"></a> <font size="-1">segmentImage</font></center> |
| 969 | </td> |
| 970 | <td><font size="-1">double clusterThreshold_ = 1.0,</font> <br> |
| 971 | <font size="-1">double smoothingThreshold_ = 1.5</font></td> |
| 972 | <td><font size="-1">Segment (coalesce similar image components) |
| 973 | by analyzing the histograms of the color components and identifying |
| 974 | units that are homogeneous with the fuzzy c-means technique. Also uses <i>quantizeColorSpace</i> |
| 975 | and <i>verbose</i> image attributes. Specify <i>clusterThreshold_</i> , |
| 976 | as the number of pixels each cluster must exceed |
| 977 | the cluster threshold to be considered valid. <i>SmoothingThreshold_</i> |
| 978 | eliminates noise in the second derivative of the histogram. As the |
| 979 | value is increased, you can expect a smoother |
| 980 | second derivative. The default is 1.5.</font></td> |
| 981 | </tr> |
| 982 | <tr> |
| 983 | <td> |
| 984 | <center><a name="shadeImage"></a> <font size="-1">shadeImage</font></center> |
| 985 | </td> |
| 986 | <td><font size="-1">double azimuth_ = 30, double elevation_ = 30,</font> <br> |
| 987 | <font size="-1">bool colorShading_ = false</font></td> |
| 988 | <td><font size="-1">Shade image using distant light source. |
| 989 | Specify <i> azimuth_</i> and <i>elevation_</i> as the |
| 990 | position of the light source. By default, the shading |
| 991 | results as a grayscale image.. Set c<i>olorShading_</i> to <i>true</i> to |
| 992 | shade the red, green, and blue components of the image.</font></td> |
| 993 | </tr> |
| 994 | <tr> |
| 995 | <td> |
| 996 | <center><a name="sharpenImage"></a> <font size="-1">sharpenImage</font></center> |
| 997 | </td> |
| 998 | <td><font size="-1">const double radius_ = 1, const double sigma_ |
| 999 | = 0.5</font></td> |
| 1000 | <td><font size="-1">Sharpen pixels in image. The radius_ |
| 1001 | parameter specifies the radius of the Gaussian, in pixels, not counting |
| 1002 | the center pixel. The sigma_ parameter specifies the standard |
| 1003 | deviation of the Laplacian, in pixels.</font></td> |
| 1004 | </tr> |
| 1005 | <tr> |
| 1006 | <td> |
| 1007 | <center><a name="shaveImage"></a> <font size="-1">shaveImage</font></center> |
| 1008 | </td> |
| 1009 | <td><font size="-1">const <a href="Geometry.html">Geometry</a> |
| 1010 | &geometry_</font></td> |
| 1011 | <td><font size="-1">Shave pixels from image edges.</font></td> |
| 1012 | </tr> |
| 1013 | <tr> |
| 1014 | <td> |
| 1015 | <center><a name="shearImage"></a> <font size="-1">shearImage</font></center> |
| 1016 | </td> |
| 1017 | <td><font size="-1">double xShearAngle_, double yShearAngle_</font></td> |
| 1018 | <td><font size="-1">Shear image (create parallelogram by sliding |
| 1019 | image by X or Y axis). Shearing slides one edge of an image along |
| 1020 | the X or Y axis, creating a |
| 1021 | parallelogram. An X direction shear slides an edge along the X |
| 1022 | axis, while a Y direction shear slides an |
| 1023 | edge along the Y axis. The amount of the shear is controlled by a |
| 1024 | shear angle. For X direction shears, x degrees |
| 1025 | is measured relative to the Y axis, and similarly, for Y direction |
| 1026 | shears y degrees is measured relative to the X axis. Empty |
| 1027 | triangles left over from shearing the image are filled |
| 1028 | with the color defined as <i>borderColor</i>. </font></td> |
| 1029 | </tr> |
| 1030 | <tr> |
| 1031 | <td> |
| 1032 | <center><a name="solarizeImage"></a> <font size="-1">solarizeImage</font></center> |
| 1033 | </td> |
| 1034 | <td><font size="-1">double factor_</font></td> |
| 1035 | <td><font size="-1">Solarize image (similar to effect seen when |
| 1036 | exposing a photographic film to light during the development process)</font></td> |
| 1037 | </tr> |
| 1038 | <tr> |
| 1039 | <td> |
| 1040 | <center><a name="spreadImage"></a> <font size="-1">spreadImage</font></center> |
| 1041 | </td> |
| 1042 | <td><font size="-1">unsigned int amount_ = 3</font></td> |
| 1043 | <td><font size="-1">Spread pixels randomly within image by |
| 1044 | specified amount</font></td> |
| 1045 | </tr> |
| 1046 | <tr> |
| 1047 | <td> |
| 1048 | <center><a name="steganoImage"></a> <font size="-1">steganoImage</font></center> |
| 1049 | </td> |
| 1050 | <td><font size="-1">const <a href="Image.html">Image</a> |
| 1051 | &watermark_</font></td> |
| 1052 | <td><font size="-1">Add a digital watermark to the image (based |
| 1053 | on second image)</font></td> |
| 1054 | </tr> |
| 1055 | <tr> |
| 1056 | <td> |
| 1057 | <center><a name="stereoImage"></a> <font size="-1">stereoImage</font></center> |
| 1058 | </td> |
| 1059 | <td><font size="-1">const <a href="Image.html">Image</a> |
| 1060 | &rightImage_</font></td> |
| 1061 | <td><font size="-1">Create an image which appears in stereo when |
| 1062 | viewed with red-blue glasses (Red image on left, blue on right)</font></td> |
| 1063 | </tr> |
| 1064 | <tr> |
| 1065 | <td> |
| 1066 | <center><a name="swirlImage"></a> <font size="-1">swirlImage</font></center> |
| 1067 | </td> |
| 1068 | <td><font size="-1">double degrees_</font></td> |
| 1069 | <td><font size="-1">Swirl image (image pixels are rotated by |
| 1070 | degrees)</font></td> |
| 1071 | </tr> |
| 1072 | <tr> |
| 1073 | <td> |
| 1074 | <center><a name="textureImage"></a> <font size="-1">textureImage</font></center> |
| 1075 | </td> |
| 1076 | <td><font size="-1">const <a href="Image.html">Image</a> |
| 1077 | &texture_</font></td> |
| 1078 | <td><font size="-1">Layer a texture on image background</font></td> |
| 1079 | </tr> |
| 1080 | <tr> |
| 1081 | <td> |
| 1082 | <center><a name="thresholdImage"></a> <font size="-1">thresholdImage</font></center> |
| 1083 | </td> |
| 1084 | <td><font size="-1">double threshold_</font></td> |
| 1085 | <td><font size="-1">Threshold image</font></td> |
| 1086 | </tr> |
| 1087 | <tr> |
| 1088 | <td rowspan="2"> |
| 1089 | <center><a name="transformImage"></a> <font size="-1">transformImage</font></center> |
| 1090 | </td> |
| 1091 | <td><font size="-1">const <a href="Geometry.html">Geometry</a> |
| 1092 | &imageGeometry_</font></td> |
| 1093 | <td rowspan="2"><font size="-1">Transform image based on image |
| 1094 | and crop geometries. Crop geometry is optional.</font></td> |
| 1095 | </tr> |
| 1096 | <tr> |
| 1097 | <td><font size="-1">const <a href="Geometry.html">Geometry</a> |
| 1098 | &imageGeometry_, const <a href="Geometry.html">Geometry</a> |
| 1099 | &cropGeometry_ </font></td> |
| 1100 | </tr> |
| 1101 | <tr> |
| 1102 | <td> |
| 1103 | <center><a name="transparentImage"></a> <font size="-1">transparentImage</font></center> |
| 1104 | </td> |
| 1105 | <td><font size="-1">const <a href="Color.html">Color</a> |
| 1106 | &color_</font></td> |
| 1107 | <td><font size="-1">Add matte image to image, setting pixels |
| 1108 | matching color to transparent.</font></td> |
| 1109 | </tr> |
| 1110 | <tr> |
| 1111 | <td> |
| 1112 | <center><a name="trimImage"></a> <font size="-1">trimImage</font></center> |
| 1113 | </td> |
| 1114 | <td><font size="-1">void</font></td> |
| 1115 | <td><font size="-1">Trim edges that are the background color from |
| 1116 | the image.</font></td> |
| 1117 | </tr> |
| 1118 | <tr> |
| 1119 | <td> |
| 1120 | <center><a name="waveImage"></a> <font size="-1">waveImage</font></center> |
| 1121 | </td> |
| 1122 | <td><font size="-1">double amplitude_ = 25.0, double wavelength_ |
| 1123 | = 150.0</font></td> |
| 1124 | <td><font size="-1">Alter an image along a sine wave.</font></td> |
| 1125 | </tr> |
| 1126 | <tr> |
| 1127 | <td> |
| 1128 | <center><a name="zoomImage"></a> <font size="-1">zoomImage</font></center> |
| 1129 | </td> |
| 1130 | <td><font size="-1">const <a href="Geometry.html">Geometry</a> |
| 1131 | &geometry_</font></td> |
| 1132 | <td><font size="-1">Zoom image to specified size.</font></td> |
| 1133 | </tr> |
| 1134 | </tbody> |
| 1135 | </table> |
| 1136 | </p> |
| 1137 | <p>Function objects are available to set attributes on image frames |
| 1138 | which are equivalent to methods in the Image object. These function |
| 1139 | objects allow setting an option across a range of image frames using f<tt> |
| 1140 | or_each()</tt>. </p> |
| 1141 | <p>The following code is an example of how the color 'red' may be set |
| 1142 | to transparent in a GIF animation: </p> |
| 1143 | <p><tt><font color="#000066">list<image> images;</font></tt> <br> |
| 1144 | <tt><font color="#000066">readImages( &images, "animation.gif" );</font></tt> <br> |
| 1145 | <tt><font color="#000066">for_each ( images.begin(), images.end(), |
| 1146 | transparentImage( "red" ) );</font></tt> <br> |
| 1147 | <tt><font color="#000066">writeImages( images.begin(), images.end(), |
| 1148 | "animation.gif" );</font></tt> </p> |
| 1149 | <p>The available function objects for setting image attributes are <br> |
| 1150 | |
| 1151 | <table border="1"> |
| 1152 | <caption style="font-weight: bold;">Image Attributes</caption> <tbody> |
| 1153 | <tr> |
| 1154 | <td> |
| 1155 | <center><b>Attribute</b></center> |
| 1156 | </td> |
| 1157 | <td> |
| 1158 | <center><b>Type</b></center> |
| 1159 | </td> |
| 1160 | <td> |
| 1161 | <center><b>Constructor Signature(s)</b></center> |
| 1162 | </td> |
| 1163 | <td> |
| 1164 | <center><b>Description</b></center> |
| 1165 | </td> |
| 1166 | </tr> |
| 1167 | <tr> |
| 1168 | <td> |
| 1169 | <center><a name="adjoinImage"></a> <font size="-1">adjoinImage</font></center> |
| 1170 | </td> |
| 1171 | <td><font size="-1">bool</font></td> |
| 1172 | <td><font size="-1">bool flag_</font></td> |
| 1173 | <td><font size="-1">Join images into a single multi-image file.</font></td> |
| 1174 | </tr> |
| 1175 | <tr> |
| 1176 | <td> |
| 1177 | <center><a name="antiAlias"></a> <font size="-1">antiAliasImage</font></center> |
| 1178 | </td> |
| 1179 | <td><font size="-1">bool</font></td> |
| 1180 | <td><font size="-1">bool flag_</font></td> |
| 1181 | <td><font size="-1">Control antialiasing of rendered Postscript |
| 1182 | and Postscript or TrueType fonts. Enabled by default.</font></td> |
| 1183 | </tr> |
| 1184 | <tr> |
| 1185 | <td> |
| 1186 | <center><a name="animationDelay"></a> <font size="-1">animation-</font> <br> |
| 1187 | <font size="-1">DelayImage</font></center> |
| 1188 | </td> |
| 1189 | <td><font size="-1">unsigned int (0 to 65535)</font></td> |
| 1190 | <td><font size="-1">unsigned int delay_</font></td> |
| 1191 | <td><font size="-1">Time in 1/100ths of a second (0 to 65535) |
| 1192 | which must expire before displaying the next image in an animated |
| 1193 | sequence. This option is useful for regulating the animation of a |
| 1194 | sequence of GIF images within Netscape.</font></td> |
| 1195 | </tr> |
| 1196 | <tr> |
| 1197 | <td> |
| 1198 | <center><a name="animationIterations"></a> <font size="-1">animation-</font> <br> |
| 1199 | <font size="-1">IterationsImage</font></center> |
| 1200 | </td> |
| 1201 | <td><font size="-1">unsigned int</font></td> |
| 1202 | <td><font size="-1">unsigned int iterations_</font></td> |
| 1203 | <td><font size="-1">Number of iterations to loop an animation |
| 1204 | (e.g. Netscape loop extension) for.</font></td> |
| 1205 | </tr> |
| 1206 | <tr> |
| 1207 | <td> |
| 1208 | <center><a name="backgroundColor"></a> <font size="-1">background-</font> <br> |
| 1209 | <font size="-1">ColorImage</font></center> |
| 1210 | </td> |
| 1211 | <td><font size="-1"><a href="Color.html">Color</a> </font></td> |
| 1212 | <td><font size="-1">const <a href="Color.html">Color</a> |
| 1213 | &color_</font></td> |
| 1214 | <td><font size="-1">Image background color</font></td> |
| 1215 | </tr> |
| 1216 | <tr> |
| 1217 | <td> |
| 1218 | <center><a name="backgroundTexture"></a> <font size="-1">background-</font> <br> |
| 1219 | <font size="-1">TextureImage</font></center> |
| 1220 | </td> |
| 1221 | <td><font size="-1">std::string</font></td> |
| 1222 | <td><font size="-1">const string &texture_</font></td> |
| 1223 | <td><font size="-1">Image to use as background texture.</font></td> |
| 1224 | </tr> |
| 1225 | <tr> |
| 1226 | <td> |
| 1227 | <center><a name="borderColor"></a> <font size="-1">borderColor-</font> <br> |
| 1228 | <font size="-1">Image</font></center> |
| 1229 | </td> |
| 1230 | <td><font size="-1"><a href="Color.html">Color</a> </font></td> |
| 1231 | <td><font size="-1"> const <a href="Color.html">Color</a> |
| 1232 | &color_</font></td> |
| 1233 | <td><font size="-1">Image border color</font></td> |
| 1234 | </tr> |
| 1235 | <tr> |
| 1236 | <td> |
| 1237 | <center><a name="boxColor"></a> <font size="-1">boxColorImage</font></center> |
| 1238 | </td> |
| 1239 | <td><font size="-1"><a href="Color.html">Color</a> </font></td> |
| 1240 | <td><font size="-1">const <a href="Color.html">Color</a> |
| 1241 | &boxColor_</font></td> |
| 1242 | <td><font size="-1">Base color that annotation text is rendered |
| 1243 | on.</font></td> |
| 1244 | </tr> |
| 1245 | <tr> |
| 1246 | <td> |
| 1247 | <center><a name="chromaBluePrimary"></a> <font size="-1">chroma-</font> <br> |
| 1248 | <font size="-1">BluePrimaryImage</font></center> |
| 1249 | </td> |
| 1250 | <td><font size="-1">double x & y</font></td> |
| 1251 | <td><font size="-1">double x_, double y_</font></td> |
| 1252 | <td><font size="-1">Chromaticity blue primary point (e.g. x=0.15, |
| 1253 | y=0.06)</font></td> |
| 1254 | </tr> |
| 1255 | <tr> |
| 1256 | <td> |
| 1257 | <center><a name="chromaGreenPrimary"></a> <font size="-1">chroma-</font> <br> |
| 1258 | <font size="-1">GreenPrimaryImage</font></center> |
| 1259 | </td> |
| 1260 | <td><font size="-1">double x & y</font></td> |
| 1261 | <td><font size="-1">double x_, double y_</font></td> |
| 1262 | <td><font size="-1">Chromaticity green primary point (e.g. x=0.3, |
| 1263 | y=0.6)</font></td> |
| 1264 | </tr> |
| 1265 | <tr> |
| 1266 | <td> |
| 1267 | <center><a name="chromaRedPrimary"></a> <font size="-1">chroma-</font> <br> |
| 1268 | <font size="-1">RedPrimaryImage</font></center> |
| 1269 | </td> |
| 1270 | <td><font size="-1">double x & y</font></td> |
| 1271 | <td><font size="-1">double x_, double y_</font></td> |
| 1272 | <td><font size="-1">Chromaticity red primary point (e.g. x=0.64, |
| 1273 | y=0.33)</font></td> |
| 1274 | </tr> |
| 1275 | <tr> |
| 1276 | <td> |
| 1277 | <center><a name="chromaWhitePoint"></a> <font size="-1">chroma-</font> <br> |
| 1278 | <font size="-1">WhitePointImage</font></center> |
| 1279 | </td> |
| 1280 | <td><font size="-1">double x & y</font></td> |
| 1281 | <td><font size="-1">double x_, double y_</font></td> |
| 1282 | <td><font size="-1">Chromaticity white point (e.g. x=0.3127, |
| 1283 | y=0.329)</font></td> |
| 1284 | </tr> |
| 1285 | <tr> |
| 1286 | <td> |
| 1287 | <center><a name="colorFuzz"></a> <font size="-1">colorFuzzImage</font></center> |
| 1288 | </td> |
| 1289 | <td><font size="-1">double</font></td> |
| 1290 | <td><font size="-1">double fuzz_</font></td> |
| 1291 | <td><font size="-1">Colors within this distance are considered |
| 1292 | equal. A number of algorithms search for a target color. By |
| 1293 | default the color must be exact. Use this option to match colors that |
| 1294 | are close to the target color in RGB space.</font></td> |
| 1295 | </tr> |
| 1296 | <tr> |
| 1297 | <td> |
| 1298 | <center><a name="colorMap"></a> <font size="-1">colorMapImage</font></center> |
| 1299 | </td> |
| 1300 | <td><font size="-1"><a href="Color.html">Color</a> </font></td> |
| 1301 | <td><font size="-1">unsigned int index_, const <a |
| 1302 | href="Color.html">Color</a> &color_</font></td> |
| 1303 | <td><font size="-1">Color at color-pallet index.</font></td> |
| 1304 | </tr> |
| 1305 | <tr> |
| 1306 | <td><a name="colorSpaceImage"></a> <font size="-1">colorSpaceImage</font></td> |
| 1307 | <td><font size="-1"><a href="Enumerations.html#ColorspaceType">ColorspaceType</a> </font></td> |
| 1308 | <td><font size="-1"><a href="Enumerations.html#ColorspaceType">ColorspaceType</a> |
| 1309 | colorSpace_</font></td> |
| 1310 | <td><font size="-1">The colorspace (e.g. CMYK) used to represent |
| 1311 | the image pixel colors. Image pixels are always stored as RGB(A) except |
| 1312 | for the case of CMY(K).</font></td> |
| 1313 | </tr> |
| 1314 | <tr> |
| 1315 | <td> |
| 1316 | <center><a name="composeImage"></a> <font size="-1">composeImage</font></center> |
| 1317 | </td> |
| 1318 | <td><font size="-1"><a href="Enumerations.html#CompositeOperator">CompositeOperator</a> </font></td> |
| 1319 | <td><font size="-1"><a href="Enumerations.html#CompositeOperator">CompositeOperator</a> |
| 1320 | compose_</font></td> |
| 1321 | <td><font size="-1">Composition operator to be used when |
| 1322 | composition is implicitly used (such as for image flattening).</font></td> |
| 1323 | </tr> |
| 1324 | <tr> |
| 1325 | <td> |
| 1326 | <center><a name="compressType"></a> <font size="-1">compressType-</font> <br> |
| 1327 | <font size="-1">Image</font></center> |
| 1328 | </td> |
| 1329 | <td><font size="-1"><a href="Enumerations.html#CompressionType">CompressionType</a> </font></td> |
| 1330 | <td><font size="-1"><a href="Enumerations.html#CompressionType">CompressionType</a> |
| 1331 | compressType_</font></td> |
| 1332 | <td><font size="-1">Image compresion type. The default is the |
| 1333 | compression type of the specified image file.</font></td> |
| 1334 | </tr> |
| 1335 | <tr> |
| 1336 | <td> |
| 1337 | <center><a name="density"></a> <font size="-1">densityImage</font></center> |
| 1338 | </td> |
| 1339 | <td><font size="-1"><a href="Geometry.html">Geometry</a> |
| 1340 | (default 72x72)</font></td> |
| 1341 | <td><font size="-1">const <a href="Geometry.html">Geometry</a> |
| 1342 | &density_</font></td> |
| 1343 | <td><font size="-1">Vertical and horizontal resolution in pixels |
| 1344 | of the image. This option specifies an image density when decoding a |
| 1345 | Postscript or Portable Document page. Often used with <i>psPageSize</i>.</font></td> |
| 1346 | </tr> |
| 1347 | <tr> |
| 1348 | <td> |
| 1349 | <center><a name="depth"></a> <font size="-1">depthImage</font></center> |
| 1350 | </td> |
| 1351 | <td><font size="-1">unsigned int (8 or 16)</font></td> |
| 1352 | <td><font size="-1">unsigned int depth_</font></td> |
| 1353 | <td><font size="-1">Image depth. Used to specify the bit depth |
| 1354 | when reading or writing raw images or thwn the output format |
| 1355 | supports multiple depths. Defaults to the quantum depth that |
| 1356 | ImageMagick is compiled with.</font></td> |
| 1357 | </tr> |
| 1358 | <tr> |
| 1359 | <td> |
| 1360 | <center><a name="endianImage"></a> <font size="-1">endianImage</font></center> |
| 1361 | </td> |
| 1362 | <td><font size="-1"><a href="Enumerations.html#EndianType">EndianType</a> </font></td> |
| 1363 | <td><font size="-1"><a href="Enumerations.html#EndianType">EndianType</a> |
| 1364 | endian_</font></td> |
| 1365 | <td><font size="-1">Specify (or obtain) endian option for formats |
| 1366 | which support it.</font></td> |
| 1367 | </tr> |
| 1368 | <tr> |
| 1369 | <td> |
| 1370 | <center><a name="fileName"></a> <font size="-1">fileNameImage</font></center> |
| 1371 | </td> |
| 1372 | <td><font size="-1">std::string</font></td> |
| 1373 | <td><font size="-1">const std::string &fileName_</font></td> |
| 1374 | <td><font size="-1">Image file name.</font></td> |
| 1375 | </tr> |
| 1376 | <tr> |
| 1377 | <td> |
| 1378 | <center><a name="fillColorImage"></a> <font size="-1">fillColorImage</font></center> |
| 1379 | </td> |
| 1380 | <td><font size="-1">Color</font></td> |
| 1381 | <td><font size="-1">const Color &fillColor_</font></td> |
| 1382 | <td><font size="-1">Color to use when filling drawn objects</font></td> |
| 1383 | </tr> |
| 1384 | <tr> |
| 1385 | <td> |
| 1386 | <center><a name="filterType"></a> <font size="-1">filterTypeImage</font></center> |
| 1387 | </td> |
| 1388 | <td><font size="-1"><a href="Enumerations.html#FilterTypes">FilterTypes</a> </font></td> |
| 1389 | <td><font size="-1"><a href="Enumerations.html#FilterTypes">FilterTypes</a> |
| 1390 | filterType_</font></td> |
| 1391 | <td><font size="-1">Filter to use when resizing image. The |
| 1392 | reduction filter employed has a sigificant effect on the time required |
| 1393 | to resize an image and the resulting quality. The default filter is <i>Lanczos</i> |
| 1394 | which has been shown to produce good results when reducing images.</font></td> |
| 1395 | </tr> |
| 1396 | <tr> |
| 1397 | <td> |
| 1398 | <center><a name="font"></a> <font size="-1">fontImage</font></center> |
| 1399 | </td> |
| 1400 | <td><font size="-1">std::string</font></td> |
| 1401 | <td><font size="-1">const std::string &font_</font></td> |
| 1402 | <td><font size="-1">Text rendering font. If the font is a fully |
| 1403 | qualified X server font name, the font is obtained from an X |
| 1404 | server. To use a TrueType font, precede the TrueType filename with an @. |
| 1405 | Otherwise, specify a Postscript font name (e.g. |
| 1406 | "helvetica").</font></td> |
| 1407 | </tr> |
| 1408 | <tr> |
| 1409 | <td> |
| 1410 | <center><a name="fontPointsize"></a> <font size="-1">fontPointsize-</font> <br> |
| 1411 | <font size="-1">Image</font></center> |
| 1412 | </td> |
| 1413 | <td><font size="-1">unsigned int</font></td> |
| 1414 | <td><font size="-1">unsigned int pointSize_</font></td> |
| 1415 | <td><font size="-1">Text rendering font point size</font></td> |
| 1416 | </tr> |
| 1417 | <tr> |
| 1418 | <td> |
| 1419 | <center><a name="gifDisposeMethod"></a> <font size="-1">gifDispose-</font> <br> |
| 1420 | <font size="-1">MethodImage</font></center> |
| 1421 | </td> |
| 1422 | <td><font size="-1">unsigned int</font> <br> |
| 1423 | <font size="-1">{ 0 = Disposal not specified,</font> <br> |
| 1424 | <font size="-1">1 = Do not dispose of graphic,</font> <br> |
| 1425 | <font size="-1">3 = Overwrite graphic with background color,</font> <br> |
| 1426 | <font size="-1">4 = Overwrite graphic with previous graphic. }</font></td> |
| 1427 | <td><font size="-1">unsigned int disposeMethod_</font></td> |
| 1428 | <td><font size="-1">GIF disposal method. This option is used to |
| 1429 | control how successive frames are rendered (how the preceding frame is |
| 1430 | disposed of) when creating a GIF animation.</font></td> |
| 1431 | </tr> |
| 1432 | <tr> |
| 1433 | <td> |
| 1434 | <center><a name="interlaceType"></a> <font size="-1">interlace-</font> <br> |
| 1435 | <font size="-1">TypeImage</font></center> |
| 1436 | </td> |
| 1437 | <td><font size="-1"><a href="Enumerations.html#InterlaceType">InterlaceType</a> </font></td> |
| 1438 | <td><font size="-1"><a href="Enumerations.html#InterlaceType">InterlaceType</a> |
| 1439 | interlace_</font></td> |
| 1440 | <td><font size="-1">The type of interlacing scheme (default <i>NoInterlace</i> |
| 1441 | ). This option is used to specify the type of interlacing |
| 1442 | scheme for raw image formats such as RGB or YUV. <i>NoInterlace</i> |
| 1443 | means do not interlace, <i>LineInterlace</i> uses scanline |
| 1444 | interlacing, and <i>PlaneInterlace</i> uses plane interlacing. <i> |
| 1445 | PartitionInterlace</i> is like <i>PlaneInterlace</i> except the |
| 1446 | different planes are saved to individual files (e.g. |
| 1447 | image.R, image.G, and image.B). Use <i>LineInterlace</i> or <i>PlaneInterlace</i> |
| 1448 | to create an interlaced GIF or progressive JPEG image.</font></td> |
| 1449 | </tr> |
| 1450 | <tr> |
| 1451 | <td> |
| 1452 | <center><a name="isValidImage"></a> <font size="-1">isValidImage</font></center> |
| 1453 | </td> |
| 1454 | <td><font size="-1">bool</font></td> |
| 1455 | <td><font size="-1">bool isValid_</font></td> |
| 1456 | <td><font size="-1">Set image validity. Valid images become empty |
| 1457 | (inValid) if argument is false.</font></td> |
| 1458 | </tr> |
| 1459 | <tr> |
| 1460 | <td> |
| 1461 | <center><a name="label"></a> <font size="-1">labelImage</font></center> |
| 1462 | </td> |
| 1463 | <td><font size="-1">std::string</font></td> |
| 1464 | <td><font size="-1">const std::string &label_</font></td> |
| 1465 | <td><font size="-1">Image label</font></td> |
| 1466 | </tr> |
| 1467 | <tr> |
| 1468 | <td> |
| 1469 | <center><a name="lineWidth"></a> <font size="-1">lineWidthImage</font></center> |
| 1470 | </td> |
| 1471 | <td><font size="-1">double</font></td> |
| 1472 | <td><font size="-1">double lineWidth_</font></td> |
| 1473 | <td><font size="-1">Line width for drawing lines, circles, |
| 1474 | ellipses, etc. See <a href="Drawable.html">Drawable</a> .</font></td> |
| 1475 | </tr> |
| 1476 | <tr> |
| 1477 | <td> |
| 1478 | <center><a name="magick"></a> <font size="-1">magickImage</font></center> |
| 1479 | </td> |
| 1480 | <td><font size="-1">std::string</font></td> |
| 1481 | <td><font size="-1"> const std::string &magick_</font></td> |
| 1482 | <td><font size="-1">Get image format (e.g. "GIF")</font></td> |
| 1483 | </tr> |
| 1484 | <tr> |
| 1485 | <td> |
| 1486 | <center><a name="matte"></a> <font size="-1">matteImage</font></center> |
| 1487 | </td> |
| 1488 | <td><font size="-1">bool</font></td> |
| 1489 | <td><font size="-1">bool matteFlag_</font></td> |
| 1490 | <td><font size="-1">True if the image has transparency. If set |
| 1491 | True, store matte channel if the image has one otherwise create |
| 1492 | an opaque one.</font></td> |
| 1493 | </tr> |
| 1494 | <tr> |
| 1495 | <td> |
| 1496 | <center><a name="matteColor"></a> <font size="-1">matteColorImage</font></center> |
| 1497 | </td> |
| 1498 | <td><font size="-1"><a href="Color.html">Color</a> </font></td> |
| 1499 | <td><font size="-1">const <a href="Color.html">Color</a> |
| 1500 | &matteColor_</font></td> |
| 1501 | <td><font size="-1">Image matte (frame) color</font></td> |
| 1502 | </tr> |
| 1503 | <tr> |
| 1504 | <td> |
| 1505 | <center><a name="monochrome"></a> <font size="-1">monochrome-</font> <br> |
| 1506 | <font size="-1">Image</font></center> |
| 1507 | </td> |
| 1508 | <td><font size="-1">bool</font></td> |
| 1509 | <td><font size="-1">bool flag_</font></td> |
| 1510 | <td><font size="-1">Transform the image to black and white</font></td> |
| 1511 | </tr> |
| 1512 | <tr> |
| 1513 | <td> |
| 1514 | <center><a name="pageImage"></a> <font size="-1">pageImage</font></center> |
| 1515 | </td> |
| 1516 | <td><font size="-1"><a href="Geometry.html#PostscriptPageSize">Geometry</a> </font></td> |
| 1517 | <td><font size="-1">const <a |
| 1518 | href="Geometry.html#PostscriptPageSize">Geometry</a> &pageSize_</font></td> |
| 1519 | <td><font size="-1">Preferred size and location of an image |
| 1520 | canvas.</font> |
| 1521 | <p><font size="-1">Use this option to specify the dimensions and |
| 1522 | position of the Postscript page in dots per inch or a TEXT page in |
| 1523 | pixels. This option is typically used in concert with <i><a |
| 1524 | href="#density">density</a> </i>.</font> </p> |
| 1525 | <p><font size="-1">Page may also be used to position a GIF image |
| 1526 | (such as for a scene in an animation)</font></p> |
| 1527 | </td> |
| 1528 | </tr> |
| 1529 | <tr> |
| 1530 | <td> |
| 1531 | <center><a name="penColor"></a> <font size="-1">penColorImage</font></center> |
| 1532 | </td> |
| 1533 | <td><font size="-1"><a href="Color.html">Color</a> </font></td> |
| 1534 | <td><font size="-1">const <a href="Color.html">Color</a> |
| 1535 | &penColor_</font></td> |
| 1536 | <td><font size="-1">Pen color to use when annotating on or |
| 1537 | drawing on image.</font></td> |
| 1538 | </tr> |
| 1539 | <tr> |
| 1540 | <td> |
| 1541 | <center><a name="penTexture"></a> <font size="-1">penTextureImage</font></center> |
| 1542 | </td> |
| 1543 | <td><font size="-1"><a href="Image.html">Image</a> </font></td> |
| 1544 | <td><font size="-1">const Image & penTexture_</font></td> |
| 1545 | <td><font size="-1">Texture image to paint with (similar to |
| 1546 | penColor).</font></td> |
| 1547 | </tr> |
| 1548 | <tr> |
| 1549 | <td> |
| 1550 | <center><a name="pixelColor"></a> <font size="-1">pixelColorImage</font></center> |
| 1551 | </td> |
| 1552 | <td><font size="-1"><a href="Color.html">Color</a> </font></td> |
| 1553 | <td><font size="-1">unsigned int x_, unsigned int y_, const <a |
| 1554 | href="Color.html"> Color</a> &color_</font></td> |
| 1555 | <td><font size="-1">Get/set pixel color at location x & y.</font></td> |
| 1556 | </tr> |
| 1557 | <tr> |
| 1558 | <td> |
| 1559 | <center><a name="psPageSize"></a> <font size="-1">psPageSizeImage</font></center> |
| 1560 | </td> |
| 1561 | <td><font size="-1"><a href="Geometry.html#PostscriptPageSize">Geometry</a> </font></td> |
| 1562 | <td><font size="-1">const <a |
| 1563 | href="Geometry.html#PostscriptPageSize">Geometry</a> &pageSize_</font></td> |
| 1564 | <td><font size="-1">Postscript page size. Use this option |
| 1565 | to specify the dimensions of the Postscript page in dots per inch |
| 1566 | or a TEXT page in pixels. This option is typically used in concert with <i>density</i>.</font></td> |
| 1567 | </tr> |
| 1568 | <tr> |
| 1569 | <td> |
| 1570 | <center><a name="quality"></a> <font size="-1">qualityImage</font></center> |
| 1571 | </td> |
| 1572 | <td><font size="-1">unsigned int (0 to 100)</font></td> |
| 1573 | <td><font size="-1">unsigned int quality_</font></td> |
| 1574 | <td><font size="-1">JPEG/MIFF/PNG compression level (default 75).</font></td> |
| 1575 | </tr> |
| 1576 | <tr> |
| 1577 | <td> |
| 1578 | <center><a name="quantizeColors"></a> <font size="-1">quantize-</font> <br> |
| 1579 | <font size="-1">ColorsImage</font></center> |
| 1580 | </td> |
| 1581 | <td><font size="-1">unsigned int</font></td> |
| 1582 | <td><font size="-1">unsigned int colors_</font></td> |
| 1583 | <td><font size="-1">Preferred number of colors in the image. The |
| 1584 | actual number of colors in the image may be less than your request, but |
| 1585 | never more. Images with less unique colors than specified with this |
| 1586 | option will have any duplicate or unused colors removed.</font></td> |
| 1587 | </tr> |
| 1588 | <tr> |
| 1589 | <td> |
| 1590 | <center><a name="quantizeColorSpace"></a> <font size="-1">quantize-</font> <br> |
| 1591 | <font size="-1">ColorSpaceImage</font></center> |
| 1592 | </td> |
| 1593 | <td><font size="-1"><a href="Enumerations.html#ColorspaceType">ColorspaceType</a> </font></td> |
| 1594 | <td><font size="-1"><a href="Enumerations.html#ColorspaceType">ColorspaceType</a> |
| 1595 | colorSpace_</font></td> |
| 1596 | <td><font size="-1">Colorspace to quantize colors in (default |
| 1597 | RGB). Empirical evidence suggests that distances in color spaces such |
| 1598 | as YUV or YIQ correspond to perceptual color differences more closely |
| 1599 | than do distances in RGB space. These color spaces may give better |
| 1600 | results when color reducing an image.</font></td> |
| 1601 | </tr> |
| 1602 | <tr> |
| 1603 | <td> |
| 1604 | <center><a name="quantizeDither"></a> <font size="-1">quantize-</font> <br> |
| 1605 | <font size="-1">DitherImage</font></center> |
| 1606 | </td> |
| 1607 | <td><font size="-1">bool</font></td> |
| 1608 | <td><font size="-1">bool flag_</font></td> |
| 1609 | <td><font size="-1">Apply Floyd/Steinberg error diffusion to the |
| 1610 | image. The basic strategy of dithering is to trade intensity |
| 1611 | resolution for spatial resolution by |
| 1612 | averaging the intensities of several |
| 1613 | neighboring pixels. Images which suffer from |
| 1614 | severe contouring when reducing colors can be improved |
| 1615 | with this option. The quantizeColors or monochrome option must be set |
| 1616 | for this option to take effect.</font></td> |
| 1617 | </tr> |
| 1618 | <tr> |
| 1619 | <td> |
| 1620 | <center><a name="quantizeTreeDepth"></a> <font size="-1">quantize-</font> <br> |
| 1621 | <font size="-1">TreeDepthImage</font></center> |
| 1622 | </td> |
| 1623 | <td><font size="-1">unsigned int (0 to 8)</font></td> |
| 1624 | <td><font size="-1">unsigned int treeDepth_</font></td> |
| 1625 | <td><font size="-1">Depth of the quantization color |
| 1626 | classification tree. Values of 0 or 1 allow selection of the optimal |
| 1627 | tree depth for the color reduction algorithm. Values between 2 and 8 may |
| 1628 | be used to manually adjust the tree depth.</font></td> |
| 1629 | </tr> |
| 1630 | <tr> |
| 1631 | <td> |
| 1632 | <center><a name="renderingIntent"></a> <font size="-1">rendering-</font> <br> |
| 1633 | <font size="-1">IntentImage</font></center> |
| 1634 | </td> |
| 1635 | <td><font size="-1"><a href="Enumerations.html#RenderingIntent">RenderingIntent</a> </font></td> |
| 1636 | <td><font size="-1"><a href="Enumerations.html#RenderingIntent">RenderingIntent</a> |
| 1637 | render_</font></td> |
| 1638 | <td><font size="-1">The type of rendering intent</font></td> |
| 1639 | </tr> |
| 1640 | <tr> |
| 1641 | <td> |
| 1642 | <center><a name="resolutionUnits"></a> <font size="-1">resolution-</font> <br> |
| 1643 | <font size="-1">UnitsImage</font></center> |
| 1644 | </td> |
| 1645 | <td><font size="-1"><a href="Enumerations.html#ResolutionType">ResolutionType</a> </font></td> |
| 1646 | <td><font size="-1"><a href="Enumerations.html#ResolutionType">ResolutionType</a> |
| 1647 | units_</font></td> |
| 1648 | <td><font size="-1">Units of image resolution</font></td> |
| 1649 | </tr> |
| 1650 | <tr> |
| 1651 | <td> |
| 1652 | <center><a name="scene"></a> <font size="-1">sceneImage</font></center> |
| 1653 | </td> |
| 1654 | <td><font size="-1">unsigned int</font></td> |
| 1655 | <td><font size="-1">unsigned int scene_</font></td> |
| 1656 | <td><font size="-1">Image scene number</font></td> |
| 1657 | </tr> |
| 1658 | <tr> |
| 1659 | <td> |
| 1660 | <center><a name="size"></a> <font size="-1">sizeImage</font></center> |
| 1661 | </td> |
| 1662 | <td><font size="-1"><a href="Geometry.html">Geometry</a> </font></td> |
| 1663 | <td><font size="-1">const <a href="Geometry.html">Geometry</a> |
| 1664 | &geometry_</font></td> |
| 1665 | <td><font size="-1">Width and height of a raw image (an image |
| 1666 | which does not support width and height information). Size may |
| 1667 | also be used to affect the image size read from a multi-resolution |
| 1668 | format (e.g. Photo CD, JBIG, or JPEG.</font></td> |
| 1669 | </tr> |
| 1670 | <tr> |
| 1671 | <td> |
| 1672 | <center><a name="strokeColorImage"></a> <font size="-1">strokeColorImage</font></center> |
| 1673 | </td> |
| 1674 | <td><font size="-1"><a href="Color.html">Color</a> </font></td> |
| 1675 | <td><font size="-1">const <a href="Color.html">Color</a> |
| 1676 | &strokeColor_</font></td> |
| 1677 | <td><font size="-1">Color to use when drawing object outlines</font></td> |
| 1678 | </tr> |
| 1679 | <tr> |
| 1680 | <td> |
| 1681 | <center><a name="subImage"></a> <font size="-1">subImageImage</font></center> |
| 1682 | </td> |
| 1683 | <td><font size="-1">unsigned int</font></td> |
| 1684 | <td><font size="-1">unsigned int subImage_</font></td> |
| 1685 | <td><font size="-1">Subimage of an image sequence</font></td> |
| 1686 | </tr> |
| 1687 | <tr> |
| 1688 | <td> |
| 1689 | <center><a name="subRange"></a> <font size="-1">subRangeImage</font></center> |
| 1690 | </td> |
| 1691 | <td><font size="-1">unsigned int</font></td> |
| 1692 | <td><font size="-1">unsigned int subRange_</font></td> |
| 1693 | <td><font size="-1">Number of images relative to the base image</font></td> |
| 1694 | </tr> |
| 1695 | <tr> |
| 1696 | <td> |
| 1697 | <center><a name="tileName"></a> <font size="-1">tileNameImage</font></center> |
| 1698 | </td> |
| 1699 | <td><font size="-1">std::string</font></td> |
| 1700 | <td><font size="-1">const std::string &tileName_</font></td> |
| 1701 | <td><font size="-1">Tile name</font></td> |
| 1702 | </tr> |
| 1703 | <tr> |
| 1704 | <td> |
| 1705 | <center><a name="typeImage"></a> <font size="-1">typeImage</font></center> |
| 1706 | </td> |
| 1707 | <td><font size="-1"><a href="Enumerations.html#ImageType">ImageType</a> </font></td> |
| 1708 | <td><font size="-1"><a href="Enumerations.html#ImageType">ImageType</a> |
| 1709 | type_</font></td> |
| 1710 | <td><font size="-1">Image storage type.</font></td> |
| 1711 | </tr> |
| 1712 | <tr> |
| 1713 | <td> |
| 1714 | <center><a name="verbose"></a> <font size="-1">verboseImage</font></center> |
| 1715 | </td> |
| 1716 | <td><font size="-1">bool</font></td> |
| 1717 | <td><font size="-1">bool verboseFlag_</font></td> |
| 1718 | <td><font size="-1">Print detailed information about the image</font></td> |
| 1719 | </tr> |
| 1720 | <tr> |
| 1721 | <td> |
| 1722 | <center><a name="view"></a> <font size="-1">viewImage</font></center> |
| 1723 | </td> |
| 1724 | <td><font size="-1">std::string</font></td> |
| 1725 | <td><font size="-1">const std::string &view_</font></td> |
| 1726 | <td><font size="-1">FlashPix viewing parameters.</font></td> |
| 1727 | </tr> |
| 1728 | <tr> |
| 1729 | <td> |
| 1730 | <center><a name="x11Display"></a> <font size="-1">x11DisplayImage</font></center> |
| 1731 | </td> |
| 1732 | <td><font size="-1">std::string (e.g. "hostname:0.0")</font></td> |
| 1733 | <td><font size="-1">const std::string &display_</font></td> |
| 1734 | <td><font size="-1">X11 display to display to, obtain fonts from, |
| 1735 | or to capture image from</font></td> |
| 1736 | </tr> |
| 1737 | </tbody> |
| 1738 | </table> |
| 1739 | <br> |
| 1740 | </p> |
| 1741 | <center> |
| 1742 | <h3> Query Image Format Support</h3> |
| 1743 | </center> |
| 1744 | Magick++ provides the <a name="coderInfoList"></a> <i>coderInfoList()</i> |
| 1745 | function to support obtaining information about the image formats |
| 1746 | supported by ImageMagick. Support for image formats in ImageMagick |
| 1747 | is provided by modules known as "coders". A user-provided container is |
| 1748 | updated based on a boolean truth-table match. The truth-table supports |
| 1749 | matching based on whether ImageMagick can read the format, write the |
| 1750 | format, or supports multiple frames for the format. A wildcard specifier |
| 1751 | is supported for any "don't care" field. The data obtained via |
| 1752 | coderInfoList() may be useful for preparing GUI dialog boxes or for |
| 1753 | deciding which output format to write based on support within the |
| 1754 | ImageMagick build. |
| 1755 | <p>The definition of coderInfoList is: </p> |
| 1756 | <p><tt><font color="#000066"> class CoderInfo</font></tt> <br> |
| 1757 | <tt><font color="#000066"> {</font></tt> <br> |
| 1758 | <tt><font color="#000066"> public:</font></tt> </p> |
| 1759 | <p><tt><font color="#000066"> enum MatchType {</font></tt> <br> |
| 1760 | <tt><font color="#000066"> |
| 1761 | AnyMatch, // match any coder</font></tt> <br> |
| 1762 | <tt><font color="#000066"> TrueMatch, // |
| 1763 | match coder if true</font></tt> <br> |
| 1764 | <tt><font color="#000066"> FalseMatch // |
| 1765 | match coder if false</font></tt> <br> |
| 1766 | <tt><font color="#000066"> };</font></tt> </p> |
| 1767 | <p><tt><font color="#000066"> [ remaining CoderInfo |
| 1768 | methods ]</font></tt> </p> |
| 1769 | <p><tt><font color="#000066"> }</font></tt> </p> |
| 1770 | <p><tt><font color="#000066"> template <class Container ></font></tt> <br> |
| 1771 | <tt><font color="#000066"> void coderInfoList( Container |
| 1772 | *container_,</font></tt> <br> |
| 1773 | <tt><font color="#000066"> |
| 1774 | CoderInfo::MatchType isReadable_ = CoderInfo::AnyMatch,</font></tt> <br> |
| 1775 | <tt><font color="#000066"> |
| 1776 | CoderInfo::MatchType isWritable_ = CoderInfo::AnyMatch,</font></tt> <br> |
| 1777 | <tt><font color="#000066"> |
| 1778 | CoderInfo::MatchType isMultiFrame_ = CoderInfo::AnyMatch</font></tt> <br> |
| 1779 | <tt><font color="#000066"> |
| 1780 | );</font></tt> </p> |
| 1781 | <p>The following example shows how to retrieve a list of all of the |
| 1782 | coders which support reading images and print the coder attributes (all |
| 1783 | listed formats will be readable): </p> |
| 1784 | <p><tt><font color="#000066"> list<CoderInfo> coderList;</font></tt> <br> |
| 1785 | <tt><font color="#000066"> coderInfoList( |
| 1786 | &coderList, |
| 1787 | // Reference to output list</font></tt> <br> |
| 1788 | <tt><font color="#000066"> |
| 1789 | CoderInfo::TrueMatch, // Match readable formats</font></tt> <br> |
| 1790 | <tt><font color="#000066"> |
| 1791 | CoderInfo::AnyMatch, // Don't care about writable formats</font></tt> <br> |
| 1792 | <tt><font color="#000066"> |
| 1793 | CoderInfo::AnyMatch); // Don't care about multi-frame support</font></tt> <br> |
| 1794 | <tt><font color="#000066"> list<CoderInfo>::iterator entry |
| 1795 | = coderList.begin();</font></tt> <br> |
| 1796 | <tt><font color="#000066"> while( entry != coderList.end() )</font></tt> <br> |
| 1797 | <tt><font color="#000066"> {</font></tt> <br> |
| 1798 | <tt><font color="#000066"> cout << |
| 1799 | entry->name() << ": (" << entry->description() |
| 1800 | << ") : ";</font></tt> <br> |
| 1801 | <tt><font color="#000066"> cout << "Readable = |
| 1802 | ";</font></tt> <br> |
| 1803 | <tt><font color="#000066"> if ( |
| 1804 | entry->isReadable() )</font></tt> <br> |
| 1805 | <tt><font color="#000066"> cout << |
| 1806 | "true";</font></tt> <br> |
| 1807 | <tt><font color="#000066"> else</font></tt> <br> |
| 1808 | <tt><font color="#000066"> cout << |
| 1809 | "false";</font></tt> <br> |
| 1810 | <tt><font color="#000066"> cout << ", ";</font></tt> <br> |
| 1811 | <tt><font color="#000066"> cout << "Writable = |
| 1812 | ";</font></tt> <br> |
| 1813 | <tt><font color="#000066"> if ( |
| 1814 | entry->isWritable() )</font></tt> <br> |
| 1815 | <tt><font color="#000066"> cout << |
| 1816 | "true";</font></tt> <br> |
| 1817 | <tt><font color="#000066"> else</font></tt> <br> |
| 1818 | <tt><font color="#000066"> cout << |
| 1819 | "false";</font></tt> <br> |
| 1820 | <tt><font color="#000066"> cout << ", ";</font></tt> <br> |
| 1821 | <tt><font color="#000066"> cout << "Multiframe |
| 1822 | = ";</font></tt> <br> |
| 1823 | <tt><font color="#000066"> if ( |
| 1824 | entry->isMultiframe() )</font></tt> <br> |
| 1825 | <tt><font color="#000066"> cout << |
| 1826 | "true";</font></tt> <br> |
| 1827 | <tt><font color="#000066"> else</font></tt> <br> |
| 1828 | <tt><font color="#000066"> cout << |
| 1829 | "false";</font></tt> <br> |
| 1830 | <tt><font color="#000066"> cout << endl;<br> |
| 1831 | entry ++;</font></tt><br> |
| 1832 | <tt><font color="#000066"> }</font></tt> </p> |
| 1833 | <h3 style="text-align: center;">Obtaining A Color Histogram </h3> |
| 1834 | <p> Magick++ provides the <a name="colorHistogram"></a><span |
| 1835 | style="font-weight: bold;">colorHistogram</span> template function to |
| 1836 | retrieve a color histogram from an image. A color histogram provides a |
| 1837 | count of how many times each color occurs in the image. The histogram is |
| 1838 | written into a user-provided container, which (for example) could be a <span |
| 1839 | style="font-style: italic;"><vector></span> or a <span |
| 1840 | style="font-style: italic;"><map></span>. When a |
| 1841 | <map> is used, the <span style="font-style: italic;">Color</span> |
| 1842 | is used as the key so that quick lookups of usage counts for colors may |
| 1843 | be performed. Writing into a <span style="font-style: italic;"><map></span> |
| 1844 | may be slower than writing into a <span style="font-style: italic;"><vector></span> |
| 1845 | since the <span style="font-style: italic;"><map></span> sorts the |
| 1846 | entries (by color intensity) and checks for uniqueness. Each histogram |
| 1847 | entry is contained in type <span style="font-style: italic;">std::pair<Magick::Color,unsigned |
| 1848 | long></span><span style="font-style: italic;"> </span>with the first |
| 1849 | member of the pair being a <span style="font-style: italic;">Color,</span> |
| 1850 | and the second member of the pair being an '<span |
| 1851 | style="font-style: italic;">unsigned long</span>'. Use the <span |
| 1852 | style="font-style: italic;"><pair></span> "<span |
| 1853 | style="font-style: italic;">first</span>" member to access the Color |
| 1854 | and the "<span style="font-style: italic;">second</span>" member to |
| 1855 | access the number of times the color occurs in the image.</p> |
| 1856 | <p>The template function declaration is as follows:<br> |
| 1857 | </p> |
| 1858 | <p><span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1859 | template <class Container ></span><br |
| 1860 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1861 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1862 | void colorHistogram( Container *histogram_, const Image image)</span><br> |
| 1863 | </p> |
| 1864 | <p>The following examples illustrate using both a <map> and a |
| 1865 | <vector> to retrieve the color histogram, and print out a |
| 1866 | formatted summary.<br> |
| 1867 | <br> |
| 1868 | Using <map>:<br> |
| 1869 | <br> |
| 1870 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1871 | Image image("image.miff");</span><br |
| 1872 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1873 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1874 | map<Color,unsigned long> histogram;</span><br |
| 1875 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1876 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1877 | colorHistogram( &histogram, image );</span><br |
| 1878 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1879 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1880 | std::map<Color,unsigned long>::const_iterator p=histogram.begin();</span><br |
| 1881 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1882 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1883 | while (p != histogram.end())</span><br |
| 1884 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1885 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1886 | {</span><br |
| 1887 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1888 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1889 | cout << setw(10) << (int)p->second |
| 1890 | << ": ("</span><br |
| 1891 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1892 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1893 | << setw(quantum_width) |
| 1894 | << (int)p->first.redQuantum() << ","</span><br |
| 1895 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1896 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1897 | << setw(quant</span><span |
| 1898 | style="color: rgb(51, 51, 153); font-family: monospace;">um_width) |
| 1899 | << (int)p->first.greenQuantum() << ","</span><br |
| 1900 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1901 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1902 | << setw(quantum_width) |
| 1903 | << (int)p->first.blueQuantum() << ")"</span><br |
| 1904 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1905 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1906 | << endl;</span><br |
| 1907 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1908 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1909 | p++;</span><br |
| 1910 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1911 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1912 | }</span><br> |
| 1913 | <br> |
| 1914 | Using <vector>:<br> |
| 1915 | <br> |
| 1916 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1917 | Image image("image.miff");</span><br |
| 1918 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1919 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1920 | std::vector<std::pair<Color,unsigned long> > histogram;</span><br |
| 1921 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1922 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1923 | colorHistogram( &histogram, image );</span><br |
| 1924 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1925 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1926 | std::vector<std::pair<Color,unsigned long> >::const_iterator |
| 1927 | p=histogram.begin();</span><br |
| 1928 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1929 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1930 | while (p != histogram.end())</span><br |
| 1931 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1932 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1933 | {</span><br |
| 1934 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1935 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1936 | cout << setw(10) << (int)p->second |
| 1937 | << ": ("</span><br |
| 1938 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1939 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1940 | << setw(quantum_width) |
| 1941 | << (int)p->first.redQuantum() << ","</span><br |
| 1942 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1943 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1944 | << setw(quantum_width) |
| 1945 | << (int)p->first.greenQuantum() << ","</span><br |
| 1946 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1947 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1948 | << setw(quantum_width) |
| 1949 | << (int)p->first.blueQuantum() << ")"</span><br |
| 1950 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1951 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1952 | << endl;</span><br |
| 1953 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1954 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1955 | p++;</span><br |
| 1956 | style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1957 | <span style="color: rgb(51, 51, 153); font-family: monospace;"> |
| 1958 | }</span><br> |
| 1959 | </p> |
| 1960 | <p><br> |
| 1961 | <br> |
| 1962 | </p> |
| 1963 | </body> |
| 1964 | </html> |