49#include "MagickWand/studio.h"
50#include "MagickWand/MagickWand.h"
51#include "MagickWand/magick-wand-private.h"
52#include "MagickWand/wand.h"
53#include "MagickWand/pixel-wand-private.h"
54#include "MagickCore/image-private.h"
55#include "MagickCore/nt-base-private.h"
60#define MagickWandId "MagickWand"
88static MagickWand *CloneMagickWandFromImages(
const MagickWand *wand,
94 assert(wand != (MagickWand *) NULL);
95 assert(wand->signature == MagickWandSignature);
96 if (wand->debug != MagickFalse)
97 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
98 clone_wand=(MagickWand *) AcquireCriticalMemory(
sizeof(*clone_wand));
99 (void) memset(clone_wand,0,
sizeof(*clone_wand));
100 clone_wand->id=AcquireWandId();
101 (void) FormatLocaleString(clone_wand->name,MagickPathExtent,
"%s-%.20g",
102 MagickWandId,(
double) clone_wand->id);
103 clone_wand->exception=AcquireExceptionInfo();
104 InheritException(clone_wand->exception,wand->exception);
105 clone_wand->image_info=CloneImageInfo(wand->image_info);
106 clone_wand->images=images;
107 clone_wand->debug=IsEventLogging();
108 clone_wand->signature=MagickWandSignature;
109 if (clone_wand->debug != MagickFalse)
110 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",clone_wand->name);
136WandExport Image *GetImageFromMagickWand(
const MagickWand *wand)
138 assert(wand != (MagickWand *) NULL);
139 assert(wand->signature == MagickWandSignature);
140 if (wand->debug != MagickFalse)
141 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
142 if (wand->images == (Image *) NULL)
144 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
145 "ContainsNoImages",
"`%s'",wand->name);
146 return((Image *) NULL);
148 return(wand->images);
184WandExport MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand,
185 const double radius,
const double sigma)
190 assert(wand != (MagickWand *) NULL);
191 assert(wand->signature == MagickWandSignature);
192 if (wand->debug != MagickFalse)
193 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
194 if (wand->images == (Image *) NULL)
195 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
196 sharp_image=AdaptiveBlurImage(wand->images,radius,sigma,wand->exception);
197 if (sharp_image == (Image *) NULL)
199 ReplaceImageInList(&wand->images,sharp_image);
229WandExport MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
230 const size_t columns,
const size_t rows)
235 assert(wand != (MagickWand *) NULL);
236 assert(wand->signature == MagickWandSignature);
237 if (wand->debug != MagickFalse)
238 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
239 if (wand->images == (Image *) NULL)
240 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
241 resize_image=AdaptiveResizeImage(wand->images,columns,rows,wand->exception);
242 if (resize_image == (Image *) NULL)
244 ReplaceImageInList(&wand->images,resize_image);
281WandExport MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand,
282 const double radius,
const double sigma)
287 assert(wand != (MagickWand *) NULL);
288 assert(wand->signature == MagickWandSignature);
289 if (wand->debug != MagickFalse)
290 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
291 if (wand->images == (Image *) NULL)
292 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
293 sharp_image=AdaptiveSharpenImage(wand->images,radius,sigma,wand->exception);
294 if (sharp_image == (Image *) NULL)
296 ReplaceImageInList(&wand->images,sharp_image);
332WandExport MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand,
333 const size_t width,
const size_t height,
const double bias)
338 assert(wand != (MagickWand *) NULL);
339 assert(wand->signature == MagickWandSignature);
340 if (wand->debug != MagickFalse)
341 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
342 if (wand->images == (Image *) NULL)
343 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
344 threshold_image=AdaptiveThresholdImage(wand->images,width,height,bias,
346 if (threshold_image == (Image *) NULL)
348 ReplaceImageInList(&wand->images,threshold_image);
391static inline MagickBooleanType InsertImageInWand(MagickWand *wand,
394 if (wand->images == (Image *) NULL)
399 if (wand->insert_before != MagickFalse)
400 wand->images=GetFirstImageInList(images);
402 wand->images=GetLastImageInList(images);
405 if ((wand->insert_before != MagickFalse) &&
406 (wand->images->previous == (Image *) NULL))
411 PrependImageToList(&wand->images,images);
412 wand->images=GetFirstImageInList(images);
420 if (wand->images->next == (Image *) NULL)
425 InsertImageInList(&wand->images,images);
426 wand->images=GetLastImageInList(images);
432 InsertImageInList(&wand->images,images);
436WandExport MagickBooleanType MagickAddImage(MagickWand *wand,
437 const MagickWand *add_wand)
442 assert(wand != (MagickWand *) NULL);
443 assert(wand->signature == MagickWandSignature);
444 if (wand->debug != MagickFalse)
445 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
446 assert(add_wand != (MagickWand *) NULL);
447 assert(add_wand->signature == MagickWandSignature);
448 if (add_wand->images == (Image *) NULL)
449 ThrowWandException(WandError,
"ContainsNoImages",add_wand->name);
453 images=CloneImageList(add_wand->images,wand->exception);
454 if (images == (Image *) NULL)
456 return(InsertImageInWand(wand,images));
487WandExport MagickBooleanType MagickAddNoiseImage(MagickWand *wand,
488 const NoiseType noise_type,
const double attenuate)
493 assert(wand != (MagickWand *) NULL);
494 assert(wand->signature == MagickWandSignature);
495 if (wand->debug != MagickFalse)
496 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
497 if (wand->images == (Image *) NULL)
498 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
499 noise_image=AddNoiseImage(wand->images,noise_type,attenuate,wand->exception);
500 if (noise_image == (Image *) NULL)
502 ReplaceImageInList(&wand->images,noise_image);
532WandExport MagickBooleanType MagickAffineTransformImage(MagickWand *wand,
533 const DrawingWand *drawing_wand)
541 assert(wand != (MagickWand *) NULL);
542 assert(wand->signature == MagickWandSignature);
543 if (wand->debug != MagickFalse)
544 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
545 if (wand->images == (Image *) NULL)
546 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
547 draw_info=PeekDrawingWand(drawing_wand);
548 if (draw_info == (DrawInfo *) NULL)
550 affine_image=AffineTransformImage(wand->images,&draw_info->affine,
552 draw_info=DestroyDrawInfo(draw_info);
553 if (affine_image == (Image *) NULL)
555 ReplaceImageInList(&wand->images,affine_image);
593WandExport MagickBooleanType MagickAnnotateImage(MagickWand *wand,
594 const DrawingWand *drawing_wand,
const double x,
const double y,
595 const double angle,
const char *text)
598 geometry[MagickPathExtent];
606 assert(wand != (MagickWand *) NULL);
607 assert(wand->signature == MagickWandSignature);
608 if (wand->debug != MagickFalse)
609 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
610 if (wand->images == (Image *) NULL)
611 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
612 draw_info=PeekDrawingWand(drawing_wand);
613 if (draw_info == (DrawInfo *) NULL)
615 (void) CloneString(&draw_info->text,text);
616 (void) FormatLocaleString(geometry,MagickPathExtent,
"%+g%+g",x,y);
617 draw_info->affine.sx=cos((
double) DegreesToRadians(fmod(angle,360.0)));
618 draw_info->affine.rx=sin((
double) DegreesToRadians(fmod(angle,360.0)));
619 draw_info->affine.ry=(-sin((
double) DegreesToRadians(fmod(angle,360.0))));
620 draw_info->affine.sy=cos((
double) DegreesToRadians(fmod(angle,360.0)));
621 (void) CloneString(&draw_info->geometry,geometry);
622 status=AnnotateImage(wand->images,draw_info,wand->exception);
623 draw_info=DestroyDrawInfo(draw_info);
652WandExport MagickBooleanType MagickAnimateImages(MagickWand *wand,
653 const char *server_name)
658 assert(wand != (MagickWand *) NULL);
659 assert(wand->signature == MagickWandSignature);
660 if (wand->debug != MagickFalse)
661 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
662 (void) CloneString(&wand->image_info->server_name,server_name);
663 status=AnimateImages(wand->image_info,wand->images,wand->exception);
699WandExport MagickWand *MagickAppendImages(MagickWand *wand,
700 const MagickBooleanType stack)
705 assert(wand != (MagickWand *) NULL);
706 assert(wand->signature == MagickWandSignature);
707 if (wand->debug != MagickFalse)
708 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
709 if (wand->images == (Image *) NULL)
710 return((MagickWand *) NULL);
711 append_image=AppendImages(wand->images,stack,wand->exception);
712 if (append_image == (Image *) NULL)
713 return((MagickWand *) NULL);
714 return(CloneMagickWandFromImages(wand,append_image));
740WandExport MagickBooleanType MagickAutoGammaImage(MagickWand *wand)
745 assert(wand != (MagickWand *) NULL);
746 assert(wand->signature == MagickWandSignature);
747 if (wand->debug != MagickFalse)
748 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
749 if (wand->images == (Image *) NULL)
750 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
751 status=AutoGammaImage(wand->images,wand->exception);
778WandExport MagickBooleanType MagickAutoLevelImage(MagickWand *wand)
783 assert(wand != (MagickWand *) NULL);
784 assert(wand->signature == MagickWandSignature);
785 if (wand->debug != MagickFalse)
786 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
787 if (wand->images == (Image *) NULL)
788 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
789 status=AutoLevelImage(wand->images,wand->exception);
816WandExport MagickBooleanType MagickAutoOrientImage(MagickWand *wand)
822 assert(wand != (MagickWand *) NULL);
823 assert(wand->signature == MagickWandSignature);
824 if (wand->debug != MagickFalse)
825 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
826 if (wand->images == (Image *) NULL)
827 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
828 orient_image=AutoOrientImage(wand->images,wand->images->orientation,
830 if (orient_image == (Image *) NULL)
832 ReplaceImageInList(&wand->images,orient_image);
863WandExport MagickBooleanType MagickAutoThresholdImage(MagickWand *wand,
864 const AutoThresholdMethod method)
866 assert(wand != (MagickWand *) NULL);
867 assert(wand->signature == MagickWandSignature);
868 if (wand->debug != MagickFalse)
869 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
870 if (wand->images == (Image *) NULL)
871 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
872 return(AutoThresholdImage(wand->images,method,wand->exception));
921WandExport MagickBooleanType MagickBilateralBlurImage(MagickWand *wand,
922 const double radius,
const double sigma,
const double intensity_sigma,
923 const double spatial_sigma)
928 assert(wand != (MagickWand *) NULL);
929 assert(wand->signature == MagickWandSignature);
930 if (wand->debug != MagickFalse)
931 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
932 if (wand->images == (Image *) NULL)
933 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
934 blur_image=BilateralBlurImage(wand->images,(
size_t) radius,(
size_t) sigma,
935 intensity_sigma,spatial_sigma,wand->exception);
936 if (blur_image == (Image *) NULL)
938 ReplaceImageInList(&wand->images,blur_image);
969WandExport MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
970 const PixelWand *threshold)
973 thresholds[MagickPathExtent];
975 assert(wand != (MagickWand *) NULL);
976 assert(wand->signature == MagickWandSignature);
977 if (wand->debug != MagickFalse)
978 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
979 if (wand->images == (Image *) NULL)
980 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
981 (void) FormatLocaleString(thresholds,MagickPathExtent,
982 "%g" "," "%g" "," "%g" "," "%g",
983 (
double) PixelGetRedQuantum(threshold),
984 (
double) PixelGetGreenQuantum(threshold),
985 (
double) PixelGetBlueQuantum(threshold),
986 (
double) PixelGetAlphaQuantum(threshold));
987 return(BlackThresholdImage(wand->images,thresholds,wand->exception));
1016WandExport MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
1017 const double factor)
1022 assert(wand != (MagickWand *) NULL);
1023 assert(wand->signature == MagickWandSignature);
1024 if (wand->debug != MagickFalse)
1025 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1026 if (wand->images == (Image *) NULL)
1027 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1028 shift_image=BlueShiftImage(wand->images,factor,wand->exception);
1029 if (shift_image == (Image *) NULL)
1030 return(MagickFalse);
1031 ReplaceImageInList(&wand->images,shift_image);
1066WandExport MagickBooleanType MagickBlurImage(MagickWand *wand,
1067 const double radius,
const double sigma)
1072 assert(wand != (MagickWand *) NULL);
1073 assert(wand->signature == MagickWandSignature);
1074 if (wand->debug != MagickFalse)
1075 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1076 if (wand->images == (Image *) NULL)
1077 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1078 blur_image=BlurImage(wand->images,radius,sigma,wand->exception);
1079 if (blur_image == (Image *) NULL)
1080 return(MagickFalse);
1081 ReplaceImageInList(&wand->images,blur_image);
1118WandExport MagickBooleanType MagickBorderImage(MagickWand *wand,
1119 const PixelWand *bordercolor,
const size_t width,
const size_t height,
1120 const CompositeOperator compose)
1128 assert(wand != (MagickWand *) NULL);
1129 assert(wand->signature == MagickWandSignature);
1130 if (wand->debug != MagickFalse)
1131 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1132 if (wand->images == (Image *) NULL)
1133 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1134 border_info.width=width;
1135 border_info.height=height;
1138 PixelGetQuantumPacket(bordercolor,&wand->images->border_color);
1139 border_image=BorderImage(wand->images,&border_info,compose,wand->exception);
1140 if (border_image == (Image *) NULL)
1141 return(MagickFalse);
1142 ReplaceImageInList(&wand->images,border_image);
1176WandExport MagickBooleanType MagickBrightnessContrastImage(
1177 MagickWand *wand,
const double brightness,
const double contrast)
1182 assert(wand != (MagickWand *) NULL);
1183 assert(wand->signature == MagickWandSignature);
1184 if (wand->debug != MagickFalse)
1185 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1186 if (wand->images == (Image *) NULL)
1187 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1188 status=BrightnessContrastImage(wand->images,brightness,contrast,
1226WandExport MagickBooleanType MagickCannyEdgeImage(MagickWand *wand,
1227 const double radius,
const double sigma,
const double lower_percent,
1228 const double upper_percent)
1233 assert(wand != (MagickWand *) NULL);
1234 assert(wand->signature == MagickWandSignature);
1235 if (wand->debug != MagickFalse)
1236 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1237 if (wand->images == (Image *) NULL)
1238 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1239 edge_image=CannyEdgeImage(wand->images,radius,sigma,lower_percent,
1240 upper_percent,wand->exception);
1241 if (edge_image == (Image *) NULL)
1242 return(MagickFalse);
1243 ReplaceImageInList(&wand->images,edge_image);
1284WandExport MagickWand *MagickChannelFxImage(MagickWand *wand,
1285 const char *expression)
1290 assert(wand != (MagickWand *) NULL);
1291 assert(wand->signature == MagickWandSignature);
1292 if (wand->debug != MagickFalse)
1293 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1294 if (wand->images == (Image *) NULL)
1295 return((MagickWand *) NULL);
1296 fx_image=ChannelFxImage(wand->images,expression,wand->exception);
1297 if (fx_image == (Image *) NULL)
1298 return((MagickWand *) NULL);
1299 return(CloneMagickWandFromImages(wand,fx_image));
1330WandExport MagickBooleanType MagickCharcoalImage(MagickWand *wand,
1331 const double radius,
const double sigma)
1336 assert(wand != (MagickWand *) NULL);
1337 assert(wand->signature == MagickWandSignature);
1338 if (wand->debug != MagickFalse)
1339 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1340 if (wand->images == (Image *) NULL)
1341 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1342 charcoal_image=CharcoalImage(wand->images,radius,sigma,wand->exception);
1343 if (charcoal_image == (Image *) NULL)
1344 return(MagickFalse);
1345 ReplaceImageInList(&wand->images,charcoal_image);
1383WandExport MagickBooleanType MagickChopImage(MagickWand *wand,
1384 const size_t width,
const size_t height,
const ssize_t x,
1393 assert(wand != (MagickWand *) NULL);
1394 assert(wand->signature == MagickWandSignature);
1395 if (wand->debug != MagickFalse)
1396 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1397 if (wand->images == (Image *) NULL)
1398 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1403 chop_image=ChopImage(wand->images,&chop,wand->exception);
1404 if (chop_image == (Image *) NULL)
1405 return(MagickFalse);
1406 ReplaceImageInList(&wand->images,chop_image);
1445WandExport MagickBooleanType MagickCLAHEImage(MagickWand *wand,
1446 const size_t width,
const size_t height,
const double number_bins,
1447 const double clip_limit)
1452 assert(wand != (MagickWand *) NULL);
1453 assert(wand->signature == MagickWandSignature);
1454 if (wand->debug != MagickFalse)
1455 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1456 if (wand->images == (Image *) NULL)
1457 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1458 status=CLAHEImage(wand->images,width,height,(
size_t) number_bins,clip_limit,
1487WandExport MagickBooleanType MagickClampImage(MagickWand *wand)
1489 assert(wand != (MagickWand *) NULL);
1490 assert(wand->signature == MagickWandSignature);
1491 if (wand->debug != MagickFalse)
1492 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1493 if (wand->images == (Image *) NULL)
1494 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1495 return(ClampImage(wand->images,wand->exception));
1521WandExport MagickBooleanType MagickClipImage(MagickWand *wand)
1526 assert(wand != (MagickWand *) NULL);
1527 assert(wand->signature == MagickWandSignature);
1528 if (wand->debug != MagickFalse)
1529 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1530 if (wand->images == (Image *) NULL)
1531 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1532 status=ClipImage(wand->images,wand->exception);
1568WandExport MagickBooleanType MagickClipImagePath(MagickWand *wand,
1569 const char *pathname,
const MagickBooleanType inside)
1574 assert(wand != (MagickWand *) NULL);
1575 assert(wand->signature == MagickWandSignature);
1576 if (wand->debug != MagickFalse)
1577 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1578 if (wand->images == (Image *) NULL)
1579 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1580 status=ClipImagePath(wand->images,pathname,inside,wand->exception);
1611WandExport MagickBooleanType MagickClutImage(MagickWand *wand,
1612 const MagickWand *clut_wand,
const PixelInterpolateMethod method)
1617 assert(wand != (MagickWand *) NULL);
1618 assert(wand->signature == MagickWandSignature);
1619 if (wand->debug != MagickFalse)
1620 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1621 if ((wand->images == (Image *) NULL) || (clut_wand->images == (Image *) NULL))
1622 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1623 status=ClutImage(wand->images,clut_wand->images,method,wand->exception);
1654WandExport MagickWand *MagickCoalesceImages(MagickWand *wand)
1659 assert(wand != (MagickWand *) NULL);
1660 assert(wand->signature == MagickWandSignature);
1661 if (wand->debug != MagickFalse)
1662 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1663 if (wand->images == (Image *) NULL)
1664 return((MagickWand *) NULL);
1665 coalesce_image=CoalesceImages(wand->images,wand->exception);
1666 if (coalesce_image == (Image *) NULL)
1667 return((MagickWand *) NULL);
1668 return(CloneMagickWandFromImages(wand,coalesce_image));
1714WandExport MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
1715 const char *color_correction_collection)
1720 assert(wand != (MagickWand *) NULL);
1721 assert(wand->signature == MagickWandSignature);
1722 if (wand->debug != MagickFalse)
1723 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1724 if (wand->images == (Image *) NULL)
1725 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1726 status=ColorDecisionListImage(wand->images,color_correction_collection,
1758WandExport MagickBooleanType MagickColorizeImage(MagickWand *wand,
1759 const PixelWand *colorize,
const PixelWand *blend)
1762 percent_blend[MagickPathExtent];
1770 assert(wand != (MagickWand *) NULL);
1771 assert(wand->signature == MagickWandSignature);
1772 if (wand->debug != MagickFalse)
1773 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1774 if (wand->images == (Image *) NULL)
1775 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1776 GetPixelInfo(wand->images,&target);
1777 if (target.colorspace != CMYKColorspace)
1778 (void) FormatLocaleString(percent_blend,MagickPathExtent,
1779 "%g,%g,%g,%g",(
double) (100.0*QuantumScale*
1780 (
double) PixelGetRedQuantum(blend)),(
double) (100.0*QuantumScale*
1781 (
double) PixelGetGreenQuantum(blend)),(
double) (100.0*QuantumScale*
1782 (
double) PixelGetBlueQuantum(blend)),(
double) (100.0*QuantumScale*
1783 (
double) PixelGetAlphaQuantum(blend)));
1785 (
void) FormatLocaleString(percent_blend,MagickPathExtent,
1786 "%g,%g,%g,%g,%g",(
double) (100.0*QuantumScale*
1787 (
double) PixelGetRedQuantum(blend)),(
double) (100.0*QuantumScale*
1788 (
double) PixelGetGreenQuantum(blend)),(
double) (100.0*QuantumScale*
1789 (
double) PixelGetBlueQuantum(blend)),(
double) (100.0*QuantumScale*
1790 (
double) PixelGetBlackQuantum(blend)),(
double) (100.0*QuantumScale*
1791 (
double) PixelGetAlphaQuantum(blend)));
1792 target=PixelGetPixel(colorize);
1793 colorize_image=ColorizeImage(wand->images,percent_blend,&target,
1795 if (colorize_image == (Image *) NULL)
1796 return(MagickFalse);
1797 ReplaceImageInList(&wand->images,colorize_image);
1832WandExport MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
1833 const KernelInfo *color_matrix)
1838 assert(wand != (MagickWand *) NULL);
1839 assert(wand->signature == MagickWandSignature);
1840 if (wand->debug != MagickFalse)
1841 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1842 if (color_matrix == (
const KernelInfo *) NULL)
1843 return(MagickFalse);
1844 if (wand->images == (Image *) NULL)
1845 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1846 color_image=ColorMatrixImage(wand->images,color_matrix,wand->exception);
1847 if (color_image == (Image *) NULL)
1848 return(MagickFalse);
1849 ReplaceImageInList(&wand->images,color_image);
1881WandExport MagickBooleanType MagickColorThresholdImage(MagickWand *wand,
1882 const PixelWand *start_color,
const PixelWand *stop_color)
1888 assert(wand != (MagickWand *) NULL);
1889 assert(wand->signature == MagickWandSignature);
1890 if (wand->debug != MagickFalse)
1891 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1892 if (wand->images == (Image *) NULL)
1893 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1894 PixelGetMagickColor(start_color,&start);
1895 PixelGetMagickColor(stop_color,&stop);
1896 return(ColorThresholdImage(wand->images,&start,&stop,wand->exception));
1927WandExport MagickWand *MagickCombineImages(MagickWand *wand,
1928 const ColorspaceType colorspace)
1933 assert(wand != (MagickWand *) NULL);
1934 assert(wand->signature == MagickWandSignature);
1935 if (wand->debug != MagickFalse)
1936 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1937 if (wand->images == (Image *) NULL)
1938 return((MagickWand *) NULL);
1939 combine_image=CombineImages(wand->images,colorspace,wand->exception);
1940 if (combine_image == (Image *) NULL)
1941 return((MagickWand *) NULL);
1942 return(CloneMagickWandFromImages(wand,combine_image));
1970WandExport MagickBooleanType MagickCommentImage(MagickWand *wand,
1971 const char *comment)
1976 assert(wand != (MagickWand *) NULL);
1977 assert(wand->signature == MagickWandSignature);
1978 if (wand->debug != MagickFalse)
1979 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1980 if (wand->images == (Image *) NULL)
1981 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1982 status=SetImageProperty(wand->images,
"comment",comment,wand->exception);
2013WandExport MagickWand *MagickCompareImagesLayers(MagickWand *wand,
2014 const LayerMethod method)
2019 assert(wand != (MagickWand *) NULL);
2020 assert(wand->signature == MagickWandSignature);
2021 if (wand->debug != MagickFalse)
2022 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2023 if (wand->images == (Image *) NULL)
2024 return((MagickWand *) NULL);
2025 layers_image=CompareImagesLayers(wand->images,method,wand->exception);
2026 if (layers_image == (Image *) NULL)
2027 return((MagickWand *) NULL);
2028 return(CloneMagickWandFromImages(wand,layers_image));
2062WandExport MagickWand *MagickCompareImages(MagickWand *wand,
2063 const MagickWand *reference,
const MetricType metric,
double *distortion)
2069 assert(wand != (MagickWand *) NULL);
2070 assert(wand->signature == MagickWandSignature);
2071 if (wand->debug != MagickFalse)
2072 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2073 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
2075 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
2076 "ContainsNoImages",
"`%s'",wand->name);
2077 return((MagickWand *) NULL);
2079 compare_image=CompareImages(wand->images,reference->images,metric,distortion,
2081 if (compare_image == (Image *) NULL)
2082 return((MagickWand *) NULL);
2083 return(CloneMagickWandFromImages(wand,compare_image));
2114WandExport MagickWand *MagickComplexImages(MagickWand *wand,
2115 const ComplexOperator op)
2120 assert(wand != (MagickWand *) NULL);
2121 assert(wand->signature == MagickWandSignature);
2122 if (wand->debug != MagickFalse)
2123 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2124 if (wand->images == (Image *) NULL)
2125 return((MagickWand *) NULL);
2126 complex_image=ComplexImages(wand->images,op,wand->exception);
2127 if (complex_image == (Image *) NULL)
2128 return((MagickWand *) NULL);
2129 return(CloneMagickWandFromImages(wand,complex_image));
2175WandExport MagickBooleanType MagickCompositeImage(MagickWand *wand,
2176 const MagickWand *source_wand,
const CompositeOperator compose,
2177 const MagickBooleanType clip_to_self,
const ssize_t x,
const ssize_t y)
2182 assert(wand != (MagickWand *) NULL);
2183 assert(wand->signature == MagickWandSignature);
2184 if (wand->debug != MagickFalse)
2185 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2186 if ((wand->images == (Image *) NULL) ||
2187 (source_wand->images == (Image *) NULL))
2188 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2189 status=CompositeImage(wand->images,source_wand->images,compose,clip_to_self,
2190 x,y,wand->exception);
2236WandExport MagickBooleanType MagickCompositeImageGravity(MagickWand *wand,
2237 const MagickWand *source_wand,
const CompositeOperator compose,
2238 const GravityType gravity)
2246 assert(wand != (MagickWand *) NULL);
2247 assert(wand->signature == MagickWandSignature);
2248 if (wand->debug != MagickFalse)
2249 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2250 if ((wand->images == (Image *) NULL) ||
2251 (source_wand->images == (Image *) NULL))
2252 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2253 SetGeometry(source_wand->images,&geometry);
2254 GravityAdjustGeometry(wand->images->columns,wand->images->rows,gravity,
2256 status=CompositeImage(wand->images,source_wand->images,compose,MagickTrue,
2257 geometry.x,geometry.y,wand->exception);
2314WandExport MagickBooleanType MagickCompositeLayers(MagickWand *wand,
2315 const MagickWand *source_wand,
const CompositeOperator compose,
2316 const ssize_t x,
const ssize_t y)
2321 assert(wand != (MagickWand *) NULL);
2322 assert(wand->signature == MagickWandSignature);
2323 if (wand->debug != MagickFalse)
2324 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2325 if ((wand->images == (Image *) NULL) ||
2326 (source_wand->images == (Image *) NULL))
2327 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2328 CompositeLayers(wand->images,compose,source_wand->images,x,y,wand->exception);
2363WandExport MagickBooleanType MagickConnectedComponentsImage(MagickWand *wand,
2364 const size_t connectivity,CCObjectInfo **objects)
2367 *connected_components_image;
2369 assert(wand != (MagickWand *) NULL);
2370 assert(wand->signature == MagickWandSignature);
2371 if (wand->debug != MagickFalse)
2372 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2373 if (wand->images == (Image *) NULL)
2374 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2375 connected_components_image=ConnectedComponentsImage(wand->images,connectivity,
2376 objects,wand->exception);
2377 if (connected_components_image == (Image *) NULL)
2378 return(MagickFalse);
2379 ReplaceImageInList(&wand->images,connected_components_image);
2411WandExport MagickBooleanType MagickContrastImage(MagickWand *wand,
2412 const MagickBooleanType sharpen)
2417 assert(wand != (MagickWand *) NULL);
2418 assert(wand->signature == MagickWandSignature);
2419 if (wand->debug != MagickFalse)
2420 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2421 if (wand->images == (Image *) NULL)
2422 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2423 status=ContrastImage(wand->images,sharpen,wand->exception);
2457WandExport MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
2458 const double black_point,
const double white_point)
2463 assert(wand != (MagickWand *) NULL);
2464 assert(wand->signature == MagickWandSignature);
2465 if (wand->debug != MagickFalse)
2466 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2467 if (wand->images == (Image *) NULL)
2468 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2469 status=ContrastStretchImage(wand->images,black_point,white_point,
2499WandExport MagickBooleanType MagickConvolveImage(MagickWand *wand,
2500 const KernelInfo *kernel)
2505 assert(wand != (MagickWand *) NULL);
2506 assert(wand->signature == MagickWandSignature);
2507 if (wand->debug != MagickFalse)
2508 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2509 if (kernel == (
const KernelInfo *) NULL)
2510 return(MagickFalse);
2511 if (wand->images == (Image *) NULL)
2512 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2513 filter_image=ConvolveImage(wand->images,kernel,wand->exception);
2514 if (filter_image == (Image *) NULL)
2515 return(MagickFalse);
2516 ReplaceImageInList(&wand->images,filter_image);
2551WandExport MagickBooleanType MagickCropImage(MagickWand *wand,
2552 const size_t width,
const size_t height,
const ssize_t x,
const ssize_t y)
2560 assert(wand != (MagickWand *) NULL);
2561 assert(wand->signature == MagickWandSignature);
2562 if (wand->debug != MagickFalse)
2563 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2564 if (wand->images == (Image *) NULL)
2565 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2570 crop_image=CropImage(wand->images,&crop,wand->exception);
2571 if (crop_image == (Image *) NULL)
2572 return(MagickFalse);
2573 ReplaceImageInList(&wand->images,crop_image);
2604WandExport MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
2605 const ssize_t displace)
2610 assert(wand != (MagickWand *) NULL);
2611 assert(wand->signature == MagickWandSignature);
2612 if (wand->debug != MagickFalse)
2613 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2614 if (wand->images == (Image *) NULL)
2615 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2616 status=CycleColormapImage(wand->images,displace,wand->exception);
2672WandExport MagickBooleanType MagickConstituteImage(MagickWand *wand,
2673 const size_t columns,
const size_t rows,
const char *map,
2674 const StorageType storage,
const void *pixels)
2679 assert(wand != (MagickWand *) NULL);
2680 assert(wand->signature == MagickWandSignature);
2681 if (wand->debug != MagickFalse)
2682 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2683 images=ConstituteImage(columns,rows,map,storage,pixels,wand->exception);
2684 if (images == (Image *) NULL)
2685 return(MagickFalse);
2686 return(InsertImageInWand(wand,images));
2714WandExport MagickBooleanType MagickDecipherImage(MagickWand *wand,
2715 const char *passphrase)
2717 assert(wand != (MagickWand *) NULL);
2718 assert(wand->signature == MagickWandSignature);
2719 if (wand->debug != MagickFalse)
2720 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2721 if (wand->images == (Image *) NULL)
2722 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2723 return(DecipherImage(wand->images,passphrase,wand->exception));
2750WandExport MagickWand *MagickDeconstructImages(MagickWand *wand)
2755 assert(wand != (MagickWand *) NULL);
2756 assert(wand->signature == MagickWandSignature);
2757 if (wand->debug != MagickFalse)
2758 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2759 if (wand->images == (Image *) NULL)
2760 return((MagickWand *) NULL);
2761 deconstruct_image=CompareImagesLayers(wand->images,CompareAnyLayer,
2763 if (deconstruct_image == (Image *) NULL)
2764 return((MagickWand *) NULL);
2765 return(CloneMagickWandFromImages(wand,deconstruct_image));
2796WandExport MagickBooleanType MagickDeskewImage(MagickWand *wand,
2797 const double threshold)
2802 assert(wand != (MagickWand *) NULL);
2803 assert(wand->signature == MagickWandSignature);
2804 if (wand->debug != MagickFalse)
2805 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2806 if (wand->images == (Image *) NULL)
2807 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2808 sepia_image=DeskewImage(wand->images,threshold,wand->exception);
2809 if (sepia_image == (Image *) NULL)
2810 return(MagickFalse);
2811 ReplaceImageInList(&wand->images,sepia_image);
2838WandExport MagickBooleanType MagickDespeckleImage(MagickWand *wand)
2843 assert(wand != (MagickWand *) NULL);
2844 assert(wand->signature == MagickWandSignature);
2845 if (wand->debug != MagickFalse)
2846 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2847 if (wand->images == (Image *) NULL)
2848 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2849 despeckle_image=DespeckleImage(wand->images,wand->exception);
2850 if (despeckle_image == (Image *) NULL)
2851 return(MagickFalse);
2852 ReplaceImageInList(&wand->images,despeckle_image);
2879WandExport Image *MagickDestroyImage(Image *image)
2881 return(DestroyImage(image));
2909WandExport MagickBooleanType MagickDisplayImage(MagickWand *wand,
2910 const char *server_name)
2918 assert(wand != (MagickWand *) NULL);
2919 assert(wand->signature == MagickWandSignature);
2920 if (wand->debug != MagickFalse)
2921 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2922 if (wand->images == (Image *) NULL)
2923 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2924 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
2925 if (image == (Image *) NULL)
2926 return(MagickFalse);
2927 (void) CloneString(&wand->image_info->server_name,server_name);
2928 status=DisplayImages(wand->image_info,image,wand->exception);
2929 image=DestroyImage(image);
2958WandExport MagickBooleanType MagickDisplayImages(MagickWand *wand,
2959 const char *server_name)
2964 assert(wand != (MagickWand *) NULL);
2965 assert(wand->signature == MagickWandSignature);
2966 if (wand->debug != MagickFalse)
2967 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2968 (void) CloneString(&wand->image_info->server_name,server_name);
2969 status=DisplayImages(wand->image_info,wand->images,wand->exception);
3033WandExport MagickBooleanType MagickDistortImage(MagickWand *wand,
3034 const DistortMethod method,
const size_t number_arguments,
3035 const double *arguments,
const MagickBooleanType bestfit)
3040 assert(wand != (MagickWand *) NULL);
3041 assert(wand->signature == MagickWandSignature);
3042 if (wand->debug != MagickFalse)
3043 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3044 if (wand->images == (Image *) NULL)
3045 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3046 distort_image=DistortImage(wand->images,method,number_arguments,arguments,
3047 bestfit,wand->exception);
3048 if (distort_image == (Image *) NULL)
3049 return(MagickFalse);
3050 ReplaceImageInList(&wand->images,distort_image);
3079WandExport MagickBooleanType MagickDrawImage(MagickWand *wand,
3080 const DrawingWand *drawing_wand)
3091 assert(wand != (MagickWand *) NULL);
3092 assert(wand->signature == MagickWandSignature);
3093 if (wand->debug != MagickFalse)
3094 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3095 if (wand->images == (Image *) NULL)
3096 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3097 draw_info=PeekDrawingWand(drawing_wand);
3098 if ((draw_info == (DrawInfo *) NULL) ||
3099 (draw_info->primitive == (
char *) NULL))
3100 return(MagickFalse);
3101 primitive=AcquireString(draw_info->primitive);
3102 draw_info=DestroyDrawInfo(draw_info);
3103 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
3104 draw_info->primitive=primitive;
3105 status=DrawImage(wand->images,draw_info,wand->exception);
3106 draw_info=DestroyDrawInfo(draw_info);
3136WandExport MagickBooleanType MagickEdgeImage(MagickWand *wand,
3137 const double radius)
3142 assert(wand != (MagickWand *) NULL);
3143 assert(wand->signature == MagickWandSignature);
3144 if (wand->debug != MagickFalse)
3145 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3146 if (wand->images == (Image *) NULL)
3147 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3148 edge_image=EdgeImage(wand->images,radius,wand->exception);
3149 if (edge_image == (Image *) NULL)
3150 return(MagickFalse);
3151 ReplaceImageInList(&wand->images,edge_image);
3187WandExport MagickBooleanType MagickEmbossImage(MagickWand *wand,
3188 const double radius,
const double sigma)
3193 assert(wand != (MagickWand *) NULL);
3194 assert(wand->signature == MagickWandSignature);
3195 if (wand->debug != MagickFalse)
3196 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3197 if (wand->images == (Image *) NULL)
3198 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3199 emboss_image=EmbossImage(wand->images,radius,sigma,wand->exception);
3200 if (emboss_image == (Image *) NULL)
3201 return(MagickFalse);
3202 ReplaceImageInList(&wand->images,emboss_image);
3231WandExport MagickBooleanType MagickEncipherImage(MagickWand *wand,
3232 const char *passphrase)
3234 assert(wand != (MagickWand *) NULL);
3235 assert(wand->signature == MagickWandSignature);
3236 if (wand->debug != MagickFalse)
3237 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3238 if (wand->images == (Image *) NULL)
3239 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3240 return(EncipherImage(wand->images,passphrase,wand->exception));
3266WandExport MagickBooleanType MagickEnhanceImage(MagickWand *wand)
3271 assert(wand != (MagickWand *) NULL);
3272 assert(wand->signature == MagickWandSignature);
3273 if (wand->debug != MagickFalse)
3274 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3275 if (wand->images == (Image *) NULL)
3276 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3277 enhance_image=EnhanceImage(wand->images,wand->exception);
3278 if (enhance_image == (Image *) NULL)
3279 return(MagickFalse);
3280 ReplaceImageInList(&wand->images,enhance_image);
3308WandExport MagickBooleanType MagickEqualizeImage(MagickWand *wand)
3313 assert(wand != (MagickWand *) NULL);
3314 assert(wand->signature == MagickWandSignature);
3315 if (wand->debug != MagickFalse)
3316 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3317 if (wand->images == (Image *) NULL)
3318 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3319 status=EqualizeImage(wand->images,wand->exception);
3356WandExport MagickWand *MagickEvaluateImages(MagickWand *wand,
3357 const MagickEvaluateOperator op)
3362 assert(wand != (MagickWand *) NULL);
3363 assert(wand->signature == MagickWandSignature);
3364 if (wand->debug != MagickFalse)
3365 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3366 if (wand->images == (Image *) NULL)
3367 return((MagickWand *) NULL);
3368 evaluate_image=EvaluateImages(wand->images,op,wand->exception);
3369 if (evaluate_image == (Image *) NULL)
3370 return((MagickWand *) NULL);
3371 return(CloneMagickWandFromImages(wand,evaluate_image));
3374WandExport MagickBooleanType MagickEvaluateImage(MagickWand *wand,
3375 const MagickEvaluateOperator op,
const double value)
3380 assert(wand != (MagickWand *) NULL);
3381 assert(wand->signature == MagickWandSignature);
3382 if (wand->debug != MagickFalse)
3383 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3384 if (wand->images == (Image *) NULL)
3385 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3386 status=EvaluateImage(wand->images,op,value,wand->exception);
3441WandExport MagickBooleanType MagickExportImagePixels(MagickWand *wand,
3442 const ssize_t x,
const ssize_t y,
const size_t columns,
3443 const size_t rows,
const char *map,
const StorageType storage,
3449 assert(wand != (MagickWand *) NULL);
3450 assert(wand->signature == MagickWandSignature);
3451 if (wand->debug != MagickFalse)
3452 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3453 if (wand->images == (Image *) NULL)
3454 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3455 status=ExportImagePixels(wand->images,x,y,columns,rows,map,
3456 storage,pixels,wand->exception);
3493WandExport MagickBooleanType MagickExtentImage(MagickWand *wand,
3494 const size_t width,
const size_t height,
const ssize_t x,
const ssize_t y)
3502 assert(wand != (MagickWand *) NULL);
3503 assert(wand->signature == MagickWandSignature);
3504 if (wand->debug != MagickFalse)
3505 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3506 if (wand->images == (Image *) NULL)
3507 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3509 extent.height=height;
3512 extent_image=ExtentImage(wand->images,&extent,wand->exception);
3513 if (extent_image == (Image *) NULL)
3514 return(MagickFalse);
3515 ReplaceImageInList(&wand->images,extent_image);
3542WandExport MagickBooleanType MagickFlipImage(MagickWand *wand)
3547 assert(wand != (MagickWand *) NULL);
3548 assert(wand->signature == MagickWandSignature);
3549 if (wand->debug != MagickFalse)
3550 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3551 if (wand->images == (Image *) NULL)
3552 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3553 flip_image=FlipImage(wand->images,wand->exception);
3554 if (flip_image == (Image *) NULL)
3555 return(MagickFalse);
3556 ReplaceImageInList(&wand->images,flip_image);
3602WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
3603 const PixelWand *fill,
const double fuzz,
const PixelWand *bordercolor,
3604 const ssize_t x,
const ssize_t y,
const MagickBooleanType invert)
3615 assert(wand != (MagickWand *) NULL);
3616 assert(wand->signature == MagickWandSignature);
3617 if (wand->debug != MagickFalse)
3618 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3619 if (wand->images == (Image *) NULL)
3620 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3621 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
3622 PixelGetQuantumPacket(fill,&draw_info->fill);
3623 (void) GetOneVirtualPixelInfo(wand->images,TileVirtualPixelMethod,x %
3624 (ssize_t) wand->images->columns,y % (ssize_t) wand->images->rows,&target,
3626 if (bordercolor != (PixelWand *) NULL)
3627 PixelGetMagickColor(bordercolor,&target);
3628 wand->images->fuzz=fuzz;
3629 status=FloodfillPaintImage(wand->images,draw_info,&target,x,y,invert,
3631 draw_info=DestroyDrawInfo(draw_info);
3658WandExport MagickBooleanType MagickFlopImage(MagickWand *wand)
3663 assert(wand != (MagickWand *) NULL);
3664 assert(wand->signature == MagickWandSignature);
3665 if (wand->debug != MagickFalse)
3666 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3667 if (wand->images == (Image *) NULL)
3668 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3669 flop_image=FlopImage(wand->images,wand->exception);
3670 if (flop_image == (Image *) NULL)
3671 return(MagickFalse);
3672 ReplaceImageInList(&wand->images,flop_image);
3704WandExport MagickBooleanType MagickForwardFourierTransformImage(
3705 MagickWand *wand,
const MagickBooleanType magnitude)
3710 assert(wand != (MagickWand *) NULL);
3711 assert(wand->signature == MagickWandSignature);
3712 if (wand->debug != MagickFalse)
3713 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3714 if (wand->images == (Image *) NULL)
3715 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3716 forward_image=ForwardFourierTransformImage(wand->images,magnitude,
3718 if (forward_image == (Image *) NULL)
3719 return(MagickFalse);
3720 ReplaceImageInList(&wand->images,forward_image);
3764WandExport MagickBooleanType MagickFrameImage(MagickWand *wand,
3765 const PixelWand *matte_color,
const size_t width,
const size_t height,
3766 const ssize_t inner_bevel,
const ssize_t outer_bevel,
3767 const CompositeOperator compose)
3775 assert(wand != (MagickWand *) NULL);
3776 assert(wand->signature == MagickWandSignature);
3777 if (wand->debug != MagickFalse)
3778 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3779 if (wand->images == (Image *) NULL)
3780 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3781 (void) memset(&frame_info,0,
sizeof(frame_info));
3782 frame_info.width=wand->images->columns+2*width;
3783 frame_info.height=wand->images->rows+2*height;
3784 frame_info.x=(ssize_t) width;
3785 frame_info.y=(ssize_t) height;
3786 frame_info.inner_bevel=inner_bevel;
3787 frame_info.outer_bevel=outer_bevel;
3788 PixelGetQuantumPacket(matte_color,&wand->images->matte_color);
3789 frame_image=FrameImage(wand->images,&frame_info,compose,wand->exception);
3790 if (frame_image == (Image *) NULL)
3791 return(MagickFalse);
3792 ReplaceImageInList(&wand->images,frame_image);
3829WandExport MagickBooleanType MagickFunctionImage(MagickWand *wand,
3830 const MagickFunction function,
const size_t number_arguments,
3831 const double *arguments)
3836 assert(wand != (MagickWand *) NULL);
3837 assert(wand->signature == MagickWandSignature);
3838 if (wand->debug != MagickFalse)
3839 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3840 if (wand->images == (Image *) NULL)
3841 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3842 status=FunctionImage(wand->images,function,number_arguments,arguments,
3871WandExport MagickWand *MagickFxImage(MagickWand *wand,
const char *expression)
3876 assert(wand != (MagickWand *) NULL);
3877 assert(wand->signature == MagickWandSignature);
3878 if (wand->debug != MagickFalse)
3879 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3880 if (wand->images == (Image *) NULL)
3881 return((MagickWand *) NULL);
3882 fx_image=FxImage(wand->images,expression,wand->exception);
3883 if (fx_image == (Image *) NULL)
3884 return((MagickWand *) NULL);
3885 return(CloneMagickWandFromImages(wand,fx_image));
3919WandExport MagickBooleanType MagickGammaImage(MagickWand *wand,
3925 assert(wand != (MagickWand *) NULL);
3926 assert(wand->signature == MagickWandSignature);
3927 if (wand->debug != MagickFalse)
3928 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3929 if (wand->images == (Image *) NULL)
3930 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3931 status=GammaImage(wand->images,gamma,wand->exception);
3966WandExport MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
3967 const double radius,
const double sigma)
3972 assert(wand != (MagickWand *) NULL);
3973 assert(wand->signature == MagickWandSignature);
3974 if (wand->debug != MagickFalse)
3975 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3976 if (wand->images == (Image *) NULL)
3977 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3978 blur_image=GaussianBlurImage(wand->images,radius,sigma,wand->exception);
3979 if (blur_image == (Image *) NULL)
3980 return(MagickFalse);
3981 ReplaceImageInList(&wand->images,blur_image);
4007WandExport MagickWand *MagickGetImage(MagickWand *wand)
4012 assert(wand != (MagickWand *) NULL);
4013 assert(wand->signature == MagickWandSignature);
4014 if (wand->debug != MagickFalse)
4015 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4016 if (wand->images == (Image *) NULL)
4018 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4019 "ContainsNoImages",
"`%s'",wand->name);
4020 return((MagickWand *) NULL);
4022 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
4023 if (image == (Image *) NULL)
4024 return((MagickWand *) NULL);
4025 return(CloneMagickWandFromImages(wand,image));
4052WandExport MagickBooleanType MagickGetImageAlphaChannel(MagickWand *wand)
4054 assert(wand != (MagickWand *) NULL);
4055 assert(wand->signature == MagickWandSignature);
4056 if (wand->debug != MagickFalse)
4057 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4058 if (wand->images == (Image *) NULL)
4059 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4060 return(GetImageAlphaChannel(wand->images));
4087WandExport MagickWand *MagickGetImageMask(MagickWand *wand,
4088 const PixelMask type)
4093 assert(wand != (MagickWand *) NULL);
4094 assert(wand->signature == MagickWandSignature);
4095 if (wand->debug != MagickFalse)
4096 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4097 if (wand->images == (Image *) NULL)
4099 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4100 "ContainsNoImages",
"`%s'",wand->name);
4101 return((MagickWand *) NULL);
4103 image=GetImageMask(wand->images,type,wand->exception);
4104 if (image == (Image *) NULL)
4105 return((MagickWand *) NULL);
4106 return(CloneMagickWandFromImages(wand,image));
4134WandExport MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
4135 PixelWand *background_color)
4137 assert(wand != (MagickWand *) NULL);
4138 assert(wand->signature == MagickWandSignature);
4139 if (wand->debug != MagickFalse)
4140 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4141 if (wand->images == (Image *) NULL)
4142 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4143 PixelSetPixelColor(background_color,&wand->images->background_color);
4179WandExport
unsigned char *MagickGetImageBlob(MagickWand *wand,
size_t *length)
4184 assert(wand != (MagickWand *) NULL);
4185 assert(wand->signature == MagickWandSignature);
4186 if (wand->debug != MagickFalse)
4187 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4188 if (wand->images == (Image *) NULL)
4190 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4191 "ContainsNoImages",
"`%s'",wand->name);
4192 return((
unsigned char *) NULL);
4194 blob=(
unsigned char *) ImageToBlob(wand->image_info,wand->images,length,
4230WandExport
unsigned char *MagickGetImagesBlob(MagickWand *wand,
size_t *length)
4235 assert(wand != (MagickWand *) NULL);
4236 assert(wand->signature == MagickWandSignature);
4237 if (wand->debug != MagickFalse)
4238 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4239 if (wand->images == (Image *) NULL)
4241 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4242 "ContainsNoImages",
"`%s'",wand->name);
4243 return((
unsigned char *) NULL);
4245 blob=(
unsigned char *) ImagesToBlob(wand->image_info,GetFirstImageInList(
4246 wand->images),length,wand->exception);
4280WandExport MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,
4281 double *x,
double *y,
double *z)
4283 assert(wand != (MagickWand *) NULL);
4284 assert(wand->signature == MagickWandSignature);
4285 if (wand->debug != MagickFalse)
4286 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4287 if (wand->images == (Image *) NULL)
4288 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4289 *x=wand->images->chromaticity.blue_primary.x;
4290 *y=wand->images->chromaticity.blue_primary.y;
4291 *z=wand->images->chromaticity.blue_primary.z;
4320WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
4321 PixelWand *border_color)
4323 assert(wand != (MagickWand *) NULL);
4324 assert(wand->signature == MagickWandSignature);
4325 if (wand->debug != MagickFalse)
4326 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4327 if (wand->images == (Image *) NULL)
4328 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4329 PixelSetPixelColor(border_color,&wand->images->border_color);
4371WandExport ChannelFeatures *MagickGetImageFeatures(MagickWand *wand,
4372 const size_t distance)
4374 assert(wand != (MagickWand *) NULL);
4375 assert(wand->signature == MagickWandSignature);
4376 if (wand->debug != MagickFalse)
4377 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4378 if (wand->images == (Image *) NULL)
4380 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4381 "ContainsNoImages",
"`%s'",wand->name);
4382 return((ChannelFeatures *) NULL);
4384 return(GetImageFeatures(wand->images,distance,wand->exception));
4415WandExport MagickBooleanType MagickGetImageKurtosis(MagickWand *wand,
4416 double *kurtosis,
double *skewness)
4421 assert(wand != (MagickWand *) NULL);
4422 assert(wand->signature == MagickWandSignature);
4423 if (wand->debug != MagickFalse)
4424 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4425 if (wand->images == (Image *) NULL)
4426 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4427 status=GetImageKurtosis(wand->images,kurtosis,skewness,wand->exception);
4461WandExport MagickBooleanType MagickGetImageMean(MagickWand *wand,
double *mean,
4462 double *standard_deviation)
4467 assert(wand != (MagickWand *) NULL);
4468 assert(wand->signature == MagickWandSignature);
4469 if (wand->debug != MagickFalse)
4470 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4471 if (wand->images == (Image *) NULL)
4472 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4473 status=GetImageMean(wand->images,mean,standard_deviation,wand->exception);
4504WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand,
4505 double *minima,
double *maxima)
4510 assert(wand != (MagickWand *) NULL);
4511 assert(wand->signature == MagickWandSignature);
4512 if (wand->debug != MagickFalse)
4513 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4514 if (wand->images == (Image *) NULL)
4515 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4516 status=GetImageRange(wand->images,minima,maxima,wand->exception);
4550WandExport ChannelStatistics *MagickGetImageStatistics(MagickWand *wand)
4552 assert(wand != (MagickWand *) NULL);
4553 assert(wand->signature == MagickWandSignature);
4554 if (wand->debug != MagickFalse)
4555 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4556 if (wand->images == (Image *) NULL)
4558 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4559 "ContainsNoImages",
"`%s'",wand->name);
4560 return((ChannelStatistics *) NULL);
4562 return(GetImageStatistics(wand->images,wand->exception));
4593WandExport MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
4594 const size_t index,PixelWand *color)
4596 assert(wand != (MagickWand *) NULL);
4597 assert(wand->signature == MagickWandSignature);
4598 if (wand->debug != MagickFalse)
4599 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4600 if (wand->images == (Image *) NULL)
4601 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4602 if ((wand->images->colormap == (PixelInfo *) NULL) ||
4603 (index >= wand->images->colors))
4605 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4606 "InvalidColormapIndex",
"`%s'",wand->name);
4607 return(MagickFalse);
4609 PixelSetPixelColor(color,wand->images->colormap+index);
4635WandExport
size_t MagickGetImageColors(MagickWand *wand)
4637 assert(wand != (MagickWand *) NULL);
4638 assert(wand->signature == MagickWandSignature);
4639 if (wand->debug != MagickFalse)
4640 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4641 if (wand->images == (Image *) NULL)
4643 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4644 "ContainsNoImages",
"`%s'",wand->name);
4647 return(GetNumberColors(wand->images,(FILE *) NULL,wand->exception));
4672WandExport ColorspaceType MagickGetImageColorspace(MagickWand *wand)
4674 assert(wand != (MagickWand *) NULL);
4675 assert(wand->signature == MagickWandSignature);
4676 if (wand->debug != MagickFalse)
4677 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4678 if (wand->images == (Image *) NULL)
4680 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4681 "ContainsNoImages",
"`%s'",wand->name);
4682 return(UndefinedColorspace);
4684 return(wand->images->colorspace);
4710WandExport CompositeOperator MagickGetImageCompose(MagickWand *wand)
4712 assert(wand != (MagickWand *) NULL);
4713 assert(wand->signature == MagickWandSignature);
4714 if (wand->debug != MagickFalse)
4715 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4716 if (wand->images == (Image *) NULL)
4718 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4719 "ContainsNoImages",
"`%s'",wand->name);
4720 return(UndefinedCompositeOp);
4722 return(wand->images->compose);
4747WandExport CompressionType MagickGetImageCompression(MagickWand *wand)
4749 assert(wand != (MagickWand *) NULL);
4750 assert(wand->signature == MagickWandSignature);
4751 if (wand->debug != MagickFalse)
4752 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4753 if (wand->images == (Image *) NULL)
4755 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4756 "ContainsNoImages",
"`%s'",wand->name);
4757 return(UndefinedCompression);
4759 return(wand->images->compression);
4784WandExport
size_t MagickGetImageCompressionQuality(MagickWand *wand)
4786 assert(wand != (MagickWand *) NULL);
4787 assert(wand->signature == MagickWandSignature);
4788 if (wand->debug != MagickFalse)
4789 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4790 if (wand->images == (Image *) NULL)
4792 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4793 "ContainsNoImages",
"`%s'",wand->name);
4796 return(wand->images->quality);
4821WandExport
size_t MagickGetImageDelay(MagickWand *wand)
4823 assert(wand != (MagickWand *) NULL);
4824 assert(wand->signature == MagickWandSignature);
4825 if (wand->debug != MagickFalse)
4826 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4827 if (wand->images == (Image *) NULL)
4828 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4829 return(wand->images->delay);
4854WandExport
size_t MagickGetImageDepth(MagickWand *wand)
4856 assert(wand != (MagickWand *) NULL);
4857 assert(wand->signature == MagickWandSignature);
4858 if (wand->debug != MagickFalse)
4859 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4860 if (wand->images == (Image *) NULL)
4861 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4862 return(wand->images->depth);
4887WandExport DisposeType MagickGetImageDispose(MagickWand *wand)
4889 assert(wand != (MagickWand *) NULL);
4890 assert(wand->signature == MagickWandSignature);
4891 if (wand->debug != MagickFalse)
4892 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4893 if (wand->images == (Image *) NULL)
4895 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4896 "ContainsNoImages",
"`%s'",wand->name);
4897 return(UndefinedDispose);
4899 return((DisposeType) wand->images->dispose);
4933WandExport MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
4934 const MagickWand *reference,
const MetricType metric,
double *distortion)
4939 assert(wand != (MagickWand *) NULL);
4940 assert(wand->signature == MagickWandSignature);
4941 if (wand->debug != MagickFalse)
4942 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4943 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4944 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4945 status=GetImageDistortion(wand->images,reference->images,metric,distortion,
4980WandExport
double *MagickGetImageDistortions(MagickWand *wand,
4981 const MagickWand *reference,
const MetricType metric)
4984 *channel_distortion;
4986 assert(wand != (MagickWand *) NULL);
4987 assert(wand->signature == MagickWandSignature);
4988 if (wand->debug != MagickFalse)
4989 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4990 assert(reference != (MagickWand *) NULL);
4991 assert(reference->signature == MagickWandSignature);
4992 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4994 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4995 "ContainsNoImages",
"`%s'",wand->name);
4996 return((
double *) NULL);
4998 channel_distortion=GetImageDistortions(wand->images,reference->images,
4999 metric,wand->exception);
5000 return(channel_distortion);
5025WandExport EndianType MagickGetImageEndian(MagickWand *wand)
5027 assert(wand != (MagickWand *) NULL);
5028 assert(wand->signature == MagickWandSignature);
5029 if (wand->debug != MagickFalse)
5030 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5031 if (wand->images == (Image *) NULL)
5033 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5034 "ContainsNoImages",
"`%s'",wand->name);
5035 return(UndefinedEndian);
5037 return(wand->images->endian);
5063WandExport
char *MagickGetImageFilename(MagickWand *wand)
5065 assert(wand != (MagickWand *) NULL);
5066 assert(wand->signature == MagickWandSignature);
5067 if (wand->debug != MagickFalse)
5068 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5069 if (wand->images == (Image *) NULL)
5071 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5072 "ContainsNoImages",
"`%s'",wand->name);
5073 return((
char *) NULL);
5075 return(AcquireString(wand->images->filename));
5100WandExport FilterType MagickGetImageFilter(MagickWand *wand)
5102 assert(wand != (MagickWand *) NULL);
5103 assert(wand->signature == MagickWandSignature);
5104 if (wand->debug != MagickFalse)
5105 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5106 if (wand->images == (Image *) NULL)
5108 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5109 "ContainsNoImages",
"`%s'",wand->name);
5110 return(UndefinedFilter);
5112 return(wand->images->filter);
5138WandExport
char *MagickGetImageFormat(MagickWand *wand)
5140 assert(wand != (MagickWand *) NULL);
5141 assert(wand->signature == MagickWandSignature);
5142 if (wand->debug != MagickFalse)
5143 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5144 if (wand->images == (Image *) NULL)
5146 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5147 "ContainsNoImages",
"`%s'",wand->name);
5148 return((
char *) NULL);
5150 return(AcquireString(wand->images->magick));
5175WandExport
double MagickGetImageFuzz(MagickWand *wand)
5177 assert(wand != (MagickWand *) NULL);
5178 assert(wand->signature == MagickWandSignature);
5179 if (wand->debug != MagickFalse)
5180 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5181 if (wand->images == (Image *) NULL)
5183 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5184 "ContainsNoImages",
"`%s'",wand->name);
5187 return(wand->images->fuzz);
5212WandExport
double MagickGetImageGamma(MagickWand *wand)
5214 assert(wand != (MagickWand *) NULL);
5215 assert(wand->signature == MagickWandSignature);
5216 if (wand->debug != MagickFalse)
5217 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5218 if (wand->images == (Image *) NULL)
5220 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5221 "ContainsNoImages",
"`%s'",wand->name);
5224 return(wand->images->gamma);
5249WandExport GravityType MagickGetImageGravity(MagickWand *wand)
5251 assert(wand != (MagickWand *) NULL);
5252 assert(wand->signature == MagickWandSignature);
5253 if (wand->debug != MagickFalse)
5254 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5255 if (wand->images == (Image *) NULL)
5257 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5258 "ContainsNoImages",
"`%s'",wand->name);
5259 return(UndefinedGravity);
5261 return(wand->images->gravity);
5293WandExport MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,
5294 double *x,
double *y,
double *z)
5296 assert(wand != (MagickWand *) NULL);
5297 assert(wand->signature == MagickWandSignature);
5298 if (wand->debug != MagickFalse)
5299 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5300 if (wand->images == (Image *) NULL)
5301 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5302 *x=wand->images->chromaticity.green_primary.x;
5303 *y=wand->images->chromaticity.green_primary.y;
5304 *z=wand->images->chromaticity.green_primary.z;
5330WandExport
size_t MagickGetImageHeight(MagickWand *wand)
5332 assert(wand != (MagickWand *) NULL);
5333 assert(wand->signature == MagickWandSignature);
5334 if (wand->debug != MagickFalse)
5335 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5336 if (wand->images == (Image *) NULL)
5337 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5338 return(wand->images->rows);
5368WandExport PixelWand **MagickGetImageHistogram(MagickWand *wand,
5369 size_t *number_colors)
5380 assert(wand != (MagickWand *) NULL);
5381 assert(wand->signature == MagickWandSignature);
5382 if (wand->debug != MagickFalse)
5383 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5384 if (wand->images == (Image *) NULL)
5386 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5387 "ContainsNoImages",
"`%s'",wand->name);
5388 return((PixelWand **) NULL);
5390 histogram=GetImageHistogram(wand->images,number_colors,wand->exception);
5391 if (histogram == (PixelInfo *) NULL)
5392 return((PixelWand **) NULL);
5393 pixel_wands=NewPixelWands(*number_colors);
5394 for (i=0; i < (ssize_t) *number_colors; i++)
5396 PixelSetPixelColor(pixel_wands[i],&histogram[i]);
5397 PixelSetColorCount(pixel_wands[i],(
size_t) histogram[i].count);
5399 histogram=(PixelInfo *) RelinquishMagickMemory(histogram);
5400 return(pixel_wands);
5425WandExport InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
5427 assert(wand != (MagickWand *) NULL);
5428 assert(wand->signature == MagickWandSignature);
5429 if (wand->debug != MagickFalse)
5430 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5431 if (wand->images == (Image *) NULL)
5433 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5434 "ContainsNoImages",
"`%s'",wand->name);
5435 return(UndefinedInterlace);
5437 return(wand->images->interlace);
5463WandExport PixelInterpolateMethod MagickGetImageInterpolateMethod(
5466 assert(wand != (MagickWand *) NULL);
5467 assert(wand->signature == MagickWandSignature);
5468 if (wand->debug != MagickFalse)
5469 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5470 if (wand->images == (Image *) NULL)
5472 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5473 "ContainsNoImages",
"`%s'",wand->name);
5474 return(UndefinedInterpolatePixel);
5476 return(wand->images->interpolate);
5501WandExport
size_t MagickGetImageIterations(MagickWand *wand)
5503 assert(wand != (MagickWand *) NULL);
5504 assert(wand->signature == MagickWandSignature);
5505 if (wand->debug != MagickFalse)
5506 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5507 if (wand->images == (Image *) NULL)
5508 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5509 return(wand->images->iterations);
5537WandExport MagickBooleanType MagickGetImageLength(MagickWand *wand,
5538 MagickSizeType *length)
5540 assert(wand != (MagickWand *) NULL);
5541 assert(wand->signature == MagickWandSignature);
5542 if (wand->debug != MagickFalse)
5543 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5544 if (wand->images == (Image *) NULL)
5545 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5546 *length=GetBlobSize(wand->images);
5575WandExport MagickBooleanType MagickGetImageMatteColor(MagickWand *wand,
5576 PixelWand *matte_color)
5578 assert(wand != (MagickWand *)NULL);
5579 assert(wand->signature == MagickWandSignature);
5580 if (wand->debug != MagickFalse)
5581 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5582 if (wand->images == (Image *)NULL)
5583 ThrowWandException(WandError,
"ContainsNoImages", wand->name);
5584 PixelSetPixelColor(matte_color,&wand->images->matte_color);
5610WandExport OrientationType MagickGetImageOrientation(MagickWand *wand)
5612 assert(wand != (MagickWand *) NULL);
5613 assert(wand->signature == MagickWandSignature);
5614 if (wand->debug != MagickFalse)
5615 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5616 if (wand->images == (Image *) NULL)
5618 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5619 "ContainsNoImages",
"`%s'",wand->name);
5620 return(UndefinedOrientation);
5622 return(wand->images->orientation);
5656WandExport MagickBooleanType MagickGetImagePage(MagickWand *wand,
5657 size_t *width,
size_t *height,ssize_t *x,ssize_t *y)
5659 assert(wand != (
const MagickWand *) NULL);
5660 assert(wand->signature == MagickWandSignature);
5661 if (wand->debug != MagickFalse)
5662 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5663 if (wand->images == (Image *) NULL)
5664 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5665 *width=wand->images->page.width;
5666 *height=wand->images->page.height;
5667 *x=wand->images->page.x;
5668 *y=wand->images->page.y;
5699WandExport MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
5700 const ssize_t x,
const ssize_t y,PixelWand *color)
5708 assert(wand != (MagickWand *) NULL);
5709 assert(wand->signature == MagickWandSignature);
5710 if (wand->debug != MagickFalse)
5711 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5712 if (wand->images == (Image *) NULL)
5713 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5714 image_view=AcquireVirtualCacheView(wand->images,wand->exception);
5715 p=GetCacheViewVirtualPixels(image_view,x,y,1,1,wand->exception);
5716 if (p == (
const Quantum *) NULL)
5718 image_view=DestroyCacheView(image_view);
5719 return(MagickFalse);
5721 PixelSetQuantumPixel(wand->images,p,color);
5722 image_view=DestroyCacheView(image_view);
5755WandExport MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,
5756 double *x,
double *y,
double *z)
5758 assert(wand != (MagickWand *) NULL);
5759 assert(wand->signature == MagickWandSignature);
5760 if (wand->debug != MagickFalse)
5761 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5762 if (wand->images == (Image *) NULL)
5763 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5764 *x=wand->images->chromaticity.red_primary.x;
5765 *y=wand->images->chromaticity.red_primary.y;
5766 *z=wand->images->chromaticity.red_primary.z;
5803WandExport MagickWand *MagickGetImageRegion(MagickWand *wand,
5804 const size_t width,
const size_t height,
const ssize_t x,
5813 assert(wand != (MagickWand *) NULL);
5814 assert(wand->signature == MagickWandSignature);
5815 if (wand->debug != MagickFalse)
5816 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5817 if (wand->images == (Image *) NULL)
5818 return((MagickWand *) NULL);
5820 region.height=height;
5823 region_image=CropImage(wand->images,®ion,wand->exception);
5824 if (region_image == (Image *) NULL)
5825 return((MagickWand *) NULL);
5826 return(CloneMagickWandFromImages(wand,region_image));
5851WandExport RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
5853 assert(wand != (MagickWand *) NULL);
5854 assert(wand->signature == MagickWandSignature);
5855 if (wand->debug != MagickFalse)
5856 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5857 if (wand->images == (Image *) NULL)
5859 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5860 "ContainsNoImages",
"`%s'",wand->name);
5861 return(UndefinedIntent);
5863 return((RenderingIntent) wand->images->rendering_intent);
5893WandExport MagickBooleanType MagickGetImageResolution(MagickWand *wand,
5894 double *x,
double *y)
5896 assert(wand != (MagickWand *) NULL);
5897 assert(wand->signature == MagickWandSignature);
5898 if (wand->debug != MagickFalse)
5899 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5900 if (wand->images == (Image *) NULL)
5901 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5902 *x=wand->images->resolution.x;
5903 *y=wand->images->resolution.y;
5929WandExport
size_t MagickGetImageScene(MagickWand *wand)
5931 assert(wand != (MagickWand *) NULL);
5932 assert(wand->signature == MagickWandSignature);
5933 if (wand->debug != MagickFalse)
5934 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5935 if (wand->images == (Image *) NULL)
5936 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5937 return(wand->images->scene);
5963WandExport
char *MagickGetImageSignature(MagickWand *wand)
5971 assert(wand != (MagickWand *) NULL);
5972 assert(wand->signature == MagickWandSignature);
5973 if (wand->debug != MagickFalse)
5974 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5975 if (wand->images == (Image *) NULL)
5977 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5978 "ContainsNoImages",
"`%s'",wand->name);
5979 return((
char *) NULL);
5981 status=SignatureImage(wand->images,wand->exception);
5982 if (status == MagickFalse)
5983 return((
char *) NULL);
5984 value=GetImageProperty(wand->images,
"signature",wand->exception);
5985 if (value == (
const char *) NULL)
5986 return((
char *) NULL);
5987 return(AcquireString(value));
6012WandExport
size_t MagickGetImageTicksPerSecond(MagickWand *wand)
6014 assert(wand != (MagickWand *) NULL);
6015 assert(wand->signature == MagickWandSignature);
6016 if (wand->debug != MagickFalse)
6017 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6018 if (wand->images == (Image *) NULL)
6019 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6020 return((
size_t) wand->images->ticks_per_second);
6049WandExport ImageType MagickGetImageType(MagickWand *wand)
6051 assert(wand != (MagickWand *) NULL);
6052 assert(wand->signature == MagickWandSignature);
6053 if (wand->debug != MagickFalse)
6054 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6055 if (wand->images == (Image *) NULL)
6057 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6058 "ContainsNoImages",
"`%s'",wand->name);
6059 return(UndefinedType);
6061 return(GetImageType(wand->images));
6086WandExport ResolutionType MagickGetImageUnits(MagickWand *wand)
6088 assert(wand != (MagickWand *) NULL);
6089 assert(wand->signature == MagickWandSignature);
6090 if (wand->debug != MagickFalse)
6091 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6092 if (wand->images == (Image *) NULL)
6094 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6095 "ContainsNoImages",
"`%s'",wand->name);
6096 return(UndefinedResolution);
6098 return(wand->images->units);
6124WandExport VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
6126 assert(wand != (MagickWand *) NULL);
6127 assert(wand->signature == MagickWandSignature);
6128 if (wand->debug != MagickFalse)
6129 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6130 if (wand->images == (Image *) NULL)
6132 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6133 "ContainsNoImages",
"`%s'",wand->name);
6134 return(UndefinedVirtualPixelMethod);
6136 return(GetImageVirtualPixelMethod(wand->images));
6168WandExport MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,
6169 double *x,
double *y,
double *z)
6171 assert(wand != (MagickWand *) NULL);
6172 assert(wand->signature == MagickWandSignature);
6173 if (wand->debug != MagickFalse)
6174 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6175 if (wand->images == (Image *) NULL)
6176 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6177 *x=wand->images->chromaticity.white_point.x;
6178 *y=wand->images->chromaticity.white_point.y;
6179 *z=wand->images->chromaticity.white_point.z;
6205WandExport
size_t MagickGetImageWidth(MagickWand *wand)
6207 assert(wand != (MagickWand *) NULL);
6208 assert(wand->signature == MagickWandSignature);
6209 if (wand->debug != MagickFalse)
6210 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6211 if (wand->images == (Image *) NULL)
6212 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6213 return(wand->images->columns);
6239WandExport
size_t MagickGetNumberImages(MagickWand *wand)
6241 assert(wand != (MagickWand *) NULL);
6242 assert(wand->signature == MagickWandSignature);
6243 if (wand->debug != MagickFalse)
6244 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6245 return(GetImageListLength(wand->images));
6270WandExport
double MagickGetImageTotalInkDensity(MagickWand *wand)
6272 assert(wand != (MagickWand *) NULL);
6273 assert(wand->signature == MagickWandSignature);
6274 if (wand->debug != MagickFalse)
6275 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6276 if (wand->images == (Image *) NULL)
6278 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6279 "ContainsNoImages",
"`%s'",wand->name);
6282 return(GetImageTotalInkDensity(wand->images,wand->exception));
6314WandExport MagickBooleanType MagickHaldClutImage(MagickWand *wand,
6315 const MagickWand *hald_wand)
6320 assert(wand != (MagickWand *) NULL);
6321 assert(wand->signature == MagickWandSignature);
6322 if (wand->debug != MagickFalse)
6323 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6324 if ((wand->images == (Image *) NULL) || (hald_wand->images == (Image *) NULL))
6325 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6326 status=HaldClutImage(wand->images,hald_wand->images,wand->exception);
6353WandExport MagickBooleanType MagickHasNextImage(MagickWand *wand)
6355 assert(wand != (MagickWand *) NULL);
6356 assert(wand->signature == MagickWandSignature);
6357 if (wand->debug != MagickFalse)
6358 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6359 if (wand->images == (Image *) NULL)
6360 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6361 if (GetNextImageInList(wand->images) == (Image *) NULL)
6362 return(MagickFalse);
6389WandExport MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
6391 assert(wand != (MagickWand *) NULL);
6392 assert(wand->signature == MagickWandSignature);
6393 if (wand->debug != MagickFalse)
6394 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6395 if (wand->images == (Image *) NULL)
6396 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6397 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
6398 return(MagickFalse);
6439WandExport MagickBooleanType MagickHoughLineImage(MagickWand *wand,
6440 const size_t width,
const size_t height,
const size_t threshold)
6445 assert(wand != (MagickWand *) NULL);
6446 assert(wand->signature == MagickWandSignature);
6447 if (wand->debug != MagickFalse)
6448 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6449 if (wand->images == (Image *) NULL)
6450 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6451 lines_image=HoughLineImage(wand->images,width,height,threshold,
6453 if (lines_image == (Image *) NULL)
6454 return(MagickFalse);
6455 ReplaceImageInList(&wand->images,lines_image);
6482WandExport
char *MagickIdentifyImage(MagickWand *wand)
6486 filename[MagickPathExtent];
6494 assert(wand != (MagickWand *) NULL);
6495 assert(wand->signature == MagickWandSignature);
6496 if (wand->debug != MagickFalse)
6497 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6498 if (wand->images == (Image *) NULL)
6500 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6501 "ContainsNoImages",
"`%s'",wand->name);
6502 return((
char *) NULL);
6504 description=(
char *) NULL;
6505 unique_file=AcquireUniqueFileResource(filename);
6507 if (unique_file != -1)
6508 file=fdopen(unique_file,
"wb");
6509 if ((unique_file == -1) || (file == (FILE *) NULL))
6511 (void) RelinquishUniqueFileResource(filename);
6512 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6513 "UnableToCreateTemporaryFile",
"`%s'",wand->name);
6514 return((
char *) NULL);
6516 (void) IdentifyImage(wand->images,file,MagickTrue,wand->exception);
6517 (void) fclose(file);
6518 description=FileToString(filename,~0UL,wand->exception);
6519 (void) RelinquishUniqueFileResource(filename);
6520 return(description);
6553WandExport ImageType MagickIdentifyImageType(MagickWand *wand)
6555 assert(wand != (MagickWand *) NULL);
6556 assert(wand->signature == MagickWandSignature);
6557 if (wand->debug != MagickFalse)
6558 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6559 if (wand->images == (Image *) NULL)
6561 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6562 "ContainsNoImages",
"`%s'",wand->name);
6563 return(UndefinedType);
6565 return(IdentifyImageType(wand->images,wand->exception));
6598WandExport MagickBooleanType MagickImplodeImage(MagickWand *wand,
6599 const double amount,
const PixelInterpolateMethod method)
6604 assert(wand != (MagickWand *) NULL);
6605 assert(wand->signature == MagickWandSignature);
6606 if (wand->debug != MagickFalse)
6607 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6608 if (wand->images == (Image *) NULL)
6609 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6610 implode_image=ImplodeImage(wand->images,amount,method,wand->exception);
6611 if (implode_image == (Image *) NULL)
6612 return(MagickFalse);
6613 ReplaceImageInList(&wand->images,implode_image);
6668WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand,
6669 const ssize_t x,
const ssize_t y,
const size_t columns,
const size_t rows,
6670 const char *map,
const StorageType storage,
const void *pixels)
6675 assert(wand != (MagickWand *) NULL);
6676 assert(wand->signature == MagickWandSignature);
6677 if (wand->debug != MagickFalse)
6678 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6679 if (wand->images == (Image *) NULL)
6680 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6681 status=ImportImagePixels(wand->images,x,y,columns,rows,map,storage,pixels,
6715WandExport MagickBooleanType MagickInterpolativeResizeImage(MagickWand *wand,
6716 const size_t columns,
const size_t rows,
const PixelInterpolateMethod method)
6721 assert(wand != (MagickWand *) NULL);
6722 assert(wand->signature == MagickWandSignature);
6723 if (wand->debug != MagickFalse)
6724 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6725 if (wand->images == (Image *) NULL)
6726 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6727 resize_image=InterpolativeResizeImage(wand->images,columns,rows,method,
6729 if (resize_image == (Image *) NULL)
6730 return(MagickFalse);
6731 ReplaceImageInList(&wand->images,resize_image);
6766WandExport MagickBooleanType MagickInverseFourierTransformImage(
6767 MagickWand *magnitude_wand,MagickWand *phase_wand,
6768 const MagickBooleanType magnitude)
6776 assert(magnitude_wand != (MagickWand *) NULL);
6777 assert(magnitude_wand->signature == MagickWandSignature);
6778 if (magnitude_wand->debug != MagickFalse)
6779 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",
6780 magnitude_wand->name);
6781 wand=magnitude_wand;
6782 if (magnitude_wand->images == (Image *) NULL)
6783 ThrowWandException(WandError,
"ContainsNoImages",
6784 magnitude_wand->name);
6785 assert(phase_wand != (MagickWand *) NULL);
6786 assert(phase_wand->signature == MagickWandSignature);
6787 inverse_image=InverseFourierTransformImage(magnitude_wand->images,
6788 phase_wand->images,magnitude,wand->exception);
6789 if (inverse_image == (Image *) NULL)
6790 return(MagickFalse);
6791 ReplaceImageInList(&wand->images,inverse_image);
6826WandExport MagickBooleanType MagickKmeansImage(MagickWand *wand,
6827 const size_t number_colors,
const size_t max_iterations,
6828 const double tolerance)
6833 assert(wand != (MagickWand *) NULL);
6834 assert(wand->signature == MagickWandSignature);
6835 if (wand->debug != MagickFalse)
6836 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6837 if (wand->images == (Image *) NULL)
6838 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6839 status=KmeansImage(wand->images,number_colors,max_iterations,tolerance,
6871WandExport MagickBooleanType MagickKuwaharaImage(MagickWand *wand,
6872 const double radius,
const double sigma)
6877 assert(wand != (MagickWand *) NULL);
6878 assert(wand->signature == MagickWandSignature);
6879 if (wand->debug != MagickFalse)
6880 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6881 if (wand->images == (Image *) NULL)
6882 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6883 kuwahara_image=KuwaharaImage(wand->images,radius,sigma,wand->exception);
6884 if (kuwahara_image == (Image *) NULL)
6885 return(MagickFalse);
6886 ReplaceImageInList(&wand->images,kuwahara_image);
6914WandExport MagickBooleanType MagickLabelImage(MagickWand *wand,
6920 assert(wand != (MagickWand *) NULL);
6921 assert(wand->signature == MagickWandSignature);
6922 if (wand->debug != MagickFalse)
6923 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6924 if (wand->images == (Image *) NULL)
6925 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6926 status=SetImageProperty(wand->images,
"label",label,wand->exception);
6969WandExport MagickBooleanType MagickLevelImage(MagickWand *wand,
6970 const double black_point,
const double gamma,
const double white_point)
6975 assert(wand != (MagickWand *) NULL);
6976 assert(wand->signature == MagickWandSignature);
6977 if (wand->debug != MagickFalse)
6978 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6979 if (wand->images == (Image *) NULL)
6980 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6981 status=LevelImage(wand->images,black_point,white_point,gamma,
7019WandExport MagickBooleanType MagickLevelImageColors(MagickWand *wand,
7020 const PixelWand *black_color,
const PixelWand *white_color,
7021 const MagickBooleanType invert)
7030 assert(wand != (MagickWand *) NULL);
7031 assert(wand->signature == MagickWandSignature);
7032 if (wand->debug != MagickFalse)
7033 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7034 if (wand->images == (Image *) NULL)
7035 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7036 PixelGetMagickColor(black_color,&black);
7037 PixelGetMagickColor(white_color,&white);
7038 status=LevelImageColors(wand->images,&black,&white,invert,wand->exception);
7074WandExport MagickBooleanType MagickLevelizeImage(MagickWand *wand,
7075 const double black_point,
const double gamma,
const double white_point)
7080 assert(wand != (MagickWand *) NULL);
7081 assert(wand->signature == MagickWandSignature);
7082 if (wand->debug != MagickFalse)
7083 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7084 if (wand->images == (Image *) NULL)
7085 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7086 status=LevelizeImage(wand->images,black_point,white_point,gamma,
7121WandExport MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
7122 const double black_point,
const double white_point)
7127 assert(wand != (MagickWand *) NULL);
7128 assert(wand->signature == MagickWandSignature);
7129 if (wand->debug != MagickFalse)
7130 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7131 if (wand->images == (Image *) NULL)
7132 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7133 status=LinearStretchImage(wand->images,black_point,white_point,
7168WandExport MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
7169 const size_t columns,
const size_t rows,
const double delta_x,
7170 const double rigidity)
7175 assert(wand != (MagickWand *) NULL);
7176 assert(wand->signature == MagickWandSignature);
7177 if (wand->debug != MagickFalse)
7178 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7179 if (wand->images == (Image *) NULL)
7180 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7181 rescale_image=LiquidRescaleImage(wand->images,columns,rows,delta_x,
7182 rigidity,wand->exception);
7183 if (rescale_image == (Image *) NULL)
7184 return(MagickFalse);
7185 ReplaceImageInList(&wand->images,rescale_image);
7218WandExport MagickBooleanType MagickLocalContrastImage(MagickWand *wand,
7219 const double radius,
const double strength)
7224 assert(wand != (MagickWand *)NULL);
7225 assert(wand->signature == MagickWandSignature);
7226 if (wand->debug != MagickFalse)
7227 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s", wand->name);
7228 if (wand->images == (Image *)NULL)
7229 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7230 contrast_image=LocalContrastImage(wand->images,radius,strength,
7232 if (contrast_image == (Image *)NULL)
7233 return(MagickFalse);
7234 ReplaceImageInList(&wand->images,contrast_image);
7261WandExport MagickBooleanType MagickMagnifyImage(MagickWand *wand)
7266 assert(wand != (MagickWand *) NULL);
7267 assert(wand->signature == MagickWandSignature);
7268 if (wand->debug != MagickFalse)
7269 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7270 if (wand->images == (Image *) NULL)
7271 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7272 magnify_image=MagnifyImage(wand->images,wand->exception);
7273 if (magnify_image == (Image *) NULL)
7274 return(MagickFalse);
7275 ReplaceImageInList(&wand->images,magnify_image);
7316WandExport MagickBooleanType MagickMeanShiftImage(MagickWand *wand,
7317 const size_t width,
const size_t height,
const double color_distance)
7322 assert(wand != (MagickWand *) NULL);
7323 assert(wand->signature == MagickWandSignature);
7324 if (wand->debug != MagickFalse)
7325 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7326 if (wand->images == (Image *) NULL)
7327 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7328 mean_image=MeanShiftImage(wand->images,width,height,color_distance,
7330 if (mean_image == (Image *) NULL)
7331 return(MagickFalse);
7332 ReplaceImageInList(&wand->images,mean_image);
7379WandExport MagickWand *MagickMergeImageLayers(MagickWand *wand,
7380 const LayerMethod method)
7385 assert(wand != (MagickWand *) NULL);
7386 assert(wand->signature == MagickWandSignature);
7387 if (wand->debug != MagickFalse)
7388 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7389 if (wand->images == (Image *) NULL)
7390 return((MagickWand *) NULL);
7391 mosaic_image=MergeImageLayers(wand->images,method,wand->exception);
7392 if (mosaic_image == (Image *) NULL)
7393 return((MagickWand *) NULL);
7394 return(CloneMagickWandFromImages(wand,mosaic_image));
7420WandExport MagickBooleanType MagickMinifyImage(MagickWand *wand)
7425 assert(wand != (MagickWand *) NULL);
7426 assert(wand->signature == MagickWandSignature);
7427 if (wand->debug != MagickFalse)
7428 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7429 if (wand->images == (Image *) NULL)
7430 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7431 minify_image=MinifyImage(wand->images,wand->exception);
7432 if (minify_image == (Image *) NULL)
7433 return(MagickFalse);
7434 ReplaceImageInList(&wand->images,minify_image);
7474WandExport MagickBooleanType MagickModulateImage(MagickWand *wand,
7475 const double brightness,
const double saturation,
const double hue)
7478 modulate[MagickPathExtent];
7483 assert(wand != (MagickWand *) NULL);
7484 assert(wand->signature == MagickWandSignature);
7485 if (wand->debug != MagickFalse)
7486 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7487 if (wand->images == (Image *) NULL)
7488 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7489 (void) FormatLocaleString(modulate,MagickPathExtent,
"%g,%g,%g",
7490 brightness,saturation,hue);
7491 status=ModulateImage(wand->images,modulate,wand->exception);
7535WandExport MagickWand *MagickMontageImage(MagickWand *wand,
7536 const DrawingWand *drawing_wand,
const char *tile_geometry,
7537 const char *thumbnail_geometry,
const MontageMode mode,
const char *frame)
7551 assert(wand != (MagickWand *) NULL);
7552 assert(wand->signature == MagickWandSignature);
7553 if (wand->debug != MagickFalse)
7554 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7555 if (wand->images == (Image *) NULL)
7556 return((MagickWand *) NULL);
7557 montage_info=CloneMontageInfo(wand->image_info,(MontageInfo *) NULL);
7562 (void) CloneString(&montage_info->frame,
"15x15+3+3");
7563 montage_info->shadow=MagickTrue;
7568 montage_info->frame=(
char *) NULL;
7569 montage_info->shadow=MagickFalse;
7570 montage_info->border_width=0;
7573 case ConcatenateMode:
7575 montage_info->frame=(
char *) NULL;
7576 montage_info->shadow=MagickFalse;
7577 (void) CloneString(&montage_info->geometry,
"+0+0");
7578 montage_info->border_width=0;
7584 font=DrawGetFont(drawing_wand);
7585 if (font != (
char *) NULL)
7586 (void) CloneString(&montage_info->font,font);
7587 if (frame != (
char *) NULL)
7588 (void) CloneString(&montage_info->frame,frame);
7589 montage_info->pointsize=DrawGetFontSize(drawing_wand);
7590 pixel_wand=NewPixelWand();
7591 DrawGetFillColor(drawing_wand,pixel_wand);
7592 PixelGetQuantumPacket(pixel_wand,&montage_info->fill);
7593 DrawGetStrokeColor(drawing_wand,pixel_wand);
7594 PixelGetQuantumPacket(pixel_wand,&montage_info->stroke);
7595 pixel_wand=DestroyPixelWand(pixel_wand);
7596 if (thumbnail_geometry != (
char *) NULL)
7597 (void) CloneString(&montage_info->geometry,thumbnail_geometry);
7598 if (tile_geometry != (
char *) NULL)
7599 (void) CloneString(&montage_info->tile,tile_geometry);
7600 montage_image=MontageImageList(wand->image_info,montage_info,wand->images,
7602 montage_info=DestroyMontageInfo(montage_info);
7603 if (montage_image == (Image *) NULL)
7604 return((MagickWand *) NULL);
7605 return(CloneMagickWandFromImages(wand,montage_image));
7635WandExport MagickWand *MagickMorphImages(MagickWand *wand,
7636 const size_t number_frames)
7641 assert(wand != (MagickWand *) NULL);
7642 assert(wand->signature == MagickWandSignature);
7643 if (wand->debug != MagickFalse)
7644 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7645 if (wand->images == (Image *) NULL)
7646 return((MagickWand *) NULL);
7647 morph_image=MorphImages(wand->images,number_frames,wand->exception);
7648 if (morph_image == (Image *) NULL)
7649 return((MagickWand *) NULL);
7650 return(CloneMagickWandFromImages(wand,morph_image));
7686WandExport MagickBooleanType MagickMorphologyImage(MagickWand *wand,
7687 const MorphologyMethod method,
const ssize_t iterations,
7688 const KernelInfo *kernel)
7693 assert(wand != (MagickWand *) NULL);
7694 assert(wand->signature == MagickWandSignature);
7695 if (wand->debug != MagickFalse)
7696 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7697 if (kernel == (
const KernelInfo *) NULL)
7698 return(MagickFalse);
7699 if (wand->images == (Image *) NULL)
7700 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7701 morphology_image=MorphologyImage(wand->images,method,iterations,kernel,
7703 if (morphology_image == (Image *) NULL)
7704 return(MagickFalse);
7705 ReplaceImageInList(&wand->images,morphology_image);
7743WandExport MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
7744 const double radius,
const double sigma,
const double angle)
7749 assert(wand != (MagickWand *) NULL);
7750 assert(wand->signature == MagickWandSignature);
7751 if (wand->debug != MagickFalse)
7752 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7753 if (wand->images == (Image *) NULL)
7754 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7755 blur_image=MotionBlurImage(wand->images,radius,sigma,angle,wand->exception);
7756 if (blur_image == (Image *) NULL)
7757 return(MagickFalse);
7758 ReplaceImageInList(&wand->images,blur_image);
7792WandExport MagickBooleanType MagickNegateImage(MagickWand *wand,
7793 const MagickBooleanType gray)
7798 assert(wand != (MagickWand *) NULL);
7799 assert(wand->signature == MagickWandSignature);
7800 if (wand->debug != MagickFalse)
7801 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7802 if (wand->images == (Image *) NULL)
7803 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7804 status=NegateImage(wand->images,gray,wand->exception);
7839WandExport MagickBooleanType MagickNewImage(MagickWand *wand,
const size_t width,
7840 const size_t height,
const PixelWand *background)
7848 assert(wand != (MagickWand *) NULL);
7849 assert(wand->signature == MagickWandSignature);
7850 if (wand->debug != MagickFalse)
7851 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7852 PixelGetMagickColor(background,&pixel);
7853 images=NewMagickImage(wand->image_info,width,height,&pixel,wand->exception);
7854 if (images == (Image *) NULL)
7855 return(MagickFalse);
7856 return(InsertImageInWand(wand,images));
7894WandExport MagickBooleanType MagickNextImage(MagickWand *wand)
7896 assert(wand != (MagickWand *) NULL);
7897 assert(wand->signature == MagickWandSignature);
7898 if (wand->debug != MagickFalse)
7899 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7900 if (wand->images == (Image *) NULL)
7901 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7902 wand->insert_before=MagickFalse;
7903 if (wand->image_pending != MagickFalse)
7905 wand->image_pending=MagickFalse;
7908 if (GetNextImageInList(wand->images) == (Image *) NULL)
7910 wand->image_pending=MagickTrue;
7911 return(MagickFalse);
7913 wand->images=GetNextImageInList(wand->images);
7943WandExport MagickBooleanType MagickNormalizeImage(MagickWand *wand)
7948 assert(wand != (MagickWand *) NULL);
7949 assert(wand->signature == MagickWandSignature);
7950 if (wand->debug != MagickFalse)
7951 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7952 if (wand->images == (Image *) NULL)
7953 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7954 status=NormalizeImage(wand->images,wand->exception);
7987WandExport MagickBooleanType MagickOilPaintImage(MagickWand *wand,
7988 const double radius,
const double sigma)
7993 assert(wand != (MagickWand *) NULL);
7994 assert(wand->signature == MagickWandSignature);
7995 if (wand->debug != MagickFalse)
7996 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7997 if (wand->images == (Image *) NULL)
7998 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7999 paint_image=OilPaintImage(wand->images,radius,sigma,wand->exception);
8000 if (paint_image == (Image *) NULL)
8001 return(MagickFalse);
8002 ReplaceImageInList(&wand->images,paint_image);
8044WandExport MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
8045 const PixelWand *target,
const PixelWand *fill,
const double fuzz,
8046 const MagickBooleanType invert)
8055 assert(wand != (MagickWand *) NULL);
8056 assert(wand->signature == MagickWandSignature);
8057 if (wand->debug != MagickFalse)
8058 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8059 if (wand->images == (Image *) NULL)
8060 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8061 PixelGetMagickColor(target,&target_pixel);
8062 PixelGetMagickColor(fill,&fill_pixel);
8063 wand->images->fuzz=fuzz;
8064 status=OpaquePaintImage(wand->images,&target_pixel,&fill_pixel,invert,
8094WandExport MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
8099 assert(wand != (MagickWand *) NULL);
8100 assert(wand->signature == MagickWandSignature);
8101 if (wand->debug != MagickFalse)
8102 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8103 if (wand->images == (Image *) NULL)
8104 return((MagickWand *) NULL);
8105 optimize_image=OptimizeImageLayers(wand->images,wand->exception);
8106 if (optimize_image == (Image *) NULL)
8107 return((MagickWand *) NULL);
8108 return(CloneMagickWandFromImages(wand,optimize_image));
8139WandExport MagickBooleanType MagickOptimizeImageTransparency(MagickWand *wand)
8141 assert(wand != (MagickWand *) NULL);
8142 assert(wand->signature == MagickWandSignature);
8143 if (wand->debug != MagickFalse)
8144 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8145 if (wand->images == (Image *) NULL)
8146 return(MagickFalse);
8147 OptimizeImageTransparency(wand->images,wand->exception);
8196WandExport MagickBooleanType MagickOrderedDitherImage(MagickWand *wand,
8197 const char *threshold_map)
8202 assert(wand != (MagickWand *) NULL);
8203 assert(wand->signature == MagickWandSignature);
8204 if (wand->debug != MagickFalse)
8205 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8206 if (wand->images == (Image *) NULL)
8207 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8208 status=OrderedDitherImage(wand->images,threshold_map,wand->exception);
8239WandExport MagickBooleanType MagickPingImage(MagickWand *wand,
8240 const char *filename)
8248 assert(wand != (MagickWand *) NULL);
8249 assert(wand->signature == MagickWandSignature);
8250 if (wand->debug != MagickFalse)
8251 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8252 ping_info=CloneImageInfo(wand->image_info);
8253 if (filename != (
const char *) NULL)
8254 (void) CopyMagickString(ping_info->filename,filename,MagickPathExtent);
8255 images=PingImage(ping_info,wand->exception);
8256 ping_info=DestroyImageInfo(ping_info);
8257 if (images == (Image *) NULL)
8258 return(MagickFalse);
8259 return(InsertImageInWand(wand,images));
8289WandExport MagickBooleanType MagickPingImageBlob(MagickWand *wand,
8290 const void *blob,
const size_t length)
8295 assert(wand != (MagickWand *) NULL);
8296 assert(wand->signature == MagickWandSignature);
8297 if (wand->debug != MagickFalse)
8298 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8299 images=PingBlob(wand->image_info,blob,length,wand->exception);
8300 if (images == (Image *) NULL)
8301 return(MagickFalse);
8302 return(InsertImageInWand(wand,images));
8330WandExport MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
8338 assert(wand != (MagickWand *) NULL);
8339 assert(wand->signature == MagickWandSignature);
8340 assert(file != (FILE *) NULL);
8341 if (wand->debug != MagickFalse)
8342 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8343 read_info=CloneImageInfo(wand->image_info);
8344 SetImageInfoFile(read_info,file);
8345 images=PingImage(read_info,wand->exception);
8346 read_info=DestroyImageInfo(read_info);
8347 if (images == (Image *) NULL)
8348 return(MagickFalse);
8349 return(InsertImageInWand(wand,images));
8384WandExport MagickBooleanType MagickPolaroidImage(MagickWand *wand,
8385 const DrawingWand *drawing_wand,
const char *caption,
const double angle,
8386 const PixelInterpolateMethod method)
8394 assert(wand != (MagickWand *) NULL);
8395 assert(wand->signature == MagickWandSignature);
8396 if (wand->debug != MagickFalse)
8397 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8398 if (wand->images == (Image *) NULL)
8399 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8400 draw_info=PeekDrawingWand(drawing_wand);
8401 if (draw_info == (DrawInfo *) NULL)
8402 return(MagickFalse);
8403 polaroid_image=PolaroidImage(wand->images,draw_info,caption,angle,method,
8405 if (polaroid_image == (Image *) NULL)
8406 return(MagickFalse);
8407 ReplaceImageInList(&wand->images,polaroid_image);
8442WandExport MagickBooleanType MagickPolynomialImage(MagickWand *wand,
8443 const size_t number_terms,
const double *terms)
8448 assert(wand != (MagickWand *) NULL);
8449 assert(wand->signature == MagickWandSignature);
8450 if (wand->debug != MagickFalse)
8451 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8452 if (wand->images == (Image *) NULL)
8453 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8454 polynomial_image=PolynomialImage(wand->images,number_terms,terms,
8456 if (polynomial_image == (Image *) NULL)
8457 return(MagickFalse);
8458 ReplaceImageInList(&wand->images,polynomial_image);
8491WandExport MagickBooleanType MagickPosterizeImage(MagickWand *wand,
8492 const size_t levels,
const DitherMethod dither)
8497 assert(wand != (MagickWand *) NULL);
8498 assert(wand->signature == MagickWandSignature);
8499 if (wand->debug != MagickFalse)
8500 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8501 if (wand->images == (Image *) NULL)
8502 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8503 status=PosterizeImage(wand->images,levels,dither,wand->exception);
8535WandExport MagickWand *MagickPreviewImages(MagickWand *wand,
8536 const PreviewType preview)
8541 assert(wand != (MagickWand *) NULL);
8542 assert(wand->signature == MagickWandSignature);
8543 if (wand->debug != MagickFalse)
8544 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8545 if (wand->images == (Image *) NULL)
8546 return((MagickWand *) NULL);
8547 preview_image=PreviewImage(wand->images,preview,wand->exception);
8548 if (preview_image == (Image *) NULL)
8549 return((MagickWand *) NULL);
8550 return(CloneMagickWandFromImages(wand,preview_image));
8589WandExport MagickBooleanType MagickPreviousImage(MagickWand *wand)
8591 assert(wand != (MagickWand *) NULL);
8592 assert(wand->signature == MagickWandSignature);
8593 if (wand->debug != MagickFalse)
8594 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8595 if (wand->images == (Image *) NULL)
8596 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8597 if (wand->image_pending != MagickFalse)
8599 wand->image_pending=MagickFalse;
8602 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
8604 wand->image_pending=MagickTrue;
8605 wand->insert_before=MagickTrue;
8606 return(MagickFalse);
8608 wand->images=GetPreviousImageInList(wand->images);
8662WandExport MagickBooleanType MagickQuantizeImage(MagickWand *wand,
8663 const size_t number_colors,
const ColorspaceType colorspace,
8664 const size_t treedepth,
const DitherMethod dither_method,
8665 const MagickBooleanType measure_error)
8673 assert(wand != (MagickWand *) NULL);
8674 assert(wand->signature == MagickWandSignature);
8675 if (wand->debug != MagickFalse)
8676 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8677 if (wand->images == (Image *) NULL)
8678 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8679 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
8680 quantize_info->number_colors=number_colors;
8681 quantize_info->dither_method=dither_method;
8682 quantize_info->tree_depth=treedepth;
8683 quantize_info->colorspace=colorspace;
8684 quantize_info->measure_error=measure_error;
8685 status=QuantizeImage(quantize_info,wand->images,wand->exception);
8686 quantize_info=DestroyQuantizeInfo(quantize_info);
8740WandExport MagickBooleanType MagickQuantizeImages(MagickWand *wand,
8741 const size_t number_colors,
const ColorspaceType colorspace,
8742 const size_t treedepth,
const DitherMethod dither_method,
8743 const MagickBooleanType measure_error)
8751 assert(wand != (MagickWand *) NULL);
8752 assert(wand->signature == MagickWandSignature);
8753 if (wand->debug != MagickFalse)
8754 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8755 if (wand->images == (Image *) NULL)
8756 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8757 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
8758 quantize_info->number_colors=number_colors;
8759 quantize_info->dither_method=dither_method;
8760 quantize_info->tree_depth=treedepth;
8761 quantize_info->colorspace=colorspace;
8762 quantize_info->measure_error=measure_error;
8763 status=QuantizeImages(quantize_info,wand->images,wand->exception);
8764 quantize_info=DestroyQuantizeInfo(quantize_info);
8800WandExport MagickBooleanType MagickRangeThresholdImage(MagickWand *wand,
8801 const double low_black,
const double low_white,
const double high_white,
8802 const double high_black)
8807 assert(wand != (MagickWand *) NULL);
8808 assert(wand->signature == MagickWandSignature);
8809 if (wand->debug != MagickFalse)
8810 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8811 if (wand->images == (Image *) NULL)
8812 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8813 status=RangeThresholdImage(wand->images,low_black,low_white,
8814 high_white,high_black,wand->exception);
8843WandExport MagickBooleanType MagickRotationalBlurImage(MagickWand *wand,
8849 assert(wand != (MagickWand *) NULL);
8850 assert(wand->signature == MagickWandSignature);
8851 if (wand->debug != MagickFalse)
8852 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8853 if (wand->images == (Image *) NULL)
8854 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8855 blur_image=RotationalBlurImage(wand->images,angle,wand->exception);
8856 if (blur_image == (Image *) NULL)
8857 return(MagickFalse);
8858 ReplaceImageInList(&wand->images,blur_image);
8894WandExport MagickBooleanType MagickRaiseImage(MagickWand *wand,
8895 const size_t width,
const size_t height,
const ssize_t x,
8896 const ssize_t y,
const MagickBooleanType raise)
8904 assert(wand != (MagickWand *) NULL);
8905 assert(wand->signature == MagickWandSignature);
8906 if (wand->debug != MagickFalse)
8907 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8908 if (wand->images == (Image *) NULL)
8909 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8910 raise_info.width=width;
8911 raise_info.height=height;
8914 status=RaiseImage(wand->images,&raise_info,raise,wand->exception);
8946WandExport MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
8947 const double low,
const double high)
8949 assert(wand != (MagickWand *) NULL);
8950 assert(wand->signature == MagickWandSignature);
8951 if (wand->debug != MagickFalse)
8952 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8953 if (wand->images == (Image *) NULL)
8954 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8955 return(RandomThresholdImage(wand->images,low,high,wand->exception));
8987WandExport MagickBooleanType MagickReadImage(MagickWand *wand,
8988 const char *filename)
8996 assert(wand != (MagickWand *) NULL);
8997 assert(wand->signature == MagickWandSignature);
8998 if (wand->debug != MagickFalse)
8999 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9000 read_info=CloneImageInfo(wand->image_info);
9001 if (filename != (
const char *) NULL)
9002 (void) CopyMagickString(read_info->filename,filename,MagickPathExtent);
9003 images=ReadImage(read_info,wand->exception);
9004 read_info=DestroyImageInfo(read_info);
9005 if (images == (Image *) NULL)
9006 return(MagickFalse);
9007 return(InsertImageInWand(wand,images));
9038WandExport MagickBooleanType MagickReadImageBlob(MagickWand *wand,
9039 const void *blob,
const size_t length)
9044 assert(wand != (MagickWand *) NULL);
9045 assert(wand->signature == MagickWandSignature);
9046 if (wand->debug != MagickFalse)
9047 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9048 images=BlobToImage(wand->image_info,blob,length,wand->exception);
9049 if (images == (Image *) NULL)
9050 return(MagickFalse);
9051 return(InsertImageInWand(wand,images));
9079WandExport MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
9087 assert(wand != (MagickWand *) NULL);
9088 assert(wand->signature == MagickWandSignature);
9089 assert(file != (FILE *) NULL);
9090 if (wand->debug != MagickFalse)
9091 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9092 read_info=CloneImageInfo(wand->image_info);
9093 SetImageInfoFile(read_info,file);
9094 images=ReadImage(read_info,wand->exception);
9095 read_info=DestroyImageInfo(read_info);
9096 if (images == (Image *) NULL)
9097 return(MagickFalse);
9098 return(InsertImageInWand(wand,images));
9130WandExport MagickBooleanType MagickRemapImage(MagickWand *wand,
9131 const MagickWand *remap_wand,
const DitherMethod dither_method)
9139 assert(wand != (MagickWand *) NULL);
9140 assert(wand->signature == MagickWandSignature);
9141 if (wand->debug != MagickFalse)
9142 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9143 if ((wand->images == (Image *) NULL) ||
9144 (remap_wand->images == (Image *) NULL))
9145 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9146 quantize_info=AcquireQuantizeInfo(wand->image_info);
9147 quantize_info->dither_method=dither_method;
9148 status=RemapImage(quantize_info,wand->images,remap_wand->images,
9150 quantize_info=DestroyQuantizeInfo(quantize_info);
9178WandExport MagickBooleanType MagickRemoveImage(MagickWand *wand)
9180 assert(wand != (MagickWand *) NULL);
9181 assert(wand->signature == MagickWandSignature);
9182 if (wand->debug != MagickFalse)
9183 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9184 if (wand->images == (Image *) NULL)
9185 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9186 DeleteImageFromList(&wand->images);
9230WandExport MagickBooleanType MagickResampleImage(MagickWand *wand,
9231 const double x_resolution,
const double y_resolution,
const FilterType filter)
9236 assert(wand != (MagickWand *) NULL);
9237 assert(wand->signature == MagickWandSignature);
9238 if (wand->debug != MagickFalse)
9239 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9240 if (wand->images == (Image *) NULL)
9241 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9242 resample_image=ResampleImage(wand->images,x_resolution,y_resolution,filter,
9244 if (resample_image == (Image *) NULL)
9245 return(MagickFalse);
9246 ReplaceImageInList(&wand->images,resample_image);
9275WandExport MagickBooleanType MagickResetImagePage(MagickWand *wand,
9278 assert(wand != (MagickWand *) NULL);
9279 assert(wand->signature == MagickWandSignature);
9280 if (wand->debug != MagickFalse)
9281 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9282 if (wand->images == (Image *) NULL)
9283 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9284 if ((page == (
char *) NULL) || (*page ==
'\0'))
9286 (void) ParseAbsoluteGeometry(
"0x0+0+0",&wand->images->page);
9289 return(ResetImagePage(wand->images,page));
9332WandExport MagickBooleanType MagickResizeImage(MagickWand *wand,
9333 const size_t columns,
const size_t rows,
const FilterType filter)
9338 assert(wand != (MagickWand *) NULL);
9339 assert(wand->signature == MagickWandSignature);
9340 if (wand->debug != MagickFalse)
9341 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9342 if (wand->images == (Image *) NULL)
9343 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9344 resize_image=ResizeImage(wand->images,columns,rows,filter,wand->exception);
9345 if (resize_image == (Image *) NULL)
9346 return(MagickFalse);
9347 ReplaceImageInList(&wand->images,resize_image);
9379WandExport MagickBooleanType MagickRollImage(MagickWand *wand,
9380 const ssize_t x,
const ssize_t y)
9385 assert(wand != (MagickWand *) NULL);
9386 assert(wand->signature == MagickWandSignature);
9387 if (wand->debug != MagickFalse)
9388 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9389 if (wand->images == (Image *) NULL)
9390 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9391 roll_image=RollImage(wand->images,x,y,wand->exception);
9392 if (roll_image == (Image *) NULL)
9393 return(MagickFalse);
9394 ReplaceImageInList(&wand->images,roll_image);
9428WandExport MagickBooleanType MagickRotateImage(MagickWand *wand,
9429 const PixelWand *background,
const double degrees)
9434 assert(wand != (MagickWand *) NULL);
9435 assert(wand->signature == MagickWandSignature);
9436 if (wand->debug != MagickFalse)
9437 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9438 if (wand->images == (Image *) NULL)
9439 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9440 PixelGetQuantumPacket(background,&wand->images->background_color);
9441 rotate_image=RotateImage(wand->images,degrees,wand->exception);
9442 if (rotate_image == (Image *) NULL)
9443 return(MagickFalse);
9444 ReplaceImageInList(&wand->images,rotate_image);
9478WandExport MagickBooleanType MagickSampleImage(MagickWand *wand,
9479 const size_t columns,
const size_t rows)
9484 assert(wand != (MagickWand *) NULL);
9485 assert(wand->signature == MagickWandSignature);
9486 if (wand->debug != MagickFalse)
9487 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9488 if (wand->images == (Image *) NULL)
9489 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9490 sample_image=SampleImage(wand->images,columns,rows,wand->exception);
9491 if (sample_image == (Image *) NULL)
9492 return(MagickFalse);
9493 ReplaceImageInList(&wand->images,sample_image);
9525WandExport MagickBooleanType MagickScaleImage(MagickWand *wand,
9526 const size_t columns,
const size_t rows)
9531 assert(wand != (MagickWand *) NULL);
9532 assert(wand->signature == MagickWandSignature);
9533 if (wand->debug != MagickFalse)
9534 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9535 if (wand->images == (Image *) NULL)
9536 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9537 scale_image=ScaleImage(wand->images,columns,rows,wand->exception);
9538 if (scale_image == (Image *) NULL)
9539 return(MagickFalse);
9540 ReplaceImageInList(&wand->images,scale_image);
9583MagickExport MagickBooleanType MagickSegmentImage(MagickWand *wand,
9584 const ColorspaceType colorspace,
const MagickBooleanType verbose,
9585 const double cluster_threshold,
const double smooth_threshold)
9590 assert(wand != (MagickWand *) NULL);
9591 assert(wand->signature == MagickWandSignature);
9592 if (wand->debug != MagickFalse)
9593 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9594 if (wand->images == (Image *) NULL)
9595 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9596 status=SegmentImage(wand->images,colorspace,verbose,cluster_threshold,
9597 smooth_threshold,wand->exception);
9634WandExport MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
9635 const double radius,
const double sigma,
const double threshold)
9640 assert(wand != (MagickWand *) NULL);
9641 assert(wand->signature == MagickWandSignature);
9642 if (wand->debug != MagickFalse)
9643 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9644 if (wand->images == (Image *) NULL)
9645 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9646 blur_image=SelectiveBlurImage(wand->images,radius,sigma,threshold,
9648 if (blur_image == (Image *) NULL)
9649 return(MagickFalse);
9650 ReplaceImageInList(&wand->images,blur_image);
9681WandExport MagickBooleanType MagickSeparateImage(MagickWand *wand,
9682 const ChannelType channel)
9687 assert(wand != (MagickWand *) NULL);
9688 assert(wand->signature == MagickWandSignature);
9689 if (wand->debug != MagickFalse)
9690 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9691 if (wand->images == (Image *) NULL)
9692 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9693 separate_image=SeparateImage(wand->images,channel,wand->exception);
9694 if (separate_image == (Image *) NULL)
9695 return(MagickFalse);
9696 ReplaceImageInList(&wand->images,separate_image);
9728WandExport MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
9729 const double threshold)
9734 assert(wand != (MagickWand *) NULL);
9735 assert(wand->signature == MagickWandSignature);
9736 if (wand->debug != MagickFalse)
9737 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9738 if (wand->images == (Image *) NULL)
9739 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9740 sepia_image=SepiaToneImage(wand->images,threshold,wand->exception);
9741 if (sepia_image == (Image *) NULL)
9742 return(MagickFalse);
9743 ReplaceImageInList(&wand->images,sepia_image);
9774WandExport MagickBooleanType MagickSetImage(MagickWand *wand,
9775 const MagickWand *set_wand)
9780 assert(wand != (MagickWand *) NULL);
9781 assert(wand->signature == MagickWandSignature);
9782 if (wand->debug != MagickFalse)
9783 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9784 assert(set_wand != (MagickWand *) NULL);
9785 assert(set_wand->signature == MagickWandSignature);
9786 if (wand->debug != MagickFalse)
9787 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",set_wand->name);
9788 if (set_wand->images == (Image *) NULL)
9789 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9790 images=CloneImageList(set_wand->images,wand->exception);
9791 if (images == (Image *) NULL)
9792 return(MagickFalse);
9793 ReplaceImageInList(&wand->images,images);
9824WandExport MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
9825 const AlphaChannelOption alpha_type)
9827 assert(wand != (MagickWand *) NULL);
9828 assert(wand->signature == MagickWandSignature);
9829 if (wand->debug != MagickFalse)
9830 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9831 if (wand->images == (Image *) NULL)
9832 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9833 return(SetImageAlphaChannel(wand->images,alpha_type,wand->exception));
9861WandExport MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
9862 const PixelWand *background)
9864 assert(wand != (MagickWand *) NULL);
9865 assert(wand->signature == MagickWandSignature);
9866 if (wand->debug != MagickFalse)
9867 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9868 if (wand->images == (Image *) NULL)
9869 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9870 PixelGetQuantumPacket(background,&wand->images->background_color);
9903WandExport MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
9904 const double x,
const double y,
const double z)
9906 assert(wand != (MagickWand *) NULL);
9907 assert(wand->signature == MagickWandSignature);
9908 if (wand->debug != MagickFalse)
9909 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9910 if (wand->images == (Image *) NULL)
9911 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9912 wand->images->chromaticity.blue_primary.x=x;
9913 wand->images->chromaticity.blue_primary.y=y;
9914 wand->images->chromaticity.blue_primary.z=z;
9943WandExport MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
9944 const PixelWand *border)
9946 assert(wand != (MagickWand *) NULL);
9947 assert(wand->signature == MagickWandSignature);
9948 if (wand->debug != MagickFalse)
9949 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9950 if (wand->images == (Image *) NULL)
9951 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9952 PixelGetQuantumPacket(border,&wand->images->border_color);
9981WandExport ChannelType MagickSetImageChannelMask(MagickWand *wand,
9982 const ChannelType channel_mask)
9984 assert(wand != (MagickWand *) NULL);
9985 assert(wand->signature == MagickWandSignature);
9986 if (wand->debug != MagickFalse)
9987 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9988 return(SetImageChannelMask(wand->images,channel_mask));
10018WandExport MagickBooleanType MagickSetImageMask(MagickWand *wand,
10019 const PixelMask type,
const MagickWand *clip_mask)
10021 assert(wand != (MagickWand *) NULL);
10022 assert(wand->signature == MagickWandSignature);
10023 if (wand->debug != MagickFalse)
10024 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10025 assert(clip_mask != (MagickWand *) NULL);
10026 assert(clip_mask->signature == MagickWandSignature);
10027 if (clip_mask->debug != MagickFalse)
10028 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",clip_mask->name);
10029 if (clip_mask->images == (Image *) NULL)
10030 ThrowWandException(WandError,
"ContainsNoImages",clip_mask->name);
10031 return(SetImageMask(wand->images,type,clip_mask->images,wand->exception));
10059WandExport MagickBooleanType MagickSetImageColor(MagickWand *wand,
10060 const PixelWand *color)
10065 assert(wand != (MagickWand *) NULL);
10066 assert(wand->signature == MagickWandSignature);
10067 if (wand->debug != MagickFalse)
10068 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10069 PixelGetMagickColor(color,&pixel);
10070 return(SetImageColor(wand->images,&pixel,wand->exception));
10101WandExport MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
10102 const size_t index,
const PixelWand *color)
10104 assert(wand != (MagickWand *) NULL);
10105 assert(wand->signature == MagickWandSignature);
10106 if (wand->debug != MagickFalse)
10107 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10108 if (wand->images == (Image *) NULL)
10109 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10110 if ((wand->images->colormap == (PixelInfo *) NULL) ||
10111 (index >= wand->images->colors))
10112 ThrowWandException(WandError,
"InvalidColormapIndex",wand->name);
10113 PixelGetQuantumPacket(color,wand->images->colormap+index);
10114 return(SyncImage(wand->images,wand->exception));
10147WandExport MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
10148 const ColorspaceType colorspace)
10150 assert(wand != (MagickWand *) NULL);
10151 assert(wand->signature == MagickWandSignature);
10152 if (wand->debug != MagickFalse)
10153 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10154 if (wand->images == (Image *) NULL)
10155 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10156 return(SetImageColorspace(wand->images,colorspace,wand->exception));
10186WandExport MagickBooleanType MagickSetImageCompose(MagickWand *wand,
10187 const CompositeOperator compose)
10189 assert(wand != (MagickWand *) NULL);
10190 assert(wand->signature == MagickWandSignature);
10191 if (wand->debug != MagickFalse)
10192 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10193 if (wand->images == (Image *) NULL)
10194 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10195 wand->images->compose=compose;
10196 return(MagickTrue);
10224WandExport MagickBooleanType MagickSetImageCompression(MagickWand *wand,
10225 const CompressionType compression)
10227 assert(wand != (MagickWand *) NULL);
10228 assert(wand->signature == MagickWandSignature);
10229 if (wand->debug != MagickFalse)
10230 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10231 if (wand->images == (Image *) NULL)
10232 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10233 wand->images->compression=compression;
10234 return(MagickTrue);
10262WandExport MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
10263 const size_t quality)
10265 assert(wand != (MagickWand *) NULL);
10266 assert(wand->signature == MagickWandSignature);
10267 if (wand->debug != MagickFalse)
10268 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10269 if (wand->images == (Image *) NULL)
10270 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10271 wand->images->quality=quality;
10272 return(MagickTrue);
10300WandExport MagickBooleanType MagickSetImageDelay(MagickWand *wand,
10301 const size_t delay)
10303 assert(wand != (MagickWand *) NULL);
10304 assert(wand->signature == MagickWandSignature);
10305 if (wand->debug != MagickFalse)
10306 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10307 if (wand->images == (Image *) NULL)
10308 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10309 wand->images->delay=delay;
10310 return(MagickTrue);
10338WandExport MagickBooleanType MagickSetImageDepth(MagickWand *wand,
10339 const size_t depth)
10341 assert(wand != (MagickWand *) NULL);
10342 assert(wand->signature == MagickWandSignature);
10343 if (wand->debug != MagickFalse)
10344 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10345 if (wand->images == (Image *) NULL)
10346 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10347 return(SetImageDepth(wand->images,depth,wand->exception));
10375WandExport MagickBooleanType MagickSetImageDispose(MagickWand *wand,
10376 const DisposeType dispose)
10378 assert(wand != (MagickWand *) NULL);
10379 assert(wand->signature == MagickWandSignature);
10380 if (wand->debug != MagickFalse)
10381 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10382 if (wand->images == (Image *) NULL)
10383 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10384 wand->images->dispose=dispose;
10385 return(MagickTrue);
10413WandExport MagickBooleanType MagickSetImageEndian(MagickWand *wand,
10414 const EndianType endian)
10416 assert(wand != (MagickWand *) NULL);
10417 assert(wand->signature == MagickWandSignature);
10418 if (wand->debug != MagickFalse)
10419 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10420 if (wand->images == (Image *) NULL)
10421 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10422 wand->images->endian=endian;
10423 return(MagickTrue);
10453WandExport MagickBooleanType MagickSetImageExtent(MagickWand *wand,
10454 const size_t columns,
const size_t rows)
10456 assert(wand != (MagickWand *) NULL);
10457 assert(wand->signature == MagickWandSignature);
10458 if (wand->debug != MagickFalse)
10459 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10460 if (wand->images == (Image *) NULL)
10461 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10462 return(SetImageExtent(wand->images,columns,rows,wand->exception));
10491WandExport MagickBooleanType MagickSetImageFilename(MagickWand *wand,
10492 const char *filename)
10494 assert(wand != (MagickWand *) NULL);
10495 assert(wand->signature == MagickWandSignature);
10496 if (wand->debug != MagickFalse)
10497 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10498 if (wand->images == (Image *) NULL)
10499 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10500 if (filename == (
const char *) NULL)
10501 return(MagickFalse);
10502 (void) CopyMagickString(wand->images->filename,filename,MagickPathExtent);
10503 return(MagickTrue);
10535WandExport MagickBooleanType MagickSetImageFilter(MagickWand *wand,
10536 const FilterType filter)
10538 assert(wand != (MagickWand *) NULL);
10539 assert(wand->signature == MagickWandSignature);
10540 if (wand->debug != MagickFalse)
10541 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10542 if (wand->images == (Image *) NULL)
10543 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10544 wand->images->filter=filter;
10545 return(MagickTrue);
10574WandExport MagickBooleanType MagickSetImageFormat(MagickWand *wand,
10575 const char *format)
10580 assert(wand != (MagickWand *) NULL);
10581 assert(wand->signature == MagickWandSignature);
10582 if (wand->debug != MagickFalse)
10583 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10584 if (wand->images == (Image *) NULL)
10585 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10586 if ((format == (
char *) NULL) || (*format ==
'\0'))
10588 *wand->images->magick=
'\0';
10589 return(MagickTrue);
10591 magick_info=GetMagickInfo(format,wand->exception);
10592 if (magick_info == (
const MagickInfo *) NULL)
10593 return(MagickFalse);
10594 ClearMagickException(wand->exception);
10595 (void) CopyMagickString(wand->images->magick,format,MagickPathExtent);
10596 LocaleUpper(wand->images->magick);
10597 return(MagickTrue);
10625WandExport MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
10628 assert(wand != (MagickWand *) NULL);
10629 assert(wand->signature == MagickWandSignature);
10630 if (wand->debug != MagickFalse)
10631 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10632 if (wand->images == (Image *) NULL)
10633 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10634 wand->images->fuzz=fuzz;
10635 return(MagickTrue);
10663WandExport MagickBooleanType MagickSetImageGamma(MagickWand *wand,
10664 const double gamma)
10666 assert(wand != (MagickWand *) NULL);
10667 assert(wand->signature == MagickWandSignature);
10668 if (wand->debug != MagickFalse)
10669 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10670 if (wand->images == (Image *) NULL)
10671 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10672 wand->images->gamma=gamma;
10673 return(MagickTrue);
10704WandExport MagickBooleanType MagickSetImageGravity(MagickWand *wand,
10705 const GravityType gravity)
10707 assert(wand != (MagickWand *) NULL);
10708 assert(wand->signature == MagickWandSignature);
10709 if (wand->debug != MagickFalse)
10710 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10711 if (wand->images == (Image *) NULL)
10712 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10713 wand->images->gravity=gravity;
10714 return(MagickTrue);
10747WandExport MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
10748 const double x,
const double y,
const double z)
10750 assert(wand != (MagickWand *) NULL);
10751 assert(wand->signature == MagickWandSignature);
10752 if (wand->debug != MagickFalse)
10753 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10754 if (wand->images == (Image *) NULL)
10755 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10756 wand->images->chromaticity.green_primary.x=x;
10757 wand->images->chromaticity.green_primary.y=y;
10758 wand->images->chromaticity.green_primary.z=z;
10759 return(MagickTrue);
10788WandExport MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
10789 const InterlaceType interlace)
10791 assert(wand != (MagickWand *) NULL);
10792 assert(wand->signature == MagickWandSignature);
10793 if (wand->debug != MagickFalse)
10794 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10795 if (wand->images == (Image *) NULL)
10796 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10797 wand->images->interlace=interlace;
10798 return(MagickTrue);
10828WandExport MagickBooleanType MagickSetImagePixelInterpolateMethod(
10829 MagickWand *wand,
const PixelInterpolateMethod method)
10831 return(MagickSetImageInterpolateMethod(wand,method));
10834WandExport MagickBooleanType MagickSetImageInterpolateMethod(
10835 MagickWand *wand,
const PixelInterpolateMethod method)
10837 assert(wand != (MagickWand *) NULL);
10838 assert(wand->signature == MagickWandSignature);
10839 if (wand->debug != MagickFalse)
10840 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10841 if (wand->images == (Image *) NULL)
10842 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10843 wand->images->interpolate=method;
10844 return(MagickTrue);
10872WandExport MagickBooleanType MagickSetImageIterations(MagickWand *wand,
10873 const size_t iterations)
10875 assert(wand != (MagickWand *) NULL);
10876 assert(wand->signature == MagickWandSignature);
10877 if (wand->debug != MagickFalse)
10878 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10879 if (wand->images == (Image *) NULL)
10880 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10881 wand->images->iterations=iterations;
10882 return(MagickTrue);
10911WandExport MagickBooleanType MagickSetImageMatte(MagickWand *wand,
10912 const MagickBooleanType matte)
10914 assert(wand != (MagickWand *) NULL);
10915 assert(wand->signature == MagickWandSignature);
10916 if (wand->debug != MagickFalse)
10917 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10918 if (wand->images == (Image *) NULL)
10919 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10920 if (matte == MagickFalse)
10921 wand->images->alpha_trait=UndefinedPixelTrait;
10924 if (wand->images->alpha_trait == UndefinedPixelTrait)
10925 (void) SetImageAlpha(wand->images,OpaqueAlpha,wand->exception);
10926 wand->images->alpha_trait=BlendPixelTrait;
10928 return(MagickTrue);
10956WandExport MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
10957 const PixelWand *alpha)
10959 assert(wand != (MagickWand *)NULL);
10960 assert(wand->signature == MagickWandSignature);
10961 if (wand->debug != MagickFalse)
10962 (void) LogMagickEvent(WandEvent, GetMagickModule(),
"%s", wand->name);
10963 if (wand->images == (Image *)NULL)
10964 ThrowWandException(WandError,
"ContainsNoImages", wand->name);
10965 PixelGetQuantumPacket(alpha,&wand->images->matte_color);
10966 return(MagickTrue);
10995WandExport MagickBooleanType MagickSetImageAlpha(MagickWand *wand,
10996 const double alpha)
11001 assert(wand != (MagickWand *) NULL);
11002 assert(wand->signature == MagickWandSignature);
11003 if (wand->debug != MagickFalse)
11004 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11005 if (wand->images == (Image *) NULL)
11006 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11007 status=SetImageAlpha(wand->images,ClampToQuantum((
double) QuantumRange*alpha),
11037WandExport MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
11038 const OrientationType orientation)
11040 assert(wand != (MagickWand *) NULL);
11041 assert(wand->signature == MagickWandSignature);
11042 if (wand->debug != MagickFalse)
11043 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11044 if (wand->images == (Image *) NULL)
11045 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11046 wand->images->orientation=orientation;
11047 return(MagickTrue);
11080WandExport MagickBooleanType MagickSetImagePage(MagickWand *wand,
11081 const size_t width,
const size_t height,
const ssize_t x,
11084 assert(wand != (MagickWand *) NULL);
11085 assert(wand->signature == MagickWandSignature);
11086 if (wand->debug != MagickFalse)
11087 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11088 if (wand->images == (Image *) NULL)
11089 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11090 wand->images->page.width=width;
11091 wand->images->page.height=height;
11092 wand->images->page.x=x;
11093 wand->images->page.y=y;
11094 return(MagickTrue);
11124WandExport MagickBooleanType MagickSetImagePixelColor(MagickWand *wand,
11125 const ssize_t x,
const ssize_t y,
const PixelWand *color)
11133 assert(wand != (MagickWand *) NULL);
11134 assert(wand->signature == MagickWandSignature);
11135 if (wand->debug != MagickFalse)
11136 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11137 if (wand->images == (Image *) NULL)
11138 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11139 image_view=AcquireAuthenticCacheView(wand->images,wand->exception);
11140 q=GetCacheViewAuthenticPixels(image_view,x,y,1,1,wand->exception);
11141 if (q == (Quantum *) NULL)
11143 image_view=DestroyCacheView(image_view);
11144 return(MagickFalse);
11146 PixelGetQuantumPixel(wand->images,color,q);
11147 image_view=DestroyCacheView(image_view);
11148 return(MagickTrue);
11188WandExport MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand,
11189 const MagickProgressMonitor progress_monitor,
void *client_data)
11191 MagickProgressMonitor
11194 assert(wand != (MagickWand *) NULL);
11195 assert(wand->signature == MagickWandSignature);
11196 if (wand->debug != MagickFalse)
11197 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11198 if (wand->images == (Image *) NULL)
11200 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11201 "ContainsNoImages",
"`%s'",wand->name);
11202 return((MagickProgressMonitor) NULL);
11204 previous_monitor=SetImageProgressMonitor(wand->images,
11205 progress_monitor,client_data);
11206 return(previous_monitor);
11238WandExport MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
11239 const double x,
const double y,
const double z)
11241 assert(wand != (MagickWand *) NULL);
11242 assert(wand->signature == MagickWandSignature);
11243 if (wand->debug != MagickFalse)
11244 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11245 if (wand->images == (Image *) NULL)
11246 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11247 wand->images->chromaticity.red_primary.x=x;
11248 wand->images->chromaticity.red_primary.y=y;
11249 wand->images->chromaticity.red_primary.z=z;
11250 return(MagickTrue);
11279WandExport MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
11280 const RenderingIntent rendering_intent)
11282 assert(wand != (MagickWand *) NULL);
11283 assert(wand->signature == MagickWandSignature);
11284 if (wand->debug != MagickFalse)
11285 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11286 if (wand->images == (Image *) NULL)
11287 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11288 wand->images->rendering_intent=rendering_intent;
11289 return(MagickTrue);
11319WandExport MagickBooleanType MagickSetImageResolution(MagickWand *wand,
11320 const double x_resolution,
const double y_resolution)
11322 assert(wand != (MagickWand *) NULL);
11323 assert(wand->signature == MagickWandSignature);
11324 if (wand->debug != MagickFalse)
11325 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11326 if (wand->images == (Image *) NULL)
11327 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11328 wand->images->resolution.x=x_resolution;
11329 wand->images->resolution.y=y_resolution;
11330 return(MagickTrue);
11358WandExport MagickBooleanType MagickSetImageScene(MagickWand *wand,
11359 const size_t scene)
11361 assert(wand != (MagickWand *) NULL);
11362 assert(wand->signature == MagickWandSignature);
11363 if (wand->debug != MagickFalse)
11364 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11365 if (wand->images == (Image *) NULL)
11366 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11367 wand->images->scene=scene;
11368 return(MagickTrue);
11396WandExport MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
11397 const ssize_t ticks_per_second)
11399 assert(wand != (MagickWand *) NULL);
11400 assert(wand->signature == MagickWandSignature);
11401 if (wand->debug != MagickFalse)
11402 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11403 if (wand->images == (Image *) NULL)
11404 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11405 wand->images->ticks_per_second=ticks_per_second;
11406 return(MagickTrue);
11437WandExport MagickBooleanType MagickSetImageType(MagickWand *wand,
11438 const ImageType image_type)
11440 assert(wand != (MagickWand *) NULL);
11441 assert(wand->signature == MagickWandSignature);
11442 if (wand->debug != MagickFalse)
11443 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11444 if (wand->images == (Image *) NULL)
11445 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11446 return(SetImageType(wand->images,image_type,wand->exception));
11475WandExport MagickBooleanType MagickSetImageUnits(MagickWand *wand,
11476 const ResolutionType units)
11478 assert(wand != (MagickWand *) NULL);
11479 assert(wand->signature == MagickWandSignature);
11480 if (wand->debug != MagickFalse)
11481 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11482 if (wand->images == (Image *) NULL)
11483 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11484 wand->images->units=units;
11485 return(MagickTrue);
11515WandExport VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
11516 const VirtualPixelMethod method)
11518 assert(wand != (MagickWand *) NULL);
11519 assert(wand->signature == MagickWandSignature);
11520 if (wand->debug != MagickFalse)
11521 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11522 if (wand->images == (Image *) NULL)
11523 return(UndefinedVirtualPixelMethod);
11524 return(SetImageVirtualPixelMethod(wand->images,method,wand->exception));
11556WandExport MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
11557 const double x,
const double y,
const double z)
11559 assert(wand != (MagickWand *) NULL);
11560 assert(wand->signature == MagickWandSignature);
11561 if (wand->debug != MagickFalse)
11562 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11563 if (wand->images == (Image *) NULL)
11564 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11565 wand->images->chromaticity.white_point.x=x;
11566 wand->images->chromaticity.white_point.y=y;
11567 wand->images->chromaticity.white_point.z=z;
11568 return(MagickTrue);
11602WandExport MagickBooleanType MagickShadeImage(MagickWand *wand,
11603 const MagickBooleanType gray,
const double azimuth,
const double elevation)
11608 assert(wand != (MagickWand *) NULL);
11609 assert(wand->signature == MagickWandSignature);
11610 if (wand->debug != MagickFalse)
11611 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11612 if (wand->images == (Image *) NULL)
11613 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11614 shade_image=ShadeImage(wand->images,gray,azimuth,elevation,wand->exception);
11615 if (shade_image == (Image *) NULL)
11616 return(MagickFalse);
11617 ReplaceImageInList(&wand->images,shade_image);
11618 return(MagickTrue);
11652WandExport MagickBooleanType MagickShadowImage(MagickWand *wand,
11653 const double alpha,
const double sigma,
const ssize_t x,
const ssize_t y)
11658 assert(wand != (MagickWand *) NULL);
11659 assert(wand->signature == MagickWandSignature);
11660 if (wand->debug != MagickFalse)
11661 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11662 if (wand->images == (Image *) NULL)
11663 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11664 shadow_image=ShadowImage(wand->images,alpha,sigma,x,y,wand->exception);
11665 if (shadow_image == (Image *) NULL)
11666 return(MagickFalse);
11667 ReplaceImageInList(&wand->images,shadow_image);
11668 return(MagickTrue);
11702WandExport MagickBooleanType MagickSharpenImage(MagickWand *wand,
11703 const double radius,
const double sigma)
11708 assert(wand != (MagickWand *) NULL);
11709 assert(wand->signature == MagickWandSignature);
11710 if (wand->debug != MagickFalse)
11711 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11712 if (wand->images == (Image *) NULL)
11713 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11714 sharp_image=SharpenImage(wand->images,radius,sigma,wand->exception);
11715 if (sharp_image == (Image *) NULL)
11716 return(MagickFalse);
11717 ReplaceImageInList(&wand->images,sharp_image);
11718 return(MagickTrue);
11751WandExport MagickBooleanType MagickShaveImage(MagickWand *wand,
11752 const size_t columns,
const size_t rows)
11760 assert(wand != (MagickWand *) NULL);
11761 assert(wand->signature == MagickWandSignature);
11762 if (wand->debug != MagickFalse)
11763 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11764 if (wand->images == (Image *) NULL)
11765 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11766 shave_info.width=columns;
11767 shave_info.height=rows;
11770 shave_image=ShaveImage(wand->images,&shave_info,wand->exception);
11771 if (shave_image == (Image *) NULL)
11772 return(MagickFalse);
11773 ReplaceImageInList(&wand->images,shave_image);
11774 return(MagickTrue);
11812WandExport MagickBooleanType MagickShearImage(MagickWand *wand,
11813 const PixelWand *background,
const double x_shear,
const double y_shear)
11818 assert(wand != (MagickWand *) NULL);
11819 assert(wand->signature == MagickWandSignature);
11820 if (wand->debug != MagickFalse)
11821 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11822 if (wand->images == (Image *) NULL)
11823 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11824 PixelGetQuantumPacket(background,&wand->images->background_color);
11825 shear_image=ShearImage(wand->images,x_shear,y_shear,wand->exception);
11826 if (shear_image == (Image *) NULL)
11827 return(MagickFalse);
11828 ReplaceImageInList(&wand->images,shear_image);
11829 return(MagickTrue);
11869WandExport MagickBooleanType MagickSigmoidalContrastImage(
11870 MagickWand *wand,
const MagickBooleanType sharpen,
const double alpha,
11876 assert(wand != (MagickWand *) NULL);
11877 assert(wand->signature == MagickWandSignature);
11878 if (wand->debug != MagickFalse)
11879 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11880 if (wand->images == (Image *) NULL)
11881 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11882 status=SigmoidalContrastImage(wand->images,sharpen,alpha,beta,
11925WandExport MagickWand *MagickSimilarityImage(MagickWand *wand,
11926 const MagickWand *reference,
const MetricType metric,
11927 const double similarity_threshold,RectangleInfo *offset,
double *similarity)
11932 assert(wand != (MagickWand *) NULL);
11933 assert(wand->signature == MagickWandSignature);
11934 if (wand->debug != MagickFalse)
11935 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11936 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
11938 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11939 "ContainsNoImages",
"`%s'",wand->name);
11940 return((MagickWand *) NULL);
11942 similarity_image=SimilarityImage(wand->images,reference->images,metric,
11943 similarity_threshold,offset,similarity,wand->exception);
11944 if (similarity_image == (Image *) NULL)
11945 return((MagickWand *) NULL);
11946 return(CloneMagickWandFromImages(wand,similarity_image));
11983WandExport MagickBooleanType MagickSketchImage(MagickWand *wand,
11984 const double radius,
const double sigma,
const double angle)
11989 assert(wand != (MagickWand *) NULL);
11990 assert(wand->signature == MagickWandSignature);
11991 if (wand->debug != MagickFalse)
11992 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11993 if (wand->images == (Image *) NULL)
11994 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11995 sketch_image=SketchImage(wand->images,radius,sigma,angle,wand->exception);
11996 if (sketch_image == (Image *) NULL)
11997 return(MagickFalse);
11998 ReplaceImageInList(&wand->images,sketch_image);
11999 return(MagickTrue);
12032WandExport MagickWand *MagickSmushImages(MagickWand *wand,
12033 const MagickBooleanType stack,
const ssize_t offset)
12038 assert(wand != (MagickWand *) NULL);
12039 assert(wand->signature == MagickWandSignature);
12040 if (wand->debug != MagickFalse)
12041 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12042 if (wand->images == (Image *) NULL)
12043 return((MagickWand *) NULL);
12044 smush_image=SmushImages(wand->images,stack,offset,wand->exception);
12045 if (smush_image == (Image *) NULL)
12046 return((MagickWand *) NULL);
12047 return(CloneMagickWandFromImages(wand,smush_image));
12078WandExport MagickBooleanType MagickSolarizeImage(MagickWand *wand,
12079 const double threshold)
12084 assert(wand != (MagickWand *) NULL);
12085 assert(wand->signature == MagickWandSignature);
12086 if (wand->debug != MagickFalse)
12087 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12088 if (wand->images == (Image *) NULL)
12089 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12090 status=SolarizeImage(wand->images,threshold,wand->exception);
12145WandExport MagickBooleanType MagickSparseColorImage(MagickWand *wand,
12146 const SparseColorMethod method,
const size_t number_arguments,
12147 const double *arguments)
12152 assert(wand != (MagickWand *) NULL);
12153 assert(wand->signature == MagickWandSignature);
12154 if (wand->debug != MagickFalse)
12155 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12156 if (wand->images == (Image *) NULL)
12157 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12158 sparse_image=SparseColorImage(wand->images,method,number_arguments,arguments,
12160 if (sparse_image == (Image *) NULL)
12161 return(MagickFalse);
12162 ReplaceImageInList(&wand->images,sparse_image);
12163 return(MagickTrue);
12198WandExport MagickBooleanType MagickSpliceImage(MagickWand *wand,
12199 const size_t width,
const size_t height,
const ssize_t x,
12208 assert(wand != (MagickWand *) NULL);
12209 assert(wand->signature == MagickWandSignature);
12210 if (wand->debug != MagickFalse)
12211 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12212 if (wand->images == (Image *) NULL)
12213 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12214 splice.width=width;
12215 splice.height=height;
12218 splice_image=SpliceImage(wand->images,&splice,wand->exception);
12219 if (splice_image == (Image *) NULL)
12220 return(MagickFalse);
12221 ReplaceImageInList(&wand->images,splice_image);
12222 return(MagickTrue);
12253WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand,
12254 const PixelInterpolateMethod method,
const double radius)
12259 assert(wand != (MagickWand *) NULL);
12260 assert(wand->signature == MagickWandSignature);
12261 if (wand->debug != MagickFalse)
12262 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12263 if (wand->images == (Image *) NULL)
12264 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12265 spread_image=SpreadImage(wand->images,method,radius,wand->exception);
12266 if (spread_image == (Image *) NULL)
12267 return(MagickFalse);
12268 ReplaceImageInList(&wand->images,spread_image);
12269 return(MagickTrue);
12302WandExport MagickBooleanType MagickStatisticImage(MagickWand *wand,
12303 const StatisticType type,
const size_t width,
const size_t height)
12308 assert(wand != (MagickWand *) NULL);
12309 assert(wand->signature == MagickWandSignature);
12310 if (wand->debug != MagickFalse)
12311 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12312 if (wand->images == (Image *) NULL)
12313 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12314 statistic_image=StatisticImage(wand->images,type,width,height,
12316 if (statistic_image == (Image *) NULL)
12317 return(MagickFalse);
12318 ReplaceImageInList(&wand->images,statistic_image);
12319 return(MagickTrue);
12352WandExport MagickWand *MagickSteganoImage(MagickWand *wand,
12353 const MagickWand *watermark_wand,
const ssize_t offset)
12358 assert(wand != (MagickWand *) NULL);
12359 assert(wand->signature == MagickWandSignature);
12360 if (wand->debug != MagickFalse)
12361 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12362 if ((wand->images == (Image *) NULL) ||
12363 (watermark_wand->images == (Image *) NULL))
12365 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
12366 "ContainsNoImages",
"`%s'",wand->name);
12367 return((MagickWand *) NULL);
12369 wand->images->offset=offset;
12370 stegano_image=SteganoImage(wand->images,watermark_wand->images,
12372 if (stegano_image == (Image *) NULL)
12373 return((MagickWand *) NULL);
12374 return(CloneMagickWandFromImages(wand,stegano_image));
12403WandExport MagickWand *MagickStereoImage(MagickWand *wand,
12404 const MagickWand *offset_wand)
12409 assert(wand != (MagickWand *) NULL);
12410 assert(wand->signature == MagickWandSignature);
12411 if (wand->debug != MagickFalse)
12412 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12413 if ((wand->images == (Image *) NULL) ||
12414 (offset_wand->images == (Image *) NULL))
12416 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
12417 "ContainsNoImages",
"`%s'",wand->name);
12418 return((MagickWand *) NULL);
12420 stereo_image=StereoImage(wand->images,offset_wand->images,wand->exception);
12421 if (stereo_image == (Image *) NULL)
12422 return((MagickWand *) NULL);
12423 return(CloneMagickWandFromImages(wand,stereo_image));
12448WandExport MagickBooleanType MagickStripImage(MagickWand *wand)
12450 assert(wand != (MagickWand *) NULL);
12451 assert(wand->signature == MagickWandSignature);
12452 if (wand->debug != MagickFalse)
12453 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12454 if (wand->images == (Image *) NULL)
12455 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12456 return(StripImage(wand->images,wand->exception));
12488WandExport MagickBooleanType MagickSwirlImage(MagickWand *wand,
12489 const double degrees,
const PixelInterpolateMethod method)
12494 assert(wand != (MagickWand *) NULL);
12495 assert(wand->signature == MagickWandSignature);
12496 if (wand->debug != MagickFalse)
12497 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12498 if (wand->images == (Image *) NULL)
12499 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12500 swirl_image=SwirlImage(wand->images,degrees,method,wand->exception);
12501 if (swirl_image == (Image *) NULL)
12502 return(MagickFalse);
12503 ReplaceImageInList(&wand->images,swirl_image);
12504 return(MagickTrue);
12533WandExport MagickWand *MagickTextureImage(MagickWand *wand,
12534 const MagickWand *texture_wand)
12542 assert(wand != (MagickWand *) NULL);
12543 assert(wand->signature == MagickWandSignature);
12544 if (wand->debug != MagickFalse)
12545 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12546 if ((wand->images == (Image *) NULL) ||
12547 (texture_wand->images == (Image *) NULL))
12549 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
12550 "ContainsNoImages",
"`%s'",wand->name);
12551 return((MagickWand *) NULL);
12553 texture_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12554 if (texture_image == (Image *) NULL)
12555 return((MagickWand *) NULL);
12556 status=TextureImage(texture_image,texture_wand->images,wand->exception);
12557 if (status == MagickFalse)
12559 texture_image=DestroyImage(texture_image);
12560 return((MagickWand *) NULL);
12562 return(CloneMagickWandFromImages(wand,texture_image));
12596WandExport MagickBooleanType MagickThresholdImage(MagickWand *wand,
12597 const double threshold)
12602 status=MagickThresholdImageChannel(wand,DefaultChannels,threshold);
12606WandExport MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
12607 const ChannelType channel,
const double threshold)
12615 assert(wand != (MagickWand *) NULL);
12616 assert(wand->signature == MagickWandSignature);
12617 if (wand->debug != MagickFalse)
12618 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12619 if (wand->images == (Image *) NULL)
12620 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12621 channel_mask=SetImageChannelMask(wand->images,channel);
12622 status=BilevelImage(wand->images,threshold,wand->exception);
12623 (void) SetImageChannelMask(wand->images,channel_mask);
12656WandExport MagickBooleanType MagickThumbnailImage(MagickWand *wand,
12657 const size_t columns,
const size_t rows)
12662 assert(wand != (MagickWand *) NULL);
12663 assert(wand->signature == MagickWandSignature);
12664 if (wand->debug != MagickFalse)
12665 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12666 if (wand->images == (Image *) NULL)
12667 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12668 thumbnail_image=ThumbnailImage(wand->images,columns,rows,wand->exception);
12669 if (thumbnail_image == (Image *) NULL)
12670 return(MagickFalse);
12671 ReplaceImageInList(&wand->images,thumbnail_image);
12672 return(MagickTrue);
12705WandExport MagickBooleanType MagickTintImage(MagickWand *wand,
12706 const PixelWand *tint,
const PixelWand *blend)
12709 percent_blend[MagickPathExtent];
12717 assert(wand != (MagickWand *) NULL);
12718 assert(wand->signature == MagickWandSignature);
12719 if (wand->debug != MagickFalse)
12720 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12721 if (wand->images == (Image *) NULL)
12722 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12723 if (wand->images->colorspace != CMYKColorspace)
12724 (void) FormatLocaleString(percent_blend,MagickPathExtent,
12725 "%g,%g,%g,%g",(
double) (100.0*QuantumScale*
12726 (
double) PixelGetRedQuantum(blend)),(
double) (100.0*QuantumScale*
12727 (
double) PixelGetGreenQuantum(blend)),(
double) (100.0*QuantumScale*
12728 (
double) PixelGetBlueQuantum(blend)),(
double) (100.0*QuantumScale*
12729 (
double) PixelGetAlphaQuantum(blend)));
12731 (
void) FormatLocaleString(percent_blend,MagickPathExtent,
12732 "%g,%g,%g,%g,%g",(
double) (100.0*QuantumScale*
12733 (
double) PixelGetCyanQuantum(blend)),(
double) (100.0*QuantumScale*
12734 (
double) PixelGetMagentaQuantum(blend)),(
double) (100.0*QuantumScale*
12735 (
double) PixelGetYellowQuantum(blend)),(
double) (100.0*QuantumScale*
12736 (
double) PixelGetBlackQuantum(blend)),(
double) (100.0*QuantumScale*
12737 (
double) PixelGetAlphaQuantum(blend)));
12738 target=PixelGetPixel(tint);
12739 tint_image=TintImage(wand->images,percent_blend,&target,wand->exception);
12740 if (tint_image == (Image *) NULL)
12741 return(MagickFalse);
12742 ReplaceImageInList(&wand->images,tint_image);
12743 return(MagickTrue);
12778WandExport MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
12779 const ColorspaceType colorspace)
12781 assert(wand != (MagickWand *) NULL);
12782 assert(wand->signature == MagickWandSignature);
12783 if (wand->debug != MagickFalse)
12784 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12785 if (wand->images == (Image *) NULL)
12786 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12787 return(TransformImageColorspace(wand->images,colorspace,wand->exception));
12830WandExport MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
12831 const PixelWand *target,
const double alpha,
const double fuzz,
12832 const MagickBooleanType invert)
12840 assert(wand != (MagickWand *) NULL);
12841 assert(wand->signature == MagickWandSignature);
12842 if (wand->debug != MagickFalse)
12843 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12844 if (wand->images == (Image *) NULL)
12845 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12846 PixelGetMagickColor(target,&target_pixel);
12847 wand->images->fuzz=fuzz;
12848 status=TransparentPaintImage(wand->images,&target_pixel,ClampToQuantum(
12849 (
double) QuantumRange*alpha),invert,wand->exception);
12876WandExport MagickBooleanType MagickTransposeImage(MagickWand *wand)
12881 assert(wand != (MagickWand *) NULL);
12882 assert(wand->signature == MagickWandSignature);
12883 if (wand->debug != MagickFalse)
12884 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12885 if (wand->images == (Image *) NULL)
12886 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12887 transpose_image=TransposeImage(wand->images,wand->exception);
12888 if (transpose_image == (Image *) NULL)
12889 return(MagickFalse);
12890 ReplaceImageInList(&wand->images,transpose_image);
12891 return(MagickTrue);
12917WandExport MagickBooleanType MagickTransverseImage(MagickWand *wand)
12922 assert(wand != (MagickWand *) NULL);
12923 assert(wand->signature == MagickWandSignature);
12924 if (wand->debug != MagickFalse)
12925 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12926 if (wand->images == (Image *) NULL)
12927 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12928 transverse_image=TransverseImage(wand->images,wand->exception);
12929 if (transverse_image == (Image *) NULL)
12930 return(MagickFalse);
12931 ReplaceImageInList(&wand->images,transverse_image);
12932 return(MagickTrue);
12964WandExport MagickBooleanType MagickTrimImage(MagickWand *wand,
const double fuzz)
12969 assert(wand != (MagickWand *) NULL);
12970 assert(wand->signature == MagickWandSignature);
12971 if (wand->debug != MagickFalse)
12972 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12973 if (wand->images == (Image *) NULL)
12974 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12975 wand->images->fuzz=fuzz;
12976 trim_image=TrimImage(wand->images,wand->exception);
12977 if (trim_image == (Image *) NULL)
12978 return(MagickFalse);
12979 ReplaceImageInList(&wand->images,trim_image);
12980 return(MagickTrue);
13005WandExport MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
13010 assert(wand != (MagickWand *) NULL);
13011 assert(wand->signature == MagickWandSignature);
13012 if (wand->debug != MagickFalse)
13013 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13014 if (wand->images == (Image *) NULL)
13015 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13016 unique_image=UniqueImageColors(wand->images,wand->exception);
13017 if (unique_image == (Image *) NULL)
13018 return(MagickFalse);
13019 ReplaceImageInList(&wand->images,unique_image);
13020 return(MagickTrue);
13060WandExport MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
13061 const double radius,
const double sigma,
const double gain,
13062 const double threshold)
13067 assert(wand != (MagickWand *) NULL);
13068 assert(wand->signature == MagickWandSignature);
13069 if (wand->debug != MagickFalse)
13070 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13071 if (wand->images == (Image *) NULL)
13072 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13073 unsharp_image=UnsharpMaskImage(wand->images,radius,sigma,gain,threshold,
13075 if (unsharp_image == (Image *) NULL)
13076 return(MagickFalse);
13077 ReplaceImageInList(&wand->images,unsharp_image);
13078 return(MagickTrue);
13111WandExport MagickBooleanType MagickVignetteImage(MagickWand *wand,
13112 const double radius,
const double sigma,
const ssize_t x,
const ssize_t y)
13117 assert(wand != (MagickWand *) NULL);
13118 assert(wand->signature == MagickWandSignature);
13119 if (wand->debug != MagickFalse)
13120 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13121 if (wand->images == (Image *) NULL)
13122 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13123 vignette_image=VignetteImage(wand->images,radius,sigma,x,y,wand->exception);
13124 if (vignette_image == (Image *) NULL)
13125 return(MagickFalse);
13126 ReplaceImageInList(&wand->images,vignette_image);
13127 return(MagickTrue);
13161WandExport MagickBooleanType MagickWaveImage(MagickWand *wand,
13162 const double amplitude,
const double wave_length,
13163 const PixelInterpolateMethod method)
13168 assert(wand != (MagickWand *) NULL);
13169 assert(wand->signature == MagickWandSignature);
13170 if (wand->debug != MagickFalse)
13171 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13172 if (wand->images == (Image *) NULL)
13173 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13174 wave_image=WaveImage(wand->images,amplitude,wave_length,method,
13176 if (wave_image == (Image *) NULL)
13177 return(MagickFalse);
13178 ReplaceImageInList(&wand->images,wave_image);
13179 return(MagickTrue);
13214WandExport MagickBooleanType MagickWaveletDenoiseImage(MagickWand *wand,
13215 const double threshold,
const double softness)
13220 assert(wand != (MagickWand *) NULL);
13221 assert(wand->signature == MagickWandSignature);
13222 if (wand->debug != MagickFalse)
13223 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13224 if (wand->images == (Image *) NULL)
13225 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13226 noise_image=WaveletDenoiseImage(wand->images,threshold,softness,
13228 if (noise_image == (Image *) NULL)
13229 return(MagickFalse);
13230 ReplaceImageInList(&wand->images,noise_image);
13231 return(MagickTrue);
13257WandExport MagickBooleanType MagickWhiteBalanceImage(MagickWand *wand)
13262 assert(wand != (MagickWand *) NULL);
13263 assert(wand->signature == MagickWandSignature);
13264 if (wand->debug != MagickFalse)
13265 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13266 if (wand->images == (Image *) NULL)
13267 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13268 status=WhiteBalanceImage(wand->images, wand->exception);
13299WandExport MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
13300 const PixelWand *threshold)
13303 thresholds[MagickPathExtent];
13305 assert(wand != (MagickWand *) NULL);
13306 assert(wand->signature == MagickWandSignature);
13307 if (wand->debug != MagickFalse)
13308 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13309 if (wand->images == (Image *) NULL)
13310 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13311 (void) FormatLocaleString(thresholds,MagickPathExtent,
13312 "%g" "," "%g" "," "%g" "," "%g",
13313 (
double) PixelGetRedQuantum(threshold),
13314 (
double) PixelGetGreenQuantum(threshold),
13315 (
double) PixelGetBlueQuantum(threshold),
13316 (
double) PixelGetAlphaQuantum(threshold));
13317 return(WhiteThresholdImage(wand->images,thresholds,wand->exception));
13348WandExport MagickBooleanType MagickWriteImage(MagickWand *wand,
13349 const char *filename)
13360 assert(wand != (MagickWand *) NULL);
13361 assert(wand->signature == MagickWandSignature);
13362 if (wand->debug != MagickFalse)
13363 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13364 if (wand->images == (Image *) NULL)
13365 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13366 if (filename != (
const char *) NULL)
13367 (void) CopyMagickString(wand->images->filename,filename,MagickPathExtent);
13368 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
13369 if (image == (Image *) NULL)
13370 return(MagickFalse);
13371 write_info=CloneImageInfo(wand->image_info);
13372 write_info->adjoin=MagickTrue;
13373 status=WriteImage(write_info,image,wand->exception);
13374 image=DestroyImage(image);
13375 write_info=DestroyImageInfo(write_info);
13403WandExport MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
13414 assert(wand != (MagickWand *) NULL);
13415 assert(wand->signature == MagickWandSignature);
13416 assert(file != (FILE *) NULL);
13417 if (wand->debug != MagickFalse)
13418 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13419 if (wand->images == (Image *) NULL)
13420 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13421 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
13422 if (image == (Image *) NULL)
13423 return(MagickFalse);
13424 write_info=CloneImageInfo(wand->image_info);
13425 SetImageInfoFile(write_info,file);
13426 write_info->adjoin=MagickTrue;
13427 status=WriteImage(write_info,image,wand->exception);
13428 write_info=DestroyImageInfo(write_info);
13429 image=DestroyImage(image);
13460WandExport MagickBooleanType MagickWriteImages(MagickWand *wand,
13461 const char *filename,
const MagickBooleanType adjoin)
13469 assert(wand != (MagickWand *) NULL);
13470 assert(wand->signature == MagickWandSignature);
13471 if (wand->debug != MagickFalse)
13472 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13473 if (wand->images == (Image *) NULL)
13474 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13475 write_info=CloneImageInfo(wand->image_info);
13476 write_info->adjoin=adjoin;
13477 status=WriteImages(write_info,wand->images,filename,wand->exception);
13478 write_info=DestroyImageInfo(write_info);
13506WandExport MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
13514 assert(wand != (MagickWand *) NULL);
13515 assert(wand->signature == MagickWandSignature);
13516 if (wand->debug != MagickFalse)
13517 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13518 if (wand->images == (Image *) NULL)
13519 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13520 write_info=CloneImageInfo(wand->image_info);
13521 SetImageInfoFile(write_info,file);
13522 write_info->adjoin=MagickTrue;
13523 status=WriteImages(write_info,wand->images,(
const char *) NULL,
13525 write_info=DestroyImageInfo(write_info);