28
27
<hr width="100%">Image is the primary object in Magick++ and represents
29
a single image frame (see <a href="ImageDesign.html">design</a> ). The
30
<a href="STL.html">STL interface</a> <b>must</b> be used to operate on
31
image sequences or images (e.g. of format GIF, TIFF, MIFF, Postscript,
32
& MNG) which are comprized of multiple image frames. Individual
28
a single image frame (see <a href="ImageDesign.html">design</a> ). The <a
29
href="STL.html">STL interface</a> <b>must</b> be used to operate on
30
image sequences or images (e.g. of format GIF, TIFF, MIFF, Postscript,
31
& MNG) which are comprized of multiple image frames. Individual
33
32
frames of a multi-frame image may be requested by adding array-style
34
33
notation to the end of the file name (e.g. "animation.gif[3]" retrieves
35
34
the fourth frame of a GIF animation. Various image manipulation
36
35
operations may be applied to the image. Attributes may be set on the
37
36
image to influence the operation of the manipulation operations. The <a
38
href="Pixels.html"> Pixels</a> class provides low-level access to
37
href="Pixels.html"> Pixels</a> class provides low-level access to image
40
38
pixels. As a convenience, including <tt><font color="#663366"><Magick++.h></font></tt>
41
is sufficient in order to use the complete Magick++ API. The Magick++
39
is sufficient in order to use the complete Magick++ API. The Magick++
42
40
API is enclosed within the <i>Magick</i> namespace so you must either
43
add the prefix "<tt> Magick::</tt> " to each class/enumeration name or
45
the statement "<tt> using namespace Magick;</tt>" after including the <tt>Magick++.h</tt>
41
add the prefix "<tt> Magick::</tt> " to each class/enumeration name or add
42
the statement "<tt> using namespace Magick;</tt>" after including the <tt>Magick++.h</tt>
47
44
<p>The preferred way to allocate Image objects is via automatic
48
45
allocation (on the stack). There is no concern that allocating Image
49
objects on the stack will excessively enlarge the stack since Magick++
50
allocates all large data objects (such as the actual image data) from
51
the heap. Use of automatic allocation is preferred over explicit
52
allocation (via <i>new</i>) since it is much less error prone and
53
allows use of C++ scoping rules to avoid memory leaks. Use of automatic
54
allocation allows Magick++ objects to be assigned and copied just like
55
the C++ intrinsic data types (e.g. '<i>int</i> '), leading to clear and
46
objects on the stack will excessively enlarge the stack since Magick++
47
allocates all large data objects (such as the actual image data) from
48
the heap. Use of automatic allocation is preferred over explicit
49
allocation (via <i>new</i>) since it is much less error prone and
50
allows use of C++ scoping rules to avoid memory leaks. Use of automatic
51
allocation allows Magick++ objects to be assigned and copied just like
52
the C++ intrinsic data types (e.g. '<i>int</i> '), leading to clear and
56
53
easy to read code. Use of automatic allocation leads to naturally
57
54
exception-safe code since if an exception is thrown, the object is
58
automagically deallocated once the stack unwinds past the scope of the
55
automatically deallocated once the stack unwinds past the scope of the
59
56
allocation (not the case for objects allocated via <i>new</i> ). </p>
60
57
<p>Image is very easy to use. For example, here is a the source to a
61
program which reads an image, crops it, and writes it to a new file
58
program which reads an image, crops it, and writes it to a new file (the
63
59
exception handling is optional but strongly recommended): </p>
64
<blockquote><tt><font color="#000066">#include <Magick++.h></font></tt>
60
<blockquote><tt><font color="#000066">#include <Magick++.h></font></tt> <br>
66
61
<tt><font color="#000066">#include <iostream></font></tt> <br>
67
62
<tt><font color="#000066">using namespace std;</font></tt> <br>
68
63
<tt><font color="#000066">using namespace Magick;</font></tt> <br>
79
74
<p><tt><font color="#000066"> try {</font></tt> <br>
80
75
<tt><font color="#000066"> // Read a file into
81
76
image object</font></tt> <br>
82
<tt><font color="#000066"> image.read( "girl.gif" );</font></tt>
77
<tt><font color="#000066"> image.read( "girl.gif" );</font></tt> </p>
84
78
<p><tt><font color="#000066"> // Crop the image to
85
79
specified size</font></tt> (width, height, xOffset, yOffset)<br>
86
80
<tt><font color="#000066"> image.crop(
87
81
Geometry(100,100, 100, 100) );</font></tt> </p>
88
82
<p><tt><font color="#000066"> // Write the image to
89
83
a file</font></tt> <br>
90
<tt><font color="#000066"> image.write( "x.gif" );</font></tt>
84
<tt><font color="#000066"> image.write( "x.gif" );</font></tt> <br>
92
85
<tt><font color="#000066"> }</font></tt> <br>
93
<tt><font color="#000066"> catch( Exception &error_ )</font></tt>
86
<tt><font color="#000066"> catch( Exception &error_ )</font></tt> <br>
95
87
<tt><font color="#000066"> {</font></tt> <br>
96
88
<tt><font color="#000066"> cout
97
<< "Caught exception: " << error_.what() << endl;</font></tt>
99
<tt><font color="#000066"> return 1;</font></tt>
89
<< "Caught exception: " << error_.what() << endl;</font></tt> <br>
90
<tt><font color="#000066"> return 1;</font></tt> <br>
101
91
<tt><font color="#000066"> }</font></tt> <br>
102
92
<tt><font color="#000066"> return 0;</font></tt> <br>
103
93
<tt><font color="#000066">}</font></tt></p>
105
95
The following is the source to a program which illustrates the use of
106
96
Magick++'s efficient reference-counted assignment and copy-constructor
107
operations which minimize use of memory and eliminate unncessary copy
108
operations (allowing Image objects to be efficiently assigned, and
109
copied into containers). The program accomplishes the
97
operations which minimize use of memory and eliminate unncessary copy
98
operations (allowing Image objects to be efficiently assigned, and
99
copied into containers). The program accomplishes the
112
102
<li> Read master image.</li>
288
263
<td><font size="-1">const <a href="Blob.html">Blob</a>
289
264
&blob_, const <a href="Geometry.html">Geometry</a> &size,
290
size_t depth</font></td>
293
<td><font size="-1">const <a href="Blob.html">Blob</a>
294
&blob_, const <a href="Geometry.html">Geometry</a> &size,
295
size_t depth_, const string &magick_</font></td>
298
<td><font size="-1">const <a href="Blob.html">Blob</a>
299
&blob_, const <a href="Geometry.html">Geometry</a> &size,
265
unsigned int depth</font></td>
268
<td><font size="-1">const <a href="Blob.html">Blob</a>
269
&blob_, const <a href="Geometry.html">Geometry</a> &size,
270
unsigned int depth_, const string &magick_</font></td>
273
<td><font size="-1">const <a href="Blob.html">Blob</a>
274
&blob_, const <a href="Geometry.html">Geometry</a> &size, const
301
275
string &magick_</font></td>
304
<td><font size="-1">const size_t width_, </font> <br>
305
<font size="-1">const size_t height_,</font> <br>
278
<td><font size="-1">const unsigned int width_, </font> <br>
279
<font size="-1">const unsigned int height_,</font> <br>
306
280
<font size="-1">std::string map_,</font> <br>
307
281
<font size="-1">const <a href="Enumerations.html#StorageType">
308
282
StorageType</a> type_,</font> <br>
309
<font size="-1">const void *pixels_</font></td>
283
<font size="-1">const unsigned char* pixels_</font></td>
310
284
<td><font size="-1">Construct a new Image based on an array of
311
image pixels. The pixel data must be in scanline order top-to-bottom.
312
The data can be character, short int, integer, float, or double. Float
285
image pixels. The pixel data must be in scanline order top-to-bottom.
286
The data can be character, short int, integer, float, or double. Float
313
287
and double require the pixels to be normalized [0..1]. The other types
314
are [0..MaxRGB]. For example, to create a 640x480 image from
315
unsigned red-green-blue character data, use</font>
316
<p><font size="-1"> Image image( 640, 480, "RGB",
288
are [0..QuantumRange]. For example, to create a 640x480 image from
289
unsigned red-green-blue character data, use</font>
290
<p><font size="-1"> Image image( 640, 480, "RGB",
317
291
0, pixels );</font> </p>
318
292
<p><font size="-1">The parameters are as follows:</font> <br>
331
305
<td><font size="-1">map_</font></td>
332
306
<td><font size="-1">This character string can be any
333
combination or order of R = red, G = green, B = blue, A = alpha, C =
334
cyan, Y = yellow M = magenta, and K = black. The ordering reflects the
335
order of the pixels in the supplied pixel array.</font></td>
307
combination or order of R = red, G = green, B = blue, A = alpha, C =
308
cyan, Y = yellow M = magenta, and K = black. The ordering reflects the
309
order of the pixels in the supplied pixel array.</font></td>
338
312
<td><font size="-1">type_</font></td>
339
313
<td><font size="-1"><a href="Enumerations.html#StorageType">Pixel
340
storage type</a> (CharPixel, ShortPixel, IntegerPixel, FloatPixel, or
314
storage type</a> (CharPixel, ShortPixel, IntegerPixel, FloatPixel, or
341
315
DoublePixel)</font></td>
344
318
<td><font size="-1">pixels_</font></td>
345
319
<td><font size="-1">This array of values contain the pixel
346
components as defined by the map_ and type_ parameters. The length of
347
the arrays must equal the area specified by the width_ and height_
320
components as defined by the map_ and type_ parameters. The length of
321
the arrays must equal the area specified by the width_ and height_
348
322
values and type_ parameters.</font></td>
466
423
image) and placement gravity.</font></td>
469
<td style="text-align: center;">
470
427
<center><a name="blur"></a> <font size="-1">blur</font></center>
472
429
<td><font size="-1">const double radius_ = 1, const double sigma_
473
430
= 0.5</font></td>
474
431
<td><font size="-1">Blur image. The <i>radius_ </i>parameter
475
specifies the radius of the Gaussian, in pixels, not counting the
477
pixel. The <i>sigma_</i> parameter specifies the standard
478
deviation of the Laplacian, in pixels.</font></td>
481
<td style="vertical-align: middle; text-align: center;"><small><a
482
name="blurChannel"></a>blurChannel<br>
484
<td style="vertical-align: middle;"><small>const ChannelType
485
channel_, const double radius_ = 0.0, const double sigma_ = 1.0<br>
487
<td style="vertical-align: middle;"><font size="-1">Blur an image
488
channel. The <span style="font-style: italic;">channel_</span>
489
parameter specifies the channel to blur. The <i>radius_ </i>parameter
490
specifies the radius of the Gaussian, in pixels, not counting the
492
pixel. The <i>sigma_</i> parameter specifies the standard
493
deviation of the Laplacian, in pixels.</font></td>
496
<td style="text-align: center;">
432
specifies the radius of the Gaussian, in pixels, not counting the center
433
pixel. The <i>sigma_</i> parameter specifies the standard
434
deviation of the Laplacian, in pixels.</font></td>
497
438
<center><a name="border"></a> <font size="-1">border</font></center>
499
440
<td><font size="-1">const <a href="Geometry.html">Geometry</a>
502
443
color of the border is specified by the <i>borderColor</i> attribute.</font></td>
505
<td style="text-align: center;">
506
<center><a name="cdl"></a> <font size="-1">cdl</font></center>
508
<td><font size="-1">const std::string &cdl_</font></td>
509
<td><font size="-1">color correct with a color decision list. See <a href="http://en.wikipedia.org/wiki/ASC_CDL">http://en.wikipedia.org/wiki/ASC_CDL</a> for details.</font></td>
512
<td style="text-align: center;">
513
447
<center><a name="channel"></a> <font size="-1">channel</font></center>
515
449
<td><font size="-1"><a href="Enumerations.html#ChannelType">ChannelType</a>
516
450
layer_</font></td>
517
451
<td><font size="-1">Extract channel from image. Use this option
518
to extract a particular channel from the image. <i>MatteChannel</i>
452
to extract a particular channel from the image. <i>MatteChannel</i>
519
453
for example, is useful for extracting the opacity values
520
454
from an image.</font></td>
523
<td style="text-align: center;">
524
458
<center><a name="charcoal"></a> <font size="-1">charcoal</font></center>
526
460
<td><font size="-1">const double radius_ = 1, const double sigma_
527
461
= 0.5</font></td>
528
462
<td><font size="-1">Charcoal effect image (looks like charcoal
529
463
sketch). The <i>radius_</i> parameter specifies the radius of the
530
Gaussian, in pixels, not counting the center pixel. The <i>sigma_</i>
531
parameter specifies the standard deviation of the Laplacian, in pixels.</font></td>
464
Gaussian, in pixels, not counting the center pixel. The <i>sigma_</i>
465
parameter specifies the standard deviation of the Laplacian, in pixels.</font></td>
534
<td style="text-align: center;">
535
469
<center><a name="chop"></a> <font size="-1">chop</font></center>
537
471
<td><font size="-1">const <a href="Geometry.html">Geometry</a>
540
474
subregion of image)</font></td>
543
<td style="text-align: center;" rowspan="2">
544
478
<center><a name="colorize"></a> <font size="-1">colorize</font></center>
546
<td><font size="-1">const size_t opacityRed_, const
547
size_t opacityGreen_, const size_t opacityBlue_, const
480
<td><font size="-1">const unsigned int opacityRed_, const
481
unsigned int opacityGreen_, const unsigned int opacityBlue_, const
548
482
Color &penColor_</font></td>
549
483
<td><font size="-1">Colorize image with pen color, using
550
specified percent opacity for red, green, and blue quantums.</font></td>
553
<td style="text-align: center;">
554
<center><a name="colorMatrix"></a> <font size="-1">colorMatrix</font></center>
556
<td><font size="-1">const size_t order_, const double *color_matrix_</font></td>
557
<td><font size="-1">apply color correction to the image.</font></td>
560
<td style="text-align: center;">
484
specified percent opacity for red, green, and blue quantums.</font></td>
487
<td><font size="-1">const unsigned int opacity_, const Color
488
&penColor_</font></td>
489
<td><font size="-1">Colorize image with pen color, using
490
specified percent opacity.</font></td>
561
494
<center><a name="comment"></a> <font size="-1">comment</font></center>
563
<td><font size="-1">const std::string &comment_</font></td>
496
<td><font size="-1">const string &comment_</font></td>
564
497
<td><font size="-1">Comment image (add comment string to
565
498
image). By default, each image is commented with its file name.
566
Use this method to assign a specific comment to the
567
image. Optionally you can include the image filename, type,
568
width, height, or other image attributes by embedding <a
499
Use this method to assign a specific comment to the
500
image. Optionally you can include the image filename, type,
501
width, height, or other image attributes by embedding <a
569
502
href="FormatCharacters.html">special format characters.</a> </font></td>
572
<td style="text-align: center;" valign="middle"><font size="-1"><a
505
<td valign="middle" align="center"><font size="-1"><a
573
506
name="compare"></a> compare<br>
575
508
<td valign="middle"><font size="-1">const Image &reference_<br>
577
<td valign="top"><font size="-1">Compare current image with
578
another image. Sets <a href="#meanErrorPerPixel">meanErrorPerPixel</a>
579
, <a href="#normalizedMaxError">normalizedMaxError</a> , and <a
510
<td valign="top"><font size="-1">Compare current image with
511
another image. Sets <a href="#meanErrorPerPixel">meanErrorPerPixel</a> , <a
512
href="#normalizedMaxError">normalizedMaxError</a> , and <a
580
513
href="#normalizedMeanError">normalizedMeanError</a> in the current
581
image. False is returned if the images are identical. An ErrorOption
582
exception is thrown if the reference image columns, rows, colorspace,
514
image. False is returned if the images are identical. An ErrorOption
515
exception is thrown if the reference image columns, rows, colorspace, or
584
516
matte differ from the current image.</font><br>
588
<td style="text-align: center;" rowspan="3">
589
521
<center><a name="composite"></a> <font size="-1">composite</font></center>
591
523
<td><font size="-1">const <a href="Image.html">Image</a>
592
&compositeImage_, ssize_t xOffset_, ssize_t yOffset_, <a
524
&compositeImage_, int xOffset_, int yOffset_, <a
593
525
href="Enumerations.html#CompositeOperator"> CompositeOperator</a>
594
526
compose_ = <i>InCompositeOp</i></font></td>
595
527
<td><font size="-1">Compose an image onto the current image at
596
offset specified by <i>xOffset_</i>, <i>yOffset_ </i>using the
597
composition algorithm specified by <i>compose_</i>. </font></td>
528
offset specified by <i>xOffset_</i>, <i>yOffset_ </i>using the
529
composition algorithm specified by <i>compose_</i>. </font></td>
600
532
<td><font size="-1">const <a href="Image.html">Image</a>
611
543
gravity_, <a href="Enumerations.html#CompositeOperator">CompositeOperator</a>
612
544
compose_ = <i>InCompositeOp</i></font></td>
613
545
<td><font size="-1">Compose an image onto the current image with
614
placement specified by <i>gravity_ </i>using the composition
546
placement specified by <i>gravity_ </i>using the composition algorithm
616
547
specified by <i>compose_</i>. </font></td>
619
<td style="text-align: center;">
620
551
<center><a name="contrast"></a> <font size="-1">contrast</font></center>
622
<td><font size="-1">size_t sharpen_</font></td>
553
<td><font size="-1">unsigned int sharpen_</font></td>
623
554
<td><font size="-1">Contrast image (enhance intensity differences
624
555
in image)</font></td>
627
<td style="text-align: center;">
628
559
<center><a name="convolve"></a> <font size="-1">convolve</font></center>
630
<td><font size="-1">size_t order_, const double *kernel_</font></td>
561
<td><font size="-1">unsigned int order_, const double *kernel_</font></td>
631
562
<td><font size="-1">Convolve image. Applies a user-specfied
632
563
convolution to the image. The <i>order_</i> parameter represents the
633
number of columns and rows in the filter kernel, and <i>kernel_</i>
634
is a two-dimensional array of doubles representing the convolution
564
number of columns and rows in the filter kernel, and <i>kernel_</i>
565
is a two-dimensional array of doubles representing the convolution
635
566
kernel to apply.</font></td>
638
<td style="text-align: center;">
639
570
<center><a name="crop"></a> <font size="-1">crop</font></center>
641
572
<td><font size="-1">const <a href="Geometry.html">Geometry</a>
643
574
<td><font size="-1">Crop image (subregion of original image)</font></td>
646
<td style="text-align: center;">
647
578
<center><a name="cycleColormap"></a> <font size="-1">cycleColormap</font></center>
649
580
<td><font size="-1">int amount_</font></td>
650
581
<td><font size="-1">Cycle image colormap</font></td>
653
<td style="text-align: center;">
654
585
<center><a name="despeckle"></a> <font size="-1">despeckle</font></center>
656
587
<td><font size="-1">void</font></td>
657
588
<td><font size="-1">Despeckle image (reduce speckle noise)</font></td>
660
<td style="text-align: center;">
661
592
<center><a name="display"></a> <font size="-1">display</font></center>
663
594
<td><font size="-1">void</font></td>
664
595
<td><font size="-1">Display image on screen.</font> <br>
665
596
<font size="-1"><b><font color="#ff0000">Caution: </font></b> if
666
an image format is is not compatible with the display visual (e.g.
667
JPEG on a colormapped display) then the original image will be
597
an image format is not compatible with the display visual (e.g.
598
JPEG on a colormapped display) then the original image will be
668
599
altered. Use a copy of the original if this is a problem.</font></td>
672
<center><a name="distort"></a> <font size="-1">distort</font></center>
674
<td><font size="-1">const DistortImageMethod method, const unsigned long number_arguments, const double *arguments, const bool bestfit = false </font></td>
675
<td><font size="-1">Distort image. Applies a user-specfied
676
distortion to the image.</font></td>
679
<td style="text-align: center;" rowspan="2">
680
603
<center><a name="draw"></a> <font size="-1">draw</font></center>
682
605
<td><font size="-1">const <a href="Drawable.html">Drawable</a>
688
611
> &drawable_</font></td>
689
612
<td><font size="-1">Draw shapes or text on image using a set of
690
613
Drawable objects contained in an STL list. Use of this method improves
691
drawing performance and allows batching draw objects together in a
614
drawing performance and allows batching draw objects together in a
692
615
list for repeated use.</font></td>
695
<td style="text-align: center;">
696
619
<center><a name="edge"></a> <font size="-1">edge</font></center>
698
<td><font size="-1">size_t radius_ = 0.0</font></td>
621
<td><font size="-1">unsigned int radius_ = 0.0</font></td>
699
622
<td><font size="-1">Edge image (hilight edges in image).
700
The radius is the radius of the pixel neighborhood.. Specify a radius
701
of zero for automatic radius selection.</font></td>
623
The radius is the radius of the pixel neighborhood.. Specify a radius
624
of zero for automatic radius selection.</font></td>
704
<td style="text-align: center;">
705
628
<center><a name="emboss"></a> <font size="-1">emboss</font></center>
707
630
<td><font size="-1">const double radius_ = 1, const double sigma_
708
631
= 0.5</font></td>
709
632
<td><font size="-1">Emboss image (hilight edges with 3D effect).
710
633
The <i> radius_</i> parameter specifies the radius of the Gaussian, in
711
pixels, not counting the center pixel. The <i>sigma_</i>
712
parameter specifies the standard deviation of the Laplacian, in pixels.</font></td>
634
pixels, not counting the center pixel. The <i>sigma_</i>
635
parameter specifies the standard deviation of the Laplacian, in pixels.</font></td>
715
<td style="text-align: center;">
716
639
<center><a name="enhance"></a> <font size="-1">enhance</font></center>
718
641
<td><font size="-1">void</font></td>
719
642
<td><font size="-1">Enhance image (minimize noise)</font></td>
722
<td style="text-align: center;">
723
646
<center><a name="equalize"></a> <font size="-1">equalize</font></center>
725
648
<td><font size="-1">void</font></td>
726
649
<td><font size="-1">Equalize image (histogram equalization)</font></td>
729
<td style="text-align: center;">
730
653
<center><a name="erase"></a> <font size="-1">erase</font></center>
732
655
<td><font size="-1">void</font></td>
762
665
vertical direction)</font></td>
765
<td style="text-align: center;" rowspan="4">
766
<center><a name="floodFillColor"></a> <font size="-1">floodFill-</font>
669
<center><a name="floodFillColor"></a> <font size="-1">floodFill-</font> <br>
768
670
<font size="-1">Color</font></center>
770
<td><font size="-1">size_t x_, size_t y_, const <a
672
<td><font size="-1">unsigned int x_, unsigned int y_, const <a
771
673
href="Color.html"> Color</a> &fillColor_</font></td>
772
674
<td rowspan="2"><font size="-1">Flood-fill color across pixels
773
that match the color of the target pixel and are neighbors of the
774
target pixel. Uses current fuzz setting when determining color match.</font></td>
675
that match the color of the target pixel and are neighbors of the
676
target pixel. Uses current fuzz setting when determining color match.</font></td>
777
679
<td><font size="-1">const <a href="Geometry.html">Geometry</a>
778
680
&point_, const <a href="Color.html">Color</a> &fillColor_</font></td>
781
<td><font size="-1">size_t x_, size_t y_, const <a
782
href="Color.html"> Color</a> &fillColor_, const <a
783
href="Color.html">Color</a>
683
<td><font size="-1">unsigned int x_, unsigned int y_, const <a
684
href="Color.html"> Color</a> &fillColor_, const <a href="Color.html">Color</a>
784
685
&borderColor_</font></td>
785
686
<td rowspan="2"><font size="-1">Flood-fill color across pixels
786
687
starting at target-pixel and stopping at pixels matching specified
787
border color. Uses current fuzz setting when determining color match.</font></td>
688
border color. Uses current fuzz setting when determining color match.</font></td>
790
691
<td><font size="-1">const <a href="Geometry.html">Geometry</a>
791
&point_, const <a href="Color.html">Color</a> &fillColor_,
792
const <a href="Color.html">Color</a> &borderColor_</font></td>
692
&point_, const <a href="Color.html">Color</a> &fillColor_, const <a
693
href="Color.html">Color</a> &borderColor_</font></td>
795
<td style="text-align: center;"><a name="floodFillOpacity"></a> <font
796
size="-1">floodFillOpacity</font></td>
696
<td><a name="floodFillOpacity"></a> <font size="-1">floodFillOpacity</font></td>
797
697
<td><font size="-1">const long x_, const long y_, const unsigned
798
int opacity_, const PaintMethod method_</font></td>
698
int opacity_, const PaintMethod method_</font></td>
799
699
<td><font size="-1">Floodfill pixels matching color (within fuzz
800
factor) of target pixel(x,y) with replacement opacity value using
700
factor) of target pixel(x,y) with replacement opacity value using method.</font></td>
804
<td style="text-align: center;" rowspan="4">
805
<center><a name="floodFillTexture"></a> <font size="-1">floodFill-</font>
704
<center><a name="floodFillTexture"></a> <font size="-1">floodFill-</font> <br>
807
705
<font size="-1">Texture</font></center>
809
<td><font size="-1">size_t x_, size_t y_, const
707
<td><font size="-1">unsigned int x_, unsigned int y_, const
810
708
Image &texture_</font></td>
811
709
<td rowspan="2"><font size="-1">Flood-fill texture across pixels
812
that match the color of the target pixel and are neighbors of the
813
target pixel. Uses current fuzz setting when determining color match.</font></td>
710
that match the color of the target pixel and are neighbors of the
711
target pixel. Uses current fuzz setting when determining color match.</font></td>
816
714
<td><font size="-1">const <a href="Geometry.html">Geometry</a>
817
715
&point_, const Image &texture_</font></td>
820
<td><font size="-1">size_t x_, size_t y_, const Image
718
<td><font size="-1">unsigned int x_, unsigned int y_, const Image
821
719
&texture_, const <a href="Color.html">Color</a> &borderColor_</font></td>
822
720
<td rowspan="2"><font size="-1">Flood-fill texture across pixels
823
721
starting at target-pixel and stopping at pixels matching specified
824
border color. Uses current fuzz setting when determining color match.</font></td>
722
border color. Uses current fuzz setting when determining color match.</font></td>
827
725
<td><font size="-1">const <a href="Geometry.html">Geometry</a>
828
&point_, const Image &texture_, const <a href="Color.html">
726
&point_, const Image &texture_, const <a href="Color.html"> Color</a>
830
727
&borderColor_</font></td>
833
<td style="text-align: center;">
834
731
<center><a name="flop"></a> <font size="-1">flop</font></center>
836
733
<td><font size="-1">void </font></td>
879
761
of image.</font></td>
882
<td style="text-align: center;">
883
765
<center><a name="gaussianBlur"></a> <font size="-1">gaussianBlur</font></center>
885
767
<td><font size="-1">const double width_, const double sigma_</font></td>
886
768
<td><font size="-1">Gaussian blur image. The number of neighbor
887
769
pixels to be included in the convolution mask is specified by
888
'width_'. For example, a width of one gives a (standard) 3x3
889
convolution mask. The standard deviation of the gaussian bell curve is
890
specified by 'sigma_'.</font></td>
893
<td style="vertical-align: middle; text-align: center;"><small><a
894
name="gaussianBlurChannel"></a>gaussianBlurChannel<br>
896
<td style="vertical-align: middle;"><small>const ChannelType
897
channel_, const double radius_ = 0.0, const double sigma_ = 1.0<br>
899
<td style="vertical-align: middle;"><font size="-1">Gaussian blur
900
an image channel. </font><font size="-1">The <span
901
style="font-style: italic;">channel_</span> parameter specifies the
902
channel to blur. </font><font size="-1">The number of neighbor
903
pixels to be included in the convolution mask is specified by
904
'width_'. For example, a width of one gives a (standard) 3x3
905
convolution mask. The standard deviation of the gaussian bell curve is
906
specified by 'sigma_'.</font></td>
909
<td style="text-align: center;" valign="middle"><font size="-1"><a
910
name="haldClut"></a> haldClut<br>
912
<td valign="middle"><font size="-1">const Image &reference_<br>
914
<td valign="top"><font size="-1">apply a Hald color lookup table to the image.</font><br>
918
<td style="text-align: center;">
770
'width_'. For example, a width of one gives a (standard) 3x3
771
convolution mask. The standard deviation of the gaussian bell curve is
772
specified by 'sigma_'.</font></td>
919
776
<center><a name="implode"></a> <font size="-1">implode</font></center>
921
778
<td><font size="-1">const double factor_</font></td>
922
779
<td><font size="-1">Implode image (special effect)</font></td>
925
<td style="text-align: center;">
926
<center><a name="inverseFourierTransform"></a> <font size="-1">inverseFourierTransform</font></center>
928
<td><font size="-1">const Image &phaseImage_, const bool magnitude_</font></td>
929
<td><font size="-1">implements the inverse discrete Fourier transform (DFT) of the image either as a magnitude / phase or real / imaginary image pair.</font></td>
932
<td style="text-align: center;">
933
783
<center><a name="label"></a> <font size="-1">label</font></center>
935
785
<td><font size="-1">const string &label_</font></td>
936
786
<td><font size="-1">Assign a label to an image. Use this option
937
787
to assign a specific label to the image. Optionally
938
you can include the image filename, type, width, height, or scene
939
number in the label by embedding <a href="FormatCharacters.html">
940
special format characters.</a> If the first character of string is @,
942
image label is read from a file titled by the remaining characters in
788
you can include the image filename, type, width, height, or scene
789
number in the label by embedding <a href="FormatCharacters.html">
790
special format characters.</a> If the first character of string is @, the
791
image label is read from a file titled by the remaining characters in
943
792
the string. When converting to Postscript, use this option to
944
793
specify a header string to print above the image.</font></td>
980
829
specifies a gamma correction to apply to the image. White point
981
830
specifies the lightest color in the image. Colors brighter than the
982
831
white point are set to the maximum quantum value. The black and white
983
point have the valid range 0 to MaxRGB while mid (gamma) has a useful
832
point have the valid range 0 to QuantumRange while mid (gamma) has a useful
984
833
range of 0 to ten.<br>
988
<td style="text-align: center;">
989
838
<center><a name="magnify"></a> <font size="-1">magnify</font></center>
991
840
<td><font size="-1">void</font></td>
992
841
<td><font size="-1">Magnify image by integral size</font></td>
995
<td style="text-align: center;">
996
845
<center><a name="map"></a> <font size="-1">map</font></center>
998
847
<td><font size="-1">const Image &mapImage_ , bool dither_ =
999
848
false</font></td>
1000
849
<td><font size="-1">Remap image colors with closest color from
1001
reference image. Set dither_ to <i>true</i> in to apply
1003
error diffusion to the image. By default, color reduction chooses an
1004
optimal set of colors that best represent the original
850
reference image. Set dither_ to <i>true</i> in to apply Floyd/Steinberg
851
error diffusion to the image. By default, color reduction chooses an
852
optimal set of colors that best represent the original
1005
853
image. Alternatively, you can choose a
1006
particular set of colors from an image file
854
particular set of colors from an image file
1007
855
with this option.</font></td>
1010
<td style="text-align: center;">
1011
859
<center><a name="matteFloodfill"></a> <font size="-1">matteFloodfill</font></center>
1013
861
<td><font size="-1">const <a href="Color.html">Color</a>
1014
&target_, const size_t opacity_, const ssize_t x_, const
862
&target_, const unsigned int opacity_, const int x_, const int
1016
863
y_, <a href="Enumerations.html#PaintMethod">PaintMethod</a> method_</font></td>
1017
864
<td><font size="-1">Floodfill designated area with a replacement
1018
865
opacity value.</font></td>
1021
<td style="text-align: center;"><a name="medianFilter"></a> <font
1022
size="-1">medianFilter</font></td>
868
<td><a name="medianFilter"></a> <font size="-1">medianFilter</font></td>
1023
869
<td><font size="-1">const double radius_ = 0.0</font></td>
1024
870
<td><font size="-1">Filter image by replacing each pixel
1025
component with the median color in a circular neighborhood</font></td>
871
component with the median color in a circular neighborhood</font></td>
1028
<td style="text-align: center;">
1029
875
<center><a name="minify"></a> <font size="-1">minify</font></center>
1031
877
<td><font size="-1">void</font></td>
1032
878
<td><font size="-1">Reduce image by integral size</font></td>
1035
<td style="text-align: center;"><a name="modifyImage"></a> <font
1036
size="-1">modifyImage</font></td>
881
<td><a name="modifyImage"></a> <font size="-1">modifyImage</font></td>
1037
882
<td><font size="-1">void</font></td>
1038
883
<td><font size="-1">Prepare to update image. Ensures that there
1039
is only one reference to the underlying image so that the underlying
1040
image may be safely modified without effecting previous generations of
1041
the image. Copies the underlying image to a new image if necessary.</font></td>
884
is only one reference to the underlying image so that the underlying
885
image may be safely modified without effecting previous generations of
886
the image. Copies the underlying image to a new image if necessary.</font></td>
1044
<td style="text-align: center;">
1045
890
<center><a name="modulate"></a> <font size="-1">modulate</font></center>
1047
892
<td><font size="-1">double brightness_, double saturation_,
1048
893
double hue_</font></td>
1049
894
<td><font size="-1">Modulate percent hue, saturation, and
1050
brightness of an image. Modulation of saturation and brightness is as a
895
brightness of an image. Modulation of saturation and brightness is as a
1051
896
ratio of the current value (1.0 for no change). Modulation of hue is an
1052
897
absolute rotation of -180 degrees to +180 degrees from the current
1053
898
position corresponding to an argument range of 0 to 2.0 (1.0 for no
1054
899
change).</font></td>
1057
<td style="vertical-align: middle; text-align: center;"><small><a
1058
name="motionBlur"></a>motionBlur<br>
1060
<td style="vertical-align: middle;"><small>const double radius_,
1061
const double sigma_, const double angle_<br>
1063
<td style="vertical-align: middle;"><small>Motion blur image with
1064
specified blur factor. The radius_ parameter specifies the radius of
1065
the Gaussian, in pixels, not counting the center pixel. The
1066
sigma_ parameter specifies the standard deviation of the Laplacian, in
1067
pixels. The angle_ parameter specifies the angle the object appears to
1068
be comming from (zero degrees is from the right).<br>
1072
<td style="text-align: center;">
1073
903
<center><a name="negate"></a> <font size="-1">negate</font></center>
1075
905
<td><font size="-1">bool grayscale_ = false</font></td>
1076
906
<td><font size="-1">Negate colors in image. Replace every
1077
pixel with its complementary color (white becomes black, yellow becomes
1078
blue, etc.). Set grayscale to only negate grayscale values in
907
pixel with its complementary color (white becomes black, yellow becomes
908
blue, etc.). Set grayscale to only negate grayscale values in
1079
909
image.</font></td>
1082
<td style="text-align: center;">
1083
913
<center><a name="normalize"></a> <font size="-1">normalize</font></center>
1085
915
<td><font size="-1">void</font></td>
1086
916
<td><font size="-1">Normalize image (increase contrast by
1087
normalizing the pixel values to span the full range of color values).</font></td>
917
normalizing the pixel values to span the full range of color values).</font></td>
1090
<td style="text-align: center;">
1091
921
<center><a name="oilPaint"></a> <font size="-1">oilPaint</font></center>
1093
<td><font size="-1">size_t radius_ = 3</font></td>
923
<td><font size="-1">unsigned int radius_ = 3</font></td>
1094
924
<td><font size="-1">Oilpaint image (image looks like oil painting)</font></td>
1097
<td style="text-align: center;">
1098
928
<center><a name="opacity"></a> <font size="-1">opacity</font></center>
1100
<td><font size="-1">size_t opacity_</font></td>
930
<td><font size="-1">unsigned int opacity_</font></td>
1101
931
<td><font size="-1">Set or attenuate the opacity channel in the
1102
image. If the image pixels are opaque then they are set to the
932
image. If the image pixels are opaque then they are set to the specified
1104
933
opacity value, otherwise they are blended with the supplied opacity
1105
value. The value of opacity_ ranges from 0 (completely opaque) to
934
value. The value of opacity_ ranges from 0 (completely opaque) to <i>QuantumRange</i>
1107
935
. The defines <i>OpaqueOpacity</i> and <i>TransparentOpacity</i> are
1108
936
available to specify completely opaque or completely transparent,
1109
937
respectively.</font></td>
1112
<td style="text-align: center;">
1113
941
<center><a name="opaque"></a> <font size="-1">opaque</font></center>
1115
943
<td><font size="-1">const <a href="Color.html">Color</a>
1116
944
&opaqueColor_, const <a href="Color.html">Color</a> &penColor_</font></td>
1117
945
<td><font size="-1">Change color of pixels matching opaqueColor_
1118
to specified penColor_.</font></td>
946
to specified penColor_.</font></td>
1121
<td style="text-align: center;" rowspan="2" nosave="">
949
<td rowspan="2" nosave="">
1122
950
<center><a name="ping"></a> <font size="-1">ping</font></center>
1124
952
<td><font size="-1">const std::string &imageSpec_</font></td>
1125
953
<td rowspan="2" nosave=""><font size="-1">Ping is similar to read
1126
954
except only enough of the image is read to determine the image columns,
1127
rows, and filesize. The <a href="#columns">columns</a> </font>,
1128
<font size="-1"><a href="#rows">rows</a> , and <a
1129
href="#fileSize">fileSize</a>
955
rows, and filesize. The <a href="#columns">columns</a> </font>, <font
956
size="-1"><a href="#rows">rows</a> , and <a href="#fileSize">fileSize</a>
1130
957
attributes are valid after invoking ping. The image data is not
1131
958
valid after calling ping.</font></td>
1177
1003
<td><font size="-1">const <a href="Geometry.html">Geometry</a>
1178
1004
&size_, const std::string &imageSpec_</font></td>
1179
1005
<td><font size="-1">Read image of specified size into current
1180
object. This form is useful for images that do not specifiy their size
1181
or to specify a size hint for decoding an image. For example, when
1182
reading a Photo CD, JBIG, or JPEG image, a size request causes the
1183
library to return an image which is the next resolution greater or
1184
equal to the specified size. This may result in memory and time savings.</font></td>
1006
object. This form is useful for images that do not specifiy their size
1007
or to specify a size hint for decoding an image. For example, when
1008
reading a Photo CD, JBIG, or JPEG image, a size request causes the
1009
library to return an image which is the next resolution greater or
1010
equal to the specified size. This may result in memory and time savings.</font></td>
1187
1013
<td><font size="-1">const <a href="Blob.html">Blob</a> &blob_</font></td>
1188
1014
<td rowspan="5"><font size="-1">Read encoded image of specified
1189
size from an in-memory <a href="Blob.html">BLOB</a> into current
1190
object. Depending on the method arguments, the Blob size, depth, and
1191
format may also be specified. Some image formats require that size be
1015
size from an in-memory <a href="Blob.html">BLOB</a> into current
1016
object. Depending on the method arguments, the Blob size, depth, and
1017
format may also be specified. Some image formats require that size be
1192
1018
specified. The default ImageMagick uses for depth depends on its
1193
1019
Quantum size (8 or 16). If ImageMagick's Quantum size does not
1194
1020
match that of the image, the depth may need to be specified.
1195
ImageMagick can usually automagically detect the image's format.
1197
a format can't be automagically detected, the format must be specified.</font></td>
1021
ImageMagick can usually automatically detect the image's format. When
1022
a format can't be automatically detected, the format must be specified.</font></td>
1200
1025
<td><font size="-1">const <a href="Blob.html">Blob</a>
1214
1039
<td><font size="-1">const <a href="Blob.html">Blob</a>
1215
&blob_, const <a href="Geometry.html">Geometry</a> &size_,
1040
&blob_, const <a href="Geometry.html">Geometry</a> &size_, const
1217
1041
string &magick_</font></td>
1220
<td><font size="-1">const size_t width_, const size_t
1221
height_, std::string map_, const StorageType type_, const void *pixels_</font></td>
1044
<td><font size="-1">const unsigned int width_, const unsigned int
1045
height_, std::string map_, const StorageType type_, const unsigned char* pixels_</font></td>
1222
1046
<td><font size="-1">Read image based on an array of image pixels.
1223
The pixel data must be in scanline order top-to-bottom. The data can be
1047
The pixel data must be in scanline order top-to-bottom. The data can be
1224
1048
character, short int, integer, float, or double. Float and double
1225
require the pixels to be normalized [0..1]. The other types are
1226
[0..MaxRGB]. For example, to create a 640x480 image from
1049
require the pixels to be normalized [0..1]. The other types are
1050
[0..QuantumRange]. For example, to create a 640x480 image from
1227
1051
unsigned red-green-blue character data, use</font>
1228
<p><font size="-1"> image.read( 640, 480, "RGB", CharPixel,
1052
<p><font size="-1"> image.read( 640, 480, "RGB", 0,
1229
1053
pixels );</font> </p>
1230
1054
<p><font size="-1">The parameters are as follows:</font> <br>
1243
1067
<td><font size="-1">map_</font></td>
1244
1068
<td><font size="-1">This character string can be any
1245
combination or order of R = red, G = green, B = blue, A = alpha, C =
1246
cyan, Y = yellow M = magenta, and K = black. The ordering reflects the
1247
order of the pixels in the supplied pixel array.</font></td>
1069
combination or order of R = red, G = green, B = blue, A = alpha, C =
1070
cyan, Y = yellow M = magenta, and K = black. The ordering reflects the
1071
order of the pixels in the supplied pixel array.</font></td>
1250
1074
<td><font size="-1">type_</font></td>
1251
1075
<td><font size="-1">Pixel storage type (CharPixel,
1252
ShortPixel, IntegerPixel, FloatPixel, or DoublePixel)</font></td>
1076
ShortPixel, IntegerPixel, FloatPixel, or DoublePixel)</font></td>
1255
1079
<td><font size="-1">pixels_</font></td>
1256
1080
<td><font size="-1">This array of values contain the pixel
1257
components as defined by the map_ and type_ parameters. The length of
1258
the arrays must equal the area specified by the width_ and height_
1081
components as defined by the map_ and type_ parameters. The length of
1082
the arrays must equal the area specified by the width_ and height_
1259
1083
values and type_ parameters.</font></td>
1267
<td style="text-align: center;">
1268
1092
<center><a name="reduceNoise"></a> <font size="-1">reduceNoise</font></center>
1270
<td><font size="-1">const double order_</font></td>
1271
<td><font size="-1">reduce noise in image using a noise peak elimination filter.</font></td>
1274
<td style="vertical-align: middle; text-align: center;"><small><a
1275
name="randomThreshold"></a>randomThreshold<br>
1277
<td style="vertical-align: middle;"><small>const Geometry
1278
&thresholds_<br>
1280
<td style="vertical-align: middle;"><small>Random threshold the
1281
image. Changes the value of individual pixels based on the intensity of
1282
each pixel compared to a random threshold. The result is a
1283
low-contrast, two color image. The thresholds_ argument is a
1284
geometry containing LOWxHIGH thresholds. If the string contains
1285
2x2, 3x3, or 4x4, then an ordered dither of order 2, 3, or 4 will be
1286
performed instead. This is a very fast alternative to 'quantize' based
1291
<td style="vertical-align: middle; text-align: center;"><small><a
1292
name="randomThresholdChannel"></a>randomThresholdChannel<br>
1294
<td style="vertical-align: middle;"><small>const Geometry
1295
&thresholds_, const ChannelType channel_<br>
1297
<td style="vertical-align: middle;"><small>Random threshold an
1298
image channel. Similar to <a href="#randomThreshold">randomThreshold</a>()
1299
but restricted to the specified channel.<br>
1303
<td style="text-align: center;">
1094
<td><font size="-1">void</font></td>
1095
<td rowspan="2"><font size="-1">Reduce noise in image using a
1096
noise peak elimination filter.</font></td>
1099
<td><font size="-1">unsigned int order_</font></td>
1304
1103
<center><a name="roll"></a> <font size="-1">roll</font></center>
1306
<td><font size="-1">int columns_, ssize_t rows_</font></td>
1105
<td><font size="-1">int columns_, int rows_</font></td>
1307
1106
<td><font size="-1">Roll image (rolls image vertically and
1308
1107
horizontally) by specified number of columnms and rows)</font></td>
1311
<td style="text-align: center;">
1312
1111
<center><a name="rotate"></a> <font size="-1">rotate</font></center>
1314
1113
<td><font size="-1">double degrees_</font></td>
1332
1131
<td><font size="-1">Resize image by using simple ratio algorithm</font></td>
1335
<td style="text-align: center;">
1336
1135
<center><a name="segment"></a> <font size="-1">segment</font></center>
1338
1137
<td><font size="-1">double clusterThreshold_ = 1.0,</font> <br>
1339
1138
<font size="-1">double smoothingThreshold_ = 1.5</font></td>
1340
1139
<td><font size="-1">Segment (coalesce similar image components)
1341
by analyzing the histograms of the color components and identifying
1342
units that are homogeneous with the fuzzy c-means technique. Also uses <i>quantizeColorSpace</i>
1343
and <i>verbose</i> image attributes. Specify <i> clusterThreshold_</i>
1345
as the number of pixels each cluster must
1140
by analyzing the histograms of the color components and identifying
1141
units that are homogeneous with the fuzzy c-means technique. Also uses <i>quantizeColorSpace</i>
1142
and <i>verbose</i> image attributes. Specify <i> clusterThreshold_</i> ,
1143
as the number of pixels each cluster must exceed
1347
1144
the cluster threshold to be considered valid. <i>SmoothingThreshold_</i>
1348
eliminates noise in the second derivative of the histogram. As
1145
eliminates noise in the second derivative of the histogram. As the
1350
1146
value is increased, you can expect a smoother
1351
1147
second derivative. The default is 1.5.</font></td>
1354
<td style="text-align: center;">
1355
1151
<center><a name="shade"></a> <font size="-1">shade</font></center>
1357
<td><font size="-1">double azimuth_ = 30, double elevation_ = 30,</font>
1153
<td><font size="-1">double azimuth_ = 30, double elevation_ = 30,</font> <br>
1359
1154
<font size="-1">bool colorShading_ = false</font></td>
1360
1155
<td><font size="-1">Shade image using distant light source.
1361
1156
Specify <i> azimuth_</i> and <i>elevation_</i> as the
1362
position of the light source. By default, the shading
1363
results as a grayscale image.. Set c<i>olorShading_</i> to <i>true</i>
1365
shade the red, green, and blue components of the image.</font></td>
1157
position of the light source. By default, the shading
1158
results as a grayscale image.. Set c<i>olorShading_</i> to <i>true</i> to
1159
shade the red, green, and blue components of the image.</font></td>
1368
<td style="text-align: center;">
1369
1163
<center><a name="sharpen"></a> <font size="-1">sharpen</font></center>
1371
1165
<td><font size="-1">const double radius_ = 1, const double sigma_
1376
1170
standard deviation of the Laplacian, in pixels.</font></td>
1379
<td style="vertical-align: middle; text-align: center;"><small><a
1380
name="sharpenChannel"></a>sharpenChannel<br>
1382
<td style="vertical-align: middle;"><small>const ChannelType
1383
channel_, const double radius_ = 0.0, const double sigma_ = 1.0<br>
1385
<td style="vertical-align: middle;"><font size="-1">Sharpen pixel
1386
quantums in an image channel The <span
1387
style="font-style: italic;">channel_</span> parameter specifies the
1388
channel to sharpen.. The <i>radius_</i>
1389
parameter specifies the radius of the Gaussian, in pixels, not counting
1390
the center pixel. The <i>sigma_</i> parameter specifies the
1391
standard deviation of the Laplacian, in pixels.</font></td>
1394
<td style="text-align: center;">
1395
1174
<center><a name="shave"></a> <font size="-1">shave</font></center>
1397
1176
<td><font size="-1">const Geometry &geometry_</font></td>
1398
1177
<td><font size="-1">Shave pixels from image edges.</font></td>
1401
<td style="text-align: center;">
1402
1181
<center><a name="shear"></a> <font size="-1">shear</font></center>
1404
1183
<td><font size="-1">double xShearAngle_, double yShearAngle_</font></td>
1405
1184
<td><font size="-1">Shear image (create parallelogram by sliding
1406
1185
image by X or Y axis). Shearing slides one edge of an image along
1407
the X or Y axis, creating a
1408
parallelogram. An X direction shear slides an edge along the X
1409
axis, while a Y direction shear slides
1410
an edge along the Y axis. The amount of the shear is controlled
1411
by a shear angle. For X direction shears, x
1186
the X or Y axis, creating a
1187
parallelogram. An X direction shear slides an edge along the X
1188
axis, while a Y direction shear slides
1189
an edge along the Y axis. The amount of the shear is controlled
1190
by a shear angle. For X direction shears, x
1412
1191
degrees is measured relative to the Y axis, and similarly, for Y
1413
1192
direction shears y degrees is measured relative to the X
1414
1193
axis. Empty triangles left over from shearing the image are
1415
1194
filled with the color defined as <i>borderColor</i>. </font></td>
1418
<td style="text-align: center;">
1419
1198
<center><a name="solarize"></a> <font size="-1">solarize</font></center>
1421
1200
<td><font size="-1">double factor_ = 50.0</font></td>
1423
1202
exposing a photographic film to light during the development process)</font></td>
1426
<td style="text-align: center;">
1427
<center><a name="splice"></a> <font size="-1">splice</font></center>
1429
<td><font size="-1">const <a href="Geometry.html">Geometry</a>
1430
&geometry_</font></td>
1431
<td><font size="-1">splice the background color into the image</font></td>
1434
<td style="text-align: center;">
1435
1206
<center><a name="spread"></a> <font size="-1">spread</font></center>
1437
<td><font size="-1">size_t amount_ = 3</font></td>
1208
<td><font size="-1">unsigned int amount_ = 3</font></td>
1438
1209
<td><font size="-1">Spread pixels randomly within image by
1439
1210
specified amount</font></td>
1442
<td style="text-align: center;">
1443
1214
<center><a name="stegano"></a> <font size="-1">stegano</font></center>
1445
1216
<td><font size="-1">const Image &watermark_</font></td>
1446
1217
<td><font size="-1">Add a digital watermark to the image (based
1447
on second image)</font></td>
1218
on second image)</font></td>
1451
<center><a name="sparseColor"></a> <font size="-1">sparseColor</font></center>
1453
<td><font size="-1">const ChannelType channel, const SparseColorMethod method, const unsigned long number_arguments, const double *arguments </font></td>
1454
<td><font size="-1">Sparse color image, given a set of coordinates, interpolates the colors found at those coordinates, across the whole image, using various methods.</font></td>
1457
<td style="text-align: center;">
1458
<center><a name="statistics"></a> <font size="-1">statistics</font></center>
1460
<td><font size="-1">ImageStatistics *statistics</font></td>
1461
<td><font size="-1">Obtain image statistics. Statistics are normalized to the range of 0.0 to 1.0 and are output to the specified ImageStatistics structure. The structure includes members maximum, minimum, mean, standard_deviation, and variance for each of these channels: red, green, blue, and opacity (e.g. statistics->red.maximum).</font></td>
1464
<td style="text-align: center;">
1465
1222
<center><a name="stereo"></a> <font size="-1">stereo</font></center>
1467
1224
<td><font size="-1">const Image &rightImage_</font></td>
1523
1280
the image.</font></td>
1526
<td style="text-align: center;">
1527
1284
<center><a name="unsharpmask"></a> <font size="-1">unsharpmask</font></center>
1529
1286
<td><font size="-1">double radius_, double sigma_, double
1530
amount_, double threshold_</font></td>
1531
<td><font size="-1">Sharpen the image using the unsharp mask
1532
algorithm. The <i>radius</i>_
1533
parameter specifies the radius of the Gaussian, in pixels, not
1534
counting the center pixel. The <i>sigma</i>_ parameter specifies the
1535
standard deviation of the Gaussian, in pixels. The <i>amount</i>_
1536
parameter specifies the percentage of the difference between the
1537
original and the blur image that is added back into the original. The <i>threshold</i>_
1538
parameter specifies the threshold in pixels needed to apply the
1539
diffence amount.</font></td>
1542
<td style="vertical-align: middle; text-align: center;"><small><a
1543
name="unsharpmaskChannel"></a>unsharpmaskChannel<br>
1545
<td style="vertical-align: middle;"><small>const ChannelType
1546
channel_, const double radius_, const double sigma_, const double
1547
amount_, const double threshold_<br>
1549
<td style="vertical-align: middle;"><small>Sharpen an image
1550
channel using the unsharp mask algorithm. The <span
1551
style="font-style: italic;">channel_</span> parameter specifies the
1552
channel to sharpen. </small><font size="-1">The <i>radius</i>_
1553
parameter specifies the radius of the Gaussian, in pixels, not
1554
counting the center pixel. The <i>sigma</i>_ parameter specifies the
1555
standard deviation of the Gaussian, in pixels. The <i>amount</i>_
1556
parameter specifies the percentage of the difference between the
1557
original and the blur image that is added back into the original. The <i>threshold</i>_
1558
parameter specifies the threshold in pixels needed to apply the
1559
diffence amount.</font></td>
1562
<td style="text-align: center;">
1287
amount_, double threshold_</font></td>
1288
<td><font size="-1">Replace image with a sharpened version of the
1289
original image using the unsharp mask algorithm. The <i>radius</i>_
1290
parameter specifies the radius of the Gaussian, in pixels, not
1291
counting the center pixel. The <i>sigma</i>_ parameter specifies the
1292
standard deviation of the Gaussian, in pixels. The <i>amount</i>_
1293
parameter specifies the percentage of the difference between the
1294
original and the blur image that is added back into the original. The <i>threshold</i>_
1295
parameter specifies the threshold in pixels needed to apply the
1296
diffence amount.</font></td>
1563
1300
<center><a name="wave"></a> <font size="-1">wave</font></center>
1565
1302
<td><font size="-1">double amplitude_ = 25.0, double wavelength_
1567
1304
<td><font size="-1">Alter an image along a sine wave.</font></td>
1570
<td style="text-align: center;" rowspan="5">
1571
1308
<center><a name="write"></a> <font size="-1">write</font></center>
1573
1310
<td><font size="-1">const string &imageSpec_</font></td>
1574
1311
<td><font size="-1">Write image to a file using filename i<i>mageSpec_</i>
1576
1313
<font size="-1"><b><font color="#ff0000">Caution: </font></b> if
1577
an image format is selected which is capable of supporting fewer
1578
colors than the original image or quantization has been requested, the
1579
original image will be quantized to fewer colors. Use a copy of the
1314
an image format is selected which is capable of supporting fewer
1315
colors than the original image or quantization has been requested, the
1316
original image will be quantized to fewer colors. Use a copy of the
1580
1317
original if this is a problem.</font></td>
1583
1320
<td><font size="-1"><a href="Blob.html">Blob</a> *blob_</font></td>
1584
1321
<td rowspan="3"><font size="-1">Write image to a in-memory <a
1585
1322
href="Blob.html"> BLOB</a> stored in <i>blob_</i>. The <i>magick</i>_
1586
parameter specifies the image format to write (defaults to <a
1323
parameter specifies the image format to write (defaults to <a
1587
1324
href="#magick">magick</a> ). The depth_ parameter species the image
1588
1325
depth (defaults to <a href="#depth"> depth</a> ).</font> <br>
1589
1326
<font size="-1"><b><font color="#ff0000">Caution: </font></b> if
1590
an image format is selected which is capable of supporting fewer
1591
colors than the original image or quantization has been requested, the
1592
original image will be quantized to fewer colors. Use a copy of the
1327
an image format is selected which is capable of supporting fewer
1328
colors than the original image or quantization has been requested, the
1329
original image will be quantized to fewer colors. Use a copy of the
1593
1330
original if this is a problem.</font></td>
1600
1337
<td><font size="-1"><a href="Blob.html">Blob</a> *blob_,
1601
std::string &magick_, size_t depth_</font></td>
1338
std::string &magick_, unsigned int depth_</font></td>
1604
<td><font size="-1">const ssize_t x_, const ssize_t y_, const unsigned
1605
int columns_, const size_t rows_, const std::string &map_,
1606
const StorageType type_, void *pixels_</font></td>
1341
<td><font size="-1">const int x_, const int y_, const unsigned
1342
int columns_, const unsigned int rows_, const std::string &map_,
1343
const StorageType type_, unsigned char* pixels_</font></td>
1607
1344
<td><font size="-1">Write pixel data into a buffer you supply.
1608
The data is saved either as char, short int, integer, float or double
1609
format in the order specified by the type_ parameter. For example, we
1345
The data is saved either as char, short int, integer, float or double
1346
format in the order specified by the type_ parameter. For example, we
1610
1347
want to extract scanline 1 of a 640x480 image as character data in
1611
1348
red-green-blue order:</font>
1612
<p><font size="-1"> image.write(0,0,640,1,"RGB",0,pixels);</font>
1349
<p><font size="-1"> image.write(0,0,640,1,"RGB",0,pixels);</font> </p>
1614
1350
<p><font size="-1">The parameters are as follows:</font> <br>
1616
1352
<table border="0" width="100%">
1639
1375
<td><font size="-1">map_</font></td>
1640
1376
<td><font size="-1">This character string can be any
1641
combination or order of R = red, G = green, B = blue, A = alpha, C =
1642
cyan, Y = yellow, M = magenta, and K = black. The ordering reflects
1643
the order of the pixels in the supplied pixel array.</font></td>
1377
combination or order of R = red, G = green, B = blue, A = alpha, C =
1378
cyan, Y = yellow, M = magenta, and K = black. The ordering reflects
1379
the order of the pixels in the supplied pixel array.</font></td>
1646
1382
<td><font size="-1">type_</font></td>
1647
1383
<td><font size="-1">Pixel storage type (CharPixel,
1648
ShortPixel, IntegerPixel, FloatPixel, or DoublePixel)</font></td>
1384
ShortPixel, IntegerPixel, FloatPixel, or DoublePixel)</font></td>
1651
1387
<td><font size="-1">pixels_</font></td>
1652
1388
<td><font size="-1">This array of values contain the pixel
1653
components as defined by the map_ and type_ parameters. The length of
1654
the arrays must equal the area specified by the width_ and height_
1389
components as defined by the map_ and type_ parameters. The length of
1390
the arrays must equal the area specified by the width_ and height_
1655
1391
values and type_ parameters.</font></td>
1727
1462
<td><font size="-1">void</font></td>
1728
1463
<td><font size="-1">bool flag_</font></td>
1729
1464
<td><font size="-1">Control antialiasing of rendered Postscript
1730
and Postscript or TrueType fonts. Enabled by default.</font></td>
1465
and Postscript or TrueType fonts. Enabled by default.</font></td>
1734
<center><a name="animationDelay"></a> <font size="-1">animation-</font>
1469
<center><a name="animationDelay"></a> <font size="-1">animation-</font> <br>
1736
1470
<font size="-1">Delay</font></center>
1738
<td><font size="-1">size_t (0 to 65535)</font></td>
1472
<td><font size="-1">unsigned int (0 to 65535)</font></td>
1739
1473
<td><font size="-1">void</font></td>
1740
<td><font size="-1">size_t delay_</font></td>
1474
<td><font size="-1">unsigned int delay_</font></td>
1741
1475
<td><font size="-1">Time in 1/100ths of a second (0 to 65535)
1742
which must expire before displaying the next image in an animated
1743
sequence. This option is useful for regulating the animation of a
1744
sequence of GIF images within Netscape.</font></td>
1476
which must expire before displaying the next image in an animated
1477
sequence. This option is useful for regulating the animation of a
1478
sequence of GIF images within Netscape.</font></td>
1748
<center><a name="animationIterations"></a> <font size="-1">animation-</font>
1482
<center><a name="animationIterations"></a> <font size="-1">animation-</font> <br>
1750
1483
<font size="-1">Iterations</font></center>
1752
<td><font size="-1">size_t</font></td>
1485
<td><font size="-1">unsigned int</font></td>
1753
1486
<td><font size="-1">void</font></td>
1754
<td><font size="-1">size_t iterations_</font></td>
1487
<td><font size="-1">unsigned int iterations_</font></td>
1755
1488
<td><font size="-1">Number of iterations to loop an animation
1756
(e.g. Netscape loop extension) for.</font></td>
1489
(e.g. Netscape loop extension) for.</font></td>
1759
1492
<td style="vertical-align: middle; text-align: center;"><small><a
2574
2268
</small></a> </td>
2575
2269
<td valign="top"><small>const std::string name_</small><small><br>
2577
<td valign="top"><small>const std::string name_, const Blob
2271
<td valign="top"><small>const std::string name_, const Blob
2578
2272
&colorProfile_</small><small><br>
2580
2274
<td valign="top"><small>Get/set/remove </small><small> a named
2581
2275
profile</small><small>. Valid names include </small><small>"*",
2582
"8BIM", "ICM", "IPTC", or a user/format-defined profile name. </small><br>
2276
"8bim", "icm", "iptc", or a user/format-defined profile name. </small><br>
2587
2281
<center><a name="quality"></a> <font size="-1">quality</font></center>
2589
<td><font size="-1">size_t (0 to 100)</font></td>
2283
<td><font size="-1">unsigned int (0 to 100)</font></td>
2590
2284
<td><font size="-1">void</font></td>
2591
<td><font size="-1">size_t quality_</font></td>
2285
<td><font size="-1">unsigned int quality_</font></td>
2592
2286
<td><font size="-1">JPEG/MIFF/PNG compression level (default 75).</font></td>
2596
<center><a name="quantizeColors"></a> <font size="-1">quantize-</font>
2290
<center><a name="quantizeColors"></a> <font size="-1">quantize-</font> <br>
2598
2291
<font size="-1">Colors</font></center>
2600
<td><font size="-1">size_t</font></td>
2293
<td><font size="-1">unsigned int</font></td>
2601
2294
<td><font size="-1">void</font></td>
2602
<td><font size="-1">size_t colors_</font></td>
2295
<td><font size="-1">unsigned int colors_</font></td>
2603
2296
<td><font size="-1">Preferred number of colors in the image. The
2604
2297
actual number of colors in the image may be less than your request, but
2605
never more. Images with less unique colors than specified with this
2606
option will have any duplicate or unused colors removed.</font></td>
2298
never more. Images with less unique colors than specified with this
2299
option will have any duplicate or unused colors removed.</font></td>
2610
<center><a name="quantizeColorSpace"></a> <font size="-1">quantize-</font>
2303
<center><a name="quantizeColorSpace"></a> <font size="-1">quantize-</font> <br>
2612
2304
<font size="-1">ColorSpace</font></center>
2614
<td><font size="-1"><a href="Enumerations.html#ColorspaceType">ColorspaceType</a>
2306
<td><font size="-1"><a href="Enumerations.html#ColorspaceType">ColorspaceType</a> </font></td>
2616
2307
<td><font size="-1">void</font></td>
2617
2308
<td><font size="-1"><a href="Enumerations.html#ColorspaceType">ColorspaceType</a>
2618
2309
colorSpace_</font></td>
2619
2310
<td><font size="-1">Colorspace to quantize colors in (default
2620
RGB). Empirical evidence suggests that distances in color spaces such
2621
as YUV or YIQ correspond to perceptual color differences more closely
2622
than do distances in RGB space. These color spaces may give better
2311
RGB). Empirical evidence suggests that distances in color spaces such
2312
as YUV or YIQ correspond to perceptual color differences more closely
2313
than do distances in RGB space. These color spaces may give better
2623
2314
results when color reducing an image.</font></td>
2627
<center><a name="quantizeDither"></a> <font size="-1">quantize-</font>
2318
<center><a name="quantizeDither"></a> <font size="-1">quantize-</font> <br>
2629
2319
<font size="-1">Dither</font></center>
2631
2321
<td><font size="-1">bool</font></td>
2632
2322
<td><font size="-1">void</font></td>
2633
2323
<td><font size="-1">bool flag_</font></td>
2634
2324
<td><font size="-1">Apply Floyd/Steinberg error diffusion to the
2635
image. The basic strategy of dithering is to trade
2325
image. The basic strategy of dithering is to trade intensity
2637
2326
resolution for spatial resolution by
2638
averaging the intensities of several
2639
neighboring pixels. Images which suffer from
2640
severe contouring when reducing colors can be
2327
averaging the intensities of several
2328
neighboring pixels. Images which suffer from
2329
severe contouring when reducing colors can be
2641
2330
improved with this option. The quantizeColors or monochrome option must
2642
2331
be set for this option to take effect.</font></td>
2646
<center><a name="quantizeTreeDepth"></a> <font size="-1">quantize-</font>
2335
<center><a name="quantizeTreeDepth"></a> <font size="-1">quantize-</font> <br>
2648
2336
<font size="-1">TreeDepth</font></center>
2650
<td><font size="-1">size_t </font></td>
2338
<td><font size="-1">unsigned int </font></td>
2651
2339
<td><font size="-1">void</font></td>
2652
<td><font size="-1">size_t treeDepth_</font></td>
2340
<td><font size="-1">unsigned int treeDepth_</font></td>
2653
2341
<td><font size="-1">Depth of the quantization color
2654
classification tree. Values of 0 or 1 allow selection of the optimal
2655
tree depth for the color reduction algorithm. Values between 2 and 8
2656
may be used to manually adjust the tree depth.</font></td>
2342
classification tree. Values of 0 or 1 allow selection of the optimal
2343
tree depth for the color reduction algorithm. Values between 2 and 8
2344
may be used to manually adjust the tree depth.</font></td>
2660
<center><a name="renderingIntent"></a> <font size="-1">rendering-</font>
2348
<center><a name="renderingIntent"></a> <font size="-1">rendering-</font> <br>
2662
2349
<font size="-1">Intent</font></center>
2664
<td><font size="-1"><a href="Enumerations.html#RenderingIntent">RenderingIntent</a>
2351
<td><font size="-1"><a href="Enumerations.html#RenderingIntent">RenderingIntent</a> </font></td>
2666
2352
<td><font size="-1">void</font></td>
2667
2353
<td><font size="-1"><a href="Enumerations.html#RenderingIntent">RenderingIntent</a>
2668
2354
render_</font></td>
2786
2479
<td><font size="-1">void</font></td>
2787
2480
<td><font size="-1">LineJoin lineJoin_</font></td>
2788
2481
<td><font size="-1">Specify the shape to be used at the corners
2789
of paths (or other vector shapes) when they are stroked. Values of
2790
LineJoin are UndefinedJoin, MiterJoin, RoundJoin, and BevelJoin.</font></td>
2482
of paths (or other vector shapes) when they are stroked. Values of
2483
LineJoin are UndefinedJoin, MiterJoin, RoundJoin, and BevelJoin.</font></td>
2794
2487
<center><a name="strokeMiterLimit"></a> <font size="-1">strokeMiterLimit</font></center>
2796
<td><font size="-1">size_t</font></td>
2489
<td><font size="-1">unsigned int</font></td>
2797
2490
<td><font size="-1">void</font></td>
2798
<td><font size="-1">size_t miterLimit_</font></td>
2491
<td><font size="-1">unsigned int miterLimit_</font></td>
2799
2492
<td><font size="-1">Specify miter limit. When two line segments
2800
meet at a sharp angle and miter joins have been specified for
2801
'lineJoin', it is possible for the miter to extend far beyond the
2802
thickness of the line stroking the path. The miterLimit' imposes a
2803
limit on the ratio of the miter length to the 'lineWidth'. The default
2493
meet at a sharp angle and miter joins have been specified for
2494
'lineJoin', it is possible for the miter to extend far beyond the
2495
thickness of the line stroking the path. The miterLimit' imposes a
2496
limit on the ratio of the miter length to the 'lineWidth'. The default
2804
2497
value of this parameter is 4.</font></td>
2954
2634
<h3> <a name="Raw Image Pixel Access"></a> Low-Level Image Pixel Access</h3>
2956
2636
Image pixels (of type <i><a href="PixelPacket.html">PixelPacket</a> </i>)
2957
may be accessed directly via the <i>Image Pixel Cache</i> . The
2958
image pixel cache is a rectangular window into the actual image pixels
2959
(which may be in memory, memory-mapped from a disk file, or entirely on
2960
disk). Two interfaces exist to access the <i>Image Pixel Cache.</i>
2962
interface described here (part of the <i>Image</i> class) supports
2637
may be accessed directly via the <i>Image Pixel Cache</i> . The
2638
image pixel cache is a rectangular window into the actual image pixels
2639
(which may be in memory, memory-mapped from a disk file, or entirely on
2640
disk). Two interfaces exist to access the <i>Image Pixel Cache.</i> The
2641
interface described here (part of the <i>Image</i> class) supports only
2964
2642
one view at a time. See the <i><a href="Pixels.html">Pixels</a> </i>
2965
class for a more abstract interface which supports simultaneous pixel
2966
views (up to the number of rows). As an analogy, the interface
2643
class for a more abstract interface which supports simultaneous pixel
2644
views (up to the number of rows). As an analogy, the interface described
2968
2645
here relates to the <i><a href="Pixels.html">Pixels</a> </i> class as
2969
stdio's gets() relates to fgets(). The <i><a href="Pixels.html"> Pixels</a>
2970
</i>class provides the more general form of the interface.
2971
<p>Obtain existing image pixels via <i>getPixels()</i>. Create a new
2646
stdio's gets() relates to fgets(). The <i><a href="Pixels.html"> Pixels</a> </i>
2647
class provides the more general form of the interface.
2648
<p>Obtain existing image pixels via <i>getPixels()</i>. Create a new
2972
2649
pixel region using <i>setPixels().</i></p>
2973
2650
<p>In order to ensure that only the current generation of the image is
2974
2651
modified, the Image's <a href="#modifyImage">modifyImage()</a> method
3010
2686
size="-1"> // Request pixel region with size 60x40, and top origin at
3011
2687
20x30</font></font></font> <br>
3012
2688
<font face="Courier New,Courier"><font color="#000099"><font
3013
size="-1"> ssize_t columns = 60;</font></font></font> <br>
2689
size="-1"> int columns = 60;</font></font></font> <br>
3014
2690
<font face="Courier New,Courier"><font color="#000099"><font
3015
size="-1"> PixelPacket *pixel_cache =
3016
image.getPixels(20,30,columns,40);</font></font></font> <br>
2691
size="-1"> PixelPacket *pixel_cache = image.getPixels(20,30,columns,40);</font></font></font> <br>
3017
2692
<font face="Courier New,Courier"><font color="#ff0000"><font
3018
2693
size="-1"> // Set pixel at column 5, and row 10 in the pixel cache to
3019
2694
red.</font></font></font> <br>
3020
2695
<font face="Courier New,Courier"><font color="#000099"><font
3021
size="-1"> ssize_t column = 5;</font></font></font> <br>
3022
<font face="Courier New,Courier"><font color="#000099"><font
3023
size="-1"> ssize_t row = 10;</font></font></font> <br>
3024
<font face="Courier New,Courier"><font color="#000099"><font
3025
size="-1"> PixelPacket *pixel =
3026
pixel_cache+row*columns*sizeof(PixelPacket)+column;</font></font></font>
2696
size="-1"> int column = 5;</font></font></font> <br>
2697
<font face="Courier New,Courier"><font color="#000099"><font
2698
size="-1"> int row = 10;</font></font></font> <br>
2699
<font face="Courier New,Courier"><font color="#000099"><font
2700
size="-1"> PixelPacket *pixel = pixel_cache+row*columns+column;</font></font></font> <br>
3028
2701
<font face="Courier New,Courier"><font color="#000099"><font
3029
2702
size="-1"> *pixel = Color("red");</font></font></font> <br>
3030
2703
<font face="Courier New,Courier"><font color="#ff0000"><font
3100
2772
<td><font size="-1">Returns a pointer to the Image pixel indexes
3101
2773
corresponding to the pixel region requested by the last <a
3102
2774
href="#getConstPixels">getConstPixels</a> , <a href="#getPixels">getPixels</a>
3103
, or <a href="#setPixels">setPixels</a> call. </font><font
2775
, or <a href="#setPixels">setPixels</a> call. </font><font size="-1">The
3105
2776
returned pointer remains valid until the next getPixel, getConstPixels,
3106
2777
or setPixels call and should never be deallocated by the user.</font><font
3107
size="-1"> </font><font size="-1">Only valid for PseudoClass images
3109
CMYKA images. The pixel indexes represent an array of type
3110
IndexPacket, with each entry corresponding to a pixel x,y position. For
3111
PseudoClass images, the entry's value is the offset into the colormap
3112
(see <a href="#colorMap">colorMap</a> ) for that pixel. For
3114
images, the indexes are used to contain the alpha channel.</font></td>
2778
size="-1"> </font><font size="-1">Only valid for PseudoClass images or
2779
CMYKA images. The pixel indexes represent an array of type
2780
IndexPacket, with each entry corresponding to a pixel x,y position. For
2781
PseudoClass images, the entry's value is the offset into the colormap
2782
(see <a href="#colorMap">colorMap</a> ) for that pixel. For CMYKA
2783
images, the indexes are used to contain the alpha channel.</font></td>
3118
2787
<center><a name="getPixels"></a> <font size="-1">getPixels</font></center>
3120
2789
<td><font size="-1"><a href="PixelPacket.html">PixelPacket</a> *</font></td>
3121
<td><font size="-1">const ssize_t x_, const ssize_t y_, const unsigned
3122
int columns_, const size_t rows_</font></td>
2790
<td><font size="-1">const int x_, const int y_, const unsigned
2791
int columns_, const unsigned int rows_</font></td>
3123
2792
<td><font size="-1">Transfers pixels from the image to the pixel
3124
2793
cache as defined by the specified rectangular region. Modified pixels
3125
may be subsequently transferred back to the image via syncPixels. </font><font
2794
may be subsequently transferred back to the image via syncPixels. </font><font
3126
2795
size="-1">The returned pointer remains valid until the next getPixel,
3127
getConstPixels, or setPixels call and should never be deallocated by
2796
getConstPixels, or setPixels call and should never be deallocated by the
3129
2797
user.</font><font size="-1"></font></td>