49#include "wand/studio.h"
50#include "wand/MagickWand.h"
51#include "wand/magick-wand-private.h"
53#include "wand/pixel-wand-private.h"
54#include "magick/image-private.h"
59#define MagickWandId "MagickWand"
94 assert(wand->signature == WandSignature);
95 if (wand->debug != MagickFalse)
96 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
97 clone_wand=(
MagickWand *) AcquireCriticalMemory(
sizeof(*clone_wand));
98 (void) memset(clone_wand,0,
sizeof(*clone_wand));
99 clone_wand->id=AcquireWandId();
100 (void) FormatLocaleString(clone_wand->name,MaxTextExtent,
"%s-%.20g",
101 MagickWandId,(
double) clone_wand->id);
102 clone_wand->exception=AcquireExceptionInfo();
103 InheritException(clone_wand->exception,wand->exception);
104 clone_wand->image_info=CloneImageInfo(wand->image_info);
105 clone_wand->quantize_info=CloneQuantizeInfo(wand->quantize_info);
106 clone_wand->images=images;
107 clone_wand->debug=IsEventLogging();
108 if (clone_wand->debug != MagickFalse)
109 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",clone_wand->name);
110 clone_wand->signature=WandSignature;
136WandExport Image *GetImageFromMagickWand(
const MagickWand *wand)
139 assert(wand->signature == WandSignature);
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);
189WandExport MagickBooleanType MagickAdaptiveBlurImage(
MagickWand *wand,
190 const double radius,
const double sigma)
195 status=MagickAdaptiveBlurImageChannel(wand,DefaultChannels,radius,sigma);
199WandExport MagickBooleanType MagickAdaptiveBlurImageChannel(
MagickWand *wand,
200 const ChannelType channel,
const double radius,
const double sigma)
206 assert(wand->signature == WandSignature);
207 if (wand->debug != MagickFalse)
208 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
209 if (wand->images == (Image *) NULL)
210 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
211 sharp_image=AdaptiveBlurImageChannel(wand->images,channel,radius,sigma,
213 if (sharp_image == (Image *) NULL)
215 ReplaceImageInList(&wand->images,sharp_image);
245WandExport MagickBooleanType MagickAdaptiveResizeImage(
MagickWand *wand,
246 const size_t columns,
const size_t rows)
252 assert(wand->signature == WandSignature);
253 if (wand->debug != MagickFalse)
254 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
255 if (wand->images == (Image *) NULL)
256 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
257 resize_image=AdaptiveResizeImage(wand->images,columns,rows,wand->exception);
258 if (resize_image == (Image *) NULL)
260 ReplaceImageInList(&wand->images,resize_image);
302WandExport MagickBooleanType MagickAdaptiveSharpenImage(
MagickWand *wand,
303 const double radius,
const double sigma)
308 status=MagickAdaptiveSharpenImageChannel(wand,DefaultChannels,radius,sigma);
312WandExport MagickBooleanType MagickAdaptiveSharpenImageChannel(
MagickWand *wand,
313 const ChannelType channel,
const double radius,
const double sigma)
319 assert(wand->signature == WandSignature);
320 if (wand->debug != MagickFalse)
321 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
322 if (wand->images == (Image *) NULL)
323 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
324 sharp_image=AdaptiveSharpenImageChannel(wand->images,channel,radius,sigma,
326 if (sharp_image == (Image *) NULL)
328 ReplaceImageInList(&wand->images,sharp_image);
364WandExport MagickBooleanType MagickAdaptiveThresholdImage(
MagickWand *wand,
365 const size_t width,
const size_t height,
const ssize_t offset)
371 assert(wand->signature == WandSignature);
372 if (wand->debug != MagickFalse)
373 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
374 if (wand->images == (Image *) NULL)
375 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
376 threshold_image=AdaptiveThresholdImage(wand->images,width,height,offset,
378 if (threshold_image == (Image *) NULL)
380 ReplaceImageInList(&wand->images,threshold_image);
423static inline MagickBooleanType InsertImageInWand(
MagickWand *wand,
426 if (wand->images == (Image *) NULL)
431 if (wand->insert_before != MagickFalse)
432 wand->images=GetFirstImageInList(images);
434 wand->images=GetLastImageInList(images);
437 if ((wand->insert_before != MagickFalse) &&
438 (wand->images->previous == (Image *) NULL) )
443 PrependImageToList(&wand->images,images);
444 wand->images=GetFirstImageInList(images);
452 if (wand->images->next == (Image *) NULL)
457 InsertImageInList(&wand->images,images);
458 wand->images=GetLastImageInList(images);
464 InsertImageInList(&wand->images,images);
468WandExport MagickBooleanType MagickAddImage(
MagickWand *wand,
475 assert(wand->signature == WandSignature);
476 if (wand->debug != MagickFalse)
477 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
479 assert(add_wand->signature == WandSignature);
480 if (add_wand->images == (Image *) NULL)
481 ThrowWandException(WandError,
"ContainsNoImages",add_wand->name);
485 images=CloneImageList(add_wand->images,wand->exception);
486 if (images == (Image *) NULL)
488 return(InsertImageInWand(wand,images));
522WandExport MagickBooleanType MagickAddNoiseImage(
MagickWand *wand,
523 const NoiseType noise_type)
528 status=MagickAddNoiseImageChannel(wand,DefaultChannels,noise_type);
532WandExport MagickBooleanType MagickAddNoiseImageChannel(
MagickWand *wand,
533 const ChannelType channel,
const NoiseType noise_type)
539 assert(wand->signature == WandSignature);
540 if (wand->debug != MagickFalse)
541 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
542 if (wand->images == (Image *) NULL)
543 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
544 noise_image=AddNoiseImageChannel(wand->images,channel,noise_type,
546 if (noise_image == (Image *) NULL)
548 ReplaceImageInList(&wand->images,noise_image);
578WandExport MagickBooleanType MagickAffineTransformImage(
MagickWand *wand,
588 assert(wand->signature == WandSignature);
589 if (wand->debug != MagickFalse)
590 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
591 if (wand->images == (Image *) NULL)
592 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
593 draw_info=PeekDrawingWand(drawing_wand);
594 if (draw_info == (DrawInfo *) NULL)
596 affine_image=AffineTransformImage(wand->images,&draw_info->affine,
598 draw_info=DestroyDrawInfo(draw_info);
599 if (affine_image == (Image *) NULL)
601 ReplaceImageInList(&wand->images,affine_image);
639WandExport MagickBooleanType MagickAnnotateImage(
MagickWand *wand,
640 const DrawingWand *drawing_wand,
const double x,
const double y,
641 const double angle,
const char *text)
644 geometry[MaxTextExtent];
653 assert(wand->signature == WandSignature);
654 if (wand->debug != MagickFalse)
655 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
656 if (wand->images == (Image *) NULL)
657 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
658 draw_info=PeekDrawingWand(drawing_wand);
659 if (draw_info == (DrawInfo *) NULL)
661 (void) CloneString(&draw_info->text,text);
662 (void) FormatLocaleString(geometry,MaxTextExtent,
"%+g%+g",x,y);
663 draw_info->affine.sx=cos(DegreesToRadians(fmod(angle,360.0)));
664 draw_info->affine.rx=sin(DegreesToRadians(fmod(angle,360.0)));
665 draw_info->affine.ry=(-sin(DegreesToRadians(fmod(angle,360.0))));
666 draw_info->affine.sy=cos(DegreesToRadians(fmod(angle,360.0)));
667 (void) CloneString(&draw_info->geometry,geometry);
668 status=AnnotateImage(wand->images,draw_info);
669 draw_info=DestroyDrawInfo(draw_info);
670 if (status == MagickFalse)
671 InheritException(wand->exception,&wand->images->exception);
700WandExport MagickBooleanType MagickAnimateImages(
MagickWand *wand,
701 const char *server_name)
707 assert(wand->signature == WandSignature);
708 if (wand->debug != MagickFalse)
709 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
710 (void) CloneString(&wand->image_info->server_name,server_name);
711 status=AnimateImages(wand->image_info,wand->images);
712 if (status == MagickFalse)
713 InheritException(wand->exception,&wand->images->exception);
750 const MagickBooleanType stack)
756 assert(wand->signature == WandSignature);
757 if (wand->debug != MagickFalse)
758 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
759 if (wand->images == (Image *) NULL)
761 append_image=AppendImages(wand->images,stack,wand->exception);
762 if (append_image == (Image *) NULL)
764 return(CloneMagickWandFromImages(wand,append_image));
794WandExport MagickBooleanType MagickAutoGammaImage(
MagickWand *wand)
799 status=MagickAutoGammaImageChannel(wand,DefaultChannels);
803WandExport MagickBooleanType MagickAutoGammaImageChannel(
MagickWand *wand,
804 const ChannelType channel)
810 assert(wand->signature == WandSignature);
811 if (wand->debug != MagickFalse)
812 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
813 if (wand->images == (Image *) NULL)
814 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
815 status=AutoGammaImageChannel(wand->images,channel);
816 if (status == MagickFalse)
817 InheritException(wand->exception,&wand->images->exception);
848WandExport MagickBooleanType MagickAutoLevelImage(
MagickWand *wand)
853 status=MagickAutoLevelImageChannel(wand,DefaultChannels);
857WandExport MagickBooleanType MagickAutoLevelImageChannel(
MagickWand *wand,
858 const ChannelType channel)
864 assert(wand->signature == WandSignature);
865 if (wand->debug != MagickFalse)
866 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
867 if (wand->images == (Image *) NULL)
868 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
869 status=AutoLevelImageChannel(wand->images,channel);
870 if (status == MagickFalse)
871 InheritException(wand->exception,&wand->images->exception);
898WandExport MagickBooleanType MagickAutoOrientImage(
MagickWand *wand)
905 assert(wand->signature == WandSignature);
906 if (wand->debug != MagickFalse)
907 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
908 if (wand->images == (Image *) NULL)
909 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
910 orient_image=AutoOrientImage(wand->images,wand->images->orientation,
912 if (orient_image == (Image *) NULL)
914 ReplaceImageInList(&wand->images,orient_image);
945WandExport MagickBooleanType MagickBlackThresholdImage(
MagickWand *wand,
949 thresholds[MaxTextExtent];
955 assert(wand->signature == WandSignature);
956 if (wand->debug != MagickFalse)
957 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
958 if (wand->images == (Image *) NULL)
959 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
960 (void) FormatLocaleString(thresholds,MaxTextExtent,
"%g" ","
961 "%g" "," "%g" "," "%g",(
double) PixelGetRedQuantum(threshold),(
double)
962 PixelGetGreenQuantum(threshold),(
double) PixelGetBlueQuantum(threshold),
963 (
double) PixelGetOpacityQuantum(threshold));
964 status=BlackThresholdImage(wand->images,thresholds);
965 if (status == MagickFalse)
966 InheritException(wand->exception,&wand->images->exception);
996WandExport MagickBooleanType MagickBlueShiftImage(
MagickWand *wand,
1003 assert(wand->signature == WandSignature);
1004 if (wand->debug != MagickFalse)
1005 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1006 if (wand->images == (Image *) NULL)
1007 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1008 shift_image=BlueShiftImage(wand->images,factor,wand->exception);
1009 if (shift_image == (Image *) NULL)
1010 return(MagickFalse);
1011 ReplaceImageInList(&wand->images,shift_image);
1051WandExport MagickBooleanType MagickBlurImage(
MagickWand *wand,
1052 const double radius,
const double sigma)
1057 status=MagickBlurImageChannel(wand,DefaultChannels,radius,sigma);
1061WandExport MagickBooleanType MagickBlurImageChannel(
MagickWand *wand,
1062 const ChannelType channel,
const double radius,
const double sigma)
1068 assert(wand->signature == WandSignature);
1069 if (wand->debug != MagickFalse)
1070 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1071 if (wand->images == (Image *) NULL)
1072 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1073 blur_image=BlurImageChannel(wand->images,channel,radius,sigma,
1075 if (blur_image == (Image *) NULL)
1076 return(MagickFalse);
1077 ReplaceImageInList(&wand->images,blur_image);
1112WandExport MagickBooleanType MagickBorderImage(
MagickWand *wand,
1113 const PixelWand *bordercolor,
const size_t width,
const size_t height)
1122 assert(wand->signature == WandSignature);
1123 if (wand->debug != MagickFalse)
1124 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1125 if (wand->images == (Image *) NULL)
1126 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1127 border_info.width=width;
1128 border_info.height=height;
1131 PixelGetQuantumColor(bordercolor,&wand->images->border_color);
1132 border_image=BorderImage(wand->images,&border_info,wand->exception);
1133 if (border_image == (Image *) NULL)
1134 return(MagickFalse);
1135 ReplaceImageInList(&wand->images,border_image);
1174WandExport MagickBooleanType MagickBrightnessContrastImage(
MagickWand *wand,
1175 const double brightness,
const double contrast)
1180 status=MagickBrightnessContrastImageChannel(wand,DefaultChannels,brightness,
1185WandExport MagickBooleanType MagickBrightnessContrastImageChannel(
1186 MagickWand *wand,
const ChannelType channel,
const double brightness,
1187 const double contrast)
1193 assert(wand->signature == WandSignature);
1194 if (wand->debug != MagickFalse)
1195 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1196 if (wand->images == (Image *) NULL)
1197 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1198 status=BrightnessContrastImageChannel(wand->images,channel,brightness,
1200 if (status == MagickFalse)
1201 InheritException(wand->exception,&wand->images->exception);
1233WandExport MagickBooleanType MagickCharcoalImage(
MagickWand *wand,
1234 const double radius,
const double sigma)
1240 assert(wand->signature == WandSignature);
1241 if (wand->debug != MagickFalse)
1242 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1243 if (wand->images == (Image *) NULL)
1244 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1245 charcoal_image=CharcoalImage(wand->images,radius,sigma,wand->exception);
1246 if (charcoal_image == (Image *) NULL)
1247 return(MagickFalse);
1248 ReplaceImageInList(&wand->images,charcoal_image);
1284WandExport MagickBooleanType MagickChopImage(
MagickWand *wand,
1285 const size_t width,
const size_t height,
const ssize_t x,
const ssize_t y)
1294 assert(wand->signature == WandSignature);
1295 if (wand->debug != MagickFalse)
1296 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1297 if (wand->images == (Image *) NULL)
1298 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1303 chop_image=ChopImage(wand->images,&chop,wand->exception);
1304 if (chop_image == (Image *) NULL)
1305 return(MagickFalse);
1306 ReplaceImageInList(&wand->images,chop_image);
1337WandExport MagickBooleanType MagickClampImage(
MagickWand *wand)
1342 status=MagickClampImageChannel(wand,DefaultChannels);
1346WandExport MagickBooleanType MagickClampImageChannel(
MagickWand *wand,
1347 const ChannelType channel)
1353 assert(wand->signature == WandSignature);
1354 if (wand->debug != MagickFalse)
1355 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1356 if (wand->images == (Image *) NULL)
1357 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1358 status=ClampImageChannel(wand->images,channel);
1359 if (status == MagickFalse)
1360 InheritException(wand->exception,&wand->images->exception);
1387WandExport MagickBooleanType MagickClipImage(
MagickWand *wand)
1393 assert(wand->signature == WandSignature);
1394 if (wand->debug != MagickFalse)
1395 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1396 if (wand->images == (Image *) NULL)
1397 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1398 status=ClipImage(wand->images);
1399 if (status == MagickFalse)
1400 InheritException(wand->exception,&wand->images->exception);
1436WandExport MagickBooleanType MagickClipImagePath(
MagickWand *wand,
1437 const char *pathname,
const MagickBooleanType inside)
1443 assert(wand->signature == WandSignature);
1444 if (wand->debug != MagickFalse)
1445 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1446 if (wand->images == (Image *) NULL)
1447 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1448 status=ClipImagePath(wand->images,pathname,inside);
1449 if (status == MagickFalse)
1450 InheritException(wand->exception,&wand->images->exception);
1482WandExport MagickBooleanType MagickClutImage(
MagickWand *wand,
1488 status=MagickClutImageChannel(wand,DefaultChannels,clut_wand);
1492WandExport MagickBooleanType MagickClutImageChannel(
MagickWand *wand,
1493 const ChannelType channel,
const MagickWand *clut_wand)
1499 assert(wand->signature == WandSignature);
1500 if (wand->debug != MagickFalse)
1501 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1502 if ((wand->images == (Image *) NULL) || (clut_wand->images == (Image *) NULL))
1503 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1504 status=ClutImageChannel(wand->images,channel,clut_wand->images);
1505 if (status == MagickFalse)
1506 InheritException(wand->exception,&wand->images->exception);
1543 assert(wand->signature == WandSignature);
1544 if (wand->debug != MagickFalse)
1545 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1546 if (wand->images == (Image *) NULL)
1548 coalesce_image=CoalesceImages(wand->images,wand->exception);
1549 if (coalesce_image == (Image *) NULL)
1551 return(CloneMagickWandFromImages(wand,coalesce_image));
1597WandExport MagickBooleanType MagickColorDecisionListImage(
MagickWand *wand,
1598 const char *color_correction_collection)
1604 assert(wand->signature == WandSignature);
1605 if (wand->debug != MagickFalse)
1606 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1607 if (wand->images == (Image *) NULL)
1608 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1609 status=ColorDecisionListImage(wand->images,color_correction_collection);
1610 if (status == MagickFalse)
1611 InheritException(wand->exception,&wand->images->exception);
1642WandExport MagickBooleanType MagickColorizeImage(
MagickWand *wand,
1646 percent_opaque[MaxTextExtent];
1655 assert(wand->signature == WandSignature);
1656 if (wand->debug != MagickFalse)
1657 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1658 if (wand->images == (Image *) NULL)
1659 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1660 (void) FormatLocaleString(percent_opaque,MaxTextExtent,
"%g,%g,%g,%g",
1661 100.0*QuantumScale*(
double) PixelGetRedQuantum(opacity),100.0*
1662 QuantumScale*(
double) PixelGetGreenQuantum(opacity),100.0*QuantumScale*
1663 (
double) PixelGetBlueQuantum(opacity),100.0*QuantumScale*
1664 (
double) PixelGetOpacityQuantum(opacity));
1665 PixelGetQuantumColor(colorize,&target);
1666 colorize_image=ColorizeImage(wand->images,percent_opaque,target,
1668 if (colorize_image == (Image *) NULL)
1669 return(MagickFalse);
1670 ReplaceImageInList(&wand->images,colorize_image);
1705WandExport MagickBooleanType MagickColorMatrixImage(
MagickWand *wand,
1706 const KernelInfo *color_matrix)
1712 assert(wand->signature == WandSignature);
1713 if (wand->debug != MagickFalse)
1714 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1715 if (color_matrix == (
const KernelInfo *) NULL)
1716 return(MagickFalse);
1717 if (wand->images == (Image *) NULL)
1718 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1719 color_image=ColorMatrixImage(wand->images,color_matrix,wand->exception);
1720 if (color_image == (Image *) NULL)
1721 return(MagickFalse);
1722 ReplaceImageInList(&wand->images,color_image);
1755 const ChannelType channel)
1761 assert(wand->signature == WandSignature);
1762 if (wand->debug != MagickFalse)
1763 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1764 if (wand->images == (Image *) NULL)
1766 combine_image=CombineImages(wand->images,channel,wand->exception);
1767 if (combine_image == (Image *) NULL)
1769 return(CloneMagickWandFromImages(wand,combine_image));
1797WandExport MagickBooleanType MagickCommentImage(
MagickWand *wand,
1798 const char *comment)
1804 assert(wand->signature == WandSignature);
1805 if (wand->debug != MagickFalse)
1806 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1807 if (wand->images == (Image *) NULL)
1808 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1809 status=SetImageProperty(wand->images,
"comment",comment);
1810 if (status == MagickFalse)
1811 InheritException(wand->exception,&wand->images->exception);
1849 const MagickWand *reference,
const ChannelType channel,
const MetricType metric,
1856 assert(wand->signature == WandSignature);
1857 if (wand->debug != MagickFalse)
1858 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1859 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
1861 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1862 "ContainsNoImages",
"`%s'",wand->name);
1865 compare_image=CompareImageChannels(wand->images,reference->images,channel,
1866 metric,distortion,&wand->images->exception);
1867 if (compare_image == (Image *) NULL)
1869 return(CloneMagickWandFromImages(wand,compare_image));
1900 const ImageLayerMethod method)
1906 assert(wand->signature == WandSignature);
1907 if (wand->debug != MagickFalse)
1908 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1909 if (wand->images == (Image *) NULL)
1911 layers_image=CompareImageLayers(wand->images,method,wand->exception);
1912 if (layers_image == (Image *) NULL)
1914 return(CloneMagickWandFromImages(wand,layers_image));
1948 const MagickWand *reference,
const MetricType metric,
double *distortion)
1955 assert(wand->signature == WandSignature);
1956 if (wand->debug != MagickFalse)
1957 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1958 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
1960 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1961 "ContainsNoImages",
"`%s'",wand->name);
1964 compare_image=CompareImages(wand->images,reference->images,metric,distortion,
1965 &wand->images->exception);
1966 if (compare_image == (Image *) NULL)
1968 return(CloneMagickWandFromImages(wand,compare_image));
2015WandExport MagickBooleanType MagickCompositeImage(
MagickWand *wand,
2016 const MagickWand *source_wand,
const CompositeOperator compose,
const ssize_t x,
2022 status=MagickCompositeImageChannel(wand,DefaultChannels,source_wand,
2027WandExport MagickBooleanType MagickCompositeImageChannel(
MagickWand *wand,
2028 const ChannelType channel,
const MagickWand *source_wand,
2029 const CompositeOperator compose,
const ssize_t x,
const ssize_t y)
2035 assert(wand->signature == WandSignature);
2036 if (wand->debug != MagickFalse)
2037 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2038 if ((wand->images == (Image *) NULL) ||
2039 (source_wand->images == (Image *) NULL))
2040 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2041 status=CompositeImageChannel(wand->images,channel,compose,
2042 source_wand->images,x,y);
2043 if (status == MagickFalse)
2044 InheritException(wand->exception,&wand->images->exception);
2090WandExport MagickBooleanType MagickCompositeImageGravity(
MagickWand *wand,
2091 const MagickWand *source_wand,
const CompositeOperator compose,
2092 const GravityType gravity)
2101 assert(wand->signature == WandSignature);
2102 if (wand->debug != MagickFalse)
2103 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2104 if ((wand->images == (Image *) NULL) ||
2105 (source_wand->images == (Image *) NULL))
2106 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2107 SetGeometry(source_wand->images,&geometry);
2108 GravityAdjustGeometry(wand->images->columns,wand->images->rows,gravity,
2110 status=CompositeImage(wand->images,compose,source_wand->images,geometry.x,
2168WandExport MagickBooleanType MagickCompositeLayers(
MagickWand *wand,
2169 const MagickWand *source_wand,
const CompositeOperator compose,
const ssize_t x,
2176 assert(wand->signature == WandSignature);
2177 if (wand->debug != MagickFalse)
2178 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2179 if ((wand->images == (Image *) NULL) ||
2180 (source_wand->images == (Image *) NULL))
2181 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2182 CompositeLayers(wand->images,compose,source_wand->images,x,y,
2183 &wand->images->exception);
2216WandExport MagickBooleanType MagickContrastImage(
MagickWand *wand,
2217 const MagickBooleanType sharpen)
2223 assert(wand->signature == WandSignature);
2224 if (wand->debug != MagickFalse)
2225 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2226 if (wand->images == (Image *) NULL)
2227 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2228 status=ContrastImage(wand->images,sharpen);
2229 if (status == MagickFalse)
2230 InheritException(wand->exception,&wand->images->exception);
2270WandExport MagickBooleanType MagickContrastStretchImage(
MagickWand *wand,
2271 const double black_point,
const double white_point)
2276 status=MagickContrastStretchImageChannel(wand,DefaultChannels,black_point,
2281WandExport MagickBooleanType MagickContrastStretchImageChannel(
MagickWand *wand,
2282 const ChannelType channel,
const double black_point,
const double white_point)
2288 assert(wand->signature == WandSignature);
2289 if (wand->debug != MagickFalse)
2290 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2291 if (wand->images == (Image *) NULL)
2292 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2293 status=ContrastStretchImageChannel(wand->images,channel,black_point,
2295 if (status == MagickFalse)
2296 InheritException(wand->exception,&wand->images->exception);
2333WandExport MagickBooleanType MagickConvolveImage(
MagickWand *wand,
2334 const size_t order,
const double *kernel)
2339 status=MagickConvolveImageChannel(wand,DefaultChannels,order,kernel);
2343WandExport MagickBooleanType MagickConvolveImageChannel(
MagickWand *wand,
2344 const ChannelType channel,
const size_t order,
const double *kernel)
2350 assert(wand->signature == WandSignature);
2351 if (wand->debug != MagickFalse)
2352 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2353 if (kernel == (
const double *) NULL)
2354 return(MagickFalse);
2355 if (wand->images == (Image *) NULL)
2356 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2357 convolve_image=ConvolveImageChannel(wand->images,channel,order,kernel,
2359 if (convolve_image == (Image *) NULL)
2360 return(MagickFalse);
2361 ReplaceImageInList(&wand->images,convolve_image);
2396WandExport MagickBooleanType MagickCropImage(
MagickWand *wand,
2397 const size_t width,
const size_t height,
const ssize_t x,
const ssize_t y)
2406 assert(wand->signature == WandSignature);
2407 if (wand->debug != MagickFalse)
2408 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2409 if (wand->images == (Image *) NULL)
2410 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2415 crop_image=CropImage(wand->images,&crop,wand->exception);
2416 if (crop_image == (Image *) NULL)
2417 return(MagickFalse);
2418 ReplaceImageInList(&wand->images,crop_image);
2449WandExport MagickBooleanType MagickCycleColormapImage(
MagickWand *wand,
2450 const ssize_t displace)
2456 assert(wand->signature == WandSignature);
2457 if (wand->debug != MagickFalse)
2458 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2459 if (wand->images == (Image *) NULL)
2460 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2461 status=CycleColormapImage(wand->images,displace);
2462 if (status == MagickFalse)
2463 InheritException(wand->exception,&wand->images->exception);
2518WandExport MagickBooleanType MagickConstituteImage(
MagickWand *wand,
2519 const size_t columns,
const size_t rows,
const char *map,
2520 const StorageType storage,
const void *pixels)
2526 assert(wand->signature == WandSignature);
2527 if (wand->debug != MagickFalse)
2528 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2529 images=ConstituteImage(columns,rows,map,storage,pixels,wand->exception);
2530 if (images == (Image *) NULL)
2531 return(MagickFalse);
2532 return(InsertImageInWand(wand,images));
2560WandExport MagickBooleanType MagickDecipherImage(
MagickWand *wand,
2561 const char *passphrase)
2564 assert(wand->signature == WandSignature);
2565 if (wand->debug != MagickFalse)
2566 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2567 if (wand->images == (Image *) NULL)
2568 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2569 return(DecipherImage(wand->images,passphrase,&wand->images->exception));
2602 assert(wand->signature == WandSignature);
2603 if (wand->debug != MagickFalse)
2604 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2605 if (wand->images == (Image *) NULL)
2607 deconstruct_image=DeconstructImages(wand->images,wand->exception);
2608 if (deconstruct_image == (Image *) NULL)
2610 return(CloneMagickWandFromImages(wand,deconstruct_image));
2641WandExport MagickBooleanType MagickDeskewImage(
MagickWand *wand,
2642 const double threshold)
2648 assert(wand->signature == WandSignature);
2649 if (wand->debug != MagickFalse)
2650 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2651 if (wand->images == (Image *) NULL)
2652 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2653 sepia_image=DeskewImage(wand->images,threshold,wand->exception);
2654 if (sepia_image == (Image *) NULL)
2655 return(MagickFalse);
2656 ReplaceImageInList(&wand->images,sepia_image);
2683WandExport MagickBooleanType MagickDespeckleImage(
MagickWand *wand)
2689 assert(wand->signature == WandSignature);
2690 if (wand->debug != MagickFalse)
2691 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2692 if (wand->images == (Image *) NULL)
2693 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2694 despeckle_image=DespeckleImage(wand->images,wand->exception);
2695 if (despeckle_image == (Image *) NULL)
2696 return(MagickFalse);
2697 ReplaceImageInList(&wand->images,despeckle_image);
2724WandExport Image *MagickDestroyImage(Image *image)
2726 return(DestroyImage(image));
2754WandExport MagickBooleanType MagickDisplayImage(
MagickWand *wand,
2755 const char *server_name)
2764 assert(wand->signature == WandSignature);
2765 if (wand->debug != MagickFalse)
2766 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2767 if (wand->images == (Image *) NULL)
2768 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2769 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
2770 if (image == (Image *) NULL)
2771 return(MagickFalse);
2772 (void) CloneString(&wand->image_info->server_name,server_name);
2773 status=DisplayImages(wand->image_info,image);
2774 if (status == MagickFalse)
2775 InheritException(wand->exception,&image->exception);
2776 image=DestroyImage(image);
2805WandExport MagickBooleanType MagickDisplayImages(
MagickWand *wand,
2806 const char *server_name)
2812 assert(wand->signature == WandSignature);
2813 if (wand->debug != MagickFalse)
2814 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2815 (void) CloneString(&wand->image_info->server_name,server_name);
2816 status=DisplayImages(wand->image_info,wand->images);
2817 if (status == MagickFalse)
2818 InheritException(wand->exception,&wand->images->exception);
2882WandExport MagickBooleanType MagickDistortImage(
MagickWand *wand,
2883 const DistortImageMethod method,
const size_t number_arguments,
2884 const double *arguments,
const MagickBooleanType bestfit)
2890 assert(wand->signature == WandSignature);
2891 if (wand->debug != MagickFalse)
2892 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2893 if (wand->images == (Image *) NULL)
2894 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2895 distort_image=DistortImage(wand->images,method,number_arguments,arguments,
2896 bestfit,wand->exception);
2897 if (distort_image == (Image *) NULL)
2898 return(MagickFalse);
2899 ReplaceImageInList(&wand->images,distort_image);
2928WandExport MagickBooleanType MagickDrawImage(
MagickWand *wand,
2941 assert(wand->signature == WandSignature);
2942 if (wand->debug != MagickFalse)
2943 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2944 if (wand->images == (Image *) NULL)
2945 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2946 draw_info=PeekDrawingWand(drawing_wand);
2947 if ((draw_info == (DrawInfo *) NULL) ||
2948 (draw_info->primitive == (
char *) NULL))
2949 return(MagickFalse);
2950 primitive=AcquireString(draw_info->primitive);
2951 draw_info=DestroyDrawInfo(draw_info);
2952 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
2953 draw_info->primitive=primitive;
2954 status=DrawImage(wand->images,draw_info);
2955 if (status == MagickFalse)
2956 InheritException(wand->exception,&wand->images->exception);
2957 draw_info=DestroyDrawInfo(draw_info);
2987WandExport MagickBooleanType MagickEdgeImage(
MagickWand *wand,
2988 const double radius)
2994 assert(wand->signature == WandSignature);
2995 if (wand->debug != MagickFalse)
2996 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2997 if (wand->images == (Image *) NULL)
2998 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2999 edge_image=EdgeImage(wand->images,radius,wand->exception);
3000 if (edge_image == (Image *) NULL)
3001 return(MagickFalse);
3002 ReplaceImageInList(&wand->images,edge_image);
3038WandExport MagickBooleanType MagickEmbossImage(
MagickWand *wand,
3039 const double radius,
const double sigma)
3045 assert(wand->signature == WandSignature);
3046 if (wand->debug != MagickFalse)
3047 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3048 if (wand->images == (Image *) NULL)
3049 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3050 emboss_image=EmbossImage(wand->images,radius,sigma,wand->exception);
3051 if (emboss_image == (Image *) NULL)
3052 return(MagickFalse);
3053 ReplaceImageInList(&wand->images,emboss_image);
3082WandExport MagickBooleanType MagickEncipherImage(
MagickWand *wand,
3083 const char *passphrase)
3086 assert(wand->signature == WandSignature);
3087 if (wand->debug != MagickFalse)
3088 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3089 if (wand->images == (Image *) NULL)
3090 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3091 return(EncipherImage(wand->images,passphrase,&wand->images->exception));
3117WandExport MagickBooleanType MagickEnhanceImage(
MagickWand *wand)
3123 assert(wand->signature == WandSignature);
3124 if (wand->debug != MagickFalse)
3125 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3126 if (wand->images == (Image *) NULL)
3127 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3128 enhance_image=EnhanceImage(wand->images,wand->exception);
3129 if (enhance_image == (Image *) NULL)
3130 return(MagickFalse);
3131 ReplaceImageInList(&wand->images,enhance_image);
3162WandExport MagickBooleanType MagickEqualizeImage(
MagickWand *wand)
3167 status=MagickEqualizeImageChannel(wand,DefaultChannels);
3171WandExport MagickBooleanType MagickEqualizeImageChannel(
MagickWand *wand,
3172 const ChannelType channel)
3178 assert(wand->signature == WandSignature);
3179 if (wand->debug != MagickFalse)
3180 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3181 if (wand->images == (Image *) NULL)
3182 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3183 status=EqualizeImageChannel(wand->images,channel);
3184 if (status == MagickFalse)
3185 InheritException(wand->exception,&wand->images->exception);
3227WandExport MagickBooleanType MagickEvaluateImage(
MagickWand *wand,
3228 const MagickEvaluateOperator op,
const double value)
3234 assert(wand->signature == WandSignature);
3235 if (wand->debug != MagickFalse)
3236 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3237 if (wand->images == (Image *) NULL)
3238 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3239 status=EvaluateImage(wand->images,op,value,&wand->images->exception);
3240 if (status == MagickFalse)
3241 InheritException(wand->exception,&wand->images->exception);
3246 const MagickEvaluateOperator op)
3252 assert(wand->signature == WandSignature);
3253 if (wand->debug != MagickFalse)
3254 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3255 if (wand->images == (Image *) NULL)
3257 evaluate_image=EvaluateImages(wand->images,op,wand->exception);
3258 if (evaluate_image == (Image *) NULL)
3260 return(CloneMagickWandFromImages(wand,evaluate_image));
3263WandExport MagickBooleanType MagickEvaluateImageChannel(
MagickWand *wand,
3264 const ChannelType channel,
const MagickEvaluateOperator op,
const double value)
3270 assert(wand->signature == WandSignature);
3271 if (wand->debug != MagickFalse)
3272 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3273 if (wand->images == (Image *) NULL)
3274 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3275 status=EvaluateImageChannel(wand->images,channel,op,value,
3276 &wand->images->exception);
3331WandExport MagickBooleanType MagickExportImagePixels(
MagickWand *wand,
3332 const ssize_t x,
const ssize_t y,
const size_t columns,
const size_t rows,
3333 const char *map,
const StorageType storage,
void *pixels)
3339 assert(wand->signature == WandSignature);
3340 if (wand->debug != MagickFalse)
3341 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3342 if (wand->images == (Image *) NULL)
3343 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3344 status=ExportImagePixels(wand->images,x,y,columns,rows,map,
3345 storage,pixels,wand->exception);
3346 if (status == MagickFalse)
3347 InheritException(wand->exception,&wand->images->exception);
3384WandExport MagickBooleanType MagickExtentImage(
MagickWand *wand,
3385 const size_t width,
const size_t height,
const ssize_t x,
const ssize_t y)
3394 assert(wand->signature == WandSignature);
3395 if (wand->debug != MagickFalse)
3396 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3397 if (wand->images == (Image *) NULL)
3398 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3400 extent.height=height;
3403 extent_image=ExtentImage(wand->images,&extent,wand->exception);
3404 if (extent_image == (Image *) NULL)
3405 return(MagickFalse);
3406 ReplaceImageInList(&wand->images,extent_image);
3440WandExport MagickBooleanType MagickFilterImage(
MagickWand *wand,
3441 const KernelInfo *kernel)
3446 status=MagickFilterImageChannel(wand,DefaultChannels,kernel);
3450WandExport MagickBooleanType MagickFilterImageChannel(
MagickWand *wand,
3451 const ChannelType channel,
const KernelInfo *kernel)
3457 assert(wand->signature == WandSignature);
3458 if (wand->debug != MagickFalse)
3459 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3460 if (kernel == (
const KernelInfo *) NULL)
3461 return(MagickFalse);
3462 if (wand->images == (Image *) NULL)
3463 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3464 filter_image=FilterImageChannel(wand->images,channel,kernel,wand->exception);
3465 if (filter_image == (Image *) NULL)
3466 return(MagickFalse);
3467 ReplaceImageInList(&wand->images,filter_image);
3494WandExport MagickBooleanType MagickFlipImage(
MagickWand *wand)
3500 assert(wand->signature == WandSignature);
3501 if (wand->debug != MagickFalse)
3502 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3503 if (wand->images == (Image *) NULL)
3504 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3505 flip_image=FlipImage(wand->images,wand->exception);
3506 if (flip_image == (Image *) NULL)
3507 return(MagickFalse);
3508 ReplaceImageInList(&wand->images,flip_image);
3557WandExport MagickBooleanType MagickFloodfillPaintImage(
MagickWand *wand,
3558 const ChannelType channel,
const PixelWand *fill,
const double fuzz,
3559 const PixelWand *bordercolor,
const ssize_t x,
const ssize_t y,
3560 const MagickBooleanType invert)
3572 assert(wand->signature == WandSignature);
3573 if (wand->debug != MagickFalse)
3574 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3575 if (wand->images == (Image *) NULL)
3576 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3577 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
3578 PixelGetQuantumColor(fill,&draw_info->fill);
3579 (void) GetOneVirtualMagickPixel(wand->images,x % wand->images->columns,
3580 y % wand->images->rows,&target,wand->exception);
3582 PixelGetMagickColor(bordercolor,&target);
3583 wand->images->fuzz=fuzz;
3584 status=FloodfillPaintImage(wand->images,channel,draw_info,&target,x,y,invert);
3585 if (status == MagickFalse)
3586 InheritException(wand->exception,&wand->images->exception);
3587 draw_info=DestroyDrawInfo(draw_info);
3614WandExport MagickBooleanType MagickFlopImage(
MagickWand *wand)
3620 assert(wand->signature == WandSignature);
3621 if (wand->debug != MagickFalse)
3622 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3623 if (wand->images == (Image *) NULL)
3624 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3625 flop_image=FlopImage(wand->images,wand->exception);
3626 if (flop_image == (Image *) NULL)
3627 return(MagickFalse);
3628 ReplaceImageInList(&wand->images,flop_image);
3660WandExport MagickBooleanType MagickForwardFourierTransformImage(
3661 MagickWand *wand,
const MagickBooleanType magnitude)
3667 assert(wand->signature == WandSignature);
3668 if (wand->debug != MagickFalse)
3669 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3670 if (wand->images == (Image *) NULL)
3671 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3672 forward_image=ForwardFourierTransformImage(wand->images,magnitude,
3674 if (forward_image == (Image *) NULL)
3675 return(MagickFalse);
3676 ReplaceImageInList(&wand->images,forward_image);
3718WandExport MagickBooleanType MagickFrameImage(
MagickWand *wand,
3719 const PixelWand *matte_color,
const size_t width,
const size_t height,
3720 const ssize_t inner_bevel,
const ssize_t outer_bevel)
3729 assert(wand->signature == WandSignature);
3730 if (wand->debug != MagickFalse)
3731 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3732 if (wand->images == (Image *) NULL)
3733 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3734 (void) memset(&frame_info,0,
sizeof(frame_info));
3735 frame_info.width=wand->images->columns+2*width;
3736 frame_info.height=wand->images->rows+2*height;
3737 frame_info.x=(ssize_t) width;
3738 frame_info.y=(ssize_t) height;
3739 frame_info.inner_bevel=inner_bevel;
3740 frame_info.outer_bevel=outer_bevel;
3741 PixelGetQuantumColor(matte_color,&wand->images->matte_color);
3742 frame_image=FrameImage(wand->images,&frame_info,wand->exception);
3743 if (frame_image == (Image *) NULL)
3744 return(MagickFalse);
3745 ReplaceImageInList(&wand->images,frame_image);
3788WandExport MagickBooleanType MagickFunctionImage(
MagickWand *wand,
3789 const MagickFunction function,
const size_t number_arguments,
3790 const double *arguments)
3796 assert(wand->signature == WandSignature);
3797 if (wand->debug != MagickFalse)
3798 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3799 if (wand->images == (Image *) NULL)
3800 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3801 status=FunctionImage(wand->images,function,number_arguments,arguments,
3802 &wand->images->exception);
3803 if (status == MagickFalse)
3804 InheritException(wand->exception,&wand->images->exception);
3808WandExport MagickBooleanType MagickFunctionImageChannel(
MagickWand *wand,
3809 const ChannelType channel,
const MagickFunction function,
3810 const size_t number_arguments,
const double *arguments)
3816 assert(wand->signature == WandSignature);
3817 if (wand->debug != MagickFalse)
3818 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3819 if (wand->images == (Image *) NULL)
3820 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3821 status=FunctionImageChannel(wand->images,channel,function,number_arguments,
3822 arguments,&wand->images->exception);
3860 fx_wand=MagickFxImageChannel(wand,DefaultChannels,expression);
3865 const ChannelType channel,
const char *expression)
3871 assert(wand->signature == WandSignature);
3872 if (wand->debug != MagickFalse)
3873 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3874 if (wand->images == (Image *) NULL)
3876 fx_image=FxImageChannel(wand->images,channel,expression,wand->exception);
3877 if (fx_image == (Image *) NULL)
3879 return(CloneMagickWandFromImages(wand,fx_image));
3918WandExport MagickBooleanType MagickGammaImage(
MagickWand *wand,
3924 status=MagickGammaImageChannel(wand,DefaultChannels,gamma);
3928WandExport MagickBooleanType MagickGammaImageChannel(
MagickWand *wand,
3929 const ChannelType channel,
const double gamma)
3935 assert(wand->signature == WandSignature);
3936 if (wand->debug != MagickFalse)
3937 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3938 if (wand->images == (Image *) NULL)
3939 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3940 status=GammaImageChannel(wand->images,channel,gamma);
3941 if (status == MagickFalse)
3942 InheritException(wand->exception,&wand->images->exception);
3982WandExport MagickBooleanType MagickGaussianBlurImage(
MagickWand *wand,
3983 const double radius,
const double sigma)
3988 status=MagickGaussianBlurImageChannel(wand,DefaultChannels,radius,sigma);
3992WandExport MagickBooleanType MagickGaussianBlurImageChannel(
MagickWand *wand,
3993 const ChannelType channel,
const double radius,
const double sigma)
3999 assert(wand->signature == WandSignature);
4000 if (wand->debug != MagickFalse)
4001 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4002 if (wand->images == (Image *) NULL)
4003 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4004 blur_image=GaussianBlurImageChannel(wand->images,channel,radius,sigma,
4006 if (blur_image == (Image *) NULL)
4007 return(MagickFalse);
4008 ReplaceImageInList(&wand->images,blur_image);
4040 assert(wand->signature == WandSignature);
4041 if (wand->debug != MagickFalse)
4042 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4043 if (wand->images == (Image *) NULL)
4045 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4046 "ContainsNoImages",
"`%s'",wand->name);
4049 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
4050 if (image == (Image *) NULL)
4052 return(CloneMagickWandFromImages(wand,image));
4079WandExport MagickBooleanType MagickGetImageAlphaChannel(
MagickWand *wand)
4082 assert(wand->signature == WandSignature);
4083 if (wand->debug != MagickFalse)
4084 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4085 if (wand->images == (Image *) NULL)
4086 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4087 return(GetImageAlphaChannel(wand->images));
4118 assert(wand->signature == WandSignature);
4119 if (wand->debug != MagickFalse)
4120 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4121 if (wand->images == (Image *) NULL)
4123 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4124 "ContainsNoImages",
"`%s'",wand->name);
4127 image=GetImageClipMask(wand->images,wand->exception);
4128 if (image == (Image *) NULL)
4130 return(CloneMagickWandFromImages(wand,image));
4158WandExport MagickBooleanType MagickGetImageBackgroundColor(
MagickWand *wand,
4162 assert(wand->signature == WandSignature);
4163 if (wand->debug != MagickFalse)
4164 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4165 if (wand->images == (Image *) NULL)
4166 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4167 PixelSetQuantumColor(background_color,&wand->images->background_color);
4203WandExport
unsigned char *MagickGetImageBlob(
MagickWand *wand,
size_t *length)
4206 assert(wand->signature == WandSignature);
4207 if (wand->debug != MagickFalse)
4208 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4209 if (wand->images == (Image *) NULL)
4211 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4212 "ContainsNoImages",
"`%s'",wand->name);
4213 return((
unsigned char *) NULL);
4215 return(ImageToBlob(wand->image_info,wand->images,length,wand->exception));
4249WandExport
unsigned char *MagickGetImagesBlob(
MagickWand *wand,
size_t *length)
4255 assert(wand->signature == WandSignature);
4256 if (wand->debug != MagickFalse)
4257 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4258 if (wand->images == (Image *) NULL)
4260 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4261 "ContainsNoImages",
"`%s'",wand->name);
4262 return((
unsigned char *) NULL);
4264 blob=ImagesToBlob(wand->image_info,GetFirstImageInList(wand->images),length,
4297WandExport MagickBooleanType MagickGetImageBluePrimary(
MagickWand *wand,
4298 double *x,
double *y)
4301 assert(wand->signature == WandSignature);
4302 if (wand->debug != MagickFalse)
4303 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4304 if (wand->images == (Image *) NULL)
4305 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4306 *x=wand->images->chromaticity.blue_primary.x;
4307 *y=wand->images->chromaticity.blue_primary.y;
4336WandExport MagickBooleanType MagickGetImageBorderColor(
MagickWand *wand,
4340 assert(wand->signature == WandSignature);
4341 if (wand->debug != MagickFalse)
4342 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4343 if (wand->images == (Image *) NULL)
4344 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4345 PixelSetQuantumColor(border_color,&wand->images->border_color);
4374WandExport
size_t MagickGetImageChannelDepth(
MagickWand *wand,
4375 const ChannelType channel)
4378 assert(wand->signature == WandSignature);
4379 if (wand->debug != MagickFalse)
4380 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4381 if (wand->images == (Image *) NULL)
4382 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4383 return(GetImageChannelDepth(wand->images,channel,wand->exception));
4419WandExport MagickBooleanType MagickGetImageChannelDistortion(
MagickWand *wand,
4420 const MagickWand *reference,
const ChannelType channel,
const MetricType metric,
4427 assert(wand->signature == WandSignature);
4428 if (wand->debug != MagickFalse)
4429 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4431 assert(reference->signature == WandSignature);
4432 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4433 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4434 status=GetImageChannelDistortion(wand->images,reference->images,channel,
4435 metric,distortion,&wand->images->exception);
4469WandExport
double *MagickGetImageChannelDistortions(
MagickWand *wand,
4470 const MagickWand *reference,
const MetricType metric)
4473 *channel_distortion;
4476 assert(wand->signature == WandSignature);
4477 if (wand->debug != MagickFalse)
4478 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4480 assert(reference->signature == WandSignature);
4481 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4483 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4484 "ContainsNoImages",
"`%s'",wand->name);
4485 return((
double *) NULL);
4487 channel_distortion=GetImageChannelDistortions(wand->images,reference->images,
4488 metric,&wand->images->exception);
4489 return(channel_distortion);
4530WandExport ChannelFeatures *MagickGetImageChannelFeatures(
MagickWand *wand,
4531 const size_t distance)
4534 assert(wand->signature == WandSignature);
4535 if (wand->debug != MagickFalse)
4536 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4537 if (wand->images == (Image *) NULL)
4539 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4540 "ContainsNoImages",
"`%s'",wand->name);
4541 return((ChannelFeatures *) NULL);
4543 return(GetImageChannelFeatures(wand->images,distance,wand->exception));
4576WandExport MagickBooleanType MagickGetImageChannelKurtosis(
MagickWand *wand,
4577 const ChannelType channel,
double *kurtosis,
double *skewness)
4583 assert(wand->signature == WandSignature);
4584 if (wand->debug != MagickFalse)
4585 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4586 if (wand->images == (Image *) NULL)
4587 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4588 status=GetImageChannelKurtosis(wand->images,channel,kurtosis,skewness,
4623WandExport MagickBooleanType MagickGetImageChannelMean(
MagickWand *wand,
4624 const ChannelType channel,
double *mean,
double *standard_deviation)
4630 assert(wand->signature == WandSignature);
4631 if (wand->debug != MagickFalse)
4632 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4633 if (wand->images == (Image *) NULL)
4634 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4635 status=GetImageChannelMean(wand->images,channel,mean,standard_deviation,
4669WandExport MagickBooleanType MagickGetImageChannelRange(
MagickWand *wand,
4670 const ChannelType channel,
double *minima,
double *maxima)
4676 assert(wand->signature == WandSignature);
4677 if (wand->debug != MagickFalse)
4678 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4679 if (wand->images == (Image *) NULL)
4680 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4681 status=GetImageChannelRange(wand->images,channel,minima,maxima,
4716WandExport ChannelStatistics *MagickGetImageChannelStatistics(
MagickWand *wand)
4719 assert(wand->signature == WandSignature);
4720 if (wand->debug != MagickFalse)
4721 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4722 if (wand->images == (Image *) NULL)
4724 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4725 "ContainsNoImages",
"`%s'",wand->name);
4726 return((ChannelStatistics *) NULL);
4728 return(GetImageChannelStatistics(wand->images,wand->exception));
4759WandExport MagickBooleanType MagickGetImageColormapColor(
MagickWand *wand,
4763 assert(wand->signature == WandSignature);
4764 if (wand->debug != MagickFalse)
4765 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4766 if (wand->images == (Image *) NULL)
4767 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4768 if ((wand->images->colormap == (PixelPacket *) NULL) ||
4769 (index >= wand->images->colors))
4771 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4772 "InvalidColormapIndex",
"`%s'",wand->name);
4773 return(MagickFalse);
4775 PixelSetQuantumColor(color,wand->images->colormap+index);
4801WandExport
size_t MagickGetImageColors(
MagickWand *wand)
4804 assert(wand->signature == WandSignature);
4805 if (wand->debug != MagickFalse)
4806 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4807 if (wand->images == (Image *) NULL)
4809 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4810 "ContainsNoImages",
"`%s'",wand->name);
4813 return(GetNumberColors(wand->images,(FILE *) NULL,wand->exception));
4838WandExport ColorspaceType MagickGetImageColorspace(
MagickWand *wand)
4841 assert(wand->signature == WandSignature);
4842 if (wand->debug != MagickFalse)
4843 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4844 if (wand->images == (Image *) NULL)
4846 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4847 "ContainsNoImages",
"`%s'",wand->name);
4848 return(UndefinedColorspace);
4850 return(wand->images->colorspace);
4876WandExport CompositeOperator MagickGetImageCompose(
MagickWand *wand)
4879 assert(wand->signature == WandSignature);
4880 if (wand->debug != MagickFalse)
4881 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4882 if (wand->images == (Image *) NULL)
4884 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4885 "ContainsNoImages",
"`%s'",wand->name);
4886 return(UndefinedCompositeOp);
4888 return(wand->images->compose);
4913WandExport CompressionType MagickGetImageCompression(
MagickWand *wand)
4916 assert(wand->signature == WandSignature);
4917 if (wand->debug != MagickFalse)
4918 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4919 if (wand->images == (Image *) NULL)
4921 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4922 "ContainsNoImages",
"`%s'",wand->name);
4923 return(UndefinedCompression);
4925 return(wand->images->compression);
4950WandExport
size_t MagickGetImageCompressionQuality(
MagickWand *wand)
4953 assert(wand->signature == WandSignature);
4954 if (wand->debug != MagickFalse)
4955 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4956 if (wand->images == (Image *) NULL)
4958 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4959 "ContainsNoImages",
"`%s'",wand->name);
4962 return(wand->images->quality);
4987WandExport
size_t MagickGetImageDelay(
MagickWand *wand)
4990 assert(wand->signature == WandSignature);
4991 if (wand->debug != MagickFalse)
4992 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4993 if (wand->images == (Image *) NULL)
4994 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4995 return(wand->images->delay);
5020WandExport
size_t MagickGetImageDepth(
MagickWand *wand)
5023 assert(wand->signature == WandSignature);
5024 if (wand->debug != MagickFalse)
5025 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5026 if (wand->images == (Image *) NULL)
5027 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5028 return(wand->images->depth);
5062WandExport MagickBooleanType MagickGetImageDistortion(
MagickWand *wand,
5063 const MagickWand *reference,
const MetricType metric,
double *distortion)
5069 assert(wand->signature == WandSignature);
5070 if (wand->debug != MagickFalse)
5071 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5072 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
5073 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5074 status=GetImageDistortion(wand->images,reference->images,metric,distortion,
5075 &wand->images->exception);
5101WandExport DisposeType MagickGetImageDispose(
MagickWand *wand)
5104 assert(wand->signature == WandSignature);
5105 if (wand->debug != MagickFalse)
5106 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5107 if (wand->images == (Image *) NULL)
5109 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5110 "ContainsNoImages",
"`%s'",wand->name);
5111 return(UndefinedDispose);
5113 return((DisposeType) wand->images->dispose);
5138WandExport EndianType MagickGetImageEndian(
MagickWand *wand)
5141 assert(wand->signature == WandSignature);
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(UndefinedEndian);
5150 return(wand->images->endian);
5176WandExport
char *MagickGetImageFilename(
MagickWand *wand)
5179 assert(wand->signature == WandSignature);
5180 if (wand->debug != MagickFalse)
5181 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5182 if (wand->images == (Image *) NULL)
5184 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5185 "ContainsNoImages",
"`%s'",wand->name);
5186 return((
char *) NULL);
5188 return(AcquireString(wand->images->filename));
5214WandExport
char *MagickGetImageFormat(
MagickWand *wand)
5217 assert(wand->signature == WandSignature);
5218 if (wand->debug != MagickFalse)
5219 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5220 if (wand->images == (Image *) NULL)
5222 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5223 "ContainsNoImages",
"`%s'",wand->name);
5224 return((
char *) NULL);
5226 return(AcquireString(wand->images->magick));
5251WandExport
double MagickGetImageFuzz(
MagickWand *wand)
5254 assert(wand->signature == WandSignature);
5255 if (wand->debug != MagickFalse)
5256 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5257 if (wand->images == (Image *) NULL)
5259 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5260 "ContainsNoImages",
"`%s'",wand->name);
5263 return(wand->images->fuzz);
5288WandExport
double MagickGetImageGamma(
MagickWand *wand)
5291 assert(wand->signature == WandSignature);
5292 if (wand->debug != MagickFalse)
5293 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5294 if (wand->images == (Image *) NULL)
5296 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5297 "ContainsNoImages",
"`%s'",wand->name);
5300 return(wand->images->gamma);
5325WandExport GravityType MagickGetImageGravity(
MagickWand *wand)
5328 assert(wand->signature == WandSignature);
5329 if (wand->debug != MagickFalse)
5330 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5331 if (wand->images == (Image *) NULL)
5333 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5334 "ContainsNoImages",
"`%s'",wand->name);
5335 return(UndefinedGravity);
5337 return(wand->images->gravity);
5367WandExport MagickBooleanType MagickGetImageGreenPrimary(
MagickWand *wand,
5368 double *x,
double *y)
5371 assert(wand->signature == WandSignature);
5372 if (wand->debug != MagickFalse)
5373 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5374 if (wand->images == (Image *) NULL)
5375 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5376 *x=wand->images->chromaticity.green_primary.x;
5377 *y=wand->images->chromaticity.green_primary.y;
5403WandExport
size_t MagickGetImageHeight(
MagickWand *wand)
5406 assert(wand->signature == WandSignature);
5407 if (wand->debug != MagickFalse)
5408 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5409 if (wand->images == (Image *) NULL)
5410 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5411 return(wand->images->rows);
5442 size_t *number_colors)
5454 assert(wand->signature == WandSignature);
5455 if (wand->debug != MagickFalse)
5456 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5457 if (wand->images == (Image *) NULL)
5459 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5460 "ContainsNoImages",
"`%s'",wand->name);
5463 histogram=GetImageHistogram(wand->images,number_colors,wand->exception);
5464 if (histogram == (ColorPacket *) NULL)
5466 pixel_wands=NewPixelWands(*number_colors);
5467 for (i=0; i < (ssize_t) *number_colors; i++)
5469 PixelSetQuantumColor(pixel_wands[i],&histogram[i].pixel);
5470 PixelSetIndex(pixel_wands[i],histogram[i].index);
5471 PixelSetColorCount(pixel_wands[i],(
size_t) histogram[i].count);
5473 histogram=(ColorPacket *) RelinquishMagickMemory(histogram);
5474 return(pixel_wands);
5499WandExport InterlaceType MagickGetImageInterlaceScheme(
MagickWand *wand)
5502 assert(wand->signature == WandSignature);
5503 if (wand->debug != MagickFalse)
5504 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5505 if (wand->images == (Image *) NULL)
5507 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5508 "ContainsNoImages",
"`%s'",wand->name);
5509 return(UndefinedInterlace);
5511 return(wand->images->interlace);
5537WandExport InterpolatePixelMethod MagickGetImageInterpolateMethod(
5541 assert(wand->signature == WandSignature);
5542 if (wand->debug != MagickFalse)
5543 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5544 if (wand->images == (Image *) NULL)
5546 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5547 "ContainsNoImages",
"`%s'",wand->name);
5548 return(UndefinedInterpolatePixel);
5550 return(wand->images->interpolate);
5575WandExport
size_t MagickGetImageIterations(
MagickWand *wand)
5578 assert(wand->signature == WandSignature);
5579 if (wand->debug != MagickFalse)
5580 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5581 if (wand->images == (Image *) NULL)
5582 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5583 return(wand->images->iterations);
5611WandExport MagickBooleanType MagickGetImageLength(
MagickWand *wand,
5612 MagickSizeType *length)
5615 assert(wand->signature == WandSignature);
5616 if (wand->debug != MagickFalse)
5617 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5618 if (wand->images == (Image *) NULL)
5619 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5620 *length=GetBlobSize(wand->images);
5649WandExport MagickBooleanType MagickGetImageMatteColor(
MagickWand *wand,
5653 assert(wand->signature == WandSignature);
5654 if (wand->debug != MagickFalse)
5655 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5656 if (wand->images == (Image *) NULL)
5657 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5658 PixelSetQuantumColor(matte_color,&wand->images->matte_color);
5684WandExport OrientationType MagickGetImageOrientation(
MagickWand *wand)
5687 assert(wand->signature == WandSignature);
5688 if (wand->debug != MagickFalse)
5689 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5690 if (wand->images == (Image *) NULL)
5692 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5693 "ContainsNoImages",
"`%s'",wand->name);
5694 return(UndefinedOrientation);
5696 return(wand->images->orientation);
5730WandExport MagickBooleanType MagickGetImagePage(
MagickWand *wand,
5731 size_t *width,
size_t *height,ssize_t *x,ssize_t *y)
5734 assert(wand->signature == WandSignature);
5735 if (wand->debug != MagickFalse)
5736 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5737 if (wand->images == (Image *) NULL)
5738 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5739 *width=wand->images->page.width;
5740 *height=wand->images->page.height;
5741 *x=wand->images->page.x;
5742 *y=wand->images->page.y;
5773WandExport MagickBooleanType MagickGetImagePixelColor(
MagickWand *wand,
5774 const ssize_t x,
const ssize_t y,
PixelWand *color)
5786 assert(wand->signature == WandSignature);
5787 if (wand->debug != MagickFalse)
5788 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5789 if (wand->images == (Image *) NULL)
5790 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5791 image_view=AcquireVirtualCacheView(wand->images,wand->exception);
5792 p=GetCacheViewVirtualPixels(image_view,x,y,1,1,wand->exception);
5793 if (p == (
const PixelPacket *) NULL)
5795 image_view=DestroyCacheView(image_view);
5796 return(MagickFalse);
5798 indexes=GetCacheViewAuthenticIndexQueue(image_view);
5799 PixelSetQuantumColor(color,p);
5800 if (GetCacheViewColorspace(image_view) == CMYKColorspace)
5801 PixelSetBlackQuantum(color,*indexes);
5803 if (GetCacheViewStorageClass(image_view) == PseudoClass)
5804 PixelSetIndex(color,*indexes);
5805 image_view=DestroyCacheView(image_view);
5836WandExport MagickBooleanType MagickGetImageRange(
MagickWand *wand,
5837 double *minima,
double *maxima)
5843 assert(wand->signature == WandSignature);
5844 if (wand->debug != MagickFalse)
5845 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5846 if (wand->images == (Image *) NULL)
5847 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5848 status=GetImageRange(wand->images,minima,maxima,wand->exception);
5879WandExport MagickBooleanType MagickGetImageRedPrimary(
MagickWand *wand,
5880 double *x,
double *y)
5883 assert(wand->signature == WandSignature);
5884 if (wand->debug != MagickFalse)
5885 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5886 if (wand->images == (Image *) NULL)
5887 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5888 *x=wand->images->chromaticity.red_primary.x;
5889 *y=wand->images->chromaticity.red_primary.y;
5927 const size_t height,
const ssize_t x,
const ssize_t y)
5936 assert(wand->signature == WandSignature);
5937 if (wand->debug != MagickFalse)
5938 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5939 if (wand->images == (Image *) NULL)
5942 region.height=height;
5945 region_image=CropImage(wand->images,®ion,wand->exception);
5946 if (region_image == (Image *) NULL)
5948 return(CloneMagickWandFromImages(wand,region_image));
5973WandExport RenderingIntent MagickGetImageRenderingIntent(
MagickWand *wand)
5976 assert(wand->signature == WandSignature);
5977 if (wand->debug != MagickFalse)
5978 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5979 if (wand->images == (Image *) NULL)
5981 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5982 "ContainsNoImages",
"`%s'",wand->name);
5983 return(UndefinedIntent);
5985 return((RenderingIntent) wand->images->rendering_intent);
6015WandExport MagickBooleanType MagickGetImageResolution(
MagickWand *wand,
6016 double *x,
double *y)
6019 assert(wand->signature == WandSignature);
6020 if (wand->debug != MagickFalse)
6021 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6022 if (wand->images == (Image *) NULL)
6023 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6024 *x=wand->images->x_resolution;
6025 *y=wand->images->y_resolution;
6051WandExport
size_t MagickGetImageScene(
MagickWand *wand)
6054 assert(wand->signature == WandSignature);
6055 if (wand->debug != MagickFalse)
6056 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6057 if (wand->images == (Image *) NULL)
6058 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6059 return(wand->images->scene);
6085WandExport
char *MagickGetImageSignature(
MagickWand *wand)
6094 assert(wand->signature == WandSignature);
6095 if (wand->debug != MagickFalse)
6096 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6097 if (wand->images == (Image *) NULL)
6099 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6100 "ContainsNoImages",
"`%s'",wand->name);
6101 return((
char *) NULL);
6103 status=SignatureImage(wand->images);
6104 if (status == MagickFalse)
6105 InheritException(wand->exception,&wand->images->exception);
6106 value=GetImageProperty(wand->images,
"signature");
6107 if (value != (
const char *) NULL)
6108 return(AcquireString(value));
6109 InheritException(wand->exception,&wand->images->exception);
6110 return((
char *) NULL);
6135WandExport
size_t MagickGetImageTicksPerSecond(
MagickWand *wand)
6138 assert(wand->signature == WandSignature);
6139 if (wand->debug != MagickFalse)
6140 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6141 if (wand->images == (Image *) NULL)
6142 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6143 return((
size_t) wand->images->ticks_per_second);
6176WandExport ImageType MagickGetImageType(
MagickWand *wand)
6179 assert(wand->signature == WandSignature);
6180 if (wand->debug != MagickFalse)
6181 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6182 if (wand->images == (Image *) NULL)
6184 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6185 "ContainsNoImages",
"`%s'",wand->name);
6186 return(UndefinedType);
6188 return(GetImageType(wand->images,wand->exception));
6213WandExport ResolutionType MagickGetImageUnits(
MagickWand *wand)
6216 assert(wand->signature == WandSignature);
6217 if (wand->debug != MagickFalse)
6218 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6219 if (wand->images == (Image *) NULL)
6221 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6222 "ContainsNoImages",
"`%s'",wand->name);
6223 return(UndefinedResolution);
6225 return(wand->images->units);
6251WandExport VirtualPixelMethod MagickGetImageVirtualPixelMethod(
MagickWand *wand)
6254 assert(wand->signature == WandSignature);
6255 if (wand->debug != MagickFalse)
6256 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6257 if (wand->images == (Image *) NULL)
6259 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6260 "ContainsNoImages",
"`%s'",wand->name);
6261 return(UndefinedVirtualPixelMethod);
6263 return(GetImageVirtualPixelMethod(wand->images));
6293WandExport MagickBooleanType MagickGetImageWhitePoint(
MagickWand *wand,
6294 double *x,
double *y)
6297 assert(wand->signature == WandSignature);
6298 if (wand->debug != MagickFalse)
6299 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6300 if (wand->images == (Image *) NULL)
6301 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6302 *x=wand->images->chromaticity.white_point.x;
6303 *y=wand->images->chromaticity.white_point.y;
6329WandExport
size_t MagickGetImageWidth(
MagickWand *wand)
6332 assert(wand->signature == WandSignature);
6333 if (wand->debug != MagickFalse)
6334 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6335 if (wand->images == (Image *) NULL)
6336 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6337 return(wand->images->columns);
6363WandExport
size_t MagickGetNumberImages(
MagickWand *wand)
6366 assert(wand->signature == WandSignature);
6367 if (wand->debug != MagickFalse)
6368 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6369 return(GetImageListLength(wand->images));
6394WandExport
double MagickGetImageTotalInkDensity(
MagickWand *wand)
6397 assert(wand->signature == WandSignature);
6398 if (wand->debug != MagickFalse)
6399 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6400 if (wand->images == (Image *) NULL)
6402 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6403 "ContainsNoImages",
"`%s'",wand->name);
6406 return(GetImageTotalInkDensity(wand->images));
6441WandExport MagickBooleanType MagickHaldClutImage(
MagickWand *wand,
6447 status=MagickHaldClutImageChannel(wand,DefaultChannels,hald_wand);
6451WandExport MagickBooleanType MagickHaldClutImageChannel(
MagickWand *wand,
6452 const ChannelType channel,
const MagickWand *hald_wand)
6458 assert(wand->signature == WandSignature);
6459 if (wand->debug != MagickFalse)
6460 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6461 if ((wand->images == (Image *) NULL) || (hald_wand->images == (Image *) NULL))
6462 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6463 status=HaldClutImageChannel(wand->images,channel,hald_wand->images);
6464 if (status == MagickFalse)
6465 InheritException(wand->exception,&wand->images->exception);
6492WandExport MagickBooleanType MagickHasNextImage(
MagickWand *wand)
6495 assert(wand->signature == WandSignature);
6496 if (wand->debug != MagickFalse)
6497 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6498 if (wand->images == (Image *) NULL)
6499 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6500 if (GetNextImageInList(wand->images) == (Image *) NULL)
6501 return(MagickFalse);
6528WandExport MagickBooleanType MagickHasPreviousImage(
MagickWand *wand)
6531 assert(wand->signature == WandSignature);
6532 if (wand->debug != MagickFalse)
6533 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6534 if (wand->images == (Image *) NULL)
6535 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6536 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
6537 return(MagickFalse);
6564WandExport
char *MagickIdentifyImage(
MagickWand *wand)
6568 filename[MaxTextExtent];
6577 assert(wand->signature == WandSignature);
6578 if (wand->debug != MagickFalse)
6579 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6580 if (wand->images == (Image *) NULL)
6582 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6583 "ContainsNoImages",
"`%s'",wand->name);
6584 return((
char *) NULL);
6586 description=(
char *) NULL;
6587 unique_file=AcquireUniqueFileResource(filename);
6589 if (unique_file != -1)
6590 file=fdopen(unique_file,
"wb");
6591 if ((unique_file == -1) || (file == (FILE *) NULL))
6593 (void) RelinquishUniqueFileResource(filename);
6594 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6595 "UnableToCreateTemporaryFile",
"`%s'",wand->name);
6596 return((
char *) NULL);
6598 (void) IdentifyImage(wand->images,file,MagickTrue);
6599 (void) fclose(file);
6600 description=FileToString(filename,~0UL,wand->exception);
6601 (void) RelinquishUniqueFileResource(filename);
6602 return(description);
6633WandExport MagickBooleanType MagickImplodeImage(
MagickWand *wand,
6634 const double amount)
6640 assert(wand->signature == WandSignature);
6641 if (wand->debug != MagickFalse)
6642 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6643 if (wand->images == (Image *) NULL)
6644 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6645 implode_image=ImplodeImage(wand->images,amount,wand->exception);
6646 if (implode_image == (Image *) NULL)
6647 return(MagickFalse);
6648 ReplaceImageInList(&wand->images,implode_image);
6703WandExport MagickBooleanType MagickImportImagePixels(
MagickWand *wand,
6704 const ssize_t x,
const ssize_t y,
const size_t columns,
const size_t rows,
6705 const char *map,
const StorageType storage,
const void *pixels)
6711 assert(wand->signature == WandSignature);
6712 if (wand->debug != MagickFalse)
6713 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6714 if (wand->images == (Image *) NULL)
6715 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6716 status=ImportImagePixels(wand->images,x,y,columns,rows,map,storage,pixels);
6717 if (status == MagickFalse)
6718 InheritException(wand->exception,&wand->images->exception);
6753WandExport MagickBooleanType MagickInverseFourierTransformImage(
6755 const MagickBooleanType magnitude)
6763 assert(magnitude_wand != (
MagickWand *) NULL);
6764 assert(magnitude_wand->signature == WandSignature);
6765 if (magnitude_wand->debug != MagickFalse)
6766 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",
6767 magnitude_wand->name);
6768 wand=magnitude_wand;
6769 if (magnitude_wand->images == (Image *) NULL)
6770 ThrowWandException(WandError,
"ContainsNoImages",
6771 magnitude_wand->name);
6773 assert(phase_wand->signature == WandSignature);
6774 inverse_image=InverseFourierTransformImage(magnitude_wand->images,
6775 phase_wand->images,magnitude,wand->exception);
6776 if (inverse_image == (Image *) NULL)
6777 return(MagickFalse);
6778 ReplaceImageInList(&wand->images,inverse_image);
6806WandExport MagickBooleanType MagickLabelImage(
MagickWand *wand,
6813 assert(wand->signature == WandSignature);
6814 if (wand->debug != MagickFalse)
6815 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6816 if (wand->images == (Image *) NULL)
6817 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6818 status=SetImageProperty(wand->images,
"label",label);
6819 if (status == MagickFalse)
6820 InheritException(wand->exception,&wand->images->exception);
6866WandExport MagickBooleanType MagickLevelImage(
MagickWand *wand,
6867 const double black_point,
const double gamma,
const double white_point)
6872 status=MagickLevelImageChannel(wand,DefaultChannels,black_point,gamma,
6877WandExport MagickBooleanType MagickLevelImageChannel(
MagickWand *wand,
6878 const ChannelType channel,
const double black_point,
const double gamma,
6879 const double white_point)
6885 assert(wand->signature == WandSignature);
6886 if (wand->debug != MagickFalse)
6887 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6888 if (wand->images == (Image *) NULL)
6889 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6890 status=LevelImageChannel(wand->images,channel,black_point,white_point,gamma);
6891 if (status == MagickFalse)
6892 InheritException(wand->exception,&wand->images->exception);
6935WandExport MagickBooleanType MagickLevelImageColors(
MagickWand *wand,
6937 const MagickBooleanType invert)
6942 status=MagickLevelImageColorsChannel(wand,DefaultChannels,black_color,
6943 white_color,invert);
6947WandExport MagickBooleanType MagickLevelImageColorsChannel(
MagickWand *wand,
6948 const ChannelType channel,
const PixelWand *black_color,
6949 const PixelWand *white_color,
const MagickBooleanType invert)
6959 assert(wand->signature == WandSignature);
6960 if (wand->debug != MagickFalse)
6961 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6962 if (wand->images == (Image *) NULL)
6963 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6964 PixelGetMagickColor(black_color,&black);
6965 PixelGetMagickColor(white_color,&white);
6966 status=LevelColorsImageChannel(wand->images,channel,&black,&white,invert);
6967 if (status == MagickFalse)
6968 InheritException(wand->exception,&wand->images->exception);
7010WandExport MagickBooleanType MagickLevelizeImage(
MagickWand *wand,
7011 const double black_point,
const double gamma,
const double white_point)
7016 status=MagickLevelizeImageChannel(wand,DefaultChannels,black_point,gamma,
7021WandExport MagickBooleanType MagickLevelizeImageChannel(
MagickWand *wand,
7022 const ChannelType channel,
const double black_point,
const double gamma,
7023 const double white_point)
7029 assert(wand->signature == WandSignature);
7030 if (wand->debug != MagickFalse)
7031 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7032 if (wand->images == (Image *) NULL)
7033 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7034 status=LevelizeImageChannel(wand->images,channel,black_point,white_point,
7036 if (status == MagickFalse)
7037 InheritException(wand->exception,&wand->images->exception);
7071WandExport MagickBooleanType MagickLinearStretchImage(
MagickWand *wand,
7072 const double black_point,
const double white_point)
7078 assert(wand->signature == WandSignature);
7079 if (wand->debug != MagickFalse)
7080 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7081 if (wand->images == (Image *) NULL)
7082 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7083 status=LinearStretchImage(wand->images,black_point,white_point);
7084 if (status == MagickFalse)
7085 InheritException(wand->exception,&wand->images->exception);
7119WandExport MagickBooleanType MagickLiquidRescaleImage(
MagickWand *wand,
7120 const size_t columns,
const size_t rows,
const double delta_x,
7121 const double rigidity)
7127 assert(wand->signature == WandSignature);
7128 if (wand->debug != MagickFalse)
7129 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7130 if (wand->images == (Image *) NULL)
7131 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7132 rescale_image=LiquidRescaleImage(wand->images,columns,rows,delta_x,
7133 rigidity,wand->exception);
7134 if (rescale_image == (Image *) NULL)
7135 return(MagickFalse);
7136 ReplaceImageInList(&wand->images,rescale_image);
7169WandExport MagickBooleanType MagickLocalContrastImage(
MagickWand *wand,
7170 const double radius,
const double strength)
7176 assert(wand->signature == WandSignature);
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 contrast_image=LocalContrastImage(wand->images,radius,strength,
7183 if (contrast_image == (Image *) NULL)
7184 return(MagickFalse);
7185 ReplaceImageInList(&wand->images,contrast_image);
7212WandExport MagickBooleanType MagickMagnifyImage(
MagickWand *wand)
7218 assert(wand->signature == WandSignature);
7219 if (wand->debug != MagickFalse)
7220 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7221 if (wand->images == (Image *) NULL)
7222 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7223 magnify_image=MagnifyImage(wand->images,wand->exception);
7224 if (magnify_image == (Image *) NULL)
7225 return(MagickFalse);
7226 ReplaceImageInList(&wand->images,magnify_image);
7274 const ImageLayerMethod method)
7280 assert(wand->signature == WandSignature);
7281 if (wand->debug != MagickFalse)
7282 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7283 if (wand->images == (Image *) NULL)
7285 mosaic_image=MergeImageLayers(wand->images,method,wand->exception);
7286 if (mosaic_image == (Image *) NULL)
7288 return(CloneMagickWandFromImages(wand,mosaic_image));
7314WandExport MagickBooleanType MagickMinifyImage(
MagickWand *wand)
7320 assert(wand->signature == WandSignature);
7321 if (wand->debug != MagickFalse)
7322 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7323 if (wand->images == (Image *) NULL)
7324 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7325 minify_image=MinifyImage(wand->images,wand->exception);
7326 if (minify_image == (Image *) NULL)
7327 return(MagickFalse);
7328 ReplaceImageInList(&wand->images,minify_image);
7368WandExport MagickBooleanType MagickModulateImage(
MagickWand *wand,
7369 const double brightness,
const double saturation,
const double hue)
7372 modulate[MaxTextExtent];
7378 assert(wand->signature == WandSignature);
7379 if (wand->debug != MagickFalse)
7380 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7381 if (wand->images == (Image *) NULL)
7382 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7383 (void) FormatLocaleString(modulate,MaxTextExtent,
"%g,%g,%g",
7384 brightness,saturation,hue);
7385 status=ModulateImage(wand->images,modulate);
7386 if (status == MagickFalse)
7387 InheritException(wand->exception,&wand->images->exception);
7432 const DrawingWand *drawing_wand,
const char *tile_geometry,
7433 const char *thumbnail_geometry,
const MontageMode mode,
const char *frame)
7448 assert(wand->signature == WandSignature);
7449 if (wand->debug != MagickFalse)
7450 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7451 if (wand->images == (Image *) NULL)
7453 montage_info=CloneMontageInfo(wand->image_info,(MontageInfo *) NULL);
7458 (void) CloneString(&montage_info->frame,
"15x15+3+3");
7459 montage_info->shadow=MagickTrue;
7464 montage_info->frame=(
char *) NULL;
7465 montage_info->shadow=MagickFalse;
7466 montage_info->border_width=0;
7469 case ConcatenateMode:
7471 montage_info->frame=(
char *) NULL;
7472 montage_info->shadow=MagickFalse;
7473 (void) CloneString(&montage_info->geometry,
"+0+0");
7474 montage_info->border_width=0;
7480 font=DrawGetFont(drawing_wand);
7481 if (font != (
char *) NULL)
7482 (void) CloneString(&montage_info->font,font);
7483 if (frame != (
char *) NULL)
7484 (void) CloneString(&montage_info->frame,frame);
7485 montage_info->pointsize=DrawGetFontSize(drawing_wand);
7486 pixel_wand=NewPixelWand();
7487 DrawGetFillColor(drawing_wand,pixel_wand);
7488 PixelGetQuantumColor(pixel_wand,&montage_info->fill);
7489 DrawGetStrokeColor(drawing_wand,pixel_wand);
7490 PixelGetQuantumColor(pixel_wand,&montage_info->stroke);
7491 pixel_wand=DestroyPixelWand(pixel_wand);
7492 if (thumbnail_geometry != (
char *) NULL)
7493 (void) CloneString(&montage_info->geometry,thumbnail_geometry);
7494 if (tile_geometry != (
char *) NULL)
7495 (void) CloneString(&montage_info->tile,tile_geometry);
7496 montage_image=MontageImageList(wand->image_info,montage_info,wand->images,
7498 montage_info=DestroyMontageInfo(montage_info);
7499 if (montage_image == (Image *) NULL)
7501 return(CloneMagickWandFromImages(wand,montage_image));
7532 const size_t number_frames)
7538 assert(wand->signature == WandSignature);
7539 if (wand->debug != MagickFalse)
7540 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7541 if (wand->images == (Image *) NULL)
7543 morph_image=MorphImages(wand->images,number_frames,wand->exception);
7544 if (morph_image == (Image *) NULL)
7546 return(CloneMagickWandFromImages(wand,morph_image));
7588WandExport MagickBooleanType MagickMorphologyImage(
MagickWand *wand,
7589 const MorphologyMethod method,
const ssize_t iterations,
7590 const KernelInfo *kernel)
7595 status=MagickMorphologyImageChannel(wand,DefaultChannels,method,iterations,
7600WandExport MagickBooleanType MagickMorphologyImageChannel(
MagickWand *wand,
7601 const ChannelType channel,
const MorphologyMethod method,
7602 const ssize_t iterations,
const KernelInfo *kernel)
7608 assert(wand->signature == WandSignature);
7609 if (wand->debug != MagickFalse)
7610 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7611 if (kernel == (
const KernelInfo *) NULL)
7612 return(MagickFalse);
7613 if (wand->images == (Image *) NULL)
7614 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7615 morphology_image=MorphologyImageChannel(wand->images,channel,method,
7616 iterations,kernel,wand->exception);
7617 if (morphology_image == (Image *) NULL)
7618 return(MagickFalse);
7619 ReplaceImageInList(&wand->images,morphology_image);
7663WandExport MagickBooleanType MagickMotionBlurImage(
MagickWand *wand,
7664 const double radius,
const double sigma,
const double angle)
7669 status=MagickMotionBlurImageChannel(wand,DefaultChannels,radius,sigma,angle);
7673WandExport MagickBooleanType MagickMotionBlurImageChannel(
MagickWand *wand,
7674 const ChannelType channel,
const double radius,
const double sigma,
7681 assert(wand->signature == WandSignature);
7682 if (wand->debug != MagickFalse)
7683 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7684 if (wand->images == (Image *) NULL)
7685 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7686 blur_image=MotionBlurImageChannel(wand->images,channel,radius,sigma,angle,
7688 if (blur_image == (Image *) NULL)
7689 return(MagickFalse);
7690 ReplaceImageInList(&wand->images,blur_image);
7729WandExport MagickBooleanType MagickNegateImage(
MagickWand *wand,
7730 const MagickBooleanType gray)
7735 status=MagickNegateImageChannel(wand,DefaultChannels,gray);
7739WandExport MagickBooleanType MagickNegateImageChannel(
MagickWand *wand,
7740 const ChannelType channel,
const MagickBooleanType gray)
7746 assert(wand->signature == WandSignature);
7747 if (wand->debug != MagickFalse)
7748 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7749 if (wand->images == (Image *) NULL)
7750 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7751 status=NegateImageChannel(wand->images,channel,gray);
7752 if (status == MagickFalse)
7753 InheritException(wand->exception,&wand->images->exception);
7788WandExport MagickBooleanType MagickNewImage(
MagickWand *wand,
const size_t width,
7789 const size_t height,
const PixelWand *background)
7798 assert(wand->signature == WandSignature);
7799 if (wand->debug != MagickFalse)
7800 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7801 PixelGetMagickColor(background,&pixel);
7802 images=NewMagickImage(wand->image_info,width,height,&pixel);
7803 if (images == (Image *) NULL)
7804 return(MagickFalse);
7805 if (images->exception.severity != UndefinedException)
7806 InheritException(wand->exception,&images->exception);
7807 return(InsertImageInWand(wand,images));
7845WandExport MagickBooleanType MagickNextImage(
MagickWand *wand)
7848 assert(wand->signature == WandSignature);
7849 if (wand->debug != MagickFalse)
7850 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7851 if (wand->images == (Image *) NULL)
7852 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7853 wand->insert_before=MagickFalse;
7854 if (wand->image_pending != MagickFalse)
7856 wand->image_pending=MagickFalse;
7859 if (GetNextImageInList(wand->images) == (Image *) NULL)
7861 wand->image_pending=MagickTrue;
7862 return(MagickFalse);
7864 wand->images=GetNextImageInList(wand->images);
7899WandExport MagickBooleanType MagickNormalizeImage(
MagickWand *wand)
7904 status=MagickNormalizeImageChannel(wand,DefaultChannels);
7908WandExport MagickBooleanType MagickNormalizeImageChannel(
MagickWand *wand,
7909 const ChannelType channel)
7915 assert(wand->signature == WandSignature);
7916 if (wand->debug != MagickFalse)
7917 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7918 if (wand->images == (Image *) NULL)
7919 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7920 status=NormalizeImageChannel(wand->images,channel);
7921 if (status == MagickFalse)
7922 InheritException(wand->exception,&wand->images->exception);
7953WandExport MagickBooleanType MagickOilPaintImage(
MagickWand *wand,
7954 const double radius)
7960 assert(wand->signature == WandSignature);
7961 if (wand->debug != MagickFalse)
7962 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7963 if (wand->images == (Image *) NULL)
7964 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7965 paint_image=OilPaintImage(wand->images,radius,wand->exception);
7966 if (paint_image == (Image *) NULL)
7967 return(MagickFalse);
7968 ReplaceImageInList(&wand->images,paint_image);
8016WandExport MagickBooleanType MagickOpaquePaintImage(
MagickWand *wand,
8018 const MagickBooleanType invert)
8023 status=MagickOpaquePaintImageChannel(wand,DefaultChannels,target,fill,fuzz,
8028WandExport MagickBooleanType MagickOpaquePaintImageChannel(
MagickWand *wand,
8030 const double fuzz,
const MagickBooleanType invert)
8040 assert(wand->signature == WandSignature);
8041 if (wand->debug != MagickFalse)
8042 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8043 if (wand->images == (Image *) NULL)
8044 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8045 PixelGetMagickColor(target,&target_pixel);
8046 PixelGetMagickColor(fill,&fill_pixel);
8047 wand->images->fuzz=fuzz;
8048 status=OpaquePaintImageChannel(wand->images,channel,&target_pixel,
8049 &fill_pixel,invert);
8050 if (status == MagickFalse)
8051 InheritException(wand->exception,&wand->images->exception);
8086 assert(wand->signature == WandSignature);
8087 if (wand->debug != MagickFalse)
8088 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8089 if (wand->images == (Image *) NULL)
8091 optimize_image=OptimizeImageLayers(wand->images,wand->exception);
8092 if (optimize_image == (Image *) NULL)
8094 return(CloneMagickWandFromImages(wand,optimize_image));
8125WandExport MagickBooleanType MagickOptimizeImageTransparency(
MagickWand *wand)
8128 assert(wand->signature == WandSignature);
8129 if(wand->debug != MagickFalse)
8130 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8131 if (wand->images == (Image *) NULL)
8132 return(MagickFalse);
8133 OptimizeImageTransparency(wand->images,wand->exception);
8187WandExport MagickBooleanType MagickOrderedPosterizeImage(
MagickWand *wand,
8188 const char *threshold_map)
8193 status=MagickOrderedPosterizeImageChannel(wand,DefaultChannels,threshold_map);
8197WandExport MagickBooleanType MagickOrderedPosterizeImageChannel(
8198 MagickWand *wand,
const ChannelType channel,
const char *threshold_map)
8204 assert(wand->signature == WandSignature);
8205 if (wand->debug != MagickFalse)
8206 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8207 if (wand->images == (Image *) NULL)
8208 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8209 status=OrderedPosterizeImageChannel(wand->images,channel,threshold_map,
8241WandExport MagickBooleanType MagickPingImage(
MagickWand *wand,
8242 const char *filename)
8251 assert(wand->signature == WandSignature);
8252 if (wand->debug != MagickFalse)
8253 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8254 ping_info=CloneImageInfo(wand->image_info);
8255 if (filename != (
const char *) NULL)
8256 (void) CopyMagickString(ping_info->filename,filename,MaxTextExtent);
8257 images=PingImage(ping_info,wand->exception);
8258 ping_info=DestroyImageInfo(ping_info);
8259 if (images == (Image *) NULL)
8260 return(MagickFalse);
8261 return(InsertImageInWand(wand,images));
8291WandExport MagickBooleanType MagickPingImageBlob(
MagickWand *wand,
8292 const void *blob,
const size_t length)
8298 assert(wand->signature == WandSignature);
8299 if (wand->debug != MagickFalse)
8300 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8301 images=PingBlob(wand->image_info,blob,length,wand->exception);
8302 if (images == (Image *) NULL)
8303 return(MagickFalse);
8304 return(InsertImageInWand(wand,images));
8332WandExport MagickBooleanType MagickPingImageFile(
MagickWand *wand,FILE *file)
8341 assert(wand->signature == WandSignature);
8342 assert(file != (FILE *) NULL);
8343 if (wand->debug != MagickFalse)
8344 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8345 read_info=CloneImageInfo(wand->image_info);
8346 SetImageInfoFile(read_info,file);
8347 images=PingImage(read_info,wand->exception);
8348 read_info=DestroyImageInfo(read_info);
8349 if (images == (Image *) NULL)
8350 return(MagickFalse);
8351 return(InsertImageInWand(wand,images));
8381WandExport MagickBooleanType MagickPolaroidImage(
MagickWand *wand,
8382 const DrawingWand *drawing_wand,
const double angle)
8391 assert(wand->signature == WandSignature);
8392 if (wand->debug != MagickFalse)
8393 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8394 if (wand->images == (Image *) NULL)
8395 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8396 draw_info=PeekDrawingWand(drawing_wand);
8397 if (draw_info == (DrawInfo *) NULL)
8398 return(MagickFalse);
8399 polaroid_image=PolaroidImage(wand->images,draw_info,angle,wand->exception);
8400 if (polaroid_image == (Image *) NULL)
8401 return(MagickFalse);
8402 ReplaceImageInList(&wand->images,polaroid_image);
8435WandExport MagickBooleanType MagickPosterizeImage(
MagickWand *wand,
8436 const size_t levels,
const MagickBooleanType dither)
8442 assert(wand->signature == WandSignature);
8443 if (wand->debug != MagickFalse)
8444 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8445 if (wand->images == (Image *) NULL)
8446 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8447 status=PosterizeImage(wand->images,levels,dither);
8448 if (status == MagickFalse)
8449 InheritException(wand->exception,&wand->images->exception);
8482 const PreviewType preview)
8488 assert(wand->signature == WandSignature);
8489 if (wand->debug != MagickFalse)
8490 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8491 if (wand->images == (Image *) NULL)
8493 preview_image=PreviewImage(wand->images,preview,wand->exception);
8494 if (preview_image == (Image *) NULL)
8496 return(CloneMagickWandFromImages(wand,preview_image));
8535WandExport MagickBooleanType MagickPreviousImage(
MagickWand *wand)
8538 assert(wand->signature == WandSignature);
8539 if (wand->debug != MagickFalse)
8540 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8541 if (wand->images == (Image *) NULL)
8542 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8543 if (wand->image_pending != MagickFalse)
8545 wand->image_pending=MagickFalse;
8548 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
8550 wand->image_pending=MagickTrue;
8551 wand->insert_before=MagickTrue;
8552 return(MagickFalse);
8554 wand->images=GetPreviousImageInList(wand->images);
8609WandExport MagickBooleanType MagickQuantizeImage(
MagickWand *wand,
8610 const size_t number_colors,
const ColorspaceType colorspace,
8611 const size_t treedepth,
const MagickBooleanType dither,
8612 const MagickBooleanType measure_error)
8621 assert(wand->signature == WandSignature);
8622 if (wand->debug != MagickFalse)
8623 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8624 if (wand->images == (Image *) NULL)
8625 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8626 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
8627 quantize_info->number_colors=number_colors;
8628 quantize_info->dither=dither;
8629 quantize_info->tree_depth=treedepth;
8630 quantize_info->colorspace=colorspace;
8631 quantize_info->measure_error=measure_error;
8632 status=QuantizeImage(quantize_info,wand->images);
8633 if (status == MagickFalse)
8634 InheritException(wand->exception,&wand->images->exception);
8635 quantize_info=DestroyQuantizeInfo(quantize_info);
8690WandExport MagickBooleanType MagickQuantizeImages(
MagickWand *wand,
8691 const size_t number_colors,
const ColorspaceType colorspace,
8692 const size_t treedepth,
const MagickBooleanType dither,
8693 const MagickBooleanType measure_error)
8702 assert(wand->signature == WandSignature);
8703 if (wand->debug != MagickFalse)
8704 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8705 if (wand->images == (Image *) NULL)
8706 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8707 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
8708 quantize_info->number_colors=number_colors;
8709 quantize_info->dither=dither;
8710 quantize_info->tree_depth=treedepth;
8711 quantize_info->colorspace=colorspace;
8712 quantize_info->measure_error=measure_error;
8713 status=QuantizeImages(quantize_info,wand->images);
8714 if (status == MagickFalse)
8715 InheritException(wand->exception,&wand->images->exception);
8716 quantize_info=DestroyQuantizeInfo(quantize_info);
8752WandExport MagickBooleanType MagickRaiseImage(
MagickWand *wand,
8753 const size_t width,
const size_t height,
const ssize_t x,
const ssize_t y,
8754 const MagickBooleanType raise)
8763 assert(wand->signature == WandSignature);
8764 if (wand->debug != MagickFalse)
8765 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8766 if (wand->images == (Image *) NULL)
8767 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8768 raise_info.width=width;
8769 raise_info.height=height;
8772 status=RaiseImage(wand->images,&raise_info,raise);
8773 if (status == MagickFalse)
8774 InheritException(wand->exception,&wand->images->exception);
8811WandExport MagickBooleanType MagickRandomThresholdImage(
MagickWand *wand,
8812 const double low,
const double high)
8817 status=MagickRandomThresholdImageChannel(wand,DefaultChannels,low,high);
8821WandExport MagickBooleanType MagickRandomThresholdImageChannel(
MagickWand *wand,
8822 const ChannelType channel,
const double low,
const double high)
8825 threshold[MaxTextExtent];
8831 assert(wand->signature == WandSignature);
8832 if (wand->debug != MagickFalse)
8833 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8834 if (wand->images == (Image *) NULL)
8835 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8836 (void) FormatLocaleString(threshold,MaxTextExtent,
"%gx%g",low,high);
8837 status=RandomThresholdImageChannel(wand->images,channel,threshold,
8839 if (status == MagickFalse)
8840 InheritException(wand->exception,&wand->images->exception);
8872WandExport MagickBooleanType MagickReadImage(
MagickWand *wand,
8873 const char *filename)
8882 assert(wand->signature == WandSignature);
8883 if (wand->debug != MagickFalse)
8884 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8885 read_info=CloneImageInfo(wand->image_info);
8886 if (filename != (
const char *) NULL)
8887 (void) CopyMagickString(read_info->filename,filename,MaxTextExtent);
8888 images=ReadImage(read_info,wand->exception);
8889 read_info=DestroyImageInfo(read_info);
8890 if (images == (Image *) NULL)
8891 return(MagickFalse);
8892 return(InsertImageInWand(wand,images));
8922WandExport MagickBooleanType MagickReadImageBlob(
MagickWand *wand,
8923 const void *blob,
const size_t length)
8929 assert(wand->signature == WandSignature);
8930 if (wand->debug != MagickFalse)
8931 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8932 images=BlobToImage(wand->image_info,blob,length,wand->exception);
8933 if (images == (Image *) NULL)
8934 return(MagickFalse);
8935 return(InsertImageInWand(wand,images));
8963WandExport MagickBooleanType MagickReadImageFile(
MagickWand *wand,FILE *file)
8972 assert(wand->signature == WandSignature);
8973 assert(file != (FILE *) NULL);
8974 if (wand->debug != MagickFalse)
8975 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8976 read_info=CloneImageInfo(wand->image_info);
8977 SetImageInfoFile(read_info,file);
8978 images=ReadImage(read_info,wand->exception);
8979 read_info=DestroyImageInfo(read_info);
8980 if (images == (Image *) NULL)
8981 return(MagickFalse);
8982 return(InsertImageInWand(wand,images));
9014WandExport MagickBooleanType MagickRemapImage(
MagickWand *wand,
9015 const MagickWand *remap_wand,
const DitherMethod method)
9024 assert(wand->signature == WandSignature);
9025 if (wand->debug != MagickFalse)
9026 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9027 if ((wand->images == (Image *) NULL) ||
9028 (remap_wand->images == (Image *) NULL))
9029 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9030 quantize_info=AcquireQuantizeInfo(wand->image_info);
9031 quantize_info->dither_method=method;
9032 if (method == NoDitherMethod)
9033 quantize_info->dither=MagickFalse;
9034 status=RemapImage(quantize_info,wand->images,remap_wand->images);
9035 quantize_info=DestroyQuantizeInfo(quantize_info);
9036 if (status == MagickFalse)
9037 InheritException(wand->exception,&wand->images->exception);
9065WandExport MagickBooleanType MagickRemoveImage(
MagickWand *wand)
9068 assert(wand->signature == WandSignature);
9069 if (wand->debug != MagickFalse)
9070 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9071 if (wand->images == (Image *) NULL)
9072 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9073 DeleteImageFromList(&wand->images);
9119WandExport MagickBooleanType MagickResampleImage(
MagickWand *wand,
9120 const double x_resolution,
const double y_resolution,
const FilterTypes filter,
9127 assert(wand->signature == WandSignature);
9128 if (wand->debug != MagickFalse)
9129 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9130 if (wand->images == (Image *) NULL)
9131 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9132 resample_image=ResampleImage(wand->images,x_resolution,y_resolution,filter,
9133 blur,wand->exception);
9134 if (resample_image == (Image *) NULL)
9135 return(MagickFalse);
9136 ReplaceImageInList(&wand->images,resample_image);
9165WandExport MagickBooleanType MagickResetImagePage(
MagickWand *wand,
9169 assert(wand->signature == WandSignature);
9170 if (wand->debug != MagickFalse)
9171 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9172 if (wand->images == (Image *) NULL)
9173 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9174 if ((page == (
char *) NULL) || (*page ==
'\0'))
9176 (void) ParseAbsoluteGeometry(
"0x0+0+0",&wand->images->page);
9179 return(ResetImagePage(wand->images,page));
9225WandExport MagickBooleanType MagickResizeImage(
MagickWand *wand,
9226 const size_t columns,
const size_t rows,
const FilterTypes filter,
9233 assert(wand->signature == WandSignature);
9234 if (wand->debug != MagickFalse)
9235 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9236 if (wand->images == (Image *) NULL)
9237 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9238 resize_image=ResizeImage(wand->images,columns,rows,filter,blur,
9240 if (resize_image == (Image *) NULL)
9241 return(MagickFalse);
9242 ReplaceImageInList(&wand->images,resize_image);
9273WandExport MagickBooleanType MagickRollImage(
MagickWand *wand,
const ssize_t x,
9280 assert(wand->signature == WandSignature);
9281 if (wand->debug != MagickFalse)
9282 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9283 if (wand->images == (Image *) NULL)
9284 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9285 roll_image=RollImage(wand->images,x,y,wand->exception);
9286 if (roll_image == (Image *) NULL)
9287 return(MagickFalse);
9288 ReplaceImageInList(&wand->images,roll_image);
9322WandExport MagickBooleanType MagickRotateImage(
MagickWand *wand,
9323 const PixelWand *background,
const double degrees)
9329 assert(wand->signature == WandSignature);
9330 if (wand->debug != MagickFalse)
9331 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9332 if (wand->images == (Image *) NULL)
9333 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9334 PixelGetQuantumColor(background,&wand->images->background_color);
9335 rotate_image=RotateImage(wand->images,degrees,wand->exception);
9336 if (rotate_image == (Image *) NULL)
9337 return(MagickFalse);
9338 ReplaceImageInList(&wand->images,rotate_image);
9371WandExport MagickBooleanType MagickRotationalBlurImage(
MagickWand *wand,
9377 status=MagickRotationalBlurImageChannel(wand,DefaultChannels,angle);
9381WandExport MagickBooleanType MagickRotationalBlurImageChannel(
MagickWand *wand,
9382 const ChannelType channel,
const double angle)
9388 assert(wand->signature == WandSignature);
9389 if (wand->debug != MagickFalse)
9390 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9391 if (wand->images == (Image *) NULL)
9392 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9393 blur_image=RotationalBlurImageChannel(wand->images,channel,angle,
9395 if (blur_image == (Image *) NULL)
9396 return(MagickFalse);
9397 ReplaceImageInList(&wand->images,blur_image);
9430WandExport MagickBooleanType MagickSampleImage(
MagickWand *wand,
9431 const size_t columns,
const size_t rows)
9437 assert(wand->signature == WandSignature);
9438 if (wand->debug != MagickFalse)
9439 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9440 if (wand->images == (Image *) NULL)
9441 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9442 sample_image=SampleImage(wand->images,columns,rows,wand->exception);
9443 if (sample_image == (Image *) NULL)
9444 return(MagickFalse);
9445 ReplaceImageInList(&wand->images,sample_image);
9476WandExport MagickBooleanType MagickScaleImage(
MagickWand *wand,
9477 const size_t columns,
const size_t rows)
9483 assert(wand->signature == WandSignature);
9484 if (wand->debug != MagickFalse)
9485 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9486 if (wand->images == (Image *) NULL)
9487 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9488 scale_image=ScaleImage(wand->images,columns,rows,wand->exception);
9489 if (scale_image == (Image *) NULL)
9490 return(MagickFalse);
9491 ReplaceImageInList(&wand->images,scale_image);
9534MagickExport MagickBooleanType MagickSegmentImage(
MagickWand *wand,
9535 const ColorspaceType colorspace,
const MagickBooleanType verbose,
9536 const double cluster_threshold,
const double smooth_threshold)
9542 assert(wand->signature == WandSignature);
9543 if (wand->debug != MagickFalse)
9544 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9545 if (wand->images == (Image *) NULL)
9546 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9547 status=SegmentImage(wand->images,colorspace,verbose,cluster_threshold,
9549 if (status == MagickFalse)
9550 InheritException(wand->exception,&wand->images->exception);
9593WandExport MagickBooleanType MagickSelectiveBlurImage(
MagickWand *wand,
9594 const double radius,
const double sigma,
const double threshold)
9599 status=MagickSelectiveBlurImageChannel(wand,DefaultChannels,radius,sigma,
9604WandExport MagickBooleanType MagickSelectiveBlurImageChannel(
MagickWand *wand,
9605 const ChannelType channel,
const double radius,
const double sigma,
9606 const double threshold)
9612 assert(wand->signature == WandSignature);
9613 if (wand->debug != MagickFalse)
9614 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9615 if (wand->images == (Image *) NULL)
9616 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9617 blur_image=SelectiveBlurImageChannel(wand->images,channel,radius,sigma,
9618 threshold,wand->exception);
9619 if (blur_image == (Image *) NULL)
9620 return(MagickFalse);
9621 ReplaceImageInList(&wand->images,blur_image);
9652WandExport MagickBooleanType MagickSeparateImageChannel(
MagickWand *wand,
9653 const ChannelType channel)
9659 assert(wand->signature == WandSignature);
9660 if (wand->debug != MagickFalse)
9661 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9662 if (wand->images == (Image *) NULL)
9663 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9664 status=SeparateImageChannel(wand->images,channel);
9665 if (status == MagickFalse)
9666 InheritException(wand->exception,&wand->images->exception);
9698WandExport MagickBooleanType MagickSepiaToneImage(
MagickWand *wand,
9699 const double threshold)
9705 assert(wand->signature == WandSignature);
9706 if (wand->debug != MagickFalse)
9707 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9708 if (wand->images == (Image *) NULL)
9709 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9710 sepia_image=SepiaToneImage(wand->images,threshold,wand->exception);
9711 if (sepia_image == (Image *) NULL)
9712 return(MagickFalse);
9713 ReplaceImageInList(&wand->images,sepia_image);
9744WandExport MagickBooleanType MagickSetImage(
MagickWand *wand,
9751 assert(wand->signature == WandSignature);
9752 if (wand->debug != MagickFalse)
9753 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9755 assert(set_wand->signature == WandSignature);
9756 if (wand->debug != MagickFalse)
9757 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",set_wand->name);
9758 if (set_wand->images == (Image *) NULL)
9759 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9760 images=CloneImageList(set_wand->images,wand->exception);
9761 if (images == (Image *) NULL)
9762 return(MagickFalse);
9763 ReplaceImageInList(&wand->images,images);
9794WandExport MagickBooleanType MagickSetImageAlphaChannel(
MagickWand *wand,
9795 const AlphaChannelType alpha_type)
9798 assert(wand->signature == WandSignature);
9799 if (wand->debug != MagickFalse)
9800 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9801 if (wand->images == (Image *) NULL)
9802 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9803 return(SetImageAlphaChannel(wand->images,alpha_type));
9831WandExport MagickBooleanType MagickSetImageBackgroundColor(
MagickWand *wand,
9835 assert(wand->signature == WandSignature);
9836 if (wand->debug != MagickFalse)
9837 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9838 if (wand->images == (Image *) NULL)
9839 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9840 PixelGetQuantumColor(background,&wand->images->background_color);
9870WandExport MagickBooleanType MagickSetImageBias(
MagickWand *wand,
9874 option[MaxTextExtent];
9877 assert(wand->signature == WandSignature);
9878 if (wand->debug != MagickFalse)
9879 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9880 if (wand->images == (Image *) NULL)
9881 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9882 (void) FormatLocaleString(option,MaxTextExtent,
"%+g",bias);
9883 (void) SetImageOption(wand->image_info,
"bias",option);
9914WandExport MagickBooleanType MagickSetImageBluePrimary(
MagickWand *wand,
9915 const double x,
const double y)
9918 assert(wand->signature == WandSignature);
9919 if (wand->debug != MagickFalse)
9920 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9921 if (wand->images == (Image *) NULL)
9922 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9923 wand->images->chromaticity.blue_primary.x=x;
9924 wand->images->chromaticity.blue_primary.y=y;
9953WandExport MagickBooleanType MagickSetImageBorderColor(
MagickWand *wand,
9957 assert(wand->signature == WandSignature);
9958 if (wand->debug != MagickFalse)
9959 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9960 if (wand->images == (Image *) NULL)
9961 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9962 PixelGetQuantumColor(border,&wand->images->border_color);
9993WandExport MagickBooleanType MagickSetImageChannelDepth(
MagickWand *wand,
9994 const ChannelType channel,
const size_t depth)
9997 assert(wand->signature == WandSignature);
9998 if (wand->debug != MagickFalse)
9999 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10000 if (wand->images == (Image *) NULL)
10001 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10002 return(SetImageChannelDepth(wand->images,channel,depth));
10030WandExport MagickBooleanType MagickSetImageClipMask(
MagickWand *wand,
10034 assert(wand->signature == WandSignature);
10035 if (wand->debug != MagickFalse)
10036 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10038 assert(clip_mask->signature == WandSignature);
10039 if (clip_mask->debug != MagickFalse)
10040 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",clip_mask->name);
10041 if (clip_mask->images == (Image *) NULL)
10042 ThrowWandException(WandError,
"ContainsNoImages",clip_mask->name);
10043 return(SetImageClipMask(wand->images,clip_mask->images));
10071WandExport MagickBooleanType MagickSetImageColor(
MagickWand *wand,
10081 assert(wand->signature == WandSignature);
10082 if (wand->debug != MagickFalse)
10083 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10084 PixelGetMagickColor(color,&pixel);
10085 status=SetImageColor(wand->images,&pixel);
10086 if (status == MagickFalse)
10087 InheritException(wand->exception,&wand->images->exception);
10119WandExport MagickBooleanType MagickSetImageColormapColor(
MagickWand *wand,
10120 const size_t index,
const PixelWand *color)
10123 assert(wand->signature == WandSignature);
10124 if (wand->debug != MagickFalse)
10125 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10126 if (wand->images == (Image *) NULL)
10127 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10128 if ((wand->images->colormap == (PixelPacket *) NULL) ||
10129 (index >= wand->images->colors))
10130 ThrowWandException(WandError,
"InvalidColormapIndex",wand->name);
10131 PixelGetQuantumColor(color,wand->images->colormap+index);
10132 return(SyncImage(wand->images));
10164WandExport MagickBooleanType MagickSetImageColorspace(
MagickWand *wand,
10165 const ColorspaceType colorspace)
10168 assert(wand->signature == WandSignature);
10169 if (wand->debug != MagickFalse)
10170 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10171 if (wand->images == (Image *) NULL)
10172 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10173 return(SetImageColorspace(wand->images,colorspace));
10203WandExport MagickBooleanType MagickSetImageCompose(
MagickWand *wand,
10204 const CompositeOperator compose)
10207 assert(wand->signature == WandSignature);
10208 if (wand->debug != MagickFalse)
10209 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10210 if (wand->images == (Image *) NULL)
10211 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10212 wand->images->compose=compose;
10213 return(MagickTrue);
10241WandExport MagickBooleanType MagickSetImageCompression(
MagickWand *wand,
10242 const CompressionType compression)
10245 assert(wand->signature == WandSignature);
10246 if (wand->debug != MagickFalse)
10247 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10248 if (wand->images == (Image *) NULL)
10249 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10250 wand->images->compression=compression;
10251 return(MagickTrue);
10279WandExport MagickBooleanType MagickSetImageCompressionQuality(
MagickWand *wand,
10280 const size_t quality)
10283 assert(wand->signature == WandSignature);
10284 if (wand->debug != MagickFalse)
10285 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10286 if (wand->images == (Image *) NULL)
10287 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10288 wand->images->quality=quality;
10289 return(MagickTrue);
10317WandExport MagickBooleanType MagickSetImageDelay(
MagickWand *wand,
10318 const size_t delay)
10321 assert(wand->signature == WandSignature);
10322 if (wand->debug != MagickFalse)
10323 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10324 if (wand->images == (Image *) NULL)
10325 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10326 wand->images->delay=delay;
10327 return(MagickTrue);
10355WandExport MagickBooleanType MagickSetImageDepth(
MagickWand *wand,
10356 const size_t depth)
10359 assert(wand->signature == WandSignature);
10360 if (wand->debug != MagickFalse)
10361 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10362 if (wand->images == (Image *) NULL)
10363 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10364 wand->images->depth=depth;
10365 return(MagickTrue);
10393WandExport MagickBooleanType MagickSetImageDispose(
MagickWand *wand,
10394 const DisposeType dispose)
10397 assert(wand->signature == WandSignature);
10398 if (wand->debug != MagickFalse)
10399 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10400 if (wand->images == (Image *) NULL)
10401 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10402 wand->images->dispose=dispose;
10403 return(MagickTrue);
10431WandExport MagickBooleanType MagickSetImageEndian(
MagickWand *wand,
10432 const EndianType endian)
10435 assert(wand->signature == WandSignature);
10436 if (wand->debug != MagickFalse)
10437 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10438 if (wand->images == (Image *) NULL)
10439 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10440 wand->images->endian=endian;
10441 return(MagickTrue);
10471WandExport MagickBooleanType MagickSetImageExtent(
MagickWand *wand,
10472 const size_t columns,
const size_t rows)
10475 assert(wand->signature == WandSignature);
10476 if (wand->debug != MagickFalse)
10477 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10478 if (wand->images == (Image *) NULL)
10479 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10480 return(SetImageExtent(wand->images,columns,rows));
10509WandExport MagickBooleanType MagickSetImageFilename(
MagickWand *wand,
10510 const char *filename)
10513 assert(wand->signature == WandSignature);
10514 if (wand->debug != MagickFalse)
10515 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10516 if (wand->images == (Image *) NULL)
10517 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10518 if (filename == (
const char *) NULL)
10519 return(MagickFalse);
10520 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
10521 return(MagickTrue);
10550WandExport MagickBooleanType MagickSetImageFormat(
MagickWand *wand,
10551 const char *format)
10557 assert(wand->signature == WandSignature);
10558 if (wand->debug != MagickFalse)
10559 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10560 if (wand->images == (Image *) NULL)
10561 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10562 if ((format == (
char *) NULL) || (*format ==
'\0'))
10564 *wand->images->magick=
'\0';
10565 return(MagickTrue);
10567 magick_info=GetMagickInfo(format,wand->exception);
10568 if (magick_info == (
const MagickInfo *) NULL)
10569 return(MagickFalse);
10570 ClearMagickException(wand->exception);
10571 (void) CopyMagickString(wand->images->magick,format,MaxTextExtent);
10572 LocaleUpper(wand->images->magick);
10573 return(MagickTrue);
10601WandExport MagickBooleanType MagickSetImageFuzz(
MagickWand *wand,
10605 assert(wand->signature == WandSignature);
10606 if (wand->debug != MagickFalse)
10607 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10608 if (wand->images == (Image *) NULL)
10609 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10610 wand->images->fuzz=fuzz;
10611 return(MagickTrue);
10639WandExport MagickBooleanType MagickSetImageGamma(
MagickWand *wand,
10640 const double gamma)
10643 assert(wand->signature == WandSignature);
10644 if (wand->debug != MagickFalse)
10645 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10646 if (wand->images == (Image *) NULL)
10647 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10648 wand->images->gamma=gamma;
10649 return(MagickTrue);
10678WandExport MagickBooleanType MagickSetImageGravity(
MagickWand *wand,
10679 const GravityType gravity)
10682 assert(wand->signature == WandSignature);
10683 if (wand->debug != MagickFalse)
10684 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10685 if (wand->images == (Image *) NULL)
10686 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10687 wand->images->gravity=gravity;
10688 return(MagickTrue);
10720WandExport MagickBooleanType MagickSetImageGreenPrimary(
MagickWand *wand,
10721 const double x,
const double y)
10724 assert(wand->signature == WandSignature);
10725 if (wand->debug != MagickFalse)
10726 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10727 if (wand->images == (Image *) NULL)
10728 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10729 wand->images->chromaticity.green_primary.x=x;
10730 wand->images->chromaticity.green_primary.y=y;
10731 return(MagickTrue);
10760WandExport MagickBooleanType MagickSetImageInterlaceScheme(
MagickWand *wand,
10761 const InterlaceType interlace)
10764 assert(wand->signature == WandSignature);
10765 if (wand->debug != MagickFalse)
10766 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10767 if (wand->images == (Image *) NULL)
10768 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10769 wand->images->interlace=interlace;
10770 return(MagickTrue);
10799WandExport MagickBooleanType MagickSetImageInterpolateMethod(
MagickWand *wand,
10800 const InterpolatePixelMethod method)
10803 assert(wand->signature == WandSignature);
10804 if (wand->debug != MagickFalse)
10805 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10806 if (wand->images == (Image *) NULL)
10807 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10808 wand->images->interpolate=method;
10809 return(MagickTrue);
10837WandExport MagickBooleanType MagickSetImageIterations(
MagickWand *wand,
10838 const size_t iterations)
10841 assert(wand->signature == WandSignature);
10842 if (wand->debug != MagickFalse)
10843 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10844 if (wand->images == (Image *) NULL)
10845 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10846 wand->images->iterations=iterations;
10847 return(MagickTrue);
10876WandExport MagickBooleanType MagickSetImageMatte(
MagickWand *wand,
10877 const MagickBooleanType matte)
10880 assert(wand->signature == WandSignature);
10881 if (wand->debug != MagickFalse)
10882 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10883 if (wand->images == (Image *) NULL)
10884 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10885 if ((wand->images->matte == MagickFalse) && (matte != MagickFalse))
10886 (void) SetImageOpacity(wand->images,OpaqueOpacity);
10887 wand->images->matte=matte;
10888 return(MagickTrue);
10916WandExport MagickBooleanType MagickSetImageMatteColor(
MagickWand *wand,
10920 assert(wand->signature == WandSignature);
10921 if (wand->debug != MagickFalse)
10922 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10923 if (wand->images == (Image *) NULL)
10924 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10925 PixelGetQuantumColor(matte,&wand->images->matte_color);
10926 return(MagickTrue);
10955WandExport MagickBooleanType MagickSetImageOpacity(
MagickWand *wand,
10956 const double alpha)
10962 assert(wand->signature == WandSignature);
10963 if (wand->debug != MagickFalse)
10964 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10965 if (wand->images == (Image *) NULL)
10966 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10967 status=SetImageOpacity(wand->images,ClampToQuantum((
double) QuantumRange-
10968 (
double) QuantumRange*alpha));
10969 if (status == MagickFalse)
10970 InheritException(wand->exception,&wand->images->exception);
10999WandExport MagickBooleanType MagickSetImageOrientation(
MagickWand *wand,
11000 const OrientationType orientation)
11003 assert(wand->signature == WandSignature);
11004 if (wand->debug != MagickFalse)
11005 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11006 if (wand->images == (Image *) NULL)
11007 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11008 wand->images->orientation=orientation;
11009 return(MagickTrue);
11044WandExport MagickBooleanType MagickSetImagePage(
MagickWand *wand,
11045 const size_t width,
const size_t height,
const ssize_t x,
const ssize_t y)
11048 assert(wand->signature == WandSignature);
11049 if (wand->debug != MagickFalse)
11050 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11051 if (wand->images == (Image *) NULL)
11052 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11053 wand->images->page.width=width;
11054 wand->images->page.height=height;
11055 wand->images->page.x=x;
11056 wand->images->page.y=y;
11057 return(MagickTrue);
11087WandExport MagickBooleanType MagickSetImagePixelColor(
MagickWand *wand,
11088 const ssize_t x,
const ssize_t y,
const PixelWand *color)
11100 assert(wand->signature == WandSignature);
11101 if (wand->debug != MagickFalse)
11102 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11103 if (wand->images == (Image *) NULL)
11104 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11105 image_view=AcquireVirtualCacheView(wand->images,wand->exception);
11106 q=GetCacheViewAuthenticPixels(image_view,x,y,1,1,wand->exception);
11107 if (q == (PixelPacket *) NULL)
11109 image_view=DestroyCacheView(image_view);
11110 return(MagickFalse);
11112 indexes=GetCacheViewAuthenticIndexQueue(image_view);
11113 PixelGetQuantumColor(color,q);
11114 if (GetCacheViewColorspace(image_view) == CMYKColorspace)
11115 *indexes=PixelGetBlackQuantum(color);
11117 if (GetCacheViewStorageClass(image_view) == PseudoClass)
11118 *indexes=PixelGetIndex(color);
11119 image_view=DestroyCacheView(image_view);
11120 return(MagickTrue);
11160WandExport MagickProgressMonitor MagickSetImageProgressMonitor(
MagickWand *wand,
11161 const MagickProgressMonitor progress_monitor,
void *client_data)
11163 MagickProgressMonitor
11167 assert(wand->signature == WandSignature);
11168 if (wand->debug != MagickFalse)
11169 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11170 if (wand->images == (Image *) NULL)
11172 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11173 "ContainsNoImages",
"`%s'",wand->name);
11174 return((MagickProgressMonitor) NULL);
11176 previous_monitor=SetImageProgressMonitor(wand->images,progress_monitor,
11178 return(previous_monitor);
11208WandExport MagickBooleanType MagickSetImageRedPrimary(
MagickWand *wand,
11209 const double x,
const double y)
11212 assert(wand->signature == WandSignature);
11213 if (wand->debug != MagickFalse)
11214 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11215 if (wand->images == (Image *) NULL)
11216 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11217 wand->images->chromaticity.red_primary.x=x;
11218 wand->images->chromaticity.red_primary.y=y;
11219 return(MagickTrue);
11248WandExport MagickBooleanType MagickSetImageRenderingIntent(
MagickWand *wand,
11249 const RenderingIntent rendering_intent)
11252 assert(wand->signature == WandSignature);
11253 if (wand->debug != MagickFalse)
11254 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11255 if (wand->images == (Image *) NULL)
11256 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11257 wand->images->rendering_intent=rendering_intent;
11258 return(MagickTrue);
11288WandExport MagickBooleanType MagickSetImageResolution(
MagickWand *wand,
11289 const double x_resolution,
const double y_resolution)
11292 assert(wand->signature == WandSignature);
11293 if (wand->debug != MagickFalse)
11294 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11295 if (wand->images == (Image *) NULL)
11296 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11297 wand->images->x_resolution=x_resolution;
11298 wand->images->y_resolution=y_resolution;
11299 return(MagickTrue);
11327WandExport MagickBooleanType MagickSetImageScene(
MagickWand *wand,
11328 const size_t scene)
11331 assert(wand->signature == WandSignature);
11332 if (wand->debug != MagickFalse)
11333 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11334 if (wand->images == (Image *) NULL)
11335 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11336 wand->images->scene=scene;
11337 return(MagickTrue);
11365WandExport MagickBooleanType MagickSetImageTicksPerSecond(
MagickWand *wand,
11366 const ssize_t ticks_per_second)
11369 assert(wand->signature == WandSignature);
11370 if (wand->debug != MagickFalse)
11371 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11372 if (wand->images == (Image *) NULL)
11373 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11374 wand->images->ticks_per_second=ticks_per_second;
11375 return(MagickTrue);
11406WandExport MagickBooleanType MagickSetImageType(
MagickWand *wand,
11407 const ImageType image_type)
11410 assert(wand->signature == WandSignature);
11411 if (wand->debug != MagickFalse)
11412 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11413 if (wand->images == (Image *) NULL)
11414 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11415 return(SetImageType(wand->images,image_type));
11444WandExport MagickBooleanType MagickSetImageUnits(
MagickWand *wand,
11445 const ResolutionType units)
11448 assert(wand->signature == WandSignature);
11449 if (wand->debug != MagickFalse)
11450 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11451 if (wand->images == (Image *) NULL)
11452 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11453 wand->images->units=units;
11454 return(MagickTrue);
11484WandExport VirtualPixelMethod MagickSetImageVirtualPixelMethod(
MagickWand *wand,
11485 const VirtualPixelMethod method)
11488 assert(wand->signature == WandSignature);
11489 if (wand->debug != MagickFalse)
11490 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11491 if (wand->images == (Image *) NULL)
11492 return(UndefinedVirtualPixelMethod);
11493 return(SetImageVirtualPixelMethod(wand->images,method));
11523WandExport MagickBooleanType MagickSetImageWhitePoint(
MagickWand *wand,
11524 const double x,
const double y)
11527 assert(wand->signature == WandSignature);
11528 if (wand->debug != MagickFalse)
11529 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11530 if (wand->images == (Image *) NULL)
11531 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11532 wand->images->chromaticity.white_point.x=x;
11533 wand->images->chromaticity.white_point.y=y;
11534 return(MagickTrue);
11568WandExport MagickBooleanType MagickShadeImage(
MagickWand *wand,
11569 const MagickBooleanType gray,
const double azimuth,
const double elevation)
11575 assert(wand->signature == WandSignature);
11576 if (wand->debug != MagickFalse)
11577 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11578 if (wand->images == (Image *) NULL)
11579 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11580 shade_image=ShadeImage(wand->images,gray,azimuth,elevation,wand->exception);
11581 if (shade_image == (Image *) NULL)
11582 return(MagickFalse);
11583 ReplaceImageInList(&wand->images,shade_image);
11584 return(MagickTrue);
11618WandExport MagickBooleanType MagickShadowImage(
MagickWand *wand,
11619 const double opacity,
const double sigma,
const ssize_t x,
const ssize_t y)
11625 assert(wand->signature == WandSignature);
11626 if (wand->debug != MagickFalse)
11627 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11628 if (wand->images == (Image *) NULL)
11629 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11630 shadow_image=ShadowImage(wand->images,opacity,sigma,x,y,wand->exception);
11631 if (shadow_image == (Image *) NULL)
11632 return(MagickFalse);
11633 ReplaceImageInList(&wand->images,shadow_image);
11634 return(MagickTrue);
11673WandExport MagickBooleanType MagickSharpenImage(
MagickWand *wand,
11674 const double radius,
const double sigma)
11679 status=MagickSharpenImageChannel(wand,DefaultChannels,radius,sigma);
11683WandExport MagickBooleanType MagickSharpenImageChannel(
MagickWand *wand,
11684 const ChannelType channel,
const double radius,
const double sigma)
11690 assert(wand->signature == WandSignature);
11691 if (wand->debug != MagickFalse)
11692 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11693 if (wand->images == (Image *) NULL)
11694 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11695 sharp_image=SharpenImageChannel(wand->images,channel,radius,sigma,
11697 if (sharp_image == (Image *) NULL)
11698 return(MagickFalse);
11699 ReplaceImageInList(&wand->images,sharp_image);
11700 return(MagickTrue);
11733WandExport MagickBooleanType MagickShaveImage(
MagickWand *wand,
11734 const size_t columns,
const size_t rows)
11743 assert(wand->signature == WandSignature);
11744 if (wand->debug != MagickFalse)
11745 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11746 if (wand->images == (Image *) NULL)
11747 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11748 shave_info.width=columns;
11749 shave_info.height=rows;
11752 shave_image=ShaveImage(wand->images,&shave_info,wand->exception);
11753 if (shave_image == (Image *) NULL)
11754 return(MagickFalse);
11755 ReplaceImageInList(&wand->images,shave_image);
11756 return(MagickTrue);
11794WandExport MagickBooleanType MagickShearImage(
MagickWand *wand,
11795 const PixelWand *background,
const double x_shear,
const double y_shear)
11801 assert(wand->signature == WandSignature);
11802 if (wand->debug != MagickFalse)
11803 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11804 if (wand->images == (Image *) NULL)
11805 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11806 PixelGetQuantumColor(background,&wand->images->background_color);
11807 shear_image=ShearImage(wand->images,x_shear,y_shear,wand->exception);
11808 if (shear_image == (Image *) NULL)
11809 return(MagickFalse);
11810 ReplaceImageInList(&wand->images,shear_image);
11811 return(MagickTrue);
11857WandExport MagickBooleanType MagickSigmoidalContrastImage(
MagickWand *wand,
11858 const MagickBooleanType sharpen,
const double alpha,
const double beta)
11863 status=MagickSigmoidalContrastImageChannel(wand,DefaultChannels,sharpen,
11868WandExport MagickBooleanType MagickSigmoidalContrastImageChannel(
11869 MagickWand *wand,
const ChannelType channel,
const MagickBooleanType sharpen,
11870 const double alpha,
const double beta)
11876 assert(wand->signature == WandSignature);
11877 if (wand->debug != MagickFalse)
11878 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11879 if (wand->images == (Image *) NULL)
11880 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11881 status=SigmoidalContrastImageChannel(wand->images,channel,sharpen,alpha,beta);
11882 if (status == MagickFalse)
11883 InheritException(wand->exception,&wand->images->exception);
11920 const MagickWand *reference,RectangleInfo *offset,
double *similarity)
11926 assert(wand->signature == WandSignature);
11927 if (wand->debug != MagickFalse)
11928 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11929 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
11931 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11932 "ContainsNoImages",
"`%s'",wand->name);
11935 similarity_image=SimilarityImage(wand->images,reference->images,offset,
11936 similarity,&wand->images->exception);
11937 if (similarity_image == (Image *) NULL)
11939 return(CloneMagickWandFromImages(wand,similarity_image));
11976WandExport MagickBooleanType MagickSketchImage(
MagickWand *wand,
11977 const double radius,
const double sigma,
const double angle)
11983 assert(wand->signature == WandSignature);
11984 if (wand->debug != MagickFalse)
11985 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11986 if (wand->images == (Image *) NULL)
11987 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11988 sketch_image=SketchImage(wand->images,radius,sigma,angle,wand->exception);
11989 if (sketch_image == (Image *) NULL)
11990 return(MagickFalse);
11991 ReplaceImageInList(&wand->images,sketch_image);
11992 return(MagickTrue);
12026 const MagickBooleanType stack,
const ssize_t offset)
12032 assert(wand->signature == WandSignature);
12033 if (wand->debug != MagickFalse)
12034 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12035 if (wand->images == (Image *) NULL)
12037 smush_image=SmushImages(wand->images,stack,offset,wand->exception);
12038 if (smush_image == (Image *) NULL)
12040 return(CloneMagickWandFromImages(wand,smush_image));
12075WandExport MagickBooleanType MagickSolarizeImage(
MagickWand *wand,
12076 const double threshold)
12081 status=MagickSolarizeImageChannel(wand,DefaultChannels,threshold);
12085WandExport MagickBooleanType MagickSolarizeImageChannel(
MagickWand *wand,
12086 const ChannelType channel,
const double threshold)
12092 assert(wand->signature == WandSignature);
12093 if (wand->debug != MagickFalse)
12094 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12095 if (wand->images == (Image *) NULL)
12096 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12097 status=SolarizeImageChannel(wand->images,channel,threshold,wand->exception);
12152WandExport MagickBooleanType MagickSparseColorImage(
MagickWand *wand,
12153 const ChannelType channel,
const SparseColorMethod method,
12154 const size_t number_arguments,
const double *arguments)
12160 assert(wand->signature == WandSignature);
12161 if (wand->debug != MagickFalse)
12162 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12163 if (wand->images == (Image *) NULL)
12164 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12165 sparse_image=SparseColorImage(wand->images,channel,method,number_arguments,
12166 arguments,wand->exception);
12167 if (sparse_image == (Image *) NULL)
12168 return(MagickFalse);
12169 ReplaceImageInList(&wand->images,sparse_image);
12170 return(MagickTrue);
12205WandExport MagickBooleanType MagickSpliceImage(
MagickWand *wand,
12206 const size_t width,
const size_t height,
const ssize_t x,
12216 assert(wand->signature == WandSignature);
12217 if (wand->debug != MagickFalse)
12218 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12219 if (wand->images == (Image *) NULL)
12220 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12221 splice.width=width;
12222 splice.height=height;
12225 splice_image=SpliceImage(wand->images,&splice,wand->exception);
12226 if (splice_image == (Image *) NULL)
12227 return(MagickFalse);
12228 ReplaceImageInList(&wand->images,splice_image);
12229 return(MagickTrue);
12257WandExport MagickBooleanType MagickSpreadImage(
MagickWand *wand,
12258 const double radius)
12264 assert(wand->signature == WandSignature);
12265 if (wand->debug != MagickFalse)
12266 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12267 if (wand->images == (Image *) NULL)
12268 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12269 spread_image=SpreadImage(wand->images,radius,wand->exception);
12270 if (spread_image == (Image *) NULL)
12271 return(MagickFalse);
12272 ReplaceImageInList(&wand->images,spread_image);
12273 return(MagickTrue);
12312WandExport MagickBooleanType MagickStatisticImage(
MagickWand *wand,
12313 const StatisticType type,
const size_t width,
const size_t height)
12318 status=MagickStatisticImageChannel(wand,DefaultChannels,type,width,height);
12322WandExport MagickBooleanType MagickStatisticImageChannel(
MagickWand *wand,
12323 const ChannelType channel,
const StatisticType type,
const size_t width,
12324 const size_t height)
12330 assert(wand->signature == WandSignature);
12331 if (wand->debug != MagickFalse)
12332 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12333 if (wand->images == (Image *) NULL)
12334 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12335 statistic_image=StatisticImageChannel(wand->images,channel,type,width,height,
12337 if (statistic_image == (Image *) NULL)
12338 return(MagickFalse);
12339 ReplaceImageInList(&wand->images,statistic_image);
12340 return(MagickTrue);
12374 const MagickWand *watermark_wand,
const ssize_t offset)
12380 assert(wand->signature == WandSignature);
12381 if (wand->debug != MagickFalse)
12382 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12383 if ((wand->images == (Image *) NULL) ||
12384 (watermark_wand->images == (Image *) NULL))
12386 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
12387 "ContainsNoImages",
"`%s'",wand->name);
12390 wand->images->offset=offset;
12391 stegano_image=SteganoImage(wand->images,watermark_wand->images,
12393 if (stegano_image == (Image *) NULL)
12395 return(CloneMagickWandFromImages(wand,stegano_image));
12431 assert(wand->signature == WandSignature);
12432 if (wand->debug != MagickFalse)
12433 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12434 if ((wand->images == (Image *) NULL) ||
12435 (offset_wand->images == (Image *) NULL))
12437 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
12438 "ContainsNoImages",
"`%s'",wand->name);
12441 stereo_image=StereoImage(wand->images,offset_wand->images,wand->exception);
12442 if (stereo_image == (Image *) NULL)
12444 return(CloneMagickWandFromImages(wand,stereo_image));
12469WandExport MagickBooleanType MagickStripImage(
MagickWand *wand)
12475 assert(wand->signature == WandSignature);
12476 if (wand->debug != MagickFalse)
12477 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12478 if (wand->images == (Image *) NULL)
12479 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12480 status=StripImage(wand->images);
12481 if (status == MagickFalse)
12482 InheritException(wand->exception,&wand->images->exception);
12512WandExport MagickBooleanType MagickSwirlImage(
MagickWand *wand,
12513 const double degrees)
12519 assert(wand->signature == WandSignature);
12520 if (wand->debug != MagickFalse)
12521 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12522 if (wand->images == (Image *) NULL)
12523 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12524 swirl_image=SwirlImage(wand->images,degrees,wand->exception);
12525 if (swirl_image == (Image *) NULL)
12526 return(MagickFalse);
12527 ReplaceImageInList(&wand->images,swirl_image);
12528 return(MagickTrue);
12567 assert(wand->signature == WandSignature);
12568 if (wand->debug != MagickFalse)
12569 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12570 if ((wand->images == (Image *) NULL) ||
12571 (texture_wand->images == (Image *) NULL))
12573 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
12574 "ContainsNoImages",
"`%s'",wand->name);
12577 texture_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12578 if (texture_image == (Image *) NULL)
12580 status=TextureImage(texture_image,texture_wand->images);
12581 if (status == MagickFalse)
12583 InheritException(wand->exception,&texture_image->exception);
12584 texture_image=DestroyImage(texture_image);
12587 return(CloneMagickWandFromImages(wand,texture_image));
12621WandExport MagickBooleanType MagickThresholdImage(
MagickWand *wand,
12622 const double threshold)
12627 status=MagickThresholdImageChannel(wand,DefaultChannels,threshold);
12631WandExport MagickBooleanType MagickThresholdImageChannel(
MagickWand *wand,
12632 const ChannelType channel,
const double threshold)
12638 assert(wand->signature == WandSignature);
12639 if (wand->debug != MagickFalse)
12640 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12641 if (wand->images == (Image *) NULL)
12642 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12643 status=BilevelImageChannel(wand->images,channel,threshold);
12644 if (status == MagickFalse)
12645 InheritException(wand->exception,&wand->images->exception);
12678WandExport MagickBooleanType MagickThumbnailImage(
MagickWand *wand,
12679 const size_t columns,
const size_t rows)
12685 assert(wand->signature == WandSignature);
12686 if (wand->debug != MagickFalse)
12687 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12688 if (wand->images == (Image *) NULL)
12689 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12690 thumbnail_image=ThumbnailImage(wand->images,columns,rows,wand->exception);
12691 if (thumbnail_image == (Image *) NULL)
12692 return(MagickFalse);
12693 ReplaceImageInList(&wand->images,thumbnail_image);
12694 return(MagickTrue);
12727WandExport MagickBooleanType MagickTintImage(
MagickWand *wand,
12731 percent_opaque[MaxTextExtent];
12740 assert(wand->signature == WandSignature);
12741 if (wand->debug != MagickFalse)
12742 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12743 if (wand->images == (Image *) NULL)
12744 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12745 (void) FormatLocaleString(percent_opaque,MaxTextExtent,
12746 "%g,%g,%g,%g",100.0*QuantumScale*(
double) PixelGetRedQuantum(opacity),
12747 100.0*QuantumScale*(
double) PixelGetGreenQuantum(opacity),100.0*
12748 QuantumScale*(
double) PixelGetBlueQuantum(opacity),100.0*QuantumScale*
12749 (
double) PixelGetOpacityQuantum(opacity));
12750 PixelGetQuantumColor(tint,&target);
12751 tint_image=TintImage(wand->images,percent_opaque,target,wand->exception);
12752 if (tint_image == (Image *) NULL)
12753 return(MagickFalse);
12754 ReplaceImageInList(&wand->images,tint_image);
12755 return(MagickTrue);
12791 const char *crop,
const char *geometry)
12800 assert(wand->signature == WandSignature);
12801 if (wand->debug != MagickFalse)
12802 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12803 if (wand->images == (Image *) NULL)
12805 transform_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12806 if (transform_image == (Image *) NULL)
12808 status=TransformImage(&transform_image,crop,geometry);
12809 if (status == MagickFalse)
12811 InheritException(wand->exception,&transform_image->exception);
12812 transform_image=DestroyImage(transform_image);
12815 return(CloneMagickWandFromImages(wand,transform_image));
12850WandExport MagickBooleanType MagickTransformImageColorspace(
MagickWand *wand,
12851 const ColorspaceType colorspace)
12854 assert(wand->signature == WandSignature);
12855 if (wand->debug != MagickFalse)
12856 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12857 if (wand->images == (Image *) NULL)
12858 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12859 return(TransformImageColorspace(wand->images,colorspace));
12902WandExport MagickBooleanType MagickTransparentPaintImage(
MagickWand *wand,
12903 const PixelWand *target,
const double alpha,
const double fuzz,
12904 const MagickBooleanType invert)
12913 assert(wand->signature == WandSignature);
12914 if (wand->debug != MagickFalse)
12915 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12916 if (wand->images == (Image *) NULL)
12917 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12918 PixelGetMagickColor(target,&target_pixel);
12919 wand->images->fuzz=fuzz;
12920 status=TransparentPaintImage(wand->images,&target_pixel,ClampToQuantum(
12921 (
double) QuantumRange-(
double) QuantumRange*alpha),invert);
12922 if (status == MagickFalse)
12923 InheritException(wand->exception,&wand->images->exception);
12950WandExport MagickBooleanType MagickTransposeImage(
MagickWand *wand)
12956 assert(wand->signature == WandSignature);
12957 if (wand->debug != MagickFalse)
12958 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12959 if (wand->images == (Image *) NULL)
12960 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12961 transpose_image=TransposeImage(wand->images,wand->exception);
12962 if (transpose_image == (Image *) NULL)
12963 return(MagickFalse);
12964 ReplaceImageInList(&wand->images,transpose_image);
12965 return(MagickTrue);
12991WandExport MagickBooleanType MagickTransverseImage(
MagickWand *wand)
12997 assert(wand->signature == WandSignature);
12998 if (wand->debug != MagickFalse)
12999 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13000 if (wand->images == (Image *) NULL)
13001 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13002 transverse_image=TransverseImage(wand->images,wand->exception);
13003 if (transverse_image == (Image *) NULL)
13004 return(MagickFalse);
13005 ReplaceImageInList(&wand->images,transverse_image);
13006 return(MagickTrue);
13038WandExport MagickBooleanType MagickTrimImage(
MagickWand *wand,
const double fuzz)
13044 assert(wand->signature == WandSignature);
13045 if (wand->debug != MagickFalse)
13046 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13047 if (wand->images == (Image *) NULL)
13048 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13049 wand->images->fuzz=fuzz;
13050 trim_image=TrimImage(wand->images,wand->exception);
13051 if (trim_image == (Image *) NULL)
13052 return(MagickFalse);
13053 ReplaceImageInList(&wand->images,trim_image);
13054 return(MagickTrue);
13079WandExport MagickBooleanType MagickUniqueImageColors(
MagickWand *wand)
13085 assert(wand->signature == WandSignature);
13086 if (wand->debug != MagickFalse)
13087 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13088 if (wand->images == (Image *) NULL)
13089 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13090 unique_image=UniqueImageColors(wand->images,wand->exception);
13091 if (unique_image == (Image *) NULL)
13092 return(MagickFalse);
13093 ReplaceImageInList(&wand->images,unique_image);
13094 return(MagickTrue);
13140WandExport MagickBooleanType MagickUnsharpMaskImage(
MagickWand *wand,
13141 const double radius,
const double sigma,
const double amount,
13142 const double threshold)
13147 status=MagickUnsharpMaskImageChannel(wand,DefaultChannels,radius,sigma,
13152WandExport MagickBooleanType MagickUnsharpMaskImageChannel(
MagickWand *wand,
13153 const ChannelType channel,
const double radius,
const double sigma,
13154 const double amount,
const double threshold)
13160 assert(wand->signature == WandSignature);
13161 if (wand->debug != MagickFalse)
13162 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13163 if (wand->images == (Image *) NULL)
13164 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13165 unsharp_image=UnsharpMaskImageChannel(wand->images,channel,radius,sigma,
13166 amount,threshold,wand->exception);
13167 if (unsharp_image == (Image *) NULL)
13168 return(MagickFalse);
13169 ReplaceImageInList(&wand->images,unsharp_image);
13170 return(MagickTrue);
13203WandExport MagickBooleanType MagickVignetteImage(
MagickWand *wand,
13204 const double black_point,
const double white_point,
const ssize_t x,
13211 assert(wand->signature == WandSignature);
13212 if (wand->debug != MagickFalse)
13213 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13214 if (wand->images == (Image *) NULL)
13215 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13216 vignette_image=VignetteImage(wand->images,black_point,white_point,x,y,
13218 if (vignette_image == (Image *) NULL)
13219 return(MagickFalse);
13220 ReplaceImageInList(&wand->images,vignette_image);
13221 return(MagickTrue);
13252WandExport MagickBooleanType MagickWaveImage(
MagickWand *wand,
13253 const double amplitude,
const double wave_length)
13259 assert(wand->signature == WandSignature);
13260 if (wand->debug != MagickFalse)
13261 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13262 if (wand->images == (Image *) NULL)
13263 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13264 wave_image=WaveImage(wand->images,amplitude,wave_length,wand->exception);
13265 if (wave_image == (Image *) NULL)
13266 return(MagickFalse);
13267 ReplaceImageInList(&wand->images,wave_image);
13268 return(MagickTrue);
13298WandExport MagickBooleanType MagickWhiteThresholdImage(
MagickWand *wand,
13302 thresholds[MaxTextExtent];
13308 assert(wand->signature == WandSignature);
13309 if (wand->debug != MagickFalse)
13310 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13311 if (wand->images == (Image *) NULL)
13312 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13313 (void) FormatLocaleString(thresholds,MaxTextExtent,
13314 "%g" "," "%g" "," "%g" "," "%g",(
double) PixelGetRedQuantum(threshold),
13315 (
double) PixelGetGreenQuantum(threshold),(
double)
13316 PixelGetBlueQuantum(threshold),(
double) PixelGetOpacityQuantum(threshold));
13317 status=WhiteThresholdImage(wand->images,thresholds);
13318 if (status == MagickFalse)
13319 InheritException(wand->exception,&wand->images->exception);
13351WandExport MagickBooleanType MagickWriteImage(
MagickWand *wand,
13352 const char *filename)
13364 assert(wand->signature == WandSignature);
13365 if (wand->debug != MagickFalse)
13366 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13367 if (wand->images == (Image *) NULL)
13368 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13369 if (filename != (
const char *) NULL)
13370 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
13371 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
13372 if (image == (Image *) NULL)
13373 return(MagickFalse);
13374 write_info=CloneImageInfo(wand->image_info);
13375 write_info->adjoin=MagickTrue;
13376 status=WriteImage(write_info,image);
13377 if (status == MagickFalse)
13378 InheritException(wand->exception,&image->exception);
13379 image=DestroyImage(image);
13380 write_info=DestroyImageInfo(write_info);
13408WandExport MagickBooleanType MagickWriteImageFile(
MagickWand *wand,FILE *file)
13420 assert(wand->signature == WandSignature);
13421 assert(file != (FILE *) NULL);
13422 if (wand->debug != MagickFalse)
13423 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13424 if (wand->images == (Image *) NULL)
13425 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13426 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
13427 if (image == (Image *) NULL)
13428 return(MagickFalse);
13429 write_info=CloneImageInfo(wand->image_info);
13430 SetImageInfoFile(write_info,file);
13431 write_info->adjoin=MagickTrue;
13432 status=WriteImage(write_info,image);
13433 write_info=DestroyImageInfo(write_info);
13434 if (status == MagickFalse)
13435 InheritException(wand->exception,&image->exception);
13436 image=DestroyImage(image);
13467WandExport MagickBooleanType MagickWriteImages(
MagickWand *wand,
13468 const char *filename,
const MagickBooleanType adjoin)
13477 assert(wand->signature == WandSignature);
13478 if (wand->debug != MagickFalse)
13479 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13480 if (wand->images == (Image *) NULL)
13481 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13482 write_info=CloneImageInfo(wand->image_info);
13483 write_info->adjoin=adjoin;
13484 status=WriteImages(write_info,wand->images,filename,wand->exception);
13485 if (status == MagickFalse)
13486 InheritException(wand->exception,&wand->images->exception);
13487 write_info=DestroyImageInfo(write_info);
13515WandExport MagickBooleanType MagickWriteImagesFile(
MagickWand *wand,FILE *file)
13524 assert(wand->signature == WandSignature);
13525 if (wand->debug != MagickFalse)
13526 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13527 if (wand->images == (Image *) NULL)
13528 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13529 write_info=CloneImageInfo(wand->image_info);
13530 SetImageInfoFile(write_info,file);
13531 write_info->adjoin=MagickTrue;
13532 status=WriteImages(write_info,wand->images,(
const char *) NULL,
13534 write_info=DestroyImageInfo(write_info);
13535 if (status == MagickFalse)
13536 InheritException(wand->exception,&wand->images->exception);