% Execute Magick Scripting Language Scripts. %
% %
% Software Design %
-% John Cristy %
+% Cristy %
% Leonard Rosenthol %
% William Radcliffe %
% December 2001 %
% %
% %
-% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2015 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 "MagickCore/studio.h"
#include "MagickCore/annotate.h"
#include "MagickCore/artifact.h"
+#include "MagickCore/attribute.h"
#include "MagickCore/blob.h"
#include "MagickCore/blob-private.h"
#include "MagickCore/cache.h"
#include "MagickCore/cache-view.h"
+#include "MagickCore/channel.h"
#include "MagickCore/color.h"
#include "MagickCore/color-private.h"
#include "MagickCore/colormap.h"
#include "MagickCore/constitute.h"
#include "MagickCore/decorate.h"
#include "MagickCore/display.h"
+#include "MagickCore/distort.h"
#include "MagickCore/draw.h"
#include "MagickCore/effect.h"
#include "MagickCore/enhance.h"
#include "MagickCore/segment.h"
#include "MagickCore/shear.h"
#include "MagickCore/signature.h"
+#include "MagickCore/statistic.h"
#include "MagickCore/static.h"
#include "MagickCore/string_.h"
#include "MagickCore/string-private.h"
#include "MagickCore/utility.h"
#if defined(MAGICKCORE_XML_DELEGATE)
# if defined(MAGICKCORE_WINDOWS_SUPPORT)
-# if defined(__MINGW32__)
-# define _MSC_VER
-# else
+# if !defined(__MINGW32__) && !defined(__MINGW64__)
# include <win32config.h>
# endif
# endif
msl_info->image=(Image **) ResizeQuantumMemory(msl_info->image,(n+1),
sizeof(*msl_info->image));
if ((msl_info->image_info == (ImageInfo **) NULL) ||
- (msl_info->draw_info == (DrawInfo **) NULL) ||
- (msl_info->attributes == (Image **) NULL) ||
- (msl_info->image == (Image **) NULL))
- ThrowMSLException(ResourceLimitFatalError,"MemoryAllocationFailed","msl");
+ (msl_info->draw_info == (DrawInfo **) NULL) ||
+ (msl_info->attributes == (Image **) NULL) ||
+ (msl_info->image == (Image **) NULL))
+ ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed")
msl_info->image_info[n]=CloneImageInfo(msl_info->image_info[n-1]);
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],
- &image->exception);
+ msl_info->exception);
else
- msl_info->attributes[n]=CloneImage(image,0,0,MagickTrue,&image->exception);
+ msl_info->attributes[n]=CloneImage(image,0,0,MagickTrue,
+ msl_info->exception);
msl_info->image[n]=(Image *) image;
if ((msl_info->image_info[n] == (ImageInfo *) NULL) ||
- (msl_info->attributes[n] == (Image *) NULL))
- ThrowMSLException(ResourceLimitFatalError,"MemoryAllocationFailed","msl");
+ (msl_info->attributes[n] == (Image *) NULL))
+ ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed")
if (msl_info->number_groups != 0)
msl_info->group_info[msl_info->number_groups-1].numImages++;
}
*draw_info;
ExceptionInfo
- exception;
+ *exception;
GeometryInfo
geometry_info;
*/
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" SAX.startElement(%s",tag);
- GetExceptionInfo(&exception);
+ exception=AcquireExceptionInfo();
msl_info=(MSLInfo *) context;
n=msl_info->n;
keyword=(const char *) NULL;
value=(char *) NULL;
SetGeometryInfo(&geometry_info);
+ (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
channel=DefaultChannels;
switch (*tag)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
}
- channel_mask=SetPixelChannelMask(msl_info->image[n],channel);
+ channel_mask=SetImageChannelMask(msl_info->image[n],channel);
noise_image=AddNoiseImage(msl_info->image[n],noise,1.0,
- &msl_info->image[n]->exception);
- (void) SetPixelChannelMap(msl_info->image[n],channel_mask);
+ msl_info->exception);
+ (void) SetPixelChannelMask(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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
*p;
p=value;
- draw_info->affine.sx=InterpretLocaleValue(p,&p);
+ draw_info->affine.sx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.rx=InterpretLocaleValue(p,&p);
+ draw_info->affine.rx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ry=InterpretLocaleValue(p,&p);
+ draw_info->affine.ry=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.sy=InterpretLocaleValue(p,&p);
+ draw_info->affine.sy=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.tx=InterpretLocaleValue(p,&p);
+ draw_info->affine.tx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ty=InterpretLocaleValue(p,&p);
+ draw_info->affine.ty=StringToDouble(p,&p);
break;
}
if (LocaleCompare(keyword,"align") == 0)
}
if (LocaleCompare(keyword,"antialias") == 0)
{
- option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
- value);
+ option=ParseCommandOption(MagickBooleanOptions,
+ MagickFalse,value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedBooleanType",
value);
if (LocaleCompare(keyword, "fill") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &draw_info->fill,&exception);
+ &draw_info->fill,exception);
break;
}
if (LocaleCompare(keyword,"family") == 0)
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParseGravityGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
break;
}
if (LocaleCompare(keyword,"gravity") == 0)
{
if (LocaleCompare(keyword,"pointsize") == 0)
{
- draw_info->pointsize=InterpretLocaleValue(value,
- (char **) NULL);
+ draw_info->pointsize=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"rotate") == 0)
{
- angle=InterpretLocaleValue(value,(char **) NULL);
+ angle=StringToDouble(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=InterpretLocaleValue(value,(char **) NULL);
+ angle=StringToDouble(value,(char **) NULL);
affine.ry=tan(DegreesToRadians(fmod((double) angle,
360.0)));
break;
}
if (LocaleCompare(keyword,"skewY") == 0)
{
- angle=InterpretLocaleValue(value,(char **) NULL);
+ angle=StringToDouble(value,(char **) NULL);
affine.rx=tan(DegreesToRadians(fmod((double) angle,
360.0)));
break;
if (LocaleCompare(keyword, "stroke") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &draw_info->stroke,&exception);
+ &draw_info->stroke,exception);
break;
}
if (LocaleCompare(keyword,"strokewidth") == 0)
if (LocaleCompare(keyword, "undercolor") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &draw_info->undercolor,&exception);
+ &draw_info->undercolor,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
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);
+ msl_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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
append_image=AppendImages(msl_info->image[n],stack,
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (append_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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
- (char **) NULL);
+ geometry_info.rho=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- channel_mask=SetPixelChannelMask(msl_info->image[n],channel);
+ channel_mask=SetImageChannelMask(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);
+ geometry_info.sigma,msl_info->exception);
+ (void) SetPixelChannelMask(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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword, "fill") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &msl_info->image[n]->border_color,&exception);
+ &msl_info->image[n]->border_color,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParsePageGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
break;
}
}
border_image=BorderImage(msl_info->image[n],&geometry,
- msl_info->image[n]->compose,&msl_info->image[n]->exception);
+ msl_info->image[n]->compose,msl_info->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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword,"fill") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &target,&msl_info->image[n]->exception);
+ &target,msl_info->exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
colorize_image=ColorizeImage(msl_info->image[n],blend,&target,
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (colorize_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
}
if (LocaleCompare((const char *) tag, "charcoal") == 0)
{
- double bias = 0.0,
+ double
radius = 0.0,
sigma = 1.0;
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i],&exception));
+ 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)
+ if (LocaleCompare(keyword,"radius") == 0)
{
- radius = InterpretLocaleValue(value,(char **) NULL);
+ radius=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
Image
*newImage;
- newImage=CharcoalImage(msl_info->image[n],radius,sigma,bias,
- &msl_info->image[n]->exception);
+ newImage=CharcoalImage(msl_info->image[n],radius,sigma,
+ msl_info->exception);
if (newImage == (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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParsePageGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
break;
}
}
chop_image=ChopImage(msl_info->image[n],&geometry,
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (chop_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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword,"bordercolor") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &target,&exception);
+ &target,exception);
paint_method=FillToBorderMethod;
break;
}
if (LocaleCompare(keyword,"fill") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &draw_info->fill,&exception);
+ &draw_info->fill,exception);
break;
}
if (LocaleCompare(keyword,"fuzz") == 0)
{
- msl_info->image[n]->fuzz=InterpretLocaleValue(value,
+ msl_info->image[n]->fuzz=StringToDouble(value,
(char **) NULL);
break;
}
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParsePageGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
- geometry.x,geometry.y,&target,&exception);
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
+ TileVirtualPixelMethod,geometry.x,geometry.y,&target,
+ exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
if (LocaleCompare(keyword,"x") == 0)
{
geometry.x=StringToLong(value);
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
- geometry.x,geometry.y,&target,&exception);
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
+ TileVirtualPixelMethod,geometry.x,geometry.y,&target,
+ exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
if (LocaleCompare(keyword,"y") == 0)
{
geometry.y=StringToLong(value);
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
- geometry.x,geometry.y,&target,&exception);
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
+ TileVirtualPixelMethod,geometry.x,geometry.y,&target,
+ exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
(void) FloodfillPaintImage(msl_info->image[n],draw_info,&target,
geometry.x,geometry.y,paint_method == FloodfillMethod ?
- MagickFalse : MagickTrue,&msl_info->image[n]->exception);
+ MagickFalse : MagickTrue,msl_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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
const char
*attribute;
- attribute=GetImageProperty(msl_info->attributes[j],"id");
+ attribute=GetImageProperty(msl_info->attributes[j],"id",
+ exception);
if ((attribute != (const char *) NULL) &&
(LocaleCompare(attribute,value) == 0))
{
composite_image=CloneImage(msl_info->image[j],0,0,
- MagickFalse,&exception);
+ MagickFalse,exception);
break;
}
}
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword, "color") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &composite_image->background_color,&exception);
+ &composite_image->background_color,exception);
break;
}
if (LocaleCompare(keyword,"compose") == 0)
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParsePageGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
break;
const char
*attribute;
- attribute=GetImageProperty(msl_info->attributes[j],"id");
+ attribute=GetImageProperty(msl_info->attributes[j],"id",
+ exception);
if ((attribute != (const char *) NULL) &&
(LocaleCompare(value,value) == 0))
{
SetImageType(composite_image,TrueColorMatteType,
- &exception);
+ exception);
(void) CompositeImage(composite_image,
- CopyOpacityCompositeOp,msl_info->image[j],0,0);
+ msl_info->image[j],CopyAlphaCompositeOp,MagickTrue,
+ 0,0,exception);
break;
}
}
if (compose != DissolveCompositeOp)
{
(void) SetImageAlpha(composite_image,(Quantum)
- opacity);
+ opacity,exception);
break;
}
(void) SetImageArtifact(msl_info->image[n],
"compose:args",value);
- if (composite_image->matte != MagickTrue)
- (void) SetImageAlpha(composite_image,OpaqueAlpha);
- composite_view=AcquireCacheView(composite_image);
+ if (composite_image->alpha_trait != BlendPixelTrait)
+ (void) SetImageAlpha(composite_image,OpaqueAlpha,
+ exception);
+ composite_view=AcquireAuthenticCacheView(composite_image,exception);
for (y=0; y < (ssize_t) composite_image->rows ; y++)
{
q=GetCacheViewAuthenticPixels(composite_view,0,y,
- (ssize_t) composite_image->columns,1,&exception);
+ (ssize_t) composite_image->columns,1,exception);
for (x=0; x < (ssize_t) composite_image->columns; x++)
{
if (GetPixelAlpha(composite_image,q) == OpaqueAlpha)
ClampToQuantum(opacity),q);
q+=GetPixelChannels(composite_image);
}
- if (SyncCacheViewAuthenticPixels(composite_view,&exception) == MagickFalse)
+ if (SyncCacheViewAuthenticPixels(composite_view,exception) == MagickFalse)
break;
}
composite_view=DestroyCacheView(composite_view);
if (LocaleCompare(keyword,"rotate") == 0)
{
rotate_image=RotateImage(composite_image,
- InterpretLocaleValue(value,(char **) NULL),&exception);
+ StringToDouble(value,(char **) NULL),exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
for (x=0; x < (ssize_t) image->columns; x+=(ssize_t) width)
{
if (rotate_image != (Image *) NULL)
- (void) CompositeImage(image,compose,rotate_image,
- x,y);
+ (void) CompositeImage(image,rotate_image,compose,
+ MagickTrue,x,y,exception);
else
- (void) CompositeImage(image,compose,
- composite_image,x,y);
+ (void) CompositeImage(image,composite_image,
+ compose,MagickTrue,x,y,exception);
}
if (rotate_image != (Image *) NULL)
rotate_image=DestroyImage(rotate_image);
(double) composite_image->rows,(double) geometry.x,(double)
geometry.y);
flags=ParseGravityGeometry(image,composite_geometry,&geometry,
- &exception);
- channel_mask=SetPixelChannelMask(image,channel);
+ exception);
+ channel_mask=SetImageChannelMask(image,channel);
if (rotate_image == (Image *) NULL)
- CompositeImage(image,compose,composite_image,geometry.x,geometry.y);
+ CompositeImage(image,composite_image,compose,MagickTrue,geometry.x,
+ geometry.y,exception);
else
{
/*
composite_image->columns)/2;
geometry.y-=(ssize_t) (rotate_image->rows-
composite_image->rows)/2;
- CompositeImage(image,compose,rotate_image,geometry.x,geometry.y);
+ CompositeImage(image,rotate_image,compose,MagickTrue,geometry.x,
+ geometry.y,exception);
rotate_image=DestroyImage(rotate_image);
}
- (void) SetPixelChannelMask(image,channel_mask);
+ (void) SetImageChannelMask(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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
(void) ContrastImage(msl_info->image[n],sharpen,
- &msl_info->image[n]->exception);
+ msl_info->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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParseGravityGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
crop_image=CropImage(msl_info->image[n],&geometry,
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (crop_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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
}
- (void) CycleColormapImage(msl_info->image[n],display,&exception);
+ (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],
- &exception);
+ exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
despeckle_image=DespeckleImage(msl_info->image[n],
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (despeckle_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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
(void) DisplayImages(msl_info->image_info[n],msl_info->image[n],
- &msl_info->image[n]->exception);
+ msl_info->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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
*p;
p=value;
- draw_info->affine.sx=InterpretLocaleValue(p,&p);
+ draw_info->affine.sx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.rx=InterpretLocaleValue(p,&p);
+ draw_info->affine.rx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ry=InterpretLocaleValue(p,&p);
+ draw_info->affine.ry=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.sy=InterpretLocaleValue(p,&p);
+ draw_info->affine.sy=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.tx=InterpretLocaleValue(p,&p);
+ draw_info->affine.tx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ty=InterpretLocaleValue(p,&p);
+ draw_info->affine.ty=StringToDouble(p,&p);
break;
}
if (LocaleCompare(keyword,"align") == 0)
if (LocaleCompare(keyword, "fill") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &draw_info->fill,&exception);
+ &draw_info->fill,exception);
break;
}
if (LocaleCompare(keyword,"family") == 0)
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParsePageGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
break;
case 'P':
case 'p':
{
- if (LocaleCompare(keyword,"primitive") == 0)
+ if (LocaleCompare(keyword,"points") == 0)
{
- CloneString(&draw_info->primitive,value);
+ if (LocaleCompare(draw_info->primitive,"path") == 0)
+ {
+ (void) ConcatenateString(&draw_info->primitive," '");
+ ConcatenateString(&draw_info->primitive,value);
+ (void) ConcatenateString(&draw_info->primitive,"'");
+ }
+ else
+ {
+ (void) ConcatenateString(&draw_info->primitive," ");
+ ConcatenateString(&draw_info->primitive,value);
+ }
break;
}
if (LocaleCompare(keyword,"pointsize") == 0)
{
- draw_info->pointsize=InterpretLocaleValue(value,
+ draw_info->pointsize=StringToDouble(value,
(char **) NULL);
break;
}
+ if (LocaleCompare(keyword,"primitive") == 0)
+ {
+ CloneString(&draw_info->primitive,value);
+ break;
+ }
ThrowMSLException(OptionError,"UnrecognizedAttribute",
keyword);
break;
{
if (LocaleCompare(keyword,"rotate") == 0)
{
- angle=InterpretLocaleValue(value,(char **) NULL);
+ angle=StringToDouble(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=InterpretLocaleValue(value,(char **) NULL);
+ angle=StringToDouble(value,(char **) NULL);
affine.ry=cos(DegreesToRadians(fmod(angle,360.0)));
break;
}
if (LocaleCompare(keyword,"skewY") == 0)
{
- angle=InterpretLocaleValue(value,(char **) NULL);
+ angle=StringToDouble(value,(char **) NULL);
affine.rx=cos(DegreesToRadians(fmod(angle,360.0)));
break;
}
if (LocaleCompare(keyword, "stroke") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &draw_info->stroke,&exception);
+ &draw_info->stroke,exception);
break;
}
if (LocaleCompare(keyword,"strokewidth") == 0)
if (LocaleCompare(keyword, "undercolor") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &draw_info->undercolor,&exception);
+ &draw_info->undercolor,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
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);
+ (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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
- (char **) NULL);
+ geometry_info.rho=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
edge_image=EdgeImage(msl_info->image[n],geometry_info.rho,
- geometry_info.sigma,&msl_info->image[n]->exception);
+ msl_info->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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
}
}
emboss_image=EmbossImage(msl_info->image[n],geometry_info.rho,
- geometry_info.sigma,&msl_info->image[n]->exception);
+ geometry_info.sigma,msl_info->exception);
if (emboss_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],
- &exception);
+ exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
enhance_image=EnhanceImage(msl_info->image[n],
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (enhance_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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
(void) EqualizeImage(msl_info->image[n],
- &msl_info->image[n]->exception);
+ msl_info->exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedElement",(const char *) tag);
*newImage;
newImage=MergeImageLayers(msl_info->image[n],FlattenLayer,
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (newImage == (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],
- &exception);
+ exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
flip_image=FlipImage(msl_info->image[n],
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (flip_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],
- &exception);
+ exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
flop_image=FlopImage(msl_info->image[n],
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (flop_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
(const char *) tag);
break;
}
+ (void) ResetMagickMemory(&frame_info,0,sizeof(frame_info));
SetGeometry(msl_info->image[n],&geometry);
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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword, "fill") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &msl_info->image[n]->matte_color,&exception);
+ &msl_info->image[n]->matte_color,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParsePageGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
frame_info.width=geometry.width;
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]->compose,&msl_info->image[n]->exception);
+ msl_info->image[n]->compose,msl_info->exception);
if (frame_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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"blue") == 0)
{
- pixel.blue=InterpretLocaleValue(value,(char **) NULL);
+ pixel.blue=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
if (LocaleCompare(keyword,"green") == 0)
{
- pixel.green=InterpretLocaleValue(value,(char **) NULL);
+ pixel.green=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"red") == 0)
{
- pixel.red=InterpretLocaleValue(value,(char **) NULL);
+ pixel.red=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
(void) FormatLocaleString(gamma,MaxTextExtent,"%g,%g,%g",
(double) pixel.red,(double) pixel.green,(double) pixel.blue);
(void) GammaImage(msl_info->image[n],atof(gamma),
- &msl_info->image[n]->exception);
+ msl_info->exception);
break;
}
else if (LocaleCompare((const char *) tag,"get") == 0)
{
(void) FormatLocaleString(value,MaxTextExtent,"%.20g",
(double) msl_info->image[n]->rows);
- (void) SetImageProperty(msl_info->attributes[n],key,value);
+ (void) SetImageProperty(msl_info->attributes[n],key,value,
+ exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
(void) FormatLocaleString(value,MaxTextExtent,"%.20g",
(double) msl_info->image[n]->columns);
- (void) SetImageProperty(msl_info->attributes[n],key,value);
+ (void) SetImageProperty(msl_info->attributes[n],key,value,
+ 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],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'C':
"xc:",MaxTextExtent);
(void) ConcatenateMagickString(msl_info->image_info[n]->
filename,value,MaxTextExtent);
- next_image=ReadImage(msl_info->image_info[n],&exception);
- CatchException(&exception);
+ next_image=ReadImage(msl_info->image_info[n],exception);
+ CatchException(exception);
if (next_image == (Image *) NULL)
continue;
if (msl_info->image[n] == (Image *) NULL)
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"amount") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
}
}
implode_image=ImplodeImage(msl_info->image[n],geometry_info.rho,
- msl_info->image[n]->interpolate,&msl_info->image[n]->exception);
+ msl_info->image[n]->interpolate,msl_info->exception);
if (implode_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
{
if (LocaleCompare(keyword,"black") == 0)
{
- levelBlack = InterpretLocaleValue(value,(char **) NULL);
+ levelBlack = StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"gamma") == 0)
{
- levelGamma = InterpretLocaleValue(value,(char **) NULL);
+ levelGamma = StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"white") == 0)
{
- levelWhite = InterpretLocaleValue(value,(char **) NULL);
+ levelWhite = StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
/* process image */
LevelImage(msl_info->image[n],levelBlack,levelWhite,levelGamma,
- &msl_info->image[n]->exception);
+ msl_info->exception);
break;
}
}
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
magnify_image=MagnifyImage(msl_info->image[n],
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (magnify_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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
const char
*attribute;
- attribute=GetImageProperty(msl_info->attributes[j],"id");
+ attribute=GetImageProperty(msl_info->attributes[j],"id",
+ exception);
if ((attribute != (const char *) NULL) &&
(LocaleCompare(attribute,value) == 0))
{
affinity_image=CloneImage(msl_info->image[j],0,0,
- MagickFalse,&exception);
+ MagickFalse,exception);
break;
}
}
}
}
quantize_info=AcquireQuantizeInfo(msl_info->image_info[n]);
- quantize_info->dither=dither;
+ quantize_info->dither_method=dither != MagickFalse ?
+ RiemersmaDitherMethod : NoDitherMethod;
(void) RemapImages(quantize_info,msl_info->image[n],
- affinity_image,&exception);
+ affinity_image,exception);
quantize_info=DestroyQuantizeInfo(quantize_info);
affinity_image=DestroyImage(affinity_image);
break;
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword,"bordercolor") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &target,&exception);
+ &target,exception);
paint_method=FillToBorderMethod;
break;
}
{
if (LocaleCompare(keyword,"fuzz") == 0)
{
- msl_info->image[n]->fuzz=InterpretLocaleValue(value,
+ msl_info->image[n]->fuzz=StringToDouble(value,
(char **) NULL);
break;
}
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParsePageGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
- geometry.x,geometry.y,&target,&exception);
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
+ TileVirtualPixelMethod,geometry.x,geometry.y,&target,
+ exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"opacity") == 0)
{
- opacity=InterpretLocaleValue(value,(char **) NULL);
+ opacity=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
if (LocaleCompare(keyword,"x") == 0)
{
geometry.x=StringToLong(value);
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
- geometry.x,geometry.y,&target,&exception);
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
+ TileVirtualPixelMethod,geometry.x,geometry.y,&target,
+ exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
if (LocaleCompare(keyword,"y") == 0)
{
geometry.y=StringToLong(value);
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
- geometry.x,geometry.y,&target,&exception);
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
+ TileVirtualPixelMethod,geometry.x,geometry.y,&target,
+ exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
draw_info=CloneDrawInfo(msl_info->image_info[n],
msl_info->draw_info[n]);
draw_info->fill.alpha=ClampToQuantum(opacity);
- channel_mask=SetPixelChannelMask(msl_info->image[n],AlphaChannel);
+ channel_mask=SetImageChannelMask(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);
+ MagickFalse : MagickTrue,msl_info->exception);
+ (void) SetPixelChannelMask(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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
}
median_image=StatisticImage(msl_info->image[n],MedianStatistic,
(size_t) geometry_info.rho,(size_t) geometry_info.sigma,
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (median_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],
- &exception);
+ exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
minify_image=MinifyImage(msl_info->image[n],
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (minify_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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"blackness") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
if (LocaleCompare(keyword,"brightness") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
{
if (LocaleCompare(keyword,"hue") == 0)
{
- geometry_info.xi=InterpretLocaleValue(value,
+ geometry_info.xi=StringToDouble(value,
(char **) NULL);
break;
}
{
if (LocaleCompare(keyword,"lightness") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
{
if (LocaleCompare(keyword,"saturation") == 0)
{
- geometry_info.sigma=InterpretLocaleValue(value,
+ geometry_info.sigma=StringToDouble(value,
(char **) NULL);
break;
}
{
if (LocaleCompare(keyword,"whiteness") == 0)
{
- geometry_info.sigma=InterpretLocaleValue(value,
+ geometry_info.sigma=StringToDouble(value,
(char **) NULL);
break;
}
(void) FormatLocaleString(modulate,MaxTextExtent,"%g,%g,%g",
geometry_info.rho,geometry_info.sigma,geometry_info.xi);
(void) ModulateImage(msl_info->image[n],modulate,
- &msl_info->image[n]->exception);
+ msl_info->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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
}
- channel_mask=SetPixelChannelMask(msl_info->image[n],channel);
+ channel_mask=SetImageChannelMask(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);
+ msl_info->exception);
+ (void) SetPixelChannelMask(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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
(void) NormalizeImage(msl_info->image[n],
- &msl_info->image[n]->exception);
+ msl_info->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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
}
}
paint_image=OilPaintImage(msl_info->image[n],geometry_info.rho,
- geometry_info.sigma,&msl_info->image[n]->exception);
+ geometry_info.sigma,msl_info->exception);
if (paint_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
break;
}
(void) QueryColorCompliance("none",AllCompliance,&target,
- &exception);
+ exception);
(void) QueryColorCompliance("none",AllCompliance,&fill_color,
- &exception);
+ 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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword,"fill") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &fill_color,&exception);
+ &fill_color,exception);
break;
}
if (LocaleCompare(keyword,"fuzz") == 0)
{
- msl_info->image[n]->fuzz=InterpretLocaleValue(value,
+ msl_info->image[n]->fuzz=StringToDouble(value,
(char **) NULL);
break;
}
}
}
}
- channel_mask=SetPixelChannelMask(msl_info->image[n],channel);
+ channel_mask=SetImageChannelMask(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);
+ MagickFalse,msl_info->exception);
+ (void) SetPixelChannelMask(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],
- &exception);
+ 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],
- &exception);
+ exception);
CloneString(&value,attribute);
- if (*keyword == '+')
+ if (*keyword == '!')
{
/*
Remove a profile from the image.
*/
(void) ProfileImage(msl_info->image[n],keyword,
- (const unsigned char *) NULL,0,MagickTrue);
+ (const unsigned char *) NULL,0,exception);
continue;
}
/*
profile=GetImageProfile(msl_info->image[n],"iptc");
if (profile != (StringInfo *) NULL)
profile_info->profile=(void *) CloneStringInfo(profile);
- profile_image=GetImageCache(profile_info,keyword,&exception);
+ profile_image=GetImageCache(profile_info,keyword,exception);
profile_info=DestroyImageInfo(profile_info);
if (profile_image == (Image *) NULL)
{
*q=(*++p);
break;
}
- profile=FileToStringInfo(filename,~0UL,&exception);
+ profile=FileToStringInfo(filename,~0UL,exception);
if (profile != (StringInfo *) NULL)
{
(void) ProfileImage(msl_info->image[n],name,
GetStringInfoDatum(profile),(size_t)
- GetStringInfoLength(profile),MagickFalse);
+ GetStringInfoLength(profile),exception);
profile=DestroyStringInfo(profile);
}
continue;
if (profile != (StringInfo *) NULL)
(void) ProfileImage(msl_info->image[n],name,
GetStringInfoDatum(profile),(size_t)
- GetStringInfoLength(profile),MagickFalse);
+ GetStringInfoLength(profile),exception);
name=GetNextImageProfile(profile_image);
}
profile_image=DestroyImage(profile_image);
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"dither") == 0)
{
- option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickDitherOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedBooleanType",
value);
- quantize_info.dither=(MagickBooleanType) option;
+ quantize_info.dither_method=(DitherMethod) option;
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- (void) QuantizeImage(&quantize_info,msl_info->image[n],&exception);
+ (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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
*p;
p=value;
- draw_info->affine.sx=InterpretLocaleValue(p,&p);
+ draw_info->affine.sx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.rx=InterpretLocaleValue(p,&p);
+ draw_info->affine.rx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ry=InterpretLocaleValue(p,&p);
+ draw_info->affine.ry=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.sy=InterpretLocaleValue(p,&p);
+ draw_info->affine.sy=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.tx=InterpretLocaleValue(p,&p);
+ draw_info->affine.tx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ty=InterpretLocaleValue(p,&p);
+ draw_info->affine.ty=StringToDouble(p,&p);
break;
}
if (LocaleCompare(keyword,"align") == 0)
if (LocaleCompare(keyword, "fill") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &draw_info->fill,&exception);
+ &draw_info->fill,exception);
break;
}
if (LocaleCompare(keyword,"family") == 0)
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParsePageGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
break;
{
if (LocaleCompare(keyword,"pointsize") == 0)
{
- draw_info->pointsize=InterpretLocaleValue(value,
+ draw_info->pointsize=StringToDouble(value,
(char **) NULL);
break;
}
{
if (LocaleCompare(keyword,"rotate") == 0)
{
- angle=InterpretLocaleValue(value,(char **) NULL);
+ angle=StringToDouble(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=InterpretLocaleValue(value,(char **) NULL);
+ angle=StringToDouble(value,(char **) NULL);
affine.ry=cos(DegreesToRadians(fmod(angle,360.0)));
break;
}
if (LocaleCompare(keyword,"skewY") == 0)
{
- angle=InterpretLocaleValue(value,(char **) NULL);
+ angle=StringToDouble(value,(char **) NULL);
affine.rx=cos(DegreesToRadians(fmod(angle,360.0)));
break;
}
if (LocaleCompare(keyword, "stroke") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &draw_info->stroke,&exception);
+ &draw_info->stroke,exception);
break;
}
if (LocaleCompare(keyword,"strokewidth") == 0)
if (LocaleCompare(keyword, "undercolor") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &draw_info->undercolor,&exception);
+ &draw_info->undercolor,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
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);
+ msl_info->exception);
if (status != MagickFalse)
{
Image
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParsePageGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
break;
}
}
(void) RaiseImage(msl_info->image[n],&geometry,raise,
- &msl_info->image[n]->exception);
+ msl_info->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],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'F':
(void) CopyMagickString(msl_info->image_info[n]->filename,
value,MaxTextExtent);
- image=ReadImage(msl_info->image_info[n],&exception);
- CatchException(&exception);
+ image=ReadImage(msl_info->image_info[n],exception);
+ CatchException(exception);
if (image == (Image *) NULL)
continue;
AppendImageToList(&msl_info->image[n],image);
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
}
paint_image=StatisticImage(msl_info->image[n],NonpeakStatistic,
(size_t) geometry_info.rho,(size_t) geometry_info.sigma,
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (paint_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],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'G':
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
- case 'b':
- {
- if (LocaleCompare(keyword,"blur") == 0)
- {
- msl_info->image[n]->blur=InterpretLocaleValue(value,
- (char **) NULL);
- break;
- }
- ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
- break;
- }
case 'G':
case 'g':
{
{
if (LocaleCompare(keyword,"x-resolution") == 0)
{
- x_resolution=InterpretLocaleValue(value,(char **) NULL);
+ x_resolution=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"y-resolution") == 0)
{
- y_resolution=InterpretLocaleValue(value,(char **) NULL);
+ y_resolution=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
if (msl_info->image[n]->units == PixelsPerCentimeterResolution)
factor=2.54;
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);
+ (factor*(msl_info->image[n]->resolution.x == 0.0 ? DefaultResolution :
+ msl_info->image[n]->resolution.x))+0.5);
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);
+ (factor*(msl_info->image[n]->resolution.y == 0.0 ? DefaultResolution :
+ msl_info->image[n]->resolution.y))+0.5);
resample_image=ResizeImage(msl_info->image[n],width,height,
- msl_info->image[n]->filter,msl_info->image[n]->blur,
- &msl_info->image[n]->exception);
+ msl_info->image[n]->filter,msl_info->exception);
if (resample_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
}
if (LocaleCompare((const char *) tag,"resize") == 0)
{
- double
- blur;
-
FilterTypes
filter;
break;
}
filter=UndefinedFilter;
- blur=1.0;
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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParseRegionGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
keyword);
break;
}
- case 'S':
- case 's':
- {
- if (LocaleCompare(keyword,"support") == 0)
- {
- blur=InterpretLocaleValue(value,(char **) NULL);
- break;
- }
- ThrowMSLException(OptionError,"UnrecognizedAttribute",
- keyword);
- break;
- }
case 'W':
case 'w':
{
}
}
resize_image=ResizeImage(msl_info->image[n],geometry.width,
- geometry.height,filter,blur,&msl_info->image[n]->exception);
+ geometry.height,filter,msl_info->exception);
if (resize_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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParsePageGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
break;
}
}
roll_image=RollImage(msl_info->image[n],geometry.x,geometry.y,
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (roll_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],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'G':
Image
*newImage;
- newImage=RollImage(msl_info->image[n], x, y, &msl_info->image[n]->exception);
+ newImage=RollImage(msl_info->image[n], x, y, msl_info->exception);
if (newImage == (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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"degrees") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
}
}
rotate_image=RotateImage(msl_info->image[n],geometry_info.rho,
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (rotate_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],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'D':
{
if (LocaleCompare(keyword,"degrees") == 0)
{
- degrees = InterpretLocaleValue(value,(char **) NULL);
+ degrees = StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
Image
*newImage;
- newImage=RotateImage(msl_info->image[n], degrees, &msl_info->image[n]->exception);
+ newImage=RotateImage(msl_info->image[n], degrees, msl_info->exception);
if (newImage == (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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParseRegionGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
sample_image=SampleImage(msl_info->image[n],geometry.width,
- geometry.height,&msl_info->image[n]->exception);
+ geometry.height,msl_info->exception);
if (sample_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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParseRegionGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
scale_image=ScaleImage(msl_info->image[n],geometry.width,
- geometry.height,&msl_info->image[n]->exception);
+ geometry.height,msl_info->exception);
if (scale_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
}
geometry_info.rho=1.0;
geometry_info.sigma=1.5;
- colorspace=RGBColorspace;
+ colorspace=sRGBColorspace;
verbose=MagickFalse;
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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"cluster-threshold") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
{
if (LocaleCompare(keyword,"smoothing-threshold") == 0)
{
- geometry_info.sigma=InterpretLocaleValue(value,
+ geometry_info.sigma=StringToDouble(value,
(char **) NULL);
break;
}
}
}
(void) SegmentImage(msl_info->image[n],colorspace,verbose,
- geometry_info.rho,geometry_info.sigma,&exception);
+ geometry_info.rho,geometry_info.sigma,exception);
break;
}
else if (LocaleCompare((const char *) tag, "set") == 0)
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'C':
const char
*property;
- property=GetImageProperty(msl_info->attributes[j],"id");
+ property=GetImageProperty(msl_info->attributes[j],"id",
+ exception);
if (LocaleCompare(property,value) == 0)
{
SetImageMask(msl_info->image[n],msl_info->image[j],
- &exception);
+ exception);
break;
}
}
const char
*property;
- property=GetImageProperty(msl_info->attributes[j],"id");
+ property=GetImageProperty(msl_info->attributes[j],"id",
+ exception);
if (LocaleCompare(property,value) == 0)
{
- SetImageClipMask(msl_info->image[n],msl_info->image[j],
- &exception);
+ SetImageMask(msl_info->image[n],msl_info->image[j],
+ exception);
break;
}
}
ThrowMSLException(OptionError,"UnrecognizedColorspace",
value);
(void) TransformImageColorspace(msl_info->image[n],
- (ColorspaceType) colorspace);
+ (ColorspaceType) colorspace,exception);
break;
}
(void) SetMSLAttributes(msl_info,keyword,value);
- (void) SetImageProperty(msl_info->image[n],keyword,value);
+ (void) SetImageProperty(msl_info->image[n],keyword,value,
+ exception);
break;
}
case 'D':
if (LocaleCompare(keyword,"density") == 0)
{
flags=ParseGeometry(value,&geometry_info);
- msl_info->image[n]->x_resolution=geometry_info.rho;
- msl_info->image[n]->y_resolution=geometry_info.sigma;
+ msl_info->image[n]->resolution.x=geometry_info.rho;
+ msl_info->image[n]->resolution.y=geometry_info.sigma;
if ((flags & SigmaValue) == 0)
- msl_info->image[n]->y_resolution=
- msl_info->image[n]->x_resolution;
+ msl_info->image[n]->resolution.y=
+ msl_info->image[n]->resolution.x;
break;
}
(void) SetMSLAttributes(msl_info,keyword,value);
- (void) SetImageProperty(msl_info->image[n],keyword,value);
+ (void) SetImageProperty(msl_info->image[n],keyword,value,
+ exception);
break;
}
case 'O':
opac = (int)(QuantumRange * ((float)opac/100));
} else
opac = StringToLong( value );
- (void) SetImageAlpha( msl_info->image[n], (Quantum) opac );
+ (void) SetImageAlpha( msl_info->image[n], (Quantum) opac,
+ exception);
break;
}
(void) SetMSLAttributes(msl_info,keyword,value);
- (void) SetImageProperty(msl_info->image[n],keyword,value);
+ (void) SetImageProperty(msl_info->image[n],keyword,value,
+ msl_info->exception);
break;
}
case 'P':
geometry;
(void) ResetMagickMemory(&geometry,0,sizeof(geometry));
- image_option=GetImageOption(msl_info->image_info[n],"page");
+ image_option=GetImageArtifact(msl_info->image[n],"page");
if (image_option != (const char *) NULL)
flags=ParseAbsoluteGeometry(image_option,&geometry);
flags=ParseAbsoluteGeometry(value,&geometry);
break;
}
(void) SetMSLAttributes(msl_info,keyword,value);
- (void) SetImageProperty(msl_info->image[n],keyword,value);
+ (void) SetImageProperty(msl_info->image[n],keyword,value,
+ msl_info->exception);
break;
}
default:
{
(void) SetMSLAttributes(msl_info,keyword,value);
- (void) SetImageProperty(msl_info->image[n],keyword,value);
+ (void) SetImageProperty(msl_info->image[n],keyword,value,
+ msl_info->exception);
break;
}
}
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"azimuth") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
{
if (LocaleCompare(keyword,"elevation") == 0)
{
- geometry_info.sigma=InterpretLocaleValue(value,
+ geometry_info.sigma=StringToDouble(value,
(char **) NULL);
break;
}
}
}
shade_image=ShadeImage(msl_info->image[n],gray,geometry_info.rho,
- geometry_info.sigma,&msl_info->image[n]->exception);
+ geometry_info.sigma,msl_info->exception);
if (shade_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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry_info.xi=InterpretLocaleValue(value,
+ geometry_info.xi=StringToDouble(value,
(char **) NULL);
break;
}
}
}
shadow_image=ShadowImage(msl_info->image[n],geometry_info.rho,
- geometry_info.sigma,(ssize_t) ceil(geometry_info.xi-0.5),(ssize_t)
- ceil(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->exception);
if (shadow_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
}
if (LocaleCompare((const char *) tag,"sharpen") == 0)
{
- double bias = 0.0,
+ double
radius = 0.0,
sigma = 1.0;
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i],&exception));
+ 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 = InterpretLocaleValue(value,(char **) NULL);
+ radius = StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
Image
*newImage;
- newImage=SharpenImage(msl_info->image[n],radius,sigma,bias,
- &msl_info->image[n]->exception);
+ newImage=SharpenImage(msl_info->image[n],radius,sigma,
+ msl_info->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],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'G':
newImage=ShaveImage(msl_info->image[n], &rectInfo,
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (newImage == (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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword, "fill") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &msl_info->image[n]->background_color,&exception);
+ &msl_info->image[n]->background_color,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
}
}
shear_image=ShearImage(msl_info->image[n],geometry_info.rho,
- geometry_info.sigma,&msl_info->image[n]->exception);
+ geometry_info.sigma,msl_info->exception);
if (shear_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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
}
- (void) SignatureImage(msl_info->image[n],&exception);
+ (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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"threshold") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
}
}
(void) SolarizeImage(msl_info->image[n],geometry_info.rho,
- &msl_info->image[n]->exception);
+ msl_info->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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
}
}
spread_image=SpreadImage(msl_info->image[n],geometry_info.rho,
- msl_info->image[n]->interpolate,&msl_info->image[n]->exception);
+ msl_info->image[n]->interpolate,msl_info->exception);
if (spread_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
else if (LocaleCompare((const char *) tag,"stegano") == 0)
{
Image *
- watermark = (Image*)NULL;
+ watermark = (Image*) NULL;
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],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'I':
for (j=0; j<msl_info->n;j++)
{
const char *
- theAttr = GetImageProperty(msl_info->attributes[j], "id");
+ theAttr = GetImageProperty(msl_info->attributes[j], "id",
+ exception);
if (theAttr && LocaleCompare(theAttr, value) == 0)
{
watermark = msl_info->image[j];
Image
*newImage;
- newImage=SteganoImage(msl_info->image[n], watermark, &msl_info->image[n]->exception);
+ newImage=SteganoImage(msl_info->image[n], watermark, msl_info->exception);
if (newImage == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
else if (LocaleCompare((const char *) tag,"stereo") == 0)
{
Image *
- stereoImage = (Image*)NULL;
+ stereoImage = (Image*) NULL;
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],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'I':
for (j=0; j<msl_info->n;j++)
{
const char *
- theAttr = GetImageProperty(msl_info->attributes[j], "id");
+ theAttr = GetImageProperty(msl_info->attributes[j], "id",
+ exception);
if (theAttr && LocaleCompare(theAttr, value) == 0)
{
stereoImage = msl_info->image[j];
Image
*newImage;
- newImage=StereoImage(msl_info->image[n], stereoImage, &msl_info->image[n]->exception);
+ newImage=StereoImage(msl_info->image[n], stereoImage, msl_info->exception);
if (newImage == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
} else
ThrowMSLException(OptionError,"Missing stereo image",keyword);
}
+ if (LocaleCompare((const char *) tag,"strip") == 0)
+ {
+ /*
+ Strip image.
+ */
+ if (msl_info->image[n] == (Image *) NULL)
+ {
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
+ break;
+ }
+ 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],
+ exception);
+ CloneString(&value,attribute);
+ ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
+ }
+ (void) StripImage(msl_info->image[n],msl_info->exception);
+ break;
+ }
if (LocaleCompare((const char *) tag,"swap") == 0)
{
Image
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
ThrowMSLException(OptionError,"NoSuchImage",(const char *) tag);
break;
}
- swap=CloneImage(p,0,0,MagickTrue,&p->exception);
- ReplaceImageInList(&p,CloneImage(q,0,0,MagickTrue,&q->exception));
+ swap=CloneImage(p,0,0,MagickTrue,msl_info->exception);
+ ReplaceImageInList(&p,CloneImage(q,0,0,MagickTrue,
+ msl_info->exception));
ReplaceImageInList(&q,swap);
msl_info->image[n]=GetFirstImageInList(q);
break;
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"degrees") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
}
}
swirl_image=SwirlImage(msl_info->image[n],geometry_info.rho,
- msl_info->image[n]->interpolate,&msl_info->image[n]->exception);
+ msl_info->image[n]->interpolate,msl_info->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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
}
- (void) SyncImage(msl_info->image[n]);
+ (void) SyncImage(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],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
const char
*attribute;
- attribute=GetImageProperty(msl_info->attributes[j],"id");
+ attribute=GetImageProperty(msl_info->attributes[j],"id",
+ exception);
if ((attribute != (const char *) NULL) &&
(LocaleCompare(attribute,value) == 0))
{
texture_image=CloneImage(msl_info->image[j],0,0,
- MagickFalse,&exception);
+ MagickFalse,exception);
break;
}
}
}
}
}
- (void) TextureImage(msl_info->image[n],texture_image);
+ (void) TextureImage(msl_info->image[n],texture_image,exception);
texture_image=DestroyImage(texture_image);
break;
}
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'T':
{
if (LocaleCompare(keyword,"threshold") == 0)
{
- threshold = InterpretLocaleValue(value,(char **) NULL);
+ threshold = StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
process image.
*/
{
- BilevelImage(msl_info->image[n],threshold);
- break;
+ BilevelImage(msl_info->image[n],threshold,exception);
+ break;
}
}
else if (LocaleCompare((const char *) tag, "transparent") == 0)
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'C':
target;
(void) QueryColorCompliance(value,AllCompliance,&target,
- &exception);
+ exception);
(void) TransparentPaintImage(msl_info->image[n],&target,
- TransparentAlpha,MagickFalse,&msl_info->image[n]->exception);
+ TransparentAlpha,MagickFalse,msl_info->exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
rectInfo.height = rectInfo.width = 0;
rectInfo.x = rectInfo.y = 0;
- newImage=CropImage(msl_info->image[n],&rectInfo, &msl_info->image[n]->exception);
+ newImage=CropImage(msl_info->image[n],&rectInfo, msl_info->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],&exception));
+ 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],
- &msl_info->image[n]->exception);
+ msl_info->exception);
break;
}
}
}
if ( value != NULL )
value=DestroyString(value);
+ (void) DestroyExceptionInfo(exception);
(void) LogMagickEvent(CoderEvent,GetMagickModule()," )");
}
break;
StripString(msl_info->content);
(void) SetImageProperty(msl_info->image[n],"comment",
- msl_info->content);
+ msl_info->content,msl_info->exception);
break;
}
break;
while ( i-- )
{
if (msl_info->image[msl_info->n] != (Image *) NULL)
- msl_info->image[msl_info->n]=DestroyImage(msl_info->image[msl_info->n]);
- msl_info->attributes[msl_info->n]=DestroyImage(msl_info->attributes[msl_info->n]);
- msl_info->image_info[msl_info->n]=DestroyImageInfo(msl_info->image_info[msl_info->n]);
+ msl_info->image[msl_info->n]=DestroyImage(
+ msl_info->image[msl_info->n]);
+ msl_info->attributes[msl_info->n]=DestroyImage(
+ msl_info->attributes[msl_info->n]);
+ msl_info->image_info[msl_info->n]=DestroyImageInfo(
+ msl_info->image_info[msl_info->n]);
msl_info->n--;
}
}
break;
StripString(msl_info->content);
(void) SetImageProperty(msl_info->image[n],"label",
- msl_info->content);
+ msl_info->content,msl_info->exception);
break;
}
break;
}
#endif
-static MagickBooleanType ProcessMSLScript(const ImageInfo *image_info,Image **image,
- ExceptionInfo *exception)
+static MagickBooleanType ProcessMSLScript(const ImageInfo *image_info,
+ Image **image,ExceptionInfo *exception)
{
char
message[MaxTextExtent];
(void) xmlParseChunk(msl_info.parser," ",1,MagickTrue);
xmlFreeParserCtxt(msl_info.parser);
(void) LogMagickEvent(CoderEvent,GetMagickModule(),"end SAX");
- xmlCleanupParser();
msl_info.group_info=(MSLGroupInfo *) RelinquishMagickMemory(
msl_info.group_info);
if (*image == (Image *) NULL)
*image=(*msl_info.image);
- if ((*msl_info.image)->exception.severity != UndefinedException)
+ if (msl_info.exception->severity != UndefinedException)
return(MagickFalse);
return(MagickTrue);
}
MagickInfo
*entry;
+#if defined(MAGICKCORE_XML_DELEGATE)
+ xmlInitParser();
+#endif
entry=SetMagickInfo("MSL");
#if defined(MAGICKCORE_XML_DELEGATE)
entry->decoder=(DecodeImageHandler *) ReadMSLImage;
ssize_t
alpha;
- alpha=ParseCommandOption(MagickAlphaOptions,MagickFalse,value);
+ alpha=ParseCommandOption(MagickAlphaChannelOptions,MagickFalse,value);
if (alpha < 0)
ThrowMSLException(OptionError,"UnrecognizedType",value);
if (image != (Image *) NULL)
- (void) SetImageAlphaChannel(image,(AlphaChannelType) alpha,
+ (void) SetImageAlphaChannel(image,(AlphaChannelOption) alpha,
exception);
break;
}
limit=MagickResourceInfinity;
if (LocaleCompare(value,"unlimited") != 0)
- limit=(MagickSizeType) SiPrefixToDouble(value,100.0);
+ limit=(MagickSizeType) StringToDoubleInterval(value,100.0);
(void) SetMagickResourceLimit(AreaResource,limit);
break;
}
&image_info->background_color,exception);
break;
}
- if (LocaleCompare(keyword,"bias") == 0)
- {
- if (image == (Image *) NULL)
- break;
- image->bias=SiPrefixToDouble(value,QuantumRange);
- break;
- }
if (LocaleCompare(keyword,"blue-primary") == 0)
{
if (image == (Image *) NULL)
{
if (LocaleCompare(keyword,"id") == 0)
{
- (void) SetImageProperty(attributes,keyword,value);
+ (void) SetImageProperty(attributes,keyword,value,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"pointsize") == 0)
{
- image_info->pointsize=InterpretLocaleValue(value,(char **) NULL);
- draw_info->pointsize=InterpretLocaleValue(value,(char **) NULL);
+ image_info->pointsize=StringToDouble(value,(char **) NULL);
+ draw_info->pointsize=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
ModuleExport void UnregisterMSLImage(void)
{
(void) UnregisterMagickInfo("MSL");
+#if defined(MAGICKCORE_XML_DELEGATE)
+ xmlCleanupParser();
+#endif
}
\f
#if defined(MAGICKCORE_XML_DELEGATE)