% December 2001 %
% %
% %
-% Copyright 1999-2009 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2011 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.
*/
-#include "magick/studio.h"
-#include "magick/annotate.h"
-#include "magick/artifact.h"
-#include "magick/blob.h"
-#include "magick/blob-private.h"
-#include "magick/cache.h"
-#include "magick/cache-view.h"
-#include "magick/color.h"
-#include "magick/colormap.h"
-#include "magick/color-private.h"
-#include "magick/composite.h"
-#include "magick/constitute.h"
-#include "magick/decorate.h"
-#include "magick/display.h"
-#include "magick/draw.h"
-#include "magick/effect.h"
-#include "magick/enhance.h"
-#include "magick/exception.h"
-#include "magick/exception-private.h"
-#include "magick/fx.h"
-#include "magick/geometry.h"
-#include "magick/image.h"
-#include "magick/image-private.h"
-#include "magick/list.h"
-#include "magick/log.h"
-#include "magick/magick.h"
-#include "magick/memory_.h"
-#include "magick/option.h"
-#include "magick/paint.h"
-#include "magick/profile.h"
-#include "magick/property.h"
-#include "magick/quantize.h"
-#include "magick/quantum-private.h"
-#include "magick/registry.h"
-#include "magick/resize.h"
-#include "magick/resource_.h"
-#include "magick/segment.h"
-#include "magick/shear.h"
-#include "magick/signature.h"
-#include "magick/static.h"
-#include "magick/string_.h"
-#include "magick/module.h"
-#include "magick/transform.h"
-#include "magick/threshold.h"
-#include "magick/utility.h"
+#include "MagickCore/studio.h"
+#include "MagickCore/annotate.h"
+#include "MagickCore/artifact.h"
+#include "MagickCore/blob.h"
+#include "MagickCore/blob-private.h"
+#include "MagickCore/cache.h"
+#include "MagickCore/cache-view.h"
+#include "MagickCore/color.h"
+#include "MagickCore/color-private.h"
+#include "MagickCore/colormap.h"
+#include "MagickCore/composite.h"
+#include "MagickCore/constitute.h"
+#include "MagickCore/decorate.h"
+#include "MagickCore/display.h"
+#include "MagickCore/draw.h"
+#include "MagickCore/effect.h"
+#include "MagickCore/enhance.h"
+#include "MagickCore/exception.h"
+#include "MagickCore/exception-private.h"
+#include "MagickCore/fx.h"
+#include "MagickCore/geometry.h"
+#include "MagickCore/image.h"
+#include "MagickCore/image-private.h"
+#include "MagickCore/list.h"
+#include "MagickCore/log.h"
+#include "MagickCore/magick.h"
+#include "MagickCore/memory_.h"
+#include "MagickCore/module.h"
+#include "MagickCore/option.h"
+#include "MagickCore/paint.h"
+#include "MagickCore/pixel-accessor.h"
+#include "MagickCore/profile.h"
+#include "MagickCore/property.h"
+#include "MagickCore/quantize.h"
+#include "MagickCore/quantum-private.h"
+#include "MagickCore/registry.h"
+#include "MagickCore/resize.h"
+#include "MagickCore/resource_.h"
+#include "MagickCore/segment.h"
+#include "MagickCore/shear.h"
+#include "MagickCore/signature.h"
+#include "MagickCore/static.h"
+#include "MagickCore/string_.h"
+#include "MagickCore/string-private.h"
+#include "MagickCore/transform.h"
+#include "MagickCore/threshold.h"
+#include "MagickCore/utility.h"
#if defined(MAGICKCORE_XML_DELEGATE)
-# if defined(__WINDOWS__)
+# if defined(MAGICKCORE_WINDOWS_SUPPORT)
# if defined(__MINGW32__)
# define _MSC_VER
# else
*/
typedef struct _MSLGroupInfo
{
- unsigned long
+ size_t
numImages; /* how many images are in this group */
} MSLGroupInfo;
ExceptionInfo
*exception;
- long
+ ssize_t
n,
number_groups;
*/
#if defined(MAGICKCORE_XML_DELEGATE)
static MagickBooleanType
- WriteMSLImage(const ImageInfo *,Image *);
+ WriteMSLImage(const ImageInfo *,Image *,ExceptionInfo *);
static MagickBooleanType
SetMSLAttributes(MSLInfo *,const char *,const char *);
ImageInfo
*read_info;
- (void) FormatMagickString(key,MaxTextExtent,"cache:%s",path);
+ (void) FormatLocaleString(key,MaxTextExtent,"cache:%s",path);
sans_exception=AcquireExceptionInfo();
image=(Image *) GetImageRegistry(ImageRegistryType,key,sans_exception);
sans_exception=DestroyExceptionInfo(sans_exception);
" SAX.setDocumentLocator()\n");
(void) location;
msl_info=(MSLInfo *) context;
+ (void) msl_info;
}
static void MSLStartDocument(void *context)
static void MSLPushImage(MSLInfo *msl_info,Image *image)
{
- long
+ ssize_t
n;
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
msl_info->draw_info[n]=CloneDrawInfo(msl_info->image_info[n-1],
msl_info->draw_info[n-1]);
if (image == (Image *) NULL)
- msl_info->attributes[n]=AcquireImage(msl_info->image_info[n]);
+ msl_info->attributes[n]=AcquireImage(msl_info->image_info[n],
+ &image->exception);
else
msl_info->attributes[n]=CloneImage(image,0,0,MagickTrue,&image->exception);
msl_info->image[n]=(Image *) image;
ChannelType
channel;
+ ChannelType
+ channel_mask;
+
char
key[MaxTextExtent],
*value;
int
flags;
- long
+ ssize_t
option,
j,
n,
RectangleInfo
geometry;
- register long
+ register ssize_t
i;
- unsigned long
+ size_t
height,
width;
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"noise") == 0)
{
- option=ParseMagickOption(MagickNoiseOptions,MagickFalse,
+ option=ParseCommandOption(MagickNoiseOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedNoiseType",
}
}
}
- noise_image=AddNoiseImageChannel(msl_info->image[n],channel,noise,
+ channel_mask=SetPixelChannelMask(msl_info->image[n],channel);
+ noise_image=AddNoiseImage(msl_info->image[n],noise,
&msl_info->image[n]->exception);
+ (void) SetPixelChannelMap(msl_info->image[n],channel_mask);
if (noise_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
*p;
p=value;
- draw_info->affine.sx=strtod(p,&p);
+ draw_info->affine.sx=InterpretLocaleValue(p,&p);
if (*p ==',')
p++;
- draw_info->affine.rx=strtod(p,&p);
+ draw_info->affine.rx=InterpretLocaleValue(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ry=strtod(p,&p);
+ draw_info->affine.ry=InterpretLocaleValue(p,&p);
if (*p ==',')
p++;
- draw_info->affine.sy=strtod(p,&p);
+ draw_info->affine.sy=InterpretLocaleValue(p,&p);
if (*p ==',')
p++;
- draw_info->affine.tx=strtod(p,&p);
+ draw_info->affine.tx=InterpretLocaleValue(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ty=strtod(p,&p);
+ draw_info->affine.ty=InterpretLocaleValue(p,&p);
break;
}
if (LocaleCompare(keyword,"align") == 0)
{
- option=ParseMagickOption(MagickAlignOptions,MagickFalse,
+ option=ParseCommandOption(MagickAlignOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedAlignType",
}
if (LocaleCompare(keyword,"antialias") == 0)
{
- option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedBooleanType",
{
if (LocaleCompare(keyword, "fill") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->fill,
- &exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &draw_info->fill,&exception);
break;
}
if (LocaleCompare(keyword,"family") == 0)
{
if (LocaleCompare(keyword,"geometry") == 0)
{
- flags=ParsePageGeometry(msl_info->image[n],value,
+ flags=ParseGravityGeometry(msl_info->image[n],value,
&geometry,&exception);
- if ((flags & HeightValue) == 0)
- geometry.height=geometry.width;
break;
}
if (LocaleCompare(keyword,"gravity") == 0)
{
- option=ParseMagickOption(MagickGravityOptions,MagickFalse,
- value);
+ option=ParseCommandOption(MagickGravityOptions,
+ MagickFalse,value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedGravityType",
value);
{
if (LocaleCompare(keyword,"pointsize") == 0)
{
- draw_info->pointsize=atof(value);
+ draw_info->pointsize=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"rotate") == 0)
{
- angle=atof(value);
+ angle=InterpretLocaleValue(value,(char **) NULL);
affine.sx=cos(DegreesToRadians(fmod(angle,360.0)));
affine.rx=sin(DegreesToRadians(fmod(angle,360.0)));
affine.ry=(-sin(DegreesToRadians(fmod(angle,360.0))));
}
if (LocaleCompare(keyword,"skewX") == 0)
{
- angle=atof(value);
+ angle=InterpretLocaleValue(value,(char **) NULL);
affine.ry=tan(DegreesToRadians(fmod((double) angle,
360.0)));
break;
}
if (LocaleCompare(keyword,"skewY") == 0)
{
- angle=atof(value);
+ angle=InterpretLocaleValue(value,(char **) NULL);
affine.rx=tan(DegreesToRadians(fmod((double) angle,
360.0)));
break;
}
if (LocaleCompare(keyword,"stretch") == 0)
{
- option=ParseMagickOption(MagickStretchOptions,MagickFalse,
- value);
+ option=ParseCommandOption(MagickStretchOptions,
+ MagickFalse,value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedStretchType",
value);
}
if (LocaleCompare(keyword, "stroke") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->stroke,
- &exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &draw_info->stroke,&exception);
break;
}
if (LocaleCompare(keyword,"strokewidth") == 0)
{
- draw_info->stroke_width=atol(value);
+ draw_info->stroke_width=StringToLong(value);
break;
}
if (LocaleCompare(keyword,"style") == 0)
{
- option=ParseMagickOption(MagickStyleOptions,MagickFalse,
+ option=ParseCommandOption(MagickStyleOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedStyleType",
{
if (LocaleCompare(keyword, "undercolor") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->undercolor,
- &exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &draw_info->undercolor,&exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"weight") == 0)
{
- draw_info->weight=atol(value);
+ draw_info->weight=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry.x=atol(value);
+ geometry.x=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"y") == 0)
{
- geometry.y=atol(value);
+ geometry.y=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- (void) FormatMagickString(text,MaxTextExtent,"%lux%lu%+ld%+ld",
- geometry.width,geometry.height,geometry.x,geometry.y);
+ (void) FormatLocaleString(text,MaxTextExtent,
+ "%.20gx%.20g%+.20g%+.20g",(double) geometry.width,(double)
+ geometry.height,(double) geometry.x,(double) geometry.y);
CloneString(&draw_info->geometry,text);
- draw_info->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
- draw_info->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
- draw_info->affine.ry=current.sx*affine.ry+current.ry*affine.sy;
- draw_info->affine.sy=current.rx*affine.ry+current.sy*affine.sy;
- draw_info->affine.tx=current.sx*affine.tx+current.ry*affine.ty+
- current.tx;
- draw_info->affine.ty=current.rx*affine.tx+current.sy*affine.ty+
- current.ty;
- (void) AnnotateImage(msl_info->image[n],draw_info);
+ draw_info->affine.sx=affine.sx*current.sx+affine.ry*current.rx;
+ draw_info->affine.rx=affine.rx*current.sx+affine.sy*current.rx;
+ draw_info->affine.ry=affine.sx*current.ry+affine.ry*current.sy;
+ draw_info->affine.sy=affine.rx*current.ry+affine.sy*current.sy;
+ draw_info->affine.tx=affine.sx*current.tx+affine.ry*current.ty+
+ affine.tx;
+ draw_info->affine.ty=affine.rx*current.tx+affine.sy*current.ty+
+ affine.ty;
+ (void) AnnotateImage(msl_info->image[n],draw_info,
+ &msl_info->image[n]->exception);
draw_info=DestroyDrawInfo(draw_info);
break;
}
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"stack") == 0)
{
- option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedBooleanType",
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"sigma") == 0)
{
- geometry_info.sigma=atol(value);
+ geometry_info.sigma=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- blur_image=BlurImageChannel(msl_info->image[n],channel,
- geometry_info.rho,geometry_info.sigma,
+ channel_mask=SetPixelChannelMask(msl_info->image[n],channel);
+ blur_image=BlurImage(msl_info->image[n],geometry_info.rho,
+ geometry_info.sigma,geometry_info.xi,
&msl_info->image[n]->exception);
+ (void) SetPixelChannelMap(msl_info->image[n],channel_mask);
if (blur_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"compose") == 0)
{
- option=ParseMagickOption(MagickComposeOptions,MagickFalse,
+ option=ParseCommandOption(MagickComposeOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedComposeType",
{
if (LocaleCompare(keyword, "fill") == 0)
{
- (void) QueryColorDatabase(value,
+ (void) QueryColorCompliance(value,AllCompliance,
&msl_info->image[n]->border_color,&exception);
break;
}
{
if (LocaleCompare(keyword,"height") == 0)
{
- geometry.height=atol(value);
+ geometry.height=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"width") == 0)
{
- geometry.width=atol(value);
+ geometry.width=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
border_image=BorderImage(msl_info->image[n],&geometry,
- &msl_info->image[n]->exception);
+ msl_info->image[n]->compose,&msl_info->image[n]->exception);
if (border_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"fill") == 0)
{
- (void) QueryColorDatabase(value,&target,
+ (void) QueryColorCompliance(value,AllCompliance,&target,
&msl_info->image[n]->exception);
break;
}
}
if (LocaleCompare((const char *) tag, "charcoal") == 0)
{
- double radius = 0.0,
+ double bias = 0.0,
+ radius = 0.0,
sigma = 1.0;
if (msl_info->image[n] == (Image *) NULL)
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i],&exception));
switch (*keyword)
{
+ case 'B':
+ case 'b':
+ {
+ if (LocaleCompare(keyword, "bias") == 0)
+ {
+ bias = InterpretLocaleValue(value,(char **) NULL);
+ break;
+ }
+ ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
+ break;
+ }
case 'R':
case 'r':
{
if (LocaleCompare(keyword, "radius") == 0)
{
- radius = atof( value );
+ radius = InterpretLocaleValue(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"sigma") == 0)
{
- sigma = atol( value );
+ sigma = StringToLong( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
Image
*newImage;
- newImage=CharcoalImage(msl_info->image[n],radius,sigma,
+ newImage=CharcoalImage(msl_info->image[n],radius,sigma,bias,
&msl_info->image[n]->exception);
if (newImage == (Image *) NULL)
break;
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"height") == 0)
{
- geometry.height=atol(value);
+ geometry.height=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"width") == 0)
{
- geometry.width=atol(value);
+ geometry.width=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry.x=atol(value);
+ geometry.x=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"y") == 0)
{
- geometry.y=atol(value);
+ geometry.y=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
PaintMethod
paint_method;
- MagickPixelPacket
+ PixelInfo
target;
/*
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"bordercolor") == 0)
{
- (void) QueryMagickColor(value,&target,&exception);
+ (void) QueryMagickColorCompliance(value,AllCompliance,
+ &target,&exception);
paint_method=FillToBorderMethod;
break;
}
{
if (LocaleCompare(keyword,"fill") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->fill,
- &exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &draw_info->fill,&exception);
break;
}
if (LocaleCompare(keyword,"fuzz") == 0)
{
- msl_info->image[n]->fuzz=atof(value);
+ msl_info->image[n]->fuzz=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry.x=atol(value);
+ geometry.x=StringToLong(value);
(void) GetOneVirtualMagickPixel(msl_info->image[n],
geometry.x,geometry.y,&target,&exception);
break;
{
if (LocaleCompare(keyword,"y") == 0)
{
- geometry.y=atol(value);
+ geometry.y=StringToLong(value);
(void) GetOneVirtualMagickPixel(msl_info->image[n],
geometry.x,geometry.y,&target,&exception);
break;
}
}
}
- (void) FloodfillPaintImage(msl_info->image[n],DefaultChannels,
- draw_info,&target,geometry.x,geometry.y,
- paint_method == FloodfillMethod ? MagickFalse : MagickTrue);
+ (void) FloodfillPaintImage(msl_info->image[n],draw_info,&target,
+ geometry.x,geometry.y,paint_method == FloodfillMethod ?
+ MagickFalse : MagickTrue,&msl_info->image[n]->exception);
draw_info=DestroyDrawInfo(draw_info);
break;
}
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"compose") == 0)
{
- option=ParseMagickOption(MagickComposeOptions,MagickFalse,
+ option=ParseCommandOption(MagickComposeOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedComposeType",
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
if (LocaleCompare(keyword, "color") == 0)
{
- (void) QueryColorDatabase(value,
+ (void) QueryColorCompliance(value,AllCompliance,
&composite_image->background_color,&exception);
break;
}
}
if (LocaleCompare(keyword,"gravity") == 0)
{
- option=ParseMagickOption(MagickGravityOptions,MagickFalse,
+ option=ParseCommandOption(MagickGravityOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedGravityType",
if ((attribute != (const char *) NULL) &&
(LocaleCompare(value,value) == 0))
{
- SetImageType(composite_image,TrueColorMatteType);
+ SetImageType(composite_image,TrueColorMatteType,
+ &exception);
(void) CompositeImage(composite_image,
CopyOpacityCompositeOp,msl_info->image[j],0,0);
break;
{
if (LocaleCompare(keyword,"opacity") == 0)
{
- long
+ ssize_t
opacity,
y;
- register long
+ register ssize_t
x;
- register PixelPacket
+ register Quantum
*q;
CacheView
*composite_view;
- opacity=QuantumRange-atol(value);
+ opacity=StringToLong(value);
if (compose != DissolveCompositeOp)
{
(void) SetImageOpacity(composite_image,(Quantum)
(void) SetImageArtifact(msl_info->image[n],
"compose:args",value);
if (composite_image->matte != MagickTrue)
- (void) SetImageOpacity(composite_image,OpaqueOpacity);
+ (void) SetImageOpacity(composite_image,OpaqueAlpha);
composite_view=AcquireCacheView(composite_image);
- for (y=0; y < (long) composite_image->rows ; y++)
+ for (y=0; y < (ssize_t) composite_image->rows ; y++)
{
- q=GetCacheViewAuthenticPixels(composite_view,0,y,(long)
- composite_image->columns,1,&exception);
- for (x=0; x < (long) composite_image->columns; x++)
+ q=GetCacheViewAuthenticPixels(composite_view,0,y,
+ (ssize_t) composite_image->columns,1,&exception);
+ for (x=0; x < (ssize_t) composite_image->columns; x++)
{
- if (q->opacity == OpaqueOpacity)
- q->opacity=RoundToQuantum(opacity);
- q++;
+ if (GetPixelAlpha(composite_image,q) == OpaqueAlpha)
+ SetPixelAlpha(composite_image,
+ ClampToQuantum(opacity),q);
+ q+=GetPixelChannels(composite_image);
}
if (SyncCacheViewAuthenticPixels(composite_view,&exception) == MagickFalse)
break;
{
if (LocaleCompare(keyword,"rotate") == 0)
{
- rotate_image=RotateImage(composite_image,atof(value),
- &exception);
+ rotate_image=RotateImage(composite_image,
+ InterpretLocaleValue(value,(char **) NULL),&exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
MagickBooleanType
tile;
- option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedBooleanType",
value);
tile=(MagickBooleanType) option;
+ (void) tile;
if (rotate_image != (Image *) NULL)
(void) SetImageArtifact(rotate_image,
"compose:outside-overlay","false");
image=msl_info->image[n];
height=composite_image->rows;
width=composite_image->columns;
- for (y=0; y < (long) image->rows; y+=height)
- for (x=0; x < (long) image->columns; x+=width)
+ for (y=0; y < (ssize_t) image->rows; y+=(ssize_t) height)
+ for (x=0; x < (ssize_t) image->columns; x+=(ssize_t) width)
{
if (rotate_image != (Image *) NULL)
(void) CompositeImage(image,compose,rotate_image,
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry.x=atol(value);
+ geometry.x=StringToLong(value);
(void) GetOneVirtualPixel(msl_info->image[n],geometry.x,
geometry.y,&target,&exception);
break;
{
if (LocaleCompare(keyword,"y") == 0)
{
- geometry.y=atol(value);
+ geometry.y=StringToLong(value);
(void) GetOneVirtualPixel(msl_info->image[n],geometry.x,
geometry.y,&target,&exception);
break;
}
}
image=msl_info->image[n];
- (void) FormatMagickString(composite_geometry,MaxTextExtent,
- "%lux%lu%+ld%+ld",composite_image->columns,composite_image->rows,
- geometry.x,geometry.y);
+ (void) FormatLocaleString(composite_geometry,MaxTextExtent,
+ "%.20gx%.20g%+.20g%+.20g",(double) composite_image->columns,
+ (double) composite_image->rows,(double) geometry.x,(double)
+ geometry.y);
flags=ParseGravityGeometry(image,composite_geometry,&geometry,
&exception);
+ channel_mask=SetPixelChannelMask(image,channel);
if (rotate_image == (Image *) NULL)
- CompositeImageChannel(image,channel,compose,composite_image,
- geometry.x,geometry.y);
+ CompositeImage(image,compose,composite_image,geometry.x,geometry.y);
else
{
/*
Rotate image.
*/
- geometry.x-=(long) (rotate_image->columns-
+ geometry.x-=(ssize_t) (rotate_image->columns-
composite_image->columns)/2;
- geometry.y-=(long) (rotate_image->rows-composite_image->rows)/2;
- CompositeImageChannel(image,channel,compose,rotate_image,
- geometry.x,geometry.y);
+ geometry.y-=(ssize_t) (rotate_image->rows-composite_image->rows)/2;
+ CompositeImage(image,compose,rotate_image,geometry.x,geometry.y);
rotate_image=DestroyImage(rotate_image);
}
+ (void) SetPixelChannelMask(image,channel_mask);
composite_image=DestroyImage(composite_image);
break;
}
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"sharpen") == 0)
{
- option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedBooleanType",
}
}
}
- (void) ContrastImage(msl_info->image[n],sharpen);
+ (void) ContrastImage(msl_info->image[n],sharpen,
+ &msl_info->image[n]->exception);
break;
}
if (LocaleCompare((const char *) tag,"crop") == 0)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"geometry") == 0)
{
- flags=ParsePageGeometry(msl_info->image[n],value,
+ flags=ParseGravityGeometry(msl_info->image[n],value,
&geometry,&exception);
- if ((flags & HeightValue) == 0)
- geometry.height=geometry.width;
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"height") == 0)
{
- geometry.height=atol(value);
+ geometry.height=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"width") == 0)
{
- geometry.width=atol(value);
+ geometry.width=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry.x=atol(value);
+ geometry.x=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"y") == 0)
{
- geometry.y=atol(value);
+ geometry.y=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
if (LocaleCompare((const char *) tag,"cycle-colormap") == 0)
{
- long
+ ssize_t
display;
/*
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"display") == 0)
{
- display=atol(value);
+ display=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- (void) CycleColormapImage(msl_info->image[n],display);
+ (void) CycleColormapImage(msl_info->image[n],display,&exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedElement",(const char *) tag);
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
}
- (void) DisplayImages(msl_info->image_info[n],msl_info->image[n]);
+ (void) DisplayImages(msl_info->image_info[n],msl_info->image[n],
+ &msl_info->image[n]->exception);
break;
}
if (LocaleCompare((const char *) tag,"draw") == 0)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
*p;
p=value;
- draw_info->affine.sx=strtod(p,&p);
+ draw_info->affine.sx=InterpretLocaleValue(p,&p);
if (*p ==',')
p++;
- draw_info->affine.rx=strtod(p,&p);
+ draw_info->affine.rx=InterpretLocaleValue(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ry=strtod(p,&p);
+ draw_info->affine.ry=InterpretLocaleValue(p,&p);
if (*p ==',')
p++;
- draw_info->affine.sy=strtod(p,&p);
+ draw_info->affine.sy=InterpretLocaleValue(p,&p);
if (*p ==',')
p++;
- draw_info->affine.tx=strtod(p,&p);
+ draw_info->affine.tx=InterpretLocaleValue(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ty=strtod(p,&p);
+ draw_info->affine.ty=InterpretLocaleValue(p,&p);
break;
}
if (LocaleCompare(keyword,"align") == 0)
{
- option=ParseMagickOption(MagickAlignOptions,MagickFalse,
+ option=ParseCommandOption(MagickAlignOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedAlignType",
}
if (LocaleCompare(keyword,"antialias") == 0)
{
- option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedBooleanType",
{
if (LocaleCompare(keyword, "fill") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->fill,
- &exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &draw_info->fill,&exception);
break;
}
if (LocaleCompare(keyword,"family") == 0)
}
if (LocaleCompare(keyword,"gravity") == 0)
{
- option=ParseMagickOption(MagickGravityOptions,MagickFalse,
+ option=ParseCommandOption(MagickGravityOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedGravityType",
}
if (LocaleCompare(keyword,"pointsize") == 0)
{
- draw_info->pointsize=atof(value);
+ draw_info->pointsize=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"rotate") == 0)
{
- angle=atof(value);
+ angle=InterpretLocaleValue(value,(char **) NULL);
affine.sx=cos(DegreesToRadians(fmod(angle,360.0)));
affine.rx=sin(DegreesToRadians(fmod(angle,360.0)));
affine.ry=(-sin(DegreesToRadians(fmod(angle,360.0))));
}
if (LocaleCompare(keyword,"skewX") == 0)
{
- angle=atof(value);
+ angle=InterpretLocaleValue(value,(char **) NULL);
affine.ry=cos(DegreesToRadians(fmod(angle,360.0)));
break;
}
if (LocaleCompare(keyword,"skewY") == 0)
{
- angle=atof(value);
+ angle=InterpretLocaleValue(value,(char **) NULL);
affine.rx=cos(DegreesToRadians(fmod(angle,360.0)));
break;
}
if (LocaleCompare(keyword,"stretch") == 0)
{
- option=ParseMagickOption(MagickStretchOptions,MagickFalse,
- value);
+ option=ParseCommandOption(MagickStretchOptions,
+ MagickFalse,value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedStretchType",
value);
}
if (LocaleCompare(keyword, "stroke") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->stroke,
- &exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &draw_info->stroke,&exception);
break;
}
if (LocaleCompare(keyword,"strokewidth") == 0)
{
- draw_info->stroke_width=atol(value);
+ draw_info->stroke_width=StringToLong(value);
break;
}
if (LocaleCompare(keyword,"style") == 0)
{
- option=ParseMagickOption(MagickStyleOptions,MagickFalse,
+ option=ParseCommandOption(MagickStyleOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedStyleType",
{
if (LocaleCompare(keyword, "undercolor") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->undercolor,
- &exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &draw_info->undercolor,&exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"weight") == 0)
{
- draw_info->weight=atol(value);
+ draw_info->weight=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry.x=atol(value);
+ geometry.x=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"y") == 0)
{
- geometry.y=atol(value);
+ geometry.y=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- (void) FormatMagickString(text,MaxTextExtent,"%lux%lu%+ld%+ld",
- geometry.width,geometry.height,geometry.x,geometry.y);
+ (void) FormatLocaleString(text,MaxTextExtent,
+ "%.20gx%.20g%+.20g%+.20g",(double) geometry.width,(double)
+ geometry.height,(double) geometry.x,(double) geometry.y);
CloneString(&draw_info->geometry,text);
- draw_info->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
- draw_info->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
- draw_info->affine.ry=current.sx*affine.ry+current.ry*affine.sy;
- draw_info->affine.sy=current.rx*affine.ry+current.sy*affine.sy;
- draw_info->affine.tx=current.sx*affine.tx+current.ry*affine.ty+
- current.tx;
- draw_info->affine.ty=current.rx*affine.tx+current.sy*affine.ty+
- current.ty;
- (void) DrawImage(msl_info->image[n],draw_info);
+ draw_info->affine.sx=affine.sx*current.sx+affine.ry*current.rx;
+ draw_info->affine.rx=affine.rx*current.sx+affine.sy*current.rx;
+ draw_info->affine.ry=affine.sx*current.ry+affine.ry*current.sy;
+ draw_info->affine.sy=affine.rx*current.ry+affine.sy*current.sy;
+ draw_info->affine.tx=affine.sx*current.tx+affine.ry*current.ty+
+ affine.tx;
+ draw_info->affine.ty=affine.rx*current.tx+affine.sy*current.ty+
+ affine.ty;
+ (void) DrawImage(msl_info->image[n],draw_info,&exception);
draw_info=DestroyDrawInfo(draw_info);
break;
}
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
edge_image=EdgeImage(msl_info->image[n],geometry_info.rho,
- &msl_info->image[n]->exception);
+ geometry_info.sigma,&msl_info->image[n]->exception);
if (edge_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"sigma") == 0)
{
- geometry_info.sigma=atol(value);
+ geometry_info.sigma=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
}
- (void) EqualizeImage(msl_info->image[n]);
+ (void) EqualizeImage(msl_info->image[n],
+ &msl_info->image[n]->exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedElement",(const char *) tag);
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"compose") == 0)
{
- option=ParseMagickOption(MagickComposeOptions,
+ option=ParseCommandOption(MagickComposeOptions,
MagickFalse,value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedComposeType",
{
if (LocaleCompare(keyword, "fill") == 0)
{
- (void) QueryColorDatabase(value,
+ (void) QueryColorCompliance(value,AllCompliance,
&msl_info->image[n]->matte_color,&exception);
break;
}
{
if (LocaleCompare(keyword,"height") == 0)
{
- frame_info.height=atol(value);
+ frame_info.height=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"inner") == 0)
{
- frame_info.inner_bevel=atol(value);
+ frame_info.inner_bevel=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"outer") == 0)
{
- frame_info.outer_bevel=atol(value);
+ frame_info.outer_bevel=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"width") == 0)
{
- frame_info.width=atol(value);
+ frame_info.width=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- frame_info.x=(long) frame_info.width;
- frame_info.y=(long) frame_info.height;
+ frame_info.x=(ssize_t) frame_info.width;
+ frame_info.y=(ssize_t) frame_info.height;
frame_info.width=msl_info->image[n]->columns+2*frame_info.x;
frame_info.height=msl_info->image[n]->rows+2*frame_info.y;
frame_image=FrameImage(msl_info->image[n],&frame_info,
- &msl_info->image[n]->exception);
+ msl_info->image[n]->compose,&msl_info->image[n]->exception);
if (frame_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
char
gamma[MaxTextExtent];
- MagickPixelPacket
+ PixelInfo
pixel;
/*
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"blue") == 0)
{
- pixel.blue=atof(value);
+ pixel.blue=InterpretLocaleValue(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
if (LocaleCompare(keyword,"green") == 0)
{
- pixel.green=atof(value);
+ pixel.green=InterpretLocaleValue(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"red") == 0)
{
- pixel.red=atof(value);
+ pixel.red=InterpretLocaleValue(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
if (*gamma == '\0')
- (void) FormatMagickString(gamma,MaxTextExtent,"%g,%g,%g",
+ (void) FormatLocaleString(gamma,MaxTextExtent,"%g,%g,%g",
(double) pixel.red,(double) pixel.green,(double) pixel.blue);
- switch (channel)
- {
- default:
- {
- (void) GammaImage(msl_info->image[n],gamma);
- break;
- }
- case RedChannel:
- {
- (void) GammaImageChannel(msl_info->image[n],RedChannel,pixel.red);
- break;
- }
- case GreenChannel:
- {
- (void) GammaImageChannel(msl_info->image[n],GreenChannel,
- pixel.green);
- break;
- }
- case BlueChannel:
- {
- (void) GammaImageChannel(msl_info->image[n],BlueChannel,
- pixel.blue);
- break;
- }
- }
+ (void) GammaImage(msl_info->image[n],atof(gamma),
+ &msl_info->image[n]->exception);
break;
}
else if (LocaleCompare((const char *) tag,"get") == 0)
{
if (LocaleCompare(keyword,"height") == 0)
{
- (void) FormatMagickString(value,MaxTextExtent,"%ld",
- msl_info->image[n]->rows);
+ (void) FormatLocaleString(value,MaxTextExtent,"%.20g",
+ (double) msl_info->image[n]->rows);
(void) SetImageProperty(msl_info->attributes[n],key,value);
break;
}
{
if (LocaleCompare(keyword,"width") == 0)
{
- (void) FormatMagickString(value,MaxTextExtent,"%ld",
- msl_info->image[n]->columns);
+ (void) FormatLocaleString(value,MaxTextExtent,"%.20g",
+ (double) msl_info->image[n]->columns);
(void) SetImageProperty(msl_info->attributes[n],key,value);
break;
}
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i],&exception));
switch (*keyword)
{
case 'C':
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"amount") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
implode_image=ImplodeImage(msl_info->image[n],geometry_info.rho,
- &msl_info->image[n]->exception);
+ msl_info->image[n]->interpolate,&msl_info->image[n]->exception);
if (implode_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
{
if (LocaleCompare(keyword,"black") == 0)
{
- levelBlack = atof( value );
+ levelBlack = InterpretLocaleValue(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"gamma") == 0)
{
- levelGamma = atof( value );
+ levelGamma = InterpretLocaleValue(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"white") == 0)
{
- levelWhite = atof( value );
+ levelWhite = InterpretLocaleValue(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
/* process image */
- {
- char level[MaxTextExtent + 1];
- (void) FormatMagickString(level,MaxTextExtent,"%3.6f/%3.6f/%3.6f/",
- levelBlack,levelGamma,levelWhite);
- LevelImage ( msl_info->image[n], level );
- break;
- }
+ LevelImage(msl_info->image[n],levelBlack,levelWhite,levelGamma,
+ &msl_info->image[n]->exception);
+ break;
}
}
case 'M':
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"dither") == 0)
{
- option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedBooleanType",
quantize_info=AcquireQuantizeInfo(msl_info->image_info[n]);
quantize_info->dither=dither;
(void) RemapImages(quantize_info,msl_info->image[n],
- affinity_image);
+ affinity_image,&exception);
quantize_info=DestroyQuantizeInfo(quantize_info);
affinity_image=DestroyImage(affinity_image);
break;
double
opacity;
- MagickPixelPacket
+ PixelInfo
target;
PaintMethod
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"bordercolor") == 0)
{
- (void) QueryMagickColor(value,&target,&exception);
+ (void) QueryMagickColorCompliance(value,AllCompliance,
+ &target,&exception);
paint_method=FillToBorderMethod;
break;
}
{
if (LocaleCompare(keyword,"fuzz") == 0)
{
- msl_info->image[n]->fuzz=atof(value);
+ msl_info->image[n]->fuzz=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"opacity") == 0)
{
- opacity=atof(value);
+ opacity=InterpretLocaleValue(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry.x=atol(value);
+ geometry.x=StringToLong(value);
(void) GetOneVirtualMagickPixel(msl_info->image[n],
geometry.x,geometry.y,&target,&exception);
break;
{
if (LocaleCompare(keyword,"y") == 0)
{
- geometry.y=atol(value);
+ geometry.y=StringToLong(value);
(void) GetOneVirtualMagickPixel(msl_info->image[n],
geometry.x,geometry.y,&target,&exception);
break;
}
draw_info=CloneDrawInfo(msl_info->image_info[n],
msl_info->draw_info[n]);
- draw_info->fill.opacity=RoundToQuantum(opacity);
- (void) FloodfillPaintImage(msl_info->image[n],OpacityChannel,
- draw_info,&target,geometry.x,geometry.y,
- paint_method == FloodfillMethod ? MagickFalse : MagickTrue);
+ draw_info->fill.alpha=ClampToQuantum(opacity);
+ channel_mask=SetPixelChannelMask(msl_info->image[n],AlphaChannel);
+ (void) FloodfillPaintImage(msl_info->image[n],draw_info,&target,
+ geometry.x,geometry.y,paint_method == FloodfillMethod ?
+ MagickFalse : MagickTrue,&msl_info->image[n]->exception);
+ (void) SetPixelChannelMap(msl_info->image[n],channel_mask);
draw_info=DestroyDrawInfo(draw_info);
break;
}
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- median_image=MedianFilterImage(msl_info->image[n],geometry_info.rho,
+ median_image=StatisticImage(msl_info->image[n],MedianStatistic,
+ (size_t) geometry_info.rho,(size_t) geometry_info.sigma,
&msl_info->image[n]->exception);
if (median_image == (Image *) NULL)
break;
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"blackness") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
if (LocaleCompare(keyword,"brightness") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"hue") == 0)
{
- geometry_info.xi=atof(value);
+ geometry_info.xi=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"lightness") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"saturation") == 0)
{
- geometry_info.sigma=atof(value);
+ geometry_info.sigma=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"whiteness") == 0)
{
- geometry_info.sigma=atof(value);
+ geometry_info.sigma=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- (void) FormatMagickString(modulate,MaxTextExtent,"%g,%g,%g",
+ (void) FormatLocaleString(modulate,MaxTextExtent,"%g,%g,%g",
geometry_info.rho,geometry_info.sigma,geometry_info.xi);
- (void) ModulateImage(msl_info->image[n],modulate);
+ (void) ModulateImage(msl_info->image[n],modulate,
+ &msl_info->image[n]->exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedElement",(const char *) tag);
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"gray") == 0)
{
- option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedBooleanType",
}
}
}
- (void) NegateImageChannel(msl_info->image[n],channel,gray);
+ channel_mask=SetPixelChannelMask(msl_info->image[n],channel);
+ (void) NegateImage(msl_info->image[n],gray,
+ &msl_info->image[n]->exception);
+ (void) SetPixelChannelMap(msl_info->image[n],channel_mask);
break;
}
if (LocaleCompare((const char *) tag,"normalize") == 0)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
}
- (void) NormalizeImageChannel(msl_info->image[n],channel);
+ (void) NormalizeImage(msl_info->image[n],
+ &msl_info->image[n]->exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedElement",(const char *) tag);
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
paint_image=OilPaintImage(msl_info->image[n],geometry_info.rho,
- &msl_info->image[n]->exception);
+ geometry_info.sigma,&msl_info->image[n]->exception);
if (paint_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
}
if (LocaleCompare((const char *) tag,"opaque") == 0)
{
- MagickPixelPacket
+ PixelInfo
fill_color,
target;
(const char *) tag);
break;
}
- (void) QueryMagickColor("none",&target,&exception);
- (void) QueryMagickColor("none",&fill_color,&exception);
+ (void) QueryMagickColorCompliance("none",AllCompliance,&target,
+ &exception);
+ (void) QueryMagickColorCompliance("none",AllCompliance,&fill_color,
+ &exception);
if (attributes != (const xmlChar **) NULL)
for (i=0; (attributes[i] != (const xmlChar *) NULL); i++)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"fill") == 0)
{
- (void) QueryMagickColor(value,&fill_color,&exception);
+ (void) QueryMagickColorCompliance(value,AllCompliance,
+ &fill_color,&exception);
break;
}
if (LocaleCompare(keyword,"fuzz") == 0)
{
- msl_info->image[n]->fuzz=atof(value);
+ msl_info->image[n]->fuzz=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- (void) OpaquePaintImageChannel(msl_info->image[n],channel,
- &target,&fill_color,MagickFalse);
+ channel_mask=SetPixelChannelMask(msl_info->image[n],channel);
+ (void) OpaquePaintImage(msl_info->image[n],&target,&fill_color,
+ MagickFalse,&msl_info->image[n]->exception);
+ (void) SetPixelChannelMap(msl_info->image[n],channel_mask);
break;
}
ThrowMSLException(OptionError,"UnrecognizedElement",(const char *) tag);
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"output") == 0)
{
- (void) fprintf(stdout,"%s",value);
+ (void) FormatLocaleFile(stdout,"%s",value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
if (*keyword == '+')
{
if (profile != (StringInfo *) NULL)
{
(void) ProfileImage(msl_info->image[n],name,
- GetStringInfoDatum(profile),(unsigned long)
+ GetStringInfoDatum(profile),(size_t)
GetStringInfoLength(profile),MagickFalse);
profile=DestroyStringInfo(profile);
}
profile=GetImageProfile(profile_image,name);
if (profile != (StringInfo *) NULL)
(void) ProfileImage(msl_info->image[n],name,
- GetStringInfoDatum(profile),(unsigned long)
+ GetStringInfoDatum(profile),(size_t)
GetStringInfoLength(profile),MagickFalse);
name=GetNextImageProfile(profile_image);
}
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"colors") == 0)
{
- quantize_info.number_colors=atol(value);
+ quantize_info.number_colors=StringToLong(value);
break;
}
if (LocaleCompare(keyword,"colorspace") == 0)
{
- option=ParseMagickOption(MagickColorspaceOptions,
+ option=ParseCommandOption(MagickColorspaceOptions,
MagickFalse,value);
if (option < 0)
ThrowMSLException(OptionError,
{
if (LocaleCompare(keyword,"dither") == 0)
{
- option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedBooleanType",
{
if (LocaleCompare(keyword,"measure") == 0)
{
- option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedBooleanType",
{
if (LocaleCompare(keyword,"treedepth") == 0)
{
- quantize_info.tree_depth=atol(value);
+ quantize_info.tree_depth=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- (void) QuantizeImage(&quantize_info,msl_info->image[n]);
+ (void) QuantizeImage(&quantize_info,msl_info->image[n],&exception);
break;
}
if (LocaleCompare((const char *) tag,"query-font-metrics") == 0)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
*p;
p=value;
- draw_info->affine.sx=strtod(p,&p);
+ draw_info->affine.sx=InterpretLocaleValue(p,&p);
if (*p ==',')
p++;
- draw_info->affine.rx=strtod(p,&p);
+ draw_info->affine.rx=InterpretLocaleValue(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ry=strtod(p,&p);
+ draw_info->affine.ry=InterpretLocaleValue(p,&p);
if (*p ==',')
p++;
- draw_info->affine.sy=strtod(p,&p);
+ draw_info->affine.sy=InterpretLocaleValue(p,&p);
if (*p ==',')
p++;
- draw_info->affine.tx=strtod(p,&p);
+ draw_info->affine.tx=InterpretLocaleValue(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ty=strtod(p,&p);
+ draw_info->affine.ty=InterpretLocaleValue(p,&p);
break;
}
if (LocaleCompare(keyword,"align") == 0)
{
- option=ParseMagickOption(MagickAlignOptions,MagickFalse,
+ option=ParseCommandOption(MagickAlignOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedAlignType",
}
if (LocaleCompare(keyword,"antialias") == 0)
{
- option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedBooleanType",
{
if (LocaleCompare(keyword, "fill") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->fill,
- &exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &draw_info->fill,&exception);
break;
}
if (LocaleCompare(keyword,"family") == 0)
}
if (LocaleCompare(keyword,"gravity") == 0)
{
- option=ParseMagickOption(MagickGravityOptions,MagickFalse,
+ option=ParseCommandOption(MagickGravityOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedGravityType",
{
if (LocaleCompare(keyword,"pointsize") == 0)
{
- draw_info->pointsize=atof(value);
+ draw_info->pointsize=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"rotate") == 0)
{
- angle=atof(value);
+ angle=InterpretLocaleValue(value,(char **) NULL);
affine.sx=cos(DegreesToRadians(fmod(angle,360.0)));
affine.rx=sin(DegreesToRadians(fmod(angle,360.0)));
affine.ry=(-sin(DegreesToRadians(fmod(angle,360.0))));
}
if (LocaleCompare(keyword,"skewX") == 0)
{
- angle=atof(value);
+ angle=InterpretLocaleValue(value,(char **) NULL);
affine.ry=cos(DegreesToRadians(fmod(angle,360.0)));
break;
}
if (LocaleCompare(keyword,"skewY") == 0)
{
- angle=atof(value);
+ angle=InterpretLocaleValue(value,(char **) NULL);
affine.rx=cos(DegreesToRadians(fmod(angle,360.0)));
break;
}
if (LocaleCompare(keyword,"stretch") == 0)
{
- option=ParseMagickOption(MagickStretchOptions,MagickFalse,
- value);
+ option=ParseCommandOption(MagickStretchOptions,
+ MagickFalse,value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedStretchType",
value);
}
if (LocaleCompare(keyword, "stroke") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->stroke,
- &exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &draw_info->stroke,&exception);
break;
}
if (LocaleCompare(keyword,"strokewidth") == 0)
{
- draw_info->stroke_width=atol(value);
+ draw_info->stroke_width=StringToLong(value);
break;
}
if (LocaleCompare(keyword,"style") == 0)
{
- option=ParseMagickOption(MagickStyleOptions,MagickFalse,
+ option=ParseCommandOption(MagickStyleOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedStyleType",
{
if (LocaleCompare(keyword, "undercolor") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->undercolor,
- &exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &draw_info->undercolor,&exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"weight") == 0)
{
- draw_info->weight=atol(value);
+ draw_info->weight=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry.x=atol(value);
+ geometry.x=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"y") == 0)
{
- geometry.y=atol(value);
+ geometry.y=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- (void) FormatMagickString(text,MaxTextExtent,"%lux%lu%+ld%+ld",
- geometry.width,geometry.height,geometry.x,geometry.y);
+ (void) FormatLocaleString(text,MaxTextExtent,
+ "%.20gx%.20g%+.20g%+.20g",(double) geometry.width,(double)
+ geometry.height,(double) geometry.x,(double) geometry.y);
CloneString(&draw_info->geometry,text);
- draw_info->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
- draw_info->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
- draw_info->affine.ry=current.sx*affine.ry+current.ry*affine.sy;
- draw_info->affine.sy=current.rx*affine.ry+current.sy*affine.sy;
- draw_info->affine.tx=current.sx*affine.tx+current.ry*affine.ty+
- current.tx;
- draw_info->affine.ty=current.rx*affine.tx+current.sy*affine.ty+
- current.ty;
- status=GetTypeMetrics(msl_info->attributes[n],draw_info,&metrics);
+ draw_info->affine.sx=affine.sx*current.sx+affine.ry*current.rx;
+ draw_info->affine.rx=affine.rx*current.sx+affine.sy*current.rx;
+ draw_info->affine.ry=affine.sx*current.ry+affine.ry*current.sy;
+ draw_info->affine.sy=affine.rx*current.ry+affine.sy*current.sy;
+ draw_info->affine.tx=affine.sx*current.tx+affine.ry*current.ty+
+ affine.tx;
+ draw_info->affine.ty=affine.rx*current.tx+affine.sy*current.ty+
+ affine.ty;
+ status=GetTypeMetrics(msl_info->attributes[n],draw_info,&metrics,
+ &msl_info->image[n]->exception);
if (status != MagickFalse)
{
Image
*image;
image=msl_info->attributes[n];
- FormatImageProperty(image,"msl:font-metrics.pixels_per_em.x","%g",
- metrics.pixels_per_em.x);
- FormatImageProperty(image,"msl:font-metrics.pixels_per_em.y","%g",
- metrics.pixels_per_em.y);
+ FormatImageProperty(image,"msl:font-metrics.pixels_per_em.x",
+ "%g",metrics.pixels_per_em.x);
+ FormatImageProperty(image,"msl:font-metrics.pixels_per_em.y",
+ "%g",metrics.pixels_per_em.y);
FormatImageProperty(image,"msl:font-metrics.ascent","%g",
metrics.ascent);
FormatImageProperty(image,"msl:font-metrics.descent","%g",
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"height") == 0)
{
- geometry.height=atol(value);
+ geometry.height=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"raise") == 0)
{
- option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedNoiseType",
{
if (LocaleCompare(keyword,"width") == 0)
{
- geometry.width=atol(value);
+ geometry.width=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- (void) RaiseImage(msl_info->image[n],&geometry,raise);
+ (void) RaiseImage(msl_info->image[n],&geometry,raise,
+ &msl_info->image[n]->exception);
break;
}
if (LocaleCompare((const char *) tag,"read") == 0)
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i],&exception));
switch (*keyword)
{
case 'F':
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- paint_image=ReduceNoiseImage(msl_info->image[n],geometry_info.rho,
+ paint_image=StatisticImage(msl_info->image[n],NonpeakStatistic,
+ (size_t) geometry_info.rho,(size_t) geometry_info.sigma,
&msl_info->image[n]->exception);
if (paint_image == (Image *) NULL)
break;
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i],&exception));
switch (*keyword)
{
case 'G':
{
if (LocaleCompare(keyword,"height") == 0)
{
- height = atol( value );
+ height = StringToLong( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"width") == 0)
{
- width = atol( value );
+ width = StringToLong( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"x") == 0)
{
- x = atol( value );
+ x = StringToLong( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"y") == 0)
{
- y = atol( value );
+ y = StringToLong( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i],&exception));
switch (*keyword)
{
case 'b':
{
if (LocaleCompare(keyword,"blur") == 0)
{
- msl_info->image[n]->blur=atof(value);
+ msl_info->image[n]->blur=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"geometry") == 0)
{
- long
+ ssize_t
flags;
flags=ParseGeometry(value,&geometry_info);
{
if (LocaleCompare(keyword,"x-resolution") == 0)
{
- x_resolution=atof(value);
+ x_resolution=InterpretLocaleValue(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"y-resolution") == 0)
{
- y_resolution=atof(value);
+ y_resolution=InterpretLocaleValue(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
factor=1.0;
if (msl_info->image[n]->units == PixelsPerCentimeterResolution)
factor=2.54;
- width=(unsigned long) (x_resolution*msl_info->image[n]->columns/
+ width=(size_t) (x_resolution*msl_info->image[n]->columns/
(factor*(msl_info->image[n]->x_resolution == 0.0 ? DefaultResolution :
msl_info->image[n]->x_resolution))+0.5);
- height=(unsigned long) (y_resolution*msl_info->image[n]->rows/
+ height=(size_t) (y_resolution*msl_info->image[n]->rows/
(factor*(msl_info->image[n]->y_resolution == 0.0 ? DefaultResolution :
msl_info->image[n]->y_resolution))+0.5);
resample_image=ResizeImage(msl_info->image[n],width,height,
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"filter") == 0)
{
- option=ParseMagickOption(MagickFilterOptions,MagickFalse,
+ option=ParseCommandOption(MagickFilterOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedNoiseType",
{
if (LocaleCompare(keyword,"height") == 0)
{
- geometry.height=(unsigned long) atol(value);
+ geometry.height=StringToUnsignedLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"support") == 0)
{
- blur=atof(value);
+ blur=InterpretLocaleValue(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"width") == 0)
{
- geometry.width=atol(value);
+ geometry.width=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry.x=atol(value);
+ geometry.x=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"y") == 0)
{
- geometry.y=atol(value);
+ geometry.y=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i],&exception));
switch (*keyword)
{
case 'G':
{
if (LocaleCompare(keyword,"x") == 0)
{
- x = atol( value );
+ x = StringToLong( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"y") == 0)
{
- y = atol( value );
+ y = StringToLong( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"degrees") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i],&exception));
switch (*keyword)
{
case 'D':
{
if (LocaleCompare(keyword,"degrees") == 0)
{
- degrees = atof( value );
+ degrees = InterpretLocaleValue(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"height") == 0)
{
- geometry.height=(unsigned long) atol(value);
+ geometry.height=StringToUnsignedLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"width") == 0)
{
- geometry.width=atol(value);
+ geometry.width=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"height") == 0)
{
- geometry.height=(unsigned long) atol(value);
+ geometry.height=StringToUnsignedLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"width") == 0)
{
- geometry.width=atol(value);
+ geometry.width=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"cluster-threshold") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
if (LocaleCompare(keyword,"colorspace") == 0)
{
- option=ParseMagickOption(MagickColorspaceOptions,
+ option=ParseCommandOption(MagickColorspaceOptions,
MagickFalse,value);
if (option < 0)
ThrowMSLException(OptionError,
{
if (LocaleCompare(keyword,"smoothing-threshold") == 0)
{
- geometry_info.sigma=atof(value);
+ geometry_info.sigma=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
(void) SegmentImage(msl_info->image[n],colorspace,verbose,
- geometry_info.rho,geometry_info.sigma);
+ geometry_info.rho,geometry_info.sigma,&exception);
break;
}
else if (LocaleCompare((const char *) tag, "set") == 0)
{
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",
- (const char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",(const char *) tag);
break;
}
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i],&exception));
switch (*keyword)
{
case 'C':
property=GetImageProperty(msl_info->attributes[j],"id");
if (LocaleCompare(property,value) == 0)
{
- SetImageMask(msl_info->image[n],msl_info->image[j]);
+ SetImageMask(msl_info->image[n],msl_info->image[j],
+ &exception);
break;
}
}
property=GetImageProperty(msl_info->attributes[j],"id");
if (LocaleCompare(property,value) == 0)
{
- SetImageClipMask(msl_info->image[n],msl_info->image[j]);
+ SetImageClipMask(msl_info->image[n],msl_info->image[j],
+ &exception);
break;
}
}
}
if (LocaleCompare(keyword,"colorspace") == 0)
{
- long
+ ssize_t
colorspace;
- colorspace=(ColorspaceType) ParseMagickOption(
- MagickColorspaceOptions,MagickFalse,keyword);
+ colorspace=(ColorspaceType) ParseCommandOption(
+ MagickColorspaceOptions,MagickFalse,value);
if (colorspace < 0)
ThrowMSLException(OptionError,"UnrecognizedColorspace",
value);
break;
}
(void) SetMSLAttributes(msl_info,keyword,value);
+ (void) SetImageProperty(msl_info->image[n],keyword,value);
break;
}
case 'D':
break;
}
(void) SetMSLAttributes(msl_info,keyword,value);
+ (void) SetImageProperty(msl_info->image[n],keyword,value);
break;
}
case 'O':
{
if (LocaleCompare(keyword, "opacity") == 0)
{
- long opac = OpaqueOpacity,
- len = (long) strlen( value );
+ ssize_t opac = OpaqueAlpha,
+ len = (ssize_t) strlen( value );
if (value[len-1] == '%') {
char tmp[100];
(void) CopyMagickString(tmp,value,len);
- opac = atol( tmp );
+ opac = StringToLong( tmp );
opac = (int)(QuantumRange * ((float)opac/100));
} else
- opac = atol( value );
+ opac = StringToLong( value );
(void) SetImageOpacity( msl_info->image[n], (Quantum) opac );
break;
}
(void) SetMSLAttributes(msl_info,keyword,value);
+ (void) SetImageProperty(msl_info->image[n],keyword,value);
break;
}
case 'P':
if (image_option != (const char *) NULL)
flags=ParseAbsoluteGeometry(image_option,&geometry);
flags=ParseAbsoluteGeometry(value,&geometry);
- (void) FormatMagickString(page,MaxTextExtent,"%lux%lu",
- geometry.width,geometry.height);
+ (void) FormatLocaleString(page,MaxTextExtent,"%.20gx%.20g",
+ (double) geometry.width,(double) geometry.height);
if (((flags & XValue) != 0) || ((flags & YValue) != 0))
- (void) FormatMagickString(page,MaxTextExtent,"%lux%lu%+ld%+ld",
- geometry.width,geometry.height,geometry.x,geometry.y);
+ (void) FormatLocaleString(page,MaxTextExtent,
+ "%.20gx%.20g%+.20g%+.20g",(double) geometry.width,
+ (double) geometry.height,(double) geometry.x,(double)
+ geometry.y);
(void) SetImageOption(msl_info->image_info[n],keyword,page);
msl_info->image_info[n]->page=GetPageGeometry(page);
break;
}
(void) SetMSLAttributes(msl_info,keyword,value);
+ (void) SetImageProperty(msl_info->image[n],keyword,value);
break;
}
default:
{
(void) SetMSLAttributes(msl_info,keyword,value);
+ (void) SetImageProperty(msl_info->image[n],keyword,value);
break;
}
}
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"azimuth") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"elevation") == 0)
{
- geometry_info.sigma=atof(value);
+ geometry_info.sigma=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
if (LocaleCompare(keyword,"gray") == 0)
{
- option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedNoiseType",
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"opacity") == 0)
{
- geometry_info.rho=atol(value);
+ geometry_info.rho=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"sigma") == 0)
{
- geometry_info.sigma=atol(value);
+ geometry_info.sigma=StringToLong(value);
break;
}
break;
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry_info.xi=atof(value);
+ geometry_info.xi=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"y") == 0)
{
- geometry_info.psi=atol(value);
+ geometry_info.psi=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
shadow_image=ShadowImage(msl_info->image[n],geometry_info.rho,
- geometry_info.sigma,(long) (geometry_info.xi+0.5),(long)
- (geometry_info.psi+0.5),&msl_info->image[n]->exception);
+ geometry_info.sigma,(ssize_t) ceil(geometry_info.xi-0.5),(ssize_t)
+ ceil(geometry_info.psi-0.5),&msl_info->image[n]->exception);
if (shadow_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
}
if (LocaleCompare((const char *) tag,"sharpen") == 0)
{
- double radius = 0.0,
+ double bias = 0.0,
+ radius = 0.0,
sigma = 1.0;
if (msl_info->image[n] == (Image *) NULL)
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i],&exception));
switch (*keyword)
{
+ case 'B':
+ case 'b':
+ {
+ if (LocaleCompare(keyword, "bias") == 0)
+ {
+ bias = InterpretLocaleValue(value,(char **) NULL);
+ break;
+ }
+ ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
+ break;
+ }
case 'R':
case 'r':
{
if (LocaleCompare(keyword, "radius") == 0)
{
- radius = atof( value );
+ radius = InterpretLocaleValue(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"sigma") == 0)
{
- sigma = atol( value );
+ sigma = StringToLong( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
Image
*newImage;
- newImage=SharpenImage(msl_info->image[n],radius,sigma,&msl_info->image[n]->exception);
+ newImage=SharpenImage(msl_info->image[n],radius,sigma,bias,
+ &msl_info->image[n]->exception);
if (newImage == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i],&exception));
switch (*keyword)
{
case 'G':
{
if (LocaleCompare(keyword,"height") == 0)
{
- height = atol( value );
+ height = StringToLong( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"width") == 0)
{
- width = atol( value );
+ width = StringToLong( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword, "fill") == 0)
{
- (void) QueryColorDatabase(value,
+ (void) QueryColorCompliance(value,AllCompliance,
&msl_info->image[n]->background_color,&exception);
break;
}
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"y") == 0)
{
- geometry_info.sigma=atol(value);
+ geometry_info.sigma=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
}
- (void) SignatureImage(msl_info->image[n]);
+ (void) SignatureImage(msl_info->image[n],&exception);
break;
}
if (LocaleCompare((const char *) tag,"solarize") == 0)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"threshold") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- (void) SolarizeImage(msl_info->image[n],geometry_info.rho);
+ (void) SolarizeImage(msl_info->image[n],geometry_info.rho,
+ &msl_info->image[n]->exception);
break;
}
if (LocaleCompare((const char *) tag,"spread") == 0)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
spread_image=SpreadImage(msl_info->image[n],geometry_info.rho,
- &msl_info->image[n]->exception);
+ msl_info->image[n]->interpolate,&msl_info->image[n]->exception);
if (spread_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i],&exception));
switch (*keyword)
{
case 'I':
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i],&exception));
switch (*keyword)
{
case 'I':
*q,
*swap;
- long
+ ssize_t
index,
swap_index;
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword,"indexes") == 0)
{
flags=ParseGeometry(value,&geometry_info);
- index=(long) geometry_info.rho;
+ index=(ssize_t) geometry_info.rho;
if ((flags & SigmaValue) == 0)
- swap_index=(long) geometry_info.sigma;
+ swap_index=(ssize_t) geometry_info.sigma;
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"degrees") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=InterpretLocaleValue(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
swirl_image=SwirlImage(msl_info->image[n],geometry_info.rho,
- &msl_info->image[n]->exception);
+ msl_info->image[n]->interpolate,&msl_info->image[n]->exception);
if (swirl_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ &exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i],&exception));
switch (*keyword)
{
case 'T':
{
if (LocaleCompare(keyword,"threshold") == 0)
{
- threshold = atof( value );
+ threshold = InterpretLocaleValue(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
process image.
*/
{
- BilevelImageChannel(msl_info->image[n],
- (ChannelType) ((long) (AllChannels &~ (long) OpacityChannel)),
- threshold);
+ BilevelImage(msl_info->image[n],threshold);
break;
}
}
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i],&exception));
switch (*keyword)
{
case 'C':
{
if (LocaleCompare(keyword,"color") == 0)
{
- MagickPixelPacket
+ PixelInfo
target;
- (void) QueryMagickColor(value,&target,&exception);
+ (void) QueryMagickColorCompliance(value,AllCompliance,&target,
+ &exception);
(void) TransparentPaintImage(msl_info->image[n],&target,
- TransparentOpacity,MagickFalse);
+ TransparentAlpha,MagickFalse,&msl_info->image[n]->exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i],&exception));
switch (*keyword)
{
case 'F':
/* process */
{
- (void) WriteImage(msl_info->image_info[n], msl_info->image[n]);
+ (void) WriteImage(msl_info->image_info[n], msl_info->image[n],
+ &msl_info->image[n]->exception);
break;
}
}
static void MSLEndElement(void *context,const xmlChar *tag)
{
- long
+ ssize_t
n;
MSLInfo
{
if (msl_info->group_info[msl_info->number_groups-1].numImages > 0 )
{
- long i = (long)
+ ssize_t i = (ssize_t)
(msl_info->group_info[msl_info->number_groups-1].numImages);
while ( i-- )
{
register char
*p;
- register long
+ register ssize_t
i;
/*
else
{
msl_info->content=(char *) NULL;
- if (~length >= MaxTextExtent)
+ if (~length >= (MaxTextExtent-1))
msl_info->content=(char *) AcquireQuantumMemory(length+MaxTextExtent,
sizeof(*msl_info->content));
if (msl_info->content != (char *) NULL)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" SAX.ignorableWhitespace(%.30s, %d)",c,length);
msl_info=(MSLInfo *) context;
+ (void) msl_info;
}
static void MSLProcessingInstructions(void *context,const xmlChar *target,
" SAX.processingInstruction(%s, %s)",
target,data);
msl_info=(MSLInfo *) context;
+ (void) msl_info;
}
static void MSLComment(void *context,const xmlChar *value)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" SAX.comment(%s)",value);
msl_info=(MSLInfo *) context;
+ (void) msl_info;
}
static void MSLWarning(void *context,const char *format,...)
(void) LogMagickEvent(CoderEvent,GetMagickModule()," SAX.warning: ");
(void) LogMagickEvent(CoderEvent,GetMagickModule(),format,operands);
msl_info=(MSLInfo *) context;
+ (void) msl_info;
#if !defined(MAGICKCORE_HAVE_VSNPRINTF)
(void) vsprintf(reason,format,operands);
#else
(void) LogMagickEvent(CoderEvent,GetMagickModule()," SAX.error: ");
(void) LogMagickEvent(CoderEvent,GetMagickModule(),format,operands);
msl_info=(MSLInfo *) context;
+ (void) msl_info;
#if !defined(MAGICKCORE_HAVE_VSNPRINTF)
(void) vsprintf(reason,format,operands);
#else
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" SAX.pcdata(%s, %d)",value,length);
msl_info=(MSLInfo *) context;
+ (void) msl_info;
parser=msl_info->parser;
child=xmlGetLastChild(parser->node);
if ((child != (xmlNodePtr) NULL) && (child->type == XML_CDATA_SECTION_NODE))
(external_id != (const xmlChar *) NULL ? (const char *) external_id : " "),
(system_id != (const xmlChar *) NULL ? (const char *) system_id : " "));
msl_info=(MSLInfo *) context;
+ (void) msl_info;
parser=msl_info->parser;
if (((external_id == NULL) && (system_id == NULL)) ||
((parser->validate == 0) || (parser->wellFormed == 0) ||
int
status;
- long
+ ssize_t
n;
MSLInfo
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
image_info->filename);
assert(image != (Image **) NULL);
- msl_image=AcquireImage(image_info);
+ msl_image=AcquireImage(image_info,exception);
status=OpenBlob(image_info,msl_image,ReadBinaryBlobMode,exception);
if (status == MagickFalse)
{
"UnableToInterpretMSLImage");
*msl_info.image_info=CloneImageInfo(image_info);
*msl_info.draw_info=CloneDrawInfo(image_info,(DrawInfo *) NULL);
- *msl_info.attributes=AcquireImage(image_info);
+ *msl_info.attributes=AcquireImage(image_info,exception);
msl_info.group_info[0].numImages=0;
/* the first slot is used to point to the MSL file image */
*msl_info.image=msl_image;
msl_image->filename);
while (ReadBlobString(msl_image,message) != (char *) NULL)
{
- n=(long) strlen(message);
+ n=(ssize_t) strlen(message);
if (n == 0)
continue;
status=xmlParseChunk(msl_info.parser,message,(int) n,MagickFalse);
%
% The format of the RegisterMSLImage method is:
%
-% unsigned long RegisterMSLImage(void)
+% size_t RegisterMSLImage(void)
%
*/
-ModuleExport unsigned long RegisterMSLImage(void)
+ModuleExport size_t RegisterMSLImage(void)
{
MagickInfo
*entry;
return(MagickImageCoderSignature);
}
\f
+#if defined(MAGICKCORE_XML_DELEGATE)
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
int
flags;
- long
+ ssize_t
n;
assert(msl_info != (MSLInfo *) NULL);
{
if (LocaleCompare(keyword,"adjoin") == 0)
{
- long
+ ssize_t
adjoin;
- adjoin=ParseMagickOption(MagickBooleanOptions,MagickFalse,value);
+ adjoin=ParseCommandOption(MagickBooleanOptions,MagickFalse,value);
if (adjoin < 0)
ThrowMSLException(OptionError,"UnrecognizedType",value);
image_info->adjoin=(MagickBooleanType) adjoin;
}
if (LocaleCompare(keyword,"alpha") == 0)
{
- long
+ ssize_t
alpha;
- alpha=ParseMagickOption(MagickAlphaOptions,MagickFalse,value);
+ alpha=ParseCommandOption(MagickAlphaOptions,MagickFalse,value);
if (alpha < 0)
ThrowMSLException(OptionError,"UnrecognizedType",value);
if (image != (Image *) NULL)
- (void) SetImageAlphaChannel(image,(AlphaChannelType) alpha);
+ (void) SetImageAlphaChannel(image,(AlphaChannelType) alpha,
+ exception);
break;
}
if (LocaleCompare(keyword,"antialias") == 0)
{
- long
+ ssize_t
antialias;
- antialias=ParseMagickOption(MagickBooleanOptions,MagickFalse,value);
+ antialias=ParseCommandOption(MagickBooleanOptions,MagickFalse,value);
if (antialias < 0)
ThrowMSLException(OptionError,"UnrecognizedGravityType",value);
image_info->antialias=(MagickBooleanType) antialias;
limit=MagickResourceInfinity;
if (LocaleCompare(value,"unlimited") != 0)
- limit=(MagickSizeType) StringToDouble(value,100.0);
+ limit=(MagickSizeType) SiPrefixToDouble(value,100.0);
(void) SetMagickResourceLimit(AreaResource,limit);
break;
}
{
if (LocaleCompare(keyword,"background") == 0)
{
- (void) QueryColorDatabase(value,&image_info->background_color,
- exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &image_info->background_color,exception);
break;
}
if (LocaleCompare(keyword,"bias") == 0)
{
if (image == (Image *) NULL)
break;
- image->bias=StringToDouble(value,QuantumRange);
+ image->bias=SiPrefixToDouble(value,QuantumRange);
break;
}
if (LocaleCompare(keyword,"blue-primary") == 0)
}
if (LocaleCompare(keyword,"bordercolor") == 0)
{
- (void) QueryColorDatabase(value,&image_info->border_color,
- exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &image_info->border_color,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"fill") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->fill,exception);
+ (void) QueryColorCompliance(value,AllCompliance,&draw_info->fill,
+ exception);
(void) SetImageOption(image_info,keyword,value);
break;
}
{
if (LocaleCompare(keyword,"gravity") == 0)
{
- long
+ ssize_t
gravity;
- gravity=ParseMagickOption(MagickGravityOptions,MagickFalse,value);
+ gravity=ParseCommandOption(MagickGravityOptions,MagickFalse,value);
if (gravity < 0)
ThrowMSLException(OptionError,"UnrecognizedGravityType",value);
(void) SetImageOption(image_info,keyword,value);
}
if (LocaleCompare(keyword,"mattecolor") == 0)
{
- (void) QueryColorDatabase(value,&image_info->matte_color,
- exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &image_info->matte_color,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"pointsize") == 0)
{
- image_info->pointsize=atof(value);
- draw_info->pointsize=atof(value);
+ image_info->pointsize=InterpretLocaleValue(value,(char **) NULL);
+ draw_info->pointsize=InterpretLocaleValue(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"quality") == 0)
{
- image_info->quality=atol(value);
+ image_info->quality=StringToLong(value);
if (image == (Image *) NULL)
break;
- image->quality=atol(value);
+ image->quality=StringToLong(value);
break;
}
break;
}
if (LocaleCompare(keyword,"stroke") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->stroke,exception);
+ (void) QueryColorCompliance(value,AllCompliance,&draw_info->stroke,
+ exception);
(void) SetImageOption(image_info,keyword,value);
break;
}
}
return(MagickTrue);
}
+#endif
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The format of the WriteMSLImage method is:
%
-% MagickBooleanType WriteMSLImage(const ImageInfo *image_info,Image *image)
+% MagickBooleanType WriteMSLImage(const ImageInfo *image_info,
+% Image *image,ExceptionInfo *exception)
%
% A description of each parameter follows.
%
%
% o image: The image.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
-static MagickBooleanType WriteMSLImage(const ImageInfo *image_info,Image *image)
+static MagickBooleanType WriteMSLImage(const ImageInfo *image_info,Image *image,
+ ExceptionInfo *exception)
{
assert(image_info != (const ImageInfo *) NULL);
assert(image_info->signature == MagickSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
(void) ReferenceImage(image);
- (void) ProcessMSLScript(image_info,&image,&image->exception);
+ (void) ProcessMSLScript(image_info,&image,exception);
return(MagickTrue);
}
#endif