#if defined(MAGICKCORE_XML_DELEGATE)
static MagickBooleanType
WriteMSLImage(const ImageInfo *,Image *);
+
+static MagickBooleanType
+ SetMSLAttributes(MSLInfo *,const xmlChar **);
#endif
\f
#if defined(MAGICKCORE_XML_DELEGATE)
+\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
%
% o exception: return any errors or warnings in this structure.
%
-%
*/
#if defined(__cplusplus) || defined(c_plusplus)
*/
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" SAX.internalSubset(%s %s %s)",name,
- (external_id != (const xmlChar *) NULL ? (char *) external_id : " "),
- (system_id != (const xmlChar *) NULL ? (char *) system_id : " "));
+ (external_id != (const xmlChar *) NULL ? (const char *) external_id : " "),
+ (system_id != (const xmlChar *) NULL ? (const char *) system_id : " "));
msl_info=(MSLInfo *) context;
(void) xmlCreateIntSubset(msl_info->document,name,external_id,system_id);
}
*/
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" SAX.resolveEntity(%s, %s)",
- (public_id != (const xmlChar *) NULL ? (char *) public_id : "none"),
- (system_id != (const xmlChar *) NULL ? (char *) system_id : "none"));
+ (public_id != (const xmlChar *) NULL ? (const char *) public_id : "none"),
+ (system_id != (const xmlChar *) NULL ? (const char *) system_id : "none"));
msl_info=(MSLInfo *) context;
stream=xmlLoadExternalEntity((const char *) system_id,(const char *)
public_id,msl_info->parser);
Get an entity by name.
*/
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
- " SAX.MSLGetEntity(%s)",(char *) name);
+ " SAX.MSLGetEntity(%s)",(const char *) name);
msl_info=(MSLInfo *) context;
return(xmlGetDocEntity(msl_info->document,name));
}
Get a parameter entity by name.
*/
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
- " SAX.getParameterEntity(%s)",(char *) name);
+ " SAX.getParameterEntity(%s)",(const char *) name);
msl_info=(MSLInfo *) context;
return(xmlGetParameterEntity(msl_info->document,name));
}
*/
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" SAX.entityDecl(%s, %d, %s, %s, %s)",name,type,
- public_id != (const xmlChar *) NULL ? (char *) public_id : "none",
- system_id != (const xmlChar *) NULL ? (char *) system_id : "none",content);
+ public_id != (const xmlChar *) NULL ? (const char *) public_id : "none",
+ system_id != (const xmlChar *) NULL ? (const char *) system_id : "none",
+ content);
msl_info=(MSLInfo *) context;
if (msl_info->parser->inSubset == 1)
(void) xmlAddDocEntity(msl_info->document,name,type,public_id,system_id,
*/
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" SAX.notationDecl(%s, %s, %s)",name,
- public_id != (const xmlChar *) NULL ? (char *) public_id : "none",
- system_id != (const xmlChar *) NULL ? (char *) system_id : "none");
+ public_id != (const xmlChar *) NULL ? (const char *) public_id : "none",
+ system_id != (const xmlChar *) NULL ? (const char *) system_id : "none");
msl_info=(MSLInfo *) context;
parser=msl_info->parser;
if (parser->inSubset == 1)
*/
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" SAX.unparsedEntityDecl(%s, %s, %s, %s)",name,
- public_id != (const xmlChar *) NULL ? (char *) public_id : "none",
- system_id != (const xmlChar *) NULL ? (char *) system_id : "none",notation);
+ public_id != (const xmlChar *) NULL ? (const char *) public_id : "none",
+ system_id != (const xmlChar *) NULL ? (const char *) system_id : "none",
+ notation);
msl_info=(MSLInfo *) context;
(void) xmlAddDocEntity(msl_info->document,name,
XML_EXTERNAL_GENERAL_UNPARSED_ENTITY,public_id,system_id,notation);
case 'A':
case 'a':
{
- if (LocaleCompare((char *) tag,"add-noise") == 0)
+ if (LocaleCompare((const char *) tag,"add-noise") == 0)
{
Image
*noise_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
noise=UniformNoise;
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
msl_info->image[n]=noise_image;
break;
}
- if (LocaleCompare((char *) tag,"annotate") == 0)
+ if (LocaleCompare((const char *) tag,"annotate") == 0)
{
char
text[MaxTextExtent];
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
draw_info=CloneDrawInfo(msl_info->image_info[n],
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
draw_info=DestroyDrawInfo(draw_info);
break;
}
- if (LocaleCompare((char *) tag,"append") == 0)
+ if (LocaleCompare((const char *) tag,"append") == 0)
{
Image
*append_image;
MagickBooleanType
stack;
-
+
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
stack=MagickFalse;
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
case 'B':
case 'b':
{
- if (LocaleCompare((char *) tag,"blur") == 0)
+ if (LocaleCompare((const char *) tag,"blur") == 0)
{
Image
*blur_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
msl_info->image[n]=blur_image;
break;
}
- if (LocaleCompare((char *) tag,"border") == 0)
+ if (LocaleCompare((const char *) tag,"border") == 0)
{
Image
*border_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
SetGeometry(msl_info->image[n],&geometry);
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
case 'C':
case 'c':
{
- if (LocaleCompare((char *) tag,"colorize") == 0)
+ if (LocaleCompare((const char *) tag,"colorize") == 0)
{
char
opacity[MaxTextExtent];
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
target=msl_info->image[n]->background_color;
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
msl_info->image[n]=colorize_image;
break;
}
- if (LocaleCompare((char *) tag, "charcoal") == 0)
+ if (LocaleCompare((const char *) tag, "charcoal") == 0)
{
double radius = 0.0,
sigma = 1.0;
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(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],(char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i]));
switch (*keyword)
{
case 'R':
break;
}
}
- if (LocaleCompare((char *) tag,"chop") == 0)
+ if (LocaleCompare((const char *) tag,"chop") == 0)
{
Image
*chop_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
SetGeometry(msl_info->image[n],&geometry);
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
msl_info->image[n]=chop_image;
break;
}
- if (LocaleCompare((char *) tag,"color-floodfill") == 0)
+ if (LocaleCompare((const char *) tag,"color-floodfill") == 0)
{
PaintMethod
paint_method;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
draw_info=CloneDrawInfo(msl_info->image_info[n],
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
draw_info=DestroyDrawInfo(draw_info);
break;
}
- if (LocaleCompare((char *) tag,"comment") == 0)
+ if (LocaleCompare((const char *) tag,"comment") == 0)
break;
- if (LocaleCompare((char *) tag,"composite") == 0)
+ if (LocaleCompare((const char *) tag,"composite") == 0)
{
char
composite_geometry[MaxTextExtent];
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
composite_image=NewImageList();
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
{
const char
*attribute;
-
+
attribute=GetImageProperty(msl_info->attributes[j],"id");
if ((attribute != (const char *) NULL) &&
(LocaleCompare(attribute,value) == 0))
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
long
opacity,
y;
-
+
register long
x;
-
+
register PixelPacket
*q;
-
+
CacheView
*composite_view;
opacity=QuantumRange-atol(value);
if (compose != DissolveCompositeOp)
{
- (void) SetImageOpacity(composite_image,(Quantum) opacity);
+ (void) SetImageOpacity(composite_image,(Quantum)
+ opacity);
break;
}
(void) SetImageArtifact(msl_info->image[n],
(void) SetImageOpacity(composite_image,OpaqueOpacity);
composite_view=AcquireCacheView(composite_image);
for (y=0; y < (long) 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++)
- {
+ {
if (q->opacity == OpaqueOpacity)
q->opacity=RoundToQuantum(opacity);
q++;
composite_image=DestroyImage(composite_image);
break;
}
- if (LocaleCompare((char *) tag,"contrast") == 0)
+ if (LocaleCompare((const char *) tag,"contrast") == 0)
{
MagickBooleanType
sharpen;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
sharpen=MagickFalse;
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
(void) ContrastImage(msl_info->image[n],sharpen);
break;
}
- if (LocaleCompare((char *) tag,"crop") == 0)
+ if (LocaleCompare((const char *) tag,"crop") == 0)
{
Image
*crop_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
SetGeometry(msl_info->image[n],&geometry);
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
msl_info->image[n]=crop_image;
break;
}
- if (LocaleCompare((char *) tag,"cycle-colormap") == 0)
+ if (LocaleCompare((const char *) tag,"cycle-colormap") == 0)
{
long
display;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
display=0;
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
case 'D':
case 'd':
{
- if (LocaleCompare((char *) tag,"despeckle") == 0)
+ if (LocaleCompare((const char *) tag,"despeckle") == 0)
{
Image
*despeckle_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
msl_info->image[n]=despeckle_image;
break;
}
- if (LocaleCompare((char *) tag,"display") == 0)
+ if (LocaleCompare((const char *) tag,"display") == 0)
{
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
(void) DisplayImages(msl_info->image_info[n],msl_info->image[n]);
break;
}
- if (LocaleCompare((char *) tag,"draw") == 0)
+ if (LocaleCompare((const char *) tag,"draw") == 0)
{
char
text[MaxTextExtent];
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
draw_info=CloneDrawInfo(msl_info->image_info[n],
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
case 'p':
{
if (LocaleCompare(keyword,"primitive") == 0)
- {
+ {
CloneString(&draw_info->primitive,value);
break;
}
case 'E':
case 'e':
{
- if (LocaleCompare((char *) tag,"edge") == 0)
+ if (LocaleCompare((const char *) tag,"edge") == 0)
{
Image
*edge_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
msl_info->image[n]=edge_image;
break;
}
- if (LocaleCompare((char *) tag,"emboss") == 0)
+ if (LocaleCompare((const char *) tag,"emboss") == 0)
{
Image
*emboss_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
msl_info->image[n]=emboss_image;
break;
}
- if (LocaleCompare((char *) tag,"enhance") == 0)
+ if (LocaleCompare((const char *) tag,"enhance") == 0)
{
Image
*enhance_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
msl_info->image[n]=enhance_image;
break;
}
- if (LocaleCompare((char *) tag,"equalize") == 0)
+ if (LocaleCompare((const char *) tag,"equalize") == 0)
{
/*
Equalize image.
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
case 'F':
case 'f':
{
- if (LocaleCompare((char *) tag, "flatten") == 0)
+ if (LocaleCompare((const char *) tag, "flatten") == 0)
{
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
break;
}
}
- if (LocaleCompare((char *) tag,"flip") == 0)
+ if (LocaleCompare((const char *) tag,"flip") == 0)
{
Image
*flip_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
msl_info->image[n]=flip_image;
break;
}
- if (LocaleCompare((char *) tag,"flop") == 0)
+ if (LocaleCompare((const char *) tag,"flop") == 0)
{
Image
*flop_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
msl_info->image[n]=flop_image;
break;
}
- if (LocaleCompare((char *) tag,"frame") == 0)
+ if (LocaleCompare((const char *) tag,"frame") == 0)
{
FrameInfo
frame_info;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
SetGeometry(msl_info->image[n],&geometry);
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
case 'G':
case 'g':
{
- if (LocaleCompare((char *) tag,"gamma") == 0)
+ if (LocaleCompare((const char *) tag,"gamma") == 0)
{
char
gamma[MaxTextExtent];
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
channel=UndefinedChannel;
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
if (*gamma == '\0')
(void) FormatMagickString(gamma,MaxTextExtent,"%g,%g,%g",
(double) pixel.red,(double) pixel.green,(double) pixel.blue);
- switch (channel)
+ switch (channel)
{
default:
{
}
break;
}
- else if (LocaleCompare((char *) tag,"get") == 0)
+ else if (LocaleCompare((const char *) tag,"get") == 0)
{
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ 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++];
- CloneString(&value,(char *) attributes[i]);
+ CloneString(&value,(const char *) attributes[i]);
(void) CopyMagickString(key,value,MaxTextExtent);
switch (*keyword)
{
}
break;
}
- else if (LocaleCompare((char *) tag, "group") == 0)
+ else if (LocaleCompare((const char *) tag, "group") == 0)
{
msl_info->number_groups++;
msl_info->group_info=(MSLGroupInfo *) ResizeQuantumMemory(
case 'I':
case 'i':
{
- if (LocaleCompare((char *) tag,"image") == 0)
+ if (LocaleCompare((const char *) tag,"image") == 0)
{
long
n;
MSLPushImage(msl_info,(Image *) NULL);
- n=msl_info->n;
if (attributes == (const xmlChar **) NULL)
break;
+ (void) SetMSLAttributes(msl_info,attributes);
for (i=0; (attributes[i] != (const xmlChar *) NULL); i++)
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i]));
switch (*keyword)
{
- case 'B':
- case 'b':
- {
- if (LocaleCompare(keyword,"background") == 0)
- {
- (void) QueryColorDatabase(value,
- &msl_info->image_info[n]->background_color,&exception);
- break;
- }
- ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
- break;
- }
-
- case 'C':
- case 'c':
- {
- if (LocaleCompare(keyword,"color") == 0)
- {
- Image
- *next_image;
-
- (void) CopyMagickString(msl_info->image_info[n]->filename,"xc:",
- MaxTextExtent);
- (void) ConcatenateMagickString(msl_info->image_info[n]->filename,
- value,MaxTextExtent);
- next_image=ReadImage(msl_info->image_info[n],&exception);
- CatchException(&exception);
- if (next_image == (Image *) NULL)
- continue;
- if (msl_info->image[n] == (Image *) NULL)
- msl_info->image[n]=next_image;
- else
+ case 'C':
+ case 'c':
{
- register Image
- *p;
-
- /*
- Link image into image list.
- */
- p=msl_info->image[n];
- for ( ; p->next != (Image *) NULL; p=GetNextImageInList(p)) ;
- next_image->previous=p;
- p->next=next_image;
- }
- break;
- }
- ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
- break;
- }
+ if (LocaleCompare(keyword,"color") == 0)
+ {
+ Image
+ *next_image;
- case 'I':
- case 'i':
- {
- if (LocaleCompare(keyword,"id") == 0)
- {
- (void) SetImageProperty(msl_info->attributes[n],keyword,NULL); /* make sure to clear it! */
- (void) SetImageProperty(msl_info->attributes[n],keyword,value);
- break;
- }
- ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
- break;
- }
- case 'S':
- case 's':
- {
- if (LocaleCompare(keyword,"size") == 0)
- {
- CloneString(&msl_info->image_info[n]->size,value);
- break;
- }
+ (void) CopyMagickString(msl_info->image_info[n]->filename,
+ "xc:",MaxTextExtent);
+ (void) ConcatenateMagickString(msl_info->image_info[n]->
+ filename,value,MaxTextExtent);
+ next_image=ReadImage(msl_info->image_info[n],&exception);
+ CatchException(&exception);
+ if (next_image == (Image *) NULL)
+ continue;
+ if (msl_info->image[n] == (Image *) NULL)
+ msl_info->image[n]=next_image;
+ else
+ {
+ register Image
+ *p;
+
+ /*
+ Link image into image list.
+ */
+ p=msl_info->image[n];
+ while (p->next != (Image *) NULL)
+ p=GetNextImageInList(p);
+ next_image->previous=p;
+ p->next=next_image;
+ }
+ break;
+ }
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
break;
}
}
break;
}
- if (LocaleCompare((char *) tag,"implode") == 0)
+ if (LocaleCompare((const char *) tag,"implode") == 0)
{
Image
*implode_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
case 'L':
case 'l':
{
- if (LocaleCompare((char *) tag,"label") == 0)
+ if (LocaleCompare((const char *) tag,"label") == 0)
break;
- if (LocaleCompare((char *) tag, "level") == 0)
+ if (LocaleCompare((const char *) tag, "level") == 0)
{
double
levelBlack = 0, levelGamma = 1, levelWhite = QuantumRange;
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ 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++];
- CloneString(&value,(char *) attributes[i]);
+ CloneString(&value,(const char *) attributes[i]);
(void) CopyMagickString(key,value,MaxTextExtent);
switch (*keyword)
{
case 'M':
case 'm':
{
- if (LocaleCompare((char *) tag,"magnify") == 0)
+ if (LocaleCompare((const char *) tag,"magnify") == 0)
{
Image
*magnify_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
msl_info->image[n]=magnify_image;
break;
}
- if (LocaleCompare((char *) tag,"map") == 0)
+ if (LocaleCompare((const char *) tag,"map") == 0)
{
Image
*affinity_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
affinity_image=NewImageList();
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
{
const char
*attribute;
-
+
attribute=GetImageProperty(msl_info->attributes[j],"id");
if ((attribute != (const char *) NULL) &&
(LocaleCompare(attribute,value) == 0))
affinity_image=DestroyImage(affinity_image);
break;
}
- if (LocaleCompare((char *) tag,"matte-floodfill") == 0)
+ if (LocaleCompare((const char *) tag,"matte-floodfill") == 0)
{
double
opacity;
opacity=0.0;
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
SetGeometry(msl_info->image[n],&geometry);
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
draw_info=DestroyDrawInfo(draw_info);
break;
}
- if (LocaleCompare((char *) tag,"median-filter") == 0)
+ if (LocaleCompare((const char *) tag,"median-filter") == 0)
{
Image
*median_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
msl_info->image[n]=median_image;
break;
}
- if (LocaleCompare((char *) tag,"minify") == 0)
+ if (LocaleCompare((const char *) tag,"minify") == 0)
{
Image
*minify_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
msl_info->image[n]=minify_image;
break;
}
- if (LocaleCompare((char *) tag,"msl") == 0 )
+ if (LocaleCompare((const char *) tag,"msl") == 0 )
break;
- if (LocaleCompare((char *) tag,"modulate") == 0)
+ if (LocaleCompare((const char *) tag,"modulate") == 0)
{
char
modulate[MaxTextExtent];
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
geometry_info.rho=100.0;
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
case 'N':
case 'n':
{
- if (LocaleCompare((char *) tag,"negate") == 0)
+ if (LocaleCompare((const char *) tag,"negate") == 0)
{
MagickBooleanType
gray;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
gray=MagickFalse;
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
(void) NegateImageChannel(msl_info->image[n],channel,gray);
break;
}
- if (LocaleCompare((char *) tag,"normalize") == 0)
+ if (LocaleCompare((const char *) tag,"normalize") == 0)
{
/*
Normalize image.
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
case 'O':
case 'o':
{
- if (LocaleCompare((char *) tag,"oil-paint") == 0)
+ if (LocaleCompare((const char *) tag,"oil-paint") == 0)
{
Image
*paint_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
msl_info->image[n]=paint_image;
break;
}
- if (LocaleCompare((char *) tag,"opaque") == 0)
+ if (LocaleCompare((const char *) tag,"opaque") == 0)
{
MagickPixelPacket
fill_color,
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
(void) QueryMagickColor("none",&target,&exception);
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
case 'P':
case 'p':
{
- if (LocaleCompare((char *) tag,"print") == 0)
+ if (LocaleCompare((const char *) tag,"print") == 0)
{
if (attributes == (const xmlChar **) NULL)
break;
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
case 'Q':
case 'q':
{
- if (LocaleCompare((char *) tag,"quantize") == 0)
+ if (LocaleCompare((const char *) tag,"quantize") == 0)
{
QuantizeInfo
quantize_info;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
GetQuantizeInfo(&quantize_info);
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
(void) QuantizeImage(&quantize_info,msl_info->image[n]);
break;
}
- if (LocaleCompare((char *) tag,"query-font-metrics") == 0)
+ if (LocaleCompare((const char *) tag,"query-font-metrics") == 0)
{
char
text[MaxTextExtent];
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
case 'R':
case 'r':
{
- if (LocaleCompare((char *) tag,"raise") == 0)
+ if (LocaleCompare((const char *) tag,"raise") == 0)
{
MagickBooleanType
raise;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
raise=MagickFalse;
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
(void) RaiseImage(msl_info->image[n],&geometry,raise);
break;
}
- if (LocaleCompare((char *) tag,"read") == 0)
+ if (LocaleCompare((const char *) tag,"read") == 0)
{
if (attributes == (const xmlChar **) NULL)
break;
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i]));
switch (*keyword)
{
case 'F':
}
break;
}
- if (LocaleCompare((char *) tag,"reduce-noise") == 0)
+ if (LocaleCompare((const char *) tag,"reduce-noise") == 0)
{
Image
*paint_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
msl_info->image[n]=paint_image;
break;
}
- else if (LocaleCompare((char *) tag,"repage") == 0)
+ else if (LocaleCompare((const char *) tag,"repage") == 0)
{
/* init the values */
width=msl_info->image[n]->page.width;
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes == (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i]));
switch (*keyword)
{
case 'G':
}
}
- msl_info->image[n]->page.width=width;
- msl_info->image[n]->page.height=height;
- msl_info->image[n]->page.x=x;
- msl_info->image[n]->page.y=y;
+ msl_info->image[n]->page.width=width;
+ msl_info->image[n]->page.height=height;
+ msl_info->image[n]->page.x=x;
+ msl_info->image[n]->page.y=y;
break;
}
- else if (LocaleCompare((char *) tag,"resample") == 0)
+ else if (LocaleCompare((const char *) tag,"resample") == 0)
{
double
x_resolution,
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes == (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i]));
switch (*keyword)
{
case 'b':
}
break;
}
- if (LocaleCompare((char *) tag,"resize") == 0)
+ if (LocaleCompare((const char *) tag,"resize") == 0)
{
double
blur;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
filter=UndefinedFilter;
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
msl_info->image[n]=resize_image;
break;
}
- if (LocaleCompare((char *) tag,"roll") == 0)
+ if (LocaleCompare((const char *) tag,"roll") == 0)
{
Image
*roll_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
SetGeometry(msl_info->image[n],&geometry);
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
msl_info->image[n]=roll_image;
break;
}
- else if (LocaleCompare((char *) tag,"roll") == 0)
+ else if (LocaleCompare((const char *) tag,"roll") == 0)
{
/* init the values */
width=msl_info->image[n]->columns;
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes == (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i]));
switch (*keyword)
{
case 'G':
break;
}
- if (LocaleCompare((char *) tag,"rotate") == 0)
+ if (LocaleCompare((const char *) tag,"rotate") == 0)
{
Image
*rotate_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
msl_info->image[n]=rotate_image;
break;
}
- else if (LocaleCompare((char *) tag,"rotate") == 0)
+ else if (LocaleCompare((const char *) tag,"rotate") == 0)
{
/* init the values */
double degrees = 0;
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes == (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i]));
switch (*keyword)
{
case 'D':
case 'S':
case 's':
{
- if (LocaleCompare((char *) tag,"sample") == 0)
+ if (LocaleCompare((const char *) tag,"sample") == 0)
{
Image
*sample_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
msl_info->image[n]=sample_image;
break;
}
- if (LocaleCompare((char *) tag,"scale") == 0)
+ if (LocaleCompare((const char *) tag,"scale") == 0)
{
Image
*scale_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
msl_info->image[n]=scale_image;
break;
}
- if (LocaleCompare((char *) tag,"segment") == 0)
+ if (LocaleCompare((const char *) tag,"segment") == 0)
{
ColorspaceType
colorspace;
MagickBooleanType
verbose;
-
+
/*
Segment image.
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
geometry_info.rho=1.0;
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
geometry_info.rho,geometry_info.sigma);
break;
}
- else if (LocaleCompare((char *) tag, "set") == 0)
+ else if (LocaleCompare((const char *) tag, "set") == 0)
{
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(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],(char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i]));
switch (*keyword)
{
case 'B':
}
break;
}
- if (LocaleCompare((char *) tag,"shade") == 0)
+ if (LocaleCompare((const char *) tag,"shade") == 0)
{
Image
*shade_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
gray=MagickFalse;
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
msl_info->image[n]=shade_image;
break;
}
- if (LocaleCompare((char *) tag,"shadow") == 0)
+ if (LocaleCompare((const char *) tag,"shadow") == 0)
{
Image
*shadow_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
msl_info->image[n]=shadow_image;
break;
}
- if (LocaleCompare((char *) tag,"sharpen") == 0)
+ if (LocaleCompare((const char *) tag,"sharpen") == 0)
{
double radius = 0.0,
sigma = 1.0;
if (msl_info->image[n] == (Image *) NULL)
- {
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
- break;
- }
+ {
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
+ break;
+ }
/*
NOTE: sharpen can have no attributes, since we use all the defaults!
*/
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i]));
switch (*keyword)
{
case 'R':
break;
}
}
- else if (LocaleCompare((char *) tag,"shave") == 0)
+ else if (LocaleCompare((const char *) tag,"shave") == 0)
{
/* init the values */
width = height = 0;
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes == (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i]));
switch (*keyword)
{
case 'G':
break;
}
- if (LocaleCompare((char *) tag,"shear") == 0)
+ if (LocaleCompare((const char *) tag,"shear") == 0)
{
Image
*shear_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
msl_info->image[n]=shear_image;
break;
}
- if (LocaleCompare((char *) tag,"signature") == 0)
+ if (LocaleCompare((const char *) tag,"signature") == 0)
{
/*
Signature image.
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
(void) SignatureImage(msl_info->image[n]);
break;
}
- if (LocaleCompare((char *) tag,"solarize") == 0)
+ if (LocaleCompare((const char *) tag,"solarize") == 0)
{
/*
Solarize image.
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
geometry_info.rho=QuantumRange/2.0;
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
(void) SolarizeImage(msl_info->image[n],geometry_info.rho);
break;
}
- if (LocaleCompare((char *) tag,"spread") == 0)
+ if (LocaleCompare((const char *) tag,"spread") == 0)
{
Image
*spread_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
msl_info->image[n]=spread_image;
break;
}
- else if (LocaleCompare((char *) tag,"stegano") == 0)
+ else if (LocaleCompare((const char *) tag,"stegano") == 0)
{
Image *
watermark = (Image*)NULL;
if (msl_info->image[n] == (Image *) NULL)
- {
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
- break;
- }
+ {
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
+ break;
+ }
if (attributes == (const xmlChar **) NULL)
break;
for (i=0; (attributes[i] != (const xmlChar *) NULL); i++)
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i]));
switch (*keyword)
{
case 'I':
} else
ThrowMSLException(OptionError,"MissingWatermarkImage",keyword);
}
- else if (LocaleCompare((char *) tag,"stereo") == 0)
+ else if (LocaleCompare((const char *) tag,"stereo") == 0)
{
Image *
stereoImage = (Image*)NULL;
if (msl_info->image[n] == (Image *) NULL)
- {
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
- break;
- }
+ {
+ ThrowMSLException(OptionError,"NoImagesDefined",(const char *) tag);
+ break;
+ }
if (attributes == (const xmlChar **) NULL)
break;
for (i=0; (attributes[i] != (const xmlChar *) NULL); i++)
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i]));
switch (*keyword)
{
case 'I':
} else
ThrowMSLException(OptionError,"Missing stereo image",keyword);
}
- if (LocaleCompare((char *) tag,"swap") == 0)
+ if (LocaleCompare((const char *) tag,"swap") == 0)
{
Image
*p,
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
index=(-1);
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
q=GetImageFromList(msl_info->image[n],swap_index);
if ((p == (Image *) NULL) || (q == (Image *) NULL))
{
- ThrowMSLException(OptionError,"NoSuchImage",(char *) tag);
+ ThrowMSLException(OptionError,"NoSuchImage",(const char *) tag);
break;
}
swap=CloneImage(p,0,0,MagickTrue,&p->exception);
msl_info->image[n]=GetFirstImageInList(q);
break;
}
- if (LocaleCompare((char *) tag,"swirl") == 0)
+ if (LocaleCompare((const char *) tag,"swirl") == 0)
{
Image
*swirl_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
msl_info->image[n]=swirl_image;
break;
}
- if (LocaleCompare((char *) tag,"sync") == 0)
+ if (LocaleCompare((const char *) tag,"sync") == 0)
{
/*
Sync image.
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes != (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
case 'T':
case 't':
{
- if (LocaleCompare((char *) tag,"map") == 0)
+ if (LocaleCompare((const char *) tag,"map") == 0)
{
Image
*texture_image;
*/
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
texture_image=NewImageList();
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i]);
CloneString(&value,attribute);
switch (*keyword)
{
{
const char
*attribute;
-
+
attribute=GetImageProperty(msl_info->attributes[j],"id");
if ((attribute != (const char *) NULL) &&
(LocaleCompare(attribute,value) == 0))
texture_image=DestroyImage(texture_image);
break;
}
- else if (LocaleCompare((char *) tag,"threshold") == 0)
+ else if (LocaleCompare((const char *) tag,"threshold") == 0)
{
/* init the values */
double threshold = 0;
if (msl_info->image[n] == (Image *) NULL)
- {
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
- break;
- }
+ {
+ ThrowMSLException(OptionError,"NoImagesDefined",(const char *) tag);
+ break;
+ }
if (attributes == (const xmlChar **) NULL)
break;
for (i=0; (attributes[i] != (const xmlChar *) NULL); i++)
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i]));
switch (*keyword)
{
case 'T':
break;
}
}
- else if (LocaleCompare((char *) tag, "transparent") == 0)
+ else if (LocaleCompare((const char *) tag, "transparent") == 0)
{
if (msl_info->image[n] == (Image *) NULL)
- {
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
- break;
- }
+ {
+ ThrowMSLException(OptionError,"NoImagesDefined",(const char *) tag);
+ break;
+ }
if (attributes == (const xmlChar **) NULL)
break;
for (i=0; (attributes[i] != (const xmlChar *) NULL); i++)
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i]));
switch (*keyword)
{
case 'C':
}
break;
}
- else if (LocaleCompare((char *) tag, "trim") == 0)
+ else if (LocaleCompare((const char *) tag, "trim") == 0)
{
if (msl_info->image[n] == (Image *) NULL)
- {
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
- break;
- }
+ {
+ ThrowMSLException(OptionError,"NoImagesDefined",(const char *) tag);
+ break;
+ }
/* no attributes here */
case 'W':
case 'w':
{
- if (LocaleCompare((char *) tag,"write") == 0)
+ if (LocaleCompare((const char *) tag,"write") == 0)
{
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
break;
}
if (attributes == (const xmlChar **) NULL)
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i]));
switch (*keyword)
{
case 'F':
case 'C':
case 'c':
{
- if (LocaleCompare((char *) tag,"comment") == 0 )
+ if (LocaleCompare((const char *) tag,"comment") == 0 )
{
(void) DeleteImageProperty(msl_info->image[n],"comment");
if (msl_info->content == (char *) NULL)
case 'G':
case 'g':
{
- if (LocaleCompare((char *) tag, "group") == 0 )
+ if (LocaleCompare((const char *) tag, "group") == 0 )
{
if (msl_info->group_info[msl_info->number_groups-1].numImages > 0 )
{
case 'I':
case 'i':
{
- if (LocaleCompare((char *) tag, "image") == 0)
+ if (LocaleCompare((const char *) tag, "image") == 0)
MSLPopImage(msl_info);
break;
}
case 'L':
case 'l':
{
- if (LocaleCompare((char *) tag,"label") == 0 )
+ if (LocaleCompare((const char *) tag,"label") == 0 )
{
(void) DeleteImageProperty(msl_info->image[n],"label");
if (msl_info->content == (char *) NULL)
case 'M':
case 'm':
{
- if (LocaleCompare((char *) tag, "msl") == 0 )
+ if (LocaleCompare((const char *) tag, "msl") == 0 )
{
/*
This our base element.
*/
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" SAX.externalSubset(%s %s %s)",name,
- (external_id != (const xmlChar *) NULL ? (char *) external_id : " "),
- (system_id != (const xmlChar *) NULL ? (char *) system_id : " "));
+ (external_id != (const xmlChar *) NULL ? (const char *) external_id : " "),
+ (system_id != (const xmlChar *) NULL ? (const char *) system_id : " "));
msl_info=(MSLInfo *) context;
parser=msl_info->parser;
if (((external_id == NULL) && (system_id == NULL)) ||
% %
% %
% %
+% S e t M S L A t t r i b u t e s %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% SetMSLAttributes() ...
+%
+% The format of the SetMSLAttributes method is:
+%
+% MagickBooleanType SetMSLAttributes(MSLInfo *msl_info,
+% const xmlChar **attributes)
+%
+% A description of each parameter follows:
+%
+% o msl_info: the MSL info.
+%
+% o attributes: the attribute list.
+%
+*/
+static MagickBooleanType SetMSLAttributes(MSLInfo *msl_info,
+ const xmlChar **attributes)
+{
+ char
+ *value;
+
+ const char
+ *keyword;
+
+ ExceptionInfo
+ *exception;
+
+ long
+ n;
+
+ register long
+ i;
+
+ assert(msl_info != (MSLInfo *) NULL);
+ assert(exception != (ExceptionInfo *) NULL);
+ if (attributes == (const xmlChar **) NULL)
+ return(MagickTrue);
+ exception=msl_info->exception;
+ n=msl_info->n;
+ for (i=0; (attributes[i] != (const xmlChar *) NULL); i++)
+ {
+ keyword=(const char *) attributes[i++];
+ CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
+ msl_info->attributes[n],(const char *) attributes[i]));
+ switch (*keyword)
+ {
+ case 'B':
+ case 'b':
+ {
+ if (LocaleCompare(keyword,"background") == 0)
+ {
+ (void) QueryColorDatabase(value,
+ &msl_info->image_info[n]->background_color,exception);
+ break;
+ }
+ ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
+ break;
+ }
+ case 'F':
+ case 'f':
+ {
+ if (LocaleCompare(keyword,"fill") == 0)
+ {
+ (void) QueryColorDatabase(value,&msl_info->draw_info[n]->fill,
+ exception);
+ break;
+ }
+ ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
+ break;
+ }
+ case 'I':
+ case 'i':
+ {
+ if (LocaleCompare(keyword,"id") == 0)
+ {
+ (void) SetImageProperty(msl_info->attributes[n],keyword,NULL);
+ (void) SetImageProperty(msl_info->attributes[n],keyword,value);
+ break;
+ }
+ ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
+ break;
+ }
+ case 'S':
+ case 's':
+ {
+ if (LocaleCompare(keyword,"size") == 0)
+ {
+ CloneString(&msl_info->image_info[n]->size,value);
+ break;
+ }
+ ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
+ break;
+ }
+ default:
+ break;
+ }
+ }
+ return(MagickTrue);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
% U n r e g i s t e r M S L I m a g e %
% %
% %