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