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 Documentation</title> 7<link rel="stylesheet" href="https://imagemagick.org/Magick++/magick.css" type="text/css" /> 8</head> 9<body> 10<p class="image"><img src="Magick++.png" name="Graphic1" align="bottom" width="464" height="134" border="0" /></p> 11<div class="doc-section"> 12<p><a href="../Magick++.2">Magick++</a> provides a simple C++ API to the ImageMagick image processing library which supports reading and writing a huge number of image formats as well as supporting a broad spectrum of traditional image processing operations. The ImageMagick C API is complex and the data structures are currently not documented. Magick++ provides access to most of the features available from the C API but in a simple object-oriented and well-documented framework.</p> 13<p>Magick++ is intended to support commercial-grade application development. In order to avoid possible conflicts with the user's application, all symbols contained in Magick++ (included by the header <tt><font color="#663366"><Magick++.h></font></tt>) are scoped to the <span lang="en-US">namespace</span> <i>Magick</i>. Symbols from the ImageMagick C library are imported under the <i>MagickCore</i> namespace to avoid possible conflicts and ImageMagick macros are only included within the Magick++ implementation so they won't impact the user's application.</p> 14<p>The core class in Magick++ is the <a href="Image++.html">Image</a> class. The Image class provides methods to manipulate a single image frame (e.g. a JPEG image). Standard Template Library (STL)<span lang="en-US">compatible</span> <a href="https://imagemagick.org/Magick++/STL.html">algorithms and function objects</a> are provided in order to manipulate multiple image frames or to read and write file formats which support multiple image frames (e.g. GIF animations, MPEG animations, and Postscript files).</p> 15<p>The Image class supports reference-counted memory management which supports the semantics of an intrinsic variable type (e.g. 'int') with an extremely efficient <tt>operator =</tt> and copy constructor (only a pointer is assigned) while ensuring that the image data is replicated as required so that it the image may be modified without impacting earlier generations. Since the Image class manages heap memory internally, images are best allocated via C++ automatic (stack-based) memory allocation. This support allows most programs using Magick++ to be written without using any pointers, simplifying the implementation and avoiding the risks of using pointers. When a program uses automatic memory allocation to allocate Magick++ images, that aspect of the program becomes naturally exception-safe and thread-safe.</p> 16<p>The image class uses a number of supportive classes in order to specify arguments. Colors are specified via the <a href="https://imagemagick.org/Magick++/Color.html">Color</a> class. Colors specified in X11-style string form are implicitly converted to the Color class. Geometry arguments (those specifying width, height, and/or x and y offset) are specified via the <a href="https://imagemagick.org/Magick++/Geometry.html">Geometry</a> class. Similar to the Color class, geometries specified as an X11-style string are implicitly converted to the Geometry class. Two dimensional drawable objects are specified via the <a href="https://imagemagick.org/Magick++/Drawable.html">Drawable</a> class. Drawable objects may be provided as a single object or as a list of objects to be rendered using the current image options. Montage options (a montage is a rendered grid of thumbnails in one image) are specified via the <a href="https://imagemagick.org/Magick++/Montage.html">Montage</a> class.</p> 17<p>Errors are reported using C++ exceptions derived from the <a href="https://imagemagick.org/Magick++/Exception.html">Exception</a> class, which is itself derived from the standard C++ exception class. Exceptions are reported synchronous with the operation and are caught by the first matching <i>try</i> block as the stack is unraveled. This allows a clean coding style in which multiple related Magick++ commands may be executed with errors handled as a unit rather than line-by-line. Since the Image object provides reference-counted memory management, unreferenced images on the stack are automagically cleaned up, avoiding the potential for memory leaks.</p> 18<p style="margin-bottom: 0cm">For ease of access, the documentation for the available user-level classes is available via the following table.</p> 19<br /> 20<table border="1" class="docutils"> 21<caption><em>Magick++</em> User-Level Classes</caption> 22<colgroup> 23<col width="18%" /> 24<col width="82%" /> 25</colgroup> 26<tbody valign="top"> 27<tr><td><a class="reference external" href="https://imagemagick.org/Magick++/Blob.html">Blob</a></td> 28<td>Binary Large OBject container.</td> 29</tr> 30<tr><td><a class="reference external" href="https://imagemagick.org/Magick++/CoderInfo.html">CoderInfo</a></td> 31<td>Report information about supported image formats (use with 32<a class="reference external" href="https://imagemagick.org/Magick++/STL.html#coderInfoList">coderInfoList</a>())</td> 33</tr> 34<tr><td><a class="reference external" href="https://imagemagick.org/Magick++/Color.html">Color</a></td> 35<td>Color specification.</td> 36</tr> 37<tr><td><a class="reference external" href="https://imagemagick.org/Magick++/Drawable.html">Drawable</a></td> 38<td>Drawable shape (for input to 'draw').</td> 39</tr> 40<tr><td><a class="reference external" href="https://imagemagick.org/Magick++/Exception.html">Exception</a></td> 41<td>C++ exception objects.</td> 42</tr> 43<tr><td><a class="reference external" href="https://imagemagick.org/Magick++/Geometry.html">Geometry</a></td> 44<td>Geometry specification.</td> 45</tr> 46<tr><td><a class="reference external" href="Image++.html">Image</a></td> 47<td>Image frame. This is the primary object in <em>Magick++</em>.</td> 48</tr> 49<tr><td><a class="reference external" href="https://imagemagick.org/Magick++/Montage.html">Montage</a></td> 50<td>Montage options for montageImages().</td> 51</tr> 52<tr><td><a class="reference external" href="https://imagemagick.org/Magick++/Pixels.html">Pixels</a></td> 53<td>Low-level access to image pixels.</td> 54</tr> 55<tr><td><a class="reference external" href="https://imagemagick.org/Magick++/STL.html">STL</a></td> 56<td>STL algorithms and function objects for operating on 57containers of image frames.</td> 58</tr> 59<tr><td><a class="reference external" href="https://imagemagick.org/Magick++/TypeMetric.html">TypeMetric</a></td> 60<td>Container for font type metrics (use with 61<a class="reference external" href="Image++.html#fonttypemetrics">Image::fontTypeMetrics</a>).</td> 62</tr> 63</tbody> 64</table> 65</div> 66</body> 67</html> 68