/
Image.h
1564 lines (1224 loc) Β· 62.7 KB
/
Image.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// This may look like C code, but it is really -*- C++ -*-
//
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
//
// Copyright @ 2013 ImageMagick Studio LLC, a non-profit organization
// dedicated to making software imaging solutions freely available.
//
// Definition of Image, the representation of a single image in Magick++
//
#if !defined(Magick_Image_header)
#define Magick_Image_header
#include "Magick++/Include.h"
#include <string>
#include <list>
#include "Magick++/Blob.h"
#include "Magick++/Color.h"
#include "Magick++/Drawable.h"
#include "Magick++/Exception.h"
#include "Magick++/Geometry.h"
#include "Magick++/Statistic.h"
#include "Magick++/TypeMetric.h"
namespace Magick
{
// Forward declarations
class Options;
class ImageRef;
extern MagickPPExport const char *borderGeometryDefault;
extern MagickPPExport const char *frameGeometryDefault;
extern MagickPPExport const char *raiseGeometryDefault;
// Compare two Image objects regardless of LHS/RHS
// Image sizes and signatures are used as basis of comparison
MagickPPExport int operator ==
(const Magick::Image &left_,const Magick::Image &right_);
MagickPPExport int operator !=
(const Magick::Image &left_,const Magick::Image &right_);
MagickPPExport int operator >
(const Magick::Image &left_,const Magick::Image &right_);
MagickPPExport int operator <
(const Magick::Image &left_,const Magick::Image &right_);
MagickPPExport int operator >=
(const Magick::Image &left_,const Magick::Image &right_);
MagickPPExport int operator <=
(const Magick::Image &left_,const Magick::Image &right_);
//
// Image is the representation of an image. In reality, it actually
// a handle object which contains a pointer to a shared reference
// object (ImageRef). As such, this object is extremely space efficient.
//
class MagickPPExport Image
{
public:
// Default constructor
Image(void);
// Construct Image from in-memory BLOB
Image(const Blob &blob_);
// Construct Image of specified size from in-memory BLOB
Image(const Blob &blob_,const Geometry &size_);
// Construct Image of specified size and depth from in-memory BLOB
Image(const Blob &blob_,const Geometry &size_,const size_t depth_);
// Construct Image of specified size, depth, and format from
// in-memory BLOB
Image(const Blob &blob_,const Geometry &size_,const size_t depth_,
const std::string &magick_);
// Construct Image of specified size, and format from in-memory BLOB
Image(const Blob &blob_,const Geometry &size_,const std::string &magick_);
// Construct a blank image canvas of specified size and color
Image(const Geometry &size_,const Color &color_);
// Copy constructor
Image(const Image &image_);
// Copy constructor to copy part of the image
Image(const Image &image_,const Geometry &geometry_);
// Construct an image based on an array of raw pixels, of
// specified type and mapping, in memory
Image(const size_t width_,const size_t height_,const std::string &map_,
const StorageType type_,const void *pixels_);
// Construct from image file or image specification
Image(const std::string &imageSpec_);
// Destructor
virtual ~Image();
// Assignment operator
Image& operator=(const Image &image_);
// Join images into a single multi-image file
void adjoin(const bool flag_);
bool adjoin(void) const;
// Image supports transparency (alpha channel)
void alpha(const bool alphaFlag_);
bool alpha(void) const;
// Transparent color
void matteColor(const Color &matteColor_);
Color matteColor(void) const;
// Time in 1/100ths of a second which must expire before
// displaying the next image in an animated sequence.
void animationDelay(const size_t delay_);
size_t animationDelay(void) const;
// Number of iterations to loop an animation (e.g. Netscape loop
// extension) for.
void animationIterations(const size_t iterations_);
size_t animationIterations(void) const;
// Image background color
void backgroundColor(const Color &color_);
Color backgroundColor(void) const;
// Name of texture image to tile onto the image background
void backgroundTexture(const std::string &backgroundTexture_);
std::string backgroundTexture(void) const;
// Base image width (before transformations)
size_t baseColumns(void) const;
// Base image filename (before transformations)
std::string baseFilename(void) const;
// Base image height (before transformations)
size_t baseRows(void) const;
// Use black point compensation.
void blackPointCompensation(const bool flag_);
bool blackPointCompensation(void) const;
// Image border color
void borderColor(const Color &color_);
Color borderColor(void) const;
// Return smallest bounding box enclosing non-border pixels. The
// current fuzz value is used when discriminating between pixels.
// This is the crop bounding box used by crop(Geometry(0,0));
Geometry boundingBox(void) const;
// Text bounding-box base color (default none)
void boxColor(const Color &boxColor_);
Color boxColor(void) const;
// Set or obtain modulus channel depth
void channelDepth(const ChannelType channel_,const size_t depth_);
size_t channelDepth(const ChannelType channel_);
// Returns the number of channels in this image.
size_t channels() const;
// Image class (DirectClass or PseudoClass)
// NOTE: setting a DirectClass image to PseudoClass will result in
// the loss of color information if the number of colors in the
// image is greater than the maximum palette size (either 256 or
// 65536 entries depending on the value of MAGICKCORE_QUANTUM_DEPTH when
// ImageMagick was built).
void classType(const ClassType class_);
ClassType classType(void) const;
// Colors within this distance are considered equal
void colorFuzz(const double fuzz_);
double colorFuzz(void) const;
// Colormap size (number of colormap entries)
void colorMapSize(const size_t entries_);
size_t colorMapSize(void) const;
// Image Color Space
void colorSpace(const ColorspaceType colorSpace_);
ColorspaceType colorSpace(void) const;
void colorSpaceType(const ColorspaceType colorSpace_);
ColorspaceType colorSpaceType(void) const;
// Image width
size_t columns(void) const;
// Comment image (add comment string to image)
void comment(const std::string &comment_);
std::string comment(void) const;
// Composition operator to be used when composition is implicitly
// used (such as for image flattening).
void compose(const CompositeOperator compose_);
CompositeOperator compose(void) const;
// Compression type
void compressType(const CompressionType compressType_);
CompressionType compressType(void) const;
// Enable printing of debug messages from ImageMagick
void debug(const bool flag_);
bool debug(void) const;
// Vertical and horizontal resolution in pixels of the image
void density(const Point &density_);
Point density(void) const;
// Image depth (bits allocated to red/green/blue components)
void depth(const size_t depth_);
size_t depth(void) const;
// Tile names from within an image montage
std::string directory(void) const;
// Endianness (little like Intel or big like SPARC) for image
// formats which support endian-specific options.
void endian(const EndianType endian_);
EndianType endian(void) const;
// Exif profile (BLOB)
void exifProfile(const Blob &exifProfile_);
Blob exifProfile(void) const;
// Image file name
void fileName(const std::string &fileName_);
std::string fileName(void) const;
// Number of bytes of the image on disk
MagickSizeType fileSize(void) const;
// Color to use when filling drawn objects
void fillColor(const Color &fillColor_);
Color fillColor(void) const;
// Rule to use when filling drawn objects
void fillRule(const FillRule &fillRule_);
FillRule fillRule(void) const;
// Pattern to use while filling drawn objects.
void fillPattern(const Image &fillPattern_);
Image fillPattern(void) const;
// Filter to use when resizing image
void filterType(const FilterType filterType_);
FilterType filterType(void) const;
// Text rendering font
void font(const std::string &font_);
std::string font(void) const;
// Font family
void fontFamily(const std::string &family_);
std::string fontFamily(void) const;
// Font point size
void fontPointsize(const double pointSize_);
double fontPointsize(void) const;
// Font style
void fontStyle(const StyleType style_);
StyleType fontStyle(void) const;
// Font weight
void fontWeight(const size_t weight_);
size_t fontWeight(void) const;
// Long image format description
std::string format(void) const;
// Formats the specified expression
// More info here: https://imagemagick.org/script/escape.php
std::string formatExpression(const std::string expression);
// Gamma level of the image
double gamma(void) const;
// Preferred size of the image when encoding
Geometry geometry(void) const;
// GIF disposal method
void gifDisposeMethod(const DisposeType disposeMethod_);
DisposeType gifDisposeMethod(void) const;
bool hasChannel(const PixelChannel channel) const;
// When comparing images, emphasize pixel differences with this color.
void highlightColor(const Color color_);
// ICC color profile (BLOB)
void iccColorProfile(const Blob &colorProfile_);
Blob iccColorProfile(void) const;
// Type of interlacing to use
void interlaceType(const InterlaceType interlace_);
InterlaceType interlaceType(void) const;
// Pixel color interpolation method to use
void interpolate(const PixelInterpolateMethod interpolate_);
PixelInterpolateMethod interpolate(void) const;
// IPTC profile (BLOB)
void iptcProfile(const Blob &iptcProfile_);
Blob iptcProfile(void) const;
// Returns true if none of the pixels in the image have an alpha value
// other than OpaqueAlpha (QuantumRange).
bool isOpaque(void) const;
// Does object contain valid image?
void isValid(const bool isValid_);
bool isValid(void) const;
// Image label
void label(const std::string &label_);
std::string label(void) const;
// When comparing images, de-emphasize pixel differences with this color.
void lowlightColor(const Color color_);
// File type magick identifier (.e.g "GIF")
void magick(const std::string &magick_);
std::string magick(void) const;
// When comparing images, set pixels with a read mask to this color.
void masklightColor(const Color color_);
// The mean error per pixel computed when an image is color reduced
double meanErrorPerPixel(void) const;
// Image modulus depth (minimum number of bits required to support
// red/green/blue components without loss of accuracy)
void modulusDepth(const size_t modulusDepth_);
size_t modulusDepth(void) const;
// Transform image to black and white
void monochrome(const bool monochromeFlag_);
bool monochrome(void) const;
// Tile size and offset within an image montage
Geometry montageGeometry(void) const;
// The normalized max error per pixel computed when an image is
// color reduced.
double normalizedMaxError(void) const;
// The normalized mean error per pixel computed when an image is
// color reduced.
double normalizedMeanError(void) const;
// Image orientation
void orientation(const OrientationType orientation_);
OrientationType orientation(void) const;
// Preferred size and location of an image canvas.
void page(const Geometry &pageSize_);
Geometry page(void) const;
// JPEG/MIFF/PNG compression level (default 75).
void quality(const size_t quality_);
size_t quality(void) const;
// Maximum number of colors to quantize to
void quantizeColors(const size_t colors_);
size_t quantizeColors(void) const;
// Colorspace to quantize in.
void quantizeColorSpace(const ColorspaceType colorSpace_);
ColorspaceType quantizeColorSpace(void) const;
// Dither image during quantization (default true).
void quantizeDither(const bool ditherFlag_);
bool quantizeDither(void) const;
// Dither method
void quantizeDitherMethod(const DitherMethod ditherMethod_);
DitherMethod quantizeDitherMethod(void) const;
// Quantization tree-depth
void quantizeTreeDepth(const size_t treeDepth_);
size_t quantizeTreeDepth(void) const;
// Suppress all warning messages. Error messages are still reported.
void quiet(const bool quiet_);
bool quiet(void) const;
// The type of rendering intent
void renderingIntent(const RenderingIntent renderingIntent_);
RenderingIntent renderingIntent(void) const;
// Units of image resolution
void resolutionUnits(const ResolutionType resolutionUnits_);
ResolutionType resolutionUnits(void) const;
// The number of pixel rows in the image
size_t rows(void) const;
// Image sampling factor
void samplingFactor(const std::string &samplingFactor_);
std::string samplingFactor(void) const;
// Image scene number
void scene(const size_t scene_);
size_t scene(void) const;
// Width and height of a raw image
void size(const Geometry &geometry_);
Geometry size(void) const;
// enabled/disable stroke anti-aliasing
void strokeAntiAlias(const bool flag_);
bool strokeAntiAlias(void) const;
// Color to use when drawing object outlines
void strokeColor(const Color &strokeColor_);
Color strokeColor(void) const;
// Specify the pattern of dashes and gaps used to stroke
// paths. The strokeDashArray represents a zero-terminated array
// of numbers that specify the lengths of alternating dashes and
// gaps in pixels. If an odd number of values is provided, then
// the list of values is repeated to yield an even number of
// values. A typical strokeDashArray_ array might contain the
// members 5 3 2 0, where the zero value indicates the end of the
// pattern array.
void strokeDashArray(const double *strokeDashArray_);
const double *strokeDashArray(void) const;
// While drawing using a dash pattern, specify distance into the
// dash pattern to start the dash (default 0).
void strokeDashOffset(const double strokeDashOffset_);
double strokeDashOffset(void) const;
// Specify the shape to be used at the end of open subpaths when
// they are stroked. Values of LineCap are UndefinedCap, ButtCap,
// RoundCap, and SquareCap.
void strokeLineCap(const LineCap lineCap_);
LineCap strokeLineCap(void) const;
// Specify the shape to be used at the corners of paths (or other
// vector shapes) when they are stroked. Values of LineJoin are
// UndefinedJoin, MiterJoin, RoundJoin, and BevelJoin.
void strokeLineJoin(const LineJoin lineJoin_);
LineJoin strokeLineJoin(void) const;
// Specify miter limit. When two line segments meet at a sharp
// angle and miter joins have been specified for 'lineJoin', it is
// possible for the miter to extend far beyond the thickness of
// the line stroking the path. The miterLimit' imposes a limit on
// the ratio of the miter length to the 'lineWidth'. The default
// value of this parameter is 4.
void strokeMiterLimit(const size_t miterLimit_);
size_t strokeMiterLimit(void) const;
// Pattern image to use while stroking object outlines.
void strokePattern(const Image &strokePattern_);
Image strokePattern(void) const;
// Stroke width for drawing vector objects (default one)
void strokeWidth(const double strokeWidth_);
double strokeWidth(void) const;
// Subimage of an image sequence
void subImage(const size_t subImage_);
size_t subImage(void) const;
// Number of images relative to the base image
void subRange(const size_t subRange_);
size_t subRange(void) const;
// Anti-alias Postscript and TrueType fonts (default true)
void textAntiAlias(const bool flag_);
bool textAntiAlias(void) const;
// Render text right-to-left or left-to-right.
void textDirection(DirectionType direction_);
DirectionType textDirection() const;
// Annotation text encoding (e.g. "UTF-16")
void textEncoding(const std::string &encoding_);
std::string textEncoding(void) const;
// Text gravity.
void textGravity(GravityType gravity_);
GravityType textGravity() const;
// Text inter-line spacing
void textInterlineSpacing(double spacing_);
double textInterlineSpacing(void) const;
// Text inter-word spacing
void textInterwordSpacing(double spacing_);
double textInterwordSpacing(void) const;
// Text inter-character kerning
void textKerning(double kerning_);
double textKerning(void) const;
// Text undercolor box
void textUnderColor(const Color &underColor_);
Color textUnderColor(void) const;
// Number of colors in the image
size_t totalColors(void) const;
// Rotation to use when annotating with text or drawing
void transformRotation(const double angle_);
// Skew to use in X axis when annotating with text or drawing
void transformSkewX(const double skewx_);
// Skew to use in Y axis when annotating with text or drawing
void transformSkewY(const double skewy_);
// Image representation type (also see type operation)
// Available types:
// Bilevel PaletteBilevelAlpha
// Grayscale GrayscaleAlpha
// Palette PaletteAlpha
// TrueColor TrueColorAlpha
// ColorSeparation ColorSeparationAlpha
void type(const ImageType type_);
ImageType type(void) const;
// Print detailed information about the image
void verbose(const bool verboseFlag_);
bool verbose(void) const;
// Virtual pixel method
void virtualPixelMethod(const VirtualPixelMethod virtualPixelMethod_);
VirtualPixelMethod virtualPixelMethod(void) const;
// X11 display to display to, obtain fonts from, or to capture
// image from
void x11Display(const std::string &display_);
std::string x11Display(void) const;
// x resolution of the image
double xResolution(void) const;
// y resolution of the image
double yResolution(void) const;
// Adaptive-blur image with specified blur factor
// The radius_ parameter specifies the radius of the Gaussian, in
// pixels, not counting the center pixel. The sigma_ parameter
// specifies the standard deviation of the Laplacian, in pixels.
void adaptiveBlur(const double radius_=0.0,const double sigma_=1.0);
// This is shortcut function for a fast interpolative resize using mesh
// interpolation. It works well for small resizes of less than +/- 50%
// of the original image size. For larger resizing on images a full
// filtered and slower resize function should be used instead.
void adaptiveResize(const Geometry &geometry_);
// Adaptively sharpens the image by sharpening more intensely near image
// edges and less intensely far from edges. We sharpen the image with a
// Gaussian operator of the given radius and standard deviation (sigma).
// For reasonable results, radius should be larger than sigma.
void adaptiveSharpen(const double radius_=0.0,const double sigma_=1.0);
void adaptiveSharpenChannel(const ChannelType channel_,
const double radius_=0.0,const double sigma_=1.0);
// Local adaptive threshold image
// http://www.dai.ed.ac.uk/HIPR2/adpthrsh.htm
// Width x height define the size of the pixel neighborhood
// bias = constant to subtract from pixel neighborhood mean
void adaptiveThreshold(const size_t width_,const size_t height_,
const double bias_=0.0);
// Add noise to image with specified noise type
void addNoise(const NoiseType noiseType_,const double attenuate_=1.0);
void addNoiseChannel(const ChannelType channel_,
const NoiseType noiseType_,const double attenuate_=1.0);
// Transform image by specified affine (or free transform) matrix.
void affineTransform(const DrawableAffine &affine);
// Set or attenuate the alpha channel in the image. If the image
// pixels are opaque then they are set to the specified alpha
// value, otherwise they are blended with the supplied alpha
// value. The value of alpha_ ranges from 0 (completely opaque)
// to QuantumRange. The defines OpaqueAlpha and TransparentAlpha are
// available to specify completely opaque or completely
// transparent, respectively.
void alpha(const unsigned int alpha_);
// AlphaChannel() activates, deactivates, resets, or sets the alpha
// channel.
void alphaChannel(AlphaChannelOption alphaOption_);
//
// Annotate image (draw text on image)
//
// Gravity effects text placement in bounding area according to rules:
// NorthWestGravity text bottom-left corner placed at top-left
// NorthGravity text bottom-center placed at top-center
// NorthEastGravity text bottom-right corner placed at top-right
// WestGravity text left-center placed at left-center
// CenterGravity text center placed at center
// EastGravity text right-center placed at right-center
// SouthWestGravity text top-left placed at bottom-left
// SouthGravity text top-center placed at bottom-center
// SouthEastGravity text top-right placed at bottom-right
// Annotate using specified text, and placement location
void annotate(const std::string &text_,const Geometry &location_);
// Annotate using specified text, bounding area, and placement
// gravity
void annotate(const std::string &text_,const Geometry &boundingArea_,
const GravityType gravity_);
// Annotate with text using specified text, bounding area,
// placement gravity, and rotation.
void annotate(const std::string &text_,const Geometry &boundingArea_,
const GravityType gravity_,const double degrees_);
// Annotate with text (bounding area is entire image) and placement
// gravity.
void annotate(const std::string &text_,const GravityType gravity_);
// Inserts the artifact with the specified name and value into
// the artifact tree of the image.
void artifact(const std::string &name_,const std::string &value_);
// Returns the value of the artifact with the specified name.
std::string artifact(const std::string &name_) const;
// Access/Update a named image attribute
void attribute(const std::string name_,const char *value_);
void attribute(const std::string name_,const std::string value_);
std::string attribute(const std::string name_) const;
// Extracts the 'mean' from the image and adjust the image to try
// make set its gamma appropriately.
void autoGamma(void);
void autoGammaChannel(const ChannelType channel_);
// Adjusts the levels of a particular image channel by scaling the
// minimum and maximum values to the full quantum range.
void autoLevel(void);
void autoLevelChannel(const ChannelType channel_);
// Adjusts an image so that its orientation is suitable for viewing.
void autoOrient(void);
// Automatically selects a threshold and replaces each pixel in the image
// with a black pixel if the image intensity is less than the selected
// threshold otherwise white.
void autoThreshold(const AutoThresholdMethod method_);
// Forces all pixels below the threshold into black while leaving all
// pixels at or above the threshold unchanged.
void blackThreshold(const std::string &threshold_);
void blackThresholdChannel(const ChannelType channel_,
const std::string &threshold_);
// Simulate a scene at nighttime in the moonlight.
void blueShift(const double factor_=1.5);
// Blur image with specified blur factor
// The radius_ parameter specifies the radius of the Gaussian, in
// pixels, not counting the center pixel. The sigma_ parameter
// specifies the standard deviation of the Laplacian, in pixels.
void blur(const double radius_=0.0,const double sigma_=1.0);
void blurChannel(const ChannelType channel_,const double radius_=0.0,
const double sigma_=1.0);
// Border image (add border to image)
void border(const Geometry &geometry_=borderGeometryDefault);
// Changes the brightness and/or contrast of an image. It converts the
// brightness and contrast parameters into slope and intercept and calls
// a polynomial function to apply to the image.
void brightnessContrast(const double brightness_=0.0,
const double contrast_=0.0);
void brightnessContrastChannel(const ChannelType channel_,
const double brightness_=0.0,const double contrast_=0.0);
// Uses a multi-stage algorithm to detect a wide range of edges in images.
void cannyEdge(const double radius_=0.0,const double sigma_=1.0,
const double lowerPercent_=0.1,const double upperPercent_=0.3);
// Accepts a lightweight Color Correction Collection
// (CCC) file which solely contains one or more color corrections and
// applies the correction to the image.
void cdl(const std::string &cdl_);
// Extract channel from image
void channel(const ChannelType channel_);
// Charcoal effect image (looks like charcoal sketch)
// The radius_ parameter specifies the radius of the Gaussian, in
// pixels, not counting the center pixel. The sigma_ parameter
// specifies the standard deviation of the Laplacian, in pixels.
void charcoal(const double radius_=0.0,const double sigma_=1.0);
void charcoalChannel(const ChannelType channel_,const double radius_=0.0,
const double sigma_=1.0);
// Chop image (remove vertical or horizontal subregion of image)
// FIXME: describe how geometry argument is used to select either
// horizontal or vertical subregion of image.
void chop(const Geometry &geometry_);
// Chromaticity blue primary point.
void chromaBluePrimary(const double x_,const double y_,const double z_);
void chromaBluePrimary(double *x_,double *y_,double *z_) const;
// Chromaticity green primary point.
void chromaGreenPrimary(const double x_,const double y_,const double z_);
void chromaGreenPrimary(double *x_,double *y_,double *z_) const;
// Chromaticity red primary point.
void chromaRedPrimary(const double x_,const double y_,const double z_);
void chromaRedPrimary(double *x_,double *y_,double *z_) const;
// Chromaticity white point.
void chromaWhitePoint(const double x_,const double y_,const double z_);
void chromaWhitePoint(double *x_,double *y_,double *z_) const;
// Set each pixel whose value is below zero to zero and any the
// pixel whose value is above the quantum range to the quantum range (e.g.
// 65535) otherwise the pixel value remains unchanged.
void clamp(void);
void clampChannel(const ChannelType channel_);
// Sets the image clip mask based on any clipping path information
// if it exists.
void clip(void);
void clipPath(const std::string pathname_,const bool inside_);
// Apply a color lookup table (CLUT) to the image.
void clut(const Image &clutImage_,const PixelInterpolateMethod method);
void clutChannel(const ChannelType channel_,const Image &clutImage_,
const PixelInterpolateMethod method);
// Colorize image with pen color, using specified percent alpha.
void colorize(const unsigned int alpha_,const Color &penColor_);
// Colorize image with pen color, using specified percent alpha
// for red, green, and blue quantums
void colorize(const unsigned int alphaRed_,const unsigned int alphaGreen_,
const unsigned int alphaBlue_,const Color &penColor_);
// Color at colormap position index_
void colorMap(const size_t index_,const Color &color_);
Color colorMap(const size_t index_) const;
// Apply a color matrix to the image channels. The user supplied
// matrix may be of order 1 to 5 (1x1 through 5x5).
void colorMatrix(const size_t order_,const double *color_matrix_);
// Compare current image with another image
// False is returned if the images are not identical.
bool compare(const Image &reference_) const;
// Compare current image with another image
// Returns the distortion based on the specified metric.
double compare(const Image &reference_,const MetricType metric_);
double compareChannel(const ChannelType channel_,
const Image &reference_,
const MetricType metric_ );
// Compare current image with another image
// Sets the distortion and returns the difference image.
Image compare(const Image &reference_,const MetricType metric_,
double *distortion);
Image compareChannel(const ChannelType channel_,const Image &reference_,
const MetricType metric_,double *distortion);
// Compose an image onto another at specified offset and using
// specified algorithm
void composite(const Image &compositeImage_,const Geometry &offset_,
const CompositeOperator compose_=InCompositeOp);
void composite(const Image &compositeImage_,const GravityType gravity_,
const CompositeOperator compose_=InCompositeOp);
void composite(const Image &compositeImage_,const ::ssize_t xOffset_,
const ::ssize_t yOffset_,const CompositeOperator compose_=InCompositeOp);
// Determines the connected-components of the image
void connectedComponents(const size_t connectivity_);
// Contrast image (enhance intensity differences in image)
void contrast(const bool sharpen_);
// A simple image enhancement technique that attempts to improve the
// contrast in an image by 'stretching' the range of intensity values
// it contains to span a desired range of values. It differs from the
// more sophisticated histogram equalization in that it can only apply a
// linear scaling function to the image pixel values. As a result the
// 'enhancement' is less harsh.
void contrastStretch(const double blackPoint_,const double whitePoint_);
void contrastStretchChannel(const ChannelType channel_,
const double blackPoint_,const double whitePoint_);
// Convolve image. Applies a user-specified convolution to the image.
// order_ represents the number of columns and rows in the filter kernel.
// kernel_ is an array of doubles representing the convolution kernel.
void convolve(const size_t order_,const double *kernel_);
// Copies pixels from the source image as defined by the geometry the
// destination image at the specified offset.
void copyPixels(const Image &source_,const Geometry &geometry_,
const Offset &offset_);
// Crop image (subregion of original image)
void crop(const Geometry &geometry_);
// Cycle image colormap
void cycleColormap(const ::ssize_t amount_);
// Converts cipher pixels to plain pixels.
void decipher(const std::string &passphrase_);
// Tagged image format define. Similar to the defineValue() method
// except that passing the flag_ value 'true' creates a value-less
// define with that format and key. Passing the flag_ value 'false'
// removes any existing matching definition. The method returns 'true'
// if a matching key exists, and 'false' if no matching key exists.
void defineSet(const std::string &magick_,const std::string &key_,
bool flag_);
bool defineSet(const std::string &magick_,const std::string &key_) const;
// Tagged image format define (set/access coder-specific option) The
// magick_ option specifies the coder the define applies to. The key_
// option provides the key specific to that coder. The value_ option
// provides the value to set (if any). See the defineSet() method if the
// key must be removed entirely.
void defineValue(const std::string &magick_,const std::string &key_,
const std::string &value_);
std::string defineValue(const std::string &magick_,
const std::string &key_) const;
// Removes skew from the image. Skew is an artifact that occurs in scanned
// images because of the camera being misaligned, imperfections in the
// scanning or surface, or simply because the paper was not placed
// completely flat when scanned. The value of threshold_ ranges from 0
// to QuantumRange.
void deskew(const double threshold_);
// Despeckle image (reduce speckle noise)
void despeckle(void);
// Display image on screen
void display(void);
// Distort image. distorts an image using various distortion methods, by
// mapping color lookups of the source image to a new destination image
// usually of the same size as the source image, unless 'bestfit' is set to
// true.
void distort(const DistortMethod method_,
const size_t numberArguments_,const double *arguments_,
const bool bestfit_=false);
// Draw on image using a single drawable
void draw(const Drawable &drawable_);
// Draw on image using a drawable list
void draw(const std::vector<Magick::Drawable> &drawable_);
// Edge image (highlight edges in image)
void edge(const double radius_=0.0);
// Emboss image (highlight edges with 3D effect)
// The radius_ parameter specifies the radius of the Gaussian, in
// pixels, not counting the center pixel. The sigma_ parameter
// specifies the standard deviation of the Laplacian, in pixels.
void emboss(const double radius_=0.0,const double sigma_=1.0);
// Converts pixels to cipher-pixels.
void encipher(const std::string &passphrase_);
// Enhance image (minimize noise)
void enhance(void);
// Equalize image (histogram equalization)
void equalize(void);
// Erase image to current "background color"
void erase(void);
// Apply a value with an arithmetic, relational, or logical operator.
void evaluate(const ChannelType channel_,
const MagickEvaluateOperator operator_,double rvalue_);
// Apply a value with an arithmetic, relational, or logical operator.
void evaluate(const ChannelType channel_,const MagickFunction function_,
const size_t number_parameters_,const double *parameters_);
// Apply a value with an arithmetic, relational, or logical operator.
void evaluate(const ChannelType channel_,const ::ssize_t x_,
const ::ssize_t y_,const size_t columns_,const size_t rows_,
const MagickEvaluateOperator operator_,const double rvalue_);
// Extend the image as defined by the geometry.
void extent(const Geometry &geometry_);
void extent(const Geometry &geometry_,const Color &backgroundColor);
void extent(const Geometry &geometry_,const Color &backgroundColor,
const GravityType gravity_);
void extent(const Geometry &geometry_,const GravityType gravity_);
// Flip image (reflect each scanline in the vertical direction)
void flip(void);
// Floodfill pixels matching color (within fuzz factor) of target
// pixel(x,y) with replacement alpha value.
void floodFillAlpha(const ::ssize_t x_,const ::ssize_t y_,
const unsigned int alpha_,const bool invert_=false);
// Floodfill designated area with replacement alpha value
void floodFillAlpha(const ssize_t x_,const ssize_t y_,
const unsigned int alpha_,const Color &target_,const bool invert_=false);
// Flood-fill color across pixels that match the color of the
// target pixel and are neighbors of the target pixel.
// Uses current fuzz setting when determining color match.
void floodFillColor(const Geometry &point_,const Color &fillColor_,
const bool invert_=false);
void floodFillColor(const ::ssize_t x_,const ::ssize_t y_,
const Color &fillColor_,const bool invert_=false);
// Flood-fill color across pixels starting at target-pixel and
// stopping at pixels matching specified border color.
// Uses current fuzz setting when determining color match.
void floodFillColor(const Geometry &point_,const Color &fillColor_,
const Color &borderColor_,const bool invert_=false);
void floodFillColor(const ::ssize_t x_,const ::ssize_t y_,
const Color &fillColor_,const Color &borderColor_,
const bool invert_=false);
// Flood-fill texture across pixels that match the color of the
// target pixel and are neighbors of the target pixel.
// Uses current fuzz setting when determining color match.
void floodFillTexture(const Geometry &point_,const Image &texture_,
const bool invert_=false);
void floodFillTexture(const ::ssize_t x_,const ::ssize_t y_,
const Image &texture_,const bool invert_=false);
// Flood-fill texture across pixels starting at target-pixel and
// stopping at pixels matching specified border color.
// Uses current fuzz setting when determining color match.
void floodFillTexture(const Geometry &point_,const Image &texture_,
const Color &borderColor_,const bool invert_=false);
void floodFillTexture(const ::ssize_t x_,const ::ssize_t y_,
const Image &texture_,const Color &borderColor_,
const bool invert_=false);
// Flop image (reflect each scanline in the horizontal direction)
void flop(void);
// Obtain font metrics for text string given current font,
// pointsize, and density settings.
void fontTypeMetrics(const std::string &text_,TypeMetric *metrics);
// Obtain multi line font metrics for text string given current font,
// pointsize, and density settings.
void fontTypeMetricsMultiline(const std::string &text_,
TypeMetric *metrics);
// Frame image
void frame(const Geometry &geometry_=frameGeometryDefault);
void frame(const size_t width_,const size_t height_,
const ::ssize_t innerBevel_=6,const ::ssize_t outerBevel_=6);
// Applies a mathematical expression to the image.
void fx(const std::string expression_);
void fx(const std::string expression_,const Magick::ChannelType channel_);
// Gamma correct image
void gamma(const double gamma_);
void gamma(const double gammaRed_,const double gammaGreen_,
const double gammaBlue_);
// Gaussian blur image
// The number of neighbor pixels to be included in the convolution
// mask is specified by 'radius_'. The standard deviation of the
// gaussian bell curve is specified by 'sigma_'.
void gaussianBlur(const double radius_,const double sigma_);
void gaussianBlurChannel(const ChannelType channel_,const double radius_,
const double sigma_);
// Transfers read-only pixels from the image to the pixel cache as
// defined by the specified region.
const Quantum *getConstPixels(const ::ssize_t x_, const ::ssize_t y_,
const size_t columns_,const size_t rows_) const;
// Obtain immutable image pixel metacontent. The selected region is defined
// by the prior getPixels(), getConstPixels(), or setPixels() call.
const void *getConstMetacontent(void) const;
// Obtain mutable image pixel metacontent. The selected region is defined
// by a prior getPixels(), getConstPixels(), or setPixels() call.
void *getMetacontent(void);
// Transfers pixels from the image to the pixel cache as defined