49#include "MagickWand/studio.h"
50#include "MagickWand/MagickWand.h"
51#include "MagickWand/magick-wand-private.h"
52#include "MagickWand/wand.h"
53#include "MagickWand/pixel-wand-private.h"
54#include "MagickCore/image-private.h"
59#define MagickWandId "MagickWand"
94 assert(wand->signature == MagickWandSignature);
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,MagickPathExtent,
"%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->images=images;
106 clone_wand->debug=IsEventLogging();
107 clone_wand->signature=MagickWandSignature;
108 if (clone_wand->debug != MagickFalse)
109 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",clone_wand->name);
135WandExport Image *GetImageFromMagickWand(
const MagickWand *wand)
138 assert(wand->signature == MagickWandSignature);
139 if (wand->debug != MagickFalse)
140 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
141 if (wand->images == (Image *) NULL)
143 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
144 "ContainsNoImages",
"`%s'",wand->name);
145 return((Image *) NULL);
147 return(wand->images);
183WandExport MagickBooleanType MagickAdaptiveBlurImage(
MagickWand *wand,
184 const double radius,
const double sigma)
190 assert(wand->signature == MagickWandSignature);
191 if (wand->debug != MagickFalse)
192 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
193 if (wand->images == (Image *) NULL)
194 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
195 sharp_image=AdaptiveBlurImage(wand->images,radius,sigma,wand->exception);
196 if (sharp_image == (Image *) NULL)
198 ReplaceImageInList(&wand->images,sharp_image);
228WandExport MagickBooleanType MagickAdaptiveResizeImage(
MagickWand *wand,
229 const size_t columns,
const size_t rows)
235 assert(wand->signature == MagickWandSignature);
236 if (wand->debug != MagickFalse)
237 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
238 if (wand->images == (Image *) NULL)
239 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
240 resize_image=AdaptiveResizeImage(wand->images,columns,rows,wand->exception);
241 if (resize_image == (Image *) NULL)
243 ReplaceImageInList(&wand->images,resize_image);
280WandExport MagickBooleanType MagickAdaptiveSharpenImage(
MagickWand *wand,
281 const double radius,
const double sigma)
287 assert(wand->signature == MagickWandSignature);
288 if (wand->debug != MagickFalse)
289 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
290 if (wand->images == (Image *) NULL)
291 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
292 sharp_image=AdaptiveSharpenImage(wand->images,radius,sigma,wand->exception);
293 if (sharp_image == (Image *) NULL)
295 ReplaceImageInList(&wand->images,sharp_image);
331WandExport MagickBooleanType MagickAdaptiveThresholdImage(
MagickWand *wand,
332 const size_t width,
const size_t height,
const double bias)
338 assert(wand->signature == MagickWandSignature);
339 if (wand->debug != MagickFalse)
340 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
341 if (wand->images == (Image *) NULL)
342 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
343 threshold_image=AdaptiveThresholdImage(wand->images,width,height,bias,
345 if (threshold_image == (Image *) NULL)
347 ReplaceImageInList(&wand->images,threshold_image);
390static inline MagickBooleanType InsertImageInWand(
MagickWand *wand,
393 if (wand->images == (Image *) NULL)
398 if (wand->insert_before != MagickFalse)
399 wand->images=GetFirstImageInList(images);
401 wand->images=GetLastImageInList(images);
404 if ((wand->insert_before != MagickFalse) &&
405 (wand->images->previous == (Image *) NULL))
410 PrependImageToList(&wand->images,images);
411 wand->images=GetFirstImageInList(images);
419 if (wand->images->next == (Image *) NULL)
424 InsertImageInList(&wand->images,images);
425 wand->images=GetLastImageInList(images);
431 InsertImageInList(&wand->images,images);
435WandExport MagickBooleanType MagickAddImage(
MagickWand *wand,
442 assert(wand->signature == MagickWandSignature);
443 if (wand->debug != MagickFalse)
444 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
446 assert(add_wand->signature == MagickWandSignature);
447 if (add_wand->images == (Image *) NULL)
448 ThrowWandException(WandError,
"ContainsNoImages",add_wand->name);
452 images=CloneImageList(add_wand->images,wand->exception);
453 if (images == (Image *) NULL)
455 return(InsertImageInWand(wand,images));
486WandExport MagickBooleanType MagickAddNoiseImage(
MagickWand *wand,
487 const NoiseType noise_type,
const double attenuate)
493 assert(wand->signature == MagickWandSignature);
494 if (wand->debug != MagickFalse)
495 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
496 if (wand->images == (Image *) NULL)
497 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
498 noise_image=AddNoiseImage(wand->images,noise_type,attenuate,wand->exception);
499 if (noise_image == (Image *) NULL)
501 ReplaceImageInList(&wand->images,noise_image);
531WandExport MagickBooleanType MagickAffineTransformImage(
MagickWand *wand,
541 assert(wand->signature == MagickWandSignature);
542 if (wand->debug != MagickFalse)
543 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
544 if (wand->images == (Image *) NULL)
545 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
546 draw_info=PeekDrawingWand(drawing_wand);
547 if (draw_info == (DrawInfo *) NULL)
549 affine_image=AffineTransformImage(wand->images,&draw_info->affine,
551 draw_info=DestroyDrawInfo(draw_info);
552 if (affine_image == (Image *) NULL)
554 ReplaceImageInList(&wand->images,affine_image);
592WandExport MagickBooleanType MagickAnnotateImage(
MagickWand *wand,
593 const DrawingWand *drawing_wand,
const double x,
const double y,
594 const double angle,
const char *text)
597 geometry[MagickPathExtent];
606 assert(wand->signature == MagickWandSignature);
607 if (wand->debug != MagickFalse)
608 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
609 if (wand->images == (Image *) NULL)
610 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
611 draw_info=PeekDrawingWand(drawing_wand);
612 if (draw_info == (DrawInfo *) NULL)
614 (void) CloneString(&draw_info->text,text);
615 (void) FormatLocaleString(geometry,MagickPathExtent,
"%+g%+g",x,y);
616 draw_info->affine.sx=cos((
double) DegreesToRadians(fmod(angle,360.0)));
617 draw_info->affine.rx=sin((
double) DegreesToRadians(fmod(angle,360.0)));
618 draw_info->affine.ry=(-sin((
double) DegreesToRadians(fmod(angle,360.0))));
619 draw_info->affine.sy=cos((
double) DegreesToRadians(fmod(angle,360.0)));
620 (void) CloneString(&draw_info->geometry,geometry);
621 status=AnnotateImage(wand->images,draw_info,wand->exception);
622 draw_info=DestroyDrawInfo(draw_info);
651WandExport MagickBooleanType MagickAnimateImages(
MagickWand *wand,
652 const char *server_name)
658 assert(wand->signature == MagickWandSignature);
659 if (wand->debug != MagickFalse)
660 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
661 (void) CloneString(&wand->image_info->server_name,server_name);
662 status=AnimateImages(wand->image_info,wand->images,wand->exception);
699 const MagickBooleanType stack)
705 assert(wand->signature == MagickWandSignature);
706 if (wand->debug != MagickFalse)
707 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
708 if (wand->images == (Image *) NULL)
710 append_image=AppendImages(wand->images,stack,wand->exception);
711 if (append_image == (Image *) NULL)
713 return(CloneMagickWandFromImages(wand,append_image));
739WandExport MagickBooleanType MagickAutoGammaImage(
MagickWand *wand)
745 assert(wand->signature == MagickWandSignature);
746 if (wand->debug != MagickFalse)
747 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
748 if (wand->images == (Image *) NULL)
749 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
750 status=AutoGammaImage(wand->images,wand->exception);
777WandExport MagickBooleanType MagickAutoLevelImage(
MagickWand *wand)
783 assert(wand->signature == MagickWandSignature);
784 if (wand->debug != MagickFalse)
785 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
786 if (wand->images == (Image *) NULL)
787 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
788 status=AutoLevelImage(wand->images,wand->exception);
815WandExport MagickBooleanType MagickAutoOrientImage(
MagickWand *wand)
822 assert(wand->signature == MagickWandSignature);
823 if (wand->debug != MagickFalse)
824 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
825 if (wand->images == (Image *) NULL)
826 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
827 orient_image=AutoOrientImage(wand->images,wand->images->orientation,
829 if (orient_image == (Image *) NULL)
831 ReplaceImageInList(&wand->images,orient_image);
862WandExport MagickBooleanType MagickAutoThresholdImage(
MagickWand *wand,
863 const AutoThresholdMethod method)
866 assert(wand->signature == MagickWandSignature);
867 if (wand->debug != MagickFalse)
868 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
869 if (wand->images == (Image *) NULL)
870 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
871 return(AutoThresholdImage(wand->images,method,wand->exception));
920WandExport MagickBooleanType MagickBilateralBlurImage(
MagickWand *wand,
921 const double radius,
const double sigma,
const double intensity_sigma,
922 const double spatial_sigma)
928 assert(wand->signature == MagickWandSignature);
929 if (wand->debug != MagickFalse)
930 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
931 if (wand->images == (Image *) NULL)
932 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
933 blur_image=BilateralBlurImage(wand->images,radius,sigma,intensity_sigma,
934 spatial_sigma,wand->exception);
935 if (blur_image == (Image *) NULL)
937 ReplaceImageInList(&wand->images,blur_image);
968WandExport MagickBooleanType MagickBlackThresholdImage(
MagickWand *wand,
972 thresholds[MagickPathExtent];
975 assert(wand->signature == MagickWandSignature);
976 if (wand->debug != MagickFalse)
977 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
978 if (wand->images == (Image *) NULL)
979 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
980 (void) FormatLocaleString(thresholds,MagickPathExtent,
981 "%g" "," "%g" "," "%g" "," "%g",
982 (
double) PixelGetRedQuantum(threshold),
983 (
double) PixelGetGreenQuantum(threshold),
984 (
double) PixelGetBlueQuantum(threshold),
985 (
double) PixelGetAlphaQuantum(threshold));
986 return(BlackThresholdImage(wand->images,thresholds,wand->exception));
1015WandExport MagickBooleanType MagickBlueShiftImage(
MagickWand *wand,
1016 const double factor)
1022 assert(wand->signature == MagickWandSignature);
1023 if (wand->debug != MagickFalse)
1024 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1025 if (wand->images == (Image *) NULL)
1026 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1027 shift_image=BlueShiftImage(wand->images,factor,wand->exception);
1028 if (shift_image == (Image *) NULL)
1029 return(MagickFalse);
1030 ReplaceImageInList(&wand->images,shift_image);
1065WandExport MagickBooleanType MagickBlurImage(
MagickWand *wand,
1066 const double radius,
const double sigma)
1072 assert(wand->signature == MagickWandSignature);
1073 if (wand->debug != MagickFalse)
1074 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1075 if (wand->images == (Image *) NULL)
1076 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1077 blur_image=BlurImage(wand->images,radius,sigma,wand->exception);
1078 if (blur_image == (Image *) NULL)
1079 return(MagickFalse);
1080 ReplaceImageInList(&wand->images,blur_image);
1117WandExport MagickBooleanType MagickBorderImage(
MagickWand *wand,
1118 const PixelWand *bordercolor,
const size_t width,
const size_t height,
1119 const CompositeOperator compose)
1128 assert(wand->signature == MagickWandSignature);
1129 if (wand->debug != MagickFalse)
1130 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1131 if (wand->images == (Image *) NULL)
1132 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1133 border_info.width=width;
1134 border_info.height=height;
1137 PixelGetQuantumPacket(bordercolor,&wand->images->border_color);
1138 border_image=BorderImage(wand->images,&border_info,compose,wand->exception);
1139 if (border_image == (Image *) NULL)
1140 return(MagickFalse);
1141 ReplaceImageInList(&wand->images,border_image);
1175WandExport MagickBooleanType MagickBrightnessContrastImage(
1176 MagickWand *wand,
const double brightness,
const double contrast)
1182 assert(wand->signature == MagickWandSignature);
1183 if (wand->debug != MagickFalse)
1184 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1185 if (wand->images == (Image *) NULL)
1186 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1187 status=BrightnessContrastImage(wand->images,brightness,contrast,
1225WandExport MagickBooleanType MagickCannyEdgeImage(
MagickWand *wand,
1226 const double radius,
const double sigma,
const double lower_percent,
1227 const double upper_percent)
1233 assert(wand->signature == MagickWandSignature);
1234 if (wand->debug != MagickFalse)
1235 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1236 if (wand->images == (Image *) NULL)
1237 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1238 edge_image=CannyEdgeImage(wand->images,radius,sigma,lower_percent,
1239 upper_percent,wand->exception);
1240 if (edge_image == (Image *) NULL)
1241 return(MagickFalse);
1242 ReplaceImageInList(&wand->images,edge_image);
1284 const char *expression)
1290 assert(wand->signature == MagickWandSignature);
1291 if (wand->debug != MagickFalse)
1292 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1293 if (wand->images == (Image *) NULL)
1295 fx_image=ChannelFxImage(wand->images,expression,wand->exception);
1296 if (fx_image == (Image *) NULL)
1298 return(CloneMagickWandFromImages(wand,fx_image));
1329WandExport MagickBooleanType MagickCharcoalImage(
MagickWand *wand,
1330 const double radius,
const double sigma)
1336 assert(wand->signature == MagickWandSignature);
1337 if (wand->debug != MagickFalse)
1338 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1339 if (wand->images == (Image *) NULL)
1340 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1341 charcoal_image=CharcoalImage(wand->images,radius,sigma,wand->exception);
1342 if (charcoal_image == (Image *) NULL)
1343 return(MagickFalse);
1344 ReplaceImageInList(&wand->images,charcoal_image);
1382WandExport MagickBooleanType MagickChopImage(
MagickWand *wand,
1383 const size_t width,
const size_t height,
const ssize_t x,
1393 assert(wand->signature == MagickWandSignature);
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);
1402 chop_image=ChopImage(wand->images,&chop,wand->exception);
1403 if (chop_image == (Image *) NULL)
1404 return(MagickFalse);
1405 ReplaceImageInList(&wand->images,chop_image);
1444WandExport MagickBooleanType MagickCLAHEImage(
MagickWand *wand,
1445 const size_t width,
const size_t height,
const double number_bins,
1446 const double clip_limit)
1452 assert(wand->signature == MagickWandSignature);
1453 if (wand->debug != MagickFalse)
1454 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1455 if (wand->images == (Image *) NULL)
1456 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1457 status=CLAHEImage(wand->images,width,height,(
size_t) number_bins,clip_limit,
1486WandExport MagickBooleanType MagickClampImage(
MagickWand *wand)
1489 assert(wand->signature == MagickWandSignature);
1490 if (wand->debug != MagickFalse)
1491 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1492 if (wand->images == (Image *) NULL)
1493 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1494 return(ClampImage(wand->images,wand->exception));
1520WandExport MagickBooleanType MagickClipImage(
MagickWand *wand)
1526 assert(wand->signature == MagickWandSignature);
1527 if (wand->debug != MagickFalse)
1528 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1529 if (wand->images == (Image *) NULL)
1530 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1531 status=ClipImage(wand->images,wand->exception);
1567WandExport MagickBooleanType MagickClipImagePath(
MagickWand *wand,
1568 const char *pathname,
const MagickBooleanType inside)
1574 assert(wand->signature == MagickWandSignature);
1575 if (wand->debug != MagickFalse)
1576 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1577 if (wand->images == (Image *) NULL)
1578 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1579 status=ClipImagePath(wand->images,pathname,inside,wand->exception);
1610WandExport MagickBooleanType MagickClutImage(
MagickWand *wand,
1611 const MagickWand *clut_wand,
const PixelInterpolateMethod method)
1617 assert(wand->signature == MagickWandSignature);
1618 if (wand->debug != MagickFalse)
1619 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1620 if ((wand->images == (Image *) NULL) || (clut_wand->images == (Image *) NULL))
1621 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1622 status=ClutImage(wand->images,clut_wand->images,method,wand->exception);
1659 assert(wand->signature == MagickWandSignature);
1660 if (wand->debug != MagickFalse)
1661 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1662 if (wand->images == (Image *) NULL)
1664 coalesce_image=CoalesceImages(wand->images,wand->exception);
1665 if (coalesce_image == (Image *) NULL)
1667 return(CloneMagickWandFromImages(wand,coalesce_image));
1713WandExport MagickBooleanType MagickColorDecisionListImage(
MagickWand *wand,
1714 const char *color_correction_collection)
1720 assert(wand->signature == MagickWandSignature);
1721 if (wand->debug != MagickFalse)
1722 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1723 if (wand->images == (Image *) NULL)
1724 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1725 status=ColorDecisionListImage(wand->images,color_correction_collection,
1757WandExport MagickBooleanType MagickColorizeImage(
MagickWand *wand,
1761 percent_blend[MagickPathExtent];
1770 assert(wand->signature == MagickWandSignature);
1771 if (wand->debug != MagickFalse)
1772 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1773 if (wand->images == (Image *) NULL)
1774 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1775 GetPixelInfo(wand->images,&target);
1776 if (target.colorspace != CMYKColorspace)
1777 (void) FormatLocaleString(percent_blend,MagickPathExtent,
1778 "%g,%g,%g,%g",(
double) (100.0*QuantumScale*
1779 (
double) PixelGetRedQuantum(blend)),(
double) (100.0*QuantumScale*
1780 (
double) PixelGetGreenQuantum(blend)),(
double) (100.0*QuantumScale*
1781 (
double) PixelGetBlueQuantum(blend)),(
double) (100.0*QuantumScale*
1782 (
double) PixelGetAlphaQuantum(blend)));
1784 (
void) FormatLocaleString(percent_blend,MagickPathExtent,
1785 "%g,%g,%g,%g,%g",(
double) (100.0*QuantumScale*
1786 (
double) PixelGetRedQuantum(blend)),(
double) (100.0*QuantumScale*
1787 (
double) PixelGetGreenQuantum(blend)),(
double) (100.0*QuantumScale*
1788 (
double) PixelGetBlueQuantum(blend)),(
double) (100.0*QuantumScale*
1789 (
double) PixelGetBlackQuantum(blend)),(
double) (100.0*QuantumScale*
1790 (
double) PixelGetAlphaQuantum(blend)));
1791 target=PixelGetPixel(colorize);
1792 colorize_image=ColorizeImage(wand->images,percent_blend,&target,
1794 if (colorize_image == (Image *) NULL)
1795 return(MagickFalse);
1796 ReplaceImageInList(&wand->images,colorize_image);
1831WandExport MagickBooleanType MagickColorMatrixImage(
MagickWand *wand,
1832 const KernelInfo *color_matrix)
1838 assert(wand->signature == MagickWandSignature);
1839 if (wand->debug != MagickFalse)
1840 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1841 if (color_matrix == (
const KernelInfo *) NULL)
1842 return(MagickFalse);
1843 if (wand->images == (Image *) NULL)
1844 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1845 color_image=ColorMatrixImage(wand->images,color_matrix,wand->exception);
1846 if (color_image == (Image *) NULL)
1847 return(MagickFalse);
1848 ReplaceImageInList(&wand->images,color_image);
1880WandExport MagickBooleanType MagickColorThresholdImage(
MagickWand *wand,
1888 assert(wand->signature == MagickWandSignature);
1889 if (wand->debug != MagickFalse)
1890 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1891 if (wand->images == (Image *) NULL)
1892 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1893 PixelGetMagickColor(start_color,&start);
1894 PixelGetMagickColor(stop_color,&stop);
1895 return(ColorThresholdImage(wand->images,&start,&stop,wand->exception));
1927 const ColorspaceType colorspace)
1933 assert(wand->signature == MagickWandSignature);
1934 if (wand->debug != MagickFalse)
1935 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1936 if (wand->images == (Image *) NULL)
1938 combine_image=CombineImages(wand->images,colorspace,wand->exception);
1939 if (combine_image == (Image *) NULL)
1941 return(CloneMagickWandFromImages(wand,combine_image));
1969WandExport MagickBooleanType MagickCommentImage(
MagickWand *wand,
1970 const char *comment)
1976 assert(wand->signature == MagickWandSignature);
1977 if (wand->debug != MagickFalse)
1978 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1979 if (wand->images == (Image *) NULL)
1980 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1981 status=SetImageProperty(wand->images,
"comment",comment,wand->exception);
2013 const LayerMethod method)
2019 assert(wand->signature == MagickWandSignature);
2020 if (wand->debug != MagickFalse)
2021 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2022 if (wand->images == (Image *) NULL)
2024 layers_image=CompareImagesLayers(wand->images,method,wand->exception);
2025 if (layers_image == (Image *) NULL)
2027 return(CloneMagickWandFromImages(wand,layers_image));
2062 const MagickWand *reference,
const MetricType metric,
double *distortion)
2069 assert(wand->signature == MagickWandSignature);
2070 if (wand->debug != MagickFalse)
2071 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2072 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
2074 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
2075 "ContainsNoImages",
"`%s'",wand->name);
2078 compare_image=CompareImages(wand->images,reference->images,metric,distortion,
2080 if (compare_image == (Image *) NULL)
2082 return(CloneMagickWandFromImages(wand,compare_image));
2114 const ComplexOperator op)
2120 assert(wand->signature == MagickWandSignature);
2121 if (wand->debug != MagickFalse)
2122 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2123 if (wand->images == (Image *) NULL)
2125 complex_image=ComplexImages(wand->images,op,wand->exception);
2126 if (complex_image == (Image *) NULL)
2128 return(CloneMagickWandFromImages(wand,complex_image));
2174WandExport MagickBooleanType MagickCompositeImage(
MagickWand *wand,
2175 const MagickWand *source_wand,
const CompositeOperator compose,
2176 const MagickBooleanType clip_to_self,
const ssize_t x,
const ssize_t y)
2182 assert(wand->signature == MagickWandSignature);
2183 if (wand->debug != MagickFalse)
2184 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2185 if ((wand->images == (Image *) NULL) ||
2186 (source_wand->images == (Image *) NULL))
2187 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2188 status=CompositeImage(wand->images,source_wand->images,compose,clip_to_self,
2189 x,y,wand->exception);
2235WandExport MagickBooleanType MagickCompositeImageGravity(
MagickWand *wand,
2236 const MagickWand *source_wand,
const CompositeOperator compose,
2237 const GravityType gravity)
2246 assert(wand->signature == MagickWandSignature);
2247 if (wand->debug != MagickFalse)
2248 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2249 if ((wand->images == (Image *) NULL) ||
2250 (source_wand->images == (Image *) NULL))
2251 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2252 SetGeometry(source_wand->images,&geometry);
2253 GravityAdjustGeometry(wand->images->columns,wand->images->rows,gravity,
2255 status=CompositeImage(wand->images,source_wand->images,compose,MagickTrue,
2256 geometry.x,geometry.y,wand->exception);
2313WandExport MagickBooleanType MagickCompositeLayers(
MagickWand *wand,
2314 const MagickWand *source_wand,
const CompositeOperator compose,
2315 const ssize_t x,
const ssize_t y)
2321 assert(wand->signature == MagickWandSignature);
2322 if (wand->debug != MagickFalse)
2323 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2324 if ((wand->images == (Image *) NULL) ||
2325 (source_wand->images == (Image *) NULL))
2326 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2327 CompositeLayers(wand->images,compose,source_wand->images,x,y,wand->exception);
2362WandExport MagickBooleanType MagickConnectedComponentsImage(
MagickWand *wand,
2363 const size_t connectivity,CCObjectInfo **objects)
2366 *connected_components_image;
2369 assert(wand->signature == MagickWandSignature);
2370 if (wand->debug != MagickFalse)
2371 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2372 if (wand->images == (Image *) NULL)
2373 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2374 connected_components_image=ConnectedComponentsImage(wand->images,connectivity,
2375 objects,wand->exception);
2376 if (connected_components_image == (Image *) NULL)
2377 return(MagickFalse);
2378 ReplaceImageInList(&wand->images,connected_components_image);
2410WandExport MagickBooleanType MagickContrastImage(
MagickWand *wand,
2411 const MagickBooleanType sharpen)
2417 assert(wand->signature == MagickWandSignature);
2418 if (wand->debug != MagickFalse)
2419 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2420 if (wand->images == (Image *) NULL)
2421 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2422 status=ContrastImage(wand->images,sharpen,wand->exception);
2456WandExport MagickBooleanType MagickContrastStretchImage(
MagickWand *wand,
2457 const double black_point,
const double white_point)
2463 assert(wand->signature == MagickWandSignature);
2464 if (wand->debug != MagickFalse)
2465 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2466 if (wand->images == (Image *) NULL)
2467 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2468 status=ContrastStretchImage(wand->images,black_point,white_point,
2498WandExport MagickBooleanType MagickConvolveImage(
MagickWand *wand,
2499 const KernelInfo *kernel)
2505 assert(wand->signature == MagickWandSignature);
2506 if (wand->debug != MagickFalse)
2507 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2508 if (kernel == (
const KernelInfo *) NULL)
2509 return(MagickFalse);
2510 if (wand->images == (Image *) NULL)
2511 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2512 filter_image=ConvolveImage(wand->images,kernel,wand->exception);
2513 if (filter_image == (Image *) NULL)
2514 return(MagickFalse);
2515 ReplaceImageInList(&wand->images,filter_image);
2550WandExport MagickBooleanType MagickCropImage(
MagickWand *wand,
2551 const size_t width,
const size_t height,
const ssize_t x,
const ssize_t y)
2560 assert(wand->signature == MagickWandSignature);
2561 if (wand->debug != MagickFalse)
2562 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2563 if (wand->images == (Image *) NULL)
2564 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2569 crop_image=CropImage(wand->images,&crop,wand->exception);
2570 if (crop_image == (Image *) NULL)
2571 return(MagickFalse);
2572 ReplaceImageInList(&wand->images,crop_image);
2603WandExport MagickBooleanType MagickCycleColormapImage(
MagickWand *wand,
2604 const ssize_t displace)
2610 assert(wand->signature == MagickWandSignature);
2611 if (wand->debug != MagickFalse)
2612 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2613 if (wand->images == (Image *) NULL)
2614 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2615 status=CycleColormapImage(wand->images,displace,wand->exception);
2671WandExport MagickBooleanType MagickConstituteImage(
MagickWand *wand,
2672 const size_t columns,
const size_t rows,
const char *map,
2673 const StorageType storage,
const void *pixels)
2679 assert(wand->signature == MagickWandSignature);
2680 if (wand->debug != MagickFalse)
2681 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2682 images=ConstituteImage(columns,rows,map,storage,pixels,wand->exception);
2683 if (images == (Image *) NULL)
2684 return(MagickFalse);
2685 return(InsertImageInWand(wand,images));
2713WandExport MagickBooleanType MagickDecipherImage(
MagickWand *wand,
2714 const char *passphrase)
2717 assert(wand->signature == MagickWandSignature);
2718 if (wand->debug != MagickFalse)
2719 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2720 if (wand->images == (Image *) NULL)
2721 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2722 return(DecipherImage(wand->images,passphrase,wand->exception));
2755 assert(wand->signature == MagickWandSignature);
2756 if (wand->debug != MagickFalse)
2757 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2758 if (wand->images == (Image *) NULL)
2760 deconstruct_image=CompareImagesLayers(wand->images,CompareAnyLayer,
2762 if (deconstruct_image == (Image *) NULL)
2764 return(CloneMagickWandFromImages(wand,deconstruct_image));
2795WandExport MagickBooleanType MagickDeskewImage(
MagickWand *wand,
2796 const double threshold)
2802 assert(wand->signature == MagickWandSignature);
2803 if (wand->debug != MagickFalse)
2804 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2805 if (wand->images == (Image *) NULL)
2806 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2807 sepia_image=DeskewImage(wand->images,threshold,wand->exception);
2808 if (sepia_image == (Image *) NULL)
2809 return(MagickFalse);
2810 ReplaceImageInList(&wand->images,sepia_image);
2837WandExport MagickBooleanType MagickDespeckleImage(
MagickWand *wand)
2843 assert(wand->signature == MagickWandSignature);
2844 if (wand->debug != MagickFalse)
2845 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2846 if (wand->images == (Image *) NULL)
2847 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2848 despeckle_image=DespeckleImage(wand->images,wand->exception);
2849 if (despeckle_image == (Image *) NULL)
2850 return(MagickFalse);
2851 ReplaceImageInList(&wand->images,despeckle_image);
2878WandExport Image *MagickDestroyImage(Image *image)
2880 return(DestroyImage(image));
2908WandExport MagickBooleanType MagickDisplayImage(
MagickWand *wand,
2909 const char *server_name)
2918 assert(wand->signature == MagickWandSignature);
2919 if (wand->debug != MagickFalse)
2920 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2921 if (wand->images == (Image *) NULL)
2922 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2923 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
2924 if (image == (Image *) NULL)
2925 return(MagickFalse);
2926 (void) CloneString(&wand->image_info->server_name,server_name);
2927 status=DisplayImages(wand->image_info,image,wand->exception);
2928 image=DestroyImage(image);
2957WandExport MagickBooleanType MagickDisplayImages(
MagickWand *wand,
2958 const char *server_name)
2964 assert(wand->signature == MagickWandSignature);
2965 if (wand->debug != MagickFalse)
2966 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2967 (void) CloneString(&wand->image_info->server_name,server_name);
2968 status=DisplayImages(wand->image_info,wand->images,wand->exception);
3032WandExport MagickBooleanType MagickDistortImage(
MagickWand *wand,
3033 const DistortMethod method,
const size_t number_arguments,
3034 const double *arguments,
const MagickBooleanType bestfit)
3040 assert(wand->signature == MagickWandSignature);
3041 if (wand->debug != MagickFalse)
3042 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3043 if (wand->images == (Image *) NULL)
3044 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3045 distort_image=DistortImage(wand->images,method,number_arguments,arguments,
3046 bestfit,wand->exception);
3047 if (distort_image == (Image *) NULL)
3048 return(MagickFalse);
3049 ReplaceImageInList(&wand->images,distort_image);
3078WandExport MagickBooleanType MagickDrawImage(
MagickWand *wand,
3091 assert(wand->signature == MagickWandSignature);
3092 if (wand->debug != MagickFalse)
3093 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3094 if (wand->images == (Image *) NULL)
3095 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3096 draw_info=PeekDrawingWand(drawing_wand);
3097 if ((draw_info == (DrawInfo *) NULL) ||
3098 (draw_info->primitive == (
char *) NULL))
3099 return(MagickFalse);
3100 primitive=AcquireString(draw_info->primitive);
3101 draw_info=DestroyDrawInfo(draw_info);
3102 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
3103 draw_info->primitive=primitive;
3104 status=DrawImage(wand->images,draw_info,wand->exception);
3105 draw_info=DestroyDrawInfo(draw_info);
3135WandExport MagickBooleanType MagickEdgeImage(
MagickWand *wand,
3136 const double radius)
3142 assert(wand->signature == MagickWandSignature);
3143 if (wand->debug != MagickFalse)
3144 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3145 if (wand->images == (Image *) NULL)
3146 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3147 edge_image=EdgeImage(wand->images,radius,wand->exception);
3148 if (edge_image == (Image *) NULL)
3149 return(MagickFalse);
3150 ReplaceImageInList(&wand->images,edge_image);
3186WandExport MagickBooleanType MagickEmbossImage(
MagickWand *wand,
3187 const double radius,
const double sigma)
3193 assert(wand->signature == MagickWandSignature);
3194 if (wand->debug != MagickFalse)
3195 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3196 if (wand->images == (Image *) NULL)
3197 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3198 emboss_image=EmbossImage(wand->images,radius,sigma,wand->exception);
3199 if (emboss_image == (Image *) NULL)
3200 return(MagickFalse);
3201 ReplaceImageInList(&wand->images,emboss_image);
3230WandExport MagickBooleanType MagickEncipherImage(
MagickWand *wand,
3231 const char *passphrase)
3234 assert(wand->signature == MagickWandSignature);
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 return(EncipherImage(wand->images,passphrase,wand->exception));
3265WandExport MagickBooleanType MagickEnhanceImage(
MagickWand *wand)
3271 assert(wand->signature == MagickWandSignature);
3272 if (wand->debug != MagickFalse)
3273 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3274 if (wand->images == (Image *) NULL)
3275 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3276 enhance_image=EnhanceImage(wand->images,wand->exception);
3277 if (enhance_image == (Image *) NULL)
3278 return(MagickFalse);
3279 ReplaceImageInList(&wand->images,enhance_image);
3307WandExport MagickBooleanType MagickEqualizeImage(
MagickWand *wand)
3313 assert(wand->signature == MagickWandSignature);
3314 if (wand->debug != MagickFalse)
3315 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3316 if (wand->images == (Image *) NULL)
3317 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3318 status=EqualizeImage(wand->images,wand->exception);
3356 const MagickEvaluateOperator op)
3362 assert(wand->signature == MagickWandSignature);
3363 if (wand->debug != MagickFalse)
3364 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3365 if (wand->images == (Image *) NULL)
3367 evaluate_image=EvaluateImages(wand->images,op,wand->exception);
3368 if (evaluate_image == (Image *) NULL)
3370 return(CloneMagickWandFromImages(wand,evaluate_image));
3373WandExport MagickBooleanType MagickEvaluateImage(
MagickWand *wand,
3374 const MagickEvaluateOperator op,
const double value)
3380 assert(wand->signature == MagickWandSignature);
3381 if (wand->debug != MagickFalse)
3382 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3383 if (wand->images == (Image *) NULL)
3384 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3385 status=EvaluateImage(wand->images,op,value,wand->exception);
3440WandExport MagickBooleanType MagickExportImagePixels(
MagickWand *wand,
3441 const ssize_t x,
const ssize_t y,
const size_t columns,
3442 const size_t rows,
const char *map,
const StorageType storage,
3449 assert(wand->signature == MagickWandSignature);
3450 if (wand->debug != MagickFalse)
3451 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3452 if (wand->images == (Image *) NULL)
3453 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3454 status=ExportImagePixels(wand->images,x,y,columns,rows,map,
3455 storage,pixels,wand->exception);
3492WandExport MagickBooleanType MagickExtentImage(
MagickWand *wand,
3493 const size_t width,
const size_t height,
const ssize_t x,
const ssize_t y)
3502 assert(wand->signature == MagickWandSignature);
3503 if (wand->debug != MagickFalse)
3504 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3505 if (wand->images == (Image *) NULL)
3506 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3508 extent.height=height;
3511 extent_image=ExtentImage(wand->images,&extent,wand->exception);
3512 if (extent_image == (Image *) NULL)
3513 return(MagickFalse);
3514 ReplaceImageInList(&wand->images,extent_image);
3541WandExport MagickBooleanType MagickFlipImage(
MagickWand *wand)
3547 assert(wand->signature == MagickWandSignature);
3548 if (wand->debug != MagickFalse)
3549 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3550 if (wand->images == (Image *) NULL)
3551 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3552 flip_image=FlipImage(wand->images,wand->exception);
3553 if (flip_image == (Image *) NULL)
3554 return(MagickFalse);
3555 ReplaceImageInList(&wand->images,flip_image);
3601WandExport MagickBooleanType MagickFloodfillPaintImage(
MagickWand *wand,
3603 const ssize_t x,
const ssize_t y,
const MagickBooleanType invert)
3615 assert(wand->signature == MagickWandSignature);
3616 if (wand->debug != MagickFalse)
3617 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3618 if (wand->images == (Image *) NULL)
3619 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3620 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
3621 PixelGetQuantumPacket(fill,&draw_info->fill);
3622 (void) GetOneVirtualPixelInfo(wand->images,TileVirtualPixelMethod,x %
3623 (ssize_t) wand->images->columns,y % (ssize_t) wand->images->rows,&target,
3626 PixelGetMagickColor(bordercolor,&target);
3627 wand->images->fuzz=fuzz;
3628 status=FloodfillPaintImage(wand->images,draw_info,&target,x,y,invert,
3630 draw_info=DestroyDrawInfo(draw_info);
3657WandExport MagickBooleanType MagickFlopImage(
MagickWand *wand)
3663 assert(wand->signature == MagickWandSignature);
3664 if (wand->debug != MagickFalse)
3665 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3666 if (wand->images == (Image *) NULL)
3667 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3668 flop_image=FlopImage(wand->images,wand->exception);
3669 if (flop_image == (Image *) NULL)
3670 return(MagickFalse);
3671 ReplaceImageInList(&wand->images,flop_image);
3703WandExport MagickBooleanType MagickForwardFourierTransformImage(
3704 MagickWand *wand,
const MagickBooleanType magnitude)
3710 assert(wand->signature == MagickWandSignature);
3711 if (wand->debug != MagickFalse)
3712 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3713 if (wand->images == (Image *) NULL)
3714 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3715 forward_image=ForwardFourierTransformImage(wand->images,magnitude,
3717 if (forward_image == (Image *) NULL)
3718 return(MagickFalse);
3719 ReplaceImageInList(&wand->images,forward_image);
3763WandExport MagickBooleanType MagickFrameImage(
MagickWand *wand,
3764 const PixelWand *matte_color,
const size_t width,
const size_t height,
3765 const ssize_t inner_bevel,
const ssize_t outer_bevel,
3766 const CompositeOperator compose)
3775 assert(wand->signature == MagickWandSignature);
3776 if (wand->debug != MagickFalse)
3777 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3778 if (wand->images == (Image *) NULL)
3779 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3780 (void) memset(&frame_info,0,
sizeof(frame_info));
3781 frame_info.width=wand->images->columns+2*width;
3782 frame_info.height=wand->images->rows+2*height;
3783 frame_info.x=(ssize_t) width;
3784 frame_info.y=(ssize_t) height;
3785 frame_info.inner_bevel=inner_bevel;
3786 frame_info.outer_bevel=outer_bevel;
3787 PixelGetQuantumPacket(matte_color,&wand->images->matte_color);
3788 frame_image=FrameImage(wand->images,&frame_info,compose,wand->exception);
3789 if (frame_image == (Image *) NULL)
3790 return(MagickFalse);
3791 ReplaceImageInList(&wand->images,frame_image);
3828WandExport MagickBooleanType MagickFunctionImage(
MagickWand *wand,
3829 const MagickFunction function,
const size_t number_arguments,
3830 const double *arguments)
3836 assert(wand->signature == MagickWandSignature);
3837 if (wand->debug != MagickFalse)
3838 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3839 if (wand->images == (Image *) NULL)
3840 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3841 status=FunctionImage(wand->images,function,number_arguments,arguments,
3876 assert(wand->signature == MagickWandSignature);
3877 if (wand->debug != MagickFalse)
3878 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3879 if (wand->images == (Image *) NULL)
3881 fx_image=FxImage(wand->images,expression,wand->exception);
3882 if (fx_image == (Image *) NULL)
3884 return(CloneMagickWandFromImages(wand,fx_image));
3918WandExport MagickBooleanType MagickGammaImage(
MagickWand *wand,
3925 assert(wand->signature == MagickWandSignature);
3926 if (wand->debug != MagickFalse)
3927 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3928 if (wand->images == (Image *) NULL)
3929 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3930 status=GammaImage(wand->images,gamma,wand->exception);
3965WandExport MagickBooleanType MagickGaussianBlurImage(
MagickWand *wand,
3966 const double radius,
const double sigma)
3972 assert(wand->signature == MagickWandSignature);
3973 if (wand->debug != MagickFalse)
3974 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3975 if (wand->images == (Image *) NULL)
3976 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
3977 blur_image=GaussianBlurImage(wand->images,radius,sigma,wand->exception);
3978 if (blur_image == (Image *) NULL)
3979 return(MagickFalse);
3980 ReplaceImageInList(&wand->images,blur_image);
4012 assert(wand->signature == MagickWandSignature);
4013 if (wand->debug != MagickFalse)
4014 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4015 if (wand->images == (Image *) NULL)
4017 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4018 "ContainsNoImages",
"`%s'",wand->name);
4021 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
4022 if (image == (Image *) NULL)
4024 return(CloneMagickWandFromImages(wand,image));
4051WandExport MagickBooleanType MagickGetImageAlphaChannel(
MagickWand *wand)
4054 assert(wand->signature == MagickWandSignature);
4055 if (wand->debug != MagickFalse)
4056 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4057 if (wand->images == (Image *) NULL)
4058 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4059 return(GetImageAlphaChannel(wand->images));
4087 const PixelMask type)
4093 assert(wand->signature == MagickWandSignature);
4094 if (wand->debug != MagickFalse)
4095 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4096 if (wand->images == (Image *) NULL)
4098 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4099 "ContainsNoImages",
"`%s'",wand->name);
4102 image=GetImageMask(wand->images,type,wand->exception);
4103 if (image == (Image *) NULL)
4105 return(CloneMagickWandFromImages(wand,image));
4133WandExport MagickBooleanType MagickGetImageBackgroundColor(
MagickWand *wand,
4137 assert(wand->signature == MagickWandSignature);
4138 if (wand->debug != MagickFalse)
4139 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4140 if (wand->images == (Image *) NULL)
4141 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4142 PixelSetPixelColor(background_color,&wand->images->background_color);
4178WandExport
unsigned char *MagickGetImageBlob(
MagickWand *wand,
size_t *length)
4184 assert(wand->signature == MagickWandSignature);
4185 if (wand->debug != MagickFalse)
4186 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4187 if (wand->images == (Image *) NULL)
4189 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4190 "ContainsNoImages",
"`%s'",wand->name);
4191 return((
unsigned char *) NULL);
4193 blob=(
unsigned char *) ImageToBlob(wand->image_info,wand->images,length,
4229WandExport
unsigned char *MagickGetImagesBlob(
MagickWand *wand,
size_t *length)
4235 assert(wand->signature == MagickWandSignature);
4236 if (wand->debug != MagickFalse)
4237 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4238 if (wand->images == (Image *) NULL)
4240 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4241 "ContainsNoImages",
"`%s'",wand->name);
4242 return((
unsigned char *) NULL);
4244 blob=(
unsigned char *) ImagesToBlob(wand->image_info,GetFirstImageInList(
4245 wand->images),length,wand->exception);
4279WandExport MagickBooleanType MagickGetImageBluePrimary(
MagickWand *wand,
4280 double *x,
double *y,
double *z)
4283 assert(wand->signature == MagickWandSignature);
4284 if (wand->debug != MagickFalse)
4285 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4286 if (wand->images == (Image *) NULL)
4287 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4288 *x=wand->images->chromaticity.blue_primary.x;
4289 *y=wand->images->chromaticity.blue_primary.y;
4290 *z=wand->images->chromaticity.blue_primary.z;
4319WandExport MagickBooleanType MagickGetImageBorderColor(
MagickWand *wand,
4323 assert(wand->signature == MagickWandSignature);
4324 if (wand->debug != MagickFalse)
4325 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4326 if (wand->images == (Image *) NULL)
4327 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4328 PixelSetPixelColor(border_color,&wand->images->border_color);
4370WandExport ChannelFeatures *MagickGetImageFeatures(
MagickWand *wand,
4371 const size_t distance)
4374 assert(wand->signature == MagickWandSignature);
4375 if (wand->debug != MagickFalse)
4376 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4377 if (wand->images == (Image *) NULL)
4379 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4380 "ContainsNoImages",
"`%s'",wand->name);
4381 return((ChannelFeatures *) NULL);
4383 return(GetImageFeatures(wand->images,distance,wand->exception));
4414WandExport MagickBooleanType MagickGetImageKurtosis(
MagickWand *wand,
4415 double *kurtosis,
double *skewness)
4421 assert(wand->signature == MagickWandSignature);
4422 if (wand->debug != MagickFalse)
4423 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4424 if (wand->images == (Image *) NULL)
4425 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4426 status=GetImageKurtosis(wand->images,kurtosis,skewness,wand->exception);
4460WandExport MagickBooleanType MagickGetImageMean(
MagickWand *wand,
double *mean,
4461 double *standard_deviation)
4467 assert(wand->signature == MagickWandSignature);
4468 if (wand->debug != MagickFalse)
4469 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4470 if (wand->images == (Image *) NULL)
4471 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4472 status=GetImageMean(wand->images,mean,standard_deviation,wand->exception);
4503WandExport MagickBooleanType MagickGetImageRange(
MagickWand *wand,
4504 double *minima,
double *maxima)
4510 assert(wand->signature == MagickWandSignature);
4511 if (wand->debug != MagickFalse)
4512 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4513 if (wand->images == (Image *) NULL)
4514 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4515 status=GetImageRange(wand->images,minima,maxima,wand->exception);
4549WandExport ChannelStatistics *MagickGetImageStatistics(
MagickWand *wand)
4552 assert(wand->signature == MagickWandSignature);
4553 if (wand->debug != MagickFalse)
4554 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4555 if (wand->images == (Image *) NULL)
4557 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4558 "ContainsNoImages",
"`%s'",wand->name);
4559 return((ChannelStatistics *) NULL);
4561 return(GetImageStatistics(wand->images,wand->exception));
4592WandExport MagickBooleanType MagickGetImageColormapColor(
MagickWand *wand,
4596 assert(wand->signature == MagickWandSignature);
4597 if (wand->debug != MagickFalse)
4598 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4599 if (wand->images == (Image *) NULL)
4600 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4601 if ((wand->images->colormap == (PixelInfo *) NULL) ||
4602 (index >= wand->images->colors))
4604 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4605 "InvalidColormapIndex",
"`%s'",wand->name);
4606 return(MagickFalse);
4608 PixelSetPixelColor(color,wand->images->colormap+index);
4634WandExport
size_t MagickGetImageColors(
MagickWand *wand)
4637 assert(wand->signature == MagickWandSignature);
4638 if (wand->debug != MagickFalse)
4639 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4640 if (wand->images == (Image *) NULL)
4642 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4643 "ContainsNoImages",
"`%s'",wand->name);
4646 return(GetNumberColors(wand->images,(FILE *) NULL,wand->exception));
4671WandExport ColorspaceType MagickGetImageColorspace(
MagickWand *wand)
4674 assert(wand->signature == MagickWandSignature);
4675 if (wand->debug != MagickFalse)
4676 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4677 if (wand->images == (Image *) NULL)
4679 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4680 "ContainsNoImages",
"`%s'",wand->name);
4681 return(UndefinedColorspace);
4683 return(wand->images->colorspace);
4709WandExport CompositeOperator MagickGetImageCompose(
MagickWand *wand)
4712 assert(wand->signature == MagickWandSignature);
4713 if (wand->debug != MagickFalse)
4714 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4715 if (wand->images == (Image *) NULL)
4717 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4718 "ContainsNoImages",
"`%s'",wand->name);
4719 return(UndefinedCompositeOp);
4721 return(wand->images->compose);
4746WandExport CompressionType MagickGetImageCompression(
MagickWand *wand)
4749 assert(wand->signature == MagickWandSignature);
4750 if (wand->debug != MagickFalse)
4751 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4752 if (wand->images == (Image *) NULL)
4754 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4755 "ContainsNoImages",
"`%s'",wand->name);
4756 return(UndefinedCompression);
4758 return(wand->images->compression);
4783WandExport
size_t MagickGetImageCompressionQuality(
MagickWand *wand)
4786 assert(wand->signature == MagickWandSignature);
4787 if (wand->debug != MagickFalse)
4788 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4789 if (wand->images == (Image *) NULL)
4791 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4792 "ContainsNoImages",
"`%s'",wand->name);
4795 return(wand->images->quality);
4820WandExport
size_t MagickGetImageDelay(
MagickWand *wand)
4823 assert(wand->signature == MagickWandSignature);
4824 if (wand->debug != MagickFalse)
4825 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4826 if (wand->images == (Image *) NULL)
4827 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4828 return(wand->images->delay);
4853WandExport
size_t MagickGetImageDepth(
MagickWand *wand)
4856 assert(wand->signature == MagickWandSignature);
4857 if (wand->debug != MagickFalse)
4858 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4859 if (wand->images == (Image *) NULL)
4860 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4861 return(wand->images->depth);
4886WandExport DisposeType MagickGetImageDispose(
MagickWand *wand)
4889 assert(wand->signature == MagickWandSignature);
4890 if (wand->debug != MagickFalse)
4891 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4892 if (wand->images == (Image *) NULL)
4894 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4895 "ContainsNoImages",
"`%s'",wand->name);
4896 return(UndefinedDispose);
4898 return((DisposeType) wand->images->dispose);
4932WandExport MagickBooleanType MagickGetImageDistortion(
MagickWand *wand,
4933 const MagickWand *reference,
const MetricType metric,
double *distortion)
4939 assert(wand->signature == MagickWandSignature);
4940 if (wand->debug != MagickFalse)
4941 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4942 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4943 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
4944 status=GetImageDistortion(wand->images,reference->images,metric,distortion,
4979WandExport
double *MagickGetImageDistortions(
MagickWand *wand,
4980 const MagickWand *reference,
const MetricType metric)
4983 *channel_distortion;
4986 assert(wand->signature == MagickWandSignature);
4987 if (wand->debug != MagickFalse)
4988 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
4990 assert(reference->signature == MagickWandSignature);
4991 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
4993 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
4994 "ContainsNoImages",
"`%s'",wand->name);
4995 return((
double *) NULL);
4997 channel_distortion=GetImageDistortions(wand->images,reference->images,
4998 metric,wand->exception);
4999 return(channel_distortion);
5024WandExport EndianType MagickGetImageEndian(
MagickWand *wand)
5027 assert(wand->signature == MagickWandSignature);
5028 if (wand->debug != MagickFalse)
5029 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5030 if (wand->images == (Image *) NULL)
5032 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5033 "ContainsNoImages",
"`%s'",wand->name);
5034 return(UndefinedEndian);
5036 return(wand->images->endian);
5062WandExport
char *MagickGetImageFilename(
MagickWand *wand)
5065 assert(wand->signature == MagickWandSignature);
5066 if (wand->debug != MagickFalse)
5067 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5068 if (wand->images == (Image *) NULL)
5070 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5071 "ContainsNoImages",
"`%s'",wand->name);
5072 return((
char *) NULL);
5074 return(AcquireString(wand->images->filename));
5099WandExport FilterType MagickGetImageFilter(
MagickWand *wand)
5102 assert(wand->signature == MagickWandSignature);
5103 if (wand->debug != MagickFalse)
5104 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5105 if (wand->images == (Image *) NULL)
5107 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5108 "ContainsNoImages",
"`%s'",wand->name);
5109 return(UndefinedFilter);
5111 return(wand->images->filter);
5137WandExport
char *MagickGetImageFormat(
MagickWand *wand)
5140 assert(wand->signature == MagickWandSignature);
5141 if (wand->debug != MagickFalse)
5142 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5143 if (wand->images == (Image *) NULL)
5145 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5146 "ContainsNoImages",
"`%s'",wand->name);
5147 return((
char *) NULL);
5149 return(AcquireString(wand->images->magick));
5174WandExport
double MagickGetImageFuzz(
MagickWand *wand)
5177 assert(wand->signature == MagickWandSignature);
5178 if (wand->debug != MagickFalse)
5179 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5180 if (wand->images == (Image *) NULL)
5182 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5183 "ContainsNoImages",
"`%s'",wand->name);
5186 return(wand->images->fuzz);
5211WandExport
double MagickGetImageGamma(
MagickWand *wand)
5214 assert(wand->signature == MagickWandSignature);
5215 if (wand->debug != MagickFalse)
5216 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5217 if (wand->images == (Image *) NULL)
5219 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5220 "ContainsNoImages",
"`%s'",wand->name);
5223 return(wand->images->gamma);
5248WandExport GravityType MagickGetImageGravity(
MagickWand *wand)
5251 assert(wand->signature == MagickWandSignature);
5252 if (wand->debug != MagickFalse)
5253 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5254 if (wand->images == (Image *) NULL)
5256 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5257 "ContainsNoImages",
"`%s'",wand->name);
5258 return(UndefinedGravity);
5260 return(wand->images->gravity);
5292WandExport MagickBooleanType MagickGetImageGreenPrimary(
MagickWand *wand,
5293 double *x,
double *y,
double *z)
5296 assert(wand->signature == MagickWandSignature);
5297 if (wand->debug != MagickFalse)
5298 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5299 if (wand->images == (Image *) NULL)
5300 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5301 *x=wand->images->chromaticity.green_primary.x;
5302 *y=wand->images->chromaticity.green_primary.y;
5303 *z=wand->images->chromaticity.green_primary.z;
5329WandExport
size_t MagickGetImageHeight(
MagickWand *wand)
5332 assert(wand->signature == MagickWandSignature);
5333 if (wand->debug != MagickFalse)
5334 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5335 if (wand->images == (Image *) NULL)
5336 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5337 return(wand->images->rows);
5368 size_t *number_colors)
5380 assert(wand->signature == MagickWandSignature);
5381 if (wand->debug != MagickFalse)
5382 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5383 if (wand->images == (Image *) NULL)
5385 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5386 "ContainsNoImages",
"`%s'",wand->name);
5389 histogram=GetImageHistogram(wand->images,number_colors,wand->exception);
5390 if (histogram == (PixelInfo *) NULL)
5392 pixel_wands=NewPixelWands(*number_colors);
5393 for (i=0; i < (ssize_t) *number_colors; i++)
5395 PixelSetPixelColor(pixel_wands[i],&histogram[i]);
5396 PixelSetColorCount(pixel_wands[i],(
size_t) histogram[i].count);
5398 histogram=(PixelInfo *) RelinquishMagickMemory(histogram);
5399 return(pixel_wands);
5424WandExport InterlaceType MagickGetImageInterlaceScheme(
MagickWand *wand)
5427 assert(wand->signature == MagickWandSignature);
5428 if (wand->debug != MagickFalse)
5429 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5430 if (wand->images == (Image *) NULL)
5432 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5433 "ContainsNoImages",
"`%s'",wand->name);
5434 return(UndefinedInterlace);
5436 return(wand->images->interlace);
5462WandExport PixelInterpolateMethod MagickGetImageInterpolateMethod(
5466 assert(wand->signature == MagickWandSignature);
5467 if (wand->debug != MagickFalse)
5468 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5469 if (wand->images == (Image *) NULL)
5471 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5472 "ContainsNoImages",
"`%s'",wand->name);
5473 return(UndefinedInterpolatePixel);
5475 return(wand->images->interpolate);
5500WandExport
size_t MagickGetImageIterations(
MagickWand *wand)
5503 assert(wand->signature == MagickWandSignature);
5504 if (wand->debug != MagickFalse)
5505 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5506 if (wand->images == (Image *) NULL)
5507 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5508 return(wand->images->iterations);
5536WandExport MagickBooleanType MagickGetImageLength(
MagickWand *wand,
5537 MagickSizeType *length)
5540 assert(wand->signature == MagickWandSignature);
5541 if (wand->debug != MagickFalse)
5542 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5543 if (wand->images == (Image *) NULL)
5544 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5545 *length=GetBlobSize(wand->images);
5574WandExport MagickBooleanType MagickGetImageMatteColor(
MagickWand *wand,
5578 assert(wand->signature == MagickWandSignature);
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 PixelSetPixelColor(matte_color,&wand->images->matte_color);
5609WandExport OrientationType MagickGetImageOrientation(
MagickWand *wand)
5612 assert(wand->signature == MagickWandSignature);
5613 if (wand->debug != MagickFalse)
5614 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5615 if (wand->images == (Image *) NULL)
5617 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5618 "ContainsNoImages",
"`%s'",wand->name);
5619 return(UndefinedOrientation);
5621 return(wand->images->orientation);
5655WandExport MagickBooleanType MagickGetImagePage(
MagickWand *wand,
5656 size_t *width,
size_t *height,ssize_t *x,ssize_t *y)
5659 assert(wand->signature == MagickWandSignature);
5660 if (wand->debug != MagickFalse)
5661 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5662 if (wand->images == (Image *) NULL)
5663 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5664 *width=wand->images->page.width;
5665 *height=wand->images->page.height;
5666 *x=wand->images->page.x;
5667 *y=wand->images->page.y;
5698WandExport MagickBooleanType MagickGetImagePixelColor(
MagickWand *wand,
5699 const ssize_t x,
const ssize_t y,
PixelWand *color)
5708 assert(wand->signature == MagickWandSignature);
5709 if (wand->debug != MagickFalse)
5710 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5711 if (wand->images == (Image *) NULL)
5712 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5713 image_view=AcquireVirtualCacheView(wand->images,wand->exception);
5714 p=GetCacheViewVirtualPixels(image_view,x,y,1,1,wand->exception);
5715 if (p == (
const Quantum *) NULL)
5717 image_view=DestroyCacheView(image_view);
5718 return(MagickFalse);
5720 PixelSetQuantumPixel(wand->images,p,color);
5721 image_view=DestroyCacheView(image_view);
5754WandExport MagickBooleanType MagickGetImageRedPrimary(
MagickWand *wand,
5755 double *x,
double *y,
double *z)
5758 assert(wand->signature == MagickWandSignature);
5759 if (wand->debug != MagickFalse)
5760 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5761 if (wand->images == (Image *) NULL)
5762 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5763 *x=wand->images->chromaticity.red_primary.x;
5764 *y=wand->images->chromaticity.red_primary.y;
5765 *z=wand->images->chromaticity.red_primary.z;
5803 const size_t width,
const size_t height,
const ssize_t x,
5813 assert(wand->signature == MagickWandSignature);
5814 if (wand->debug != MagickFalse)
5815 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5816 if (wand->images == (Image *) NULL)
5819 region.height=height;
5822 region_image=CropImage(wand->images,®ion,wand->exception);
5823 if (region_image == (Image *) NULL)
5825 return(CloneMagickWandFromImages(wand,region_image));
5850WandExport RenderingIntent MagickGetImageRenderingIntent(
MagickWand *wand)
5853 assert(wand->signature == MagickWandSignature);
5854 if (wand->debug != MagickFalse)
5855 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5856 if (wand->images == (Image *) NULL)
5858 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5859 "ContainsNoImages",
"`%s'",wand->name);
5860 return(UndefinedIntent);
5862 return((RenderingIntent) wand->images->rendering_intent);
5892WandExport MagickBooleanType MagickGetImageResolution(
MagickWand *wand,
5893 double *x,
double *y)
5896 assert(wand->signature == MagickWandSignature);
5897 if (wand->debug != MagickFalse)
5898 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5899 if (wand->images == (Image *) NULL)
5900 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5901 *x=wand->images->resolution.x;
5902 *y=wand->images->resolution.y;
5928WandExport
size_t MagickGetImageScene(
MagickWand *wand)
5931 assert(wand->signature == MagickWandSignature);
5932 if (wand->debug != MagickFalse)
5933 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5934 if (wand->images == (Image *) NULL)
5935 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
5936 return(wand->images->scene);
5962WandExport
char *MagickGetImageSignature(
MagickWand *wand)
5971 assert(wand->signature == MagickWandSignature);
5972 if (wand->debug != MagickFalse)
5973 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
5974 if (wand->images == (Image *) NULL)
5976 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
5977 "ContainsNoImages",
"`%s'",wand->name);
5978 return((
char *) NULL);
5980 status=SignatureImage(wand->images,wand->exception);
5981 if (status == MagickFalse)
5982 return((
char *) NULL);
5983 value=GetImageProperty(wand->images,
"signature",wand->exception);
5984 if (value == (
const char *) NULL)
5985 return((
char *) NULL);
5986 return(AcquireString(value));
6011WandExport
size_t MagickGetImageTicksPerSecond(
MagickWand *wand)
6014 assert(wand->signature == MagickWandSignature);
6015 if (wand->debug != MagickFalse)
6016 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6017 if (wand->images == (Image *) NULL)
6018 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6019 return((
size_t) wand->images->ticks_per_second);
6048WandExport ImageType MagickGetImageType(
MagickWand *wand)
6051 assert(wand->signature == MagickWandSignature);
6052 if (wand->debug != MagickFalse)
6053 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6054 if (wand->images == (Image *) NULL)
6056 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6057 "ContainsNoImages",
"`%s'",wand->name);
6058 return(UndefinedType);
6060 return(GetImageType(wand->images));
6085WandExport ResolutionType MagickGetImageUnits(
MagickWand *wand)
6088 assert(wand->signature == MagickWandSignature);
6089 if (wand->debug != MagickFalse)
6090 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6091 if (wand->images == (Image *) NULL)
6093 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6094 "ContainsNoImages",
"`%s'",wand->name);
6095 return(UndefinedResolution);
6097 return(wand->images->units);
6123WandExport VirtualPixelMethod MagickGetImageVirtualPixelMethod(
MagickWand *wand)
6126 assert(wand->signature == MagickWandSignature);
6127 if (wand->debug != MagickFalse)
6128 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6129 if (wand->images == (Image *) NULL)
6131 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6132 "ContainsNoImages",
"`%s'",wand->name);
6133 return(UndefinedVirtualPixelMethod);
6135 return(GetImageVirtualPixelMethod(wand->images));
6167WandExport MagickBooleanType MagickGetImageWhitePoint(
MagickWand *wand,
6168 double *x,
double *y,
double *z)
6171 assert(wand->signature == MagickWandSignature);
6172 if (wand->debug != MagickFalse)
6173 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6174 if (wand->images == (Image *) NULL)
6175 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6176 *x=wand->images->chromaticity.white_point.x;
6177 *y=wand->images->chromaticity.white_point.y;
6178 *z=wand->images->chromaticity.white_point.z;
6204WandExport
size_t MagickGetImageWidth(
MagickWand *wand)
6207 assert(wand->signature == MagickWandSignature);
6208 if (wand->debug != MagickFalse)
6209 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6210 if (wand->images == (Image *) NULL)
6211 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6212 return(wand->images->columns);
6238WandExport
size_t MagickGetNumberImages(
MagickWand *wand)
6241 assert(wand->signature == MagickWandSignature);
6242 if (wand->debug != MagickFalse)
6243 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6244 return(GetImageListLength(wand->images));
6269WandExport
double MagickGetImageTotalInkDensity(
MagickWand *wand)
6272 assert(wand->signature == MagickWandSignature);
6273 if (wand->debug != MagickFalse)
6274 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6275 if (wand->images == (Image *) NULL)
6277 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6278 "ContainsNoImages",
"`%s'",wand->name);
6281 return(GetImageTotalInkDensity(wand->images,wand->exception));
6313WandExport MagickBooleanType MagickHaldClutImage(
MagickWand *wand,
6320 assert(wand->signature == MagickWandSignature);
6321 if (wand->debug != MagickFalse)
6322 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6323 if ((wand->images == (Image *) NULL) || (hald_wand->images == (Image *) NULL))
6324 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6325 status=HaldClutImage(wand->images,hald_wand->images,wand->exception);
6352WandExport MagickBooleanType MagickHasNextImage(
MagickWand *wand)
6355 assert(wand->signature == MagickWandSignature);
6356 if (wand->debug != MagickFalse)
6357 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6358 if (wand->images == (Image *) NULL)
6359 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6360 if (GetNextImageInList(wand->images) == (Image *) NULL)
6361 return(MagickFalse);
6388WandExport MagickBooleanType MagickHasPreviousImage(
MagickWand *wand)
6391 assert(wand->signature == MagickWandSignature);
6392 if (wand->debug != MagickFalse)
6393 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6394 if (wand->images == (Image *) NULL)
6395 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6396 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
6397 return(MagickFalse);
6438WandExport MagickBooleanType MagickHoughLineImage(
MagickWand *wand,
6439 const size_t width,
const size_t height,
const size_t threshold)
6445 assert(wand->signature == MagickWandSignature);
6446 if (wand->debug != MagickFalse)
6447 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6448 if (wand->images == (Image *) NULL)
6449 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6450 lines_image=HoughLineImage(wand->images,width,height,threshold,
6452 if (lines_image == (Image *) NULL)
6453 return(MagickFalse);
6454 ReplaceImageInList(&wand->images,lines_image);
6481WandExport
char *MagickIdentifyImage(
MagickWand *wand)
6485 filename[MagickPathExtent];
6494 assert(wand->signature == MagickWandSignature);
6495 if (wand->debug != MagickFalse)
6496 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6497 if (wand->images == (Image *) NULL)
6499 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6500 "ContainsNoImages",
"`%s'",wand->name);
6501 return((
char *) NULL);
6503 description=(
char *) NULL;
6504 unique_file=AcquireUniqueFileResource(filename);
6506 if (unique_file != -1)
6507 file=fdopen(unique_file,
"wb");
6508 if ((unique_file == -1) || (file == (FILE *) NULL))
6510 (void) RelinquishUniqueFileResource(filename);
6511 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6512 "UnableToCreateTemporaryFile",
"`%s'",wand->name);
6513 return((
char *) NULL);
6515 (void) IdentifyImage(wand->images,file,MagickTrue,wand->exception);
6516 (void) fclose(file);
6517 description=FileToString(filename,~0UL,wand->exception);
6518 (void) RelinquishUniqueFileResource(filename);
6519 return(description);
6552WandExport ImageType MagickIdentifyImageType(
MagickWand *wand)
6555 assert(wand->signature == MagickWandSignature);
6556 if (wand->debug != MagickFalse)
6557 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6558 if (wand->images == (Image *) NULL)
6560 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
6561 "ContainsNoImages",
"`%s'",wand->name);
6562 return(UndefinedType);
6564 return(IdentifyImageType(wand->images,wand->exception));
6597WandExport MagickBooleanType MagickImplodeImage(
MagickWand *wand,
6598 const double amount,
const PixelInterpolateMethod method)
6604 assert(wand->signature == MagickWandSignature);
6605 if (wand->debug != MagickFalse)
6606 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6607 if (wand->images == (Image *) NULL)
6608 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6609 implode_image=ImplodeImage(wand->images,amount,method,wand->exception);
6610 if (implode_image == (Image *) NULL)
6611 return(MagickFalse);
6612 ReplaceImageInList(&wand->images,implode_image);
6667WandExport MagickBooleanType MagickImportImagePixels(
MagickWand *wand,
6668 const ssize_t x,
const ssize_t y,
const size_t columns,
const size_t rows,
6669 const char *map,
const StorageType storage,
const void *pixels)
6675 assert(wand->signature == MagickWandSignature);
6676 if (wand->debug != MagickFalse)
6677 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6678 if (wand->images == (Image *) NULL)
6679 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6680 status=ImportImagePixels(wand->images,x,y,columns,rows,map,storage,pixels,
6714WandExport MagickBooleanType MagickInterpolativeResizeImage(
MagickWand *wand,
6715 const size_t columns,
const size_t rows,
const PixelInterpolateMethod method)
6721 assert(wand->signature == MagickWandSignature);
6722 if (wand->debug != MagickFalse)
6723 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6724 if (wand->images == (Image *) NULL)
6725 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6726 resize_image=InterpolativeResizeImage(wand->images,columns,rows,method,
6728 if (resize_image == (Image *) NULL)
6729 return(MagickFalse);
6730 ReplaceImageInList(&wand->images,resize_image);
6765WandExport MagickBooleanType MagickInverseFourierTransformImage(
6767 const MagickBooleanType magnitude)
6775 assert(magnitude_wand != (
MagickWand *) NULL);
6776 assert(magnitude_wand->signature == MagickWandSignature);
6777 if (magnitude_wand->debug != MagickFalse)
6778 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",
6779 magnitude_wand->name);
6780 wand=magnitude_wand;
6781 if (magnitude_wand->images == (Image *) NULL)
6782 ThrowWandException(WandError,
"ContainsNoImages",
6783 magnitude_wand->name);
6785 assert(phase_wand->signature == MagickWandSignature);
6786 inverse_image=InverseFourierTransformImage(magnitude_wand->images,
6787 phase_wand->images,magnitude,wand->exception);
6788 if (inverse_image == (Image *) NULL)
6789 return(MagickFalse);
6790 ReplaceImageInList(&wand->images,inverse_image);
6825WandExport MagickBooleanType MagickKmeansImage(
MagickWand *wand,
6826 const size_t number_colors,
const size_t max_iterations,
6827 const double tolerance)
6833 assert(wand->signature == MagickWandSignature);
6834 if (wand->debug != MagickFalse)
6835 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6836 if (wand->images == (Image *) NULL)
6837 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6838 status=KmeansImage(wand->images,number_colors,max_iterations,tolerance,
6870WandExport MagickBooleanType MagickKuwaharaImage(
MagickWand *wand,
6871 const double radius,
const double sigma)
6877 assert(wand->signature == MagickWandSignature);
6878 if (wand->debug != MagickFalse)
6879 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6880 if (wand->images == (Image *) NULL)
6881 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6882 kuwahara_image=KuwaharaImage(wand->images,radius,sigma,wand->exception);
6883 if (kuwahara_image == (Image *) NULL)
6884 return(MagickFalse);
6885 ReplaceImageInList(&wand->images,kuwahara_image);
6913WandExport MagickBooleanType MagickLabelImage(
MagickWand *wand,
6920 assert(wand->signature == MagickWandSignature);
6921 if (wand->debug != MagickFalse)
6922 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6923 if (wand->images == (Image *) NULL)
6924 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6925 status=SetImageProperty(wand->images,
"label",label,wand->exception);
6968WandExport MagickBooleanType MagickLevelImage(
MagickWand *wand,
6969 const double black_point,
const double gamma,
const double white_point)
6975 assert(wand->signature == MagickWandSignature);
6976 if (wand->debug != MagickFalse)
6977 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
6978 if (wand->images == (Image *) NULL)
6979 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
6980 status=LevelImage(wand->images,black_point,white_point,gamma,
7018WandExport MagickBooleanType MagickLevelImageColors(
MagickWand *wand,
7020 const MagickBooleanType invert)
7030 assert(wand->signature == MagickWandSignature);
7031 if (wand->debug != MagickFalse)
7032 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7033 if (wand->images == (Image *) NULL)
7034 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7035 PixelGetMagickColor(black_color,&black);
7036 PixelGetMagickColor(white_color,&white);
7037 status=LevelImageColors(wand->images,&black,&white,invert,wand->exception);
7073WandExport MagickBooleanType MagickLevelizeImage(
MagickWand *wand,
7074 const double black_point,
const double gamma,
const double white_point)
7080 assert(wand->signature == MagickWandSignature);
7081 if (wand->debug != MagickFalse)
7082 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7083 if (wand->images == (Image *) NULL)
7084 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7085 status=LevelizeImage(wand->images,black_point,white_point,gamma,
7120WandExport MagickBooleanType MagickLinearStretchImage(
MagickWand *wand,
7121 const double black_point,
const double white_point)
7127 assert(wand->signature == MagickWandSignature);
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 status=LinearStretchImage(wand->images,black_point,white_point,
7167WandExport MagickBooleanType MagickLiquidRescaleImage(
MagickWand *wand,
7168 const size_t columns,
const size_t rows,
const double delta_x,
7169 const double rigidity)
7175 assert(wand->signature == MagickWandSignature);
7176 if (wand->debug != MagickFalse)
7177 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7178 if (wand->images == (Image *) NULL)
7179 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7180 rescale_image=LiquidRescaleImage(wand->images,columns,rows,delta_x,
7181 rigidity,wand->exception);
7182 if (rescale_image == (Image *) NULL)
7183 return(MagickFalse);
7184 ReplaceImageInList(&wand->images,rescale_image);
7217WandExport MagickBooleanType MagickLocalContrastImage(
MagickWand *wand,
7218 const double radius,
const double strength)
7224 assert(wand->signature == MagickWandSignature);
7225 if (wand->debug != MagickFalse)
7226 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s", wand->name);
7227 if (wand->images == (Image *)NULL)
7228 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7229 contrast_image=LocalContrastImage(wand->images,radius,strength,
7231 if (contrast_image == (Image *)NULL)
7232 return(MagickFalse);
7233 ReplaceImageInList(&wand->images,contrast_image);
7260WandExport MagickBooleanType MagickMagnifyImage(
MagickWand *wand)
7266 assert(wand->signature == MagickWandSignature);
7267 if (wand->debug != MagickFalse)
7268 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7269 if (wand->images == (Image *) NULL)
7270 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7271 magnify_image=MagnifyImage(wand->images,wand->exception);
7272 if (magnify_image == (Image *) NULL)
7273 return(MagickFalse);
7274 ReplaceImageInList(&wand->images,magnify_image);
7315WandExport MagickBooleanType MagickMeanShiftImage(
MagickWand *wand,
7316 const size_t width,
const size_t height,
const double color_distance)
7322 assert(wand->signature == MagickWandSignature);
7323 if (wand->debug != MagickFalse)
7324 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7325 if (wand->images == (Image *) NULL)
7326 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7327 mean_image=MeanShiftImage(wand->images,width,height,color_distance,
7329 if (mean_image == (Image *) NULL)
7330 return(MagickFalse);
7331 ReplaceImageInList(&wand->images,mean_image);
7379 const LayerMethod method)
7385 assert(wand->signature == MagickWandSignature);
7386 if (wand->debug != MagickFalse)
7387 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7388 if (wand->images == (Image *) NULL)
7390 mosaic_image=MergeImageLayers(wand->images,method,wand->exception);
7391 if (mosaic_image == (Image *) NULL)
7393 return(CloneMagickWandFromImages(wand,mosaic_image));
7419WandExport MagickBooleanType MagickMinifyImage(
MagickWand *wand)
7425 assert(wand->signature == MagickWandSignature);
7426 if (wand->debug != MagickFalse)
7427 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7428 if (wand->images == (Image *) NULL)
7429 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7430 minify_image=MinifyImage(wand->images,wand->exception);
7431 if (minify_image == (Image *) NULL)
7432 return(MagickFalse);
7433 ReplaceImageInList(&wand->images,minify_image);
7473WandExport MagickBooleanType MagickModulateImage(
MagickWand *wand,
7474 const double brightness,
const double saturation,
const double hue)
7477 modulate[MagickPathExtent];
7483 assert(wand->signature == MagickWandSignature);
7484 if (wand->debug != MagickFalse)
7485 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7486 if (wand->images == (Image *) NULL)
7487 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7488 (void) FormatLocaleString(modulate,MagickPathExtent,
"%g,%g,%g",
7489 brightness,saturation,hue);
7490 status=ModulateImage(wand->images,modulate,wand->exception);
7535 const DrawingWand *drawing_wand,
const char *tile_geometry,
7536 const char *thumbnail_geometry,
const MontageMode mode,
const char *frame)
7551 assert(wand->signature == MagickWandSignature);
7552 if (wand->debug != MagickFalse)
7553 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7554 if (wand->images == (Image *) NULL)
7556 montage_info=CloneMontageInfo(wand->image_info,(MontageInfo *) NULL);
7561 (void) CloneString(&montage_info->frame,
"15x15+3+3");
7562 montage_info->shadow=MagickTrue;
7567 montage_info->frame=(
char *) NULL;
7568 montage_info->shadow=MagickFalse;
7569 montage_info->border_width=0;
7572 case ConcatenateMode:
7574 montage_info->frame=(
char *) NULL;
7575 montage_info->shadow=MagickFalse;
7576 (void) CloneString(&montage_info->geometry,
"+0+0");
7577 montage_info->border_width=0;
7583 font=DrawGetFont(drawing_wand);
7584 if (font != (
char *) NULL)
7585 (void) CloneString(&montage_info->font,font);
7586 if (frame != (
char *) NULL)
7587 (void) CloneString(&montage_info->frame,frame);
7588 montage_info->pointsize=DrawGetFontSize(drawing_wand);
7589 pixel_wand=NewPixelWand();
7590 DrawGetFillColor(drawing_wand,pixel_wand);
7591 PixelGetQuantumPacket(pixel_wand,&montage_info->fill);
7592 DrawGetStrokeColor(drawing_wand,pixel_wand);
7593 PixelGetQuantumPacket(pixel_wand,&montage_info->stroke);
7594 pixel_wand=DestroyPixelWand(pixel_wand);
7595 if (thumbnail_geometry != (
char *) NULL)
7596 (void) CloneString(&montage_info->geometry,thumbnail_geometry);
7597 if (tile_geometry != (
char *) NULL)
7598 (void) CloneString(&montage_info->tile,tile_geometry);
7599 montage_image=MontageImageList(wand->image_info,montage_info,wand->images,
7601 montage_info=DestroyMontageInfo(montage_info);
7602 if (montage_image == (Image *) NULL)
7604 return(CloneMagickWandFromImages(wand,montage_image));
7635 const size_t number_frames)
7641 assert(wand->signature == MagickWandSignature);
7642 if (wand->debug != MagickFalse)
7643 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7644 if (wand->images == (Image *) NULL)
7646 morph_image=MorphImages(wand->images,number_frames,wand->exception);
7647 if (morph_image == (Image *) NULL)
7649 return(CloneMagickWandFromImages(wand,morph_image));
7685WandExport MagickBooleanType MagickMorphologyImage(
MagickWand *wand,
7686 const MorphologyMethod method,
const ssize_t iterations,
7687 const KernelInfo *kernel)
7693 assert(wand->signature == MagickWandSignature);
7694 if (wand->debug != MagickFalse)
7695 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7696 if (kernel == (
const KernelInfo *) NULL)
7697 return(MagickFalse);
7698 if (wand->images == (Image *) NULL)
7699 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7700 morphology_image=MorphologyImage(wand->images,method,iterations,kernel,
7702 if (morphology_image == (Image *) NULL)
7703 return(MagickFalse);
7704 ReplaceImageInList(&wand->images,morphology_image);
7742WandExport MagickBooleanType MagickMotionBlurImage(
MagickWand *wand,
7743 const double radius,
const double sigma,
const double angle)
7749 assert(wand->signature == MagickWandSignature);
7750 if (wand->debug != MagickFalse)
7751 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7752 if (wand->images == (Image *) NULL)
7753 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7754 blur_image=MotionBlurImage(wand->images,radius,sigma,angle,wand->exception);
7755 if (blur_image == (Image *) NULL)
7756 return(MagickFalse);
7757 ReplaceImageInList(&wand->images,blur_image);
7791WandExport MagickBooleanType MagickNegateImage(
MagickWand *wand,
7792 const MagickBooleanType gray)
7798 assert(wand->signature == MagickWandSignature);
7799 if (wand->debug != MagickFalse)
7800 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7801 if (wand->images == (Image *) NULL)
7802 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7803 status=NegateImage(wand->images,gray,wand->exception);
7838WandExport MagickBooleanType MagickNewImage(
MagickWand *wand,
const size_t width,
7839 const size_t height,
const PixelWand *background)
7848 assert(wand->signature == MagickWandSignature);
7849 if (wand->debug != MagickFalse)
7850 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7851 PixelGetMagickColor(background,&pixel);
7852 images=NewMagickImage(wand->image_info,width,height,&pixel,wand->exception);
7853 if (images == (Image *) NULL)
7854 return(MagickFalse);
7855 return(InsertImageInWand(wand,images));
7893WandExport MagickBooleanType MagickNextImage(
MagickWand *wand)
7896 assert(wand->signature == MagickWandSignature);
7897 if (wand->debug != MagickFalse)
7898 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7899 if (wand->images == (Image *) NULL)
7900 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7901 wand->insert_before=MagickFalse;
7902 if (wand->image_pending != MagickFalse)
7904 wand->image_pending=MagickFalse;
7907 if (GetNextImageInList(wand->images) == (Image *) NULL)
7909 wand->image_pending=MagickTrue;
7910 return(MagickFalse);
7912 wand->images=GetNextImageInList(wand->images);
7942WandExport MagickBooleanType MagickNormalizeImage(
MagickWand *wand)
7948 assert(wand->signature == MagickWandSignature);
7949 if (wand->debug != MagickFalse)
7950 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7951 if (wand->images == (Image *) NULL)
7952 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7953 status=NormalizeImage(wand->images,wand->exception);
7986WandExport MagickBooleanType MagickOilPaintImage(
MagickWand *wand,
7987 const double radius,
const double sigma)
7993 assert(wand->signature == MagickWandSignature);
7994 if (wand->debug != MagickFalse)
7995 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
7996 if (wand->images == (Image *) NULL)
7997 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
7998 paint_image=OilPaintImage(wand->images,radius,sigma,wand->exception);
7999 if (paint_image == (Image *) NULL)
8000 return(MagickFalse);
8001 ReplaceImageInList(&wand->images,paint_image);
8043WandExport MagickBooleanType MagickOpaquePaintImage(
MagickWand *wand,
8045 const MagickBooleanType invert)
8055 assert(wand->signature == MagickWandSignature);
8056 if (wand->debug != MagickFalse)
8057 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8058 if (wand->images == (Image *) NULL)
8059 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8060 PixelGetMagickColor(target,&target_pixel);
8061 PixelGetMagickColor(fill,&fill_pixel);
8062 wand->images->fuzz=fuzz;
8063 status=OpaquePaintImage(wand->images,&target_pixel,&fill_pixel,invert,
8099 assert(wand->signature == MagickWandSignature);
8100 if (wand->debug != MagickFalse)
8101 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8102 if (wand->images == (Image *) NULL)
8104 optimize_image=OptimizeImageLayers(wand->images,wand->exception);
8105 if (optimize_image == (Image *) NULL)
8107 return(CloneMagickWandFromImages(wand,optimize_image));
8138WandExport MagickBooleanType MagickOptimizeImageTransparency(
MagickWand *wand)
8141 assert(wand->signature == MagickWandSignature);
8142 if (wand->debug != MagickFalse)
8143 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8144 if (wand->images == (Image *) NULL)
8145 return(MagickFalse);
8146 OptimizeImageTransparency(wand->images,wand->exception);
8195WandExport MagickBooleanType MagickOrderedDitherImage(
MagickWand *wand,
8196 const char *threshold_map)
8202 assert(wand->signature == MagickWandSignature);
8203 if (wand->debug != MagickFalse)
8204 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8205 if (wand->images == (Image *) NULL)
8206 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8207 status=OrderedDitherImage(wand->images,threshold_map,wand->exception);
8238WandExport MagickBooleanType MagickPingImage(
MagickWand *wand,
8239 const char *filename)
8248 assert(wand->signature == MagickWandSignature);
8249 if (wand->debug != MagickFalse)
8250 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8251 ping_info=CloneImageInfo(wand->image_info);
8252 if (filename != (
const char *) NULL)
8253 (void) CopyMagickString(ping_info->filename,filename,MagickPathExtent);
8254 images=PingImage(ping_info,wand->exception);
8255 ping_info=DestroyImageInfo(ping_info);
8256 if (images == (Image *) NULL)
8257 return(MagickFalse);
8258 return(InsertImageInWand(wand,images));
8288WandExport MagickBooleanType MagickPingImageBlob(
MagickWand *wand,
8289 const void *blob,
const size_t length)
8295 assert(wand->signature == MagickWandSignature);
8296 if (wand->debug != MagickFalse)
8297 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8298 images=PingBlob(wand->image_info,blob,length,wand->exception);
8299 if (images == (Image *) NULL)
8300 return(MagickFalse);
8301 return(InsertImageInWand(wand,images));
8329WandExport MagickBooleanType MagickPingImageFile(
MagickWand *wand,FILE *file)
8338 assert(wand->signature == MagickWandSignature);
8339 assert(file != (FILE *) NULL);
8340 if (wand->debug != MagickFalse)
8341 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8342 read_info=CloneImageInfo(wand->image_info);
8343 SetImageInfoFile(read_info,file);
8344 images=PingImage(read_info,wand->exception);
8345 read_info=DestroyImageInfo(read_info);
8346 if (images == (Image *) NULL)
8347 return(MagickFalse);
8348 return(InsertImageInWand(wand,images));
8383WandExport MagickBooleanType MagickPolaroidImage(
MagickWand *wand,
8384 const DrawingWand *drawing_wand,
const char *caption,
const double angle,
8385 const PixelInterpolateMethod method)
8394 assert(wand->signature == MagickWandSignature);
8395 if (wand->debug != MagickFalse)
8396 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8397 if (wand->images == (Image *) NULL)
8398 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8399 draw_info=PeekDrawingWand(drawing_wand);
8400 if (draw_info == (DrawInfo *) NULL)
8401 return(MagickFalse);
8402 polaroid_image=PolaroidImage(wand->images,draw_info,caption,angle,method,
8404 if (polaroid_image == (Image *) NULL)
8405 return(MagickFalse);
8406 ReplaceImageInList(&wand->images,polaroid_image);
8441WandExport MagickBooleanType MagickPolynomialImage(
MagickWand *wand,
8442 const size_t number_terms,
const double *terms)
8448 assert(wand->signature == MagickWandSignature);
8449 if (wand->debug != MagickFalse)
8450 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8451 if (wand->images == (Image *) NULL)
8452 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8453 polynomial_image=PolynomialImage(wand->images,number_terms,terms,
8455 if (polynomial_image == (Image *) NULL)
8456 return(MagickFalse);
8457 ReplaceImageInList(&wand->images,polynomial_image);
8490WandExport MagickBooleanType MagickPosterizeImage(
MagickWand *wand,
8491 const size_t levels,
const DitherMethod dither)
8497 assert(wand->signature == MagickWandSignature);
8498 if (wand->debug != MagickFalse)
8499 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8500 if (wand->images == (Image *) NULL)
8501 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8502 status=PosterizeImage(wand->images,levels,dither,wand->exception);
8535 const PreviewType preview)
8541 assert(wand->signature == MagickWandSignature);
8542 if (wand->debug != MagickFalse)
8543 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8544 if (wand->images == (Image *) NULL)
8546 preview_image=PreviewImage(wand->images,preview,wand->exception);
8547 if (preview_image == (Image *) NULL)
8549 return(CloneMagickWandFromImages(wand,preview_image));
8588WandExport MagickBooleanType MagickPreviousImage(
MagickWand *wand)
8591 assert(wand->signature == MagickWandSignature);
8592 if (wand->debug != MagickFalse)
8593 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8594 if (wand->images == (Image *) NULL)
8595 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8596 if (wand->image_pending != MagickFalse)
8598 wand->image_pending=MagickFalse;
8601 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
8603 wand->image_pending=MagickTrue;
8604 wand->insert_before=MagickTrue;
8605 return(MagickFalse);
8607 wand->images=GetPreviousImageInList(wand->images);
8661WandExport MagickBooleanType MagickQuantizeImage(
MagickWand *wand,
8662 const size_t number_colors,
const ColorspaceType colorspace,
8663 const size_t treedepth,
const DitherMethod dither_method,
8664 const MagickBooleanType measure_error)
8673 assert(wand->signature == MagickWandSignature);
8674 if (wand->debug != MagickFalse)
8675 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8676 if (wand->images == (Image *) NULL)
8677 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8678 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
8679 quantize_info->number_colors=number_colors;
8680 quantize_info->dither_method=dither_method;
8681 quantize_info->tree_depth=treedepth;
8682 quantize_info->colorspace=colorspace;
8683 quantize_info->measure_error=measure_error;
8684 status=QuantizeImage(quantize_info,wand->images,wand->exception);
8685 quantize_info=DestroyQuantizeInfo(quantize_info);
8739WandExport MagickBooleanType MagickQuantizeImages(
MagickWand *wand,
8740 const size_t number_colors,
const ColorspaceType colorspace,
8741 const size_t treedepth,
const DitherMethod dither_method,
8742 const MagickBooleanType measure_error)
8751 assert(wand->signature == MagickWandSignature);
8752 if (wand->debug != MagickFalse)
8753 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8754 if (wand->images == (Image *) NULL)
8755 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8756 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
8757 quantize_info->number_colors=number_colors;
8758 quantize_info->dither_method=dither_method;
8759 quantize_info->tree_depth=treedepth;
8760 quantize_info->colorspace=colorspace;
8761 quantize_info->measure_error=measure_error;
8762 status=QuantizeImages(quantize_info,wand->images,wand->exception);
8763 quantize_info=DestroyQuantizeInfo(quantize_info);
8799WandExport MagickBooleanType MagickRangeThresholdImage(
MagickWand *wand,
8800 const double low_black,
const double low_white,
const double high_white,
8801 const double high_black)
8807 assert(wand->signature == MagickWandSignature);
8808 if (wand->debug != MagickFalse)
8809 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8810 if (wand->images == (Image *) NULL)
8811 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8812 status=RangeThresholdImage(wand->images,low_black,low_white,
8813 high_white,high_black,wand->exception);
8842WandExport MagickBooleanType MagickRotationalBlurImage(
MagickWand *wand,
8849 assert(wand->signature == MagickWandSignature);
8850 if (wand->debug != MagickFalse)
8851 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8852 if (wand->images == (Image *) NULL)
8853 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8854 blur_image=RotationalBlurImage(wand->images,angle,wand->exception);
8855 if (blur_image == (Image *) NULL)
8856 return(MagickFalse);
8857 ReplaceImageInList(&wand->images,blur_image);
8893WandExport MagickBooleanType MagickRaiseImage(
MagickWand *wand,
8894 const size_t width,
const size_t height,
const ssize_t x,
8895 const ssize_t y,
const MagickBooleanType raise)
8904 assert(wand->signature == MagickWandSignature);
8905 if (wand->debug != MagickFalse)
8906 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8907 if (wand->images == (Image *) NULL)
8908 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8909 raise_info.width=width;
8910 raise_info.height=height;
8913 status=RaiseImage(wand->images,&raise_info,raise,wand->exception);
8945WandExport MagickBooleanType MagickRandomThresholdImage(
MagickWand *wand,
8946 const double low,
const double high)
8949 assert(wand->signature == MagickWandSignature);
8950 if (wand->debug != MagickFalse)
8951 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8952 if (wand->images == (Image *) NULL)
8953 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
8954 return(RandomThresholdImage(wand->images,low,high,wand->exception));
8986WandExport MagickBooleanType MagickReadImage(
MagickWand *wand,
8987 const char *filename)
8996 assert(wand->signature == MagickWandSignature);
8997 if (wand->debug != MagickFalse)
8998 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
8999 read_info=CloneImageInfo(wand->image_info);
9000 if (filename != (
const char *) NULL)
9001 (void) CopyMagickString(read_info->filename,filename,MagickPathExtent);
9002 images=ReadImage(read_info,wand->exception);
9003 read_info=DestroyImageInfo(read_info);
9004 if (images == (Image *) NULL)
9005 return(MagickFalse);
9006 return(InsertImageInWand(wand,images));
9037WandExport MagickBooleanType MagickReadImageBlob(
MagickWand *wand,
9038 const void *blob,
const size_t length)
9044 assert(wand->signature == MagickWandSignature);
9045 if (wand->debug != MagickFalse)
9046 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9047 images=BlobToImage(wand->image_info,blob,length,wand->exception);
9048 if (images == (Image *) NULL)
9049 return(MagickFalse);
9050 return(InsertImageInWand(wand,images));
9078WandExport MagickBooleanType MagickReadImageFile(
MagickWand *wand,FILE *file)
9087 assert(wand->signature == MagickWandSignature);
9088 assert(file != (FILE *) NULL);
9089 if (wand->debug != MagickFalse)
9090 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9091 read_info=CloneImageInfo(wand->image_info);
9092 SetImageInfoFile(read_info,file);
9093 images=ReadImage(read_info,wand->exception);
9094 read_info=DestroyImageInfo(read_info);
9095 if (images == (Image *) NULL)
9096 return(MagickFalse);
9097 return(InsertImageInWand(wand,images));
9129WandExport MagickBooleanType MagickRemapImage(
MagickWand *wand,
9130 const MagickWand *remap_wand,
const DitherMethod dither_method)
9139 assert(wand->signature == MagickWandSignature);
9140 if (wand->debug != MagickFalse)
9141 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9142 if ((wand->images == (Image *) NULL) ||
9143 (remap_wand->images == (Image *) NULL))
9144 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9145 quantize_info=AcquireQuantizeInfo(wand->image_info);
9146 quantize_info->dither_method=dither_method;
9147 status=RemapImage(quantize_info,wand->images,remap_wand->images,
9149 quantize_info=DestroyQuantizeInfo(quantize_info);
9177WandExport MagickBooleanType MagickRemoveImage(
MagickWand *wand)
9180 assert(wand->signature == MagickWandSignature);
9181 if (wand->debug != MagickFalse)
9182 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9183 if (wand->images == (Image *) NULL)
9184 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9185 DeleteImageFromList(&wand->images);
9229WandExport MagickBooleanType MagickResampleImage(
MagickWand *wand,
9230 const double x_resolution,
const double y_resolution,
const FilterType filter)
9236 assert(wand->signature == MagickWandSignature);
9237 if (wand->debug != MagickFalse)
9238 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9239 if (wand->images == (Image *) NULL)
9240 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9241 resample_image=ResampleImage(wand->images,x_resolution,y_resolution,filter,
9243 if (resample_image == (Image *) NULL)
9244 return(MagickFalse);
9245 ReplaceImageInList(&wand->images,resample_image);
9274WandExport MagickBooleanType MagickResetImagePage(
MagickWand *wand,
9278 assert(wand->signature == MagickWandSignature);
9279 if (wand->debug != MagickFalse)
9280 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9281 if (wand->images == (Image *) NULL)
9282 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9283 if ((page == (
char *) NULL) || (*page ==
'\0'))
9285 (void) ParseAbsoluteGeometry(
"0x0+0+0",&wand->images->page);
9288 return(ResetImagePage(wand->images,page));
9331WandExport MagickBooleanType MagickResizeImage(
MagickWand *wand,
9332 const size_t columns,
const size_t rows,
const FilterType filter)
9338 assert(wand->signature == MagickWandSignature);
9339 if (wand->debug != MagickFalse)
9340 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9341 if (wand->images == (Image *) NULL)
9342 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9343 resize_image=ResizeImage(wand->images,columns,rows,filter,wand->exception);
9344 if (resize_image == (Image *) NULL)
9345 return(MagickFalse);
9346 ReplaceImageInList(&wand->images,resize_image);
9378WandExport MagickBooleanType MagickRollImage(
MagickWand *wand,
9379 const ssize_t x,
const ssize_t y)
9385 assert(wand->signature == MagickWandSignature);
9386 if (wand->debug != MagickFalse)
9387 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9388 if (wand->images == (Image *) NULL)
9389 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9390 roll_image=RollImage(wand->images,x,y,wand->exception);
9391 if (roll_image == (Image *) NULL)
9392 return(MagickFalse);
9393 ReplaceImageInList(&wand->images,roll_image);
9427WandExport MagickBooleanType MagickRotateImage(
MagickWand *wand,
9428 const PixelWand *background,
const double degrees)
9434 assert(wand->signature == MagickWandSignature);
9435 if (wand->debug != MagickFalse)
9436 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9437 if (wand->images == (Image *) NULL)
9438 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9439 PixelGetQuantumPacket(background,&wand->images->background_color);
9440 rotate_image=RotateImage(wand->images,degrees,wand->exception);
9441 if (rotate_image == (Image *) NULL)
9442 return(MagickFalse);
9443 ReplaceImageInList(&wand->images,rotate_image);
9477WandExport MagickBooleanType MagickSampleImage(
MagickWand *wand,
9478 const size_t columns,
const size_t rows)
9484 assert(wand->signature == MagickWandSignature);
9485 if (wand->debug != MagickFalse)
9486 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9487 if (wand->images == (Image *) NULL)
9488 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9489 sample_image=SampleImage(wand->images,columns,rows,wand->exception);
9490 if (sample_image == (Image *) NULL)
9491 return(MagickFalse);
9492 ReplaceImageInList(&wand->images,sample_image);
9524WandExport MagickBooleanType MagickScaleImage(
MagickWand *wand,
9525 const size_t columns,
const size_t rows)
9531 assert(wand->signature == MagickWandSignature);
9532 if (wand->debug != MagickFalse)
9533 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9534 if (wand->images == (Image *) NULL)
9535 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9536 scale_image=ScaleImage(wand->images,columns,rows,wand->exception);
9537 if (scale_image == (Image *) NULL)
9538 return(MagickFalse);
9539 ReplaceImageInList(&wand->images,scale_image);
9582MagickExport MagickBooleanType MagickSegmentImage(
MagickWand *wand,
9583 const ColorspaceType colorspace,
const MagickBooleanType verbose,
9584 const double cluster_threshold,
const double smooth_threshold)
9590 assert(wand->signature == MagickWandSignature);
9591 if (wand->debug != MagickFalse)
9592 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9593 if (wand->images == (Image *) NULL)
9594 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9595 status=SegmentImage(wand->images,colorspace,verbose,cluster_threshold,
9596 smooth_threshold,wand->exception);
9633WandExport MagickBooleanType MagickSelectiveBlurImage(
MagickWand *wand,
9634 const double radius,
const double sigma,
const double threshold)
9640 assert(wand->signature == MagickWandSignature);
9641 if (wand->debug != MagickFalse)
9642 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9643 if (wand->images == (Image *) NULL)
9644 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9645 blur_image=SelectiveBlurImage(wand->images,radius,sigma,threshold,
9647 if (blur_image == (Image *) NULL)
9648 return(MagickFalse);
9649 ReplaceImageInList(&wand->images,blur_image);
9680WandExport MagickBooleanType MagickSeparateImage(
MagickWand *wand,
9681 const ChannelType channel)
9687 assert(wand->signature == MagickWandSignature);
9688 if (wand->debug != MagickFalse)
9689 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9690 if (wand->images == (Image *) NULL)
9691 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9692 separate_image=SeparateImage(wand->images,channel,wand->exception);
9693 if (separate_image == (Image *) NULL)
9694 return(MagickFalse);
9695 ReplaceImageInList(&wand->images,separate_image);
9727WandExport MagickBooleanType MagickSepiaToneImage(
MagickWand *wand,
9728 const double threshold)
9734 assert(wand->signature == MagickWandSignature);
9735 if (wand->debug != MagickFalse)
9736 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9737 if (wand->images == (Image *) NULL)
9738 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9739 sepia_image=SepiaToneImage(wand->images,threshold,wand->exception);
9740 if (sepia_image == (Image *) NULL)
9741 return(MagickFalse);
9742 ReplaceImageInList(&wand->images,sepia_image);
9773WandExport MagickBooleanType MagickSetImage(
MagickWand *wand,
9780 assert(wand->signature == MagickWandSignature);
9781 if (wand->debug != MagickFalse)
9782 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9784 assert(set_wand->signature == MagickWandSignature);
9785 if (wand->debug != MagickFalse)
9786 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",set_wand->name);
9787 if (set_wand->images == (Image *) NULL)
9788 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9789 images=CloneImageList(set_wand->images,wand->exception);
9790 if (images == (Image *) NULL)
9791 return(MagickFalse);
9792 ReplaceImageInList(&wand->images,images);
9823WandExport MagickBooleanType MagickSetImageAlphaChannel(
MagickWand *wand,
9824 const AlphaChannelOption alpha_type)
9827 assert(wand->signature == MagickWandSignature);
9828 if (wand->debug != MagickFalse)
9829 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9830 if (wand->images == (Image *) NULL)
9831 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9832 return(SetImageAlphaChannel(wand->images,alpha_type,wand->exception));
9860WandExport MagickBooleanType MagickSetImageBackgroundColor(
MagickWand *wand,
9864 assert(wand->signature == MagickWandSignature);
9865 if (wand->debug != MagickFalse)
9866 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9867 if (wand->images == (Image *) NULL)
9868 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9869 PixelGetQuantumPacket(background,&wand->images->background_color);
9902WandExport MagickBooleanType MagickSetImageBluePrimary(
MagickWand *wand,
9903 const double x,
const double y,
const double z)
9906 assert(wand->signature == MagickWandSignature);
9907 if (wand->debug != MagickFalse)
9908 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9909 if (wand->images == (Image *) NULL)
9910 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9911 wand->images->chromaticity.blue_primary.x=x;
9912 wand->images->chromaticity.blue_primary.y=y;
9913 wand->images->chromaticity.blue_primary.z=z;
9942WandExport MagickBooleanType MagickSetImageBorderColor(
MagickWand *wand,
9946 assert(wand->signature == MagickWandSignature);
9947 if (wand->debug != MagickFalse)
9948 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9949 if (wand->images == (Image *) NULL)
9950 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
9951 PixelGetQuantumPacket(border,&wand->images->border_color);
9980WandExport ChannelType MagickSetImageChannelMask(
MagickWand *wand,
9981 const ChannelType channel_mask)
9984 assert(wand->signature == MagickWandSignature);
9985 if (wand->debug != MagickFalse)
9986 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
9987 return(SetImageChannelMask(wand->images,channel_mask));
10017WandExport MagickBooleanType MagickSetImageMask(
MagickWand *wand,
10018 const PixelMask type,
const MagickWand *clip_mask)
10021 assert(wand->signature == MagickWandSignature);
10022 if (wand->debug != MagickFalse)
10023 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10025 assert(clip_mask->signature == MagickWandSignature);
10026 if (clip_mask->debug != MagickFalse)
10027 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",clip_mask->name);
10028 if (clip_mask->images == (Image *) NULL)
10029 ThrowWandException(WandError,
"ContainsNoImages",clip_mask->name);
10030 return(SetImageMask(wand->images,type,clip_mask->images,wand->exception));
10058WandExport MagickBooleanType MagickSetImageColor(
MagickWand *wand,
10065 assert(wand->signature == MagickWandSignature);
10066 if (wand->debug != MagickFalse)
10067 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10068 PixelGetMagickColor(color,&pixel);
10069 return(SetImageColor(wand->images,&pixel,wand->exception));
10100WandExport MagickBooleanType MagickSetImageColormapColor(
MagickWand *wand,
10101 const size_t index,
const PixelWand *color)
10104 assert(wand->signature == MagickWandSignature);
10105 if (wand->debug != MagickFalse)
10106 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10107 if (wand->images == (Image *) NULL)
10108 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10109 if ((wand->images->colormap == (PixelInfo *) NULL) ||
10110 (index >= wand->images->colors))
10111 ThrowWandException(WandError,
"InvalidColormapIndex",wand->name);
10112 PixelGetQuantumPacket(color,wand->images->colormap+index);
10113 return(SyncImage(wand->images,wand->exception));
10146WandExport MagickBooleanType MagickSetImageColorspace(
MagickWand *wand,
10147 const ColorspaceType colorspace)
10150 assert(wand->signature == MagickWandSignature);
10151 if (wand->debug != MagickFalse)
10152 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10153 if (wand->images == (Image *) NULL)
10154 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10155 return(SetImageColorspace(wand->images,colorspace,wand->exception));
10185WandExport MagickBooleanType MagickSetImageCompose(
MagickWand *wand,
10186 const CompositeOperator compose)
10189 assert(wand->signature == MagickWandSignature);
10190 if (wand->debug != MagickFalse)
10191 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10192 if (wand->images == (Image *) NULL)
10193 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10194 wand->images->compose=compose;
10195 return(MagickTrue);
10223WandExport MagickBooleanType MagickSetImageCompression(
MagickWand *wand,
10224 const CompressionType compression)
10227 assert(wand->signature == MagickWandSignature);
10228 if (wand->debug != MagickFalse)
10229 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10230 if (wand->images == (Image *) NULL)
10231 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10232 wand->images->compression=compression;
10233 return(MagickTrue);
10261WandExport MagickBooleanType MagickSetImageCompressionQuality(
MagickWand *wand,
10262 const size_t quality)
10265 assert(wand->signature == MagickWandSignature);
10266 if (wand->debug != MagickFalse)
10267 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10268 if (wand->images == (Image *) NULL)
10269 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10270 wand->images->quality=quality;
10271 return(MagickTrue);
10299WandExport MagickBooleanType MagickSetImageDelay(
MagickWand *wand,
10300 const size_t delay)
10303 assert(wand->signature == MagickWandSignature);
10304 if (wand->debug != MagickFalse)
10305 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10306 if (wand->images == (Image *) NULL)
10307 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10308 wand->images->delay=delay;
10309 return(MagickTrue);
10337WandExport MagickBooleanType MagickSetImageDepth(
MagickWand *wand,
10338 const size_t depth)
10341 assert(wand->signature == MagickWandSignature);
10342 if (wand->debug != MagickFalse)
10343 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10344 if (wand->images == (Image *) NULL)
10345 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10346 return(SetImageDepth(wand->images,depth,wand->exception));
10374WandExport MagickBooleanType MagickSetImageDispose(
MagickWand *wand,
10375 const DisposeType dispose)
10378 assert(wand->signature == MagickWandSignature);
10379 if (wand->debug != MagickFalse)
10380 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10381 if (wand->images == (Image *) NULL)
10382 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10383 wand->images->dispose=dispose;
10384 return(MagickTrue);
10412WandExport MagickBooleanType MagickSetImageEndian(
MagickWand *wand,
10413 const EndianType endian)
10416 assert(wand->signature == MagickWandSignature);
10417 if (wand->debug != MagickFalse)
10418 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10419 if (wand->images == (Image *) NULL)
10420 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10421 wand->images->endian=endian;
10422 return(MagickTrue);
10452WandExport MagickBooleanType MagickSetImageExtent(
MagickWand *wand,
10453 const size_t columns,
const size_t rows)
10456 assert(wand->signature == MagickWandSignature);
10457 if (wand->debug != MagickFalse)
10458 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10459 if (wand->images == (Image *) NULL)
10460 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10461 return(SetImageExtent(wand->images,columns,rows,wand->exception));
10490WandExport MagickBooleanType MagickSetImageFilename(
MagickWand *wand,
10491 const char *filename)
10494 assert(wand->signature == MagickWandSignature);
10495 if (wand->debug != MagickFalse)
10496 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10497 if (wand->images == (Image *) NULL)
10498 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10499 if (filename == (
const char *) NULL)
10500 return(MagickFalse);
10501 (void) CopyMagickString(wand->images->filename,filename,MagickPathExtent);
10502 return(MagickTrue);
10534WandExport MagickBooleanType MagickSetImageFilter(
MagickWand *wand,
10535 const FilterType filter)
10538 assert(wand->signature == MagickWandSignature);
10539 if (wand->debug != MagickFalse)
10540 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10541 if (wand->images == (Image *) NULL)
10542 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10543 wand->images->filter=filter;
10544 return(MagickTrue);
10573WandExport MagickBooleanType MagickSetImageFormat(
MagickWand *wand,
10574 const char *format)
10580 assert(wand->signature == MagickWandSignature);
10581 if (wand->debug != MagickFalse)
10582 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10583 if (wand->images == (Image *) NULL)
10584 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10585 if ((format == (
char *) NULL) || (*format ==
'\0'))
10587 *wand->images->magick=
'\0';
10588 return(MagickTrue);
10590 magick_info=GetMagickInfo(format,wand->exception);
10591 if (magick_info == (
const MagickInfo *) NULL)
10592 return(MagickFalse);
10593 ClearMagickException(wand->exception);
10594 (void) CopyMagickString(wand->images->magick,format,MagickPathExtent);
10595 LocaleUpper(wand->images->magick);
10596 return(MagickTrue);
10624WandExport MagickBooleanType MagickSetImageFuzz(
MagickWand *wand,
10628 assert(wand->signature == MagickWandSignature);
10629 if (wand->debug != MagickFalse)
10630 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10631 if (wand->images == (Image *) NULL)
10632 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10633 wand->images->fuzz=fuzz;
10634 return(MagickTrue);
10662WandExport MagickBooleanType MagickSetImageGamma(
MagickWand *wand,
10663 const double gamma)
10666 assert(wand->signature == MagickWandSignature);
10667 if (wand->debug != MagickFalse)
10668 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10669 if (wand->images == (Image *) NULL)
10670 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10671 wand->images->gamma=gamma;
10672 return(MagickTrue);
10703WandExport MagickBooleanType MagickSetImageGravity(
MagickWand *wand,
10704 const GravityType gravity)
10707 assert(wand->signature == MagickWandSignature);
10708 if (wand->debug != MagickFalse)
10709 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10710 if (wand->images == (Image *) NULL)
10711 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10712 wand->images->gravity=gravity;
10713 return(MagickTrue);
10746WandExport MagickBooleanType MagickSetImageGreenPrimary(
MagickWand *wand,
10747 const double x,
const double y,
const double z)
10750 assert(wand->signature == MagickWandSignature);
10751 if (wand->debug != MagickFalse)
10752 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10753 if (wand->images == (Image *) NULL)
10754 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10755 wand->images->chromaticity.green_primary.x=x;
10756 wand->images->chromaticity.green_primary.y=y;
10757 wand->images->chromaticity.green_primary.z=z;
10758 return(MagickTrue);
10787WandExport MagickBooleanType MagickSetImageInterlaceScheme(
MagickWand *wand,
10788 const InterlaceType interlace)
10791 assert(wand->signature == MagickWandSignature);
10792 if (wand->debug != MagickFalse)
10793 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10794 if (wand->images == (Image *) NULL)
10795 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10796 wand->images->interlace=interlace;
10797 return(MagickTrue);
10827WandExport MagickBooleanType MagickSetImagePixelInterpolateMethod(
10828 MagickWand *wand,
const PixelInterpolateMethod method)
10830 return(MagickSetImageInterpolateMethod(wand,method));
10833WandExport MagickBooleanType MagickSetImageInterpolateMethod(
10834 MagickWand *wand,
const PixelInterpolateMethod method)
10837 assert(wand->signature == MagickWandSignature);
10838 if (wand->debug != MagickFalse)
10839 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10840 if (wand->images == (Image *) NULL)
10841 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10842 wand->images->interpolate=method;
10843 return(MagickTrue);
10871WandExport MagickBooleanType MagickSetImageIterations(
MagickWand *wand,
10872 const size_t iterations)
10875 assert(wand->signature == MagickWandSignature);
10876 if (wand->debug != MagickFalse)
10877 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10878 if (wand->images == (Image *) NULL)
10879 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10880 wand->images->iterations=iterations;
10881 return(MagickTrue);
10910WandExport MagickBooleanType MagickSetImageMatte(
MagickWand *wand,
10911 const MagickBooleanType matte)
10914 assert(wand->signature == MagickWandSignature);
10915 if (wand->debug != MagickFalse)
10916 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
10917 if (wand->images == (Image *) NULL)
10918 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
10919 if (matte == MagickFalse)
10920 wand->images->alpha_trait=UndefinedPixelTrait;
10923 if (wand->images->alpha_trait == UndefinedPixelTrait)
10924 (void) SetImageAlpha(wand->images,OpaqueAlpha,wand->exception);
10925 wand->images->alpha_trait=BlendPixelTrait;
10927 return(MagickTrue);
10955WandExport MagickBooleanType MagickSetImageMatteColor(
MagickWand *wand,
10959 assert(wand->signature == MagickWandSignature);
10960 if (wand->debug != MagickFalse)
10961 (void) LogMagickEvent(WandEvent, GetMagickModule(),
"%s", wand->name);
10962 if (wand->images == (Image *)NULL)
10963 ThrowWandException(WandError,
"ContainsNoImages", wand->name);
10964 PixelGetQuantumPacket(alpha,&wand->images->matte_color);
10965 return(MagickTrue);
10994WandExport MagickBooleanType MagickSetImageAlpha(
MagickWand *wand,
10995 const double alpha)
11001 assert(wand->signature == MagickWandSignature);
11002 if (wand->debug != MagickFalse)
11003 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11004 if (wand->images == (Image *) NULL)
11005 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11006 status=SetImageAlpha(wand->images,ClampToQuantum((
double) QuantumRange*alpha),
11036WandExport MagickBooleanType MagickSetImageOrientation(
MagickWand *wand,
11037 const OrientationType orientation)
11040 assert(wand->signature == MagickWandSignature);
11041 if (wand->debug != MagickFalse)
11042 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11043 if (wand->images == (Image *) NULL)
11044 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11045 wand->images->orientation=orientation;
11046 return(MagickTrue);
11079WandExport MagickBooleanType MagickSetImagePage(
MagickWand *wand,
11080 const size_t width,
const size_t height,
const ssize_t x,
11084 assert(wand->signature == MagickWandSignature);
11085 if (wand->debug != MagickFalse)
11086 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11087 if (wand->images == (Image *) NULL)
11088 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11089 wand->images->page.width=width;
11090 wand->images->page.height=height;
11091 wand->images->page.x=x;
11092 wand->images->page.y=y;
11093 return(MagickTrue);
11123WandExport MagickBooleanType MagickSetImagePixelColor(
MagickWand *wand,
11124 const ssize_t x,
const ssize_t y,
const PixelWand *color)
11133 assert(wand->signature == MagickWandSignature);
11134 if (wand->debug != MagickFalse)
11135 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11136 if (wand->images == (Image *) NULL)
11137 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11138 image_view=AcquireAuthenticCacheView(wand->images,wand->exception);
11139 q=GetCacheViewAuthenticPixels(image_view,x,y,1,1,wand->exception);
11140 if (q == (Quantum *) NULL)
11142 image_view=DestroyCacheView(image_view);
11143 return(MagickFalse);
11145 PixelGetQuantumPixel(wand->images,color,q);
11146 image_view=DestroyCacheView(image_view);
11147 return(MagickTrue);
11187WandExport MagickProgressMonitor MagickSetImageProgressMonitor(
MagickWand *wand,
11188 const MagickProgressMonitor progress_monitor,
void *client_data)
11190 MagickProgressMonitor
11194 assert(wand->signature == MagickWandSignature);
11195 if (wand->debug != MagickFalse)
11196 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11197 if (wand->images == (Image *) NULL)
11199 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11200 "ContainsNoImages",
"`%s'",wand->name);
11201 return((MagickProgressMonitor) NULL);
11203 previous_monitor=SetImageProgressMonitor(wand->images,
11204 progress_monitor,client_data);
11205 return(previous_monitor);
11237WandExport MagickBooleanType MagickSetImageRedPrimary(
MagickWand *wand,
11238 const double x,
const double y,
const double z)
11241 assert(wand->signature == MagickWandSignature);
11242 if (wand->debug != MagickFalse)
11243 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11244 if (wand->images == (Image *) NULL)
11245 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11246 wand->images->chromaticity.red_primary.x=x;
11247 wand->images->chromaticity.red_primary.y=y;
11248 wand->images->chromaticity.red_primary.z=z;
11249 return(MagickTrue);
11278WandExport MagickBooleanType MagickSetImageRenderingIntent(
MagickWand *wand,
11279 const RenderingIntent rendering_intent)
11282 assert(wand->signature == MagickWandSignature);
11283 if (wand->debug != MagickFalse)
11284 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11285 if (wand->images == (Image *) NULL)
11286 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11287 wand->images->rendering_intent=rendering_intent;
11288 return(MagickTrue);
11318WandExport MagickBooleanType MagickSetImageResolution(
MagickWand *wand,
11319 const double x_resolution,
const double y_resolution)
11322 assert(wand->signature == MagickWandSignature);
11323 if (wand->debug != MagickFalse)
11324 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11325 if (wand->images == (Image *) NULL)
11326 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11327 wand->images->resolution.x=x_resolution;
11328 wand->images->resolution.y=y_resolution;
11329 return(MagickTrue);
11357WandExport MagickBooleanType MagickSetImageScene(
MagickWand *wand,
11358 const size_t scene)
11361 assert(wand->signature == MagickWandSignature);
11362 if (wand->debug != MagickFalse)
11363 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11364 if (wand->images == (Image *) NULL)
11365 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11366 wand->images->scene=scene;
11367 return(MagickTrue);
11395WandExport MagickBooleanType MagickSetImageTicksPerSecond(
MagickWand *wand,
11396 const ssize_t ticks_per_second)
11399 assert(wand->signature == MagickWandSignature);
11400 if (wand->debug != MagickFalse)
11401 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11402 if (wand->images == (Image *) NULL)
11403 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11404 wand->images->ticks_per_second=ticks_per_second;
11405 return(MagickTrue);
11436WandExport MagickBooleanType MagickSetImageType(
MagickWand *wand,
11437 const ImageType image_type)
11440 assert(wand->signature == MagickWandSignature);
11441 if (wand->debug != MagickFalse)
11442 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11443 if (wand->images == (Image *) NULL)
11444 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11445 return(SetImageType(wand->images,image_type,wand->exception));
11474WandExport MagickBooleanType MagickSetImageUnits(
MagickWand *wand,
11475 const ResolutionType units)
11478 assert(wand->signature == MagickWandSignature);
11479 if (wand->debug != MagickFalse)
11480 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11481 if (wand->images == (Image *) NULL)
11482 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11483 wand->images->units=units;
11484 return(MagickTrue);
11514WandExport VirtualPixelMethod MagickSetImageVirtualPixelMethod(
MagickWand *wand,
11515 const VirtualPixelMethod method)
11518 assert(wand->signature == MagickWandSignature);
11519 if (wand->debug != MagickFalse)
11520 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11521 if (wand->images == (Image *) NULL)
11522 return(UndefinedVirtualPixelMethod);
11523 return(SetImageVirtualPixelMethod(wand->images,method,wand->exception));
11555WandExport MagickBooleanType MagickSetImageWhitePoint(
MagickWand *wand,
11556 const double x,
const double y,
const double z)
11559 assert(wand->signature == MagickWandSignature);
11560 if (wand->debug != MagickFalse)
11561 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11562 if (wand->images == (Image *) NULL)
11563 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11564 wand->images->chromaticity.white_point.x=x;
11565 wand->images->chromaticity.white_point.y=y;
11566 wand->images->chromaticity.white_point.z=z;
11567 return(MagickTrue);
11601WandExport MagickBooleanType MagickShadeImage(
MagickWand *wand,
11602 const MagickBooleanType gray,
const double azimuth,
const double elevation)
11608 assert(wand->signature == MagickWandSignature);
11609 if (wand->debug != MagickFalse)
11610 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11611 if (wand->images == (Image *) NULL)
11612 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11613 shade_image=ShadeImage(wand->images,gray,azimuth,elevation,wand->exception);
11614 if (shade_image == (Image *) NULL)
11615 return(MagickFalse);
11616 ReplaceImageInList(&wand->images,shade_image);
11617 return(MagickTrue);
11651WandExport MagickBooleanType MagickShadowImage(
MagickWand *wand,
11652 const double alpha,
const double sigma,
const ssize_t x,
const ssize_t y)
11658 assert(wand->signature == MagickWandSignature);
11659 if (wand->debug != MagickFalse)
11660 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11661 if (wand->images == (Image *) NULL)
11662 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11663 shadow_image=ShadowImage(wand->images,alpha,sigma,x,y,wand->exception);
11664 if (shadow_image == (Image *) NULL)
11665 return(MagickFalse);
11666 ReplaceImageInList(&wand->images,shadow_image);
11667 return(MagickTrue);
11701WandExport MagickBooleanType MagickSharpenImage(
MagickWand *wand,
11702 const double radius,
const double sigma)
11708 assert(wand->signature == MagickWandSignature);
11709 if (wand->debug != MagickFalse)
11710 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11711 if (wand->images == (Image *) NULL)
11712 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11713 sharp_image=SharpenImage(wand->images,radius,sigma,wand->exception);
11714 if (sharp_image == (Image *) NULL)
11715 return(MagickFalse);
11716 ReplaceImageInList(&wand->images,sharp_image);
11717 return(MagickTrue);
11750WandExport MagickBooleanType MagickShaveImage(
MagickWand *wand,
11751 const size_t columns,
const size_t rows)
11760 assert(wand->signature == MagickWandSignature);
11761 if (wand->debug != MagickFalse)
11762 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11763 if (wand->images == (Image *) NULL)
11764 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11765 shave_info.width=columns;
11766 shave_info.height=rows;
11769 shave_image=ShaveImage(wand->images,&shave_info,wand->exception);
11770 if (shave_image == (Image *) NULL)
11771 return(MagickFalse);
11772 ReplaceImageInList(&wand->images,shave_image);
11773 return(MagickTrue);
11811WandExport MagickBooleanType MagickShearImage(
MagickWand *wand,
11812 const PixelWand *background,
const double x_shear,
const double y_shear)
11818 assert(wand->signature == MagickWandSignature);
11819 if (wand->debug != MagickFalse)
11820 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11821 if (wand->images == (Image *) NULL)
11822 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11823 PixelGetQuantumPacket(background,&wand->images->background_color);
11824 shear_image=ShearImage(wand->images,x_shear,y_shear,wand->exception);
11825 if (shear_image == (Image *) NULL)
11826 return(MagickFalse);
11827 ReplaceImageInList(&wand->images,shear_image);
11828 return(MagickTrue);
11868WandExport MagickBooleanType MagickSigmoidalContrastImage(
11869 MagickWand *wand,
const MagickBooleanType sharpen,
const double alpha,
11876 assert(wand->signature == MagickWandSignature);
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=SigmoidalContrastImage(wand->images,sharpen,alpha,beta,
11925 const MagickWand *reference,
const MetricType metric,
11926 const double similarity_threshold,RectangleInfo *offset,
double *similarity)
11932 assert(wand->signature == MagickWandSignature);
11933 if (wand->debug != MagickFalse)
11934 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11935 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
11937 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11938 "ContainsNoImages",
"`%s'",wand->name);
11941 similarity_image=SimilarityImage(wand->images,reference->images,metric,
11942 similarity_threshold,offset,similarity,wand->exception);
11943 if (similarity_image == (Image *) NULL)
11945 return(CloneMagickWandFromImages(wand,similarity_image));
11982WandExport MagickBooleanType MagickSketchImage(
MagickWand *wand,
11983 const double radius,
const double sigma,
const double angle)
11989 assert(wand->signature == MagickWandSignature);
11990 if (wand->debug != MagickFalse)
11991 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
11992 if (wand->images == (Image *) NULL)
11993 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
11994 sketch_image=SketchImage(wand->images,radius,sigma,angle,wand->exception);
11995 if (sketch_image == (Image *) NULL)
11996 return(MagickFalse);
11997 ReplaceImageInList(&wand->images,sketch_image);
11998 return(MagickTrue);
12032 const MagickBooleanType stack,
const ssize_t offset)
12038 assert(wand->signature == MagickWandSignature);
12039 if (wand->debug != MagickFalse)
12040 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12041 if (wand->images == (Image *) NULL)
12043 smush_image=SmushImages(wand->images,stack,offset,wand->exception);
12044 if (smush_image == (Image *) NULL)
12046 return(CloneMagickWandFromImages(wand,smush_image));
12077WandExport MagickBooleanType MagickSolarizeImage(
MagickWand *wand,
12078 const double threshold)
12084 assert(wand->signature == MagickWandSignature);
12085 if (wand->debug != MagickFalse)
12086 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12087 if (wand->images == (Image *) NULL)
12088 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12089 status=SolarizeImage(wand->images,threshold,wand->exception);
12144WandExport MagickBooleanType MagickSparseColorImage(
MagickWand *wand,
12145 const SparseColorMethod method,
const size_t number_arguments,
12146 const double *arguments)
12152 assert(wand->signature == MagickWandSignature);
12153 if (wand->debug != MagickFalse)
12154 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12155 if (wand->images == (Image *) NULL)
12156 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12157 sparse_image=SparseColorImage(wand->images,method,number_arguments,arguments,
12159 if (sparse_image == (Image *) NULL)
12160 return(MagickFalse);
12161 ReplaceImageInList(&wand->images,sparse_image);
12162 return(MagickTrue);
12197WandExport MagickBooleanType MagickSpliceImage(
MagickWand *wand,
12198 const size_t width,
const size_t height,
const ssize_t x,
12208 assert(wand->signature == MagickWandSignature);
12209 if (wand->debug != MagickFalse)
12210 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12211 if (wand->images == (Image *) NULL)
12212 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12213 splice.width=width;
12214 splice.height=height;
12217 splice_image=SpliceImage(wand->images,&splice,wand->exception);
12218 if (splice_image == (Image *) NULL)
12219 return(MagickFalse);
12220 ReplaceImageInList(&wand->images,splice_image);
12221 return(MagickTrue);
12252WandExport MagickBooleanType MagickSpreadImage(
MagickWand *wand,
12253 const PixelInterpolateMethod method,
const double radius)
12259 assert(wand->signature == MagickWandSignature);
12260 if (wand->debug != MagickFalse)
12261 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12262 if (wand->images == (Image *) NULL)
12263 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12264 spread_image=SpreadImage(wand->images,method,radius,wand->exception);
12265 if (spread_image == (Image *) NULL)
12266 return(MagickFalse);
12267 ReplaceImageInList(&wand->images,spread_image);
12268 return(MagickTrue);
12301WandExport MagickBooleanType MagickStatisticImage(
MagickWand *wand,
12302 const StatisticType type,
const size_t width,
const size_t height)
12308 assert(wand->signature == MagickWandSignature);
12309 if (wand->debug != MagickFalse)
12310 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12311 if (wand->images == (Image *) NULL)
12312 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12313 statistic_image=StatisticImage(wand->images,type,width,height,
12315 if (statistic_image == (Image *) NULL)
12316 return(MagickFalse);
12317 ReplaceImageInList(&wand->images,statistic_image);
12318 return(MagickTrue);
12352 const MagickWand *watermark_wand,
const ssize_t offset)
12358 assert(wand->signature == MagickWandSignature);
12359 if (wand->debug != MagickFalse)
12360 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12361 if ((wand->images == (Image *) NULL) ||
12362 (watermark_wand->images == (Image *) NULL))
12364 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
12365 "ContainsNoImages",
"`%s'",wand->name);
12368 wand->images->offset=offset;
12369 stegano_image=SteganoImage(wand->images,watermark_wand->images,
12371 if (stegano_image == (Image *) NULL)
12373 return(CloneMagickWandFromImages(wand,stegano_image));
12409 assert(wand->signature == MagickWandSignature);
12410 if (wand->debug != MagickFalse)
12411 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12412 if ((wand->images == (Image *) NULL) ||
12413 (offset_wand->images == (Image *) NULL))
12415 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
12416 "ContainsNoImages",
"`%s'",wand->name);
12419 stereo_image=StereoImage(wand->images,offset_wand->images,wand->exception);
12420 if (stereo_image == (Image *) NULL)
12422 return(CloneMagickWandFromImages(wand,stereo_image));
12447WandExport MagickBooleanType MagickStripImage(
MagickWand *wand)
12450 assert(wand->signature == MagickWandSignature);
12451 if (wand->debug != MagickFalse)
12452 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12453 if (wand->images == (Image *) NULL)
12454 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12455 return(StripImage(wand->images,wand->exception));
12487WandExport MagickBooleanType MagickSwirlImage(
MagickWand *wand,
12488 const double degrees,
const PixelInterpolateMethod method)
12494 assert(wand->signature == MagickWandSignature);
12495 if (wand->debug != MagickFalse)
12496 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12497 if (wand->images == (Image *) NULL)
12498 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12499 swirl_image=SwirlImage(wand->images,degrees,method,wand->exception);
12500 if (swirl_image == (Image *) NULL)
12501 return(MagickFalse);
12502 ReplaceImageInList(&wand->images,swirl_image);
12503 return(MagickTrue);
12542 assert(wand->signature == MagickWandSignature);
12543 if (wand->debug != MagickFalse)
12544 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12545 if ((wand->images == (Image *) NULL) ||
12546 (texture_wand->images == (Image *) NULL))
12548 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
12549 "ContainsNoImages",
"`%s'",wand->name);
12552 texture_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12553 if (texture_image == (Image *) NULL)
12555 status=TextureImage(texture_image,texture_wand->images,wand->exception);
12556 if (status == MagickFalse)
12558 texture_image=DestroyImage(texture_image);
12561 return(CloneMagickWandFromImages(wand,texture_image));
12595WandExport MagickBooleanType MagickThresholdImage(
MagickWand *wand,
12596 const double threshold)
12601 status=MagickThresholdImageChannel(wand,DefaultChannels,threshold);
12605WandExport MagickBooleanType MagickThresholdImageChannel(
MagickWand *wand,
12606 const ChannelType channel,
const double threshold)
12615 assert(wand->signature == MagickWandSignature);
12616 if (wand->debug != MagickFalse)
12617 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12618 if (wand->images == (Image *) NULL)
12619 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12620 channel_mask=SetImageChannelMask(wand->images,channel);
12621 status=BilevelImage(wand->images,threshold,wand->exception);
12622 (void) SetImageChannelMask(wand->images,channel_mask);
12655WandExport MagickBooleanType MagickThumbnailImage(
MagickWand *wand,
12656 const size_t columns,
const size_t rows)
12662 assert(wand->signature == MagickWandSignature);
12663 if (wand->debug != MagickFalse)
12664 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12665 if (wand->images == (Image *) NULL)
12666 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12667 thumbnail_image=ThumbnailImage(wand->images,columns,rows,wand->exception);
12668 if (thumbnail_image == (Image *) NULL)
12669 return(MagickFalse);
12670 ReplaceImageInList(&wand->images,thumbnail_image);
12671 return(MagickTrue);
12704WandExport MagickBooleanType MagickTintImage(
MagickWand *wand,
12708 percent_blend[MagickPathExtent];
12717 assert(wand->signature == MagickWandSignature);
12718 if (wand->debug != MagickFalse)
12719 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12720 if (wand->images == (Image *) NULL)
12721 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12722 if (wand->images->colorspace != CMYKColorspace)
12723 (void) FormatLocaleString(percent_blend,MagickPathExtent,
12724 "%g,%g,%g,%g",(
double) (100.0*QuantumScale*
12725 (
double) PixelGetRedQuantum(blend)),(
double) (100.0*QuantumScale*
12726 (
double) PixelGetGreenQuantum(blend)),(
double) (100.0*QuantumScale*
12727 (
double) PixelGetBlueQuantum(blend)),(
double) (100.0*QuantumScale*
12728 (
double) PixelGetAlphaQuantum(blend)));
12730 (
void) FormatLocaleString(percent_blend,MagickPathExtent,
12731 "%g,%g,%g,%g,%g",(
double) (100.0*QuantumScale*
12732 (
double) PixelGetCyanQuantum(blend)),(
double) (100.0*QuantumScale*
12733 (
double) PixelGetMagentaQuantum(blend)),(
double) (100.0*QuantumScale*
12734 (
double) PixelGetYellowQuantum(blend)),(
double) (100.0*QuantumScale*
12735 (
double) PixelGetBlackQuantum(blend)),(
double) (100.0*QuantumScale*
12736 (
double) PixelGetAlphaQuantum(blend)));
12737 target=PixelGetPixel(tint);
12738 tint_image=TintImage(wand->images,percent_blend,&target,wand->exception);
12739 if (tint_image == (Image *) NULL)
12740 return(MagickFalse);
12741 ReplaceImageInList(&wand->images,tint_image);
12742 return(MagickTrue);
12777WandExport MagickBooleanType MagickTransformImageColorspace(
MagickWand *wand,
12778 const ColorspaceType colorspace)
12781 assert(wand->signature == MagickWandSignature);
12782 if (wand->debug != MagickFalse)
12783 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12784 if (wand->images == (Image *) NULL)
12785 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12786 return(TransformImageColorspace(wand->images,colorspace,wand->exception));
12829WandExport MagickBooleanType MagickTransparentPaintImage(
MagickWand *wand,
12830 const PixelWand *target,
const double alpha,
const double fuzz,
12831 const MagickBooleanType invert)
12840 assert(wand->signature == MagickWandSignature);
12841 if (wand->debug != MagickFalse)
12842 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12843 if (wand->images == (Image *) NULL)
12844 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12845 PixelGetMagickColor(target,&target_pixel);
12846 wand->images->fuzz=fuzz;
12847 status=TransparentPaintImage(wand->images,&target_pixel,ClampToQuantum(
12848 (
double) QuantumRange*alpha),invert,wand->exception);
12875WandExport MagickBooleanType MagickTransposeImage(
MagickWand *wand)
12881 assert(wand->signature == MagickWandSignature);
12882 if (wand->debug != MagickFalse)
12883 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12884 if (wand->images == (Image *) NULL)
12885 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12886 transpose_image=TransposeImage(wand->images,wand->exception);
12887 if (transpose_image == (Image *) NULL)
12888 return(MagickFalse);
12889 ReplaceImageInList(&wand->images,transpose_image);
12890 return(MagickTrue);
12916WandExport MagickBooleanType MagickTransverseImage(
MagickWand *wand)
12922 assert(wand->signature == MagickWandSignature);
12923 if (wand->debug != MagickFalse)
12924 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12925 if (wand->images == (Image *) NULL)
12926 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12927 transverse_image=TransverseImage(wand->images,wand->exception);
12928 if (transverse_image == (Image *) NULL)
12929 return(MagickFalse);
12930 ReplaceImageInList(&wand->images,transverse_image);
12931 return(MagickTrue);
12963WandExport MagickBooleanType MagickTrimImage(
MagickWand *wand,
const double fuzz)
12969 assert(wand->signature == MagickWandSignature);
12970 if (wand->debug != MagickFalse)
12971 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
12972 if (wand->images == (Image *) NULL)
12973 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
12974 wand->images->fuzz=fuzz;
12975 trim_image=TrimImage(wand->images,wand->exception);
12976 if (trim_image == (Image *) NULL)
12977 return(MagickFalse);
12978 ReplaceImageInList(&wand->images,trim_image);
12979 return(MagickTrue);
13004WandExport MagickBooleanType MagickUniqueImageColors(
MagickWand *wand)
13010 assert(wand->signature == MagickWandSignature);
13011 if (wand->debug != MagickFalse)
13012 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13013 if (wand->images == (Image *) NULL)
13014 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13015 unique_image=UniqueImageColors(wand->images,wand->exception);
13016 if (unique_image == (Image *) NULL)
13017 return(MagickFalse);
13018 ReplaceImageInList(&wand->images,unique_image);
13019 return(MagickTrue);
13059WandExport MagickBooleanType MagickUnsharpMaskImage(
MagickWand *wand,
13060 const double radius,
const double sigma,
const double gain,
13061 const double threshold)
13067 assert(wand->signature == MagickWandSignature);
13068 if (wand->debug != MagickFalse)
13069 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13070 if (wand->images == (Image *) NULL)
13071 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13072 unsharp_image=UnsharpMaskImage(wand->images,radius,sigma,gain,threshold,
13074 if (unsharp_image == (Image *) NULL)
13075 return(MagickFalse);
13076 ReplaceImageInList(&wand->images,unsharp_image);
13077 return(MagickTrue);
13110WandExport MagickBooleanType MagickVignetteImage(
MagickWand *wand,
13111 const double radius,
const double sigma,
const ssize_t x,
const ssize_t y)
13117 assert(wand->signature == MagickWandSignature);
13118 if (wand->debug != MagickFalse)
13119 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13120 if (wand->images == (Image *) NULL)
13121 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13122 vignette_image=VignetteImage(wand->images,radius,sigma,x,y,wand->exception);
13123 if (vignette_image == (Image *) NULL)
13124 return(MagickFalse);
13125 ReplaceImageInList(&wand->images,vignette_image);
13126 return(MagickTrue);
13160WandExport MagickBooleanType MagickWaveImage(
MagickWand *wand,
13161 const double amplitude,
const double wave_length,
13162 const PixelInterpolateMethod method)
13168 assert(wand->signature == MagickWandSignature);
13169 if (wand->debug != MagickFalse)
13170 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13171 if (wand->images == (Image *) NULL)
13172 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13173 wave_image=WaveImage(wand->images,amplitude,wave_length,method,
13175 if (wave_image == (Image *) NULL)
13176 return(MagickFalse);
13177 ReplaceImageInList(&wand->images,wave_image);
13178 return(MagickTrue);
13213WandExport MagickBooleanType MagickWaveletDenoiseImage(
MagickWand *wand,
13214 const double threshold,
const double softness)
13220 assert(wand->signature == MagickWandSignature);
13221 if (wand->debug != MagickFalse)
13222 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13223 if (wand->images == (Image *) NULL)
13224 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13225 noise_image=WaveletDenoiseImage(wand->images,threshold,softness,
13227 if (noise_image == (Image *) NULL)
13228 return(MagickFalse);
13229 ReplaceImageInList(&wand->images,noise_image);
13230 return(MagickTrue);
13256WandExport MagickBooleanType MagickWhiteBalanceImage(
MagickWand *wand)
13262 assert(wand->signature == MagickWandSignature);
13263 if (wand->debug != MagickFalse)
13264 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13265 if (wand->images == (Image *) NULL)
13266 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13267 status=WhiteBalanceImage(wand->images, wand->exception);
13298WandExport MagickBooleanType MagickWhiteThresholdImage(
MagickWand *wand,
13302 thresholds[MagickPathExtent];
13305 assert(wand->signature == MagickWandSignature);
13306 if (wand->debug != MagickFalse)
13307 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13308 if (wand->images == (Image *) NULL)
13309 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13310 (void) FormatLocaleString(thresholds,MagickPathExtent,
13311 "%g" "," "%g" "," "%g" "," "%g",
13312 (
double) PixelGetRedQuantum(threshold),
13313 (
double) PixelGetGreenQuantum(threshold),
13314 (
double) PixelGetBlueQuantum(threshold),
13315 (
double) PixelGetAlphaQuantum(threshold));
13316 return(WhiteThresholdImage(wand->images,thresholds,wand->exception));
13347WandExport MagickBooleanType MagickWriteImage(
MagickWand *wand,
13348 const char *filename)
13360 assert(wand->signature == MagickWandSignature);
13361 if (wand->debug != MagickFalse)
13362 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13363 if (wand->images == (Image *) NULL)
13364 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13365 if (filename != (
const char *) NULL)
13366 (void) CopyMagickString(wand->images->filename,filename,MagickPathExtent);
13367 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
13368 if (image == (Image *) NULL)
13369 return(MagickFalse);
13370 write_info=CloneImageInfo(wand->image_info);
13371 write_info->adjoin=MagickTrue;
13372 status=WriteImage(write_info,image,wand->exception);
13373 image=DestroyImage(image);
13374 write_info=DestroyImageInfo(write_info);
13402WandExport MagickBooleanType MagickWriteImageFile(
MagickWand *wand,FILE *file)
13414 assert(wand->signature == MagickWandSignature);
13415 assert(file != (FILE *) NULL);
13416 if (wand->debug != MagickFalse)
13417 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13418 if (wand->images == (Image *) NULL)
13419 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13420 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
13421 if (image == (Image *) NULL)
13422 return(MagickFalse);
13423 write_info=CloneImageInfo(wand->image_info);
13424 SetImageInfoFile(write_info,file);
13425 write_info->adjoin=MagickTrue;
13426 status=WriteImage(write_info,image,wand->exception);
13427 write_info=DestroyImageInfo(write_info);
13428 image=DestroyImage(image);
13459WandExport MagickBooleanType MagickWriteImages(
MagickWand *wand,
13460 const char *filename,
const MagickBooleanType adjoin)
13469 assert(wand->signature == MagickWandSignature);
13470 if (wand->debug != MagickFalse)
13471 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13472 if (wand->images == (Image *) NULL)
13473 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13474 write_info=CloneImageInfo(wand->image_info);
13475 write_info->adjoin=adjoin;
13476 status=WriteImages(write_info,wand->images,filename,wand->exception);
13477 write_info=DestroyImageInfo(write_info);
13505WandExport MagickBooleanType MagickWriteImagesFile(
MagickWand *wand,FILE *file)
13514 assert(wand->signature == MagickWandSignature);
13515 if (wand->debug != MagickFalse)
13516 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
13517 if (wand->images == (Image *) NULL)
13518 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
13519 write_info=CloneImageInfo(wand->image_info);
13520 SetImageInfoFile(write_info,file);
13521 write_info->adjoin=MagickTrue;
13522 status=WriteImages(write_info,wand->images,(
const char *) NULL,
13524 write_info=DestroyImageInfo(write_info);