Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:01:18

0001 // This may look like C code, but it is really -*- C++ -*-
0002 //
0003 // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
0004 //
0005 // Copyright @ 2013 ImageMagick Studio LLC, a non-profit organization
0006 // dedicated to making software imaging solutions freely available.
0007 //
0008 // Definition of Image, the representation of a single image in Magick++
0009 //
0010 
0011 #if !defined(Magick_Image_header)
0012 #define Magick_Image_header
0013 
0014 #include "Magick++/Include.h"
0015 #include <string>
0016 #include <list>
0017 #include "Magick++/Blob.h"
0018 #include "Magick++/Color.h"
0019 #include "Magick++/Drawable.h"
0020 #include "Magick++/Exception.h"
0021 #include "Magick++/Geometry.h"
0022 #include "Magick++/Statistic.h"
0023 #include "Magick++/TypeMetric.h"
0024 
0025 namespace Magick
0026 {
0027   // Forward declarations
0028   class Options;
0029   class ImageRef;
0030 
0031   extern MagickPPExport const char *borderGeometryDefault;
0032   extern MagickPPExport const char *frameGeometryDefault;
0033   extern MagickPPExport const char *raiseGeometryDefault;
0034 
0035   // Compare two Image objects regardless of LHS/RHS
0036   // Image sizes and signatures are used as basis of comparison
0037   MagickPPExport int operator ==
0038     (const Magick::Image &left_,const Magick::Image &right_);
0039   MagickPPExport int operator !=
0040     (const Magick::Image &left_,const Magick::Image &right_);
0041   MagickPPExport int operator >
0042     (const Magick::Image &left_,const Magick::Image &right_);
0043   MagickPPExport int operator <
0044     (const Magick::Image &left_,const Magick::Image &right_);
0045   MagickPPExport int operator >=
0046     (const Magick::Image &left_,const Magick::Image &right_);
0047   MagickPPExport int operator <=
0048     (const Magick::Image &left_,const Magick::Image &right_);
0049 
0050   //
0051   // Image is the representation of an image. In reality, it actually
0052   // a handle object which contains a pointer to a shared reference
0053   // object (ImageRef). As such, this object is extremely space efficient.
0054   //
0055   class MagickPPExport Image
0056   {
0057   public:
0058 
0059     // Default constructor
0060     Image(void);
0061 
0062     // Construct Image from in-memory BLOB
0063     Image(const Blob &blob_);
0064 
0065     // Construct Image of specified size from in-memory BLOB
0066     Image(const Blob &blob_,const Geometry &size_);
0067 
0068     // Construct Image of specified size and depth from in-memory BLOB
0069     Image(const Blob &blob_,const Geometry &size_,const size_t depth_);
0070 
0071     // Construct Image of specified size, depth, and format from
0072     // in-memory BLOB
0073     Image(const Blob &blob_,const Geometry &size_,const size_t depth_,
0074       const std::string &magick_);
0075 
0076     // Construct Image of specified size, and format from in-memory BLOB
0077     Image(const Blob &blob_,const Geometry &size_,const std::string &magick_);
0078 
0079     // Construct a blank image canvas of specified size and color
0080     Image(const Geometry &size_,const Color &color_);
0081 
0082     // Copy constructor
0083     Image(const Image &image_);
0084 
0085     // Copy constructor to copy part of the image
0086     Image(const Image &image_,const Geometry &geometry_);
0087 
0088     // Construct an image based on an array of raw pixels, of
0089     // specified type and mapping, in memory
0090     Image(const size_t width_,const size_t height_,const std::string &map_,
0091       const StorageType type_,const void *pixels_);
0092 
0093     // Construct from image file or image specification
0094     Image(const std::string &imageSpec_);
0095 
0096     // Destructor
0097     virtual ~Image();
0098 
0099     // Assignment operator
0100     Image& operator=(const Image &image_);
0101 
0102     // Join images into a single multi-image file
0103     void adjoin(const bool flag_);
0104     bool adjoin(void) const;
0105 
0106     // Image supports transparency (alpha channel)
0107     void alpha(const bool alphaFlag_);
0108     bool alpha(void) const;
0109 
0110     // Transparent color
0111     void matteColor(const Color &matteColor_);
0112     Color matteColor(void) const;
0113 
0114     // Time in 1/100ths of a second which must expire before
0115     // displaying the next image in an animated sequence.
0116     void animationDelay(const size_t delay_);
0117     size_t animationDelay(void) const;
0118 
0119     // Number of iterations to loop an animation (e.g. Netscape loop
0120     // extension) for.
0121     void animationIterations(const size_t iterations_);
0122     size_t animationIterations(void) const;
0123 
0124     // Image background color
0125     void backgroundColor(const Color &color_);
0126     Color backgroundColor(void) const;
0127 
0128     // Name of texture image to tile onto the image background
0129     void backgroundTexture(const std::string &backgroundTexture_);
0130     std::string backgroundTexture(void) const;
0131 
0132     // Base image width (before transformations)
0133     size_t baseColumns(void) const;
0134 
0135     // Base image filename (before transformations)
0136     std::string baseFilename(void) const;
0137 
0138     // Base image height (before transformations)
0139     size_t baseRows(void) const;
0140 
0141     // Use black point compensation.
0142     void blackPointCompensation(const bool flag_);
0143     bool blackPointCompensation(void) const;
0144 
0145     // Image border color
0146     void borderColor(const Color &color_);
0147     Color borderColor(void) const;
0148 
0149     // Return smallest bounding box enclosing non-border pixels. The
0150     // current fuzz value is used when discriminating between pixels.
0151     // This is the crop bounding box used by crop(Geometry(0,0));
0152     Geometry boundingBox(void) const;
0153 
0154     // Text bounding-box base color (default none)
0155     void boxColor(const Color &boxColor_);
0156     Color boxColor(void) const;
0157 
0158     // Set or obtain modulus channel depth
0159     void channelDepth(const ChannelType channel_,const size_t depth_);
0160     size_t channelDepth(const ChannelType channel_);
0161 
0162     // Returns the number of channels in this image.
0163     size_t channels() const;
0164 
0165     // Image class (DirectClass or PseudoClass)
0166     // NOTE: setting a DirectClass image to PseudoClass will result in
0167     // the loss of color information if the number of colors in the
0168     // image is greater than the maximum palette size (either 256 or
0169     // 65536 entries depending on the value of MAGICKCORE_QUANTUM_DEPTH when
0170     // ImageMagick was built).
0171     void classType(const ClassType class_);
0172     ClassType classType(void) const;
0173 
0174     // Colors within this distance are considered equal
0175     void colorFuzz(const double fuzz_);
0176     double colorFuzz(void) const;
0177 
0178     // Colormap size (number of colormap entries)
0179     void colorMapSize(const size_t entries_);
0180     size_t colorMapSize(void) const;
0181 
0182     // Image Color Space
0183     void colorSpace(const ColorspaceType colorSpace_);
0184     ColorspaceType colorSpace(void) const;
0185 
0186     void colorSpaceType(const ColorspaceType colorSpace_);
0187     ColorspaceType colorSpaceType(void) const;
0188 
0189     // Image width
0190     size_t columns(void) const;
0191 
0192     // Comment image (add comment string to image)
0193     void comment(const std::string &comment_);
0194     std::string comment(void) const;
0195 
0196     // Composition operator to be used when composition is implicitly
0197     // used (such as for image flattening).
0198     void compose(const CompositeOperator compose_);
0199     CompositeOperator compose(void) const;
0200 
0201     // Compression type
0202     void compressType(const CompressionType compressType_);
0203     CompressionType compressType(void) const;
0204 
0205     // Enable printing of debug messages from ImageMagick
0206     void debug(const bool flag_);
0207     bool debug(void) const;
0208 
0209     // Vertical and horizontal resolution in pixels of the image
0210     void density(const Point &density_);
0211     Point density(void) const;
0212 
0213     // Image depth (bits allocated to red/green/blue components)
0214     void depth(const size_t depth_);
0215     size_t depth(void) const;
0216 
0217     // Tile names from within an image montage
0218     std::string directory(void) const;
0219 
0220     // Endianness (little like Intel or big like SPARC) for image
0221     // formats which support endian-specific options.
0222     void endian(const EndianType endian_);
0223     EndianType endian(void) const;
0224 
0225     // Exif profile (BLOB)
0226     void exifProfile(const Blob &exifProfile_);
0227     Blob exifProfile(void) const;
0228 
0229     // Image file name
0230     void fileName(const std::string &fileName_);
0231     std::string fileName(void) const;
0232 
0233     // Number of bytes of the image on disk
0234     MagickSizeType fileSize(void) const;
0235 
0236     // Color to use when filling drawn objects
0237     void fillColor(const Color &fillColor_);
0238     Color fillColor(void) const;
0239 
0240     // Rule to use when filling drawn objects
0241     void fillRule(const FillRule &fillRule_);
0242     FillRule fillRule(void) const;
0243 
0244     // Pattern to use while filling drawn objects.
0245     void fillPattern(const Image &fillPattern_);
0246     Image fillPattern(void) const;
0247 
0248     // Filter to use when resizing image
0249     void filterType(const FilterType filterType_);
0250     FilterType filterType(void) const;
0251 
0252     // Text rendering font
0253     void font(const std::string &font_);
0254     std::string font(void) const;
0255 
0256     // Font family
0257     void fontFamily(const std::string &family_);
0258     std::string fontFamily(void) const;
0259 
0260     // Font point size
0261     void fontPointsize(const double pointSize_);
0262     double fontPointsize(void) const;
0263 
0264     // Font style
0265     void fontStyle(const StyleType style_);
0266     StyleType fontStyle(void) const;
0267 
0268     // Font weight
0269     void fontWeight(const size_t weight_);
0270     size_t fontWeight(void) const;
0271 
0272     // Long image format description
0273     std::string format(void) const;
0274 
0275     // Formats the specified expression
0276     // More info here: https://imagemagick.org/script/escape.php
0277     std::string formatExpression(const std::string expression);
0278 
0279     // Gamma level of the image
0280     double gamma(void) const;
0281 
0282     // Preferred size of the image when encoding
0283     Geometry geometry(void) const;
0284 
0285     // GIF disposal method
0286     void gifDisposeMethod(const DisposeType disposeMethod_);
0287     DisposeType gifDisposeMethod(void) const;
0288 
0289     bool hasChannel(const PixelChannel channel) const;
0290 
0291     // When comparing images, emphasize pixel differences with this color.
0292     void highlightColor(const Color color_);
0293 
0294     // ICC color profile (BLOB)
0295     void iccColorProfile(const Blob &colorProfile_);
0296     Blob iccColorProfile(void) const;
0297 
0298     // Type of interlacing to use
0299     void interlaceType(const InterlaceType interlace_);
0300     InterlaceType interlaceType(void) const;
0301 
0302     // Pixel color interpolation method to use
0303     void interpolate(const PixelInterpolateMethod interpolate_);
0304     PixelInterpolateMethod interpolate(void) const;
0305 
0306     // IPTC profile (BLOB)
0307     void iptcProfile(const Blob &iptcProfile_);
0308     Blob iptcProfile(void) const;
0309 
0310     // Returns true if none of the pixels in the image have an alpha value
0311     // other than OpaqueAlpha (QuantumRange).
0312     bool isOpaque(void) const;
0313 
0314     // Does object contain valid image?
0315     void isValid(const bool isValid_);
0316     bool isValid(void) const;
0317 
0318     // Image label
0319     void label(const std::string &label_);
0320     std::string label(void) const;
0321 
0322     // When comparing images, de-emphasize pixel differences with this color.
0323     void lowlightColor(const Color color_);
0324 
0325     // File type magick identifier (.e.g "GIF")
0326     void magick(const std::string &magick_);
0327     std::string magick(void) const;
0328 
0329     // When comparing images, set pixels with a read mask to this color.
0330     void masklightColor(const Color color_);
0331 
0332     // The mean error per pixel computed when an image is color reduced
0333     double meanErrorPerPixel(void) const;
0334 
0335     // Image modulus depth (minimum number of bits required to support
0336     // red/green/blue components without loss of accuracy)
0337     void modulusDepth(const size_t modulusDepth_);
0338     size_t modulusDepth(void) const;
0339 
0340     // Transform image to black and white
0341     void monochrome(const bool monochromeFlag_);
0342     bool monochrome(void) const;
0343 
0344     // Tile size and offset within an image montage
0345     Geometry montageGeometry(void) const;
0346 
0347     // The normalized max error per pixel computed when an image is
0348     // color reduced.
0349     double normalizedMaxError(void) const;
0350 
0351     // The normalized mean error per pixel computed when an image is
0352     // color reduced.
0353     double normalizedMeanError(void) const;
0354 
0355     // Image orientation
0356     void orientation(const OrientationType orientation_);
0357     OrientationType orientation(void) const;
0358 
0359     // Preferred size and location of an image canvas.
0360     void page(const Geometry &pageSize_);
0361     Geometry page(void) const;
0362 
0363     // JPEG/MIFF/PNG compression level (default 75).
0364     void quality(const size_t quality_);
0365     size_t quality(void) const;
0366 
0367     // Maximum number of colors to quantize to
0368     void quantizeColors(const size_t colors_);
0369     size_t quantizeColors(void) const;
0370 
0371     // Colorspace to quantize in.
0372     void quantizeColorSpace(const ColorspaceType colorSpace_);
0373     ColorspaceType quantizeColorSpace(void) const;
0374 
0375     // Dither image during quantization (default true).
0376     void quantizeDither(const bool ditherFlag_);
0377     bool quantizeDither(void) const;
0378 
0379     // Dither method
0380     void quantizeDitherMethod(const DitherMethod ditherMethod_);
0381     DitherMethod quantizeDitherMethod(void) const;
0382 
0383     // Quantization tree-depth
0384     void quantizeTreeDepth(const size_t treeDepth_);
0385     size_t quantizeTreeDepth(void) const;
0386 
0387     // Suppress all warning messages. Error messages are still reported.
0388     void quiet(const bool quiet_);
0389     bool quiet(void) const;
0390 
0391     // The type of rendering intent
0392     void renderingIntent(const RenderingIntent renderingIntent_);
0393     RenderingIntent renderingIntent(void) const;
0394 
0395     // Units of image resolution
0396     void resolutionUnits(const ResolutionType resolutionUnits_);
0397     ResolutionType resolutionUnits(void) const;
0398 
0399     // The number of pixel rows in the image
0400     size_t rows(void) const;
0401 
0402     // Image sampling factor
0403     void samplingFactor(const std::string &samplingFactor_);
0404     std::string samplingFactor(void) const;
0405 
0406     // Image scene number
0407     void scene(const size_t scene_);
0408     size_t scene(void) const;
0409 
0410     // Width and height of a raw image
0411     void size(const Geometry &geometry_);
0412     Geometry size(void) const;
0413 
0414     // enabled/disable stroke anti-aliasing
0415     void strokeAntiAlias(const bool flag_);
0416     bool strokeAntiAlias(void) const;
0417 
0418     // Color to use when drawing object outlines
0419     void strokeColor(const Color &strokeColor_);
0420     Color strokeColor(void) const;
0421 
0422     // Specify the pattern of dashes and gaps used to stroke
0423     // paths. The strokeDashArray represents a zero-terminated array
0424     // of numbers that specify the lengths of alternating dashes and
0425     // gaps in pixels. If an odd number of values is provided, then
0426     // the list of values is repeated to yield an even number of
0427     // values.  A typical strokeDashArray_ array might contain the
0428     // members 5 3 2 0, where the zero value indicates the end of the
0429     // pattern array.
0430     void strokeDashArray(const double *strokeDashArray_);
0431     const double *strokeDashArray(void) const;
0432 
0433     // While drawing using a dash pattern, specify distance into the
0434     // dash pattern to start the dash (default 0).
0435     void strokeDashOffset(const double strokeDashOffset_);
0436     double strokeDashOffset(void) const;
0437 
0438     // Specify the shape to be used at the end of open subpaths when
0439     // they are stroked. Values of LineCap are UndefinedCap, ButtCap,
0440     // RoundCap, and SquareCap.
0441     void strokeLineCap(const LineCap lineCap_);
0442     LineCap strokeLineCap(void) const;
0443 
0444     // Specify the shape to be used at the corners of paths (or other
0445     // vector shapes) when they are stroked. Values of LineJoin are
0446     // UndefinedJoin, MiterJoin, RoundJoin, and BevelJoin.
0447     void strokeLineJoin(const LineJoin lineJoin_);
0448     LineJoin strokeLineJoin(void) const;
0449 
0450     // Specify miter limit. When two line segments meet at a sharp
0451     // angle and miter joins have been specified for 'lineJoin', it is
0452     // possible for the miter to extend far beyond the thickness of
0453     // the line stroking the path. The miterLimit' imposes a limit on
0454     // the ratio of the miter length to the 'lineWidth'. The default
0455     // value of this parameter is 4.
0456     void strokeMiterLimit(const size_t miterLimit_);
0457     size_t strokeMiterLimit(void) const;
0458 
0459     // Pattern image to use while stroking object outlines.
0460     void strokePattern(const Image &strokePattern_);
0461     Image strokePattern(void) const;
0462 
0463     // Stroke width for drawing vector objects (default one)
0464     void strokeWidth(const double strokeWidth_);
0465     double strokeWidth(void) const;
0466 
0467     // Subimage of an image sequence
0468     void subImage(const size_t subImage_);
0469     size_t subImage(void) const;
0470 
0471     // Number of images relative to the base image
0472     void subRange(const size_t subRange_);
0473     size_t subRange(void) const;
0474 
0475     // Anti-alias Postscript and TrueType fonts (default true)
0476     void textAntiAlias(const bool flag_);
0477     bool textAntiAlias(void) const;
0478 
0479     // Render text right-to-left or left-to-right.
0480     void textDirection(DirectionType direction_);
0481     DirectionType textDirection() const;
0482 
0483     // Annotation text encoding (e.g. "UTF-16")
0484     void textEncoding(const std::string &encoding_);
0485     std::string textEncoding(void) const;
0486 
0487     // Text gravity.
0488     void textGravity(GravityType gravity_);
0489     GravityType textGravity() const;
0490 
0491     // Text inter-line spacing
0492     void textInterlineSpacing(double spacing_);
0493     double textInterlineSpacing(void) const;
0494 
0495     // Text inter-word spacing
0496     void textInterwordSpacing(double spacing_);
0497     double textInterwordSpacing(void) const;
0498 
0499     // Text inter-character kerning
0500     void textKerning(double kerning_);
0501     double textKerning(void) const;
0502 
0503     // Text undercolor box
0504     void textUnderColor(const Color &underColor_);
0505     Color textUnderColor(void) const;
0506 
0507     // Number of colors in the image
0508     size_t totalColors(void) const;
0509 
0510     // Rotation to use when annotating with text or drawing
0511     void transformRotation(const double angle_);
0512 
0513     // Skew to use in X axis when annotating with text or drawing
0514     void transformSkewX(const double skewx_);
0515 
0516     // Skew to use in Y axis when annotating with text or drawing
0517     void transformSkewY(const double skewy_);
0518 
0519     // Image representation type (also see type operation)
0520     //   Available types:
0521     //    Bilevel         PaletteBilevelAlpha
0522     //    Grayscale       GrayscaleAlpha
0523     //    Palette         PaletteAlpha
0524     //    TrueColor       TrueColorAlpha
0525     //    ColorSeparation ColorSeparationAlpha
0526     void type(const ImageType type_);
0527     ImageType type(void) const;
0528 
0529     // Print detailed information about the image
0530     void verbose(const bool verboseFlag_);
0531     bool verbose(void) const;
0532 
0533     // Virtual pixel method
0534     void virtualPixelMethod(const VirtualPixelMethod virtualPixelMethod_);
0535     VirtualPixelMethod virtualPixelMethod(void) const;
0536 
0537     // X11 display to display to, obtain fonts from, or to capture
0538     // image from
0539     void x11Display(const std::string &display_);
0540     std::string x11Display(void) const;
0541 
0542     // x resolution of the image
0543     double xResolution(void) const;
0544 
0545     // y resolution of the image
0546     double yResolution(void) const;
0547 
0548     // Adaptive-blur image with specified blur factor
0549     // The radius_ parameter specifies the radius of the Gaussian, in
0550     // pixels, not counting the center pixel.  The sigma_ parameter
0551     // specifies the standard deviation of the Laplacian, in pixels.
0552     void adaptiveBlur(const double radius_=0.0,const double sigma_=1.0);
0553 
0554     // This is shortcut function for a fast interpolative resize using mesh
0555     // interpolation.  It works well for small resizes of less than +/- 50%
0556     // of the original image size.  For larger resizing on images a full
0557     // filtered and slower resize function should be used instead.
0558     void adaptiveResize(const Geometry &geometry_);
0559 
0560     // Adaptively sharpens the image by sharpening more intensely near image
0561     // edges and less intensely far from edges. We sharpen the image with a
0562     // Gaussian operator of the given radius and standard deviation (sigma).
0563     // For reasonable results, radius should be larger than sigma.
0564     void adaptiveSharpen(const double radius_=0.0,const double sigma_=1.0);
0565     void adaptiveSharpenChannel(const ChannelType channel_,
0566       const double radius_=0.0,const double sigma_=1.0);
0567 
0568     // Local adaptive threshold image
0569     // http://www.dai.ed.ac.uk/HIPR2/adpthrsh.htm
0570     // Width x height define the size of the pixel neighborhood
0571     // bias = constant to subtract from pixel neighborhood mean
0572     void adaptiveThreshold(const size_t width_,const size_t height_,
0573       const double bias_=0.0);
0574 
0575     // Add noise to image with specified noise type
0576     void addNoise(const NoiseType noiseType_,const double attenuate_=1.0);
0577     void addNoiseChannel(const ChannelType channel_,
0578       const NoiseType noiseType_,const double attenuate_=1.0);
0579 
0580     // Transform image by specified affine (or free transform) matrix.
0581     void affineTransform(const DrawableAffine &affine);
0582 
0583     // Set or attenuate the alpha channel in the image. If the image
0584     // pixels are opaque then they are set to the specified alpha
0585     // value, otherwise they are blended with the supplied alpha
0586     // value.  The value of alpha_ ranges from 0 (completely opaque)
0587     // to QuantumRange. The defines OpaqueAlpha and TransparentAlpha are
0588     // available to specify completely opaque or completely
0589     // transparent, respectively.
0590     void alpha(const unsigned int alpha_);
0591 
0592     // AlphaChannel() activates, deactivates, resets, or sets the alpha
0593     // channel.
0594     void alphaChannel(AlphaChannelOption alphaOption_);
0595 
0596     //
0597     // Annotate image (draw text on image)
0598     //
0599     // Gravity effects text placement in bounding area according to rules:
0600     //  NorthWestGravity  text bottom-left corner placed at top-left
0601     //  NorthGravity      text bottom-center placed at top-center
0602     //  NorthEastGravity  text bottom-right corner placed at top-right
0603     //  WestGravity       text left-center placed at left-center
0604     //  CenterGravity     text center placed at center
0605     //  EastGravity       text right-center placed at right-center
0606     //  SouthWestGravity  text top-left placed at bottom-left
0607     //  SouthGravity      text top-center placed at bottom-center
0608     //  SouthEastGravity  text top-right placed at bottom-right
0609 
0610     // Annotate using specified text, and placement location
0611     void annotate(const std::string &text_,const Geometry &location_);
0612 
0613     // Annotate using specified text, bounding area, and placement
0614     // gravity
0615     void annotate(const std::string &text_,const Geometry &boundingArea_,
0616       const GravityType gravity_);
0617 
0618     // Annotate with text using specified text, bounding area,
0619     // placement gravity, and rotation.
0620     void annotate(const std::string &text_,const Geometry &boundingArea_,
0621       const GravityType gravity_,const double degrees_);
0622 
0623     // Annotate with text (bounding area is entire image) and placement
0624     // gravity.
0625     void annotate(const std::string &text_,const GravityType gravity_);
0626 
0627     // Inserts the artifact with the specified name and value into
0628     // the artifact tree of the image.
0629     void artifact(const std::string &name_,const std::string &value_);
0630 
0631     // Returns the value of the artifact with the specified name.
0632     std::string artifact(const std::string &name_) const;
0633 
0634     // Access/Update a named image attribute
0635     void attribute(const std::string name_,const char *value_);
0636     void attribute(const std::string name_,const std::string value_);
0637     std::string attribute(const std::string name_) const;
0638 
0639     // Extracts the 'mean' from the image and adjust the image to try
0640     // make set its gamma appropriately.
0641     void autoGamma(void);
0642     void autoGammaChannel(const ChannelType channel_);
0643 
0644     // Adjusts the levels of a particular image channel by scaling the
0645     // minimum and maximum values to the full quantum range.
0646     void autoLevel(void);
0647     void autoLevelChannel(const ChannelType channel_);
0648 
0649     // Adjusts an image so that its orientation is suitable for viewing.
0650     void autoOrient(void);
0651 
0652     // Automatically selects a threshold and replaces each pixel in the image
0653     // with a black pixel if the image intensity is less than the selected
0654     // threshold otherwise white.
0655     void autoThreshold(const AutoThresholdMethod method_);
0656 
0657     // Forces all pixels below the threshold into black while leaving all
0658     // pixels at or above the threshold unchanged.
0659     void blackThreshold(const std::string &threshold_);
0660     void blackThresholdChannel(const ChannelType channel_,
0661       const std::string &threshold_);
0662 
0663      // Simulate a scene at nighttime in the moonlight.
0664     void blueShift(const double factor_=1.5);
0665 
0666     // Blur image with specified blur factor
0667     // The radius_ parameter specifies the radius of the Gaussian, in
0668     // pixels, not counting the center pixel.  The sigma_ parameter
0669     // specifies the standard deviation of the Laplacian, in pixels.
0670     void blur(const double radius_=0.0,const double sigma_=1.0);
0671     void blurChannel(const ChannelType channel_,const double radius_=0.0,
0672       const double sigma_=1.0);
0673 
0674     // Border image (add border to image)
0675     void border(const Geometry &geometry_=borderGeometryDefault);
0676 
0677     // Changes the brightness and/or contrast of an image. It converts the
0678     // brightness and contrast parameters into slope and intercept and calls
0679     // a polynomial function to apply to the image.
0680     void brightnessContrast(const double brightness_=0.0,
0681       const double contrast_=0.0);
0682     void brightnessContrastChannel(const ChannelType channel_,
0683       const double brightness_=0.0,const double contrast_=0.0);
0684 
0685     // Uses a multi-stage algorithm to detect a wide range of edges in images.
0686     void cannyEdge(const double radius_=0.0,const double sigma_=1.0,
0687       const double lowerPercent_=0.1,const double upperPercent_=0.3);
0688 
0689     // Accepts a lightweight Color Correction Collection
0690     // (CCC) file which solely contains one or more color corrections and
0691     // applies the correction to the image.
0692     void cdl(const std::string &cdl_);
0693 
0694     // Extract channel from image
0695     void channel(const ChannelType channel_);
0696 
0697     // Charcoal effect image (looks like charcoal sketch)
0698     // The radius_ parameter specifies the radius of the Gaussian, in
0699     // pixels, not counting the center pixel.  The sigma_ parameter
0700     // specifies the standard deviation of the Laplacian, in pixels.
0701     void charcoal(const double radius_=0.0,const double sigma_=1.0);
0702     void charcoalChannel(const ChannelType channel_,const double radius_=0.0,
0703       const double sigma_=1.0);
0704 
0705     // Chop image (remove vertical or horizontal subregion of image)
0706     // FIXME: describe how geometry argument is used to select either
0707     // horizontal or vertical subregion of image.
0708     void chop(const Geometry &geometry_);
0709 
0710     // Chromaticity blue primary point.
0711     void chromaBluePrimary(const double x_,const double y_,const double z_);
0712     void chromaBluePrimary(double *x_,double *y_,double *z_) const;
0713 
0714     // Chromaticity green primary point.
0715     void chromaGreenPrimary(const double x_,const double y_,const double z_);
0716     void chromaGreenPrimary(double *x_,double *y_,double *z_) const;
0717 
0718     // Chromaticity red primary point.
0719     void chromaRedPrimary(const double x_,const double y_,const double z_);
0720     void chromaRedPrimary(double *x_,double *y_,double *z_) const;
0721 
0722     // Chromaticity white point.
0723     void chromaWhitePoint(const double x_,const double y_,const double z_);
0724     void chromaWhitePoint(double *x_,double *y_,double *z_) const;
0725 
0726     // Set each pixel whose value is below zero to zero and any the
0727     // pixel whose value is above the quantum range to the quantum range (e.g.
0728     // 65535) otherwise the pixel value remains unchanged.
0729     void clamp(void);
0730     void clampChannel(const ChannelType channel_);
0731 
0732     // Sets the image clip mask based on any clipping path information
0733     // if it exists.
0734     void clip(void);
0735     void clipPath(const std::string pathname_,const bool inside_);
0736 
0737     // Apply a color lookup table (CLUT) to the image.
0738     void clut(const Image &clutImage_,const PixelInterpolateMethod method);
0739     void clutChannel(const ChannelType channel_,const Image &clutImage_,
0740       const PixelInterpolateMethod method);
0741 
0742     // Colorize image with pen color, using specified percent alpha.
0743     void colorize(const unsigned int alpha_,const Color &penColor_);
0744 
0745     // Colorize image with pen color, using specified percent alpha
0746     // for red, green, and blue quantums
0747     void colorize(const unsigned int alphaRed_,const unsigned int alphaGreen_,
0748        const unsigned int alphaBlue_,const Color &penColor_);
0749 
0750      // Color at colormap position index_
0751     void colorMap(const size_t index_,const Color &color_);
0752     Color colorMap(const size_t index_) const;
0753 
0754     // Apply a color matrix to the image channels. The user supplied
0755     // matrix may be of order 1 to 5 (1x1 through 5x5).
0756     void colorMatrix(const size_t order_,const double *color_matrix_);
0757 
0758     // Compare current image with another image
0759     // False is returned if the images are not identical.
0760     bool compare(const Image &reference_) const;
0761 
0762     // Compare current image with another image
0763     // Returns the distortion based on the specified metric.
0764     double compare(const Image &reference_,const MetricType metric_);
0765     double compareChannel(const ChannelType channel_,
0766                                      const Image &reference_,
0767                                      const MetricType metric_ );
0768 
0769     // Compare current image with another image
0770     // Sets the distortion and returns the difference image.
0771     Image compare(const Image &reference_,const MetricType metric_,
0772       double *distortion);
0773     Image compareChannel(const ChannelType channel_,const Image &reference_,
0774       const MetricType metric_,double *distortion);
0775 
0776     // Compose an image onto another at specified offset and using
0777     // specified algorithm
0778     void composite(const Image &compositeImage_,const Geometry &offset_,
0779       const CompositeOperator compose_=InCompositeOp);
0780     void composite(const Image &compositeImage_,const GravityType gravity_,
0781       const CompositeOperator compose_=InCompositeOp);
0782     void composite(const Image &compositeImage_,const ::ssize_t xOffset_,
0783       const ::ssize_t yOffset_,const CompositeOperator compose_=InCompositeOp);
0784 
0785     // Determines the connected-components of the image
0786     void connectedComponents(const size_t connectivity_);
0787 
0788     // Contrast image (enhance intensity differences in image)
0789     void contrast(const bool sharpen_);
0790 
0791     // A simple image enhancement technique that attempts to improve the
0792     // contrast in an image by 'stretching' the range of intensity values
0793     // it contains to span a desired range of values. It differs from the
0794     // more sophisticated histogram equalization in that it can only apply a
0795     // linear scaling function to the image pixel values. As a result the
0796     // 'enhancement' is less harsh.
0797     void contrastStretch(const double blackPoint_,const double whitePoint_);
0798     void contrastStretchChannel(const ChannelType channel_,
0799       const double blackPoint_,const double whitePoint_);
0800 
0801     // Convolve image.  Applies a user-specified convolution to the image.
0802     //  order_ represents the number of columns and rows in the filter kernel.
0803     //  kernel_ is an array of doubles representing the convolution kernel.
0804     void convolve(const size_t order_,const double *kernel_);
0805 
0806     // Copies pixels from the source image as defined by the geometry the
0807     // destination image at the specified offset.
0808     void copyPixels(const Image &source_,const Geometry &geometry_,
0809       const Offset &offset_);
0810 
0811     // Crop image (subregion of original image)
0812     void crop(const Geometry &geometry_);
0813 
0814     // Cycle image colormap
0815     void cycleColormap(const ::ssize_t amount_);
0816 
0817     // Converts cipher pixels to plain pixels.
0818     void decipher(const std::string &passphrase_);
0819 
0820     // Tagged image format define. Similar to the defineValue() method
0821     // except that passing the flag_ value 'true' creates a value-less
0822     // define with that format and key. Passing the flag_ value 'false'
0823     // removes any existing matching definition. The method returns 'true'
0824     // if a matching key exists, and 'false' if no matching key exists.
0825     void defineSet(const std::string &magick_,const std::string &key_,
0826       bool flag_);
0827     bool defineSet(const std::string &magick_,const std::string &key_) const;
0828 
0829     // Tagged image format define (set/access coder-specific option) The
0830     // magick_ option specifies the coder the define applies to.  The key_
0831     // option provides the key specific to that coder.  The value_ option
0832     // provides the value to set (if any). See the defineSet() method if the
0833     // key must be removed entirely.
0834     void defineValue(const std::string &magick_,const std::string &key_,
0835       const std::string &value_);
0836     std::string defineValue(const std::string &magick_,
0837       const std::string &key_) const;
0838 
0839     // Removes skew from the image. Skew is an artifact that occurs in scanned
0840     // images because of the camera being misaligned, imperfections in the
0841     // scanning or surface, or simply because the paper was not placed
0842     // completely flat when scanned. The value of threshold_ ranges from 0
0843     // to QuantumRange.
0844     void deskew(const double threshold_);
0845 
0846     // Despeckle image (reduce speckle noise)
0847     void despeckle(void);
0848 
0849     // Display image on screen
0850     void display(void);
0851 
0852     // Distort image.  distorts an image using various distortion methods, by
0853     // mapping color lookups of the source image to a new destination image
0854     // usually of the same size as the source image, unless 'bestfit' is set to
0855     // true.
0856     void distort(const DistortMethod method_,
0857       const size_t numberArguments_,const double *arguments_,
0858       const bool bestfit_=false);
0859 
0860     // Draw on image using a single drawable
0861     void draw(const Drawable &drawable_);
0862 
0863     // Draw on image using a drawable list
0864     void draw(const std::vector<Magick::Drawable> &drawable_);
0865 
0866     // Edge image (highlight edges in image)
0867     void edge(const double radius_=0.0);
0868 
0869     // Emboss image (highlight edges with 3D effect)
0870     // The radius_ parameter specifies the radius of the Gaussian, in
0871     // pixels, not counting the center pixel.  The sigma_ parameter
0872     // specifies the standard deviation of the Laplacian, in pixels.
0873     void emboss(const double radius_=0.0,const double sigma_=1.0);
0874 
0875     // Converts pixels to cipher-pixels.
0876     void encipher(const std::string &passphrase_);
0877 
0878     // Enhance image (minimize noise)
0879     void enhance(void);
0880 
0881     // Equalize image (histogram equalization)
0882     void equalize(void);
0883 
0884     // Erase image to current "background color"
0885     void erase(void);
0886 
0887     // Apply a value with an arithmetic, relational, or logical operator.
0888     void evaluate(const ChannelType channel_,
0889       const MagickEvaluateOperator operator_,double rvalue_);
0890 
0891     // Apply a value with an arithmetic, relational, or logical operator.
0892     void evaluate(const ChannelType channel_,const MagickFunction function_,
0893       const size_t number_parameters_,const double *parameters_);
0894 
0895     // Apply a value with an arithmetic, relational, or logical operator.
0896     void evaluate(const ChannelType channel_,const ::ssize_t x_,
0897       const ::ssize_t y_,const size_t columns_,const size_t rows_,
0898       const MagickEvaluateOperator operator_,const double rvalue_);
0899 
0900     // Extend the image as defined by the geometry.
0901     void extent(const Geometry &geometry_);
0902     void extent(const Geometry &geometry_,const Color &backgroundColor);
0903     void extent(const Geometry &geometry_,const Color &backgroundColor,
0904       const GravityType gravity_);
0905     void extent(const Geometry &geometry_,const GravityType gravity_);
0906 
0907     // Flip image (reflect each scanline in the vertical direction)
0908     void flip(void);
0909 
0910     // Floodfill pixels matching color (within fuzz factor) of target
0911     // pixel(x,y) with replacement alpha value.
0912     void floodFillAlpha(const ::ssize_t x_,const ::ssize_t y_,
0913       const unsigned int alpha_,const bool invert_=false);
0914 
0915     // Floodfill designated area with replacement alpha value
0916     void floodFillAlpha(const ssize_t x_,const ssize_t y_,
0917       const unsigned int alpha_,const Color &target_,const bool invert_=false);
0918 
0919     // Flood-fill color across pixels that match the color of the
0920     // target pixel and are neighbors of the target pixel.
0921     // Uses current fuzz setting when determining color match.
0922     void floodFillColor(const Geometry &point_,const Color &fillColor_,
0923       const bool invert_=false);
0924     void floodFillColor(const ::ssize_t x_,const ::ssize_t y_,
0925       const Color &fillColor_,const bool invert_=false);
0926 
0927     // Flood-fill color across pixels starting at target-pixel and
0928     // stopping at pixels matching specified border color.
0929     // Uses current fuzz setting when determining color match.
0930     void floodFillColor(const Geometry &point_,const Color &fillColor_,
0931       const Color &borderColor_,const bool invert_=false);
0932     void floodFillColor(const ::ssize_t x_,const ::ssize_t y_,
0933       const Color &fillColor_,const Color &borderColor_,
0934       const bool invert_=false);
0935 
0936     // Flood-fill texture across pixels that match the color of the
0937     // target pixel and are neighbors of the target pixel.
0938     // Uses current fuzz setting when determining color match.
0939     void floodFillTexture(const Geometry &point_,const Image &texture_,
0940       const bool invert_=false);
0941     void floodFillTexture(const ::ssize_t x_,const ::ssize_t y_,
0942       const Image &texture_,const bool invert_=false);
0943 
0944     // Flood-fill texture across pixels starting at target-pixel and
0945     // stopping at pixels matching specified border color.
0946     // Uses current fuzz setting when determining color match.
0947     void floodFillTexture(const Geometry &point_,const Image &texture_,
0948       const Color &borderColor_,const bool invert_=false);
0949     void floodFillTexture(const ::ssize_t x_,const ::ssize_t y_,
0950       const Image &texture_,const Color &borderColor_,
0951       const bool invert_=false);
0952 
0953     // Flop image (reflect each scanline in the horizontal direction)
0954     void flop(void);
0955 
0956     // Obtain font metrics for text string given current font,
0957     // pointsize, and density settings.
0958     void fontTypeMetrics(const std::string &text_,TypeMetric *metrics);
0959 
0960     // Obtain multi line font metrics for text string given current font,
0961     // pointsize, and density settings.
0962     void fontTypeMetricsMultiline(const std::string &text_,
0963       TypeMetric *metrics);
0964 
0965     // Frame image
0966     void frame(const Geometry &geometry_=frameGeometryDefault);
0967     void frame(const size_t width_,const size_t height_,
0968       const ::ssize_t innerBevel_=6,const ::ssize_t outerBevel_=6);
0969 
0970     // Applies a mathematical expression to the image.
0971     void fx(const std::string expression_);
0972     void fx(const std::string expression_,const Magick::ChannelType channel_);
0973 
0974     // Gamma correct image
0975     void gamma(const double gamma_);
0976     void gamma(const double gammaRed_,const double gammaGreen_,
0977       const double gammaBlue_);
0978 
0979     // Gaussian blur image
0980     // The number of neighbor pixels to be included in the convolution
0981     // mask is specified by 'radius_'. The standard deviation of the
0982     // gaussian bell curve is specified by 'sigma_'.
0983     void gaussianBlur(const double radius_,const double sigma_);
0984     void gaussianBlurChannel(const ChannelType channel_,const double radius_,
0985       const double sigma_);
0986 
0987     // Transfers read-only pixels from the image to the pixel cache as
0988     // defined by the specified region.
0989     const Quantum *getConstPixels(const ::ssize_t x_, const ::ssize_t y_,
0990       const size_t columns_,const size_t rows_) const;
0991 
0992     // Obtain immutable image pixel metacontent. The selected region is defined
0993     // by the prior getPixels(), getConstPixels(), or setPixels() call.
0994     const void *getConstMetacontent(void) const;
0995 
0996     // Obtain mutable image pixel metacontent. The selected region is defined
0997     // by a prior getPixels(), getConstPixels(), or setPixels() call.
0998     void *getMetacontent(void);
0999 
1000     // Transfers pixels from the image to the pixel cache as defined
1001     // by the specified region. Modified pixels may be subsequently
1002     // transferred back to the image via syncPixels.  This method is
1003     // valid for DirectClass images.
1004     Quantum *getPixels(const ::ssize_t x_,const ::ssize_t y_,
1005       const size_t columns_,const size_t rows_);
1006 
1007     // Converts the colors in the image to gray.
1008     void grayscale(const PixelIntensityMethod method_);
1009 
1010     // Apply a color lookup table (Hald CLUT) to the image.
1011     void haldClut(const Image &clutImage_);
1012 
1013     // Identifies lines in the image.
1014     void houghLine(const size_t width_,const size_t height_,
1015       const size_t threshold_=40);
1016 
1017     // Identifies the potential color type of the image. This method can be
1018     // used to detect if the type can be changed to GrayScale.
1019     ImageType identifyType(void) const;
1020 
1021     // Implode image (special effect)
1022     void implode(const double factor_);
1023 
1024     // Implements the inverse discrete Fourier transform (DFT) of the image
1025     // either as a magnitude / phase or real / imaginary image pair.
1026     void inverseFourierTransform(const Image &phase_);
1027     void inverseFourierTransform(const Image &phase_,const bool magnitude_);
1028 
1029     // An edge preserving noise reduction filter.
1030     void kuwahara(const double radius_=0.0,const double sigma_=1.0);
1031     void kuwaharaChannel(const ChannelType channel_,const double radius_=0.0,
1032       const double sigma_=1.0);
1033 
1034     // Level image. Adjust the levels of the image by scaling the
1035     // colors falling between specified white and black points to the
1036     // full available quantum range. The parameters provided represent
1037     // the black, mid (gamma), and white points.  The black point
1038     // specifies the darkest color in the image. Colors darker than
1039     // the black point are set to zero. Mid point (gamma) specifies a
1040     // gamma correction to apply to the image. White point specifies
1041     // the lightest color in the image.  Colors brighter than the
1042     // white point are set to the maximum quantum value. The black and
1043     // white point have the valid range 0 to QuantumRange while mid (gamma)
1044     // has a useful range of 0 to ten.
1045     void level(const double blackPoint_,const double whitePoint_,
1046       const double gamma_=1.0);
1047     void levelChannel(const ChannelType channel_,const double blackPoint_,
1048       const double whitePoint_,const double gamma_=1.0);
1049 
1050     // Maps the given color to "black" and "white" values, linearly spreading
1051     // out the colors, and level values on a channel by channel bases, as
1052     // per level(). The given colors allows you to specify different level
1053     // ranges for each of the color channels separately.
1054     void levelColors(const Color &blackColor_,const Color &whiteColor_,
1055       const bool invert_=true);
1056     void levelColorsChannel(const ChannelType channel_,
1057       const Color &blackColor_,const Color &whiteColor_,
1058       const bool invert_=true);
1059 
1060     // Levelize applies the reversed level operation to just the specific
1061     // channels specified.It compresses the full range of color values, so
1062     // that they lie between the given black and white points. Gamma is
1063     // applied before the values are mapped.
1064     void levelize(const double blackPoint_,const double whitePoint_,
1065       const double gamma_=1.0);
1066     void levelizeChannel(const ChannelType channel_,const double blackPoint_,
1067       const double whitePoint_,const double gamma_=1.0);
1068 
1069     // Discards any pixels below the black point and above the white point and
1070     // levels the remaining pixels.
1071     void linearStretch(const double blackPoint_,const double whitePoint_);
1072 
1073     // Rescales image with seam carving.
1074     void liquidRescale(const Geometry &geometry_);
1075 
1076     // Local contrast enhancement
1077     void localContrast(const double radius_,const double strength_);
1078     void localContrastChannel(const ChannelType channel_,const double radius_,
1079       const double strength_);
1080 
1081     // Magnify image by integral size
1082     void magnify(void);
1083 
1084     // Remap image colors with closest color from reference image
1085     void map(const Image &mapImage_,const bool dither_=false);
1086 
1087     // Delineate arbitrarily shaped clusters in the image.
1088     void meanShift(const size_t width_,const size_t height_,
1089       const double color_distance_);
1090 
1091     // Filter image by replacing each pixel component with the median
1092     // color in a circular neighborhood
1093     void medianFilter(const double radius_=0.0);
1094 
1095     // Reduce image by integral size
1096     void minify(void);
1097 
1098     // Modulate percent hue, saturation, and brightness of an image
1099     void modulate(const double brightness_,const double saturation_,
1100       const double hue_);
1101 
1102     // Returns the normalized moments of one or more image channels.
1103     ImageMoments moments(void) const;
1104 
1105     // Applies a kernel to the image according to the given morphology method.
1106     void morphology(const MorphologyMethod method_,const std::string kernel_,
1107       const ssize_t iterations_=1);
1108     void morphology(const MorphologyMethod method_,
1109       const KernelInfoType kernel_,const std::string arguments_,
1110       const ssize_t iterations_=1);
1111     void morphologyChannel(const ChannelType channel_,
1112       const MorphologyMethod method_,const std::string kernel_,
1113       const ssize_t iterations_=1);
1114     void morphologyChannel(const ChannelType channel_,
1115       const MorphologyMethod method_,const KernelInfoType kernel_,
1116       const std::string arguments_,const ssize_t iterations_=1);
1117 
1118     // Motion blur image with specified blur factor
1119     // The radius_ parameter specifies the radius of the Gaussian, in
1120     // pixels, not counting the center pixel.  The sigma_ parameter
1121     // specifies the standard deviation of the Laplacian, in pixels.
1122     // The angle_ parameter specifies the angle the object appears
1123     // to be coming from (zero degrees is from the right).
1124     void motionBlur(const double radius_,const double sigma_,
1125       const double angle_);
1126 
1127     // Negate colors in image.  Set grayscale to only negate grayscale
1128     // values in image.
1129     void negate(const bool grayscale_=false);
1130     void negateChannel(const ChannelType channel_,const bool grayscale_=false);
1131 
1132     // Normalize image (increase contrast by normalizing the pixel
1133     // values to span the full range of color values)
1134     void normalize(void);
1135 
1136     // Oilpaint image (image looks like oil painting)
1137     void oilPaint(const double radius_=0.0,const double sigma=1.0);
1138 
1139     // Change color of opaque pixel to specified pen color.
1140     void opaque(const Color &opaqueColor_,const Color &penColor_,
1141       const bool invert_=false);
1142 
1143     // Perform a ordered dither based on a number of pre-defined dithering
1144     // threshold maps, but over multiple intensity levels.
1145     void orderedDither(std::string thresholdMap_);
1146     void orderedDitherChannel(const ChannelType channel_,
1147       std::string thresholdMap_);
1148 
1149     // Set each pixel whose value is less than epsilon to epsilon or
1150     // -epsilon (whichever is closer) otherwise the pixel value remains
1151     // unchanged.
1152     void perceptible(const double epsilon_);
1153     void perceptibleChannel(const ChannelType channel_,const double epsilon_);
1154 
1155     // Returns the perceptual hash for this image.
1156     Magick::ImagePerceptualHash perceptualHash() const;
1157 
1158     // Ping is similar to read except only enough of the image is read
1159     // to determine the image columns, rows, and filesize.  Access the
1160     // columns(), rows(), and fileSize() attributes after invoking
1161     // ping.  The image data is not valid after calling ping.
1162     void ping(const std::string &imageSpec_);
1163 
1164     // Ping is similar to read except only enough of the image is read
1165     // to determine the image columns, rows, and filesize.  Access the
1166     // columns(), rows(), and fileSize() attributes after invoking
1167     // ping.  The image data is not valid after calling ping.
1168     void ping(const Blob &blob_);
1169 
1170     // Get/set pixel color at location x & y.
1171     void pixelColor(const ::ssize_t x_,const ::ssize_t y_,const Color &color_);
1172     Color pixelColor(const ::ssize_t x_,const ::ssize_t y_ ) const;
1173 
1174     // Simulates a Polaroid picture.
1175     void polaroid(const std::string &caption_,const double angle_,
1176       const PixelInterpolateMethod method_);
1177 
1178     // Reduces the image to a limited number of colors for a "poster" effect.
1179     void posterize(const size_t levels_,const DitherMethod method_);
1180     void posterizeChannel(const ChannelType channel_,const size_t levels_,
1181       const DitherMethod method_);
1182 
1183     // Execute a named process module using an argc/argv syntax similar to
1184     // that accepted by a C 'main' routine. An exception is thrown if the
1185     // requested process module doesn't exist, fails to load, or fails during
1186     // execution.
1187     void process(std::string name_,const ::ssize_t argc_,const char **argv_);
1188 
1189     // Add or remove a named profile to/from the image. Remove the
1190     // profile by passing an empty Blob (e.g. Blob()). Valid names are
1191     // "*", "8BIM", "ICM", "IPTC", or a user/format-defined profile name.
1192     void profile(const std::string name_,const Blob &colorProfile_);
1193 
1194     // Retrieve a named profile from the image. Valid names are:
1195     // "8BIM", "8BIMTEXT", "APP1", "APP1JPEG", "ICC", "ICM", & "IPTC"
1196     // or an existing user/format-defined profile name.
1197     Blob profile(const std::string name_) const;
1198 
1199     // Quantize image (reduce number of colors)
1200     void quantize(const bool measureError_=false);
1201 
1202     // Raise image (lighten or darken the edges of an image to give a
1203     // 3-D raised or lowered effect)
1204     void raise(const Geometry &geometry_=raiseGeometryDefault,
1205       const bool raisedFlag_=false);
1206 
1207     // Random threshold image.
1208     //
1209     // Changes the value of individual pixels based on the intensity
1210     // of each pixel compared to a random threshold.  The result is a
1211     // low-contrast, two color image.
1212     void randomThreshold(const double low_,const double high_);
1213     void randomThresholdChannel(const ChannelType channel_,const double low_,
1214       const double high_);
1215 
1216     // Read single image frame from in-memory BLOB
1217     void read(const Blob &blob_);
1218 
1219     // Read single image frame of specified size from in-memory BLOB
1220     void read(const Blob &blob_,const Geometry &size_);
1221 
1222     // Read single image frame of specified size and depth from
1223     // in-memory BLOB
1224     void read(const Blob &blob_,const Geometry &size_,const size_t depth_);
1225 
1226     // Read single image frame of specified size, depth, and format
1227     // from in-memory BLOB
1228     void read(const Blob &blob_,const Geometry &size_,const size_t depth_,
1229       const std::string &magick_);
1230 
1231     // Read single image frame of specified size, and format from
1232     // in-memory BLOB
1233     void read(const Blob &blob_,const Geometry &size_,
1234       const std::string &magick_);
1235 
1236     // Read single image frame of specified size into current object
1237     void read(const Geometry &size_,const std::string &imageSpec_);
1238 
1239     // Read single image frame from an array of raw pixels, with
1240     // specified storage type (ConstituteImage), e.g.
1241     // image.read( 640, 480, "RGB", 0, pixels );
1242     void read(const size_t width_,const size_t height_,const std::string &map_,
1243       const StorageType type_,const void *pixels_);
1244 
1245     // Read single image frame into current object
1246     void read(const std::string &imageSpec_);
1247 
1248     // Associate a mask with the image. The mask must be the same dimensions
1249     // as the image. Pass an invalid image to unset an existing mask.
1250     void readMask(const Image &mask_);
1251     Image readMask(void) const;
1252 
1253     // Transfers one or more pixel components from a buffer or file
1254     // into the image pixel cache of an image.
1255     // Used to support image decoders.
1256     void readPixels(const QuantumType quantum_,const unsigned char *source_);
1257 
1258     // Reduce noise in image using a noise peak elimination filter
1259     void reduceNoise(void);
1260     void reduceNoise(const size_t order_);
1261 
1262     // Resets the image page canvas and position.
1263     void repage();
1264 
1265     // Resize image in terms of its pixel size.
1266     void resample(const Point &density_);
1267 
1268     // Resize image to specified size.
1269     void resize(const Geometry &geometry_);
1270 
1271     // Roll image (rolls image vertically and horizontally) by specified
1272     // number of columns and rows)
1273     void roll(const Geometry &roll_);
1274     void roll(const size_t columns_,const size_t rows_);
1275 
1276     // Rotate image clockwise by specified number of degrees. Specify a
1277     // negative number for degrees to rotate counter-clockwise.
1278     void rotate(const double degrees_);
1279 
1280     // Rotational blur image.
1281     void rotationalBlur(const double angle_);
1282     void rotationalBlurChannel(const ChannelType channel_,const double angle_);
1283 
1284     // Resize image by using pixel sampling algorithm
1285     void sample(const Geometry &geometry_);
1286 
1287     // Resize image by using simple ratio algorithm
1288     void scale(const Geometry &geometry_);
1289 
1290     // Segment (coalesce similar image components) by analyzing the
1291     // histograms of the color components and identifying units that
1292     // are homogeneous with the fuzzy c-means technique.  Also uses
1293     // QuantizeColorSpace and Verbose image attributes
1294     void segment(const double clusterThreshold_=1.0,
1295       const double smoothingThreshold_=1.5);
1296 
1297     // Selectively blur pixels within a contrast threshold. It is similar to
1298     // the unsharpen mask that sharpens everything with contrast above a
1299     // certain threshold.
1300     void selectiveBlur(const double radius_,const double sigma_,
1301       const double threshold_);
1302     void selectiveBlurChannel(const ChannelType channel_,const double radius_,
1303       const double sigma_,const double threshold_);
1304 
1305     // Separates a channel from the image and returns it as a grayscale image.
1306     Image separate(const ChannelType channel_) const;
1307 
1308     // Applies a special effect to the image, similar to the effect achieved in
1309     // a photo darkroom by sepia toning.  Threshold ranges from 0 to
1310     // QuantumRange and is a measure of the extent of the sepia toning.
1311     // A threshold of 80% is a good starting point for a reasonable tone.
1312     void sepiaTone(const double threshold_);
1313 
1314     // Sets meanErrorPerPixel, normalizedMaxError, and normalizedMeanError
1315     // in the current image. True is returned if the images are identical.
1316     bool setColorMetric(const Image &reference_);
1317 
1318     // Allocates a pixel cache region to store image pixels as defined
1319     // by the region rectangle.  This area is subsequently transferred
1320     // from the pixel cache to the image via syncPixels.
1321     Quantum *setPixels(const ::ssize_t x_, const ::ssize_t y_,
1322       const size_t columns_,const size_t rows_);
1323 
1324     // Shade image using distant light source
1325     void shade(const double azimuth_=30,const double elevation_=30,
1326       const bool colorShading_=false);
1327 
1328     // Simulate an image shadow
1329     void shadow(const double percentAlpha_=80.0,const double sigma_=0.5,
1330       const ssize_t x_=5,const ssize_t y_=5);
1331 
1332     // Sharpen pixels in image
1333     // The radius_ parameter specifies the radius of the Gaussian, in
1334     // pixels, not counting the center pixel.  The sigma_ parameter
1335     // specifies the standard deviation of the Laplacian, in pixels.
1336     void sharpen(const double radius_=0.0,const double sigma_=1.0);
1337     void sharpenChannel(const ChannelType channel_,const double radius_=0.0,
1338       const double sigma_=1.0);
1339 
1340     // Shave pixels from image edges.
1341     void shave(const Geometry &geometry_);
1342 
1343     // Shear image (create parallelogram by sliding image by X or Y axis)
1344     void shear(const double xShearAngle_,const double yShearAngle_);
1345 
1346     // adjust the image contrast with a non-linear sigmoidal contrast algorithm
1347     void sigmoidalContrast(const bool sharpen_,const double contrast,
1348       const double midpoint=QuantumRange/2.0);
1349 
1350     // Image signature. Set force_ to true in order to re-calculate
1351     // the signature regardless of whether the image data has been
1352     // modified.
1353     std::string signature(const bool force_=false) const;
1354 
1355     // Simulates a pencil sketch. We convolve the image with a Gaussian
1356     // operator of the given radius and standard deviation (sigma). For
1357     // reasonable results, radius should be larger than sigma. Use a
1358     // radius of 0 and SketchImage() selects a suitable radius for you.
1359     void sketch(const double radius_=0.0,const double sigma_=1.0,
1360       const double angle_=0.0);
1361 
1362     // Solarize image (similar to effect seen when exposing a
1363     // photographic film to light during the development process)
1364     void solarize(const double factor_=50.0);
1365 
1366     // Sparse color image, given a set of coordinates, interpolates the colors
1367     // found at those coordinates, across the whole image, using various
1368     // methods.
1369     void sparseColor(const ChannelType channel_,
1370       const SparseColorMethod method_,const size_t numberArguments_,
1371       const double *arguments_);
1372 
1373     // Splice the background color into the image.
1374     void splice(const Geometry &geometry_);
1375     void splice(const Geometry &geometry_,const Color &backgroundColor_);
1376     void splice(const Geometry &geometry_,const Color &backgroundColor_,
1377       const GravityType gravity_);
1378 
1379     // Spread pixels randomly within image by specified amount
1380     void spread(const double amount_=3.0);
1381 
1382     // Returns the statistics for this image.
1383     Magick::ImageStatistics statistics() const;
1384 
1385     // Add a digital watermark to the image (based on second image)
1386     void stegano(const Image &watermark_);
1387 
1388     // Create an image which appears in stereo when viewed with
1389     // red-blue glasses (Red image on left, blue on right)
1390     void stereo(const Image &rightImage_);
1391 
1392     // Strip strips an image of all profiles and comments.
1393     void strip(void);
1394 
1395     // Search for the specified image at EVERY possible location in this image.
1396     // This is slow! very very slow.. It returns a similarity image such that
1397     // an exact match location is completely white and if none of the pixels
1398     // match, black, otherwise some gray level in-between.
1399     Image subImageSearch(const Image &reference_,const MetricType metric_,
1400       Geometry *offset_,double *similarityMetric_,
1401       const double similarityThreshold=(-1.0));
1402 
1403     // Swirl image (image pixels are rotated by degrees)
1404     void swirl(const double degrees_);
1405 
1406     // Transfers the image cache pixels to the image.
1407     void syncPixels(void);
1408 
1409     // Channel a texture on image background
1410     void texture(const Image &texture_);
1411 
1412     // Threshold image
1413     void threshold(const double threshold_);
1414 
1415     // Resize image to thumbnail size
1416     void thumbnail(const Geometry &geometry_);
1417 
1418     // Applies a color vector to each pixel in the image. The length of the
1419     // vector is 0 for black and white and at its maximum for the midtones.
1420     // The vector weighting function is f(x)=(1-(4.0*((x-0.5)*(x-0.5))))
1421     void tint(const std::string opacity_);
1422 
1423     // Origin of coordinate system to use when annotating with text or drawing
1424     void transformOrigin(const double x_,const double y_);
1425 
1426     // Reset transformation parameters to default
1427     void transformReset(void);
1428 
1429     // Scale to use when annotating with text or drawing
1430     void transformScale(const double sx_,const double sy_);
1431 
1432     // Add matte image to image, setting pixels matching color to
1433     // transparent
1434     void transparent(const Color &color_,const bool inverse_=false);
1435 
1436     // Add matte image to image, for all the pixels that lies in between
1437     // the given two color
1438     void transparentChroma(const Color &colorLow_,const Color &colorHigh_);
1439 
1440     // Creates a horizontal mirror image by reflecting the pixels around the
1441     // central y-axis while rotating them by 90 degrees.
1442     void transpose(void);
1443 
1444     // Creates a vertical mirror image by reflecting the pixels around the
1445     // central x-axis while rotating them by 270 degrees.
1446     void transverse(void);
1447 
1448     // Trim edges that are the background color from the image
1449     void trim(void);
1450 
1451     // Returns the unique colors of an image.
1452     Image uniqueColors(void) const;
1453 
1454     // Replace image with a sharpened version of the original image
1455     // using the unsharp mask algorithm.
1456     //  radius_
1457     //    the radius of the Gaussian, in pixels, not counting the
1458     //    center pixel.
1459     //  sigma_
1460     //    the standard deviation of the Gaussian, in pixels.
1461     //  amount_
1462     //    the percentage of the difference between the original and
1463     //    the blur image that is added back into the original.
1464     // threshold_
1465     //   the threshold in pixels needed to apply the difference amount.
1466     void unsharpmask(const double radius_,const double sigma_,
1467       const double amount_,const double threshold_);
1468     void unsharpmaskChannel(const ChannelType channel_,const double radius_,
1469       const double sigma_,const double amount_,const double threshold_);
1470 
1471     // Softens the edges of the image in vignette style.
1472     void vignette(const double radius_=0.0,const double sigma_=1.0,
1473       const ssize_t x_=0,const ssize_t y_=0);
1474 
1475     // Map image pixels to a sine wave
1476     void wave(const double amplitude_=25.0,const double wavelength_=150.0);
1477 
1478     // Removes noise from the image using a wavelet transform.
1479     void waveletDenoise(const double threshold_,const double softness_);
1480 
1481     // Forces all pixels above the threshold into white while leaving all
1482     // pixels at or below the threshold unchanged.
1483     void whiteThreshold(const std::string &threshold_);
1484     void whiteThresholdChannel(const ChannelType channel_,
1485       const std::string &threshold_);
1486 
1487     // Write single image frame to in-memory BLOB, with optional
1488     // format and adjoin parameters.
1489     void write(Blob *blob_);
1490     void write(Blob *blob_,const std::string &magick_);
1491     void write(Blob *blob_,const std::string &magick_,const size_t depth_);
1492 
1493     // Write single image frame to an array of pixels with storage
1494     // type specified by user (DispatchImage), e.g.
1495     // image.write( 0, 0, 640, 1, "RGB", 0, pixels );
1496     void write(const ::ssize_t x_,const ::ssize_t y_,const size_t columns_,
1497       const size_t rows_,const std::string &map_,const StorageType type_,
1498       void *pixels_);
1499 
1500     // Write single image frame to a file
1501     void write(const std::string &imageSpec_);
1502 
1503     // Associate a mask with the image. The mask must be the same dimensions
1504     // as the image. Pass an invalid image to unset an existing mask.
1505     void writeMask(const Image &mask_);
1506     Image writeMask(void) const;
1507 
1508     // Transfers one or more pixel components from the image pixel
1509     // cache to a buffer or file.
1510     // Used to support image encoders.
1511     void writePixels(const QuantumType quantum_,unsigned char *destination_);
1512 
1513     // Zoom image to specified size.
1514     void zoom(const Geometry &geometry_);
1515 
1516     //////////////////////////////////////////////////////////////////////
1517     //
1518     // No user-serviceable parts beyond this point
1519     //
1520     //////////////////////////////////////////////////////////////////////
1521 
1522     // Construct with MagickCore::Image and default options
1523     Image(MagickCore::Image *image_);
1524 
1525     // Retrieve Image*
1526     MagickCore::Image *&image(void);
1527     const MagickCore::Image *constImage(void) const;
1528 
1529     // Retrieve ImageInfo*
1530     MagickCore::ImageInfo *imageInfo(void);
1531     const MagickCore::ImageInfo *constImageInfo(void) const;
1532 
1533     // Retrieve Options*
1534     Options *options(void);
1535     const Options *constOptions(void) const;
1536 
1537     // Retrieve QuantizeInfo*
1538     MagickCore::QuantizeInfo *quantizeInfo(void);
1539     const MagickCore::QuantizeInfo *constQuantizeInfo(void) const;
1540 
1541     // Prepare to update image (copy if reference > 1)
1542     void modifyImage(void);
1543 
1544     // Replace current image (reference counted)
1545     MagickCore::Image *replaceImage(MagickCore::Image *replacement_);
1546 
1547   private:
1548 
1549     void floodFill(const ssize_t x_,const ssize_t y_,
1550       const Magick::Image *fillPattern_,const Color &fill_,
1551       const PixelInfo *target,const bool invert_);
1552 
1553     void mask(const Image &mask_,const PixelMask);
1554     Image mask(const PixelMask) const;
1555 
1556     void read(MagickCore::Image *image,
1557       MagickCore::ExceptionInfo *exceptionInfo);
1558 
1559     ImageRef *_imgRef;
1560   };
1561 
1562 } // end of namespace Magick
1563 
1564 #endif // Magick_Image_header