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