% February 1997 %
% %
% %
-% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
/*
Include declarations.
*/
-#if !defined(WIN32)
-#define MagickExport
-#endif
-
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
{
{ "Comment", { {"comment", StringReference} } },
{ "Label", { {"label", StringReference} } },
- { "AddNoise", { {"noise", MagickNoiseOptions},
+ { "AddNoise", { {"noise", MagickNoiseOptions}, {"attenuate", RealReference},
{"channel", MagickChannelOptions} } },
- { "Colorize", { {"fill", StringReference}, {"opacity", StringReference} } },
+ { "Colorize", { {"fill", StringReference}, {"blend", StringReference} } },
{ "Border", { {"geometry", StringReference}, {"width", IntegerReference},
{"height", IntegerReference}, {"fill", StringReference},
{"bordercolor", StringReference}, {"color", StringReference},
{"compose", MagickComposeOptions} } },
{ "Blur", { {"geometry", StringReference}, {"radius", RealReference},
- {"sigma", RealReference}, {"channel", MagickChannelOptions} } },
+ {"sigma", RealReference}, {"bias", RealReference},
+ {"channel", MagickChannelOptions} } },
{ "Chop", { {"geometry", StringReference}, {"width", IntegerReference},
{"height", IntegerReference}, {"x", IntegerReference},
{"y", IntegerReference} } },
{"interpolate", MagickInterpolateOptions} } },
{ "Magnify", },
{ "MedianFilter", { {"geometry", StringReference},
- {"width", IntegerReference},{"height", IntegerReference},
+ {"width", IntegerReference}, {"height", IntegerReference},
{"channel", MagickChannelOptions} } },
{ "Minify", },
- { "OilPaint", { {"radius", RealReference} } },
+ { "OilPaint", { {"radius", RealReference}, {"sigma", RealReference} } },
{ "ReduceNoise", { {"geometry", StringReference},
{"width", IntegerReference},{"height", IntegerReference},
{"channel", MagickChannelOptions} } },
{ "Shade", { {"geometry", StringReference}, {"azimuth", RealReference},
{"elevation", RealReference}, {"gray", MagickBooleanOptions} } },
{ "Sharpen", { {"geometry", StringReference}, {"radius", RealReference},
- {"sigma", RealReference}, {"channel", MagickChannelOptions} } },
+ {"sigma", RealReference}, {"bias", RealReference},
+ {"channel", MagickChannelOptions} } },
{ "Shear", { {"geometry", StringReference}, {"x", RealReference},
{"y", RealReference}, { "fill", StringReference},
{"color", StringReference} } },
- { "Spread", { {"radius", RealReference} } },
+ { "Spread", { {"radius", RealReference},
+ {"interpolate", MagickInterpolateOptions} } },
{ "Swirl", { {"degrees", RealReference},
{"interpolate", MagickInterpolateOptions} } },
{ "Resize", { {"geometry", StringReference}, {"width", IntegerReference},
{ "Threshold", { {"threshold", StringReference},
{"channel", MagickChannelOptions} } },
{ "Charcoal", { {"geometry", StringReference}, {"radius", RealReference},
- {"sigma", RealReference} } },
+ {"sigma", RealReference}, {"biabias", RealReference} } },
{ "Trim", { {"fuzz", StringReference} } },
{ "Wave", { {"geometry", StringReference}, {"amplitude", RealReference},
{"wavelength", RealReference},
{ "Deconstruct", },
{ "GaussianBlur", { {"geometry", StringReference},
{"radius", RealReference}, {"sigma", RealReference},
- {"channel", MagickChannelOptions} } },
+ {"bias", RealReference}, {"channel", MagickChannelOptions} } },
{ "Convolve", { {"coefficients", ArrayReference},
- {"channel", MagickChannelOptions}, {"bias", StringReference} } },
+ {"channel", MagickChannelOptions}, {"bias", StringReference},
+ {"kernel", StringReference} } },
{ "Profile", { {"name", StringReference}, {"profile", StringReference},
{ "rendering-intent", MagickIntentOptions},
{ "black-point-compensation", MagickBooleanOptions} } },
{"channel", MagickChannelOptions} } },
{ "MotionBlur", { {"geometry", StringReference},
{"radius", RealReference}, {"sigma", RealReference},
- {"angle", RealReference}, {"channel", MagickChannelOptions} } },
+ {"angle", RealReference}, {"bias", RealReference},
+ {"channel", MagickChannelOptions} } },
{ "OrderedDither", { {"threshold", StringReference},
{"channel", MagickChannelOptions} } },
{ "Shave", { {"geometry", StringReference}, {"width", IntegerReference},
{ "Difference", { {"image", ImageReference}, {"fuzz", StringReference} } },
{ "AdaptiveThreshold", { {"geometry", StringReference},
{"width", IntegerReference}, {"height", IntegerReference},
- {"offset", IntegerReference} } },
+ {"bias", RealReference} } },
{ "Resample", { {"density", StringReference}, {"x", RealReference},
{"y", RealReference}, {"filter", MagickFilterOptions},
{"support", RealReference }, {"blur", RealReference } } },
{ "WhiteThreshold", { {"threshold", StringReference},
{"channel", MagickChannelOptions} } },
{ "RadialBlur", { {"geometry", StringReference}, {"angle", RealReference},
- {"channel", MagickChannelOptions} } },
+ {"bias", RealReference}, {"channel", MagickChannelOptions} } },
{ "Thumbnail", { {"geometry", StringReference}, {"width", IntegerReference},
{"height", IntegerReference} } },
{ "Strip", },
- { "Tint", { {"fill", StringReference}, {"opacity", StringReference} } },
+ { "Tint", { {"fill", StringReference}, {"blend", StringReference} } },
{ "Channel", { {"channel", MagickChannelOptions} } },
{ "Splice", { {"geometry", StringReference}, {"width", IntegerReference},
{"height", IntegerReference}, {"x", IntegerReference},
{"background", StringReference}, {"gravity", MagickGravityOptions} } },
{ "Posterize", { {"levels", IntegerReference},
{"dither", MagickBooleanOptions} } },
- { "Shadow", { {"geometry", StringReference}, {"opacity", RealReference},
+ { "Shadow", { {"geometry", StringReference}, {"alpha", RealReference},
{"sigma", RealReference}, {"x", IntegerReference},
{"y", IntegerReference} } },
{ "Identify", { {"file", FileReference}, {"features", StringReference},
{ "Sans1", },
{ "AdaptiveSharpen", { {"geometry", StringReference},
{"radius", RealReference}, {"sigma", RealReference},
- {"channel", MagickChannelOptions} } },
+ {"bias", RealReference}, {"channel", MagickChannelOptions} } },
{ "Transpose", },
{ "Transverse", },
{ "AutoOrient", },
{ "AdaptiveBlur", { {"geometry", StringReference},
{"radius", RealReference}, {"sigma", RealReference},
- {"channel", MagickChannelOptions} } },
+ {"bias", RealReference}, {"channel", MagickChannelOptions} } },
{ "Sketch", { {"geometry", StringReference},
{"radius", RealReference}, {"sigma", RealReference},
- {"angle", RealReference} } },
+ {"angle", RealReference}, {"bias", RealReference} } },
{ "UniqueColors", },
{ "AdaptiveResize", { {"geometry", StringReference},
{"width", IntegerReference}, {"height", IntegerReference},
{"filter", MagickFilterOptions}, {"support", StringReference },
- {"blur", RealReference } } },
+ {"blur", RealReference }, {"interpolate", MagickInterpolateOptions} } },
{ "ClipMask", { {"mask", ImageReference} } },
{ "LinearStretch", { {"levels", StringReference},
{"black-point", RealReference},{"white-point", RealReference} } },
- { "Recolor", { {"matrix", ArrayReference} } },
+ { "ColorMatrix", { {"matrix", ArrayReference} } },
{ "Mask", { {"mask", ImageReference} } },
{ "Polaroid", { {"caption", StringReference}, {"angle", RealReference},
{"font", StringReference}, {"stroke", StringReference},
{"fill", StringReference}, {"strokewidth", RealReference},
{"pointsize", RealReference}, {"gravity", MagickGravityOptions},
- {"background", StringReference} } },
+ {"background", StringReference},
+ {"interpolate", MagickInterpolateOptions} } },
{ "FloodfillPaint", { {"geometry", StringReference},
{"x", IntegerReference}, {"y", IntegerReference},
{"fill", StringReference}, {"bordercolor", StringReference},
{"virtual-pixel", MagickVirtualPixelOptions},
{"best-fit", MagickBooleanOptions} } },
{ "Clut", { {"image", ImageReference},
+ {"interpolate", MagickInterpolateOptions},
{"channel", MagickChannelOptions} } },
{ "LiquidRescale", { {"geometry", StringReference},
{"width", IntegerReference}, {"height", IntegerReference},
{"virtual-pixel", MagickVirtualPixelOptions} } },
{ "SelectiveBlur", { {"geometry", StringReference},
{"radius", RealReference}, {"sigma", RealReference},
- {"threshold", RealReference}, {"channel", MagickChannelOptions} } },
+ {"threshold", RealReference}, {"bias", RealReference},
+ {"channel", MagickChannelOptions} } },
{ "HaldClut", { {"image", ImageReference},
{"channel", MagickChannelOptions} } },
{ "BlueShift", { {"factor", StringReference} } },
{"black-point", StringReference}, {"white-point", StringReference},
{"channel", MagickChannelOptions}, {"invert", MagickBooleanOptions} } },
{ "Clamp", { {"channel", MagickChannelOptions} } },
- { "Filter", { {"kernel", StringReference},
- {"channel", MagickChannelOptions}, {"bias", StringReference} } },
{ "BrightnessContrast", { {"levels", StringReference},
{"brightness", RealReference},{"contrast", RealReference},
{"channel", MagickChannelOptions} } },
{ "Morphology", { {"kernel", StringReference},
{"channel", MagickChannelOptions}, {"method", MagickMorphologyOptions},
{"iterations", IntegerReference} } },
- { "ColorMatrix", { {"matrix", ArrayReference} } },
+ { "Sans", { {"matrix", ArrayReference} } },
{ "Color", { {"color", StringReference} } },
{ "Mode", { {"geometry", StringReference},
{"width", IntegerReference},{"height", IntegerReference},
%
*/
-static double SiPrefixToDouble(const char *string,const double interval)
+static double SiPrefixToDoubleInterval(const char *string,const double interval)
+{
+ char
+ *q;
+
+ double
+ value;
+
+ value=InterpretSiPrefixValue(string,&q);
+ if (*q == '%')
+ value*=interval/100.0;
+ return(value);
+}
+
+static inline double StringToDouble(const char *restrict string,
+ char **restrict sentinal)
+{
+ return(InterpretLocaleValue(string,sentinal));
+}
+
+static double StringToDoubleInterval(const char *string,const double interval)
{
char
*q;
double
- scale,
value;
value=InterpretLocaleValue(string,&q);
- scale=1000.0;
- if ((*q != '\0') && (tolower((int) ((unsigned char) *(q+1))) == 'i'))
- scale=1024.0;
- switch (tolower((int) ((unsigned char) *q)))
- {
- case '%': value*=pow(scale,0)*interval/100.0; break;
- case 'k': value*=pow(scale,1); break;
- case 'm': value*=pow(scale,2); break;
- case 'g': value*=pow(scale,3); break;
- case 't': value*=pow(scale,4); break;
- case 'p': value*=pow(scale,5); break;
- case 'e': value*=pow(scale,6); break;
- case 'z': value*=pow(scale,7); break;
- case 'y': value*=pow(scale,8); break;
- default: break;
- }
+ if (*q == '%')
+ value*=interval/100.0;
return(value);
}
MagickStatusType
flags;
- PixelPacket
+ PixelInfo
*color,
target_color;
break;
}
for ( ; image; image=image->next)
- (void) SetImageAlphaChannel(image,(AlphaChannelType) sp);
+ (void) SetImageAlphaChannel(image,(AlphaChannelType) sp,exception);
break;
}
if (LocaleCompare(attribute,"antialias") == 0)
limit=MagickResourceInfinity;
if (LocaleCompare(SvPV(sval,na),"unlimited") != 0)
- limit=(MagickSizeType) SiPrefixToDouble(SvPV(sval,na),100.0);
+ limit=(MagickSizeType) SiPrefixToDoubleInterval(SvPV(sval,na),
+ 100.0);
(void) SetMagickResourceLimit(AreaResource,limit);
break;
}
if (LocaleCompare(attribute,"authenticate") == 0)
{
if (info)
- (void) CloneString(&info->image_info->authenticate,SvPV(sval,na));
+ SetImageOption(info->image_info,attribute,SvPV(sval,na));
break;
}
if (info)
SetImageOption(info->image_info,attribute,SvPV(sval,na));
for ( ; image; image=image->next)
- SetImageProperty(image,attribute,SvPV(sval,na));
+ SetImageProperty(image,attribute,SvPV(sval,na),exception);
break;
}
case 'B':
{
if (LocaleCompare(attribute,"background") == 0)
{
- (void) QueryColorDatabase(SvPV(sval,na),&target_color,exception);
+ (void) QueryColorCompliance(SvPV(sval,na),AllCompliance,&target_color,
+ exception);
if (info)
info->image_info->background_color=target_color;
for ( ; image; image=image->next)
if (LocaleCompare(attribute,"bias") == 0)
{
for ( ; image; image=image->next)
- image->bias=SiPrefixToDouble(SvPV(sval,na),QuantumRange);
+ image->bias=StringToDoubleInterval(SvPV(sval,na),(double)
+ QuantumRange+1.0);
break;
}
if (LocaleCompare(attribute,"blue-primary") == 0)
}
if (LocaleCompare(attribute,"bordercolor") == 0)
{
- (void) QueryColorDatabase(SvPV(sval,na),&target_color,exception);
+ (void) QueryColorCompliance(SvPV(sval,na),AllCompliance,&target_color,
+ exception);
if (info)
info->image_info->border_color=target_color;
for ( ; image; image=image->next)
if (info)
SetImageOption(info->image_info,attribute,SvPV(sval,na));
for ( ; image; image=image->next)
- SetImageProperty(image,attribute,SvPV(sval,na));
+ SetImageProperty(image,attribute,SvPV(sval,na),exception);
break;
}
case 'C':
if (LocaleCompare(attribute,"cache-threshold") == 0)
{
(void) SetMagickResourceLimit(MemoryResource,(MagickSizeType)
- SiPrefixToDouble(SvPV(sval,na),100.0));
+ SiPrefixToDoubleInterval(SvPV(sval,na),100.0));
(void) SetMagickResourceLimit(MapResource,(MagickSizeType)
- (2*SiPrefixToDouble(SvPV(sval,na),100.0)));
+ (2.0*SiPrefixToDoubleInterval(SvPV(sval,na),100.0)));
break;
}
if (LocaleCompare(attribute,"clip-mask") == 0)
if (SvPOK(sval))
clip_mask=SetupList(aTHX_ SvRV(sval),&info,(SV ***) NULL,exception);
for ( ; image; image=image->next)
- SetImageClipMask(image,clip_mask);
+ SetImageClipMask(image,clip_mask,exception);
break;
}
if (LocaleNCompare(attribute,"colormap",8) == 0)
i%=image->colors;
if ((strchr(SvPV(sval,na),',') == 0) ||
(strchr(SvPV(sval,na),')') != 0))
- QueryColorDatabase(SvPV(sval,na),image->colormap+i,exception);
+ QueryColorCompliance(SvPV(sval,na),AllCompliance,
+ image->colormap+i,exception);
else
{
color=image->colormap+i;
break;
}
for ( ; image; image=image->next)
- (void) TransformImageColorspace(image,(ColorspaceType) sp);
+ (void) TransformImageColorspace(image,(ColorspaceType) sp,
+ exception);
break;
}
if (LocaleCompare(attribute,"comment") == 0)
for ( ; image; image=image->next)
(void) SetImageProperty(image,"Comment",InterpretImageProperties(
info ? info->image_info : (ImageInfo *) NULL,image,
- SvPV(sval,na)));
+ SvPV(sval,na),exception),exception);
break;
}
if (LocaleCompare(attribute,"compression") == 0)
if (info)
SetImageOption(info->image_info,attribute,SvPV(sval,na));
for ( ; image; image=image->next)
- SetImageProperty(image,attribute,SvPV(sval,na));
+ SetImageProperty(image,attribute,SvPV(sval,na),exception);
break;
}
case 'D':
limit=MagickResourceInfinity;
if (LocaleCompare(SvPV(sval,na),"unlimited") != 0)
- limit=(MagickSizeType) SiPrefixToDouble(SvPV(sval,na),100.0);
+ limit=(MagickSizeType) SiPrefixToDoubleInterval(SvPV(sval,na),
+ 100.0);
(void) SetMagickResourceLimit(DiskResource,limit);
break;
}
for ( ; image; image=image->next)
{
flags=ParseGeometry(SvPV(sval,na),&geometry_info);
- image->x_resolution=geometry_info.rho;
- image->y_resolution=geometry_info.sigma;
+ image->resolution.x=geometry_info.rho;
+ image->resolution.y=geometry_info.sigma;
if ((flags & SigmaValue) == 0)
- image->y_resolution=image->x_resolution;
+ image->resolution.y=image->resolution.x;
}
break;
}
if (info)
info->image_info->depth=SvIV(sval);
for ( ; image; image=image->next)
- (void) SetImageDepth(image,SvIV(sval));
+ (void) SetImageDepth(image,SvIV(sval),exception);
break;
}
if (LocaleCompare(attribute,"dispose") == 0)
if (info)
SetImageOption(info->image_info,attribute,SvPV(sval,na));
for ( ; image; image=image->next)
- SetImageProperty(image,attribute,SvPV(sval,na));
+ SetImageProperty(image,attribute,SvPV(sval,na),exception);
break;
}
case 'E':
if (info)
SetImageOption(info->image_info,attribute,SvPV(sval,na));
for ( ; image; image=image->next)
- SetImageProperty(image,attribute,SvPV(sval,na));
+ SetImageProperty(image,attribute,SvPV(sval,na),exception);
break;
}
case 'F':
if (LocaleCompare(attribute,"fuzz") == 0)
{
if (info)
- info->image_info->fuzz=SiPrefixToDouble(SvPV(sval,na),QuantumRange);
+ info->image_info->fuzz=StringToDoubleInterval(SvPV(sval,na),(double)
+ QuantumRange+1.0);
for ( ; image; image=image->next)
- image->fuzz=SiPrefixToDouble(SvPV(sval,na),QuantumRange);
+ image->fuzz=StringToDoubleInterval(SvPV(sval,na),(double)
+ QuantumRange+1.0);
break;
}
if (info)
SetImageOption(info->image_info,attribute,SvPV(sval,na));
for ( ; image; image=image->next)
- SetImageProperty(image,attribute,SvPV(sval,na));
+ SetImageProperty(image,attribute,SvPV(sval,na),exception);
break;
}
case 'G':
if (info)
SetImageOption(info->image_info,attribute,SvPV(sval,na));
for ( ; image; image=image->next)
- SetImageProperty(image,attribute,SvPV(sval,na));
+ SetImageProperty(image,attribute,SvPV(sval,na),exception);
break;
}
case 'I':
if (info)
SetImageOption(info->image_info,attribute,SvPV(sval,na));
for ( ; image; image=image->next)
- SetImageProperty(image,attribute,SvPV(sval,na));
+ SetImageProperty(image,attribute,SvPV(sval,na),exception);
break;
}
case 'L':
for ( ; image; image=image->next)
(void) SetImageProperty(image,"label",InterpretImageProperties(
info ? info->image_info : (ImageInfo *) NULL,image,
- SvPV(sval,na)));
+ SvPV(sval,na),exception),exception);
break;
}
if (LocaleCompare(attribute,"loop") == 0)
if (info)
SetImageOption(info->image_info,attribute,SvPV(sval,na));
for ( ; image; image=image->next)
- SetImageProperty(image,attribute,SvPV(sval,na));
+ SetImageProperty(image,attribute,SvPV(sval,na),exception);
break;
}
case 'M':
limit=MagickResourceInfinity;
if (LocaleCompare(SvPV(sval,na),"unlimited") != 0)
- limit=(MagickSizeType) SiPrefixToDouble(SvPV(sval,na),100.0);
+ limit=(MagickSizeType) SiPrefixToDoubleInterval(SvPV(sval,na),
+ 100.0);
(void) SetMagickResourceLimit(MapResource,limit);
break;
}
if (SvPOK(sval))
mask=SetupList(aTHX_ SvRV(sval),&info,(SV ***) NULL,exception);
for ( ; image; image=image->next)
- SetImageMask(image,mask);
+ SetImageMask(image,mask,exception);
break;
}
if (LocaleCompare(attribute,"mattecolor") == 0)
{
- (void) QueryColorDatabase(SvPV(sval,na),&target_color,exception);
+ (void) QueryColorCompliance(SvPV(sval,na),AllCompliance,&target_color,
+ exception);
if (info)
info->image_info->matte_color=target_color;
for ( ; image; image=image->next)
limit=MagickResourceInfinity;
if (LocaleCompare(SvPV(sval,na),"unlimited") != 0)
- limit=(MagickSizeType) SiPrefixToDouble(SvPV(sval,na),100.0);
+ limit=(MagickSizeType) SiPrefixToDoubleInterval(SvPV(sval,na),
+ 100.0);
(void) SetMagickResourceLimit(MemoryResource,limit);
break;
}
if (info)
info->image_info->monochrome=sp != 0 ? MagickTrue : MagickFalse;
for ( ; image; image=image->next)
- (void) SetImageType(image,BilevelType);
+ (void) SetImageType(image,BilevelType,exception);
break;
}
if (info)
SetImageOption(info->image_info,attribute,SvPV(sval,na));
for ( ; image; image=image->next)
- SetImageProperty(image,attribute,SvPV(sval,na));
+ SetImageProperty(image,attribute,SvPV(sval,na),exception);
break;
}
case 'O':
if (info)
SetImageOption(info->image_info,attribute,SvPV(sval,na));
for ( ; image; image=image->next)
- SetImageProperty(image,attribute,SvPV(sval,na));
+ SetImageProperty(image,attribute,SvPV(sval,na),exception);
break;
}
case 'P':
for ( ; image; image=image->next)
{
- if (SetImageStorageClass(image,DirectClass) == MagickFalse)
+ if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
break;
x=0;
y=0;
{
if ((strchr(SvPV(sval,na),',') == 0) ||
(strchr(SvPV(sval,na),')') != 0))
- QueryMagickColor(SvPV(sval,na),&pixel,exception);
+ QueryColorCompliance(SvPV(sval,na),AllCompliance,
+ &pixel,exception);
else
{
GetPixelInfo(image,&pixel);
if (info)
SetImageOption(info->image_info,attribute,SvPV(sval,na));
for ( ; image; image=image->next)
- SetImageProperty(image,attribute,SvPV(sval,na));
+ SetImageProperty(image,attribute,SvPV(sval,na),exception);
break;
}
case 'Q':
if (info)
SetImageOption(info->image_info,attribute,SvPV(sval,na));
for ( ; image; image=image->next)
- SetImageProperty(image,attribute,SvPV(sval,na));
+ SetImageProperty(image,attribute,SvPV(sval,na),exception);
break;
}
case 'R':
if (info)
SetImageOption(info->image_info,attribute,SvPV(sval,na));
for ( ; image; image=image->next)
- SetImageProperty(image,attribute,SvPV(sval,na));
+ SetImageProperty(image,attribute,SvPV(sval,na),exception);
break;
}
case 'S':
if (info)
SetImageOption(info->image_info,attribute,SvPV(sval,na));
for ( ; image; image=image->next)
- SetImageProperty(image,attribute,SvPV(sval,na));
+ SetImageProperty(image,attribute,SvPV(sval,na),exception);
break;
}
case 'T':
limit=MagickResourceInfinity;
if (LocaleCompare(SvPV(sval,na),"unlimited") != 0)
- limit=(MagickSizeType) SiPrefixToDouble(SvPV(sval,na),100.0);
+ limit=(MagickSizeType) SiPrefixToDoubleInterval(SvPV(sval,na),
+ 100.0);
(void) SetMagickResourceLimit(ThreadResource,limit);
break;
}
limit=MagickResourceInfinity;
if (LocaleCompare(SvPV(sval,na),"unlimited") != 0)
- limit=(MagickSizeType) SiPrefixToDouble(SvPV(sval,na),100.0);
+ limit=(MagickSizeType) SiPrefixToDoubleInterval(SvPV(sval,na),
+ 100.0);
(void) SetMagickResourceLimit(TimeResource,limit);
break;
}
if (LocaleCompare(attribute,"transparent-color") == 0)
{
- (void) QueryColorDatabase(SvPV(sval,na),&target_color,exception);
+ (void) QueryColorCompliance(SvPV(sval,na),AllCompliance,&target_color,
+ exception);
if (info)
info->image_info->transparent_color=target_color;
for ( ; image; image=image->next)
if (info)
info->image_info->type=(ImageType) sp;
for ( ; image; image=image->next)
- SetImageType(image,(ImageType) sp);
+ SetImageType(image,(ImageType) sp,exception);
break;
}
if (info)
SetImageOption(info->image_info,attribute,SvPV(sval,na));
for ( ; image; image=image->next)
- SetImageProperty(image,attribute,SvPV(sval,na));
+ SetImageProperty(image,attribute,SvPV(sval,na),exception);
break;
}
case 'U':
{
if (units == PixelsPerCentimeterResolution)
{
- image->x_resolution*=2.54;
- image->y_resolution*=2.54;
+ image->resolution.x*=2.54;
+ image->resolution.y*=2.54;
}
break;
}
{
if (units == PixelsPerInchResolution)
{
- image->x_resolution/=2.54;
- image->y_resolution/=2.54;
+ image->resolution.x/=2.54;
+ image->resolution.y/=2.54;
}
break;
}
if (info)
SetImageOption(info->image_info,attribute,SvPV(sval,na));
for ( ; image; image=image->next)
- SetImageProperty(image,attribute,SvPV(sval,na));
+ SetImageProperty(image,attribute,SvPV(sval,na),exception);
break;
}
case 'V':
if (info)
SetImageOption(info->image_info,attribute,SvPV(sval,na));
for ( ; image; image=image->next)
- SetImageProperty(image,attribute,SvPV(sval,na));
+ SetImageProperty(image,attribute,SvPV(sval,na),exception);
break;
}
case 'W':
if (info)
SetImageOption(info->image_info,attribute,SvPV(sval,na));
for ( ; image; image=image->next)
- SetImageProperty(image,attribute,SvPV(sval,na));
+ SetImageProperty(image,attribute,SvPV(sval,na),exception);
break;
}
default:
if (info)
SetImageOption(info->image_info,attribute,SvPV(sval,na));
for ( ; image; image=image->next)
- SetImageProperty(image,attribute,SvPV(sval,na));
+ SetImageProperty(image,attribute,SvPV(sval,na),exception);
break;
}
}
for (i=2; i < items; i+=2)
SetAttribute(aTHX_ package_info,image,SvPV(ST(i-1),na),ST(i),
exception);
- (void) AnimateImages(package_info->image_info,image);
+ (void) AnimateImages(package_info->image_info,image,exception);
(void) CatchImageException(image);
- InheritException(exception,&image->exception);
PerlException:
if (package_info != (struct PackageInfo *) NULL)
Compare(ref,...)
Image::Magick ref=NO_INIT
ALIAS:
- CompareImage = 1
+ CompareImages = 1
compare = 2
compareimage = 3
PPCODE:
char
*attribute;
- ChannelType
- channel;
-
double
distortion;
/*
Get attribute.
*/
- channel=DefaultChannels;
reconstruct_image=image;
metric=RootMeanSquaredErrorMetric;
for (i=2; i < items; i+=2)
"UnrecognizedType",SvPV(ST(i),na));
return;
}
- channel=(ChannelType) option;
+ SetPixelChannelMapMask(image,(ChannelType) option);
break;
}
ThrowPerlException(exception,OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(attribute,"fuzz") == 0)
{
- image->fuzz=SiPrefixToDouble(SvPV(ST(i),na),100.0);
+ image->fuzz=StringToDoubleInterval(SvPV(ST(i),na),100.0);
break;
}
ThrowPerlException(exception,OptionError,"UnrecognizedAttribute",
}
}
}
- difference_image=CompareImageChannels(image,reconstruct_image,channel,
- metric,&distortion,exception);
+ difference_image=CompareImages(image,reconstruct_image,metric,&distortion,
+ exception);
if (difference_image != (Image *) NULL)
{
difference_image->error.mean_error_per_pixel=distortion;
CompareLayers(ref)
Image::Magick ref=NO_INIT
ALIAS:
- CompareImageLayers = 1
+ CompareImagesLayers = 1
comparelayers = 2
compareimagelayers = 3
PPCODE:
}
}
}
- image=CompareImageLayers(image,method,exception);
+ image=CompareImagesLayers(image,method,exception);
if ((image == (Image *) NULL) || (exception->severity >= ErrorException))
goto PerlException;
for ( ; image; image=image->next)
for (i=2; i < items; i+=2)
SetAttribute(aTHX_ package_info,image,SvPV(ST(i-1),na),ST(i),
exception);
- (void) DisplayImages(package_info->image_info,image);
+ (void) DisplayImages(package_info->image_info,image,exception);
(void) CatchImageException(image);
- InheritException(exception,&image->exception);
PerlException:
if (package_info != (struct PackageInfo *) NULL)
count=0;
for ( ; image; image=image->next)
{
- channel_features=GetImageChannelFeatures(image,distance,
- &image->exception);
+ channel_features=GetImageFeatures(image,distance,exception);
if (channel_features == (ChannelFeatures *) NULL)
continue;
count++;
Image
*image;
- PixelPacket
+ PixelInfo
background_color;
register ssize_t
}
background_color=image->background_color;
if (items == 2)
- (void) QueryColorDatabase((char *) SvPV(ST(1),na),&background_color,
- exception);
+ (void) QueryColorCompliance((char *) SvPV(ST(1),na),AllCompliance,
+ &background_color,exception);
else
for (i=2; i < items; i+=2)
{
{
if (LocaleCompare(attribute,"background") == 0)
{
- (void) QueryColorDatabase((char *) SvPV(ST(1),na),
- &background_color,exception);
+ (void) QueryColorCompliance((char *) SvPV(ST(1),na),
+ AllCompliance,&background_color,exception);
break;
}
ThrowPerlException(exception,OptionError,"UnrecognizedAttribute",
expression[MaxTextExtent];
ChannelType
- channel;
+ channel,
+ channel_mask;
ExceptionInfo
*exception;
}
}
}
- image=FxImageChannel(image,channel,expression,exception);
+ channel_mask=SetPixelChannelMask(image,channel);
+ image=FxImage(image,expression,exception);
+ if (image != (Image *) NULL)
+ (void) SetPixelChannelMask(image,channel_mask);
if ((image == (Image *) NULL) || (exception->severity >= ErrorException))
goto PerlException;
for ( ; image; image=image->next)
const char
*value;
- value=GetImageProperty(image,attribute);
+ value=GetImageProperty(image,attribute,exception);
if (value != (const char *) NULL)
s=newSVpv(value,0);
PUSHs(s ? sv_2mortal(s) : &sv_undef);
if (LocaleCompare(attribute,"authenticate") == 0)
{
if (info)
- s=newSVpv(info->image_info->authenticate,0);
+ {
+ const char
+ *option;
+
+ option=GetImageOption(info->image_info,attribute);
+ if (option != (const char *) NULL)
+ s=newSVpv(option,0);
+ }
PUSHs(s ? sv_2mortal(s) : &sv_undef);
continue;
}
{
if (image == (Image *) NULL)
break;
- (void) FormatLocaleString(color,MaxTextExtent,QuantumFormat ","
- QuantumFormat "," QuantumFormat "," QuantumFormat,
- image->background_color.red,image->background_color.green,
- image->background_color.blue,image->background_color.alpha);
+ (void) FormatLocaleString(color,MaxTextExtent,
+ "%.20g,%.20g,%.20g,%.20g",image->background_color.red,
+ image->background_color.green,image->background_color.blue,
+ image->background_color.alpha);
s=newSVpv(color,0);
PUSHs(s ? sv_2mortal(s) : &sv_undef);
continue;
{
if (image == (Image *) NULL)
break;
- (void) FormatLocaleString(color,MaxTextExtent,QuantumFormat ","
- QuantumFormat "," QuantumFormat "," QuantumFormat,
- image->border_color.red,image->border_color.green,
- image->border_color.blue,image->border_color.alpha);
+ (void) FormatLocaleString(color,MaxTextExtent,
+ "%.20g,%.20g,%.20g,%.20g",image->border_color.red,
+ image->border_color.green,image->border_color.blue,
+ image->border_color.alpha);
s=newSVpv(color,0);
PUSHs(s ? sv_2mortal(s) : &sv_undef);
continue;
if (image == (Image *) NULL)
break;
- page=GetImageBoundingBox(image,&image->exception);
+ page=GetImageBoundingBox(image,exception);
(void) FormatLocaleString(geometry,MaxTextExtent,
"%.20gx%.20g%+.20g%+.20g",(double) page.width,(double)
page.height,(double) page.x,(double) page.y);
sv=NULL;
if (image->mask == (Image *) NULL)
- ClipImage(image);
+ ClipImage(image,exception);
if (image->mask != (Image *) NULL)
{
AddImageToRegistry(sv,image->mask);
sv=NULL;
if (image->clip_mask == (Image *) NULL)
- ClipImage(image);
+ ClipImage(image,exception);
if (image->clip_mask != (Image *) NULL)
{
AddImageToRegistry(sv,image->clip_mask);
{
if (image != (Image *) NULL)
s=newSViv((ssize_t) GetNumberColors(image,(FILE *) NULL,
- &image->exception));
+ exception));
PUSHs(s ? sv_2mortal(s) : &sv_undef);
continue;
}
(void) items;
if (j > (ssize_t) image->colors)
j%=image->colors;
- (void) FormatLocaleString(color,MaxTextExtent,QuantumFormat ","
- QuantumFormat "," QuantumFormat "," QuantumFormat,
- image->colormap[j].red,image->colormap[j].green,
- image->colormap[j].blue,image->colormap[j].alpha);
+ (void) FormatLocaleString(color,MaxTextExtent,
+ "%.20g,%.20g,%.20g,%.20g",image->colormap[j].red,
+ image->colormap[j].green,image->colormap[j].blue,
+ image->colormap[j].alpha);
s=newSVpv(color,0);
PUSHs(s ? sv_2mortal(s) : &sv_undef);
continue;
const char
*value;
- value=GetImageProperty(image,attribute);
+ value=GetImageProperty(image,attribute,exception);
if (value != (const char *) NULL)
s=newSVpv(value,0);
PUSHs(s ? sv_2mortal(s) : &sv_undef);
if (image == (Image *) NULL)
break;
(void) FormatLocaleString(geometry,MaxTextExtent,"%.15gx%.15g",
- image->x_resolution,image->y_resolution);
+ image->resolution.x,image->resolution.y);
s=newSVpv(geometry,0);
PUSHs(s ? sv_2mortal(s) : &sv_undef);
continue;
{
s=newSViv(MAGICKCORE_QUANTUM_DEPTH);
if (image != (Image *) NULL)
- s=newSViv((ssize_t) GetImageDepth(image,&image->exception));
+ s=newSViv((ssize_t) GetImageDepth(image,exception));
PUSHs(s ? sv_2mortal(s) : &sv_undef);
continue;
}
if (info && (*info->image_info->magick != '\0'))
magick_info=GetMagickInfo(info->image_info->magick,exception);
if (image != (Image *) NULL)
- magick_info=GetMagickInfo(image->magick,&image->exception);
+ magick_info=GetMagickInfo(image->magick,exception);
if ((magick_info != (const MagickInfo *) NULL) &&
(*magick_info->description != '\0'))
s=newSVpv((char *) magick_info->description,0);
(void) FormatLocaleString(key,MaxTextExtent,"%.20g\n",(double)
id);
status=SetImageRegistry(ImageRegistryType,key,image,
- &image->exception);
+ exception);
(void) status;
s=newSViv(id++);
}
items=sscanf(attribute,"%*[^[][%ld%*[,/]%ld",&x,&y);
(void) items;
image_view=AcquireCacheView(image);
- p=GetCacheViewVirtualPixels(image_view,x,y,1,1,&image->exception);
+ p=GetCacheViewVirtualPixels(image_view,x,y,1,1,exception);
if (p != (const Quantum *) NULL)
{
(void) FormatLocaleString(name,MaxTextExtent,QuantumFormat,
if (image == (Image *) NULL)
break;
- value=GetImageProperty(image,"Label");
+ value=GetImageProperty(image,"Label",exception);
if (value != (const char *) NULL)
s=newSVpv(value,0);
PUSHs(s ? sv_2mortal(s) : &sv_undef);
{
if (image == (Image *) NULL)
break;
- (void) FormatLocaleString(color,MaxTextExtent,QuantumFormat ","
- QuantumFormat "," QuantumFormat "," QuantumFormat,
- image->matte_color.red,image->matte_color.green,
- image->matte_color.blue,image->matte_color.alpha);
+ (void) FormatLocaleString(color,MaxTextExtent,
+ "%.20g,%.20g,%.20g,%.20g",image->matte_color.red,
+ image->matte_color.green,image->matte_color.blue,
+ image->matte_color.alpha);
s=newSVpv(color,0);
PUSHs(s ? sv_2mortal(s) : &sv_undef);
continue;
if (image == (Image *) NULL)
continue;
j=info ? info->image_info->monochrome :
- IsImageMonochrome(image,&image->exception);
+ IsImageMonochrome(image,exception);
s=newSViv(j);
PUSHs(s ? sv_2mortal(s) : &sv_undef);
continue;
if (image == (Image *) NULL)
break;
- (void) SignatureImage(image);
- value=GetImageProperty(image,"Signature");
+ (void) SignatureImage(image,exception);
+ value=GetImageProperty(image,"Signature",exception);
if (value != (const char *) NULL)
s=newSVpv(value,0);
PUSHs(s ? sv_2mortal(s) : &sv_undef);
{
s=newSViv(MAGICKCORE_QUANTUM_DEPTH);
if (image != (Image *) NULL)
- s=newSVnv(GetImageTotalInkDensity(image));
+ s=newSVnv(GetImageTotalInkDensity(image,exception));
PUSHs(s ? sv_2mortal(s) : &sv_undef);
continue;
}
{
if (image == (Image *) NULL)
break;
- (void) FormatLocaleString(color,MaxTextExtent,QuantumFormat ","
- QuantumFormat "," QuantumFormat "," QuantumFormat,
- image->transparent_color.red,image->transparent_color.green,
- image->transparent_color.blue,image->transparent_color.alpha);
+ (void) FormatLocaleString(color,MaxTextExtent,
+ "%.20g,%.20g,%.20g,%.20g",image->transparent_color.red,
+ image->transparent_color.green,image->transparent_color.blue,
+ image->transparent_color.alpha);
s=newSVpv(color,0);
PUSHs(s ? sv_2mortal(s) : &sv_undef);
continue;
{
if (image == (Image *) NULL)
break;
- j=(ssize_t) GetImageType(image,&image->exception);
+ j=(ssize_t) GetImageType(image,exception);
s=newSViv(j);
(void) sv_setpv(s,CommandOptionToMnemonic(MagickTypeOptions,j));
SvIOK_on(s);
if (LocaleCompare(attribute,"x-resolution") == 0)
{
if (image != (Image *) NULL)
- s=newSVnv(image->x_resolution);
+ s=newSVnv(image->resolution.x);
PUSHs(s ? sv_2mortal(s) : &sv_undef);
continue;
}
if (LocaleCompare(attribute,"y-resolution") == 0)
{
if (image != (Image *) NULL)
- s=newSVnv(image->y_resolution);
+ s=newSVnv(image->resolution.y);
PUSHs(s ? sv_2mortal(s) : &sv_undef);
continue;
}
attribute)
else
{
- value=GetImageProperty(image,attribute);
+ value=GetImageProperty(image,attribute,exception);
if (value != (const char *) NULL)
{
s=newSVpv(value,0);
*meta;
meta=InterpretImageProperties(info ? info->image_info :
- (ImageInfo *) NULL,image,attribute);
+ (ImageInfo *) NULL,image,attribute,exception);
s=newSVpv(meta,0);
PUSHs(s ? sv_2mortal(s) : &sv_undef);
meta=(char *) RelinquishMagickMemory(meta);
char
message[MaxTextExtent];
- PixelPacket
+ PixelInfo
*histogram;
ExceptionInfo
count=0;
for ( ; image; image=image->next)
{
- histogram=GetImageHistogram(image,&number_colors,&image->exception);
- if (histogram == (PixelPacket *) NULL)
+ histogram=GetImageHistogram(image,&number_colors,exception);
+ if (histogram == (PixelInfo *) NULL)
continue;
count+=(ssize_t) number_colors;
EXTEND(sp,6*count);
for (i=0; i < (ssize_t) number_colors; i++)
{
- (void) FormatLocaleString(message,MaxTextExtent,QuantumFormat,
+ (void) FormatLocaleString(message,MaxTextExtent,"%.20g",
histogram[i].red);
PUSHs(sv_2mortal(newSVpv(message,0)));
- (void) FormatLocaleString(message,MaxTextExtent,QuantumFormat,
+ (void) FormatLocaleString(message,MaxTextExtent,"%.20g",
histogram[i].green);
PUSHs(sv_2mortal(newSVpv(message,0)));
- (void) FormatLocaleString(message,MaxTextExtent,QuantumFormat,
+ (void) FormatLocaleString(message,MaxTextExtent,"%.20g",
histogram[i].blue);
PUSHs(sv_2mortal(newSVpv(message,0)));
if (image->colorspace == CMYKColorspace)
{
- (void) FormatLocaleString(message,MaxTextExtent,QuantumFormat,
+ (void) FormatLocaleString(message,MaxTextExtent,"%.20g",
histogram[i].black);
PUSHs(sv_2mortal(newSVpv(message,0)));
}
- (void) FormatLocaleString(message,MaxTextExtent,QuantumFormat,
+ (void) FormatLocaleString(message,MaxTextExtent,"%.20g",
histogram[i].alpha);
PUSHs(sv_2mortal(newSVpv(message,0)));
(void) FormatLocaleString(message,MaxTextExtent,"%.20g",(double)
histogram[i].count);
PUSHs(sv_2mortal(newSVpv(message,0)));
}
- histogram=(PixelPacket *) RelinquishMagickMemory(histogram);
+ histogram=(PixelInfo *) RelinquishMagickMemory(histogram);
}
PerlException:
char
*attribute;
- ChannelType
- channel;
-
ExceptionInfo
*exception;
PackageName);
goto PerlException;
}
- channel=DefaultChannels;
normalize=MagickTrue;
region.x=0;
region.y=0;
SvPV(ST(i),na));
return;
}
- channel=(ChannelType) option;
+ SetPixelChannelMapMask(image,(ChannelType) option);
break;
}
ThrowPerlException(exception,OptionError,"UnrecognizedAttribute",
scale=1.0;
if (normalize != MagickFalse)
scale=1.0/QuantumRange;
- if ((GetPixelRedTraits(image) & ActivePixelTrait) != 0)
+ if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
PUSHs(sv_2mortal(newSVnv(scale*GetPixelRed(image,p))));
- if ((GetPixelGreenTraits(image) & ActivePixelTrait) != 0)
+ if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
PUSHs(sv_2mortal(newSVnv(scale*GetPixelGreen(image,p))));
- if ((GetPixelBlueTraits(image) & ActivePixelTrait) != 0)
+ if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
PUSHs(sv_2mortal(newSVnv(scale*GetPixelBlue(image,p))));
- if (((GetPixelBlackTraits(image) & ActivePixelTrait) != 0) &&
+ if (((GetPixelBlackTraits(image) & UpdatePixelTrait) != 0) &&
(image->colorspace == CMYKColorspace))
PUSHs(sv_2mortal(newSVnv(scale*GetPixelBlack(image,p))));
- if ((GetPixelAlphaTraits(image) & ActivePixelTrait) != 0)
+ if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
PUSHs(sv_2mortal(newSVnv(scale*GetPixelAlpha(image,p))));
}
next->scene=scene++;
}
SetImageInfo(package_info->image_info,(unsigned int)
- GetImageListLength(image),&image->exception);
+ GetImageListLength(image),exception);
EXTEND(sp,(ssize_t) GetImageListLength(image));
for ( ; image; image=image->next)
{
case CompareOverlayLayer:
default:
{
- layers=CompareImageLayers(image,method,exception);
+ layers=CompareImagesLayers(image,method,exception);
break;
}
case MergeLayer:
case OptimizeTransLayer:
{
OptimizeImageTransparency(image,exception);
- InheritException(&(image->exception),exception);
break;
}
case RemoveDupsLayer:
{
RemoveDuplicateLayers(&image,exception);
- InheritException(&(image->exception),exception);
break;
}
case RemoveZeroLayer:
{
RemoveZeroDelayLayers(&image,exception);
- InheritException(&(image->exception),exception);
break;
}
case OptimizeLayer:
layers=CoalesceImages(image,exception);
if (layers == (Image *) NULL)
break;
- InheritException(&(layers->exception),exception);
image=layers;
layers=OptimizeImageLayers(image,exception);
if (layers == (Image *) NULL)
break;
- InheritException(&(layers->exception),exception);
image=DestroyImageList(image);
image=layers;
layers=(Image *) NULL;
OptimizeImageTransparency(image,exception);
- InheritException(&(image->exception),exception);
quantize_info=AcquireQuantizeInfo(info->image_info);
- (void) RemapImages(quantize_info,image,(Image *) NULL);
+ (void) RemapImages(quantize_info,image,(Image *) NULL,exception);
quantize_info=DestroyQuantizeInfo(quantize_info);
break;
}
image->rows,image->gravity,&geometry);
CompositeLayers(image,compose,source,geometry.x,geometry.y,exception);
source=DestroyImageList(source);
- InheritException(&(image->exception),exception);
break;
}
}
if (layers != (Image *) NULL)
- {
- InheritException(&(layers->exception),exception);
- image=layers;
- }
+ image=layers;
if ((image == (Image *) NULL) || (exception->severity >= ErrorException))
goto PerlException;
for ( ; image; image=image->next)
Magnify = 33
MagnifyImage = 34
MedianFilter = 35
- MedianFilterImage = 36
+ MedianConvolveImage = 36
Minify = 37
MinifyImage = 38
OilPaint = 39
ClipMaskImage = 212
LinearStretch = 213
LinearStretchImage = 214
- RecolorImage = 215
- Recolor = 216
+ ColorMatrix = 215
+ ColorMatrixImage = 216
Mask = 217
MaskImage = 218
Polaroid = 219
AutoLevel = 255
AutoLevelImage = 256
LevelColors = 257
- LevelColorsImage = 258
+ LevelImageColors = 258
Clamp = 259
ClampImage = 260
- Filter = 261
- FilterImage = 262
- BrightnessContrast = 263
- BrightnessContrastImage = 264
- Morphology = 265
- MorphologyImage = 266
- ColorMatrix = 267
- ColorMatrixImage = 268
- Color = 269
- ColorImage = 270
- Mode = 271
- ModeImage = 272
- Statistic = 273
- StatisticImage = 274
+ BrightnessContrast = 261
+ BrightnessContrastImage = 262
+ Morphology = 263
+ MorphologyImage = 264
+ Color = 265
+ ColorImage = 266
+ Mode = 267
+ ModeImage = 268
+ Statistic = 269
+ StatisticImage = 270
MogrifyRegion = 666
PPCODE:
{
message[MaxTextExtent];
ChannelType
- channel;
+ channel,
+ channel_mask;
CompositeOperator
compose;
MagickStatusType
flags;
- PixelPacket
+ PixelInfo
fill_color;
RectangleInfo
argument_list[0].string_reference=(char *) NULL;
(void) SetImageProperty(image,"comment",InterpretImageProperties(
info ? info->image_info : (ImageInfo *) NULL,image,
- argument_list[0].string_reference));
+ argument_list[0].string_reference,exception),exception);
break;
}
case 2: /* Label */
argument_list[0].string_reference=(char *) NULL;
(void) SetImageProperty(image,"label",InterpretImageProperties(
info ? info->image_info : (ImageInfo *) NULL,image,
- argument_list[0].string_reference));
+ argument_list[0].string_reference,exception),exception);
break;
}
case 3: /* AddNoise */
{
+ double
+ attenuate;
+
if (attribute_flag[0] == 0)
argument_list[0].integer_reference=UniformNoise;
+ attenuate=1.0;
if (attribute_flag[1] != 0)
- channel=(ChannelType) argument_list[1].integer_reference;
- image=AddNoiseImageChannel(image,channel,(NoiseType)
- argument_list[0].integer_reference,exception);
+ attenuate=argument_list[1].real_reference;
+ if (attribute_flag[2] != 0)
+ channel=(ChannelType) argument_list[2].integer_reference;
+ channel_mask=SetPixelChannelMask(image,channel);
+ image=AddNoiseImage(image,(NoiseType)
+ argument_list[0].integer_reference,attenuate,exception);
+ if (image != (Image *) NULL)
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 4: /* Colorize */
{
- PixelPacket
+ PixelInfo
target;
- (void) GetOneVirtualPixel(image,0,0,&target,exception);
+ Quantum
+ virtual_pixel[MaxPixelChannels];
+
+ GetPixelInfo(image,&target);
+ (void) GetOneVirtualPixel(image,0,0,virtual_pixel,exception);
+ target.red=virtual_pixel[RedPixelChannel];
+ target.green=virtual_pixel[GreenPixelChannel];
+ target.blue=virtual_pixel[BluePixelChannel];
+ target.alpha=virtual_pixel[AlphaPixelChannel];
if (attribute_flag[0] != 0)
- (void) QueryColorDatabase(argument_list[0].string_reference,&target,
- exception);
+ (void) QueryColorCompliance(argument_list[0].string_reference,
+ AllCompliance,&target,exception);
if (attribute_flag[1] == 0)
argument_list[1].string_reference="100%";
- image=ColorizeImage(image,argument_list[1].string_reference,target,
+ image=ColorizeImage(image,argument_list[1].string_reference,&target,
exception);
break;
}
case 5: /* Border */
{
+ CompositeOperator
+ compose;
+
geometry.width=0;
geometry.height=0;
if (attribute_flag[0] != 0)
if (attribute_flag[2] != 0)
geometry.height=argument_list[2].integer_reference;
if (attribute_flag[3] != 0)
- QueryColorDatabase(argument_list[3].string_reference,
- &image->border_color,exception);
+ QueryColorCompliance(argument_list[3].string_reference,
+ AllCompliance,&image->border_color,exception);
if (attribute_flag[4] != 0)
- QueryColorDatabase(argument_list[4].string_reference,
- &image->border_color,exception);
+ QueryColorCompliance(argument_list[4].string_reference,
+ AllCompliance,&image->border_color,exception);
if (attribute_flag[5] != 0)
- QueryColorDatabase(argument_list[5].string_reference,
- &image->border_color,exception);
+ QueryColorCompliance(argument_list[5].string_reference,
+ AllCompliance,&image->border_color,exception);
+ compose=image->compose;
if (attribute_flag[6] != 0)
- image->compose=(CompositeOperator) argument_list[6].integer_reference;
- image=BorderImage(image,&geometry,exception);
+ compose=(CompositeOperator) argument_list[6].integer_reference;
+ image=BorderImage(image,&geometry,compose,exception);
break;
}
case 6: /* Blur */
if (attribute_flag[2] != 0)
geometry_info.sigma=argument_list[2].real_reference;
if (attribute_flag[3] != 0)
- channel=(ChannelType) argument_list[3].integer_reference;
- image=BlurImageChannel(image,channel,geometry_info.rho,
- geometry_info.sigma,exception);
+ geometry_info.xi=argument_list[3].real_reference;
+ if (attribute_flag[4] != 0)
+ channel=(ChannelType) argument_list[4].integer_reference;
+ channel_mask=SetPixelChannelMask(image,channel);
+ image=BlurImage(image,geometry_info.rho,geometry_info.sigma,
+ geometry_info.xi,exception);
+ if (image != (Image *) NULL)
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 7: /* Chop */
if (attribute_flag[4] != 0)
geometry.y=argument_list[4].integer_reference;
if (attribute_flag[5] != 0)
- image->fuzz=
- SiPrefixToDouble(argument_list[5].string_reference,QuantumRange);
+ image->fuzz=StringToDoubleInterval(
+ argument_list[5].string_reference,(double) QuantumRange+1.0);
image=CropImage(image,&geometry,exception);
break;
}
{
if (attribute_flag[0] != 0)
geometry_info.rho=argument_list[0].real_reference;
- image=EdgeImage(image,geometry_info.rho,exception);
+ image=EdgeImage(image,geometry_info.rho,geometry_info.sigma,
+ exception);
break;
}
case 11: /* Emboss */
}
case 15: /* Frame */
{
+ CompositeOperator
+ compose;
+
FrameInfo
frame_info;
if (attribute_flag[4] != 0)
frame_info.outer_bevel=argument_list[4].integer_reference;
if (attribute_flag[5] != 0)
- QueryColorDatabase(argument_list[5].string_reference,&fill_color,
- exception);
+ QueryColorCompliance(argument_list[5].string_reference,
+ AllCompliance,&fill_color,exception);
if (attribute_flag[6] != 0)
- QueryColorDatabase(argument_list[6].string_reference,&fill_color,
- exception);
+ QueryColorCompliance(argument_list[6].string_reference,
+ AllCompliance,&fill_color,exception);
frame_info.x=(ssize_t) frame_info.width;
frame_info.y=(ssize_t) frame_info.height;
frame_info.width=image->columns+2*frame_info.x;
frame_info.height=image->rows+2*frame_info.y;
if ((attribute_flag[5] != 0) || (attribute_flag[6] != 0))
image->matte_color=fill_color;
+ compose=image->compose;
if (attribute_flag[7] != 0)
- image->compose=(CompositeOperator) argument_list[7].integer_reference;
- image=FrameImage(image,&frame_info,exception);
+ compose=(CompositeOperator) argument_list[7].integer_reference;
+ image=FrameImage(image,&frame_info,compose,exception);
break;
}
case 16: /* Implode */
{
+ PixelInterpolateMethod
+ method;
+
if (attribute_flag[0] == 0)
argument_list[0].real_reference=0.5;
+ method=UndefinedInterpolatePixel;
if (attribute_flag[1] != 0)
- image->interpolate=(InterpolatePixelMethod)
- argument_list[1].integer_reference;
+ method=(PixelInterpolateMethod) argument_list[1].integer_reference;
image=ImplodeImage(image,argument_list[0].real_reference,
- exception);
+ method,exception);
break;
}
case 17: /* Magnify */
flags=ParseGeometry(argument_list[0].string_reference,
&geometry_info);
if ((flags & SigmaValue) == 0)
- geometry_info.sigma=1.0;
+ geometry_info.sigma=geometry_info.rho;
}
if (attribute_flag[1] != 0)
geometry_info.rho=argument_list[1].real_reference;
geometry_info.sigma=argument_list[2].real_reference;
if (attribute_flag[3] != 0)
channel=(ChannelType) argument_list[3].integer_reference;
- image=StatisticImageChannel(image,channel,MedianStatistic,
- (size_t) geometry_info.rho,(size_t) geometry_info.sigma,exception);
+ channel_mask=SetPixelChannelMask(image,channel);
+ image=StatisticImage(image,MedianStatistic,(size_t) geometry_info.rho,
+ (size_t) geometry_info.sigma,exception);
+ if (image != (Image *) NULL)
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 19: /* Minify */
{
if (attribute_flag[0] == 0)
argument_list[0].real_reference=0.0;
+ if (attribute_flag[1] == 0)
+ argument_list[1].real_reference=1.0;
image=OilPaintImage(image,argument_list[0].real_reference,
- exception);
+ argument_list[1].real_reference,exception);
break;
}
case 21: /* ReduceNoise */
geometry_info.sigma=argument_list[2].real_reference;
if (attribute_flag[3] != 0)
channel=(ChannelType) argument_list[3].integer_reference;
- image=StatisticImageChannel(image,channel,NonpeakStatistic,
- (size_t) geometry_info.rho,(size_t) geometry_info.sigma,exception);
+ channel_mask=SetPixelChannelMask(image,channel);
+ image=StatisticImage(image,NonpeakStatistic,(size_t)
+ geometry_info.rho,(size_t) geometry_info.sigma,exception);
+ if (image != (Image *) NULL)
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 22: /* Roll */
if (attribute_flag[0] == 0)
argument_list[0].real_reference=90.0;
if (attribute_flag[1] != 0)
- QueryColorDatabase(argument_list[1].string_reference,
- &image->background_color,exception);
+ QueryColorCompliance(argument_list[1].string_reference,
+ AllCompliance,&image->background_color,exception);
if (attribute_flag[2] != 0)
- QueryColorDatabase(argument_list[2].string_reference,
- &image->background_color,exception);
+ QueryColorCompliance(argument_list[2].string_reference,
+ AllCompliance,&image->background_color,exception);
if (attribute_flag[3] != 0)
- QueryColorDatabase(argument_list[3].string_reference,
- &image->background_color,exception);
+ QueryColorCompliance(argument_list[3].string_reference,
+ AllCompliance,&image->background_color,exception);
image=RotateImage(image,argument_list[0].real_reference,exception);
break;
}
if (attribute_flag[2] != 0)
geometry_info.sigma=argument_list[2].real_reference;
if (attribute_flag[3] != 0)
- channel=(ChannelType) argument_list[3].integer_reference;
- image=SharpenImageChannel(image,channel,geometry_info.rho,
- geometry_info.sigma,exception);
+ geometry_info.xi=argument_list[3].real_reference;
+ if (attribute_flag[4] != 0)
+ channel=(ChannelType) argument_list[4].integer_reference;
+ channel_mask=SetPixelChannelMask(image,channel);
+ image=SharpenImage(image,geometry_info.rho,geometry_info.sigma,
+ geometry_info.xi,exception);
+ if (image != (Image *) NULL)
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 28: /* Shear */
if (attribute_flag[2] != 0)
geometry_info.sigma=argument_list[2].real_reference;
if (attribute_flag[3] != 0)
- QueryColorDatabase(argument_list[3].string_reference,
- &image->background_color,exception);
+ QueryColorCompliance(argument_list[3].string_reference,
+ AllCompliance,&image->background_color,exception);
if (attribute_flag[4] != 0)
- QueryColorDatabase(argument_list[4].string_reference,
- &image->background_color,exception);
+ QueryColorCompliance(argument_list[4].string_reference,
+ AllCompliance,&image->background_color,exception);
image=ShearImage(image,geometry_info.rho,geometry_info.sigma,
exception);
break;
}
case 29: /* Spread */
{
+ PixelInterpolateMethod
+ method;
+
if (attribute_flag[0] == 0)
argument_list[0].real_reference=1.0;
- image=SpreadImage(image,argument_list[0].real_reference,exception);
+ method=UndefinedInterpolatePixel;
+ if (attribute_flag[1] != 0)
+ method=(PixelInterpolateMethod) argument_list[1].integer_reference;
+ image=SpreadImage(image,argument_list[0].real_reference,method,
+ exception);
break;
}
case 30: /* Swirl */
{
+ PixelInterpolateMethod
+ method;
+
if (attribute_flag[0] == 0)
argument_list[0].real_reference=50.0;
+ method=UndefinedInterpolatePixel;
if (attribute_flag[1] != 0)
- image->interpolate=(InterpolatePixelMethod)
- argument_list[1].integer_reference;
- image=SwirlImage(image,argument_list[0].real_reference,exception);
+ method=(PixelInterpolateMethod) argument_list[1].integer_reference;
+ image=SwirlImage(image,argument_list[0].real_reference,
+ method,exception);
break;
}
case 31: /* Resize */
*text;
text=InterpretImageProperties(info ? info->image_info :
- (ImageInfo *) NULL,image,argument_list[0].string_reference);
+ (ImageInfo *) NULL,image,argument_list[0].string_reference,
+ exception);
(void) CloneString(&draw_info->text,text);
text=DestroyString(text);
}
(void) CloneString(&draw_info->density,
argument_list[3].string_reference);
if (attribute_flag[4] != 0)
- (void) QueryColorDatabase(argument_list[4].string_reference,
- &draw_info->undercolor,exception);
+ (void) QueryColorCompliance(argument_list[4].string_reference,
+ AllCompliance,&draw_info->undercolor,exception);
if (attribute_flag[5] != 0)
{
- (void) QueryColorDatabase(argument_list[5].string_reference,
- &draw_info->stroke,exception);
+ (void) QueryColorCompliance(argument_list[5].string_reference,
+ AllCompliance,&draw_info->stroke,exception);
if (argument_list[5].image_reference != (Image *) NULL)
draw_info->stroke_pattern=CloneImage(
argument_list[5].image_reference,0,0,MagickTrue,exception);
}
if (attribute_flag[6] != 0)
{
- (void) QueryColorDatabase(argument_list[6].string_reference,
- &draw_info->fill,exception);
+ (void) QueryColorCompliance(argument_list[6].string_reference,
+ AllCompliance,&draw_info->fill,exception);
if (argument_list[6].image_reference != (Image *) NULL)
draw_info->fill_pattern=CloneImage(
argument_list[6].image_reference,0,0,MagickTrue,exception);
geometry_info.sigma=geometry_info.xi;
}
if (attribute_flag[8] != 0)
- (void) QueryColorDatabase(argument_list[8].string_reference,
- &draw_info->fill,exception);
+ (void) QueryColorCompliance(argument_list[8].string_reference,
+ AllCompliance,&draw_info->fill,exception);
if (attribute_flag[11] != 0)
- draw_info->gravity=(GravityType) argument_list[11].integer_reference;
+ draw_info->gravity=(GravityType)
+ argument_list[11].integer_reference;
if (attribute_flag[25] != 0)
{
AV
if (attribute_flag[32] != 0)
draw_info->direction=(DirectionType)
argument_list[32].integer_reference;
- (void) AnnotateImage(image,draw_info);
+ (void) AnnotateImage(image,draw_info,exception);
draw_info=DestroyDrawInfo(draw_info);
break;
}
PixelInfo
target;
+ Quantum
+ virtual_pixel[MaxPixelChannels];
+
draw_info=CloneDrawInfo(info ? info->image_info :
(ImageInfo *) NULL,(DrawInfo *) NULL);
if (attribute_flag[0] != 0)
if (attribute_flag[2] != 0)
geometry.y=argument_list[2].integer_reference;
if (attribute_flag[3] != 0)
- (void) QueryColorDatabase(argument_list[3].string_reference,
- &draw_info->fill,exception);
- (void) GetOneVirtualMagickPixel(image,geometry.x,geometry.y,&target,
+ (void) QueryColorCompliance(argument_list[3].string_reference,
+ AllCompliance,&draw_info->fill,exception);
+ (void) GetOneVirtualPixel(image,geometry.x,geometry.y,virtual_pixel,
exception);
+ target.red=virtual_pixel[RedPixelChannel];
+ target.green=virtual_pixel[GreenPixelChannel];
+ target.blue=virtual_pixel[BluePixelChannel];
+ target.alpha=virtual_pixel[AlphaPixelChannel];
invert=MagickFalse;
if (attribute_flag[4] != 0)
{
- QueryMagickColor(argument_list[4].string_reference,&target,
- exception);
+ QueryColorCompliance(argument_list[4].string_reference,
+ AllCompliance,&target,exception);
invert=MagickTrue;
}
if (attribute_flag[5] != 0)
- image->fuzz=SiPrefixToDouble(argument_list[5].string_reference,
- QuantumRange);
+ image->fuzz=StringToDoubleInterval(
+ argument_list[5].string_reference,(double) QuantumRange+1.0);
if (attribute_flag[6] != 0)
invert=(MagickBooleanType) argument_list[6].integer_reference;
- (void) FloodfillPaintImage(image,DefaultChannels,draw_info,&target,
- geometry.x,geometry.y,invert);
+ (void) FloodfillPaintImage(image,draw_info,&target,geometry.x,
+ geometry.y,invert,exception);
draw_info=DestroyDrawInfo(draw_info);
break;
}
if (attribute_flag[6] != 0) /* opacity */
{
if (compose != DissolveCompositeOp)
- (void) SetImageOpacity(composite_image,(Quantum)
- SiPrefixToDouble(argument_list[6].string_reference,
- QuantumRange));
+ (void) SetImageAlpha(composite_image,(Quantum)
+ StringToDoubleInterval(argument_list[6].string_reference,
+ (double) QuantumRange+1.0),exception);
else
{
CacheView
*/
(void) CloneString(&image->geometry,
argument_list[6].string_reference);
- opacity=(Quantum) SiPrefixToDouble(
- argument_list[6].string_reference,QuantumRange);
+ opacity=(Quantum) StringToDoubleInterval(
+ argument_list[6].string_reference,(double) QuantumRange+
+ 1.0);
if (composite_image->matte != MagickTrue)
- (void) SetImageOpacity(composite_image,OpaqueAlpha);
+ (void) SetImageAlpha(composite_image,OpaqueAlpha,exception);
composite_view=AcquireCacheView(composite_image);
for (y=0; y < (ssize_t) composite_image->rows ; y++)
{
for (x=0; x < (ssize_t) composite_image->columns; x++)
{
if (GetPixelAlpha(image,q) == OpaqueAlpha)
- SetPixelAlpha(composite_image,ClampToQuantum(opacity),q);
+ SetPixelAlpha(composite_image,ClampToQuantum(opacity),
+ q);
q+=GetPixelChannels(composite_image);
}
sync=SyncCacheViewAuthenticPixels(composite_view,exception);
}
}
if (attribute_flag[9] != 0) /* "color=>" */
- QueryColorDatabase(argument_list[9].string_reference,
- &composite_image->background_color,exception);
+ QueryColorCompliance(argument_list[9].string_reference,
+ AllCompliance,&composite_image->background_color,exception);
if (attribute_flag[12] != 0) /* "interpolate=>" */
- image->interpolate=(InterpolatePixelMethod)
+ image->interpolate=(PixelInterpolateMethod)
argument_list[12].integer_reference;
if (attribute_flag[13] != 0) /* "args=>" */
(void) SetImageArtifact(composite_image,"compose:args",
if (rotate_image == (Image *) NULL)
break;
}
- if (attribute_flag[7] && argument_list[7].integer_reference) /* tile */
+ if ((attribute_flag[7] != 0) &&
+ (argument_list[7].integer_reference != 0)) /* tile */
{
ssize_t
x,
for (x=0; x < (ssize_t) image->columns; x+=(ssize_t) composite_image->columns)
{
if (attribute_flag[8] != 0) /* rotate */
- (void) CompositeImage(image,compose,rotate_image,x,y);
+ (void) CompositeImage(image,compose,rotate_image,x,y,
+ exception);
else
- (void) CompositeImage(image,compose,composite_image,x,y);
+ (void) CompositeImage(image,compose,composite_image,x,y,
+ exception);
}
if (attribute_flag[8] != 0) /* rotate */
rotate_image=DestroyImage(rotate_image);
Merge Y displacement into X displacement image.
*/
composite_image=CloneImage(composite_image,0,0,MagickTrue,
- &image->exception);
+ exception);
(void) CompositeImage(composite_image,CopyGreenCompositeOp,
- argument_list[10].image_reference,0,0);
+ argument_list[10].image_reference,0,0,exception);
}
else
{
Set a blending mask for the composition.
*/
image->mask=CloneImage(argument_list[10].image_reference,0,0,
- MagickTrue,&image->exception);
- (void) NegateImage(image->mask,MagickFalse);
+ MagickTrue,exception);
+ (void) NegateImage(image->mask,MagickFalse,exception);
}
}
if (attribute_flag[11] != 0) /* channel */
geometry.y);
flags=ParseGravityGeometry(image,composite_geometry,&geometry,
exception);
+ channel_mask=SetPixelChannelMask(image,channel);
if (attribute_flag[8] == 0) /* no rotate */
- CompositeImageChannel(image,channel,compose,composite_image,
- geometry.x,geometry.y);
+ CompositeImage(image,compose,composite_image,geometry.x,geometry.y,
+ exception);
else
{
/*
composite_image->columns)/2;
geometry.y-=(ssize_t) (rotate_image->rows-
composite_image->rows)/2;
- CompositeImageChannel(image,channel,compose,rotate_image,
- geometry.x,geometry.y);
+ CompositeImage(image,compose,rotate_image,geometry.x,geometry.y,
+ exception);
rotate_image=DestroyImage(rotate_image);
}
if (attribute_flag[10] != 0) /* mask */
else
image->mask=DestroyImage(image->mask);
}
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 36: /* Contrast */
if (attribute_flag[0] == 0)
argument_list[0].integer_reference=0;
(void) ContrastImage(image,argument_list[0].integer_reference != 0 ?
- MagickTrue : MagickFalse);
+ MagickTrue : MagickFalse,exception);
break;
}
case 37: /* CycleColormap */
{
if (attribute_flag[0] == 0)
argument_list[0].integer_reference=6;
- (void) CycleColormapImage(image,argument_list[0].integer_reference);
+ (void) CycleColormapImage(image,argument_list[0].integer_reference,
+ exception);
break;
}
case 38: /* Draw */
}
if (attribute_flag[3] != 0)
{
- (void) QueryColorDatabase(argument_list[3].string_reference,
- &draw_info->stroke,exception);
+ (void) QueryColorCompliance(argument_list[3].string_reference,
+ AllCompliance,&draw_info->stroke,exception);
if (argument_list[3].image_reference != (Image *) NULL)
draw_info->stroke_pattern=CloneImage(
argument_list[3].image_reference,0,0,MagickTrue,exception);
}
if (attribute_flag[4] != 0)
{
- (void) QueryColorDatabase(argument_list[4].string_reference,
- &draw_info->fill,exception);
+ (void) QueryColorCompliance(argument_list[4].string_reference,
+ AllCompliance,&draw_info->fill,exception);
if (argument_list[4].image_reference != (Image *) NULL)
draw_info->fill_pattern=CloneImage(
argument_list[4].image_reference,0,0,MagickTrue,exception);
(void) CloneString(&draw_info->font,
argument_list[6].string_reference);
if (attribute_flag[7] != 0)
- (void) QueryColorDatabase(argument_list[7].string_reference,
- &draw_info->border_color,exception);
+ (void) QueryColorCompliance(argument_list[7].string_reference,
+ AllCompliance,&draw_info->border_color,exception);
if (attribute_flag[8] != 0)
draw_info->affine.tx=argument_list[8].real_reference;
if (attribute_flag[9] != 0)
}
}
if (attribute_flag[23] != 0)
- image->interpolate=(InterpolatePixelMethod)
+ image->interpolate=(PixelInterpolateMethod)
argument_list[23].integer_reference;
if ((attribute_flag[24] != 0) &&
(draw_info->fill_pattern != (Image *) NULL))
if (attribute_flag[32] != 0)
draw_info->direction=(DirectionType)
argument_list[32].integer_reference;
- DrawImage(image,draw_info);
+ DrawImage(image,draw_info,exception);
draw_info=DestroyDrawInfo(draw_info);
break;
}
{
if (attribute_flag[0] != 0)
channel=(ChannelType) argument_list[0].integer_reference;
- EqualizeImageChannel(image,channel);
+ channel_mask=SetPixelChannelMask(image,channel);
+ EqualizeImage(image,exception);
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 40: /* Gamma */
(double) argument_list[4].real_reference);
argument_list[0].string_reference=message;
}
- if (strchr(argument_list[0].string_reference,',') != (char *) NULL)
- (void) GammaImage(image,argument_list[0].string_reference);
- else
- (void) GammaImageChannel(image,channel,InterpretLocaleValue(
- argument_list[0].string_reference,(char **) NULL));
+ (void) GammaImage(image,StringToDouble(
+ argument_list[0].string_reference,(char **) NULL),exception);
break;
}
case 41: /* Map */
quantize_info->dither_method=(DitherMethod)
argument_list[2].integer_reference;
(void) RemapImages(quantize_info,image,
- argument_list[0].image_reference);
+ argument_list[0].image_reference,exception);
quantize_info=DestroyQuantizeInfo(quantize_info);
break;
}
PixelInfo
target;
+ Quantum
+ virtual_pixel[MaxPixelChannels];
+
draw_info=CloneDrawInfo(info ? info->image_info : (ImageInfo *) NULL,
(DrawInfo *) NULL);
- if (attribute_flag[0] != 0)
if (attribute_flag[0] != 0)
flags=ParsePageGeometry(image,argument_list[0].string_reference,
&geometry,exception);
if (attribute_flag[2] != 0)
geometry.y=argument_list[2].integer_reference;
if (image->matte == MagickFalse)
- (void) SetImageOpacity(image,OpaqueAlpha);
- (void) GetOneVirtualMagickPixel(image,geometry.x,geometry.y,&target,
+ (void) SetImageAlpha(image,OpaqueAlpha,exception);
+ (void) GetOneVirtualPixel(image,geometry.x,geometry.y,virtual_pixel,
exception);
+ target.red=virtual_pixel[RedPixelChannel];
+ target.green=virtual_pixel[GreenPixelChannel];
+ target.blue=virtual_pixel[BluePixelChannel];
+ target.alpha=virtual_pixel[AlphaPixelChannel];
if (attribute_flag[4] != 0)
- QueryMagickColor(argument_list[4].string_reference,&target,
- exception);
+ QueryColorCompliance(argument_list[4].string_reference,
+ AllCompliance,&target,exception);
if (attribute_flag[3] != 0)
- target.alpha=SiPrefixToDouble(argument_list[3].string_reference,
- QuantumRange);
+ target.alpha=StringToDoubleInterval(
+ argument_list[3].string_reference,(double) (double) QuantumRange+
+ 1.0);
if (attribute_flag[5] != 0)
- image->fuzz=SiPrefixToDouble(argument_list[5].string_reference,
- QuantumRange);
+ image->fuzz=StringToDoubleInterval(
+ argument_list[5].string_reference,(double) QuantumRange+1.0);
invert=MagickFalse;
if (attribute_flag[6] != 0)
invert=(MagickBooleanType) argument_list[6].integer_reference;
- (void) FloodfillPaintImage(image,AlphaChannel,draw_info,&target,
- geometry.x,geometry.y,invert);
+ channel_mask=SetPixelChannelMask(image,AlphaChannel);
+ (void) FloodfillPaintImage(image,draw_info,&target,geometry.x,
+ geometry.y,invert,exception);
+ (void) SetPixelChannelMask(image,channel_mask);
draw_info=DestroyDrawInfo(draw_info);
break;
}
}
(void) FormatLocaleString(modulate,MaxTextExtent,"%.15g,%.15g,%.15g",
geometry_info.rho,geometry_info.sigma,geometry_info.xi);
- (void) ModulateImage(image,modulate);
+ (void) ModulateImage(image,modulate,exception);
break;
}
case 44: /* Negate */
argument_list[0].integer_reference=0;
if (attribute_flag[1] != 0)
channel=(ChannelType) argument_list[1].integer_reference;
- (void) NegateImageChannel(image,channel,
- argument_list[0].integer_reference != 0 ? MagickTrue : MagickFalse);
+ channel_mask=SetPixelChannelMask(image,channel);
+ (void) NegateImage(image,argument_list[0].integer_reference != 0 ?
+ MagickTrue : MagickFalse,exception);
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 45: /* Normalize */
{
if (attribute_flag[0] != 0)
channel=(ChannelType) argument_list[0].integer_reference;
- NormalizeImageChannel(image,channel);
+ channel_mask=SetPixelChannelMask(image,channel);
+ NormalizeImage(image,exception);
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 46: /* NumberColors */
fill_color,
target;
- (void) QueryMagickColor("none",&target,exception);
- (void) QueryMagickColor("none",&fill_color,exception);
+ (void) QueryColorCompliance("none",AllCompliance,&target,
+ exception);
+ (void) QueryColorCompliance("none",AllCompliance,&fill_color,
+ exception);
if (attribute_flag[0] != 0)
- (void) QueryMagickColor(argument_list[0].string_reference,
- &target,exception);
+ (void) QueryColorCompliance(argument_list[0].string_reference,
+ AllCompliance,&target,exception);
if (attribute_flag[1] != 0)
- (void) QueryMagickColor(argument_list[1].string_reference,
- &fill_color,exception);
+ (void) QueryColorCompliance(argument_list[1].string_reference,
+ AllCompliance,&fill_color,exception);
if (attribute_flag[2] != 0)
- image->fuzz=SiPrefixToDouble(argument_list[2].string_reference,
- QuantumRange);
+ image->fuzz=StringToDoubleInterval(
+ argument_list[2].string_reference,(double) QuantumRange+1.0);
if (attribute_flag[3] != 0)
channel=(ChannelType) argument_list[3].integer_reference;
invert=MagickFalse;
if (attribute_flag[4] != 0)
invert=(MagickBooleanType) argument_list[4].integer_reference;
- (void) OpaquePaintImageChannel(image,channel,&target,&fill_color,
- invert);
+ channel_mask=SetPixelChannelMask(image,channel);
+ (void) OpaquePaintImage(image,&target,&fill_color,invert,exception);
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 48: /* Quantize */
MagickTrue : MagickFalse;
if (attribute_flag[4] != 0)
quantize_info->measure_error=
- argument_list[4].integer_reference != 0 ? MagickTrue : MagickFalse;
+ argument_list[4].integer_reference != 0 ? MagickTrue :
+ MagickFalse;
if (attribute_flag[5] != 0)
- (void) QueryColorDatabase(argument_list[5].string_reference,
- &image->transparent_color,exception);
+ (void) QueryColorCompliance(argument_list[5].string_reference,
+ AllCompliance,&image->transparent_color,exception);
if (attribute_flag[5] && argument_list[5].integer_reference)
{
- (void) QuantizeImages(quantize_info,image);
+ (void) QuantizeImages(quantize_info,image,exception);
goto PerlException;
}
if (attribute_flag[6] != 0)
if ((image->storage_class == DirectClass) ||
(image->colors > quantize_info->number_colors) ||
(quantize_info->colorspace == GRAYColorspace))
- (void) QuantizeImage(quantize_info,image);
+ (void) QuantizeImage(quantize_info,image,exception);
else
- CompressImageColormap(image);
+ CompressImageColormap(image,exception);
quantize_info=DestroyQuantizeInfo(quantize_info);
break;
}
geometry.height=argument_list[2].integer_reference;
if (attribute_flag[3] == 0)
argument_list[3].integer_reference=1;
- (void) RaiseImage(image,&geometry,argument_list[3].integer_reference !=
- 0 ? MagickTrue : MagickFalse);
+ (void) RaiseImage(image,&geometry,
+ argument_list[3].integer_reference != 0 ? MagickTrue : MagickFalse,
+ exception);
break;
}
case 50: /* Segment */
verbose=argument_list[4].integer_reference != 0 ?
MagickTrue : MagickFalse;
(void) SegmentImage(image,colorspace,verbose,cluster_threshold,
- smoothing_threshold);
+ smoothing_threshold,exception);
break;
}
case 51: /* Signature */
{
- (void) SignatureImage(image);
+ (void) SignatureImage(image,exception);
break;
}
case 52: /* Solarize */
flags=ParseGeometry(argument_list[0].string_reference,
&geometry_info);
if (attribute_flag[1] != 0)
- geometry_info.rho=SiPrefixToDouble(argument_list[1].string_reference,
- QuantumRange);
- (void) SolarizeImage(image,geometry_info.rho);
+ geometry_info.rho=StringToDoubleInterval(
+ argument_list[1].string_reference,(double) QuantumRange+1.0);
+ (void) SolarizeImage(image,geometry_info.rho,exception);
break;
}
case 53: /* Sync */
{
- (void) SyncImage(image);
+ (void) SyncImage(image,exception);
break;
}
case 54: /* Texture */
{
if (attribute_flag[0] == 0)
break;
- TextureImage(image,argument_list[0].image_reference);
+ TextureImage(image,argument_list[0].image_reference,exception);
break;
}
case 55: /* Evalute */
op=(MagickEvaluateOperator) argument_list[1].integer_reference;
if (attribute_flag[2] != MagickFalse)
channel=(ChannelType) argument_list[2].integer_reference;
- (void) EvaluateImageChannel(image,channel,op,
- argument_list[0].real_reference,exception);
+ channel_mask=SetPixelChannelMask(image,channel);
+ (void) EvaluateImage(image,op,argument_list[0].real_reference,
+ exception);
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 56: /* Transparent */
PixelInfo
target;
- (void) QueryMagickColor("none",&target,exception);
+ (void) QueryColorCompliance("none",AllCompliance,&target,
+ exception);
if (attribute_flag[0] != 0)
- (void) QueryMagickColor(argument_list[0].string_reference,&target,
- exception);
+ (void) QueryColorCompliance(argument_list[0].string_reference,
+ AllCompliance,&target,exception);
opacity=TransparentAlpha;
if (attribute_flag[1] != 0)
- opacity=SiPrefixToDouble(argument_list[1].string_reference,
- QuantumRange);
+ opacity=StringToDoubleInterval(argument_list[1].string_reference,
+ (double) QuantumRange+1.0);
if (attribute_flag[2] != 0)
- image->fuzz=SiPrefixToDouble(argument_list[2].string_reference,
- QuantumRange);
+ image->fuzz=StringToDoubleInterval(
+ argument_list[2].string_reference,(double) QuantumRange+1.0);
if (attribute_flag[3] == 0)
argument_list[3].integer_reference=0;
invert=MagickFalse;
if (attribute_flag[3] != 0)
invert=(MagickBooleanType) argument_list[3].integer_reference;
(void) TransparentPaintImage(image,&target,ClampToQuantum(opacity),
- invert);
+ invert,exception);
break;
}
case 57: /* Threshold */
argument_list[0].string_reference="50%";
if (attribute_flag[1] != 0)
channel=(ChannelType) argument_list[1].integer_reference;
- threshold=SiPrefixToDouble(argument_list[0].string_reference,
- QuantumRange);
- (void) BilevelImageChannel(image,channel,threshold);
+ threshold=StringToDoubleInterval(argument_list[0].string_reference,
+ (double) QuantumRange+1.0);
+ channel_mask=SetPixelChannelMask(image,channel);
+ (void) BilevelImage(image,threshold,exception);
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 58: /* Charcoal */
geometry_info.rho=argument_list[1].real_reference;
if (attribute_flag[2] != 0)
geometry_info.sigma=argument_list[2].real_reference;
+ if (attribute_flag[3] != 0)
+ geometry_info.xi=argument_list[3].real_reference;
image=CharcoalImage(image,geometry_info.rho,geometry_info.sigma,
- exception);
+ geometry_info.xi,exception);
break;
}
case 59: /* Trim */
{
if (attribute_flag[0] != 0)
- image->fuzz=SiPrefixToDouble(argument_list[0].string_reference,
- QuantumRange);
+ image->fuzz=StringToDoubleInterval(
+ argument_list[0].string_reference,(double) QuantumRange+1.0);
image=TrimImage(image,exception);
break;
}
case 60: /* Wave */
{
+ PixelInterpolateMethod
+ method;
+
if (attribute_flag[0] != 0)
{
flags=ParseGeometry(argument_list[0].string_reference,
geometry_info.rho=argument_list[1].real_reference;
if (attribute_flag[2] != 0)
geometry_info.sigma=argument_list[2].real_reference;
+ method=UndefinedInterpolatePixel;
if (attribute_flag[3] != 0)
- image->interpolate=(InterpolatePixelMethod)
- argument_list[3].integer_reference;
+ method=(PixelInterpolateMethod) argument_list[3].integer_reference;
image=WaveImage(image,geometry_info.rho,geometry_info.sigma,
- exception);
+ method,exception);
break;
}
case 61: /* Separate */
{
if (attribute_flag[0] != 0)
channel=(ChannelType) argument_list[0].integer_reference;
- (void) SeparateImageChannel(image,channel);
+ channel_mask=SetPixelChannelMask(image,channel);
+ (void) SeparateImage(image,exception);
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 63: /* Stereo */
}
case 65: /* Deconstruct */
{
- image=CompareImageLayers(image,CompareAnyLayer,exception);
+ image=CompareImagesLayers(image,CompareAnyLayer,exception);
break;
}
case 66: /* GaussianBlur */
if (attribute_flag[2] != 0)
geometry_info.sigma=argument_list[2].real_reference;
if (attribute_flag[3] != 0)
- channel=(ChannelType) argument_list[3].integer_reference;
- image=GaussianBlurImageChannel(image,channel,geometry_info.rho,
- geometry_info.sigma,exception);
+ geometry_info.xi=argument_list[3].real_reference;
+ if (attribute_flag[4] != 0)
+ channel=(ChannelType) argument_list[4].integer_reference;
+ channel_mask=SetPixelChannelMask(image,channel);
+ image=GaussianBlurImage(image,geometry_info.rho,geometry_info.sigma,
+ geometry_info.xi,exception);
+ if (image != (Image *) NULL)
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 67: /* Convolve */
{
- AV
- *av;
-
- double
+ KernelInfo
*kernel;
- size_t
- order;
-
- if (attribute_flag[0] == 0)
+ kernel=(KernelInfo *) NULL;
+ if ((attribute_flag[0] == 0) && (attribute_flag[3] == 0))
break;
+ if (attribute_flag[0] != 0)
+ {
+ AV
+ *av;
+
+ size_t
+ order;
+
+ kernel=AcquireKernelInfo((const char *) NULL);
+ if (kernel == (KernelInfo *) NULL)
+ break;
+ av=(AV *) argument_list[0].array_reference;
+ order=(size_t) sqrt(av_len(av)+1);
+ kernel->width=order;
+ kernel->height=order;
+ kernel->values=(double *) AcquireAlignedMemory(order,order*
+ sizeof(*kernel->values));
+ if (kernel->values == (double *) NULL)
+ {
+ kernel=DestroyKernelInfo(kernel);
+ ThrowPerlException(exception,ResourceLimitFatalError,
+ "MemoryAllocationFailed",PackageName);
+ goto PerlException;
+ }
+ for (j=0; (j < (ssize_t) (order*order)) && (j < (av_len(av)+1)); j++)
+ kernel->values[j]=(double) SvNV(*(av_fetch(av,j,0)));
+ for ( ; j < (ssize_t) (order*order); j++)
+ kernel->values[j]=0.0;
+ }
if (attribute_flag[1] != 0)
channel=(ChannelType) argument_list[1].integer_reference;
if (attribute_flag[2] != 0)
- image->bias=SiPrefixToDouble(argument_list[2].string_reference,
- QuantumRange);
- av=(AV *) argument_list[0].array_reference;
- order=(size_t) sqrt(av_len(av)+1);
- kernel=(double *) AcquireQuantumMemory(order,order*sizeof(*kernel));
- if (kernel == (double *) NULL)
+ image->bias=StringToDoubleInterval(
+ argument_list[2].string_reference,(double) QuantumRange+1.0);
+ if (attribute_flag[3] != 0)
{
- ThrowPerlException(exception,ResourceLimitFatalError,
- "MemoryAllocationFailed",PackageName);
- goto PerlException;
+ kernel=AcquireKernelInfo(argument_list[3].string_reference);
+ if (kernel == (KernelInfo *) NULL)
+ break;
}
- for (j=0; (j < (ssize_t) (order*order)) && (j < (av_len(av)+1)); j++)
- kernel[j]=(double) SvNV(*(av_fetch(av,j,0)));
- for ( ; j < (ssize_t) (order*order); j++)
- kernel[j]=0.0;
- image=ConvolveImageChannel(image,channel,order,kernel,exception);
- kernel=(double *) RelinquishMagickMemory(kernel);
+ channel_mask=SetPixelChannelMask(image,channel);
+ kernel->bias=image->bias;
+ image=ConvolveImage(image,kernel,exception);
+ if (image != (Image *) NULL)
+ (void) SetPixelChannelMask(image,channel_mask);
+ kernel=DestroyKernelInfo(kernel);
break;
}
case 68: /* Profile */
Remove a profile from the image.
*/
(void) ProfileImage(image,name,(const unsigned char *) NULL,0,
- MagickTrue);
+ exception);
break;
}
/*
SetStringInfoDatum(profile,(const unsigned char *)
argument_list[1].string_reference);
(void) ProfileImage(image,name,GetStringInfoDatum(profile),
- (size_t) GetStringInfoLength(profile),MagickFalse);
+ (size_t) GetStringInfoLength(profile),exception);
profile=DestroyStringInfo(profile);
break;
}
profile_info=
CloneImageInfo(info ? info->image_info : (ImageInfo *) NULL);
(void) CopyMagickString(profile_info->filename,name,MaxTextExtent);
- profile_image=ReadImages(profile_info,&image->exception);
+ profile_image=ReadImages(profile_info,exception);
if (profile_image == (Image *) NULL)
break;
ResetImageProfileIterator(profile_image);
profile=GetImageProfile(profile_image,name);
if (profile != (const StringInfo *) NULL)
(void) ProfileImage(image,name,GetStringInfoDatum(profile),
- (size_t) GetStringInfoLength(profile),MagickFalse);
+ (size_t) GetStringInfoLength(profile),exception);
name=GetNextImageProfile(profile_image);
}
profile_image=DestroyImage(profile_image);
geometry_info.psi=argument_list[4].real_reference;
if (attribute_flag[5] != 0)
channel=(ChannelType) argument_list[5].integer_reference;
- image=UnsharpMaskImageChannel(image,channel,geometry_info.rho,
- geometry_info.sigma,geometry_info.xi,geometry_info.psi,exception);
+ channel_mask=SetPixelChannelMask(image,channel);
+ image=UnsharpMaskImage(image,geometry_info.rho,geometry_info.sigma,
+ geometry_info.xi,geometry_info.psi,exception);
+ if (image != (Image *) NULL)
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 70: /* MotionBlur */
if (attribute_flag[3] != 0)
geometry_info.xi=argument_list[3].real_reference;
if (attribute_flag[4] != 0)
- channel=(ChannelType) argument_list[4].integer_reference;
- image=MotionBlurImageChannel(image,channel,geometry_info.rho,
- geometry_info.sigma,geometry_info.xi,exception);
+ geometry_info.psi=argument_list[4].real_reference;
+ if (attribute_flag[5] != 0)
+ channel=(ChannelType) argument_list[5].integer_reference;
+ channel_mask=SetPixelChannelMask(image,channel);
+ image=MotionBlurImage(image,geometry_info.rho,geometry_info.sigma,
+ geometry_info.xi,geometry_info.psi,exception);
+ if (image != (Image *) NULL)
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 71: /* OrderedDither */
argument_list[0].string_reference="o8x8";
if (attribute_flag[1] != 0)
channel=(ChannelType) argument_list[1].integer_reference;
- (void) OrderedPosterizeImageChannel(image,channel,
- argument_list[0].string_reference,exception);
+ channel_mask=SetPixelChannelMask(image,channel);
+ (void) OrderedPosterizeImage(image,argument_list[0].string_reference,
+ exception);
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 72: /* Shave */
argument_list[0].real_reference=argument_list[5].real_reference;
attribute_flag[0]=attribute_flag[5];
}
- (void) LevelImageChannel(image,channel,black_point,white_point,gamma);
+ channel_mask=SetPixelChannelMask(image,channel);
+ (void) LevelImage(image,black_point,white_point,gamma,exception);
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 74: /* Clip */
if (attribute_flag[1] == 0)
argument_list[1].integer_reference=MagickTrue;
(void) ClipImagePath(image,argument_list[0].string_reference,
- argument_list[1].integer_reference != 0 ? MagickTrue : MagickFalse);
+ argument_list[1].integer_reference != 0 ? MagickTrue : MagickFalse,
+ exception);
break;
}
case 75: /* AffineTransform */
current.rx*affine.tx+current.sy*affine.ty+current.ty;
}
if (attribute_flag[6] != 0)
- image->interpolate=(InterpolatePixelMethod)
+ image->interpolate=(PixelInterpolateMethod)
argument_list[6].integer_reference;
if (attribute_flag[7] != 0)
- QueryColorDatabase(argument_list[7].string_reference,
- &image->background_color,exception);
+ QueryColorCompliance(argument_list[7].string_reference,
+ AllCompliance,&image->background_color,exception);
image=AffineTransformImage(image,&draw_info->affine,exception);
draw_info=DestroyDrawInfo(draw_info);
break;
goto PerlException;
}
if (attribute_flag[1] != 0)
- image->fuzz=SiPrefixToDouble(argument_list[1].string_reference,
- QuantumRange);
- (void) IsImagesEqual(image,argument_list[0].image_reference);
+ image->fuzz=StringToDoubleInterval(
+ argument_list[1].string_reference,(double) QuantumRange+1.0);
+ (void) IsImagesEqual(image,argument_list[0].image_reference,
+ exception);
break;
}
case 77: /* AdaptiveThreshold */
if (attribute_flag[3] != 0)
geometry_info.xi=argument_list[3].integer_reference;;
image=AdaptiveThresholdImage(image,(size_t) geometry_info.rho,
- (size_t) geometry_info.sigma,(ssize_t) geometry_info.xi,
- exception);
+ (size_t) geometry_info.sigma,(double) geometry_info.xi,exception);
break;
}
case 78: /* Resample */
if (attribute_flag[5] != 0)
argument_list[5].real_reference=1.0;
width=(size_t) (geometry_info.rho*image->columns/
- (image->x_resolution == 0.0 ? 72.0 : image->x_resolution)+0.5);
+ (image->resolution.x == 0.0 ? 72.0 : image->resolution.x)+0.5);
height=(size_t) (geometry_info.sigma*image->rows/
- (image->y_resolution == 0.0 ? 72.0 : image->y_resolution)+0.5);
+ (image->resolution.y == 0.0 ? 72.0 : image->resolution.y)+0.5);
image=ResizeImage(image,width,height,(FilterTypes)
argument_list[3].integer_reference,argument_list[5].real_reference,
exception);
if (image != (Image *) NULL)
{
- image->x_resolution=geometry_info.rho;
- image->y_resolution=geometry_info.sigma;
+ image->resolution.x=geometry_info.rho;
+ image->resolution.y=geometry_info.sigma;
}
break;
}
(void) SetImageArtifact(image,"identify:features",
argument_list[1].string_reference);
(void) IdentifyImage(image,argument_list[0].file_reference,
- MagickTrue);
+ MagickTrue,exception);
break;
}
case 80: /* BlackThreshold */
argument_list[0].string_reference="50%";
if (attribute_flag[2] != 0)
channel=(ChannelType) argument_list[2].integer_reference;
- BlackThresholdImageChannel(image,channel,
- argument_list[0].string_reference,exception);
+ channel_mask=SetPixelChannelMask(image,channel);
+ BlackThresholdImage(image,argument_list[0].string_reference,
+ exception);
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 81: /* WhiteThreshold */
argument_list[0].string_reference="50%";
if (attribute_flag[2] != 0)
channel=(ChannelType) argument_list[2].integer_reference;
- WhiteThresholdImageChannel(image,channel,
- argument_list[0].string_reference,exception);
+ channel_mask=SetPixelChannelMask(image,channel);
+ WhiteThresholdImage(image,argument_list[0].string_reference,
+ exception);
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 82: /* RadialBlur */
{
flags=ParseGeometry(argument_list[0].string_reference,
&geometry_info);
- if ((flags & SigmaValue) == 0)
- geometry_info.sigma=1.0;
}
if (attribute_flag[1] != 0)
geometry_info.rho=argument_list[1].real_reference;
if (attribute_flag[2] != 0)
- channel=(ChannelType) argument_list[2].integer_reference;
- image=RadialBlurImageChannel(image,channel,geometry_info.rho,
+ geometry_info.sigma=argument_list[2].real_reference;
+ if (attribute_flag[3] != 0)
+ channel=(ChannelType) argument_list[3].integer_reference;
+ channel_mask=SetPixelChannelMask(image,channel);
+ image=RadialBlurImage(image,geometry_info.rho,geometry_info.sigma,
exception);
+ if (image != (Image *) NULL)
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 83: /* Thumbnail */
}
case 84: /* Strip */
{
- (void) StripImage(image);
+ (void) StripImage(image,exception);
break;
}
case 85: /* Tint */
{
- PixelPacket
- target;
+ PixelInfo
+ tint;
- (void) GetOneVirtualPixel(image,0,0,&target,exception);
+ GetPixelInfo(image,&tint);
if (attribute_flag[0] != 0)
- (void) QueryColorDatabase(argument_list[0].string_reference,&target,
- exception);
+ (void) QueryColorCompliance(argument_list[0].string_reference,
+ AllCompliance,&tint,exception);
if (attribute_flag[1] == 0)
argument_list[1].string_reference="100";
- image=TintImage(image,argument_list[1].string_reference,target,
+ image=TintImage(image,argument_list[1].string_reference,&tint,
exception);
break;
}
{
if (attribute_flag[0] != 0)
channel=(ChannelType) argument_list[0].integer_reference;
- (void) SeparateImageChannel(image,channel);
+ channel_mask=SetPixelChannelMask(image,channel);
+ (void) SeparateImage(image,exception);
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 87: /* Splice */
if (attribute_flag[4] != 0)
geometry.y=argument_list[4].integer_reference;
if (attribute_flag[5] != 0)
- image->fuzz=SiPrefixToDouble(argument_list[5].string_reference,
- QuantumRange);
+ image->fuzz=StringToDoubleInterval(
+ argument_list[5].string_reference,(double) QuantumRange+1.0);
if (attribute_flag[6] != 0)
- (void) QueryColorDatabase(argument_list[6].string_reference,
- &image->background_color,exception);
+ (void) QueryColorCompliance(argument_list[6].string_reference,
+ AllCompliance,&image->background_color,exception);
if (attribute_flag[7] != 0)
image->gravity=(GravityType) argument_list[7].integer_reference;
image=SpliceImage(image,&geometry,exception);
if (attribute_flag[1] == 0)
argument_list[1].integer_reference=0;
(void) PosterizeImage(image,argument_list[0].integer_reference,
- argument_list[1].integer_reference ? MagickTrue : MagickFalse);
+ argument_list[1].integer_reference ? MagickTrue : MagickFalse,
+ exception);
break;
}
case 89: /* Shadow */
geometry_info.xi=argument_list[3].integer_reference;
if (attribute_flag[4] != 0)
geometry_info.psi=argument_list[4].integer_reference;
- image=ShadowImage(image,geometry_info.rho,geometry_info.sigma,
- (ssize_t) ceil(geometry_info.xi-0.5),(ssize_t) ceil(geometry_info.psi-
- 0.5),exception);
+ image=ShadowImage(image,geometry_info.rho,geometry_info.sigma,0.0,
+ (ssize_t) ceil(geometry_info.xi-0.5),(ssize_t)
+ ceil(geometry_info.psi-0.5),exception);
break;
}
case 90: /* Identify */
(argument_list[2].integer_reference != 0))
(void) SetImageArtifact(image,"identify:unique","true");
(void) IdentifyImage(image,argument_list[0].file_reference,
- MagickTrue);
+ MagickTrue,exception);
break;
}
case 91: /* SepiaTone */
if (attribute_flag[4] != 0)
sharpen=argument_list[4].integer_reference != 0 ? MagickTrue :
MagickFalse;
- (void) SigmoidalContrastImageChannel(image,channel,sharpen,
- geometry_info.rho,geometry_info.sigma);
+ channel_mask=SetPixelChannelMask(image,channel);
+ (void) SigmoidalContrastImage(image,sharpen,geometry_info.rho,
+ geometry_info.sigma,exception);
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 93: /* Extent */
if (attribute_flag[4] != 0)
geometry.y=argument_list[4].integer_reference;
if (attribute_flag[5] != 0)
- image->fuzz=SiPrefixToDouble(argument_list[5].string_reference,
- QuantumRange);
+ image->fuzz=StringToDoubleInterval(
+ argument_list[5].string_reference,(double) QuantumRange+1.0);
if (attribute_flag[6] != 0)
- (void) QueryColorDatabase(argument_list[6].string_reference,
- &image->background_color,exception);
+ (void) QueryColorCompliance(argument_list[6].string_reference,
+ AllCompliance,&image->background_color,exception);
image=ExtentImage(image,&geometry,exception);
break;
}
if (attribute_flag[4] != 0)
geometry_info.psi=argument_list[4].integer_reference;
if (attribute_flag[5] != 0)
- (void) QueryColorDatabase(argument_list[5].string_reference,
- &image->background_color,exception);
- image=VignetteImage(image,geometry_info.rho,geometry_info.sigma,
- (ssize_t) ceil(geometry_info.xi-0.5),(ssize_t) ceil(geometry_info.psi-
- 0.5),exception);
+ (void) QueryColorCompliance(argument_list[5].string_reference,
+ AllCompliance,&image->background_color,exception);
+ image=VignetteImage(image,geometry_info.rho,geometry_info.sigma,0.0,
+ (ssize_t) ceil(geometry_info.xi-0.5),(ssize_t)
+ ceil(geometry_info.psi-0.5),exception);
break;
}
case 95: /* ContrastStretch */
white_point=argument_list[2].real_reference;
if (attribute_flag[4] != 0)
channel=(ChannelType) argument_list[4].integer_reference;
- (void) ContrastStretchImageChannel(image,channel,black_point,
- white_point);
+ channel_mask=SetPixelChannelMask(image,channel);
+ (void) ContrastStretchImage(image,black_point,white_point,exception);
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 96: /* Sans0 */
&geometry_info);
if ((flags & SigmaValue) == 0)
geometry_info.sigma=1.0;
+ if ((flags & XiValue) == 0)
+ geometry_info.xi=0.0;
}
if (attribute_flag[1] != 0)
geometry_info.rho=argument_list[1].real_reference;
if (attribute_flag[2] != 0)
geometry_info.sigma=argument_list[2].real_reference;
if (attribute_flag[3] != 0)
- channel=(ChannelType) argument_list[3].integer_reference;
- image=AdaptiveSharpenImageChannel(image,channel,geometry_info.rho,
- geometry_info.sigma,exception);
+ geometry_info.xi=argument_list[3].real_reference;
+ if (attribute_flag[4] != 0)
+ channel=(ChannelType) argument_list[4].integer_reference;
+ channel_mask=SetPixelChannelMask(image,channel);
+ image=AdaptiveSharpenImage(image,geometry_info.rho,
+ geometry_info.sigma,geometry_info.xi,exception);
+ if (image != (Image *) NULL)
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 99: /* Transpose */
&geometry_info);
if ((flags & SigmaValue) == 0)
geometry_info.sigma=1.0;
+ if ((flags & XiValue) == 0)
+ geometry_info.xi=0.0;
}
if (attribute_flag[1] != 0)
geometry_info.rho=argument_list[1].real_reference;
if (attribute_flag[2] != 0)
geometry_info.sigma=argument_list[2].real_reference;
if (attribute_flag[3] != 0)
- channel=(ChannelType) argument_list[3].integer_reference;
- image=AdaptiveBlurImageChannel(image,channel,geometry_info.rho,
- geometry_info.sigma,exception);
+ geometry_info.xi=argument_list[3].real_reference;
+ if (attribute_flag[4] != 0)
+ channel=(ChannelType) argument_list[4].integer_reference;
+ channel_mask=SetPixelChannelMask(image,channel);
+ image=AdaptiveBlurImage(image,geometry_info.rho,geometry_info.sigma,
+ geometry_info.xi,exception);
+ if (image != (Image *) NULL)
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 103: /* Sketch */
geometry_info.sigma=argument_list[2].real_reference;
if (attribute_flag[3] != 0)
geometry_info.xi=argument_list[3].real_reference;
+ if (attribute_flag[4] != 0)
+ geometry_info.psi=argument_list[4].real_reference;
image=SketchImage(image,geometry_info.rho,geometry_info.sigma,
- geometry_info.xi,exception);
+ geometry_info.xi,geometry_info.psi,exception);
break;
}
case 104: /* UniqueColors */
}
case 105: /* AdaptiveResize */
{
+ PixelInterpolateMethod
+ method;
+
if (attribute_flag[0] != 0)
flags=ParseRegionGeometry(image,argument_list[0].string_reference,
&geometry,exception);
argument_list[4].string_reference);
if (attribute_flag[5] != 0)
image->blur=argument_list[5].real_reference;
+ method=UndefinedInterpolatePixel;
+ if (attribute_flag[6] != 0)
+ method=(PixelInterpolateMethod) argument_list[6].integer_reference;
image=AdaptiveResizeImage(image,geometry.width,geometry.height,
- exception);
+ method,exception);
break;
}
case 106: /* ClipMask */
}
image->clip_mask=CloneImage(argument_list[0].image_reference,0,0,
MagickTrue,exception);
- (void) NegateImage(image->clip_mask,MagickFalse);
+ (void) NegateImage(image->clip_mask,MagickFalse,exception);
break;
}
case 107: /* LinearStretch */
black_point=argument_list[1].real_reference;
if (attribute_flag[2] != 0)
white_point=argument_list[2].real_reference;
- (void) LinearStretchImage(image,black_point,white_point);
+ (void) LinearStretchImage(image,black_point,white_point,exception);
+ break;
+ }
+ case 108: /* ColorMatrix */
+ {
+ AV
+ *av;
+
+ double
+ *color_matrix;
+
+ KernelInfo
+ *kernel_info;
+
+ size_t
+ order;
+
+ if (attribute_flag[0] == 0)
+ break;
+ av=(AV *) argument_list[0].array_reference;
+ order=(size_t) sqrt(av_len(av)+1);
+ color_matrix=(double *) AcquireQuantumMemory(order,order*
+ sizeof(*color_matrix));
+ if (color_matrix == (double *) NULL)
+ {
+ ThrowPerlException(exception,ResourceLimitFatalError,
+ "MemoryAllocationFailed",PackageName);
+ goto PerlException;
+ }
+ for (j=0; (j < (ssize_t) (order*order)) && (j < (av_len(av)+1)); j++)
+ color_matrix[j]=(double) SvNV(*(av_fetch(av,j,0)));
+ for ( ; j < (ssize_t) (order*order); j++)
+ color_matrix[j]=0.0;
+ kernel_info=AcquireKernelInfo((const char *) NULL);
+ if (kernel_info == (KernelInfo *) NULL)
+ break;
+ kernel_info->width=order;
+ kernel_info->height=order;
+ kernel_info->values=color_matrix;
+ image=ColorMatrixImage(image,kernel_info,exception);
+ kernel_info->values=(double *) NULL;
+ kernel_info=DestroyKernelInfo(kernel_info);
+ color_matrix=(double *) RelinquishMagickMemory(color_matrix);
break;
}
case 109: /* Mask */
}
image->mask=CloneImage(argument_list[0].image_reference,0,0,
MagickTrue,exception);
- (void) NegateImage(image->mask,MagickFalse);
+ (void) NegateImage(image->mask,MagickFalse,exception);
break;
}
case 110: /* Polaroid */
{
+ char
+ *caption;
+
DrawInfo
*draw_info;
double
angle;
+ PixelInterpolateMethod
+ method;
+
draw_info=CloneDrawInfo(info ? info->image_info : (ImageInfo *) NULL,
(DrawInfo *) NULL);
+ caption=(char *) NULL;
if (attribute_flag[0] != 0)
- (void) SetImageProperty(image,"caption",InterpretImageProperties(
- info ? info->image_info : (ImageInfo *) NULL,image,
- argument_list[0].string_reference));
+ caption=InterpretImageProperties(info ? info->image_info :
+ (ImageInfo *) NULL,image,argument_list[0].string_reference,
+ exception);
angle=0.0;
if (attribute_flag[1] != 0)
angle=argument_list[1].real_reference;
(void) CloneString(&draw_info->font,
argument_list[2].string_reference);
if (attribute_flag[3] != 0)
- (void) QueryColorDatabase(argument_list[3].string_reference,
- &draw_info->stroke,exception);
+ (void) QueryColorCompliance(argument_list[3].string_reference,
+ AllCompliance,&draw_info->stroke,exception);
if (attribute_flag[4] != 0)
- (void) QueryColorDatabase(argument_list[4].string_reference,
- &draw_info->fill,exception);
+ (void) QueryColorCompliance(argument_list[4].string_reference,
+ AllCompliance,&draw_info->fill,exception);
if (attribute_flag[5] != 0)
draw_info->stroke_width=argument_list[5].real_reference;
if (attribute_flag[6] != 0)
if (attribute_flag[7] != 0)
draw_info->gravity=(GravityType) argument_list[7].integer_reference;
if (attribute_flag[8] != 0)
- (void) QueryColorDatabase(argument_list[8].string_reference,
- &image->background_color,exception);
- image=PolaroidImage(image,draw_info,angle,exception);
+ (void) QueryColorCompliance(argument_list[8].string_reference,
+ AllCompliance,&image->background_color,exception);
+ method=UndefinedInterpolatePixel;
+ if (attribute_flag[9] != 0)
+ method=(PixelInterpolateMethod) argument_list[9].integer_reference;
+ image=PolaroidImage(image,draw_info,caption,angle,method,exception);
draw_info=DestroyDrawInfo(draw_info);
+ if (caption != (char *) NULL)
+ caption=DestroyString(caption);
break;
}
case 111: /* FloodfillPaint */
PixelInfo
target;
+ Quantum
+ virtual_pixel[MaxPixelChannels];
+
draw_info=CloneDrawInfo(info ? info->image_info :
(ImageInfo *) NULL,(DrawInfo *) NULL);
if (attribute_flag[0] != 0)
if (attribute_flag[2] != 0)
geometry.y=argument_list[2].integer_reference;
if (attribute_flag[3] != 0)
- (void) QueryColorDatabase(argument_list[3].string_reference,
- &draw_info->fill,exception);
- (void) GetOneVirtualMagickPixel(image,geometry.x,geometry.y,&target,
+ (void) QueryColorCompliance(argument_list[3].string_reference,
+ AllCompliance,&draw_info->fill,exception);
+ (void) GetOneVirtualPixel(image,geometry.x,geometry.y,virtual_pixel,
exception);
+ target.red=virtual_pixel[RedPixelChannel];
+ target.green=virtual_pixel[GreenPixelChannel];
+ target.blue=virtual_pixel[BluePixelChannel];
+ target.alpha=virtual_pixel[AlphaPixelChannel];
if (attribute_flag[4] != 0)
- QueryMagickColor(argument_list[4].string_reference,&target,
- exception);
+ QueryColorCompliance(argument_list[4].string_reference,
+ AllCompliance,&target,exception);
if (attribute_flag[5] != 0)
- image->fuzz=SiPrefixToDouble(argument_list[5].string_reference,
- QuantumRange);
+ image->fuzz=StringToDoubleInterval(
+ argument_list[5].string_reference,(double) QuantumRange+1.0);
if (attribute_flag[6] != 0)
channel=(ChannelType) argument_list[6].integer_reference;
invert=MagickFalse;
if (attribute_flag[7] != 0)
invert=(MagickBooleanType) argument_list[7].integer_reference;
- (void) FloodfillPaintImage(image,channel,draw_info,&target,geometry.x,
- geometry.y,invert);
+ channel_mask=SetPixelChannelMask(image,channel);
+ (void) FloodfillPaintImage(image,draw_info,&target,geometry.x,
+ geometry.y,invert,exception);
+ (void) SetPixelChannelMask(image,channel_mask);
draw_info=DestroyDrawInfo(draw_info);
break;
}
}
case 113: /* Clut */
{
+ PixelInterpolateMethod
+ method;
+
if (attribute_flag[0] == 0)
{
ThrowPerlException(exception,OptionError,"ClutImageRequired",
PackageName);
goto PerlException;
}
+ method=UndefinedInterpolatePixel;
if (attribute_flag[1] != 0)
- channel=(ChannelType) argument_list[1].integer_reference;
- (void) ClutImageChannel(image,channel,
- argument_list[0].image_reference);
+ method=(PixelInterpolateMethod) argument_list[1].integer_reference;
+ if (attribute_flag[2] != 0)
+ channel=(ChannelType) argument_list[2].integer_reference;
+ channel_mask=SetPixelChannelMask(image,channel);
+ (void) ClutImage(image,argument_list[0].image_reference,method,
+ exception);
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 114: /* LiquidRescale */
flags=ParseGeometry(argument_list[0].string_reference,
&geometry_info);
if (attribute_flag[1] != 0)
- geometry_info.rho=SiPrefixToDouble(
- argument_list[1].string_reference,QuantumRange);
+ geometry_info.rho=StringToDoubleInterval(
+ argument_list[1].string_reference,(double) QuantumRange+1.0);
image=DeskewImage(image,geometry_info.rho,exception);
break;
}
quantize_info->dither_method=(DitherMethod)
argument_list[2].integer_reference;
(void) RemapImages(quantize_info,image,
- argument_list[0].image_reference);
+ argument_list[0].image_reference,exception);
quantize_info=DestroyQuantizeInfo(quantize_info);
break;
}
argument_list[2].integer_reference);
if (attribute_flag[3] != 0)
channel=(ChannelType) argument_list[3].integer_reference;
- image=SparseColorImage(image,channel,method,number_coordinates,
- coordinates,exception);
+ channel_mask=SetPixelChannelMask(image,channel);
+ image=SparseColorImage(image,method,number_coordinates,coordinates,
+ exception);
+ if (image != (Image *) NULL)
+ (void) SetPixelChannelMask(image,channel_mask);
if ((attribute_flag[2] != 0) && (image != (Image *) NULL))
virtual_pixel=SetImageVirtualPixelMethod(image,virtual_pixel);
coordinates=(double *) RelinquishMagickMemory(coordinates);
if (attribute_flag[3] != 0)
geometry_info.xi=argument_list[3].integer_reference;;
if (attribute_flag[4] != 0)
- channel=(ChannelType) argument_list[4].integer_reference;
- image=SelectiveBlurImageChannel(image,channel,geometry_info.rho,
- geometry_info.sigma,geometry_info.xi,exception);
+ geometry_info.psi=argument_list[4].integer_reference;;
+ if (attribute_flag[5] != 0)
+ channel=(ChannelType) argument_list[5].integer_reference;
+ channel_mask=SetPixelChannelMask(image,channel);
+ image=SelectiveBlurImage(image,geometry_info.rho,geometry_info.sigma,
+ geometry_info.xi,geometry_info.psi,exception);
+ if (image != (Image *) NULL)
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 122: /* HaldClut */
}
if (attribute_flag[1] != 0)
channel=(ChannelType) argument_list[1].integer_reference;
- (void) HaldClutImageChannel(image,channel,
- argument_list[0].image_reference);
+ channel_mask=SetPixelChannelMask(image,channel);
+ (void) HaldClutImage(image,argument_list[0].image_reference,
+ exception);
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 123: /* BlueShift */
if (attribute_flag[0] == 0)
argument_list[0].string_reference=(char *) NULL;
(void) ColorDecisionListImage(image,
- argument_list[0].string_reference);
+ argument_list[0].string_reference,exception);
break;
}
case 127: /* AutoGamma */
{
if (attribute_flag[0] != 0)
channel=(ChannelType) argument_list[0].integer_reference;
- (void) AutoGammaImageChannel(image,channel);
+ channel_mask=SetPixelChannelMask(image,channel);
+ (void) AutoGammaImage(image,exception);
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 128: /* AutoLevel */
{
if (attribute_flag[0] != 0)
channel=(ChannelType) argument_list[0].integer_reference;
- (void) AutoLevelImageChannel(image,channel);
+ channel_mask=SetPixelChannelMask(image,channel);
+ (void) AutoLevelImage(image,exception);
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 129: /* LevelColors */
black_point,
white_point;
- (void) QueryMagickColor("#000000",&black_point,exception);
- (void) QueryMagickColor("#ffffff",&white_point,exception);
+ (void) QueryColorCompliance("#000000",AllCompliance,
+ &black_point,exception);
+ (void) QueryColorCompliance("#ffffff",AllCompliance,
+ &white_point,exception);
if (attribute_flag[1] != 0)
- (void) QueryMagickColor(argument_list[1].string_reference,
- &black_point,exception);
+ (void) QueryColorCompliance(
+ argument_list[1].string_reference,AllCompliance,&black_point,
+ exception);
if (attribute_flag[2] != 0)
- (void) QueryMagickColor(argument_list[2].string_reference,
- &white_point,exception);
+ (void) QueryColorCompliance(
+ argument_list[2].string_reference,AllCompliance,&white_point,
+ exception);
if (attribute_flag[3] != 0)
channel=(ChannelType) argument_list[3].integer_reference;
- (void) LevelColorsImageChannel(image,channel,&black_point,
- &white_point,argument_list[0].integer_reference != 0 ? MagickTrue :
- MagickFalse);
+ channel_mask=SetPixelChannelMask(image,channel);
+ (void) LevelImageColors(image,&black_point,&white_point,
+ argument_list[0].integer_reference != 0 ? MagickTrue : MagickFalse,
+ exception);
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
case 130: /* Clamp */
{
if (attribute_flag[0] != 0)
channel=(ChannelType) argument_list[0].integer_reference;
- (void) ClampImageChannel(image,channel);
+ channel_mask=SetPixelChannelMask(image,channel);
+ (void) ClampImage(image,exception);
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
- case 131: /* Filter */
- {
- KernelInfo
- *kernel;
-
- if (attribute_flag[0] == 0)
- break;
- kernel=AcquireKernelInfo(argument_list[0].string_reference);
- if (kernel == (KernelInfo *) NULL)
- break;
- if (attribute_flag[1] != 0)
- channel=(ChannelType) argument_list[1].integer_reference;
- if (attribute_flag[2] != 0)
- image->bias=SiPrefixToDouble(argument_list[2].string_reference,
- QuantumRange);
- image=FilterImageChannel(image,channel,kernel,exception);
- kernel=DestroyKernelInfo(kernel);
- break;
- }
- case 132: /* BrightnessContrast */
+ case 131: /* BrightnessContrast */
{
double
brightness,
contrast=argument_list[2].real_reference;
if (attribute_flag[4] != 0)
channel=(ChannelType) argument_list[4].integer_reference;
- (void) BrightnessContrastImageChannel(image,channel,brightness,
- contrast);
+ channel_mask=SetPixelChannelMask(image,channel);
+ (void) BrightnessContrastImage(image,brightness,contrast,exception);
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
- case 133: /* Morphology */
+ case 132: /* Morphology */
{
KernelInfo
*kernel;
method=argument_list[2].integer_reference;
iterations=1;
if (attribute_flag[3] != 0)
- iterations=argument_list[4].integer_reference;
- image=MorphologyImageChannel(image,channel,method,iterations,kernel,
- exception);
+ iterations=argument_list[3].integer_reference;
+ channel_mask=SetPixelChannelMask(image,channel);
+ image=MorphologyImage(image,method,iterations,kernel,exception);
+ if (image != (Image *) NULL)
+ (void) SetPixelChannelMask(image,channel_mask);
kernel=DestroyKernelInfo(kernel);
break;
}
- case 108: /* Recolor */
- case 134: /* ColorMatrix */
- {
- AV
- *av;
-
- double
- *color_matrix;
-
- KernelInfo
- *kernel_info;
-
- size_t
- order;
-
- if (attribute_flag[0] == 0)
- break;
- av=(AV *) argument_list[0].array_reference;
- order=(size_t) sqrt(av_len(av)+1);
- color_matrix=(double *) AcquireQuantumMemory(order,order*
- sizeof(*color_matrix));
- if (color_matrix == (double *) NULL)
- {
- ThrowPerlException(exception,ResourceLimitFatalError,
- "MemoryAllocationFailed",PackageName);
- goto PerlException;
- }
- for (j=0; (j < (ssize_t) (order*order)) && (j < (av_len(av)+1)); j++)
- color_matrix[j]=(double) SvNV(*(av_fetch(av,j,0)));
- for ( ; j < (ssize_t) (order*order); j++)
- color_matrix[j]=0.0;
- kernel_info=AcquireKernelInfo("1");
- if (kernel_info == (KernelInfo *) NULL)
- break;
- kernel_info->width=order;
- kernel_info->height=order;
- kernel_info->values=color_matrix;
- image=ColorMatrixImage(image,kernel_info,exception);
- kernel_info->values=(double *) NULL;
- kernel_info=DestroyKernelInfo(kernel_info);
- color_matrix=(double *) RelinquishMagickMemory(color_matrix);
- break;
- }
- case 135: /* Color */
- {
- PixelInfo
- color;
-
- (void) QueryMagickColor("none",&color,exception);
- if (attribute_flag[0] != 0)
- (void) QueryMagickColor(argument_list[0].string_reference,
- &color,exception);
- (void) SetImageColor(image,&color);
- break;
- }
- case 136: /* Mode */
+ case 133: /* Mode */
{
if (attribute_flag[0] != 0)
{
geometry_info.sigma=argument_list[2].real_reference;
if (attribute_flag[3] != 0)
channel=(ChannelType) argument_list[3].integer_reference;
- image=StatisticImageChannel(image,channel,ModeStatistic,
- (size_t) geometry_info.rho,(size_t) geometry_info.sigma,exception);
+ channel_mask=SetPixelChannelMask(image,channel);
+ image=StatisticImage(image,ModeStatistic,(size_t) geometry_info.rho,
+ (size_t) geometry_info.sigma,exception);
+ if (image != (Image *) NULL)
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
- case 137: /* Statistic */
+ case 134: /* Statistic */
{
StatisticType
statistic;
channel=(ChannelType) argument_list[3].integer_reference;
if (attribute_flag[4] != 0)
statistic=(StatisticType) argument_list[4].integer_reference;
- image=StatisticImageChannel(image,channel,statistic,
- (size_t) geometry_info.rho,(size_t) geometry_info.sigma,exception);
+ channel_mask=SetPixelChannelMask(image,channel);
+ image=StatisticImage(image,statistic,(size_t) geometry_info.rho,
+ (size_t) geometry_info.sigma,exception);
+ if (image != (Image *) NULL)
+ (void) SetPixelChannelMask(image,channel_mask);
break;
}
}
{
/*
Composite region.
- */
+ */
status=CompositeImage(region_image,CopyCompositeOp,image,
- region_info.x,region_info.y);
+ region_info.x,region_info.y,exception);
(void) status;
(void) CatchImageException(region_image);
image=DestroyImage(image);
if (next && (next != image))
{
image->next=next->next;
+ if (image->next != (Image *) NULL)
+ image->next->previous=image;
DeleteImageFromRegistry(*pv,next);
}
sv_setiv(*pv,(IV) image);
*/
info=GetPackageInfo(aTHX_ (void *) av,info,exception);
montage_info=CloneMontageInfo(info->image_info,(MontageInfo *) NULL);
- (void) QueryMagickColor("none",&transparent_color,exception);
+ (void) QueryColorCompliance("none",AllCompliance,&transparent_color,
+ exception);
for (i=2; i < items; i+=2)
{
attribute=(char *) SvPV(ST(i-1),na);
{
if (LocaleCompare(attribute,"background") == 0)
{
- (void) QueryColorDatabase(SvPV(ST(i),na),
+ (void) QueryColorCompliance(SvPV(ST(i),na),AllCompliance,
&montage_info->background_color,exception);
for (next=image; next; next=next->next)
next->background_color=montage_info->background_color;
}
if (LocaleCompare(attribute,"bordercolor") == 0)
{
- (void) QueryColorDatabase(SvPV(ST(i),na),
+ (void) QueryColorCompliance(SvPV(ST(i),na),AllCompliance,
&montage_info->border_color,exception);
for (next=image; next; next=next->next)
next->border_color=montage_info->border_color;
{
if (LocaleCompare(attribute,"fill") == 0)
{
- (void) QueryColorDatabase(SvPV(ST(i),na),&montage_info->fill,
- exception);
+ (void) QueryColorCompliance(SvPV(ST(i),na),AllCompliance,
+ &montage_info->fill,exception);
break;
}
if (LocaleCompare(attribute,"font") == 0)
for (next=image; next; next=next->next)
(void) SetImageProperty(next,"label",InterpretImageProperties(
info ? info->image_info : (ImageInfo *) NULL,next,
- SvPV(ST(i),na)));
+ SvPV(ST(i),na),exception),exception);
break;
}
ThrowPerlException(exception,OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(attribute,"mattecolor") == 0)
{
- (void) QueryColorDatabase(SvPV(ST(i),na),
+ (void) QueryColorCompliance(SvPV(ST(i),na),AllCompliance,
&montage_info->matte_color,exception);
for (next=image; next; next=next->next)
next->matte_color=montage_info->matte_color;
ssize_t
in;
- in=!SvPOK(ST(i)) ? SvIV(ST(i)) :
- ParseCommandOption(MagickModeOptions,MagickFalse,SvPV(ST(i),na));
+ in=!SvPOK(ST(i)) ? SvIV(ST(i)) : ParseCommandOption(
+ MagickModeOptions,MagickFalse,SvPV(ST(i),na));
switch (in)
{
default:
}
if (LocaleCompare(attribute,"stroke") == 0)
{
- (void) QueryColorDatabase(SvPV(ST(i),na),&montage_info->stroke,
- exception);
+ (void) QueryColorCompliance(SvPV(ST(i),na),AllCompliance,
+ &montage_info->stroke,exception);
break;
}
ThrowPerlException(exception,OptionError,"UnrecognizedAttribute",
PixelInfo
transparent_color;
- QueryMagickColor(SvPV(ST(i),na),&transparent_color,exception);
+ QueryColorCompliance(SvPV(ST(i),na),AllCompliance,
+ &transparent_color,exception);
for (next=image; next; next=next->next)
(void) TransparentPaintImage(next,&transparent_color,
- TransparentAlpha,MagickFalse);
+ TransparentAlpha,MagickFalse,exception);
break;
}
ThrowPerlException(exception,OptionError,"UnrecognizedAttribute",
if (transparent_color.alpha != TransparentAlpha)
for (next=image; next; next=next->next)
(void) TransparentPaintImage(next,&transparent_color,
- TransparentAlpha,MagickFalse);
+ TransparentAlpha,MagickFalse,exception);
for ( ; image; image=image->next)
{
AddImageToRegistry(sv,image);
av_push(av,sv_bless(rv,hv));
SvREFCNT_dec(sv);
info=GetPackageInfo(aTHX_ (void *) av,info,exception);
- (void) CopyMagickString(image->filename,info->image_info->filename,
+ (void) CopyMagickString(info->image_info->filename,image->filename,
MaxTextExtent);
- SetImageInfo(info->image_info,0,&image->exception);
+ SetImageInfo(info->image_info,0,exception);
exception=DestroyExceptionInfo(exception);
SvREFCNT_dec(perl_exception);
XSRETURN(1);
for (i=1; i < items; i++)
{
name=(char *) SvPV(ST(i),na);
- if (QueryMagickColor(name,&color,exception) == MagickFalse)
+ if (QueryColorCompliance(name,AllCompliance,&color,exception) == MagickFalse)
{
PUSHs(&sv_undef);
continue;
Image
*image;
- PixelPacket
+ PixelInfo
target_color;
register ssize_t
EXTEND(sp,items);
for (i=1; i < items; i++)
{
- (void) QueryColorDatabase(SvPV(ST(i),na),&target_color,exception);
+ (void) QueryColorCompliance(SvPV(ST(i),na),AllCompliance,&target_color,
+ exception);
(void) QueryColorname(image,&target_color,SVGCompliance,message,
exception);
PUSHs(sv_2mortal(newSVpv(message,0)));
if (LocaleCompare(attribute,"fill") == 0)
{
if (info)
- (void) QueryColorDatabase(SvPV(ST(i),na),&draw_info->fill,
- &image->exception);
+ (void) QueryColorCompliance(SvPV(ST(i),na),AllCompliance,
+ &draw_info->fill,exception);
break;
}
if (LocaleCompare(attribute,"font") == 0)
if (LocaleCompare(attribute,"stroke") == 0)
{
if (info)
- (void) QueryColorDatabase(SvPV(ST(i),na),&draw_info->stroke,
- &image->exception);
+ (void) QueryColorCompliance(SvPV(ST(i),na),AllCompliance,
+ &draw_info->stroke,exception);
break;
}
if (LocaleCompare(attribute,"style") == 0)
(void) FormatLocaleString(draw_info->geometry,MaxTextExtent,
"%.15g,%.15g",x,y);
}
- status=GetTypeMetrics(image,draw_info,&metrics);
+ status=GetTypeMetrics(image,draw_info,&metrics,exception);
(void) CatchImageException(image);
if (status == MagickFalse)
PUSHs(&sv_undef);
if (LocaleCompare(attribute,"fill") == 0)
{
if (info)
- (void) QueryColorDatabase(SvPV(ST(i),na),&draw_info->fill,
- &image->exception);
+ (void) QueryColorCompliance(SvPV(ST(i),na),AllCompliance,
+ &draw_info->fill,exception);
break;
}
if (LocaleCompare(attribute,"font") == 0)
if (LocaleCompare(attribute,"stroke") == 0)
{
if (info)
- (void) QueryColorDatabase(SvPV(ST(i),na),&draw_info->stroke,
- &image->exception);
+ (void) QueryColorCompliance(SvPV(ST(i),na),AllCompliance,
+ &draw_info->stroke,exception);
break;
}
if (LocaleCompare(attribute,"style") == 0)
(void) FormatLocaleString(draw_info->geometry,MaxTextExtent,
"%.15g,%.15g",x,y);
}
- status=GetMultilineTypeMetrics(image,draw_info,&metrics);
- (void) CatchImageException(image);
+ status=GetMultilineTypeMetrics(image,draw_info,&metrics,exception);
+ (void) CatchException(exception);
if (status == MagickFalse)
PUSHs(&sv_undef);
else
*attribute;
ChannelType
- channel;
+ channel,
+ channel_mask;
ExceptionInfo
*exception;
goto PerlException;
}
av=(AV *) NULL;
- channel=DefaultChannels;
normalize=MagickTrue;
region.x=0;
region.y=0;
region.height=1;
if (items == 1)
(void) ParseAbsoluteGeometry(SvPV(ST(1),na),®ion);
+ channel=DefaultChannels;
for (i=2; i < items; i+=2)
{
attribute=(char *) SvPV(ST(i-1),na);
SvPV(ST(i),na));
return;
}
- channel=(ChannelType) option;
+ channel=(ChannelType) option;
break;
}
if (LocaleCompare(attribute,"color") == 0)
}
}
}
- (void) SetImageStorageClass(image,DirectClass);
+ (void) SetImageStorageClass(image,DirectClass,exception);
+ channel_mask=SetPixelChannelMask(image,channel);
q=GetAuthenticPixels(image,region.x,region.y,1,1,exception);
- if ((q == (const Quantum *) NULL) || (av == (AV *) NULL) ||
+ if ((q == (Quantum *) NULL) || (av == (AV *) NULL) ||
(SvTYPE(av) != SVt_PVAV))
PUSHs(&sv_undef);
else
scale=1.0;
if (normalize != MagickFalse)
scale=QuantumRange;
- if (((GetPixelRedTraits(image) & ActivePixelTrait) != 0) && (i <= av_len(av)))
+ if (((GetPixelRedTraits(image) & UpdatePixelTrait) != 0) &&
+ (i <= av_len(av)))
{
SetPixelRed(image,ClampToQuantum(scale*SvNV(*(
av_fetch(av,i,0)))),q);
i++;
}
- if (((GetPixelGreenTraits(image) & ActivePixelTrait) != 0) && (i <= av_len(av)))
+ if (((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0) &&
+ (i <= av_len(av)))
{
SetPixelGreen(image,ClampToQuantum(scale*SvNV(*(
av_fetch(av,i,0)))),q);
i++;
}
- if (((GetPixelBlueTraits(image) & ActivePixelTrait) != 0) && (i <= av_len(av)))
+ if (((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0) &&
+ (i <= av_len(av)))
{
SetPixelBlue(image,ClampToQuantum(scale*SvNV(*(
av_fetch(av,i,0)))),q);
i++;
}
- if ((((GetPixelBlackTraits(image) & ActivePixelTrait) != 0) &&
+ if ((((GetPixelBlackTraits(image) & UpdatePixelTrait) != 0) &&
(image->colorspace == CMYKColorspace)) && (i <= av_len(av)))
{
SetPixelBlack(image,ClampToQuantum(scale*
SvNV(*(av_fetch(av,i,0)))),q);
i++;
}
- if (((GetPixelAlphaTraits(image) & ActivePixelTrait) != 0) && (i <= av_len(av)))
+ if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
+ (i <= av_len(av)))
{
SetPixelAlpha(image,ClampToQuantum(scale*
SvNV(*(av_fetch(av,i,0)))),q);
}
(void) SyncAuthenticPixels(image,exception);
}
+ (void) SetPixelChannelMask(image,channel_mask);
PerlException:
InheritPerlException(exception,perl_exception);
count=0;
for ( ; image; image=image->next)
{
- channel_statistics=GetImageChannelStatistics(image,&image->exception);
+ channel_statistics=GetImageStatistics(image,exception);
if (channel_statistics == (ChannelStatistics *) NULL)
continue;
count++;
status=SyncAuthenticPixels(image,exception);
if (status != MagickFalse)
return;
- InheritException(exception,&image->exception);
PerlException:
InheritPerlException(exception,perl_exception);
clone=CloneImage(image,0,0,MagickTrue,exception);
if ((clone == (Image *) NULL) || (exception->severity >= ErrorException))
goto PerlException;
- TransformImage(&clone,crop_geometry,geometry);
+ TransformImage(&clone,crop_geometry,geometry,exception);
for ( ; clone; clone=clone->next)
{
AddImageToRegistry(sv,clone);
next->scene=scene++;
}
SetImageInfo(package_info->image_info,(unsigned int)
- GetImageListLength(image),&image->exception);
+ GetImageListLength(image),exception);
for (next=image; next; next=next->next)
{
- (void) WriteImage(package_info->image_info,next);
- if (next->exception.severity >= ErrorException)
- InheritException(exception,&next->exception);
- GetImageException(next,exception);
+ (void) WriteImage(package_info->image_info,next,exception);
number_images++;
if (package_info->image_info->adjoin)
break;