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