65
% M a g i c k A v e r a g e I m a g e s %
69
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
71
% MagickAverageImages() average a set of images.
73
% The format of the MagickAverageImages method is:
75
% MagickWand *MagickAverageImages(MagickWand *wand)
77
% A description of each parameter follows:
79
% o wand: the magick wand.
83
static MagickWand *CloneMagickWandFromImages(const MagickWand *wand,
89
assert(wand != (MagickWand *) NULL);
90
assert(wand->signature == WandSignature);
91
if (wand->debug != MagickFalse)
92
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
93
clone_wand=(MagickWand *) AcquireAlignedMemory(1,sizeof(*clone_wand));
94
if (clone_wand == (MagickWand *) NULL)
95
ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
97
(void) ResetMagickMemory(clone_wand,0,sizeof(*clone_wand));
98
clone_wand->id=AcquireWandId();
99
(void) FormatMagickString(clone_wand->name,MaxTextExtent,"%s-%.20g",
100
MagickWandId,(double) clone_wand->id);
101
clone_wand->exception=AcquireExceptionInfo();
102
InheritException(clone_wand->exception,wand->exception);
103
clone_wand->image_info=CloneImageInfo(wand->image_info);
104
clone_wand->quantize_info=CloneQuantizeInfo(wand->quantize_info);
105
clone_wand->images=images;
106
clone_wand->debug=IsEventLogging();
107
if (clone_wand->debug != MagickFalse)
108
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clone_wand->name);
109
clone_wand->signature=WandSignature;
113
WandExport MagickWand *MagickAverageImages(MagickWand *wand)
118
assert(wand != (MagickWand *) NULL);
119
assert(wand->signature == WandSignature);
120
if (wand->debug != MagickFalse)
121
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
122
if (wand->images == (Image *) NULL)
123
return((MagickWand *) NULL);
124
average_image=EvaluateImages(wand->images,MeanEvaluateOperator,
126
if (average_image == (Image *) NULL)
127
return((MagickWand *) NULL);
128
return(CloneMagickWandFromImages(wand,average_image));
132
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
65
136
% M a g i c k C l i p P a t h I m a g e %
315
386
% MagickBooleanType MagickColorFloodfillImage(MagickWand *wand,
316
387
% const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
317
% const long x,const long y)
388
% const ssize_t x,const ssize_t y)
319
390
% A description of each parameter follows:
419
490
% o wand: the magick wand.
423
static MagickWand *CloneMagickWandFromImages(const MagickWand *wand,
429
assert(wand != (MagickWand *) NULL);
430
assert(wand->signature == WandSignature);
431
if (wand->debug != MagickFalse)
432
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
433
clone_wand=(MagickWand *) AcquireMagickMemory(sizeof(*clone_wand));
434
if (clone_wand == (MagickWand *) NULL)
435
ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
437
(void) ResetMagickMemory(clone_wand,0,sizeof(*clone_wand));
438
clone_wand->id=AcquireWandId();
439
(void) FormatMagickString(clone_wand->name,MaxTextExtent,"%s-%lu",
440
MagickWandId,clone_wand->id);
441
clone_wand->exception=AcquireExceptionInfo();
442
InheritException(clone_wand->exception,wand->exception);
443
clone_wand->image_info=CloneImageInfo(wand->image_info);
444
clone_wand->quantize_info=CloneQuantizeInfo(wand->quantize_info);
445
clone_wand->images=images;
446
clone_wand->debug=IsEventLogging();
447
if (clone_wand->debug != MagickFalse)
448
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clone_wand->name);
449
clone_wand->signature=WandSignature;
453
493
WandExport MagickWand *MagickFlattenImages(MagickWand *wand)
514
554
% The format of the MagickGetImageIndex method is:
516
% long MagickGetImageIndex(MagickWand *wand)
556
% ssize_t MagickGetImageIndex(MagickWand *wand)
518
558
% A description of each parameter follows:
520
560
% o wand: the magick wand.
523
WandExport long MagickGetImageIndex(MagickWand *wand)
563
WandExport ssize_t MagickGetImageIndex(MagickWand *wand)
525
565
return(MagickGetIteratorIndex(wand));
542
582
% The format of the MagickGetImageChannelExtrema method is:
544
584
% MagickBooleanType MagickGetImageChannelExtrema(MagickWand *wand,
545
% const ChannelType channel,unsigned long *minima,unsigned long *maxima)
585
% const ChannelType channel,size_t *minima,size_t *maxima)
547
587
% A description of each parameter follows:
663
703
% MagickGetImagePixels() extracts pixel data from an image and returns it to
664
704
% you. The method returns MagickTrue on success otherwise MagickFalse if an
665
% error is encountered. The data is returned as char, short int, int, long,
705
% error is encountered. The data is returned as char, short int, int, ssize_t,
666
706
% float, or double in the order specified by map.
668
708
% Suppose you want to extract the first scanline of a 640x480 image as
673
713
% The format of the MagickGetImagePixels method is:
675
715
% MagickBooleanType MagickGetImagePixels(MagickWand *wand,
676
% const long x,const long y,const unsigned long columns,
677
% const unsigned long rows,const char *map,const StorageType storage,
716
% const ssize_t x,const ssize_t y,const size_t columns,
717
% const size_t rows,const char *map,const StorageType storage,
680
720
% A description of each parameter follows:
703
743
WandExport MagickBooleanType MagickGetImagePixels(MagickWand *wand,
704
const long x,const long y,const unsigned long columns,
705
const unsigned long rows,const char *map,const StorageType storage,
744
const ssize_t x,const ssize_t y,const size_t columns,
745
const size_t rows,const char *map,const StorageType storage,
708
748
return(MagickExportImagePixels(wand,x,y,columns,rows,map,storage,pixels));
812
852
% MagickBooleanType MagickMatteFloodfillImage(MagickWand *wand,
813
853
% const double alpha,const double fuzz,const PixelWand *bordercolor,
814
% const long x,const long y)
854
% const ssize_t x,const ssize_t y)
816
856
% A description of each parameter follows:
857
897
if (bordercolor != (PixelWand *) NULL)
858
898
PixelGetQuantumColor(bordercolor,&target);
859
899
wand->images->fuzz=fuzz;
860
status=MatteFloodfillImage(wand->images,target,RoundToQuantum(
900
status=MatteFloodfillImage(wand->images,target,ClampToQuantum(
861
901
(MagickRealType) QuantumRange-QuantumRange*alpha),x,y,bordercolor !=
862
902
(PixelWand *) NULL ? FillToBorderMethod : FloodfillMethod);
863
903
if (status == MagickFalse)
914
% M a g i c k M a x i m u m I m a g e s %
918
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
920
% MagickMaximumImages() returns the maximum intensity of an image sequence.
922
% The format of the MagickMaximumImages method is:
924
% MagickWand *MagickMaximumImages(MagickWand *wand)
926
% A description of each parameter follows:
928
% o wand: the magick wand.
931
WandExport MagickWand *MagickMaximumImages(MagickWand *wand)
936
assert(wand != (MagickWand *) NULL);
937
assert(wand->signature == WandSignature);
938
if (wand->debug != MagickFalse)
939
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
940
if (wand->images == (Image *) NULL)
941
return((MagickWand *) NULL);
942
maximum_image=EvaluateImages(wand->images,MaxEvaluateOperator,
944
if (maximum_image == (Image *) NULL)
945
return((MagickWand *) NULL);
946
return(CloneMagickWandFromImages(wand,maximum_image));
950
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
954
% M a g i c k M i n i m u m I m a g e s %
958
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
960
% MagickMinimumImages() returns the minimum intensity of an image sequence.
962
% The format of the MagickMinimumImages method is:
964
% MagickWand *MagickMinimumImages(MagickWand *wand)
966
% A description of each parameter follows:
968
% o wand: the magick wand.
971
WandExport MagickWand *MagickMinimumImages(MagickWand *wand)
976
assert(wand != (MagickWand *) NULL);
977
assert(wand->signature == WandSignature);
978
if (wand->debug != MagickFalse)
979
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
980
if (wand->images == (Image *) NULL)
981
return((MagickWand *) NULL);
982
minimum_image=EvaluateImages(wand->images,MinEvaluateOperator,
984
if (minimum_image == (Image *) NULL)
985
return((MagickWand *) NULL);
986
return(CloneMagickWandFromImages(wand,minimum_image));
990
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
874
994
% M a g i c k M o s a i c I m a g e s %
971
1091
% MagickBooleanType MagickPaintFloodfillImage(MagickWand *wand,
972
1092
% const ChannelType channel,const PixelWand *fill,const double fuzz,
973
% const PixelWand *bordercolor,const long x,const long y)
1093
% const PixelWand *bordercolor,const ssize_t x,const ssize_t y)
975
1095
% A description of each parameter follows:
995
1115
WandExport MagickBooleanType MagickPaintFloodfillImage(MagickWand *wand,
996
1116
const ChannelType channel,const PixelWand *fill,const double fuzz,
997
const PixelWand *bordercolor,const long x,const long y)
1117
const PixelWand *bordercolor,const ssize_t x,const ssize_t y)
999
1119
MagickBooleanType
1234
% M a g i c k R e c o l o r I m a g e %
1238
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1240
% MagickRecolorImage() apply color transformation to an image. The method
1241
% permits saturation changes, hue rotation, luminance to alpha, and various
1242
% other effects. Although variable-sized transformation matrices can be used,
1243
% typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA
1244
% (or RGBA with offsets). The matrix is similar to those used by Adobe Flash
1245
% except offsets are in column 6 rather than 5 (in support of CMYKA images)
1246
% and offsets are normalized (divide Flash offset by 255).
1248
% The format of the MagickRecolorImage method is:
1250
% MagickBooleanType MagickRecolorImage(MagickWand *wand,
1251
% const size_t order,const double *color_matrix)
1253
% A description of each parameter follows:
1255
% o wand: the magick wand.
1257
% o order: the number of columns and rows in the color matrix.
1259
% o color_matrix: An array of doubles representing the color matrix.
1262
WandExport MagickBooleanType MagickRecolorImage(MagickWand *wand,
1263
const size_t order,const double *color_matrix)
1268
assert(wand != (MagickWand *) NULL);
1269
assert(wand->signature == WandSignature);
1270
if (wand->debug != MagickFalse)
1271
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1272
if (color_matrix == (const double *) NULL)
1273
return(MagickFalse);
1274
if (wand->images == (Image *) NULL)
1275
ThrowWandException(WandError,"ContainsNoImages",wand->name);
1276
transform_image=RecolorImage(wand->images,order,color_matrix,
1278
if (transform_image == (Image *) NULL)
1279
return(MagickFalse);
1280
ReplaceImageInList(&wand->images,transform_image);
1285
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1114
1289
% M a g i c k S e t I m a g e A t t r i b u t e %
1274
1449
% The format of the MagickRegionOfInterestImage method is:
1276
1451
% MagickWand *MagickRegionOfInterestImage(MagickWand *wand,
1277
% const unsigned long width,const unsigned long height,const long x,
1452
% const size_t width,const size_t height,const ssize_t x,
1280
1455
% A description of each parameter follows:
1293
1468
WandExport MagickWand *MagickRegionOfInterestImage(MagickWand *wand,
1294
const unsigned long width,const unsigned long height,const long x,
1469
const size_t width,const size_t height,const ssize_t x,
1297
1472
return(MagickGetImageRegion(wand,width,height,x,y));
1311
1486
% MagickSetImagePixels() accepts pixel datand stores it in the image at the
1312
1487
% location you specify. The method returns MagickFalse on success otherwise
1313
1488
% MagickTrue if an error is encountered. The pixel data can be either char,
1314
% short int, int, long, float, or double in the order specified by map.
1489
% short int, int, ssize_t, float, or double in the order specified by map.
1316
1491
% Suppose your want to upload the first scanline of a 640x480 image from
1317
1492
% character data in red-green-blue order:
1321
1496
% The format of the MagickSetImagePixels method is:
1323
1498
% MagickBooleanType MagickSetImagePixels(MagickWand *wand,
1324
% const long x,const long y,const unsigned long columns,
1325
% const unsigned long rows,const char *map,const StorageType storage,
1499
% const ssize_t x,const ssize_t y,const size_t columns,
1500
% const size_t rows,const char *map,const StorageType storage,
1326
1501
% const void *pixels)
1328
1503
% A description of each parameter follows:
1351
1526
WandExport MagickBooleanType MagickSetImagePixels(MagickWand *wand,
1352
const long x,const long y,const unsigned long columns,
1353
const unsigned long rows,const char *map,const StorageType storage,
1527
const ssize_t x,const ssize_t y,const size_t columns,
1528
const size_t rows,const char *map,const StorageType storage,
1354
1529
const void *pixels)
1356
1531
return(MagickImportImagePixels(wand,x,y,columns,rows,map,storage,pixels));