Image.h revision e6e40ada97dd07b629238f845f92c9c0b75dc487
1// This may look like C code, but it is really -*- C++ -*-
2//
3// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
4//
5// Definition of Image, the representation of a single image in Magick++
6//
7
8#if !defined(Magick_Image_header)
9#define Magick_Image_header
10
11#include "Magick++/Include.h"
12#include <string>
13#include <list>
14#include "Magick++/Blob.h"
15#include "Magick++/Color.h"
16#include "Magick++/Drawable.h"
17#include "Magick++/Exception.h"
18#include "Magick++/Geometry.h"
19#include "Magick++/TypeMetric.h"
20
21namespace Magick
22{
23  // Forward declarations
24  class Options;
25  class ImageRef;
26
27  extern MagickPPExport const char *borderGeometryDefault;
28  extern MagickPPExport const char *frameGeometryDefault;
29  extern MagickPPExport const char *raiseGeometryDefault;
30
31  // Compare two Image objects regardless of LHS/RHS
32  // Image sizes and signatures are used as basis of comparison
33  MagickPPExport int operator ==
34    (const Magick::Image &left_,const Magick::Image &right_);
35  MagickPPExport int operator !=
36    (const Magick::Image &left_,const Magick::Image &right_);
37  MagickPPExport int operator >
38    (const Magick::Image &left_,const Magick::Image &right_);
39  MagickPPExport int operator <
40    (const Magick::Image &left_,const Magick::Image &right_);
41  MagickPPExport int operator >=
42    (const Magick::Image &left_,const Magick::Image &right_);
43  MagickPPExport int operator <=
44    (const Magick::Image &left_,const Magick::Image &right_);
45
46  //
47  // Image is the representation of an image. In reality, it actually
48  // a handle object which contains a pointer to a shared reference
49  // object (ImageRef). As such, this object is extremely space efficient.
50  //
51  class MagickPPExport Image
52  {
53  public:
54
55    // Obtain image statistics. Statistics are normalized to the range
56    // of 0.0 to 1.0 and are output to the specified ImageStatistics
57    // structure.
58    typedef struct _ImageChannelStatistics
59    {
60      /* Minimum value observed */
61      double maximum;
62      /* Maximum value observed */
63      double minimum;
64      /* Average (mean) value observed */
65      double mean;
66      /* Standard deviation, sqrt(variance) */
67      double standard_deviation;
68      /* Variance */
69      double variance;
70      /* Kurtosis */
71      double kurtosis;
72      /* Skewness */
73      double skewness;
74    } ImageChannelStatistics;
75
76    typedef struct _ImageStatistics
77    {
78      ImageChannelStatistics red;
79      ImageChannelStatistics green;
80      ImageChannelStatistics blue;
81      ImageChannelStatistics alpha;
82    } ImageStatistics;
83
84    // Default constructor
85    Image(void);
86
87    // Construct Image from in-memory BLOB
88    Image(const Blob &blob_);
89
90    // Construct Image of specified size from in-memory BLOB
91    Image(const Blob &blob_,const Geometry &size_);
92
93    // Construct Image of specified size and depth from in-memory BLOB
94    Image(const Blob &blob_,const Geometry &size,const size_t depth);
95
96    // Construct Image of specified size, depth, and format from
97    // in-memory BLOB
98    Image(const Blob &blob_,const Geometry &size,const size_t depth_,
99      const std::string &magick_);
100
101    // Construct Image of specified size, and format from in-memory BLOB
102    Image(const Blob &blob_,const Geometry &size,const std::string &magick_);
103
104    // Construct a blank image canvas of specified size and color
105    Image(const Geometry &size_,const Color &color_);
106
107    // Copy constructor
108    Image(const Image &image_);
109
110    // Construct an image based on an array of raw pixels, of
111    // specified type and mapping, in memory
112    Image(const size_t width_,const size_t height_,const std::string &map_,
113      const StorageType type_,const void *pixels_);
114
115    // Construct from image file or image specification
116    Image(const std::string &imageSpec_);
117
118    // Destructor
119    virtual ~Image();
120
121    // Assignment operator
122    Image& operator=(const Image &image_);
123
124    // Join images into a single multi-image file
125    void adjoin(const bool flag_);
126    bool adjoin(void) const;
127
128    // Image supports transparency (alpha channel)
129    void alpha(const bool alphaFlag_);
130    bool alpha(void) const;
131
132    // Transparent color
133    void alphaColor(const Color &alphaColor_);
134    Color alphaColor(void) const;
135
136    // Anti-alias Postscript and TrueType fonts (default true)
137    void antiAlias(const bool flag_);
138    bool antiAlias(void);
139
140    // Time in 1/100ths of a second which must expire before
141    // displaying the next image in an animated sequence.
142    void animationDelay(const size_t delay_);
143    size_t animationDelay(void) const;
144
145    // Number of iterations to loop an animation (e.g. Netscape loop
146    // extension) for.
147    void animationIterations(const size_t iterations_);
148    size_t animationIterations(void) const;
149
150    // Image background color
151    void backgroundColor(const Color &color_);
152    Color backgroundColor(void) const;
153
154    // Name of texture image to tile onto the image background
155    void backgroundTexture(const std::string &backgroundTexture_);
156    std::string backgroundTexture(void) const;
157
158    // Base image width (before transformations)
159    size_t baseColumns(void) const;
160
161    // Base image filename (before transformations)
162    std::string baseFilename(void) const;
163
164    // Base image height (before transformations)
165    size_t baseRows(void) const;
166
167    // Image border color
168    void borderColor(const Color &color_);
169    Color borderColor(void) const;
170
171    // Return smallest bounding box enclosing non-border pixels. The
172    // current fuzz value is used when discriminating between pixels.
173    // This is the crop bounding box used by crop(Geometry(0,0));
174    Geometry boundingBox(void) const;
175
176    // Text bounding-box base color (default none)
177    void boxColor(const Color &boxColor_);
178    Color boxColor(void) const;
179
180    // Set or obtain modulus channel depth
181    void channelDepth(const size_t depth_);
182    size_t channelDepth();
183
184    // Returns the number of channels in this image.
185    size_t channels() const;
186
187    // Image class (DirectClass or PseudoClass)
188    // NOTE: setting a DirectClass image to PseudoClass will result in
189    // the loss of color information if the number of colors in the
190    // image is greater than the maximum palette size (either 256 or
191    // 65536 entries depending on the value of MAGICKCORE_QUANTUM_DEPTH when
192    // ImageMagick was built).
193    void classType(const ClassType class_);
194    ClassType classType(void) const;
195
196    // Associate a clip mask with the image. The clip mask must be the
197    // same dimensions as the image. Pass an invalid image to unset an
198    // existing clip mask.
199    void clipMask(const Image &clipMask_);
200    Image clipMask(void) const;
201
202    // Colors within this distance are considered equal
203    void colorFuzz(const double fuzz_);
204    double colorFuzz(void) const;
205
206    // Colormap size (number of colormap entries)
207    void colorMapSize(const size_t entries_);
208    size_t colorMapSize(void) const;
209
210    // Image Color Space
211    void colorSpace(const ColorspaceType colorSpace_);
212    ColorspaceType colorSpace(void) const;
213
214    void colorSpaceType(const ColorspaceType colorSpace_);
215    ColorspaceType colorSpaceType(void) const;
216
217    // Image width
218    size_t columns(void) const;
219
220    // Comment image (add comment string to image)
221    void comment(const std::string &comment_);
222    std::string comment(void) const;
223
224    // Composition operator to be used when composition is implicitly
225    // used (such as for image flattening).
226    void compose(const CompositeOperator compose_);
227    CompositeOperator compose(void) const;
228
229    // Compression type
230    void compressType(const CompressionType compressType_);
231    CompressionType compressType(void) const;
232
233    // Enable printing of debug messages from ImageMagick
234    void debug(const bool flag_);
235    bool debug(void) const;
236
237    // Vertical and horizontal resolution in pixels of the image
238    void density(const Geometry &geomery_);
239    Geometry density(void) const;
240
241    // Image depth (bits allocated to red/green/blue components)
242    void depth(const size_t depth_);
243    size_t depth(void) const;
244
245    // Tile names from within an image montage
246    std::string directory(void) const;
247
248    // Endianness (little like Intel or big like SPARC) for image
249    // formats which support endian-specific options.
250    void endian(const EndianType endian_);
251    EndianType endian(void) const;
252
253    // Exif profile (BLOB)
254    void exifProfile(const Blob &exifProfile_);
255    Blob exifProfile(void) const;
256
257    // Image file name
258    void fileName(const std::string &fileName_);
259    std::string fileName(void) const;
260
261    // Number of bytes of the image on disk
262    MagickSizeType fileSize(void) const;
263
264    // Color to use when filling drawn objects
265    void fillColor(const Color &fillColor_);
266    Color fillColor(void) const;
267
268    // Rule to use when filling drawn objects
269    void fillRule(const FillRule &fillRule_);
270    FillRule fillRule(void) const;
271
272    // Pattern to use while filling drawn objects.
273    void fillPattern(const Image &fillPattern_);
274    Image fillPattern(void) const;
275
276    // Filter to use when resizing image
277    void filterType(const FilterTypes filterType_);
278    FilterTypes filterType(void) const;
279
280    // Text rendering font
281    void font(const std::string &font_);
282    std::string font(void) const;
283
284    // Font point size
285    void fontPointsize(const double pointSize_);
286    double fontPointsize(void) const;
287
288    // Long image format description
289    std::string format(void) const;
290
291    // Formats the specified expression
292    // More info here: http://www.imagemagick.org/script/escape.php
293    std::string formatExpression(const std::string expression);
294
295    // Gamma level of the image
296    double gamma(void) const;
297
298    // Preferred size of the image when encoding
299    Geometry geometry(void) const;
300
301    // GIF disposal method
302    void gifDisposeMethod(const DisposeType disposeMethod_);
303    DisposeType gifDisposeMethod(void) const;
304
305    // ICC color profile (BLOB)
306    void iccColorProfile(const Blob &colorProfile_);
307    Blob iccColorProfile(void) const;
308
309    // Type of interlacing to use
310    void interlaceType(const InterlaceType interlace_);
311    InterlaceType interlaceType(void) const;
312
313    // Pixel color interpolation method to use
314    void interpolate(const PixelInterpolateMethod interpolate_);
315    PixelInterpolateMethod interpolate(void) const;
316
317    // IPTC profile (BLOB)
318    void iptcProfile(const Blob &iptcProfile_);
319    Blob iptcProfile(void) const;
320
321    // Does object contain valid image?
322    void isValid(const bool isValid_);
323    bool isValid(void) const;
324
325    // Image label
326    void label(const std::string &label_);
327    std::string label(void) const;
328
329    // File type magick identifier (.e.g "GIF")
330    void magick(const std::string &magick_);
331    std::string magick(void) const;
332
333    // The mean error per pixel computed when an image is color reduced
334    double meanErrorPerPixel(void) const;
335
336    // Image modulus depth (minimum number of bits required to support
337    // red/green/blue components without loss of accuracy)
338    void modulusDepth(const size_t modulusDepth_);
339    size_t modulusDepth(void) const;
340
341    // Transform image to black and white
342    void monochrome(const bool monochromeFlag_);
343    bool monochrome(void) const;
344
345    // Tile size and offset within an image montage
346    Geometry montageGeometry(void) const;
347
348    // The normalized max error per pixel computed when an image is
349    // color reduced.
350    double normalizedMaxError(void) const;
351
352    // The normalized mean error per pixel computed when an image is
353    // color reduced.
354    double normalizedMeanError(void) const;
355
356    // Image orientation
357    void orientation(const OrientationType orientation_);
358    OrientationType orientation(void) const;
359
360    // Preferred size and location of an image canvas.
361    void page(const Geometry &pageSize_);
362    Geometry page(void) const;
363
364    // JPEG/MIFF/PNG compression level (default 75).
365    void quality(const size_t quality_);
366    size_t quality(void) const;
367
368    // Maximum number of colors to quantize to
369    void quantizeColors(const size_t colors_);
370    size_t quantizeColors(void) const;
371
372    // Colorspace to quantize in.
373    void quantizeColorSpace(const ColorspaceType colorSpace_);
374    ColorspaceType quantizeColorSpace(void) const;
375
376    // Dither image during quantization (default true).
377    void quantizeDither(const bool ditherFlag_);
378    bool quantizeDither(void) const;
379
380    // Quantization tree-depth
381    void quantizeTreeDepth(const size_t treeDepth_);
382    size_t quantizeTreeDepth(void) const;
383
384    // The type of rendering intent
385    void renderingIntent(const RenderingIntent renderingIntent_);
386    RenderingIntent renderingIntent(void) const;
387
388    // Units of image resolution
389    void resolutionUnits(const ResolutionType resolutionUnits_);
390    ResolutionType resolutionUnits(void) const;
391
392    // The number of pixel rows in the image
393    size_t rows(void) const;
394
395    // Image scene number
396    void scene(const size_t scene_);
397    size_t scene(void) const;
398
399    // Width and height of a raw image
400    void size(const Geometry &geometry_);
401    Geometry size(void) const;
402
403    // enabled/disable stroke anti-aliasing
404    void strokeAntiAlias(const bool flag_);
405    bool strokeAntiAlias(void) const;
406
407    // Color to use when drawing object outlines
408    void strokeColor(const Color &strokeColor_);
409    Color strokeColor(void) const;
410
411    // Specify the pattern of dashes and gaps used to stroke
412    // paths. The strokeDashArray represents a zero-terminated array
413    // of numbers that specify the lengths of alternating dashes and
414    // gaps in pixels. If an odd number of values is provided, then
415    // the list of values is repeated to yield an even number of
416    // values.  A typical strokeDashArray_ array might contain the
417    // members 5 3 2 0, where the zero value indicates the end of the
418    // pattern array.
419    void strokeDashArray(const double *strokeDashArray_);
420    const double *strokeDashArray(void) const;
421
422    // While drawing using a dash pattern, specify distance into the
423    // dash pattern to start the dash (default 0).
424    void strokeDashOffset(const double strokeDashOffset_);
425    double strokeDashOffset(void) const;
426
427    // Specify the shape to be used at the end of open subpaths when
428    // they are stroked. Values of LineCap are UndefinedCap, ButtCap,
429    // RoundCap, and SquareCap.
430    void strokeLineCap(const LineCap lineCap_);
431    LineCap strokeLineCap(void) const;
432
433    // Specify the shape to be used at the corners of paths (or other
434    // vector shapes) when they are stroked. Values of LineJoin are
435    // UndefinedJoin, MiterJoin, RoundJoin, and BevelJoin.
436    void strokeLineJoin(const LineJoin lineJoin_);
437    LineJoin strokeLineJoin(void) const;
438
439    // Specify miter limit. When two line segments meet at a sharp
440    // angle and miter joins have been specified for 'lineJoin', it is
441    // possible for the miter to extend far beyond the thickness of
442    // the line stroking the path. The miterLimit' imposes a limit on
443    // the ratio of the miter length to the 'lineWidth'. The default
444    // value of this parameter is 4.
445    void strokeMiterLimit(const size_t miterLimit_);
446    size_t strokeMiterLimit(void) const;
447
448    // Pattern image to use while stroking object outlines.
449    void strokePattern(const Image &strokePattern_);
450    Image strokePattern(void) const;
451
452    // Stroke width for drawing vector objects (default one)
453    void strokeWidth(const double strokeWidth_);
454    double strokeWidth(void) const;
455
456    // Subimage of an image sequence
457    void subImage(const size_t subImage_);
458    size_t subImage(void) const;
459
460    // Number of images relative to the base image
461    void subRange(const size_t subRange_);
462    size_t subRange(void) const;
463
464    // Annotation text encoding (e.g. "UTF-16")
465    void textEncoding(const std::string &encoding_);
466    std::string textEncoding(void) const;
467
468    // Text inter-line spacing
469    void textInterlineSpacing(double spacing_);
470    double textInterlineSpacing(void) const;
471
472    // Text inter-word spacing
473    void textInterwordSpacing(double spacing_);
474    double textInterwordSpacing(void) const;
475
476    // Text inter-character kerning
477    void textKerning(double kerning_);
478    double textKerning(void) const;
479
480    // Number of colors in the image
481    size_t totalColors(void) const;
482
483    // Rotation to use when annotating with text or drawing
484    void transformRotation(const double angle_);
485
486    // Skew to use in X axis when annotating with text or drawing
487    void transformSkewX(const double skewx_);
488
489    // Skew to use in Y axis when annotating with text or drawing
490    void transformSkewY(const double skewy_);
491
492    // Image representation type (also see type operation)
493    //   Available types:
494    //    Bilevel        Grayscale       GrayscaleMatte
495    //    Palette        PaletteMatte    TrueColor
496    //    TrueColorMatte ColorSeparation ColorSeparationMatte
497    void type(const ImageType type_);
498    ImageType type(void) const;
499
500    // Print detailed information about the image
501    void verbose(const bool verboseFlag_);
502    bool verbose(void) const;
503
504    // FlashPix viewing parameters
505    void view(const std::string &view_);
506    std::string view(void) const;
507
508    // Virtual pixel method
509    void virtualPixelMethod(const VirtualPixelMethod virtualPixelMethod_);
510    VirtualPixelMethod virtualPixelMethod(void) const;
511
512    // X11 display to display to, obtain fonts from, or to capture
513    // image from
514    void x11Display(const std::string &display_);
515    std::string x11Display(void) const;
516
517    // x resolution of the image
518    double xResolution(void) const;
519
520    // y resolution of the image
521    double yResolution(void) const;
522
523    // Adaptive-blur image with specified blur factor
524    // The radius_ parameter specifies the radius of the Gaussian, in
525    // pixels, not counting the center pixel.  The sigma_ parameter
526    // specifies the standard deviation of the Laplacian, in pixels.
527    void adaptiveBlur(const double radius_=0.0,const double sigma_=1.0);
528
529    // This is shortcut function for a fast interpolative resize using mesh
530    // interpolation.  It works well for small resizes of less than +/- 50%
531    // of the original image size.  For larger resizing on images a full
532    // filtered and slower resize function should be used instead.
533    void adaptiveResize(const Geometry &geometry_);
534
535    // Adaptively sharpens the image by sharpening more intensely near image
536    // edges and less intensely far from edges. We sharpen the image with a
537    // Gaussian operator of the given radius and standard deviation (sigma).
538    // For reasonable results, radius should be larger than sigma.
539    void adaptiveSharpen(const double radius_=0.0,const double sigma_=1.0);
540    void adaptiveSharpenChannel(const ChannelType channel_,
541      const double radius_=0.0,const double sigma_=1.0);
542
543    // Local adaptive threshold image
544    // http://www.dai.ed.ac.uk/HIPR2/adpthrsh.htm
545    // Width x height define the size of the pixel neighborhood
546    // offset = constant to subtract from pixel neighborhood mean
547    void adaptiveThreshold(const size_t width,const size_t height,
548      const ::ssize_t offset=0);
549
550    // Add noise to image with specified noise type
551    void addNoise(const NoiseType noiseType_);
552    void addNoiseChannel(const ChannelType channel_,
553      const NoiseType noiseType_);
554
555    // Transform image by specified affine (or free transform) matrix.
556    void affineTransform(const DrawableAffine &affine);
557
558    // Set or attenuate the alpha channel in the image. If the image
559    // pixels are opaque then they are set to the specified alpha
560    // value, otherwise they are blended with the supplied alpha
561    // value.  The value of alpha_ ranges from 0 (completely opaque)
562    // to QuantumRange. The defines OpaqueAlpha and TransparentAlpha are
563    // available to specify completely opaque or completely
564    // transparent, respectively.
565    void alpha(const unsigned int alpha_);
566
567    // AlphaChannel() activates, deactivates, resets, or sets the alpha
568    // channel.
569    void alphaChannel(AlphaChannelOption alphaOption_);
570
571    // Floodfill designated area with replacement alpha value
572    void alphaFloodfill(const Color &target_,const unsigned int alpha_,
573       const ::ssize_t x_, const ::ssize_t y_,const PaintMethod method_);
574
575    //
576    // Annotate image (draw text on image)
577    //
578    // Gravity effects text placement in bounding area according to rules:
579    //  NorthWestGravity  text bottom-left corner placed at top-left
580    //  NorthGravity      text bottom-center placed at top-center
581    //  NorthEastGravity  text bottom-right corner placed at top-right
582    //  WestGravity       text left-center placed at left-center
583    //  CenterGravity     text center placed at center
584    //  EastGravity       text right-center placed at right-center
585    //  SouthWestGravity  text top-left placed at bottom-left
586    //  SouthGravity      text top-center placed at bottom-center
587    //  SouthEastGravity  text top-right placed at bottom-right
588
589    // Annotate using specified text, and placement location
590    void annotate(const std::string &text_,const Geometry &location_);
591
592    // Annotate using specified text, bounding area, and placement
593    // gravity
594    void annotate(const std::string &text_,const Geometry &boundingArea_,
595      const GravityType gravity_);
596
597    // Annotate with text using specified text, bounding area,
598    // placement gravity, and rotation.
599    void annotate(const std::string &text_,const Geometry &boundingArea_,
600      const GravityType gravity_,const double degrees_);
601
602    // Annotate with text (bounding area is entire image) and placement
603    // gravity.
604    void annotate(const std::string &text_,const GravityType gravity_);
605
606    // Inserts the artifact with the specified name and value into
607    // the artifact tree of the image.
608    void artifact(const std::string &name_,const std::string &value_);
609
610    // Returns the value of the artifact with the specified name.
611    std::string artifact(const std::string &name_);
612
613    // Access/Update a named image attribute
614    void attribute(const std::string name_,const std::string value_);
615    std::string attribute(const std::string name_);
616
617    // Extracts the 'mean' from the image and adjust the image to try
618    // make set its gamma appropriatally.
619    void autoGamma(void);
620    void autoGammaChannel(const ChannelType channel_);
621
622    // Adjusts the levels of a particular image channel by scaling the
623    // minimum and maximum values to the full quantum range.
624    void autoLevel(void);
625    void autoLevelChannel(const ChannelType channel_);
626
627    // Adjusts an image so that its orientation is suitable for viewing.
628    void autoOrient(void);
629
630    // Forces all pixels below the threshold into black while leaving all
631    // pixels at or above the threshold unchanged.
632    void blackThreshold(const std::string &threshold_);
633    void blackThresholdChannel(const ChannelType channel_,
634      const std::string &threshold_);
635
636     // Simulate a scene at nighttime in the moonlight.
637    void blueShift(const double factor_=1.5);
638
639    // Blur image with specified blur factor
640    // The radius_ parameter specifies the radius of the Gaussian, in
641    // pixels, not counting the center pixel.  The sigma_ parameter
642    // specifies the standard deviation of the Laplacian, in pixels.
643    void blur(const double radius_=0.0,const double sigma_=1.0);
644    void blurChannel(const ChannelType channel_,const double radius_=0.0,
645      const double sigma_=1.0);
646
647    // Border image (add border to image)
648    void border(const Geometry &geometry_=borderGeometryDefault);
649
650    // Changes the brightness and/or contrast of an image. It converts the
651    // brightness and contrast parameters into slope and intercept and calls
652    // a polynomical function to apply to the image.
653    void brightnessContrast(const double brightness_=0.0,
654      const double contrast_=0.0);
655    void brightnessContrastChannel(const ChannelType channel_,
656      const double brightness_=0.0,const double contrast_=0.0);
657
658    // Extract channel from image
659    void channel(const ChannelType channel_);
660
661    // Charcoal effect image (looks like charcoal sketch)
662    // The radius_ parameter specifies the radius of the Gaussian, in
663    // pixels, not counting the center pixel.  The sigma_ parameter
664    // specifies the standard deviation of the Laplacian, in pixels.
665    void charcoal(const double radius_=0.0,const double sigma_=1.0);
666
667    // Chop image (remove vertical or horizontal subregion of image)
668    // FIXME: describe how geometry argument is used to select either
669    // horizontal or vertical subregion of image.
670    void chop(const Geometry &geometry_);
671
672    // Chromaticity blue primary point (e.g. x=0.15, y=0.06)
673    void chromaBluePrimary(const double x_,const double y_);
674    void chromaBluePrimary(double *x_,double *y_) const;
675
676    // Chromaticity green primary point (e.g. x=0.3, y=0.6)
677    void chromaGreenPrimary(const double x_,const double y_);
678    void chromaGreenPrimary(double *x_,double *y_) const;
679
680    // Chromaticity red primary point (e.g. x=0.64, y=0.33)
681    void chromaRedPrimary(const double x_,const double y_);
682    void chromaRedPrimary(double *x_,double *y_) const;
683
684    // Chromaticity white point (e.g. x=0.3127, y=0.329)
685    void chromaWhitePoint(const double x_,const double y_);
686    void chromaWhitePoint(double *x_,double *y_) const;
687
688    // Accepts a lightweight Color Correction Collection
689    // (CCC) file which solely contains one or more color corrections and
690    // applies the correction to the image.
691    void cdl(const std::string &cdl_);
692
693    // Set each pixel whose value is below zero to zero and any the
694    // pixel whose value is above the quantum range to the quantum range (e.g.
695    // 65535) otherwise the pixel value remains unchanged.
696    void clamp(void);
697    void clampChannel(const ChannelType channel_);
698
699    // Sets the image clip mask based on any clipping path information
700    // if it exists.
701    void clip(void);
702    void clipPath(const std::string pathname_,const bool inside_);
703
704    // Apply a color lookup table (CLUT) to the image.
705    void clut(const Image &clutImage_,const PixelInterpolateMethod method);
706    void clutChannel(const ChannelType channel_,const Image &clutImage_,
707      const PixelInterpolateMethod method);
708
709    // Colorize image with pen color, using specified percent alpha.
710    void colorize(const unsigned int alpha_,const Color &penColor_);
711
712    // Colorize image with pen color, using specified percent alpha
713    // for red, green, and blue quantums
714    void colorize(const unsigned int alphaRed_,const unsigned int alphaGreen_,
715       const unsigned int alphaBlue_,const Color &penColor_);
716
717     // Color at colormap position index_
718    void colorMap(const size_t index_,const Color &color_);
719    Color colorMap(const size_t index_) const;
720
721    // Apply a color matrix to the image channels. The user supplied
722    // matrix may be of order 1 to 5 (1x1 through 5x5).
723    void colorMatrix(const size_t order_,const double *color_matrix_);
724
725    // Compare current image with another image
726    // Sets meanErrorPerPixel, normalizedMaxError, and normalizedMeanError
727    // in the current image. False is returned if the images are identical.
728    bool compare(const Image &reference_);
729
730    // Compare current image with another image
731    // Returns the distortion based on the specified metric.
732    double compare(const Image &reference_,const MetricType metric_);
733    double compareChannel(const ChannelType channel_,
734                                     const Image &reference_,
735                                     const MetricType metric_ );
736
737    // Compare current image with another image
738    // Sets the distortion and returns the difference image.
739    Image compare(const Image &reference_,const MetricType metric_,
740      double *distortion);
741    Image compareChannel(const ChannelType channel_,const Image &reference_,
742      const MetricType metric_,double *distortion);
743
744    // Compose an image onto another at specified offset and using
745    // specified algorithm
746    void composite(const Image &compositeImage_,const Geometry &offset_,
747      const CompositeOperator compose_=InCompositeOp);
748    void composite(const Image &compositeImage_,const GravityType gravity_,
749      const CompositeOperator compose_=InCompositeOp);
750    void composite(const Image &compositeImage_,const ::ssize_t xOffset_,
751      const ::ssize_t yOffset_,const CompositeOperator compose_=InCompositeOp);
752
753    // Contrast image (enhance intensity differences in image)
754    void contrast(const size_t sharpen_);
755
756    // A simple image enhancement technique that attempts to improve the
757    // contrast in an image by 'stretching' the range of intensity values
758    // it contains to span a desired range of values. It differs from the
759    // more sophisticated histogram equalization in that it can only apply a
760    // linear scaling function to the image pixel values. As a result the
761    // 'enhancement' is less harsh.
762    void contrastStretch(const double blackPoint_,const double whitePoint_);
763    void contrastStretchChannel(const ChannelType channel_,
764      const double blackPoint_,const double whitePoint_);
765
766    // Convolve image.  Applies a user-specified convolution to the image.
767    //  order_ represents the number of columns and rows in the filter kernel.
768    //  kernel_ is an array of doubles representing the convolution kernel.
769    void convolve(const size_t order_,const double *kernel_);
770
771    // Crop image (subregion of original image)
772    void crop(const Geometry &geometry_);
773
774    // Cycle image colormap
775    void cycleColormap(const ::ssize_t amount_);
776
777    // Converts cipher pixels to plain pixels.
778    void decipher(const std::string &passphrase_);
779
780    // Tagged image format define. Similar to the defineValue() method
781    // except that passing the flag_ value 'true' creates a value-less
782    // define with that format and key. Passing the flag_ value 'false'
783    // removes any existing matching definition. The method returns 'true'
784    // if a matching key exists, and 'false' if no matching key exists.
785    void defineSet(const std::string &magick_,const std::string &key_,
786      bool flag_);
787    bool defineSet(const std::string &magick_,const std::string &key_) const;
788
789    // Tagged image format define (set/access coder-specific option) The
790    // magick_ option specifies the coder the define applies to.  The key_
791    // option provides the key specific to that coder.  The value_ option
792    // provides the value to set (if any). See the defineSet() method if the
793    // key must be removed entirely.
794    void defineValue(const std::string &magick_,const std::string &key_,
795      const std::string &value_);
796    std::string defineValue(const std::string &magick_,
797      const std::string &key_) const;
798
799    // Removes skew from the image. Skew is an artifact that occurs in scanned
800    // images because of the camera being misaligned, imperfections in the
801    // scanning or surface, or simply because the paper was not placed
802    // completely flat when scanned. The value of threshold_ ranges from 0
803    // to QuantumRange.
804    void deskew(const double threshold_);
805
806    // Despeckle image (reduce speckle noise)
807    void despeckle(void);
808
809    // Display image on screen
810    void display(void);
811
812    // Distort image.  distorts an image using various distortion methods, by
813    // mapping color lookups of the source image to a new destination image
814    // usally of the same size as the source image, unless 'bestfit' is set to
815    // true.
816    void distort(const DistortImageMethod method_,
817      const size_t numberArguments_,const double *arguments_,
818      const bool bestfit_=false);
819
820    // Draw on image using a single drawable
821    void draw(const Drawable &drawable_);
822
823    // Draw on image using a drawable list
824    void draw(const std::list<Magick::Drawable> &drawable_);
825
826    // Edge image (hilight edges in image)
827    void edge(const double radius_=0.0);
828
829    // Emboss image (hilight edges with 3D effect)
830    // The radius_ parameter specifies the radius of the Gaussian, in
831    // pixels, not counting the center pixel.  The sigma_ parameter
832    // specifies the standard deviation of the Laplacian, in pixels.
833    void emboss(const double radius_=0.0,const double sigma_=1.0);
834
835    // Converts pixels to cipher-pixels.
836    void encipher(const std::string &passphrase_);
837
838    // Enhance image (minimize noise)
839    void enhance(void);
840
841    // Equalize image (histogram equalization)
842    void equalize(void);
843
844    // Erase image to current "background color"
845    void erase(void);
846
847    // Extend the image as defined by the geometry.
848    void extent(const Geometry &geometry_);
849    void extent(const Geometry &geometry_,const Color &backgroundColor);
850    void extent(const Geometry &geometry_,const Color &backgroundColor,
851      const GravityType gravity_);
852    void extent(const Geometry &geometry_,const GravityType gravity_);
853
854    // Flip image (reflect each scanline in the vertical direction)
855    void flip(void);
856
857    // Floodfill pixels matching color (within fuzz factor) of target
858    // pixel(x,y) with replacement alpha value using method.
859    void floodFillAlpha(const ::ssize_t x_,const ::ssize_t y_,
860      const unsigned int alpha_,const PaintMethod method_);
861
862    // Flood-fill color across pixels that match the color of the
863    // target pixel and are neighbors of the target pixel.
864    // Uses current fuzz setting when determining color match.
865    void floodFillColor(const Geometry &point_,const Color &fillColor_);
866    void floodFillColor(const ::ssize_t x_,const ::ssize_t y_,
867      const Color &fillColor_ );
868
869    // Flood-fill color across pixels starting at target-pixel and
870    // stopping at pixels matching specified border color.
871    // Uses current fuzz setting when determining color match.
872    void floodFillColor(const Geometry &point_,const Color &fillColor_,
873      const Color &borderColor_);
874    void floodFillColor(const ::ssize_t x_,const ::ssize_t y_,
875      const Color &fillColor_,const Color &borderColor_);
876
877    // Flood-fill texture across pixels that match the color of the
878    // target pixel and are neighbors of the target pixel.
879    // Uses current fuzz setting when determining color match.
880    void floodFillTexture(const Geometry &point_,const Image &texture_);
881    void floodFillTexture(const ::ssize_t x_,const ::ssize_t y_,
882      const Image &texture_);
883
884    // Flood-fill texture across pixels starting at target-pixel and
885    // stopping at pixels matching specified border color.
886    // Uses current fuzz setting when determining color match.
887    void floodFillTexture(const Geometry &point_,const Image &texture_,
888      const Color &borderColor_);
889    void floodFillTexture(const ::ssize_t x_,const ::ssize_t y_,
890      const Image &texture_,const Color &borderColor_);
891
892    // Flop image (reflect each scanline in the horizontal direction)
893    void flop(void);
894
895    // Obtain font metrics for text string given current font,
896    // pointsize, and density settings.
897    void fontTypeMetrics(const std::string &text_,TypeMetric *metrics);
898
899    // Obtain multi line font metrics for text string given current font,
900    // pointsize, and density settings.
901    void fontTypeMetricsMultiline(const std::string &text_,
902      TypeMetric *metrics);
903
904    // Frame image
905    void frame(const Geometry &geometry_=frameGeometryDefault);
906    void frame(const size_t width_,const size_t height_,
907      const ::ssize_t innerBevel_=6,const ::ssize_t outerBevel_=6);
908
909    // Applies a mathematical expression to the image.
910    void fx(const std::string expression_);
911    void fx(const std::string expression_,const Magick::ChannelType channel_);
912
913    // Gamma correct image
914    void gamma(const double gamma_);
915    void gamma(const double gammaRed_,const double gammaGreen_,
916      const double gammaBlue_);
917
918    // Gaussian blur image
919    // The number of neighbor pixels to be included in the convolution
920    // mask is specified by 'width_'. The standard deviation of the
921    // gaussian bell curve is specified by 'sigma_'.
922    void gaussianBlur(const double width_,const double sigma_);
923    void gaussianBlurChannel(const ChannelType channel_,const double width_,
924      const double sigma_);
925
926    // Transfers read-only pixels from the image to the pixel cache as
927    // defined by the specified region
928    const Quantum *getConstPixels(const ::ssize_t x_, const ::ssize_t y_,
929      const size_t columns_,const size_t rows_) const;
930
931    // Obtain immutable image pixel metacontent (valid for PseudoClass images)
932    const void *getConstMetacontent(void) const;
933
934    // Obtain mutable image pixel metacontent (valid for PseudoClass images)
935    void *getMetacontent(void);
936
937    // Transfers pixels from the image to the pixel cache as defined
938    // by the specified region. Modified pixels may be subsequently
939    // transferred back to the image via syncPixels.  This method is
940    // valid for DirectClass images.
941    Quantum *getPixels(const ::ssize_t x_,const ::ssize_t y_,
942      const size_t columns_,const size_t rows_);
943
944    // Apply a color lookup table (Hald CLUT) to the image.
945    void haldClut(const Image &clutImage_);
946
947    // Implode image (special effect)
948    void implode(const double factor_);
949
950    // Implements the inverse discrete Fourier transform (DFT) of the image
951    // either as a magnitude / phase or real / imaginary image pair.
952    void inverseFourierTransform(const Image &phase_);
953    void inverseFourierTransform(const Image &phase_,const bool magnitude_);
954
955    // Level image. Adjust the levels of the image by scaling the
956    // colors falling between specified white and black points to the
957    // full available quantum range. The parameters provided represent
958    // the black, mid (gamma), and white points.  The black point
959    // specifies the darkest color in the image. Colors darker than
960    // the black point are set to zero. Mid point (gamma) specifies a
961    // gamma correction to apply to the image. White point specifies
962    // the lightest color in the image.  Colors brighter than the
963    // white point are set to the maximum quantum value. The black and
964    // white point have the valid range 0 to QuantumRange while mid (gamma)
965    // has a useful range of 0 to ten.
966    void level(const double blackPoint_,const double whitePoint_,
967      const double gamma_=1.0);
968    void levelChannel(const ChannelType channel_,const double blackPoint_,
969      const double whitePoint_,const double gamma_=1.0);
970
971    // Maps the given color to "black" and "white" values, linearly spreading
972    // out the colors, and level values on a channel by channel bases, as
973    // per level(). The given colors allows you to specify different level
974    // ranges for each of the color channels separately.
975    void levelColors(const Color &blackColor_,const Color &whiteColor_,
976      const bool invert_=true);
977    void levelColorsChannel(const ChannelType channel_,
978      const Color &blackColor_,const Color &whiteColor_,
979      const bool invert_=true);
980
981    // Discards any pixels below the black point and above the white point and
982    // levels the remaining pixels.
983    void linearStretch(const double blackPoint_,const double whitePoint_);
984
985    // Rescales image with seam carving.
986    void liquidRescale(const Geometry &geometry_);
987
988    // Magnify image by integral size
989    void magnify(void);
990
991    // Remap image colors with closest color from reference image
992    void map(const Image &mapImage_,const bool dither_=false);
993
994    // Filter image by replacing each pixel component with the median
995    // color in a circular neighborhood
996    void medianFilter(const double radius_=0.0);
997
998    // Reduce image by integral size
999    void minify(void);
1000
1001    // Modulate percent hue, saturation, and brightness of an image
1002    void modulate(const double brightness_,const double saturation_,
1003      const double hue_);
1004
1005    // Motion blur image with specified blur factor
1006    // The radius_ parameter specifies the radius of the Gaussian, in
1007    // pixels, not counting the center pixel.  The sigma_ parameter
1008    // specifies the standard deviation of the Laplacian, in pixels.
1009    // The angle_ parameter specifies the angle the object appears
1010    // to be comming from (zero degrees is from the right).
1011    void motionBlur(const double radius_,const double sigma_,
1012      const double angle_);
1013
1014    // Negate colors in image.  Set grayscale to only negate grayscale
1015    // values in image.
1016    void negate(const bool grayscale_=false);
1017    void negateChannel(const ChannelType channel_,const bool grayscale_=false);
1018
1019    // Normalize image (increase contrast by normalizing the pixel
1020    // values to span the full range of color values)
1021    void normalize(void);
1022
1023    // Oilpaint image (image looks like oil painting)
1024    void oilPaint(const double radius_=0.0,const double sigma=1.0);
1025
1026    // Change color of opaque pixel to specified pen color.
1027    void opaque(const Color &opaqueColor_,const Color &penColor_);
1028
1029    // Set each pixel whose value is less than epsilon to epsilon or
1030    // -epsilon (whichever is closer) otherwise the pixel value remains
1031    // unchanged.
1032    void perceptible(const double epsilon_);
1033    void perceptibleChannel(const ChannelType channel_,const double epsilon_);
1034
1035    // Ping is similar to read except only enough of the image is read
1036    // to determine the image columns, rows, and filesize.  Access the
1037    // columns(), rows(), and fileSize() attributes after invoking
1038    // ping.  The image data is not valid after calling ping.
1039    void ping(const std::string &imageSpec_);
1040
1041    // Ping is similar to read except only enough of the image is read
1042    // to determine the image columns, rows, and filesize.  Access the
1043    // columns(), rows(), and fileSize() attributes after invoking
1044    // ping.  The image data is not valid after calling ping.
1045    void ping(const Blob &blob_);
1046
1047    // Get/set pixel color at location x & y.
1048    void pixelColor(const ::ssize_t x_,const ::ssize_t y_,const Color &color_);
1049    Color pixelColor(const ::ssize_t x_,const ::ssize_t y_ ) const;
1050
1051    // Simulates a Polaroid picture.
1052    void polaroid(const std::string &caption_,const double angle_,
1053      const PixelInterpolateMethod method_);
1054
1055    // Reduces the image to a limited number of colors for a "poster" effect.
1056    void posterize(const size_t levels_,const DitherMethod method_);
1057    void posterizeChannel(const ChannelType channel_,const size_t levels_,
1058      const DitherMethod method_);
1059
1060    // Execute a named process module using an argc/argv syntax similar to
1061    // that accepted by a C 'main' routine. An exception is thrown if the
1062    // requested process module doesn't exist, fails to load, or fails during
1063    // execution.
1064    void process(std::string name_,const ::ssize_t argc_,const char **argv_);
1065
1066    // Add or remove a named profile to/from the image. Remove the
1067    // profile by passing an empty Blob (e.g. Blob()). Valid names are
1068    // "*", "8BIM", "ICM", "IPTC", or a user/format-defined profile name.
1069    void profile(const std::string name_,const Blob &colorProfile_);
1070
1071    // Retrieve a named profile from the image. Valid names are:
1072    // "8BIM", "8BIMTEXT", "APP1", "APP1JPEG", "ICC", "ICM", & "IPTC"
1073    // or an existing user/format-defined profile name.
1074    Blob profile(const std::string name_) const;
1075
1076    // Quantize image (reduce number of colors)
1077    void quantize(const bool measureError_=false);
1078
1079    void quantumOperator(const ChannelType channel_,
1080      const MagickEvaluateOperator operator_,double rvalue_);
1081
1082    void quantumOperator(const ::ssize_t x_,const ::ssize_t y_,
1083      const size_t columns_,const size_t rows_,const ChannelType channel_,
1084      const MagickEvaluateOperator operator_,const double rvalue_);
1085
1086    // Raise image (lighten or darken the edges of an image to give a
1087    // 3-D raised or lowered effect)
1088    void raise(const Geometry &geometry_=raiseGeometryDefault,
1089      const bool raisedFlag_=false);
1090
1091    // Random threshold image.
1092    //
1093    // Changes the value of individual pixels based on the intensity
1094    // of each pixel compared to a random threshold.  The result is a
1095    // low-contrast, two color image.  The thresholds_ argument is a
1096    // geometry containing LOWxHIGH thresholds.  If the string
1097    // contains 2x2, 3x3, or 4x4, then an ordered dither of order 2,
1098    // 3, or 4 will be performed instead.  If a channel_ argument is
1099    // specified then only the specified channel is altered.  This is
1100    // a very fast alternative to 'quantize' based dithering.
1101    void randomThreshold(const Geometry &thresholds_);
1102    void randomThresholdChannel(const ChannelType channel_,
1103      const Geometry &thresholds_);
1104
1105    // Read single image frame from in-memory BLOB
1106    void read(const Blob &blob_);
1107
1108    // Read single image frame of specified size from in-memory BLOB
1109    void read(const Blob &blob_,const Geometry &size_);
1110
1111    // Read single image frame of specified size and depth from
1112    // in-memory BLOB
1113    void read(const Blob &blob_,const Geometry &size_,const size_t depth_);
1114
1115    // Read single image frame of specified size, depth, and format
1116    // from in-memory BLOB
1117    void read(const Blob &blob_,const Geometry &size_,const size_t depth_,
1118      const std::string &magick_);
1119
1120    // Read single image frame of specified size, and format from
1121    // in-memory BLOB
1122    void read(const Blob &blob_,const Geometry &size_,
1123      const std::string &magick_);
1124
1125    // Read single image frame of specified size into current object
1126    void read(const Geometry &size_,const std::string &imageSpec_);
1127
1128    // Read single image frame from an array of raw pixels, with
1129    // specified storage type (ConstituteImage), e.g.
1130    // image.read( 640, 480, "RGB", 0, pixels );
1131    void read(const size_t width_,const size_t height_,const std::string &map_,
1132      const StorageType type_,const void *pixels_);
1133
1134    // Read single image frame into current object
1135    void read(const std::string &imageSpec_);
1136
1137    // Transfers one or more pixel components from a buffer or file
1138    // into the image pixel cache of an image.
1139    // Used to support image decoders.
1140    void readPixels(const QuantumType quantum_,const unsigned char *source_);
1141
1142    // Reduce noise in image using a noise peak elimination filter
1143    void reduceNoise(void);
1144    void reduceNoise(const double order_);
1145
1146    // Resize image in terms of its pixel size.
1147    void resample(const Geometry &geometry_);
1148
1149    // Resize image to specified size.
1150    void resize(const Geometry &geometry_);
1151
1152    // Roll image (rolls image vertically and horizontally) by specified
1153    // number of columnms and rows)
1154    void roll(const Geometry &roll_);
1155    void roll(const size_t columns_,const size_t rows_);
1156
1157    // Rotate image counter-clockwise by specified number of degrees.
1158    void rotate(const double degrees_);
1159
1160    // Resize image by using pixel sampling algorithm
1161    void sample(const Geometry &geometry_);
1162
1163    // Allocates a pixel cache region to store image pixels as defined
1164    // by the region rectangle.  This area is subsequently transferred
1165    // from the pixel cache to the image via syncPixels.
1166    Quantum *setPixels(const ::ssize_t x_, const ::ssize_t y_,
1167      const size_t columns_,const size_t rows_);
1168
1169    // Resize image by using simple ratio algorithm
1170    void scale(const Geometry &geometry_);
1171
1172    // Segment (coalesce similar image components) by analyzing the
1173    // histograms of the color components and identifying units that
1174    // are homogeneous with the fuzzy c-means technique.  Also uses
1175    // QuantizeColorSpace and Verbose image attributes
1176    void segment(const double clusterThreshold_=1.0,
1177      const double smoothingThreshold_=1.5);
1178
1179    // Shade image using distant light source
1180    void shade(const double azimuth_=30,const double elevation_=30,
1181      const bool colorShading_=false);
1182
1183    // Simulate an image shadow
1184    void shadow(const double percentAlpha_=80.0,const double sigma_=0.5,
1185      const ssize_t x_=5,const ssize_t y_=5);
1186
1187    // Sharpen pixels in image
1188    // The radius_ parameter specifies the radius of the Gaussian, in
1189    // pixels, not counting the center pixel.  The sigma_ parameter
1190    // specifies the standard deviation of the Laplacian, in pixels.
1191    void sharpen(const double radius_=0.0,const double sigma_=1.0);
1192    void sharpenChannel(const ChannelType channel_,const double radius_=0.0,
1193      const double sigma_=1.0);
1194
1195    // Shave pixels from image edges.
1196    void shave(const Geometry &geometry_);
1197
1198    // Shear image (create parallelogram by sliding image by X or Y axis)
1199    void shear(const double xShearAngle_,const double yShearAngle_);
1200
1201    // adjust the image contrast with a non-linear sigmoidal contrast algorithm
1202    void sigmoidalContrast(const size_t sharpen_,const double contrast,
1203      const double midpoint=QuantumRange/2.0);
1204
1205    // Image signature. Set force_ to true in order to re-calculate
1206    // the signature regardless of whether the image data has been
1207    // modified.
1208    std::string signature(const bool force_=false) const;
1209
1210    // Solarize image (similar to effect seen when exposing a
1211    // photographic film to light during the development process)
1212    void solarize(const double factor_=50.0);
1213
1214    // Sparse color image, given a set of coordinates, interpolates the colors
1215    // found at those coordinates, across the whole image, using various
1216    // methods.
1217    void sparseColor(const ChannelType channel_,
1218      const SparseColorMethod method_,const size_t numberArguments_,
1219      const double *arguments_);
1220
1221    // Splice the background color into the image.
1222    void splice(const Geometry &geometry_);
1223
1224    // Spread pixels randomly within image by specified ammount
1225    void spread(const size_t amount_=3);
1226
1227    void statistics(ImageStatistics *statistics);
1228
1229    // Add a digital watermark to the image (based on second image)
1230    void stegano(const Image &watermark_);
1231
1232    // Create an image which appears in stereo when viewed with
1233    // red-blue glasses (Red image on left, blue on right)
1234    void stereo(const Image &rightImage_);
1235
1236    // Strip strips an image of all profiles and comments.
1237    void strip(void);
1238
1239    // Swirl image (image pixels are rotated by degrees)
1240    void swirl(const double degrees_);
1241
1242    // Transfers the image cache pixels to the image.
1243    void syncPixels(void);
1244
1245    // Channel a texture on image background
1246    void texture(const Image &texture_);
1247
1248    // Threshold image
1249    void threshold(const double threshold_);
1250
1251    // Resize image to thumbnail size
1252    void thumbnail(const Geometry &geometry_);
1253
1254    // Transform image based on image and crop geometries
1255    // Crop geometry is optional
1256    void transform(const Geometry &imageGeometry_);
1257    void transform(const Geometry &imageGeometry_,
1258      const Geometry &cropGeometry_);
1259
1260    // Origin of coordinate system to use when annotating with text or drawing
1261    void transformOrigin(const double x_,const double y_);
1262
1263    // Reset transformation parameters to default
1264    void transformReset(void);
1265
1266    // Scale to use when annotating with text or drawing
1267    void transformScale(const double sx_,const double sy_);
1268
1269    // Add matte image to image, setting pixels matching color to
1270    // transparent
1271    void transparent(const Color &color_);
1272
1273    // Add matte image to image, for all the pixels that lies in between
1274    // the given two color
1275    void transparentChroma(const Color &colorLow_,const Color &colorHigh_);
1276
1277    // Trim edges that are the background color from the image
1278    void trim(void);
1279
1280    // Replace image with a sharpened version of the original image
1281    // using the unsharp mask algorithm.
1282    //  radius_
1283    //    the radius of the Gaussian, in pixels, not counting the
1284    //    center pixel.
1285    //  sigma_
1286    //    the standard deviation of the Gaussian, in pixels.
1287    //  amount_
1288    //    the percentage of the difference between the original and
1289    //    the blur image that is added back into the original.
1290    // threshold_
1291    //   the threshold in pixels needed to apply the diffence amount.
1292    void unsharpmask(const double radius_,const double sigma_,
1293      const double amount_,const double threshold_);
1294    void unsharpmaskChannel(const ChannelType channel_,const double radius_,
1295      const double sigma_,const double amount_,const double threshold_);
1296
1297    // Map image pixels to a sine wave
1298    void wave(const double amplitude_=25.0,const double wavelength_=150.0);
1299
1300    // Forces all pixels above the threshold into white while leaving all
1301    // pixels at or below the threshold unchanged.
1302    void whiteThreshold(const std::string &threshold_);
1303    void whiteThresholdChannel(const ChannelType channel_,
1304      const std::string &threshold_);
1305
1306    // Write single image frame to in-memory BLOB, with optional
1307    // format and adjoin parameters.
1308    void write(Blob *blob_);
1309    void write(Blob *blob_,const std::string &magick_);
1310    void write(Blob *blob_,const std::string &magick_,const size_t depth_);
1311
1312    // Write single image frame to an array of pixels with storage
1313    // type specified by user (DispatchImage), e.g.
1314    // image.write( 0, 0, 640, 1, "RGB", 0, pixels );
1315    void write(const ::ssize_t x_,const ::ssize_t y_,const size_t columns_,
1316      const size_t rows_,const std::string &map_,const StorageType type_,
1317      void *pixels_);
1318
1319    // Write single image frame to a file
1320    void write(const std::string &imageSpec_);
1321
1322    // Transfers one or more pixel components from the image pixel
1323    // cache to a buffer or file.
1324    // Used to support image encoders.
1325    void writePixels(const QuantumType quantum_,unsigned char *destination_);
1326
1327    // Zoom image to specified size.
1328    void zoom(const Geometry &geometry_);
1329
1330    //////////////////////////////////////////////////////////////////////
1331    //
1332    // No user-serviceable parts beyond this point
1333    //
1334    //////////////////////////////////////////////////////////////////////
1335
1336    // Construct with MagickCore::Image and default options
1337    Image(MagickCore::Image *image_);
1338
1339    // Retrieve Image*
1340    MagickCore::Image *&image(void);
1341    const MagickCore::Image *constImage(void) const;
1342
1343    // Retrieve ImageInfo*
1344    MagickCore::ImageInfo *imageInfo(void);
1345    const MagickCore::ImageInfo *constImageInfo(void) const;
1346
1347    // Retrieve Options*
1348    Options *options(void);
1349    const Options *constOptions(void) const;
1350
1351    // Retrieve QuantizeInfo*
1352    MagickCore::QuantizeInfo *quantizeInfo(void);
1353    const MagickCore::QuantizeInfo *constQuantizeInfo(void) const;
1354
1355    // Prepare to update image (copy if reference > 1)
1356    void modifyImage(void);
1357
1358    // Register image with image registry or obtain registration id
1359    ::ssize_t registerId(void);
1360
1361    // Replace current image (reference counted)
1362    MagickCore::Image *replaceImage(MagickCore::Image *replacement_);
1363
1364    // Unregister image from image registry
1365    void unregisterId(void);
1366
1367  private:
1368
1369    ImageRef *_imgRef;
1370  };
1371
1372} // end of namespace Magick
1373
1374#endif // Magick_Image_header
1375