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