www/api/Magick++/Image_8h_source.html
| Magick++ 7.1.0 |
Image.h
Go to the documentation of this file.
1 // This may look like C code, but it is really -*- C++ -*-
2 //
3 // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
4 //
5 // Copyright @ 2013 ImageMagick Studio LLC, a non-profit organization
6 // dedicated to making software imaging solutions freely available.
7 //
8 // Definition of Image, the representation of a single image in Magick++
9 //
10
11 #if !defined(Magick_Image_header)
12 #define Magick_Image_header
13
14 #include "Magick++/Include.h"
15 #include <string>
16 #include <list>
17 #include "Magick++/Blob.h"
18 #include "Magick++/Color.h"
19 #include "Magick++/Drawable.h"
20 #include "Magick++/Exception.h"
21 #include "Magick++/Geometry.h"
22 #include "Magick++/Statistic.h"
23 #include "Magick++/TypeMetric.h"
24
25 namespace Magick
26 {
27// Forward declarations
28class Options;
29class ImageRef;
30
31extern MagickPPExport const char *borderGeometryDefault;
32extern MagickPPExport const char *frameGeometryDefault;
33extern MagickPPExport const char *raiseGeometryDefault;
34
35// Compare two Image objects regardless of LHS/RHS
36// Image sizes and signatures are used as basis of comparison
37MagickPPExport int operator ==
38 (const Magick::Image &left_,const Magick::Image &right_);
39MagickPPExport int operator !=
40 (const Magick::Image &left_,const Magick::Image &right_);
41MagickPPExport int operator >
42 (const Magick::Image &left_,const Magick::Image &right_);
43MagickPPExport int operator <
44 (const Magick::Image &left_,const Magick::Image &right_);
45MagickPPExport int operator >=
46 (const Magick::Image &left_,const Magick::Image &right_);
47MagickPPExport int operator <=
48 (const Magick::Image &left_,const Magick::Image &right_);
49
50//
51// Image is the representation of an image. In reality, it actually
52// a handle object which contains a pointer to a shared reference
53// object (ImageRef). As such, this object is extremely space efficient.
54//
55class MagickPPExport Image
56 {
57public:
58
59// Default constructor
60Image(void);
61
62// Construct Image from in-memory BLOB
64
65// Construct Image of specified size from in-memory BLOB
66Image(const Blob &blob_,const Geometry &size_);
67
68// Construct Image of specified size and depth from in-memory BLOB
69Image(const Blob &blob_,const Geometry &size_,const size_t depth_);
70
71// Construct Image of specified size, depth, and format from
72// in-memory BLOB
73Image(const Blob &blob_,const Geometry &size_,const size_t depth_,
74const std::string &magick_);
75
76// Construct Image of specified size, and format from in-memory BLOB
77Image(const Blob &blob_,const Geometry &size_,const std::string &magick_);
78
79// Construct a blank image canvas of specified size and color
80Image(const Geometry &size_,const Color &color_);
81
82// Copy constructor
84
85// Copy constructor to copy part of the image
86Image(const Image &image_,const Geometry &geometry_);
87
88// Construct an image based on an array of raw pixels, of
89// specified type and mapping, in memory
90Image(const size_t width_,const size_t height_,const std::string &map_,
91const StorageType type_,const void *pixels_);
92
93// Construct from image file or image specification
94Image(const std::string &imageSpec_);
95
96// Destructor
97virtual ~Image();
98
99// Assignment operator
100Image& operator=(const Image &image_);
101
102// Join images into a single multi-image file
103void adjoin(const bool flag_);
104bool adjoin(void) const;
105
106// Image supports transparency (alpha channel)
107void alpha(const bool alphaFlag_);
108bool alpha(void) const;
109
110// Transparent color
111void matteColor(const Color &matteColor_);
112Color matteColor(void) const;
113
114// Time in 1/100ths of a second which must expire before
115// displaying the next image in an animated sequence.
116void animationDelay(const size_t delay_);
117size_t animationDelay(void) const;
118
119// Number of iterations to loop an animation (e.g. Netscape loop
120// extension) for.
121void animationIterations(const size_t iterations_);
122size_t animationIterations(void) const;
123
124// Image background color
125void backgroundColor(const Color &color_);
126Color backgroundColor(void) const;
127
128// Name of texture image to tile onto the image background
129void backgroundTexture(const std::string &backgroundTexture_);
130 std::string backgroundTexture(void) const;
131
132// Base image width (before transformations)
133size_t baseColumns(void) const;
134
135// Base image filename (before transformations)
136 std::string baseFilename(void) const;
137
138// Base image height (before transformations)
139size_t baseRows(void) const;
140
141// Use black point compensation.
142void blackPointCompensation(const bool flag_);
143bool blackPointCompensation(void) const;
144
145// Image border color
146void borderColor(const Color &color_);
147Color borderColor(void) const;
148
149// Return smallest bounding box enclosing non-border pixels. The
150// current fuzz value is used when discriminating between pixels.
151// This is the crop bounding box used by crop(Geometry(0,0));
152Geometry boundingBox(void) const;
153
154// Text bounding-box base color (default none)
155void boxColor(const Color &boxColor_);
156Color boxColor(void) const;
157
158// Set or obtain modulus channel depth
159void channelDepth(const ChannelType channel_,const size_t depth_);
160size_t channelDepth(const ChannelType channel_);
161
162// Returns the number of channels in this image.
163size_t channels() const;
164
165// Image class (DirectClass or PseudoClass)
166// NOTE: setting a DirectClass image to PseudoClass will result in
167// the loss of color information if the number of colors in the
168// image is greater than the maximum palette size (either 256 or
169// 65536 entries depending on the value of MAGICKCORE_QUANTUM_DEPTH when
170// ImageMagick was built).
171void classType(const ClassType class_);
172 ClassType classType(void) const;
173
174// Colors within this distance are considered equal
175void colorFuzz(const double fuzz_);
176double colorFuzz(void) const;
177
178// Colormap size (number of colormap entries)
179void colorMapSize(const size_t entries_);
180size_t colorMapSize(void) const;
181
182// Image Color Space
183void colorSpace(const ColorspaceType colorSpace_);
184 ColorspaceType colorSpace(void) const;
185
186void colorSpaceType(const ColorspaceType colorSpace_);
187 ColorspaceType colorSpaceType(void) const;
188
189// Image width
190size_t columns(void) const;
191
192// Comment image (add comment string to image)
193void comment(const std::string &comment_);
194 std::string comment(void) const;
195
196// Composition operator to be used when composition is implicitly
197// used (such as for image flattening).
198void compose(const CompositeOperator compose_);
199 CompositeOperator compose(void) const;
200
201// Compression type
202void compressType(const CompressionType compressType_);
203 CompressionType compressType(void) const;
204
205// Enable printing of debug messages from ImageMagick
206void debug(const bool flag_);
207bool debug(void) const;
208
209// Vertical and horizontal resolution in pixels of the image
210void density(const Point &density_);
211Point density(void) const;
212
213// Image depth (bits allocated to red/green/blue components)
214void depth(const size_t depth_);
215size_t depth(void) const;
216
217// Tile names from within an image montage
218 std::string directory(void) const;
219
220// Endianness (little like Intel or big like SPARC) for image
221// formats which support endian-specific options.
222void endian(const EndianType endian_);
223 EndianType endian(void) const;
224
225// Exif profile (BLOB)
226void exifProfile(const Blob &exifProfile_);
227Blob exifProfile(void) const;
228
229// Image file name
230void fileName(const std::string &fileName_);
231 std::string fileName(void) const;
232
233// Number of bytes of the image on disk
234 MagickSizeType fileSize(void) const;
235
236// Color to use when filling drawn objects
237void fillColor(const Color &fillColor_);
238Color fillColor(void) const;
239
240// Rule to use when filling drawn objects
241void fillRule(const FillRule &fillRule_);
242 FillRule fillRule(void) const;
243
244// Pattern to use while filling drawn objects.
245void fillPattern(const Image &fillPattern_);
246Image fillPattern(void) const;
247
248// Filter to use when resizing image
249void filterType(const FilterType filterType_);
250 FilterType filterType(void) const;
251
252// Text rendering font
253void font(const std::string &font_);
254 std::string font(void) const;
255
256// Font family
257void fontFamily(const std::string &family_);
258 std::string fontFamily(void) const;
259
260// Font point size
261void fontPointsize(const double pointSize_);
262double fontPointsize(void) const;
263
264// Font style
265void fontStyle(const StyleType style_);
266 StyleType fontStyle(void) const;
267
268// Font weight
269void fontWeight(const size_t weight_);
270size_t fontWeight(void) const;
271
272// Long image format description
273 std::string format(void) const;
274
275// Formats the specified expression
276// More info here: https://imagemagick.org/script/escape.php
277 std::string formatExpression(const std::string expression);
278
279// Gamma level of the image
280double gamma(void) const;
281
282// Preferred size of the image when encoding
283Geometry geometry(void) const;
284
285// GIF disposal method
286void gifDisposeMethod(const DisposeType disposeMethod_);
287 DisposeType gifDisposeMethod(void) const;
288
289bool hasChannel(const PixelChannel channel) const;
290
291// When comparing images, emphasize pixel differences with this color.
292void highlightColor(const Color color_);
293
294// ICC color profile (BLOB)
295void iccColorProfile(const Blob &colorProfile_);
296Blob iccColorProfile(void) const;
297
298// Type of interlacing to use
299void interlaceType(const InterlaceType interlace_);
300 InterlaceType interlaceType(void) const;
301
302// Pixel color interpolation method to use
303void interpolate(const PixelInterpolateMethod interpolate_);
304 PixelInterpolateMethod interpolate(void) const;
305
306// IPTC profile (BLOB)
307void iptcProfile(const Blob &iptcProfile_);
308Blob iptcProfile(void) const;
309
310// Returns true if none of the pixels in the image have an alpha value
311// other than OpaqueAlpha (QuantumRange).
312bool isOpaque(void) const;
313
314// Does object contain valid image?
315void isValid(const bool isValid_);
316bool isValid(void) const;
317
318// Image label
319void label(const std::string &label_);
320 std::string label(void) const;
321
322// When comparing images, de-emphasize pixel differences with this color.
323void lowlightColor(const Color color_);
324
325// File type magick identifier (.e.g "GIF")
326void magick(const std::string &magick_);
327 std::string magick(void) const;
328
329// When comparing images, set pixels with a read mask to this color.
330void masklightColor(const Color color_);
331
332// The mean error per pixel computed when an image is color reduced
333double meanErrorPerPixel(void) const;
334
335// Image modulus depth (minimum number of bits required to support
336// red/green/blue components without loss of accuracy)
337void modulusDepth(const size_t modulusDepth_);
338size_t modulusDepth(void) const;
339
340// Transform image to black and white
341void monochrome(const bool monochromeFlag_);
342bool monochrome(void) const;
343
344// Tile size and offset within an image montage
345Geometry montageGeometry(void) const;
346
347// The normalized max error per pixel computed when an image is
348// color reduced.
349double normalizedMaxError(void) const;
350
351// The normalized mean error per pixel computed when an image is
352// color reduced.
353double normalizedMeanError(void) const;
354
355// Image orientation
356void orientation(const OrientationType orientation_);
357 OrientationType orientation(void) const;
358
359// Preferred size and location of an image canvas.
360void page(const Geometry &pageSize_);
361Geometry page(void) const;
362
363// JPEG/MIFF/PNG compression level (default 75).
364void quality(const size_t quality_);
365size_t quality(void) const;
366
367// Maximum number of colors to quantize to
368void quantizeColors(const size_t colors_);
369size_t quantizeColors(void) const;
370
371// Colorspace to quantize in.
372void quantizeColorSpace(const ColorspaceType colorSpace_);
373 ColorspaceType quantizeColorSpace(void) const;
374
375// Dither image during quantization (default true).
376void quantizeDither(const bool ditherFlag_);
377bool quantizeDither(void) const;
378
379// Dither method
380void quantizeDitherMethod(const DitherMethod ditherMethod_);
381 DitherMethod quantizeDitherMethod(void) const;
382
383// Quantization tree-depth
384void quantizeTreeDepth(const size_t treeDepth_);
385size_t quantizeTreeDepth(void) const;
386
387// Suppress all warning messages. Error messages are still reported.
388void quiet(const bool quiet_);
389bool quiet(void) const;
390
391// The type of rendering intent
392void renderingIntent(const RenderingIntent renderingIntent_);
393 RenderingIntent renderingIntent(void) const;
394
395// Units of image resolution
396void resolutionUnits(const ResolutionType resolutionUnits_);
397 ResolutionType resolutionUnits(void) const;
398
399// The number of pixel rows in the image
400size_t rows(void) const;
401
402// Image sampling factor
403void samplingFactor(const std::string &samplingFactor_);
404 std::string samplingFactor(void) const;
405
406// Image scene number
407void scene(const size_t scene_);
408size_t scene(void) const;
409
410// Width and height of a raw image
411void size(const Geometry &geometry_);
412Geometry size(void) const;
413
414// enabled/disable stroke anti-aliasing
415void strokeAntiAlias(const bool flag_);
416bool strokeAntiAlias(void) const;
417
418// Color to use when drawing object outlines
419void strokeColor(const Color &strokeColor_);
420Color strokeColor(void) const;
421
422// Specify the pattern of dashes and gaps used to stroke
423// paths. The strokeDashArray represents a zero-terminated array
424// of numbers that specify the lengths of alternating dashes and
425// gaps in pixels. If an odd number of values is provided, then
426// the list of values is repeated to yield an even number of
427// values. A typical strokeDashArray_ array might contain the
428// members 5 3 2 0, where the zero value indicates the end of the
429// pattern array.
430void strokeDashArray(const double *strokeDashArray_);
431const double *strokeDashArray(void) const;
432
433// While drawing using a dash pattern, specify distance into the
434// dash pattern to start the dash (default 0).
435void strokeDashOffset(const double strokeDashOffset_);
436double strokeDashOffset(void) const;
437
438// Specify the shape to be used at the end of open subpaths when
439// they are stroked. Values of LineCap are UndefinedCap, ButtCap,
440// RoundCap, and SquareCap.
441void strokeLineCap(const LineCap lineCap_);
442 LineCap strokeLineCap(void) const;
443
444// Specify the shape to be used at the corners of paths (or other
445// vector shapes) when they are stroked. Values of LineJoin are
446// UndefinedJoin, MiterJoin, RoundJoin, and BevelJoin.
447void strokeLineJoin(const LineJoin lineJoin_);
448 LineJoin strokeLineJoin(void) const;
449
450// Specify miter limit. When two line segments meet at a sharp
451// angle and miter joins have been specified for 'lineJoin', it is
452// possible for the miter to extend far beyond the thickness of
453// the line stroking the path. The miterLimit' imposes a limit on
454// the ratio of the miter length to the 'lineWidth'. The default
455// value of this parameter is 4.
456void strokeMiterLimit(const size_t miterLimit_);
457size_t strokeMiterLimit(void) const;
458
459// Pattern image to use while stroking object outlines.
460void strokePattern(const Image &strokePattern_);
461Image strokePattern(void) const;
462
463// Stroke width for drawing vector objects (default one)
464void strokeWidth(const double strokeWidth_);
465double strokeWidth(void) const;
466
467// Subimage of an image sequence
468void subImage(const size_t subImage_);
469size_t subImage(void) const;
470
471// Number of images relative to the base image
472void subRange(const size_t subRange_);
473size_t subRange(void) const;
474
475// Anti-alias Postscript and TrueType fonts (default true)
476void textAntiAlias(const bool flag_);
477bool textAntiAlias(void) const;
478
479// Render text right-to-left or left-to-right.
480void textDirection(DirectionType direction_);
481 DirectionType textDirection() const;
482
483// Annotation text encoding (e.g. "UTF-16")
484void textEncoding(const std::string &encoding_);
485 std::string textEncoding(void) const;
486
487// Text gravity.
488void textGravity(GravityType gravity_);
489 GravityType textGravity() const;
490
491// Text inter-line spacing
492void textInterlineSpacing(double spacing_);
493double textInterlineSpacing(void) const;
494
495// Text inter-word spacing
496void textInterwordSpacing(double spacing_);
497double textInterwordSpacing(void) const;
498
499// Text inter-character kerning
500void textKerning(double kerning_);
501double textKerning(void) const;
502
503// Text undercolor box
504void textUnderColor(const Color &underColor_);
505Color textUnderColor(void) const;
506
507// Number of colors in the image
508size_t totalColors(void) const;
509
510// Rotation to use when annotating with text or drawing
511void transformRotation(const double angle_);
512
513// Skew to use in X axis when annotating with text or drawing
514void transformSkewX(const double skewx_);
515
516// Skew to use in Y axis when annotating with text or drawing
517void transformSkewY(const double skewy_);
518
519// Image representation type (also see type operation)
520// Available types:
521// Bilevel PaletteBilevelAlpha
522// Grayscale GrayscaleAlpha
523// Palette PaletteAlpha
524// TrueColor TrueColorAlpha
525// ColorSeparation ColorSeparationAlpha
526void type(const ImageType type_);
527 ImageType type(void) const;
528
529// Print detailed information about the image
530void verbose(const bool verboseFlag_);
531bool verbose(void) const;
532
533// Virtual pixel method
534void virtualPixelMethod(const VirtualPixelMethod virtualPixelMethod_);
535 VirtualPixelMethod virtualPixelMethod(void) const;
536
537// X11 display to display to, obtain fonts from, or to capture
538// image from
539void x11Display(const std::string &display_);
540 std::string x11Display(void) const;
541
542// x resolution of the image
543double xResolution(void) const;
544
545// y resolution of the image
546double yResolution(void) const;
547
548// Adaptive-blur image with specified blur factor
549// The radius_ parameter specifies the radius of the Gaussian, in
550// pixels, not counting the center pixel. The sigma_ parameter
551// specifies the standard deviation of the Laplacian, in pixels.
552void adaptiveBlur(const double radius_=0.0,const double sigma_=1.0);
553
554// This is shortcut function for a fast interpolative resize using mesh
555// interpolation. It works well for small resizes of less than +/- 50%
556// of the original image size. For larger resizing on images a full
557// filtered and slower resize function should be used instead.
558void adaptiveResize(const Geometry &geometry_);
559
560// Adaptively sharpens the image by sharpening more intensely near image
561// edges and less intensely far from edges. We sharpen the image with a
562// Gaussian operator of the given radius and standard deviation (sigma).
563// For reasonable results, radius should be larger than sigma.
564void adaptiveSharpen(const double radius_=0.0,const double sigma_=1.0);
565void adaptiveSharpenChannel(const ChannelType channel_,
566const double radius_=0.0,const double sigma_=1.0);
567
568// Local adaptive threshold image
569// http://www.dai.ed.ac.uk/HIPR2/adpthrsh.htm
570// Width x height define the size of the pixel neighborhood
571// bias = constant to subtract from pixel neighborhood mean
572void adaptiveThreshold(const size_t width_,const size_t height_,
573const double bias_=0.0);
574
575// Add noise to image with specified noise type
576void addNoise(const NoiseType noiseType_,const double attenuate_=1.0);
577void addNoiseChannel(const ChannelType channel_,
578const NoiseType noiseType_,const double attenuate_=1.0);
579
580// Transform image by specified affine (or free transform) matrix.
581void affineTransform(const DrawableAffine &affine);
582
583// Set or attenuate the alpha channel in the image. If the image
584// pixels are opaque then they are set to the specified alpha
585// value, otherwise they are blended with the supplied alpha
586// value. The value of alpha_ ranges from 0 (completely opaque)
587// to QuantumRange. The defines OpaqueAlpha and TransparentAlpha are
588// available to specify completely opaque or completely
589// transparent, respectively.
590void alpha(const unsigned int alpha_);
591
592// AlphaChannel() activates, deactivates, resets, or sets the alpha
593// channel.
594void alphaChannel(AlphaChannelOption alphaOption_);
595
596//
597// Annotate image (draw text on image)
598//
599// Gravity effects text placement in bounding area according to rules:
600// NorthWestGravity text bottom-left corner placed at top-left
601// NorthGravity text bottom-center placed at top-center
602// NorthEastGravity text bottom-right corner placed at top-right
603// WestGravity text left-center placed at left-center
604// CenterGravity text center placed at center
605// EastGravity text right-center placed at right-center
606// SouthWestGravity text top-left placed at bottom-left
607// SouthGravity text top-center placed at bottom-center
608// SouthEastGravity text top-right placed at bottom-right
609
610// Annotate using specified text, and placement location
611void annotate(const std::string &text_,const Geometry &location_);
612
613// Annotate using specified text, bounding area, and placement
614// gravity
615void annotate(const std::string &text_,const Geometry &boundingArea_,
616const GravityType gravity_);
617
618// Annotate with text using specified text, bounding area,
619// placement gravity, and rotation.
620void annotate(const std::string &text_,const Geometry &boundingArea_,
621const GravityType gravity_,const double degrees_);
622
623// Annotate with text (bounding area is entire image) and placement
624// gravity.
625void annotate(const std::string &text_,const GravityType gravity_);
626
627// Inserts the artifact with the specified name and value into
628// the artifact tree of the image.
629void artifact(const std::string &name_,const std::string &value_);
630
631// Returns the value of the artifact with the specified name.
632 std::string artifact(const std::string &name_) const;
633
634// Access/Update a named image attribute
635void attribute(const std::string name_,const char *value_);
636void attribute(const std::string name_,const std::string value_);
637 std::string attribute(const std::string name_) const;
638
639// Extracts the 'mean' from the image and adjust the image to try
640// make set its gamma appropriatally.
641void autoGamma(void);
642void autoGammaChannel(const ChannelType channel_);
643
644// Adjusts the levels of a particular image channel by scaling the
645// minimum and maximum values to the full quantum range.
646void autoLevel(void);
647void autoLevelChannel(const ChannelType channel_);
648
649// Adjusts an image so that its orientation is suitable for viewing.
650void autoOrient(void);
651
652// Automatically selects a threshold and replaces each pixel in the image
653// with a black pixel if the image intentsity is less than the selected
654// threshold otherwise white.
655void autoThreshold(const AutoThresholdMethod method_);
656
657// Forces all pixels below the threshold into black while leaving all
658// pixels at or above the threshold unchanged.
659void blackThreshold(const std::string &threshold_);
660void blackThresholdChannel(const ChannelType channel_,
661const std::string &threshold_);
662
663// Simulate a scene at nighttime in the moonlight.
664void blueShift(const double factor_=1.5);
665
666// Blur image with specified blur factor
667// The radius_ parameter specifies the radius of the Gaussian, in
668// pixels, not counting the center pixel. The sigma_ parameter
669// specifies the standard deviation of the Laplacian, in pixels.
670void blur(const double radius_=0.0,const double sigma_=1.0);
671void blurChannel(const ChannelType channel_,const double radius_=0.0,
672const double sigma_=1.0);
673
674// Border image (add border to image)
675void border(const Geometry &geometry_=borderGeometryDefault);
676
677// Changes the brightness and/or contrast of an image. It converts the
678// brightness and contrast parameters into slope and intercept and calls
679// a polynomical function to apply to the image.
680void brightnessContrast(const double brightness_=0.0,
681const double contrast_=0.0);
682void brightnessContrastChannel(const ChannelType channel_,
683const double brightness_=0.0,const double contrast_=0.0);
684
685// Uses a multi-stage algorithm to detect a wide range of edges in images.
686void cannyEdge(const double radius_=0.0,const double sigma_=1.0,
687const double lowerPercent_=0.1,const double upperPercent_=0.3);
688
689// Accepts a lightweight Color Correction Collection
690// (CCC) file which solely contains one or more color corrections and
691// applies the correction to the image.
692void cdl(const std::string &cdl_);
693
694// Extract channel from image
695void channel(const ChannelType channel_);
696
697// Charcoal effect image (looks like charcoal sketch)
698// The radius_ parameter specifies the radius of the Gaussian, in
699// pixels, not counting the center pixel. The sigma_ parameter
700// specifies the standard deviation of the Laplacian, in pixels.
701void charcoal(const double radius_=0.0,const double sigma_=1.0);
702void charcoalChannel(const ChannelType channel_,const double radius_=0.0,
703const double sigma_=1.0);
704
705// Chop image (remove vertical or horizontal subregion of image)
706// FIXME: describe how geometry argument is used to select either
707// horizontal or vertical subregion of image.
708void chop(const Geometry &geometry_);
709
710// Chromaticity blue primary point.
711void chromaBluePrimary(const double x_,const double y_,const double z_);
712void chromaBluePrimary(double *x_,double *y_,double *z_) const;
713
714// Chromaticity green primary point.
715void chromaGreenPrimary(const double x_,const double y_,const double z_);
716void chromaGreenPrimary(double *x_,double *y_,double *z_) const;
717
718// Chromaticity red primary point.
719void chromaRedPrimary(const double x_,const double y_,const double z_);
720void chromaRedPrimary(double *x_,double *y_,double *z_) const;
721
722// Chromaticity white point.
723void chromaWhitePoint(const double x_,const double y_,const double z_);
724void chromaWhitePoint(double *x_,double *y_,double *z_) const;
725
726// Set each pixel whose value is below zero to zero and any the
727// pixel whose value is above the quantum range to the quantum range (e.g.
728// 65535) otherwise the pixel value remains unchanged.
729void clamp(void);
730void clampChannel(const ChannelType channel_);
731
732// Sets the image clip mask based on any clipping path information
733// if it exists.
734void clip(void);
735void clipPath(const std::string pathname_,const bool inside_);
736
737// Apply a color lookup table (CLUT) to the image.
738void clut(const Image &clutImage_,const PixelInterpolateMethod method);
739void clutChannel(const ChannelType channel_,const Image &clutImage_,
740const PixelInterpolateMethod method);
741
742// Colorize image with pen color, using specified percent alpha.
743void colorize(const unsigned int alpha_,const Color &penColor_);
744
745// Colorize image with pen color, using specified percent alpha
746// for red, green, and blue quantums
747void colorize(const unsigned int alphaRed_,const unsigned int alphaGreen_,
748const unsigned int alphaBlue_,const Color &penColor_);
749
750// Color at colormap position index_
751void colorMap(const size_t index_,const Color &color_);
752Color colorMap(const size_t index_) const;
753
754// Apply a color matrix to the image channels. The user supplied
755// matrix may be of order 1 to 5 (1x1 through 5x5).
756void colorMatrix(const size_t order_,const double *color_matrix_);
757
758// Compare current image with another image
759// False is returned if the images are not identical.
760bool compare(const Image &reference_) const;
761
762// Compare current image with another image
763// Returns the distortion based on the specified metric.
764double compare(const Image &reference_,const MetricType metric_);
765double compareChannel(const ChannelType channel_,
766const Image &reference_,
767const MetricType metric_ );
768
769// Compare current image with another image
770// Sets the distortion and returns the difference image.
771Image compare(const Image &reference_,const MetricType metric_,
772double *distortion);
773Image compareChannel(const ChannelType channel_,const Image &reference_,
774const MetricType metric_,double *distortion);
775
776// Compose an image onto another at specified offset and using
777// specified algorithm
778void composite(const Image &compositeImage_,const Geometry &offset_,
779const CompositeOperator compose_=InCompositeOp);
780void composite(const Image &compositeImage_,const GravityType gravity_,
781const CompositeOperator compose_=InCompositeOp);
782void composite(const Image &compositeImage_,const ::ssize_t xOffset_,
783 const ::ssize_t yOffset_,const CompositeOperator compose_=InCompositeOp);
784
785// Determines the connected-components of the image
786void connectedComponents(const size_t connectivity_);
787
788// Contrast image (enhance intensity differences in image)
789void contrast(const bool sharpen_);
790
791// A simple image enhancement technique that attempts to improve the
792// contrast in an image by 'stretching' the range of intensity values
793// it contains to span a desired range of values. It differs from the
794// more sophisticated histogram equalization in that it can only apply a
795// linear scaling function to the image pixel values. As a result the
796// 'enhancement' is less harsh.
797void contrastStretch(const double blackPoint_,const double whitePoint_);
798void contrastStretchChannel(const ChannelType channel_,
799const double blackPoint_,const double whitePoint_);
800
801// Convolve image. Applies a user-specified convolution to the image.
802// order_ represents the number of columns and rows in the filter kernel.
803// kernel_ is an array of doubles representing the convolution kernel.
804void convolve(const size_t order_,const double *kernel_);
805
806// Copies pixels from the source image as defined by the geometry the
807// destination image at the specified offset.
808void copyPixels(const Image &source_,const Geometry &geometry_,
809const Offset &offset_);
810
811// Crop image (subregion of original image)
812void crop(const Geometry &geometry_);
813
814// Cycle image colormap
815void cycleColormap(const ::ssize_t amount_);
816
817// Converts cipher pixels to plain pixels.
818void decipher(const std::string &passphrase_);
819
820// Tagged image format define. Similar to the defineValue() method
821// except that passing the flag_ value 'true' creates a value-less
822// define with that format and key. Passing the flag_ value 'false'
823// removes any existing matching definition. The method returns 'true'
824// if a matching key exists, and 'false' if no matching key exists.
825void defineSet(const std::string &magick_,const std::string &key_,
826bool flag_);
827bool defineSet(const std::string &magick_,const std::string &key_) const;
828
829// Tagged image format define (set/access coder-specific option) The
830// magick_ option specifies the coder the define applies to. The key_
831// option provides the key specific to that coder. The value_ option
832// provides the value to set (if any). See the defineSet() method if the
833// key must be removed entirely.
834void defineValue(const std::string &magick_,const std::string &key_,
835const std::string &value_);
836 std::string defineValue(const std::string &magick_,
837const std::string &key_) const;
838
839// Removes skew from the image. Skew is an artifact that occurs in scanned
840// images because of the camera being misaligned, imperfections in the
841// scanning or surface, or simply because the paper was not placed
842// completely flat when scanned. The value of threshold_ ranges from 0
843// to QuantumRange.
844void deskew(const double threshold_);
845
846// Despeckle image (reduce speckle noise)
847void despeckle(void);
848
849// Display image on screen
850void display(void);
851
852// Distort image. distorts an image using various distortion methods, by
853// mapping color lookups of the source image to a new destination image
854// usally of the same size as the source image, unless 'bestfit' is set to
855// true.
856void distort(const DistortMethod method_,
857const size_t numberArguments_,const double *arguments_,
858const bool bestfit_=false);
859
860// Draw on image using a single drawable
861void draw(const Drawable &drawable_);
862
863// Draw on image using a drawable list
864void draw(const std::vector<Magick::Drawable> &drawable_);
865
866// Edge image (hilight edges in image)
867void edge(const double radius_=0.0);
868
869// Emboss image (hilight edges with 3D effect)
870// The radius_ parameter specifies the radius of the Gaussian, in
871// pixels, not counting the center pixel. The sigma_ parameter
872// specifies the standard deviation of the Laplacian, in pixels.
873void emboss(const double radius_=0.0,const double sigma_=1.0);
874
875// Converts pixels to cipher-pixels.
876void encipher(const std::string &passphrase_);
877
878// Enhance image (minimize noise)
879void enhance(void);
880
881// Equalize image (histogram equalization)
882void equalize(void);
883
884// Erase image to current "background color"
885void erase(void);
886
887// Apply a value with an arithmetic, relational, or logical operator.
888void evaluate(const ChannelType channel_,
889const MagickEvaluateOperator operator_,double rvalue_);
890
891// Apply a value with an arithmetic, relational, or logical operator.
892void evaluate(const ChannelType channel_,const MagickFunction function_,
893const size_t number_parameters_,const double *parameters_);
894
895// Apply a value with an arithmetic, relational, or logical operator.
896void evaluate(const ChannelType channel_,const ::ssize_t x_,
897 const ::ssize_t y_,const size_t columns_,const size_t rows_,
898const MagickEvaluateOperator operator_,const double rvalue_);
899
900// Extend the image as defined by the geometry.
901void extent(const Geometry &geometry_);
902void extent(const Geometry &geometry_,const Color &backgroundColor);
903void extent(const Geometry &geometry_,const Color &backgroundColor,
904const GravityType gravity_);
905void extent(const Geometry &geometry_,const GravityType gravity_);
906
907// Flip image (reflect each scanline in the vertical direction)
908void flip(void);
909
910// Floodfill pixels matching color (within fuzz factor) of target
911// pixel(x,y) with replacement alpha value.
912void floodFillAlpha(const ::ssize_t x_,const ::ssize_t y_,
913const unsigned int alpha_,const bool invert_=false);
914
915// Floodfill designated area with replacement alpha value
916void floodFillAlpha(const ssize_t x_,const ssize_t y_,
917const unsigned int alpha_,const Color &target_,const bool invert_=false);
918
919// Flood-fill color across pixels that match the color of the
920// target pixel and are neighbors of the target pixel.
921// Uses current fuzz setting when determining color match.
922void floodFillColor(const Geometry &point_,const Color &fillColor_,
923const bool invert_=false);
924void floodFillColor(const ::ssize_t x_,const ::ssize_t y_,
925const Color &fillColor_,const bool invert_=false);
926
927// Flood-fill color across pixels starting at target-pixel and
928// stopping at pixels matching specified border color.
929// Uses current fuzz setting when determining color match.
930void floodFillColor(const Geometry &point_,const Color &fillColor_,
931const Color &borderColor_,const bool invert_=false);
932void floodFillColor(const ::ssize_t x_,const ::ssize_t y_,
933const Color &fillColor_,const Color &borderColor_,
934const bool invert_=false);
935
936// Flood-fill texture across pixels that match the color of the
937// target pixel and are neighbors of the target pixel.
938// Uses current fuzz setting when determining color match.
939void floodFillTexture(const Geometry &point_,const Image &texture_,
940const bool invert_=false);
941void floodFillTexture(const ::ssize_t x_,const ::ssize_t y_,
942const Image &texture_,const bool invert_=false);
943
944// Flood-fill texture across pixels starting at target-pixel and
945// stopping at pixels matching specified border color.
946// Uses current fuzz setting when determining color match.
947void floodFillTexture(const Geometry &point_,const Image &texture_,
948const Color &borderColor_,const bool invert_=false);
949void floodFillTexture(const ::ssize_t x_,const ::ssize_t y_,
950const Image &texture_,const Color &borderColor_,
951const bool invert_=false);
952
953// Flop image (reflect each scanline in the horizontal direction)
954void flop(void);
955
956// Obtain font metrics for text string given current font,
957// pointsize, and density settings.
958void fontTypeMetrics(const std::string &text_,TypeMetric *metrics);
959
960// Obtain multi line font metrics for text string given current font,
961// pointsize, and density settings.
962void fontTypeMetricsMultiline(const std::string &text_,
963TypeMetric *metrics);
964
965// Frame image
966void frame(const Geometry &geometry_=frameGeometryDefault);
967void frame(const size_t width_,const size_t height_,
968 const ::ssize_t innerBevel_=6,const ::ssize_t outerBevel_=6);
969
970// Applies a mathematical expression to the image.
971void fx(const std::string expression_);
972void fx(const std::string expression_,const Magick::ChannelType channel_);
973
974// Gamma correct image
975void gamma(const double gamma_);
976void gamma(const double gammaRed_,const double gammaGreen_,
977const double gammaBlue_);
978
979// Gaussian blur image
980// The number of neighbor pixels to be included in the convolution
981// mask is specified by 'radius_'. The standard deviation of the
982// gaussian bell curve is specified by 'sigma_'.
983void gaussianBlur(const double radius_,const double sigma_);
984void gaussianBlurChannel(const ChannelType channel_,const double radius_,
985const double sigma_);
986
987// Transfers read-only pixels from the image to the pixel cache as
988// defined by the specified region.
989const Quantum *getConstPixels(const ::ssize_t x_, const ::ssize_t y_,
990const size_t columns_,const size_t rows_) const;
991
992// Obtain immutable image pixel metacontent. The selected region is defined
993// by the prior getPixels(), getConstPixels(), or setPixels() call.
994const void *getConstMetacontent(void) const;
995
996// Obtain mutable image pixel metacontent. The selected region is defined
997// by a prior getPixels(), getConstPixels(), or setPixels() call.
998void *getMetacontent(void);
999
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_,
1005const size_t columns_,const size_t rows_);
1006
1007// Converts the colors in the image to gray.
1008void grayscale(const PixelIntensityMethod method_);
1009
1010// Apply a color lookup table (Hald CLUT) to the image.
1011void haldClut(const Image &clutImage_);
1012
1013// Identifies lines in the image.
1014void houghLine(const size_t width_,const size_t height_,
1015const 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)
1022void 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.
1026void inverseFourierTransform(const Image &phase_);
1027void inverseFourierTransform(const Image &phase_,const bool magnitude_);
1028
1029// An edge preserving noise reduction filter.
1030void kuwahara(const double radius_=0.0,const double sigma_=1.0);
1031void kuwaharaChannel(const ChannelType channel_,const double radius_=0.0,
1032const 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.
1045void level(const double blackPoint_,const double whitePoint_,
1046const double gamma_=1.0);
1047void levelChannel(const ChannelType channel_,const double blackPoint_,
1048const 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.
1054void levelColors(const Color &blackColor_,const Color &whiteColor_,
1055const bool invert_=true);
1056void levelColorsChannel(const ChannelType channel_,
1057const Color &blackColor_,const Color &whiteColor_,
1058const 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.
1064void levelize(const double blackPoint_,const double whitePoint_,
1065const double gamma_=1.0);
1066void levelizeChannel(const ChannelType channel_,const double blackPoint_,
1067const 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.
1071void linearStretch(const double blackPoint_,const double whitePoint_);
1072
1073// Rescales image with seam carving.
1074void liquidRescale(const Geometry &geometry_);
1075
1076// Local contrast enhancement
1077void localContrast(const double radius_,const double strength_);
1078void localContrastChannel(const ChannelType channel_,const double radius_,
1079const double strength_);
1080
1081// Magnify image by integral size
1082void magnify(void);
1083
1084// Remap image colors with closest color from reference image
1085void map(const Image &mapImage_,const bool dither_=false);
1086
1087// Delineate arbitrarily shaped clusters in the image.
1088void meanShift(const size_t width_,const size_t height_,
1089const double color_distance_);
1090
1091// Filter image by replacing each pixel component with the median
1092// color in a circular neighborhood
1093void medianFilter(const double radius_=0.0);
1094
1095// Reduce image by integral size
1096void minify(void);
1097
1098// Modulate percent hue, saturation, and brightness of an image
1099void modulate(const double brightness_,const double saturation_,
1100const double hue_);
1101
1102// Returns the normalized moments of one or more image channels.
1103ImageMoments moments(void) const;
1104
1105// Applies a kernel to the image according to the given mophology method.
1106void morphology(const MorphologyMethod method_,const std::string kernel_,
1107const ssize_t iterations_=1);
1108void morphology(const MorphologyMethod method_,
1109const KernelInfoType kernel_,const std::string arguments_,
1110const ssize_t iterations_=1);
1111void morphologyChannel(const ChannelType channel_,
1112const MorphologyMethod method_,const std::string kernel_,
1113const ssize_t iterations_=1);
1114void morphologyChannel(const ChannelType channel_,
1115const MorphologyMethod method_,const KernelInfoType kernel_,
1116const 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 comming from (zero degrees is from the right).
1124void motionBlur(const double radius_,const double sigma_,
1125const double angle_);
1126
1127// Negate colors in image. Set grayscale to only negate grayscale
1128// values in image.
1129void negate(const bool grayscale_=false);
1130void 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)
1134void normalize(void);
1135
1136// Oilpaint image (image looks like oil painting)
1137void oilPaint(const double radius_=0.0,const double sigma=1.0);
1138
1139// Change color of opaque pixel to specified pen color.
1140void opaque(const Color &opaqueColor_,const Color &penColor_,
1141const 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.
1145void orderedDither(std::string thresholdMap_);
1146void 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.
1152void perceptible(const double epsilon_);
1153void perceptibleChannel(const ChannelType channel_,const double epsilon_);
1154
1155// Returns the perceptual hash for this image.
1156Magick::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.
1162void 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.
1168void ping(const Blob &blob_);
1169
1170// Get/set pixel color at location x & y.
1171void pixelColor(const ::ssize_t x_,const ::ssize_t y_,const Color &color_);
1172Color pixelColor(const ::ssize_t x_,const ::ssize_t y_ ) const;
1173
1174// Simulates a Polaroid picture.
1175void polaroid(const std::string &caption_,const double angle_,
1176const PixelInterpolateMethod method_);
1177
1178// Reduces the image to a limited number of colors for a "poster" effect.
1179void posterize(const size_t levels_,const DitherMethod method_);
1180void posterizeChannel(const ChannelType channel_,const size_t levels_,
1181const 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.
1187void 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.
1192void 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.
1197Blob profile(const std::string name_) const;
1198
1199// Quantize image (reduce number of colors)
1200void 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)
1204void raise(const Geometry &geometry_=raiseGeometryDefault,
1205const 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.
1212void randomThreshold(const double low_,const double high_);
1213void randomThresholdChannel(const ChannelType channel_,const double low_,
1214const double high_);
1215
1216// Read single image frame from in-memory BLOB
1217void read(const Blob &blob_);
1218
1219// Read single image frame of specified size from in-memory BLOB
1220void read(const Blob &blob_,const Geometry &size_);
1221
1222// Read single image frame of specified size and depth from
1223// in-memory BLOB
1224void 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
1228void read(const Blob &blob_,const Geometry &size_,const size_t depth_,
1229const std::string &magick_);
1230
1231// Read single image frame of specified size, and format from
1232// in-memory BLOB
1233void read(const Blob &blob_,const Geometry &size_,
1234const std::string &magick_);
1235
1236// Read single image frame of specified size into current object
1237void 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 );
1242void read(const size_t width_,const size_t height_,const std::string &map_,
1243const StorageType type_,const void *pixels_);
1244
1245// Read single image frame into current object
1246void 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.
1250void readMask(const Image &mask_);
1251Image 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.
1256void readPixels(const QuantumType quantum_,const unsigned char *source_);
1257
1258// Reduce noise in image using a noise peak elimination filter
1259void reduceNoise(void);
1260void reduceNoise(const size_t order_);
1261
1262// Resets the image page canvas and position.
1263void repage();
1264
1265// Resize image in terms of its pixel size.
1266void resample(const Point &density_);
1267
1268// Resize image to specified size.
1269void resize(const Geometry &geometry_);
1270
1271// Roll image (rolls image vertically and horizontally) by specified
1272// number of columnms and rows)
1273void roll(const Geometry &roll_);
1274void 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.
1278void rotate(const double degrees_);
1279
1280// Rotational blur image.
1281void rotationalBlur(const double angle_);
1282void rotationalBlurChannel(const ChannelType channel_,const double angle_);
1283
1284// Resize image by using pixel sampling algorithm
1285void sample(const Geometry &geometry_);
1286
1287// Resize image by using simple ratio algorithm
1288void 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
1294void segment(const double clusterThreshold_=1.0,
1295const 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.
1300void selectiveBlur(const double radius_,const double sigma_,
1301const double threshold_);
1302void selectiveBlurChannel(const ChannelType channel_,const double radius_,
1303const double sigma_,const double threshold_);
1304
1305// Separates a channel from the image and returns it as a grayscale image.
1306Image 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.
1312void sepiaTone(const double threshold_);
1313
1314// Sets meanErrorPerPixel, normalizedMaxError, and normalizedMeanError
1315// in the current image. False is returned if the images are not identical.
1316bool 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_,
1322const size_t columns_,const size_t rows_);
1323
1324// Shade image using distant light source
1325void shade(const double azimuth_=30,const double elevation_=30,
1326const bool colorShading_=false);
1327
1328// Simulate an image shadow
1329void shadow(const double percentAlpha_=80.0,const double sigma_=0.5,
1330const 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.
1336void sharpen(const double radius_=0.0,const double sigma_=1.0);
1337void sharpenChannel(const ChannelType channel_,const double radius_=0.0,
1338const double sigma_=1.0);
1339
1340// Shave pixels from image edges.
1341void shave(const Geometry &geometry_);
1342
1343// Shear image (create parallelogram by sliding image by X or Y axis)
1344void shear(const double xShearAngle_,const double yShearAngle_);
1345
1346// adjust the image contrast with a non-linear sigmoidal contrast algorithm
1347void sigmoidalContrast(const bool sharpen_,const double contrast,
1348const 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.
1359void sketch(const double radius_=0.0,const double sigma_=1.0,
1360const double angle_=0.0);
1361
1362// Solarize image (similar to effect seen when exposing a
1363// photographic film to light during the development process)
1364void 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.
1369void sparseColor(const ChannelType channel_,
1370const SparseColorMethod method_,const size_t numberArguments_,
1371const double *arguments_);
1372
1373// Splice the background color into the image.
1374void splice(const Geometry &geometry_);
1375void splice(const Geometry &geometry_,const Color &backgroundColor_);
1376void splice(const Geometry &geometry_,const Color &backgroundColor_,
1377const GravityType gravity_);
1378
1379// Spread pixels randomly within image by specified ammount
1380void spread(const double amount_=3.0);
1381
1382// Returns the statistics for this image.
1383Magick::ImageStatistics statistics() const;
1384
1385// Add a digital watermark to the image (based on second image)
1386void 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)
1390void stereo(const Image &rightImage_);
1391
1392// Strip strips an image of all profiles and comments.
1393void 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.
1399Image subImageSearch(const Image &reference_,const MetricType metric_,
1400Geometry *offset_,double *similarityMetric_,
1401const double similarityThreshold=(-1.0));
1402
1403// Swirl image (image pixels are rotated by degrees)
1404void swirl(const double degrees_);
1405
1406// Transfers the image cache pixels to the image.
1407void syncPixels(void);
1408
1409// Channel a texture on image background
1410void texture(const Image &texture_);
1411
1412// Threshold image
1413void threshold(const double threshold_);
1414
1415// Resize image to thumbnail size
1416void 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))))
1421void tint(const std::string opacity_);
1422
1423// Origin of coordinate system to use when annotating with text or drawing
1424void transformOrigin(const double x_,const double y_);
1425
1426// Reset transformation parameters to default
1427void transformReset(void);
1428
1429// Scale to use when annotating with text or drawing
1430void transformScale(const double sx_,const double sy_);
1431
1432// Add matte image to image, setting pixels matching color to
1433// transparent
1434void 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
1438void 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.
1442void 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.
1446void transverse(void);
1447
1448// Trim edges that are the background color from the image
1449void trim(void);
1450
1451// Returns the unique colors of an image.
1452Image 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 diffence amount.
1466void unsharpmask(const double radius_,const double sigma_,
1467const double amount_,const double threshold_);
1468void unsharpmaskChannel(const ChannelType channel_,const double radius_,
1469const double sigma_,const double amount_,const double threshold_);
1470
1471// Softens the edges of the image in vignette style.
1472void vignette(const double radius_=0.0,const double sigma_=1.0,
1473const ssize_t x_=0,const ssize_t y_=0);
1474
1475// Map image pixels to a sine wave
1476void wave(const double amplitude_=25.0,const double wavelength_=150.0);
1477
1478// Removes noise from the image using a wavelet transform.
1479void 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.
1483void whiteThreshold(const std::string &threshold_);
1484void whiteThresholdChannel(const ChannelType channel_,
1485const std::string &threshold_);
1486
1487// Write single image frame to in-memory BLOB, with optional
1488// format and adjoin parameters.
1489void write(Blob *blob_);
1490void write(Blob *blob_,const std::string &magick_);
1491void 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 );
1496void write(const ::ssize_t x_,const ::ssize_t y_,const size_t columns_,
1497const size_t rows_,const std::string &map_,const StorageType type_,
1498void *pixels_);
1499
1500// Write single image frame to a file
1501void 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.
1505void writeMask(const Image &mask_);
1506Image 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.
1511void writePixels(const QuantumType quantum_,unsigned char *destination_);
1512
1513// Zoom image to specified size.
1514void zoom(const Geometry &geometry_);
1515
1517//
1518// No user-serviceable parts beyond this point
1519//
1521
1522// Construct with MagickCore::Image and default options
1523Image(MagickCore::Image *image_);
1524
1525// Retrieve Image*
1526MagickCore::Image *&image(void);
1527const MagickCore::Image *constImage(void) const;
1528
1529// Retrieve ImageInfo*
1530 MagickCore::ImageInfo *imageInfo(void);
1531const MagickCore::ImageInfo *constImageInfo(void) const;
1532
1533// Retrieve Options*
1534Options *options(void);
1535const Options *constOptions(void) const;
1536
1537// Retrieve QuantizeInfo*
1538 MagickCore::QuantizeInfo *quantizeInfo(void);
1539const MagickCore::QuantizeInfo *constQuantizeInfo(void) const;
1540
1541// Prepare to update image (copy if reference > 1)
1542void modifyImage(void);
1543
1544// Replace current image (reference counted)
1545MagickCore::Image *replaceImage(MagickCore::Image *replacement_);
1546
1547private:
1548
1549void floodFill(const ssize_t x_,const ssize_t y_,
1550const Magick::Image *fillPattern_,const Color &fill_,
1551const PixelInfo *target,const bool invert_);
1552
1553void mask(const Image &mask_,const PixelMask);
1554Image mask(const PixelMask) const;
1555
1556void read(MagickCore::Image *image,
1557 MagickCore::ExceptionInfo *exceptionInfo);
1558
1559ImageRef *_imgRef;
1560 };
1561
1562 } // end of namespace Magick
1563
1564 #endif // Magick_Image_header
MagickPPExport const char * borderGeometryDefault
Definition: Image.cpp:34
MagickPPExport const char * raiseGeometryDefault
Definition: Image.cpp:36
Definition: Statistic.h:244
Definition: Geometry.h:208
Definition: Options.h:30
Definition: Statistic.h:219
Definition: ImageRef.h:28
Definition: Blob.h:22
#define MagickPPExport
Definition: Include.h:297
Definition: Geometry.h:151
Definition: Color.h:36
MagickPPExport const char * frameGeometryDefault
Definition: Image.cpp:35
Definition: Drawable.h:226
Definition: Geometry.h:37
Definition: Statistic.h:282
Definition: Drawable.h:120
class MagickPPExport Image
Definition: Drawable.h:722
Definition: Blob.h:17
Definition: Image.h:55
Definition: TypeMetric.h:21