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