Forward declarations.
*/
static MagickBooleanType
- DrawStrokePolygon(Image *,const DrawInfo *,const PrimitiveInfo *);
+ DrawStrokePolygon(Image *,const DrawInfo *,const PrimitiveInfo *,
+ ExceptionInfo *);
static PrimitiveInfo
*TraceStrokePolygon(const DrawInfo *,const PrimitiveInfo *);
DrawInfo
*clone_info;
+ ExceptionInfo
+ *exception;
+
clone_info=(DrawInfo *) AcquireMagickMemory(sizeof(*clone_info));
if (clone_info == (DrawInfo *) NULL)
ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
-
GetDrawInfo(image_info,clone_info);
if (draw_info == (DrawInfo *) NULL)
return(clone_info);
-
+ exception=AcquireExceptionInfo();
if (clone_info->primitive != (char *) NULL)
(void) CloneString(&clone_info->primitive,draw_info->primitive);
if (draw_info->geometry != (char *) NULL)
clone_info->stroke_width=draw_info->stroke_width;
if (draw_info->fill_pattern != (Image *) NULL)
clone_info->fill_pattern=CloneImage(draw_info->fill_pattern,0,0,MagickTrue,
- &draw_info->fill_pattern->exception);
+ exception);
if (draw_info->stroke_pattern != (Image *) NULL)
clone_info->stroke_pattern=CloneImage(draw_info->stroke_pattern,0,0,
- MagickTrue,&draw_info->stroke_pattern->exception);
+ MagickTrue,exception);
clone_info->stroke_antialias=draw_info->stroke_antialias;
clone_info->text_antialias=draw_info->text_antialias;
clone_info->fill_rule=draw_info->fill_rule;
clone_info->alpha=draw_info->alpha;
clone_info->element_reference=draw_info->element_reference;
clone_info->debug=IsEventLogging();
+ exception=DestroyExceptionInfo(exception);
return(clone_info);
}
\f
% The format of the DrawAffineImage method is:
%
% MagickBooleanType DrawAffineImage(Image *image,const Image *source,
-% const AffineMatrix *affine)
+% const AffineMatrix *affine,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o affine: the affine transform.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static SegmentInfo AffineEdge(const Image *image,const AffineMatrix *affine,
const double y,const SegmentInfo *edge)
}
MagickExport MagickBooleanType DrawAffineImage(Image *image,
- const Image *source,const AffineMatrix *affine)
+ const Image *source,const AffineMatrix *affine,ExceptionInfo *exception)
{
AffineMatrix
inverse_affine;
*image_view,
*source_view;
- ExceptionInfo
- *exception;
-
MagickBooleanType
status;
/*
Affine transform image.
*/
- exception=(&image->exception);
if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
return(MagickFalse);
status=MagickTrue;
% The format of the DrawBoundingRectangles method is:
%
% void DrawBoundingRectangles(Image *image,const DrawInfo *draw_info,
-% PolygonInfo *polygon_info)
+% PolygonInfo *polygon_info,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o polygon_info: Specifies a pointer to a PolygonInfo structure.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static void DrawBoundingRectangles(Image *image,const DrawInfo *draw_info,
- const PolygonInfo *polygon_info)
+ const PolygonInfo *polygon_info,ExceptionInfo *exception)
{
DrawInfo
*clone_info;
clone_info=CloneDrawInfo((ImageInfo *) NULL,draw_info);
(void) QueryColorCompliance("#0000",AllCompliance,&clone_info->fill,
- &image->exception);
+ exception);
resolution.x=DefaultResolution;
resolution.y=DefaultResolution;
if (clone_info->density != (char *) NULL)
{
if (polygon_info->edges[i].direction != 0)
(void) QueryColorCompliance("red",AllCompliance,&clone_info->stroke,
- &image->exception);
+ exception);
else
(void) QueryColorCompliance("green",AllCompliance,&clone_info->stroke,
- &image->exception);
+ exception);
start.x=(double) (polygon_info->edges[i].bounds.x1-mid);
start.y=(double) (polygon_info->edges[i].bounds.y1-mid);
end.x=(double) (polygon_info->edges[i].bounds.x2+mid);
primitive_info[0].method=ReplaceMethod;
coordinates=(ssize_t) primitive_info[0].coordinates;
primitive_info[coordinates].primitive=UndefinedPrimitive;
- (void) DrawPrimitive(image,clone_info,primitive_info);
+ (void) DrawPrimitive(image,clone_info,primitive_info,exception);
}
}
(void) QueryColorCompliance("blue",AllCompliance,&clone_info->stroke,
- &image->exception);
+ exception);
start.x=(double) (bounds.x1-mid);
start.y=(double) (bounds.y1-mid);
end.x=(double) (bounds.x2+mid);
primitive_info[0].method=ReplaceMethod;
coordinates=(ssize_t) primitive_info[0].coordinates;
primitive_info[coordinates].primitive=UndefinedPrimitive;
- (void) DrawPrimitive(image,clone_info,primitive_info);
+ (void) DrawPrimitive(image,clone_info,primitive_info,exception);
clone_info=DestroyDrawInfo(clone_info);
}
\f
% The format of the DrawDashPolygon method is:
%
% MagickBooleanType DrawDashPolygon(const DrawInfo *draw_info,
-% const PrimitiveInfo *primitive_info,Image *image)
+% const PrimitiveInfo *primitive_info,Image *image,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o image: the image.
%
+% o exception: return any errors or warnings in this structure.
%
*/
static MagickBooleanType DrawDashPolygon(const DrawInfo *draw_info,
- const PrimitiveInfo *primitive_info,Image *image)
+ const PrimitiveInfo *primitive_info,Image *image,ExceptionInfo *exception)
{
DrawInfo
*clone_info;
j++;
dash_polygon[0].coordinates=(size_t) j;
dash_polygon[j].primitive=UndefinedPrimitive;
- status|=DrawStrokePolygon(image,clone_info,dash_polygon);
+ status|=DrawStrokePolygon(image,clone_info,dash_polygon,exception);
}
n++;
if (draw_info->dash_pattern[n] == 0.0)
j++;
dash_polygon[0].coordinates=(size_t) j;
dash_polygon[j].primitive=UndefinedPrimitive;
- status|=DrawStrokePolygon(image,clone_info,dash_polygon);
+ status|=DrawStrokePolygon(image,clone_info,dash_polygon,exception);
}
dash_polygon=(PrimitiveInfo *) RelinquishMagickMemory(dash_polygon);
clone_info=DestroyDrawInfo(clone_info);
if (*draw_info->primitive != '@')
primitive=AcquireString(draw_info->primitive);
else
- primitive=FileToString(draw_info->primitive+1,~0,&image->exception);
+ primitive=FileToString(draw_info->primitive+1,~0,exception);
if (primitive == (char *) NULL)
return(MagickFalse);
primitive_extent=(MagickRealType) strlen(primitive);
}
token=AcquireString(primitive);
(void) QueryColorCompliance("#000000",AllCompliance,&start_color,
- &image->exception);
- if (SetImageStorageClass(image,DirectClass,&image->exception) == MagickFalse)
+ exception);
+ if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
return(MagickFalse);
status=MagickTrue;
for (q=primitive; *q != '\0'; )
{
GetMagickToken(q,&q,token);
(void) QueryColorCompliance(token,AllCompliance,
- &graphic_context[n]->border_color,&image->exception);
+ &graphic_context[n]->border_color,exception);
break;
}
status=MagickFalse;
else
{
status=QueryColorCompliance(token,AllCompliance,
- &graphic_context[n]->fill,&image->exception);
+ &graphic_context[n]->fill,exception);
if (status == MagickFalse)
{
ImageInfo
pattern_info=AcquireImageInfo();
(void) CopyMagickString(pattern_info->filename,token,
MaxTextExtent);
- graphic_context[n]->fill_pattern=
- ReadImage(pattern_info,&image->exception);
- CatchException(&image->exception);
+ graphic_context[n]->fill_pattern=ReadImage(pattern_info,
+ exception);
+ CatchException(exception);
pattern_info=DestroyImageInfo(pattern_info);
}
}
{
if (n <= 0)
{
- (void) ThrowMagickException(&image->exception,
- GetMagickModule(),DrawError,
- "UnbalancedGraphicContextPushPop","`%s'",token);
+ (void) ThrowMagickException(exception,GetMagickModule(),
+ DrawError,"UnbalancedGraphicContextPushPop","`%s'",token);
n=0;
break;
}
graphic_context,(size_t) (n+1),sizeof(*graphic_context));
if (graphic_context == (DrawInfo **) NULL)
{
- (void) ThrowMagickException(&image->exception,
- GetMagickModule(),ResourceLimitError,
- "MemoryAllocationFailed","`%s'",image->filename);
+ (void) ThrowMagickException(exception,GetMagickModule(),
+ ResourceLimitError,"MemoryAllocationFailed","`%s'",
+ image->filename);
break;
}
graphic_context[n]=CloneDrawInfo((ImageInfo *) NULL,
GetMagickToken(q,&q,token);
(void) QueryColorCompliance(token,AllCompliance,&stop_color,
- &image->exception);
+ exception);
(void) GradientImage(image,LinearGradient,ReflectSpread,
- &start_color,&stop_color,&image->exception);
+ &start_color,&stop_color,exception);
start_color=stop_color;
GetMagickToken(q,&q,token);
break;
else
{
status=QueryColorCompliance(token,AllCompliance,
- &graphic_context[n]->stroke,&image->exception);
+ &graphic_context[n]->stroke,exception);
if (status == MagickFalse)
{
ImageInfo
pattern_info=AcquireImageInfo();
(void) CopyMagickString(pattern_info->filename,token,
MaxTextExtent);
- graphic_context[n]->stroke_pattern=
- ReadImage(pattern_info,&image->exception);
- CatchException(&image->exception);
+ graphic_context[n]->stroke_pattern=ReadImage(pattern_info,
+ exception);
+ CatchException(exception);
pattern_info=DestroyImageInfo(pattern_info);
}
}
sizeof(*graphic_context[n]->dash_pattern));
if (graphic_context[n]->dash_pattern == (double *) NULL)
{
- (void) ThrowMagickException(&image->exception,
- GetMagickModule(),ResourceLimitError,
- "MemoryAllocationFailed","`%s'",image->filename);
+ (void) ThrowMagickException(exception,GetMagickModule(),
+ ResourceLimitError,"MemoryAllocationFailed","`%s'",
+ image->filename);
break;
}
for (j=0; j < x; j++)
{
GetMagickToken(q,&q,token);
(void) QueryColorCompliance(token,AllCompliance,
- &graphic_context[n]->undercolor,&image->exception);
+ &graphic_context[n]->undercolor,exception);
break;
}
if (LocaleCompare("translate",keyword) == 0)
(size_t) number_points,sizeof(*primitive_info));
if (primitive_info == (PrimitiveInfo *) NULL)
{
- (void) ThrowMagickException(&image->exception,GetMagickModule(),
+ (void) ThrowMagickException(exception,GetMagickModule(),
ResourceLimitError,"MemoryAllocationFailed","`%s'",image->filename);
break;
}
case BezierPrimitive:
{
if (primitive_info[j].coordinates > 107)
- (void) ThrowMagickException(&image->exception,GetMagickModule(),
- DrawError,"TooManyBezierCoordinates","`%s'",token);
+ (void) ThrowMagickException(exception,GetMagickModule(),DrawError,
+ "TooManyBezierCoordinates","`%s'",token);
length=BezierQuantum*primitive_info[j].coordinates;
break;
}
(size_t) number_points,sizeof(*primitive_info));
if (primitive_info == (PrimitiveInfo *) NULL)
{
- (void) ThrowMagickException(&image->exception,GetMagickModule(),
+ (void) ThrowMagickException(exception,GetMagickModule(),
ResourceLimitError,"MemoryAllocationFailed","`%s'",
image->filename);
break;
graphic_context[n-1]->clip_mask) != 0))
(void) DrawClipPath(image,graphic_context[n],
graphic_context[n]->clip_mask,exception);
- (void) DrawPrimitive(image,graphic_context[n],primitive_info);
+ (void) DrawPrimitive(image,graphic_context[n],primitive_info,exception);
}
if (primitive_info->text != (char *) NULL)
primitive_info->text=(char *) RelinquishMagickMemory(
% The format of the DrawGradientImage method is:
%
% MagickBooleanType DrawGradientImage(Image *image,
-% const DrawInfo *draw_info)
+% const DrawInfo *draw_info,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o draw_info: the draw info.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static inline MagickRealType GetStopColorOffset(const GradientInfo *gradient,
}
MagickExport MagickBooleanType DrawGradientImage(Image *image,
- const DrawInfo *draw_info)
+ const DrawInfo *draw_info,ExceptionInfo *exception)
{
CacheView
*image_view;
const SegmentInfo
*gradient_vector;
- ExceptionInfo
- *exception;
-
MagickBooleanType
status;
length=sqrt(point.x*point.x+point.y*point.y);
bounding_box=gradient->bounding_box;
status=MagickTrue;
- exception=(&image->exception);
GetPixelInfo(image,&zero);
image_view=AcquireCacheView(image);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
*pattern=DestroyImage(*pattern);
image_info=AcquireImageInfo();
image_info->size=AcquireString(geometry);
- *pattern=AcquireImage(image_info,&image->exception);
+ *pattern=AcquireImage(image_info,exception);
image_info=DestroyImageInfo(image_info);
(void) QueryColorCompliance("#00000000",AllCompliance,
&(*pattern)->background_color,exception);
% The format of the DrawPolygonPrimitive method is:
%
% MagickBooleanType DrawPolygonPrimitive(Image *image,
-% const DrawInfo *draw_info,const PrimitiveInfo *primitive_info)
+% const DrawInfo *draw_info,const PrimitiveInfo *primitive_info,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o primitive_info: Specifies a pointer to a PrimitiveInfo structure.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static PolygonInfo **DestroyPolygonThreadSet(PolygonInfo **polygon_info)
}
static MagickBooleanType DrawPolygonPrimitive(Image *image,
- const DrawInfo *draw_info,const PrimitiveInfo *primitive_info)
+ const DrawInfo *draw_info,const PrimitiveInfo *primitive_info,
+ ExceptionInfo *exception)
{
CacheView
*image_view;
- ExceptionInfo
- *exception;
-
MagickBooleanType
fill,
status;
if (polygon_info == (PolygonInfo **) NULL)
return(MagickFalse);
if (0)
- DrawBoundingRectangles(image,draw_info,polygon_info[0]);
+ DrawBoundingRectangles(image,draw_info,polygon_info[0],exception);
if (image->debug != MagickFalse)
(void) LogMagickEvent(DrawEvent,GetMagickModule()," begin draw-polygon");
fill=(primitive_info->method == FillToBorderMethod) ||
bounds.y2=bounds.y2 < 0.0 ? 0.0 : (size_t) floor(bounds.y2+0.5) >=
image->rows ? (double) image->rows-1.0 : bounds.y2;
status=MagickTrue;
- exception=(&image->exception);
start=(ssize_t) ceil(bounds.x1-0.5);
stop=(ssize_t) floor(bounds.x2+0.5);
image_view=AcquireCacheView(image);
% The format of the DrawPrimitive method is:
%
% MagickBooleanType DrawPrimitive(Image *image,const DrawInfo *draw_info,
-% PrimitiveInfo *primitive_info)
+% PrimitiveInfo *primitive_info,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o primitive_info: Specifies a pointer to a PrimitiveInfo structure.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static void LogPrimitiveInfo(const PrimitiveInfo *primitive_info)
}
MagickExport MagickBooleanType DrawPrimitive(Image *image,
- const DrawInfo *draw_info,const PrimitiveInfo *primitive_info)
+ const DrawInfo *draw_info,const PrimitiveInfo *primitive_info,
+ ExceptionInfo *exception)
{
CacheView
*image_view;
- ExceptionInfo
- *exception;
-
MagickStatusType
status;
draw_info->affine.tx,draw_info->affine.ty);
}
status=MagickTrue;
- exception=(&image->exception);
x=(ssize_t) ceil(primitive_info->point.x-0.5);
y=(ssize_t) ceil(primitive_info->point.y-0.5);
image_view=AcquireCacheView(image);
clone_info=AcquireImageInfo();
if (LocaleNCompare(primitive_info->text,"data:",5) == 0)
composite_image=ReadInlineImage(clone_info,primitive_info->text,
- &image->exception);
+ exception);
else
{
(void) CopyMagickString(clone_info->filename,primitive_info->text,
MaxTextExtent);
- composite_image=ReadImage(clone_info,&image->exception);
+ composite_image=ReadImage(clone_info,exception);
}
clone_info=DestroyImageInfo(clone_info);
if (composite_image == (Image *) NULL)
(void) FormatLocaleString(composite_geometry,MaxTextExtent,
"%.20gx%.20g%+.20g%+.20g",(double) composite_image->columns,(double)
composite_image->rows,(double) geometry.x,(double) geometry.y);
- (void) ParseGravityGeometry(image,composite_geometry,&geometry,
- &image->exception);
+ (void) ParseGravityGeometry(image,composite_geometry,&geometry,exception);
affine=draw_info->affine;
affine.tx=(double) geometry.x;
affine.ty=(double) geometry.y;
composite_image->interpolate=image->interpolate;
if (draw_info->compose == OverCompositeOp)
- (void) DrawAffineImage(image,composite_image,&affine);
+ (void) DrawAffineImage(image,composite_image,&affine,exception);
else
(void) CompositeImage(image,draw_info->compose,composite_image,
geometry.x,geometry.y,exception);
clone_info=CloneDrawInfo((ImageInfo *) NULL,draw_info);
clone_info->stroke_width=0.0;
clone_info->stroke.alpha=(Quantum) TransparentAlpha;
- status=DrawPolygonPrimitive(image,clone_info,primitive_info);
+ status=DrawPolygonPrimitive(image,clone_info,primitive_info,
+ exception);
clone_info=DestroyDrawInfo(clone_info);
- (void) DrawDashPolygon(draw_info,primitive_info,image);
+ (void) DrawDashPolygon(draw_info,primitive_info,image,exception);
break;
}
mid=ExpandAffine(&draw_info->affine)*draw_info->stroke_width/2.0;
(draw_info->linejoin == RoundJoin)) ||
(primitive_info[i].primitive != UndefinedPrimitive))
{
- (void) DrawPolygonPrimitive(image,draw_info,primitive_info);
+ (void) DrawPolygonPrimitive(image,draw_info,primitive_info,
+ exception);
break;
}
clone_info=CloneDrawInfo((ImageInfo *) NULL,draw_info);
clone_info->stroke_width=0.0;
clone_info->stroke.alpha=(Quantum) TransparentAlpha;
- status=DrawPolygonPrimitive(image,clone_info,primitive_info);
+ status=DrawPolygonPrimitive(image,clone_info,primitive_info,
+ exception);
clone_info=DestroyDrawInfo(clone_info);
- status|=DrawStrokePolygon(image,draw_info,primitive_info);
+ status|=DrawStrokePolygon(image,draw_info,primitive_info,exception);
break;
}
- status=DrawPolygonPrimitive(image,draw_info,primitive_info);
+ status=DrawPolygonPrimitive(image,draw_info,primitive_info,exception);
break;
}
}
*/
static void DrawRoundLinecap(Image *image,const DrawInfo *draw_info,
- const PrimitiveInfo *primitive_info)
+ const PrimitiveInfo *primitive_info,ExceptionInfo *exception)
{
PrimitiveInfo
linecap[5];
linecap[2].point.y+=(double) (10.0*MagickEpsilon);
linecap[3].point.y+=(double) (10.0*MagickEpsilon);
linecap[4].primitive=UndefinedPrimitive;
- (void) DrawPolygonPrimitive(image,draw_info,linecap);
+ (void) DrawPolygonPrimitive(image,draw_info,linecap,exception);
}
static MagickBooleanType DrawStrokePolygon(Image *image,
- const DrawInfo *draw_info,const PrimitiveInfo *primitive_info)
+ const DrawInfo *draw_info,const PrimitiveInfo *primitive_info,
+ ExceptionInfo *exception)
{
DrawInfo
*clone_info;
for (p=primitive_info; p->primitive != UndefinedPrimitive; p+=p->coordinates)
{
stroke_polygon=TraceStrokePolygon(draw_info,p);
- status=DrawPolygonPrimitive(image,clone_info,stroke_polygon);
+ status=DrawPolygonPrimitive(image,clone_info,stroke_polygon,exception);
stroke_polygon=(PrimitiveInfo *) RelinquishMagickMemory(stroke_polygon);
q=p+p->coordinates-1;
closed_path=(q->point.x == p->point.x) && (q->point.y == p->point.y) ?
MagickTrue : MagickFalse;
if ((draw_info->linecap == RoundCap) && (closed_path == MagickFalse))
{
- DrawRoundLinecap(image,draw_info,p);
- DrawRoundLinecap(image,draw_info,q);
+ DrawRoundLinecap(image,draw_info,p,exception);
+ DrawRoundLinecap(image,draw_info,q,exception);
}
}
clone_info=DestroyDrawInfo(clone_info);
}
if (LocaleCompare("blue-primary",option) == 0)
{
- /* Image chromaticity X,Y NB: Y=X if Y not defined
- Used by many coders
- */
(void) SetImageOption(image_info,option,
IfSetOption ? argv[1] : "0" );
break;
}
if (LocaleCompare("caption",option) == 0)
{
- /* Only used for new images via AquireImage() */
(void) SetImageOption(image_info,option,
IfSetOption ? argv[1] : (const char*)NULL);
break;
{
image_info->channel=(ChannelType) (
IfSetOption ? ParseChannelOption(argv[1]) : DefaultChannels );
- /* FUTURE: This is also a SimpleImageOperator!!! */
+ /* This is also a SimpleImageOperator */
break;
}
if (LocaleCompare("colorspace",option) == 0)
{
- /* Setting for new images, and for existing images */
/* This is also a SimpleImageOperator */
/* Undefined colorspace means don't modify images */
image_info->colorspace=UndefinedColorspace;
}
if (LocaleCompare("comment",option) == 0)
{
- /* Only used for new images via AquireImage() */
(void) SetImageOption(image_info,option,
IfSetOption ? argv[1] : (const char*)NULL);
break;
}
if (LocaleCompare("compose",option) == 0)
{
- /* FUTURE: image_info should be used, Option for escapes
- This option should NOT be used to set image 'compose'
- which is used by "-layer" operators is image_info is undefined
+ /* FUTURE: What should be used? image_info or ImageOption ???
+ The former is more efficent, but Crisy prefers the latter!
*/
(void) SetImageOption(image_info,option,
IfSetOption ? argv[1] : (const char*)NULL);
}
if (LocaleCompare("delay",option) == 0)
{
- /* Only used for new images via AcquireImage()
- Option should also be used for "-morph" (color morphong)
+ /* transfered to new images only via AcquireImage()
+ -set delay must be used to set attributes directly.
*/
(void) SetImageOption(image_info,option,
IfSetOption ? argv[1] : "0");
}
if (LocaleCompare("density",option) == 0)
{
- /* Used by both draw_info and in images via SyncImageSettings() */
- if (IfSetOption)
+ /* FUTURE: At this time everyone is using image_info string
+ The Image Option is not being used.
+ */
+ if (IsSetOption)
{
(void) CloneString(&image_info->density,argv[1]);
(void) CloneString(&draw_info->density,argv[1]);
}
if (LocaleCompare("fill",option) == 0)
{
- /* set fill OR a fill-pattern */
- /* FUTURE: tile is only set in draw_info, not in image_info ! */
const char
value;
IfSetOption ? argv[1] : "undefined");
break;
}
- if (LocaleCompare("font",option) == 0)
+ if (LocaleCompare("font",argv[0]+1) == 0)
{
(void) CloneString(&draw_info->font,
IfSetOption ? argv[1] : (const char *) NULL);
}
if (LocaleCompare("format",option) == 0)
{
- /* FUTURE: why the ping test, you could set ping after this! */
- /*
+ /* FUTURE: why the ping test, the user could set ping after this! */
register const char
*q;
for (q=strchr(argv[1],'%'); q != (char *) NULL; q=strchr(q+1,'%'))
if (strchr("Agkrz@[#",*(q+1)) != (char *) NULL)
image_info->ping=MagickFalse;
- */
- (void) SetImageOption(image_info,option,
- IfSetOption ? argv[1] : (const char *) NULL);
+ (void) SetImageOption(image_info,option,argv[1]);
break;
}
if (LocaleCompare("fuzz",option) == 0)
{
/* FUTURE: image_info and ImageOption!
Option used to set image fuzz! unless blank canvas (from color)
- Image attribute used for color compare operations
- image->fuzz is being set by SyncImageSettings()
- Can't find anything making use of image_info->fuzz
+ image attribute used for color compare operations
+ Can't find anything using image_info->fuzz (except cloning)!
*/
- (void) SetImageOption(image_info,option,
- IfSetOption ? argv[1] : (const char *) NULL);
if (IfSetOption)
- image_info->fuzz=SiPrefixToDouble(argv[1],(double) QuantumRange+1.0);
- else
- image_info->fuzz=0.0;
+ {
+ image_info->fuzz=SiPrefixToDouble(argv[1],(double) QuantumRange+1.0);
+ (void) SetImageOption(image_info,option,argv[1]);
+ break;
+ }
+ image_info->fuzz=0.0;
+ (void) SetImageOption(image_info,option,"0");
break;
}
break;
{
if (LocaleCompare("gravity",option) == 0)
{
- /* FUTURE gravity also set in image via SyncImageSettings() */
- const char
- value;
-
- value = IfSetOption ? argv[1] : "none";
- (void) SetImageOption(image_info,option,value);
+ if (*argv[0] == '+')
+ {
+ (void) SetImageOption(image_info,option,"undefined");
+ draw_info->gravity=UndefinedGravity;
+ break;
+ }
+ (void) SetImageOption(image_info,option,argv[1]);
draw_info->gravity=(GravityType) ParseCommandOption(
- MagickGravityOptions,MagickFalse,value);
+ MagickGravityOptions,MagickFalse,argv[1]);
break;
}
if (LocaleCompare("green-primary",option) == 0)
{
- /* Image chromaticity X,Y NB: Y=X if Y not defined
- Used by many coders
- */
- (void) SetImageOption(image_info,option,
- IfSetOption ? argv[1] : "0.0");
+ if (*argv[0] == '+')
+ {
+ (void) SetImageOption(image_info,option,"0.0");
+ break;
+ }
+ (void) SetImageOption(image_info,option,argv[1]);
break;
}
break;
{
if (LocaleCompare("intent",option) == 0)
{
- /* FUTURE: this should also set image->rendering_intent
- Which is only used by coders: MIFF, MPC, BMP, PNG
- and for image profile call to AcquireTransformThreadSet()
- */
- (void) SetImageOption(image_info,option,
- IfSetOption ? argv[1] : "undefined");
+ if (*argv[0] == '+')
+ {
+ (void) SetImageOption(image_info,option,"undefined");
+ break;
+ }
+ (void) SetImageOption(image_info,option,argv[1]);
break;
}
if (LocaleCompare("interlace",option) == 0)
{
- /* sets image attibute interlace via SyncImageSettings()
- Also image_info is directly used by coders
- */
- const char
- value;
-
- value = IfSetOption ? argv[1] : "undefined";
- (void) SetImageOption(image_info,option, value);
+ if (*argv[0] == '+')
+ {
+ image_info->interlace=UndefinedInterlace;
+ (void) SetImageOption(image_info,option,"undefined");
+ break;
+ }
image_info->interlace=(InterlaceType) ParseCommandOption(
- MagickInterlaceOptions,MagickFalse,value);
+ MagickInterlaceOptions,MagickFalse,argv[1]);
+ (void) SetImageOption(image_info,option,argv[1]);
break;
}
if (LocaleCompare("interline-spacing",option) == 0)
{
- const char
- value;
-
- value = IfSetOption ? argv[1] : "0"; /* undefined? */
- (void) SetImageOption(image_info,option, value);
- draw_info->interline_spacing=InterpretLocaleValue(value,
- (char **) NULL);
+ if (*argv[0] == '+')
+ {
+ (void) SetImageOption(image_info,option,"undefined");
+ break;
+ }
+ (void) SetImageOption(image_info,option,argv[1]);
break;
}
if (LocaleCompare("interpolate",option) == 0)
{
- /* FUTURE: sets image interpolate value via SyncImageSettings()
- It is NOT used by coders, only in image processing,
- so shoud really be a image_info attribute.
- */
- (void) SetImageOption(image_info,option,
- IfSetOption ? argv[1] : "undefined");
+ if (*argv[0] == '+')
+ {
+ (void) SetImageOption(image_info,option,"undefined");
+ break;
+ }
+ (void) SetImageOption(image_info,option,argv[1]);
break;
}
- if (LocaleCompare("interword-spacing",argv[0]+1) == 0)
+ if (LocaleCompare("interword-spacing",option) == 0)
{
- const char
- value;
-
- value = IfSetOption ? argv[1] : "0"; /* undefined? */
- (void) SetImageOption(image_info,option, value);
- draw_info->interword_spacing=InterpretLocaleValue(value,
- (char **) NULL);
+ if (*argv[0] == '+')
+ {
+ (void) SetImageOption(image_info,option,"undefined");
+ break;
+ }
+ (void) SetImageOption(image_info,option,argv[1]);
break;
}
break;
{
if (LocaleCompare("kerning",option) == 0)
{
- const char
- value;
-
- value = IfSetOption ? argv[1] : "0"; /* undefined? */
- (void) SetImageOption(image_info,option, value);
- draw_info->kerning=InterpretLocaleValue(value,(char **) NULL);
+ if (*argv[0] == '+')
+ {
+ (void) SetImageOption(image_info,option,"undefined");
+ break;
+ }
+ (void) SetImageOption(image_info,option,argv[1]);
break;
}
break;
{
if (LocaleCompare("label",option) == 0)
{
- /* only used for new images */
- (void) SetImageOption(image_info,option,
- IfSetOption ? argv[1] : (char *)NULL);
+ if (*argv[0] == '+')
+ {
+ (void) DeleteImageOption(image_info,option);
+ break;
+ }
+ (void) SetImageOption(image_info,option,argv[1]);
break;
}
if (LocaleCompare("limit",option) == 0)
ResourceType
type;
- if (!IsSetOption)
+ if (*argv[0] == '+')
break;
type=(ResourceType) ParseCommandOption(MagickResourceOptions,
MagickFalse,argv[1]);
(void) SetMagickResourceLimit(type,limit);
break;
}
- if (LocaleCompare("linewidth",argv[0]+1) == 0)
- {
- /* FUTURE: obsoleted by stroke-width setting */
- draw_info->stroke_width=InterpretLocaleValue(argv[1],
- (char **) NULL);
- break;
- }
if (LocaleCompare("list",option) == 0)
{
ssize_t
list;
+ /*
+ Display configuration list.
+ */
list=ParseCommandOption(MagickListOptions,MagickFalse,argv[1]);
switch (list)
{
}
if (LocaleCompare("log",option) == 0)
{
- if (IsSetOption)
- (void) SetLogFormat(argv[1]);
+ if (*argv[0] == '+')
+ break;
+ (void) SetLogFormat(argv[1]);
break;
}
if (LocaleCompare("loop",option) == 0)
{
- /* Sets image attibutes iterations via SyncImageSettings() */
- (void) SetImageOption(image_info,option,
- IfSetOption ? argv[1] : "0");
+ if (*argv[0] == '+')
+ {
+ (void) SetImageOption(image_info,option,"0");
+ break;
+ }
+ (void) SetImageOption(image_info,option,argv[1]);
break;
}
break;
}
case 'm':
{
+ if (LocaleCompare("matte",option) == 0)
+ {
+ if (*argv[0] == '+')
+ {
+ (void) SetImageOption(image_info,option,"false");
+ break;
+ }
+ (void) SetImageOption(image_info,option,"true");
+ break;
+ }
if (LocaleCompare("mattecolor",option) == 0)
{
+ if (*argv[0] == '+')
+ {
+ (void) SetImageOption(image_info,option,argv[1]);
+ (void) QueryColorCompliance(MatteColor,AllCompliance,
+ &image_info->matte_color,exception);
+ break;
+ }
(void) SetImageOption(image_info,option,argv[1]);
- (void) QueryColorCompliance(argv[1],AllCompliance,
- &image_info->matte_color,exception);
+ (void) QueryColorCompliance(argv[1],AllCompliance,&image_info->matte_color,
+ exception);
break;
}
if (LocaleCompare("monitor",option) == 0)
}
if (LocaleCompare("monochrome",option) == 0)
{
- /* Setting (for input coders) and a 'type' operation */
- image_info->monochrome=IsSetOption ? MagickTrue : MagickFalse;
+ image_info->monochrome=(*argv[0] == '-') ? MagickTrue : MagickFalse;
break;
}
break;
{
if (LocaleCompare("orient",option) == 0)
{
- /* Sets image attribute orientation via SyncImageSettings()
- Is not used when defining for new images.
- This makes it more of a 'operation' than a setting
- */
- const char
- value;
-
- value = IfSetOption ? argv[1] : "undefined";
- (void) SetImageOption(image_info,option, value);
- image_info->orientation=(InterlaceType) ParseCommandOption(
- MagickOrientationOptions,MagickFalse,value);
+ if (*argv[0] == '+')
+ {
+ image_info->orientation=UndefinedOrientation;
+ (void) SetImageOption(image_info,option,"undefined");
+ break;
+ }
+ image_info->orientation=(OrientationType) ParseCommandOption(
+ MagickOrientationOptions,MagickFalse,argv[1]);
+ (void) SetImageOption(image_info,option,argv[1]);
break;
}
}
{
if (LocaleCompare("page",option) == 0)
{
- /* Only used for new images and image generators */
char
*canonical_page,
page[MaxTextExtent];
RectangleInfo
geometry;
- if (!IsSetOption)
+ if (*argv[0] == '+')
{
(void) DeleteImageOption(image_info,option);
(void) CloneString(&image_info->page,(char *) NULL);
(void) CloneString(&image_info->page,page);
break;
}
+ if (LocaleCompare("pen",option) == 0)
+ {
+ if (*argv[0] == '+')
+ {
+ (void) SetImageOption(image_info,option,"none");
+ break;
+ }
+ (void) SetImageOption(image_info,option,argv[1]);
+ break;
+ }
if (LocaleCompare("ping",option) == 0)
{
image_info->ping=(*argv[0] == '-') ? MagickTrue : MagickFalse;
}
if (LocaleCompare("pointsize",option) == 0)
{
- double
- value=12.0;
-
- if (IfSetOption)
- InterpretLocaleValue(argv[1],(char **) NULL);
- image_info->pointsize=draw_info->pointsize=value;
+ if (*argv[0] == '+')
+ geometry_info.rho=0.0;
+ else
+ (void) ParseGeometry(argv[1],&geometry_info);
+ image_info->pointsize=geometry_info.rho;
break;
}
if (LocaleCompare("precision",option) == 0)
(void) SetMagickPrecision(StringToInteger(argv[1]));
break;
}
- /* FUTURE: Only the 'preview' coder appears to use this
- * Depreciate the coder? Leaving only the 'preview' operator.
if (LocaleCompare("preview",option) == 0)
{
- image_info->preview_type=UndefinedPreview;
- if (IfSetOption)
- image_info->preview_type=(PreviewType) ParseCommandOption(
- MagickPreviewOptions,MagickFalse,argv[1]);
+ /*
+ Preview image.
+ */
+ if (*argv[0] == '+')
+ {
+ image_info->preview_type=UndefinedPreview;
+ break;
+ }
+ image_info->preview_type=(PreviewType) ParseCommandOption(
+ MagickPreviewOptions,MagickFalse,argv[1]);
break;
}
- */
break;
}
case 'q':
{
if (LocaleCompare("quality",option) == 0)
{
- if (IfSetOption)
+ /*
+ Set image compression quality.
+ */
+ if (*argv[0] == '+')
{
- image_info->quality=StringToUnsignedLong(argv[1]);
- (void) SetImageOption(image_info,option,argv[1]);
+ image_info->quality=UndefinedCompressionQuality;
+ (void) SetImageOption(image_info,option,"0");
break;
}
- image_info->quality=UndefinedCompressionQuality;
- (void) SetImageOption(image_info,option,"0");
- break;
- }
- if (LocaleCompare("quantize",option) == 0)
- {
- /* no image_info setting! Only set direct in quantize_info */
- quantize_info->colorspace=UndefinedColorspace;
- if (IfSetOption)
- quantize_info->colorspace=(ColorspaceType) ParseCommandOption(
- MagickColorspaceOptions,MagickFalse,argv[1]);
+ image_info->quality=StringToUnsignedLong(argv[1]);
+ (void) SetImageOption(image_info,option,argv[1]);
break;
}
if (LocaleCompare("quiet",option) == 0)
{
- /* FUTURE: if two -quiet is performed you can not do +quiet! */
static WarningHandler
warning_handler = (WarningHandler) NULL;
if (*argv[0] == '+')
{
- /* Restore error or warning messages. */
+ /*
+ Restore error or warning messages.
+ */
warning_handler=SetWarningHandler(warning_handler);
break;
}
- /* Suppress error or warning messages. */
+ /*
+ Suppress error or warning messages.
+ */
warning_handler=SetWarningHandler((WarningHandler) NULL);
break;
}
{
if (LocaleCompare("red-primary",option) == 0)
{
- /* Image chromaticity X,Y NB: Y=X if Y not defined
- Used by many coders
- */
- (void) SetImageOption(image_info,option,
- IfSetOption ? argv[1] : "0" );
+ if (*argv[0] == '+')
+ {
+ (void) SetImageOption(image_info,option,"0.0");
+ break;
+ }
+ (void) SetImageOption(image_info,option,argv[1]);
break;
}
break;
(void) CloneString(&image_info->texture,argv[1]);
break;
}
- if (LocaleCompare("tile",option) == 0)
- {
- draw_info->fill_pattern=DestroyImage(draw_info->fill_pattern);
- if (ISSetOption)
- draw_info->fill_pattern=GetImageCache(image_info,argv[1],exception);
- break;
- }
if (LocaleCompare("tile-offset",option) == 0)
{
if (*argv[0] == '+')
new_image = (Image *)NULL;
- switch (*(option))
+ switch (*(argv[0]+1))
{
case 'a':
{
- if (LocaleCompare("adaptive-blur",option) == 0)
+ if (LocaleCompare("adaptive-blur",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
flags=ParseGeometry(argv[1],&geometry_info);
geometry_info.sigma,geometry_info.xi,exception);
break;
}
- if (LocaleCompare("adaptive-resize",option) == 0)
+ if (LocaleCompare("adaptive-resize",argv[0]+1) == 0)
{
/* FUTURE: this is really a "interpolate-resize" operator
"adaptive-resize" uses a fixed "Mesh" interpolation
geometry.height,interpolate_method,exception);
break;
}
- if (LocaleCompare("adaptive-sharpen",option) == 0)
+ if (LocaleCompare("adaptive-sharpen",argv[0]+1) == 0)
{
/*
Adaptive sharpen image.
geometry_info.sigma,geometry_info.xi,exception);
break;
}
- if (LocaleCompare("alpha",option) == 0)
+ if (LocaleCompare("alpha",argv[0]+1) == 0)
{
AlphaChannelType
alpha_type;
(void) SetImageAlphaChannel(*image,alpha_type,exception);
break;
}
- if (LocaleCompare("annotate",option) == 0)
+ if (LocaleCompare("annotate",argv[0]+1) == 0)
{
char
*text,
(void) AnnotateImage(*image,draw_info,exception);
break;
}
- if (LocaleCompare("auto-gamma",option) == 0)
+ if (LocaleCompare("auto-gamma",argv[0]+1) == 0)
{
/*
Auto Adjust Gamma of image based on its mean
(void) AutoGammaImage(*image,exception);
break;
}
- if (LocaleCompare("auto-level",option) == 0)
+ if (LocaleCompare("auto-level",argv[0]+1) == 0)
{
/*
Perfectly Normalize (max/min stretch) the image
(void) AutoLevelImage(*image,exception);
break;
}
- if (LocaleCompare("auto-orient",option) == 0)
+ if (LocaleCompare("auto-orient",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
switch ((*image)->orientation)
}
case 'b':
{
- if (LocaleCompare("black-threshold",option) == 0)
+ if (LocaleCompare("black-threshold",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
(void) BlackThresholdImage(*image,argv[1],exception);
break;
}
- if (LocaleCompare("blue-shift",option) == 0)
+ if (LocaleCompare("blue-shift",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
geometry_info.rho=1.5;
new_image=BlueShiftImage(*image,geometry_info.rho,exception);
break;
}
- if (LocaleCompare("blur",option) == 0)
+ if (LocaleCompare("blur",argv[0]+1) == 0)
{
/* FUTURE: use of "bias" in a blur is non-sensible */
(void) SyncImageSettings(image_info,*image);
geometry_info.sigma,geometry_info.xi,exception);
break;
}
- if (LocaleCompare("border",option) == 0)
+ if (LocaleCompare("border",argv[0]+1) == 0)
{
ComposeOperator
compose;
new_image=BorderImage(*image,&geometry,compose,exception);
break;
}
- if (LocaleCompare("brightness-contrast",option) == 0)
+ if (LocaleCompare("brightness-contrast",argv[0]+1) == 0)
{
double
brightness,
}
case 'c':
{
- if (LocaleCompare("cdl",option) == 0)
+ if (LocaleCompare("cdl",argv[0]+1) == 0)
{
char
*color_correction_collection;
exception);
break;
}
- if (LocaleCompare("channel",option) == 0)
+ if (LocaleCompare("channel",argv[0]+1) == 0)
{
/* The "channel" setting has already been set */
SetPixelChannelMap(*image,image_info->channel);
break;
}
- if (LocaleCompare("charcoal",option) == 0)
+ if (LocaleCompare("charcoal",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
flags=ParseGeometry(argv[1],&geometry_info);
geometry_info.sigma,geometry_info.xi,exception);
break;
}
- if (LocaleCompare("chop",option) == 0)
+ if (LocaleCompare("chop",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
(void) ParseGravityGeometry(*image,argv[1],&geometry,exception);
new_image=ChopImage(*image,&geometry,exception);
break;
}
- if (LocaleCompare("clamp",option) == 0)
+ if (LocaleCompare("clamp",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
(void) ClampImage(*image,exception);
break;
}
- if (LocaleCompare("clip",option) == 0)
+ if (LocaleCompare("clip",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
if (*argv[0] == '+')
(void) ClipImage(*image,exception);
break;
}
- if (LocaleCompare("clip-mask",option) == 0)
+ if (LocaleCompare("clip-mask",argv[0]+1) == 0)
{
CacheView
*mask_view;
mask_image=DestroyImage(mask_image);
break;
}
- if (LocaleCompare("clip-path",option) == 0)
+ if (LocaleCompare("clip-path",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
(void) ClipImagePath(*image,argv[1],*argv[0] == '-' ? MagickTrue :
MagickFalse,exception);
break;
}
- if (LocaleCompare("colorize",option) == 0)
+ if (LocaleCompare("colorize",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
new_image=ColorizeImage(*image,argv[1],draw_info->fill,
exception);
break;
}
- if (LocaleCompare("color-matrix",option) == 0)
+ if (LocaleCompare("color-matrix",argv[0]+1) == 0)
{
KernelInfo
*kernel;
kernel=DestroyKernelInfo(kernel);
break;
}
- if (LocaleCompare("colors",option) == 0)
+ if (LocaleCompare("colors",argv[0]+1) == 0)
{
/* Reduce the number of colors in the image. */
(void) SyncImageSettings(image_info,*image);
(void) CompressImageColormap(*image,exception);
break;
}
- if (LocaleCompare("colorspace",option) == 0)
+ if (LocaleCompare("colorspace",argv[0]+1) == 0)
{
/* This is a Image Setting, which should already been set */
/* FUTURE: default colorspace should be sRGB!
exception);
break;
}
- if (LocaleCompare("contrast",option) == 0)
+ if (LocaleCompare("contrast",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
(void) ContrastImage(*image,(*argv[0] == '-') ? MagickTrue :
MagickFalse,exception);
break;
}
- if (LocaleCompare("contrast-stretch",option) == 0)
+ if (LocaleCompare("contrast-stretch",argv[0]+1) == 0)
{
double
black_point,
exception);
break;
}
- if (LocaleCompare("convolve",option) == 0)
+ if (LocaleCompare("convolve",argv[0]+1) == 0)
{
KernelInfo
*kernel_info;
kernel_info=DestroyKernelInfo(kernel_info);
break;
}
- if (LocaleCompare("crop",option) == 0)
+ if (LocaleCompare("crop",argv[0]+1) == 0)
{
/*
Crop a image to a smaller size
new_image=CropImageToTiles(*image,argv[1],exception);
break;
}
- if (LocaleCompare("cycle",option) == 0)
+ if (LocaleCompare("cycle",argv[0]+1) == 0)
{
/*
Cycle an image colormap.
}
case 'd':
{
- if (LocaleCompare("decipher",option) == 0)
+ if (LocaleCompare("decipher",argv[0]+1) == 0)
{
StringInfo
*passkey;
}
break;
}
- if (LocaleCompare("depth",option) == 0)
+ if (LocaleCompare("depth",argv[0]+1) == 0)
{
/* the image_info->depth setting has already bee set
* We just need to apply it to all images in current sequence */
(void) SetImageDepth(*image,image_info->depth);
break;
}
- if (LocaleCompare("deskew",option) == 0)
+ if (LocaleCompare("deskew",argv[0]+1) == 0)
{
double
threshold;
new_image=DeskewImage(*image,threshold,exception);
break;
}
- if (LocaleCompare("despeckle",option) == 0)
+ if (LocaleCompare("despeckle",argv[0]+1) == 0)
{
/*
Reduce the speckles within an image.
new_image=DespeckleImage(*image,exception);
break;
}
- if (LocaleCompare("display",option) == 0)
+ if (LocaleCompare("display",argv[0]+1) == 0)
{
(void) CloneString(&draw_info->server_name,argv[1]);
break;
}
- if (LocaleCompare("distort",option) == 0)
+ if (LocaleCompare("distort",argv[0]+1) == 0)
{
char
*args,
arguments=(double *) RelinquishMagickMemory(arguments);
break;
}
- if (LocaleCompare("draw",option) == 0)
+ if (LocaleCompare("draw",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
(void) CloneString(&draw_info->primitive,argv[1]);
}
case 'e':
{
- if (LocaleCompare("edge",option) == 0)
+ if (LocaleCompare("edge",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
flags=ParseGeometry(argv[1],&geometry_info);
geometry_info.sigma,exception);
break;
}
- if (LocaleCompare("emboss",option) == 0)
+ if (LocaleCompare("emboss",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
flags=ParseGeometry(argv[1],&geometry_info);
geometry_info.sigma,exception);
break;
}
- if (LocaleCompare("encipher",option) == 0)
+ if (LocaleCompare("encipher",argv[0]+1) == 0)
{
StringInfo
*passkey;
}
break;
}
- if (LocaleCompare("enhance",option) == 0)
+ if (LocaleCompare("enhance",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
new_image=EnhanceImage(*image,exception);
break;
}
- if (LocaleCompare("equalize",option) == 0)
+ if (LocaleCompare("equalize",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
(void) EqualizeImage(*image,exception);
break;
}
- if (LocaleCompare("evaluate",option) == 0)
+ if (LocaleCompare("evaluate",argv[0]+1) == 0)
{
double
constant;
(void) EvaluateImage(*image,op,constant,exception);
break;
}
- if (LocaleCompare("extent",option) == 0)
+ if (LocaleCompare("extent",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
flags=ParseGravityGeometry(*image,argv[1],&geometry,exception);
}
case 'f':
{
- if (LocaleCompare("features",option) == 0)
+ if (LocaleCompare("features",argv[0]+1) == 0)
{
- /* FUTURE: Assign Artifact to all images -- really a setting */
+ /* FUTURE: Assign Artifact all images */
(void) SetImageArtifact(*image,"identify:features",
IfSetOption ? argv[1] : (const char *) NULL);
break;
}
- if (LocaleCompare("flip",option) == 0)
+ if (LocaleCompare("flip",argv[0]+1) == 0)
{
+ /*
+ Flip image scanlines.
+ */
(void) SyncImageSettings(image_info,*image);
new_image=FlipImage(*image,exception);
break;
}
- if (LocaleCompare("flop",option) == 0)
+ if (LocaleCompare("flop",argv[0]+1) == 0)
{
+ /*
+ Flop image scanlines.
+ */
(void) SyncImageSettings(image_info,*image);
new_image=FlopImage(*image,exception);
break;
}
- if (LocaleCompare("floodfill",option) == 0)
+ if (LocaleCompare("floodfill",argv[0]+1) == 0)
{
PixelInfo
target;
+ /*
+ Floodfill image.
+ */
(void) SyncImageSettings(image_info,*image);
(void) ParsePageGeometry(*image,argv[1],&geometry,exception);
(void) QueryColorCompliance(argv[2],AllCompliance,&target,
geometry.y,*argv[0] == '-' ? MagickFalse : MagickTrue,exception);
break;
}
- if (LocaleCompare("frame",option) == 0)
+ /* FUTURE: should be from ImageOption "format"
+ if (LocaleCompare("format",argv[0]+1) == 0)
+ {
+ format=argv[1];
+ break;
+ }
+ */
+ if (LocaleCompare("frame",argv[0]+1) == 0)
{
FrameInfo
frame_info;
+ /*
+ Surround image with an ornamental border.
+ */
(void) SyncImageSettings(image_info,*image);
flags=ParsePageGeometry(*image,argv[1],&geometry,exception);
frame_info.width=geometry.width;
new_image=FrameImage(*image,&frame_info,COMPOSE,exception);
break;
}
- if (LocaleCompare("function",option) == 0)
+ if (LocaleCompare("function",argv[0]+1) == 0)
{
char
*arguments,
size_t
number_parameters;
+ /*
+ Function Modify Image Values
+ */
(void) SyncImageSettings(image_info,*image);
function=(MagickFunction) ParseCommandOption(MagickFunctionOptions,
MagickFalse,argv[1]);
}
case 'g':
{
- if (LocaleCompare("gamma",option) == 0)
+ if (LocaleCompare("gamma",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
if (*argv[0] == '+')
(char **) NULL),exception);
break;
}
- if ((LocaleCompare("gaussian-blur",option) == 0) ||
- (LocaleCompare("gaussian",option) == 0))
+ if ((LocaleCompare("gaussian-blur",argv[0]+1) == 0) ||
+ (LocaleCompare("gaussian",argv[0]+1) == 0))
{
(void) SyncImageSettings(image_info,*image);
flags=ParseGeometry(argv[1],&geometry_info);
geometry_info.sigma,geometry_info.xi,exception);
break;
}
- if (LocaleCompare("geometry",option) == 0)
+ if (LocaleCompare("geometry",argv[0]+1) == 0)
{
/*
Record Image offset for composition,
}
case 'h':
{
- if (LocaleCompare("highlight-color",option) == 0)
+ if (LocaleCompare("highlight-color",argv[0]+1) == 0)
{
- (void) SetImageArtifact(*image,option,argv[1]);
+ (void) SetImageArtifact(*image,argv[0]+1,argv[1]);
break;
}
break;
}
case 'i':
{
- if (LocaleCompare("identify",option) == 0)
+ if (LocaleCompare("identify",argv[0]+1) == 0)
{
char
*text;
text=DestroyString(text);
break;
}
- if (LocaleCompare("implode",option) == 0)
+ if (LocaleCompare("implode",argv[0]+1) == 0)
{
+ /*
+ Implode image.
+ */
(void) SyncImageSettings(image_info,*image);
(void) ParseGeometry(argv[1],&geometry_info);
new_image=ImplodeImage(*image,geometry_info.rho,
interpolate_method,exception);
break;
}
+ if (LocaleCompare("interline-spacing",argv[0]+1) == 0)
+ {
+ if (*argv[0] == '+')
+ (void) ParseGeometry("0",&geometry_info);
+ else
+ (void) ParseGeometry(argv[1],&geometry_info);
+ draw_info->interline_spacing=geometry_info.rho;
+ break;
+ }
+ if (LocaleCompare("interpolate",argv[0]+1) == 0)
+ {
+ interpolate_method=(PixelInterpolateMethod) ParseCommandOption(
+ MagickInterpolateOptions,MagickFalse,argv[1]);
+ break;
+ }
+ if (LocaleCompare("interword-spacing",argv[0]+1) == 0)
+ {
+ if (*argv[0] == '+')
+ (void) ParseGeometry("0",&geometry_info);
+ else
+ (void) ParseGeometry(argv[1],&geometry_info);
+ draw_info->interword_spacing=geometry_info.rho;
+ break;
+ }
+ break;
+ }
+ case 'k':
+ {
+ if (LocaleCompare("kerning",argv[0]+1) == 0)
+ {
+ if (*argv[0] == '+')
+ (void) ParseGeometry("0",&geometry_info);
+ else
+ (void) ParseGeometry(argv[1],&geometry_info);
+ draw_info->kerning=geometry_info.rho;
+ break;
+ }
break;
}
case 'l':
{
- if (LocaleCompare("lat",option) == 0)
+ if (LocaleCompare("lat",argv[0]+1) == 0)
{
/*
Local adaptive threshold image.
geometry_info.xi,exception);
break;
}
- if (LocaleCompare("level",option) == 0)
+ if (LocaleCompare("level",argv[0]+1) == 0)
{
MagickRealType
black_point,
MagickStatusType
flags;
+ /*
+ Parse levels.
+ */
(void) SyncImageSettings(image_info,*image);
flags=ParseGeometry(argv[1],&geometry_info);
black_point=geometry_info.rho;
exception);
break;
}
- if (LocaleCompare("level-colors",option) == 0)
+ if (LocaleCompare("level-colors",argv[0]+1) == 0)
{
char
token[MaxTextExtent];
*argv[0] == '+' ? MagickTrue : MagickFalse,exception);
break;
}
- if (LocaleCompare("linear-stretch",option) == 0)
+ if (LocaleCompare("linear-stretch",argv[0]+1) == 0)
{
double
black_point,
(void) LinearStretchImage(*image,black_point,white_point,exception);
break;
}
- if (LocaleCompare("liquid-rescale",option) == 0)
+ if (LocaleCompare("linewidth",argv[0]+1) == 0)
+ {
+ draw_info->stroke_width=InterpretLocaleValue(argv[1],
+ (char **) NULL);
+ break;
+ }
+ if (LocaleCompare("liquid-rescale",argv[0]+1) == 0)
{
/*
Liquid rescale image.
geometry.height,1.0*geometry.x,1.0*geometry.y,exception);
break;
}
- if (LocaleCompare("lowlight-color",option) == 0)
+ if (LocaleCompare("lowlight-color",argv[0]+1) == 0)
{
- (void) SetImageArtifact(*image,option,argv[1]);
+ (void) SetImageArtifact(*image,argv[0]+1,argv[1]);
break;
}
break;
}
case 'm':
{
- if (LocaleCompare("map",option) == 0)
+ if (LocaleCompare("map",argv[0]+1) == 0)
{
Image
*remap_image;
+ /*
+ Transform image colors to match this set of colors.
+ */
(void) SyncImageSettings(image_info,*image);
if (*argv[0] == '+')
break;
remap_image=DestroyImage(remap_image);
break;
}
- if (LocaleCompare("mask",option) == 0)
+ if (LocaleCompare("mask",argv[0]+1) == 0)
{
Image
*mask;
(void) SyncImageSettings(image_info,*image);
if (*argv[0] == '+')
{
+ /*
+ Remove a mask.
+ */
(void) SetImageMask(*image,(Image *) NULL,exception);
break;
}
+ /*
+ Set the image mask.
+ */
mask=GetImageCache(image_info,argv[1],exception);
if (mask == (Image *) NULL)
break;
mask=DestroyImage(mask);
break;
}
- if (LocaleCompare("matte",option) == 0)
+ if (LocaleCompare("matte",argv[0]+1) == 0)
{
- /* FUTURE: Obsoleted by -alpha not used by anything */
- (void) SetImageAlphaChannel(*image,IfSetOption ?
- SetAlphaChannel : DeactivateAlphaChannel,exception);
+ (void) SetImageAlphaChannel(*image,(*argv[0] == '-') ?
+ SetAlphaChannel : DeactivateAlphaChannel,exception);
break;
}
- if (LocaleCompare("median",option) == 0)
+ if (LocaleCompare("median",argv[0]+1) == 0)
{
+ /*
+ Median filter image.
+ */
(void) SyncImageSettings(image_info,*image);
flags=ParseGeometry(argv[1],&geometry_info);
if ((flags & SigmaValue) == 0)
geometry_info.rho,(size_t) geometry_info.sigma,exception);
break;
}
- if (LocaleCompare("mode",option) == 0)
+ if (LocaleCompare("mode",argv[0]+1) == 0)
{
/*
- Statistical Mode image
+ Mode image.
*/
(void) SyncImageSettings(image_info,*image);
flags=ParseGeometry(argv[1],&geometry_info);
geometry_info.rho,(size_t) geometry_info.sigma,exception);
break;
}
- if (LocaleCompare("modulate",option) == 0)
+ if (LocaleCompare("modulate",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
(void) ModulateImage(*image,argv[1],exception);
break;
}
- if (LocaleCompare("monitor",option) == 0)
+ if (LocaleCompare("monitor",argv[0]+1) == 0)
{
if (*argv[0] == '+')
{
(void *) NULL);
break;
}
- if (LocaleCompare("monochrome",option) == 0)
+ if (LocaleCompare("monochrome",argv[0]+1) == 0)
{
- /* A setting (for input coders) and a 'type' operation */
(void) SyncImageSettings(image_info,*image);
(void) SetImageType(*image,BilevelType,exception);
break;
}
- if (LocaleCompare("morphology",option) == 0)
+ if (LocaleCompare("morphology",argv[0]+1) == 0)
{
char
token[MaxTextExtent];
kernel=DestroyKernelInfo(kernel);
break;
}
- if (LocaleCompare("motion-blur",option) == 0)
+ if (LocaleCompare("motion-blur",argv[0]+1) == 0)
{
+ /*
+ Motion blur image.
+ */
(void) SyncImageSettings(image_info,*image);
flags=ParseGeometry(argv[1],&geometry_info);
if ((flags & SigmaValue) == 0)
}
case 'n':
{
- if (LocaleCompare("negate",option) == 0)
+ if (LocaleCompare("negate",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
(void) NegateImage(*image,*argv[0] == '+' ? MagickTrue :
MagickFalse,exception);
break;
}
- if (LocaleCompare("noise",option) == 0)
+ if (LocaleCompare("noise",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
if (*argv[0] == '-')
}
break;
}
- if (LocaleCompare("normalize",option) == 0)
+ if (LocaleCompare("normalize",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
(void) NormalizeImage(*image,exception);
}
case 'o':
{
- if (LocaleCompare("opaque",option) == 0)
+ if (LocaleCompare("opaque",argv[0]+1) == 0)
{
PixelInfo
target;
MagickFalse : MagickTrue,exception);
break;
}
- if (LocaleCompare("ordered-dither",option) == 0)
+ if (LocaleCompare("ordered-dither",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
(void) OrderedPosterizeImage(*image,argv[1],exception);
}
case 'p':
{
- if (LocaleCompare("paint",option) == 0)
+ if (LocaleCompare("paint",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
(void) ParseGeometry(argv[1],&geometry_info);
geometry_info.sigma,exception);
break;
}
- if (LocaleCompare("polaroid",option) == 0)
+ if (LocaleCompare("pen",argv[0]+1) == 0)
+ {
+ if (*argv[0] == '+')
+ {
+ (void) QueryColorCompliance("none",AllCompliance,&draw_info->fill,
+ exception);
+ break;
+ }
+ (void) QueryColorCompliance(argv[1],AllCompliance,&draw_info->fill,
+ exception);
+ break;
+ }
+ if (LocaleCompare("pointsize",argv[0]+1) == 0)
+ {
+ if (*argv[0] == '+')
+ (void) ParseGeometry("12",&geometry_info);
+ else
+ (void) ParseGeometry(argv[1],&geometry_info);
+ draw_info->pointsize=geometry_info.rho;
+ break;
+ }
+ if (LocaleCompare("polaroid",argv[0]+1) == 0)
{
double
angle;
RandomInfo
*random_info;
+ /*
+ Simulate a Polaroid picture.
+ */
(void) SyncImageSettings(image_info,*image);
random_info=AcquireRandomInfo();
angle=22.5*(GetPseudoRandomValue(random_info)-0.5);
interpolate_method,exception);
break;
}
- if (LocaleCompare("posterize",option) == 0)
+ if (LocaleCompare("posterize",argv[0]+1) == 0)
{
+ /*
+ Posterize image.
+ */
(void) SyncImageSettings(image_info,*image);
(void) PosterizeImage(*image,StringToUnsignedLong(argv[1]),
quantize_info->dither,exception);
break;
}
- if (LocaleCompare("preview",option) == 0)
+ if (LocaleCompare("preview",argv[0]+1) == 0)
{
PreviewType
- preview_type=UndefinedPreview;
+ preview_type;
+ /*
+ Preview image.
+ */
(void) SyncImageSettings(image_info,*image);
- if (IfSetOption)
+ if (*argv[0] == '+')
+ preview_type=UndefinedPreview;
+ else
preview_type=(PreviewType) ParseCommandOption(
MagickPreviewOptions,MagickFalse,argv[1]);
new_image=PreviewImage(*image,preview_type,exception);
break;
}
- if (LocaleCompare("profile",option) == 0)
+ if (LocaleCompare("profile",argv[0]+1) == 0)
{
const char
*name;
*profile_info;
(void) SyncImageSettings(image_info,*image);
- if (!IfSetOption)
+ if (*argv[0] == '+')
{
+ /*
+ Remove a profile from the image.
+ */
(void) ProfileImage(*image,argv[1],(const unsigned char *)
NULL,0,exception);
break;
}
+ /*
+ Associate a profile with the image.
+ */
profile_info=CloneImageInfo(image_info);
profile=GetImageProfile(*image,"iptc");
if (profile != (StringInfo *) NULL)
}
break;
}
+ case 'q':
+ {
+ if (LocaleCompare("quantize",argv[0]+1) == 0)
+ {
+ if (*argv[0] == '+')
+ {
+ quantize_info->colorspace=UndefinedColorspace;
+ break;
+ }
+ quantize_info->colorspace=(ColorspaceType) ParseCommandOption(
+ MagickColorspaceOptions,MagickFalse,argv[1]);
+ break;
+ }
+ break;
+ }
case 'r':
{
- if (LocaleCompare("radial-blur",option) == 0)
+ if (LocaleCompare("radial-blur",argv[0]+1) == 0)
{
/*
Radial blur image.
geometry_info.sigma,exception);
break;
}
- if (LocaleCompare("raise",option) == 0)
+ if (LocaleCompare("raise",argv[0]+1) == 0)
{
/*
Surround image with a raise of solid color.
MagickFalse,exception);
break;
}
- if (LocaleCompare("random-threshold",option) == 0)
+ if (LocaleCompare("random-threshold",argv[0]+1) == 0)
{
/*
Threshold image.
(void) RandomThresholdImage(*image,argv[1],exception);
break;
}
- if (LocaleCompare("recolor",option) == 0)
+ if (LocaleCompare("recolor",argv[0]+1) == 0)
{
KernelInfo
*kernel;
kernel=DestroyKernelInfo(kernel);
break;
}
- if (LocaleCompare("render",option) == 0)
+ if (LocaleCompare("render",argv[0]+1) == 0)
{
(void) SyncImageSettings(image_info,*image);
draw_info->render=(*argv[0] == '+') ? MagickTrue : MagickFalse;
break;
}
- if (LocaleCompare("remap",option) == 0)
+ if (LocaleCompare("remap",argv[0]+1) == 0)
{
Image
*remap_image;
remap_image=DestroyImage(remap_image);
break;
}
- if (LocaleCompare("repage",option) == 0)
+ if (LocaleCompare("repage",argv[0]+1) == 0)
{
if (*argv[0] == '+')
{
(void) ResetImagePage(*image,argv[1]);
break;
}
- if (LocaleCompare("resample",option) == 0)
+ if (LocaleCompare("resample",argv[0]+1) == 0)
{
/*
Resample image.
geometry_info.sigma,(*image)->filter,(*image)->blur,exception);
break;
}
- if (LocaleCompare("resize",option) == 0)
+ if (LocaleCompare("resize",argv[0]+1) == 0)
{
/*
Resize image.
(*image)->filter,(*image)->blur,exception);
break;
}
- if (LocaleCompare("roll",option) == 0)
+ if (LocaleCompare("roll",argv[0]+1) == 0)
{
/*
Roll image.
new_image=RollImage(*image,geometry.x,geometry.y,exception);
break;
}
- if (LocaleCompare("rotate",option) == 0)
+ if (LocaleCompare("rotate",argv[0]+1) == 0)
{
char
*geometry;
}
case 's':
{
- if (LocaleCompare("sample",option) == 0)
+ if (LocaleCompare("sample",argv[0]+1) == 0)
{
/*
Sample image with pixel replication.
exception);
break;
}
- if (LocaleCompare("scale",option) == 0)
+ if (LocaleCompare("scale",argv[0]+1) == 0)
{
/*
Resize image.
exception);
break;
}
- if (LocaleCompare("selective-blur",option) == 0)
+ if (LocaleCompare("selective-blur",argv[0]+1) == 0)
{
/*
Selectively blur pixels within a contrast threshold.
geometry_info.sigma,geometry_info.xi,geometry_info.psi,exception);
break;
}
- if (LocaleCompare("separate",option) == 0)
+ if (LocaleCompare("separate",argv[0]+1) == 0)
{
/*
Break channels into separate images.
new_image=SeparateImages(*image,exception);
break;
}
- if (LocaleCompare("sepia-tone",option) == 0)
+ if (LocaleCompare("sepia-tone",argv[0]+1) == 0)
{
double
threshold;
new_image=SepiaToneImage(*image,threshold,exception);
break;
}
- if (LocaleCompare("segment",option) == 0)
+ if (LocaleCompare("segment",argv[0]+1) == 0)
{
/*
Segment image.
exception);
break;
}
- if (LocaleCompare("set",option) == 0)
+ if (LocaleCompare("set",argv[0]+1) == 0)
{
char
*value;
value=DestroyString(value);
break;
}
- if (LocaleCompare("shade",option) == 0)
+ if (LocaleCompare("shade",argv[0]+1) == 0)
{
/*
Shade image.
MagickFalse,geometry_info.rho,geometry_info.sigma,exception);
break;
}
- if (LocaleCompare("shadow",option) == 0)
+ if (LocaleCompare("shadow",argv[0]+1) == 0)
{
/*
Shadow image.
ceil(geometry_info.psi-0.5),exception);
break;
}
- if (LocaleCompare("sharpen",option) == 0)
+ if (LocaleCompare("sharpen",argv[0]+1) == 0)
{
/*
Sharpen image.
geometry_info.sigma,geometry_info.xi,exception);
break;
}
- if (LocaleCompare("shave",option) == 0)
+ if (LocaleCompare("shave",argv[0]+1) == 0)
{
/*
Shave the image edges.
new_image=ShaveImage(*image,&geometry,exception);
break;
}
- if (LocaleCompare("shear",option) == 0)
+ if (LocaleCompare("shear",argv[0]+1) == 0)
{
/*
Shear image.
geometry_info.sigma,exception);
break;
}
- if (LocaleCompare("sigmoidal-contrast",option) == 0)
+ if (LocaleCompare("sigmoidal-contrast",argv[0]+1) == 0)
{
/*
Sigmoidal non-linearity contrast control.
exception);
break;
}
- if (LocaleCompare("sketch",option) == 0)
+ if (LocaleCompare("sketch",argv[0]+1) == 0)
{
/*
Sketch image.
geometry_info.sigma,geometry_info.xi,geometry_info.psi,exception);
break;
}
- if (LocaleCompare("solarize",option) == 0)
+ if (LocaleCompare("solarize",argv[0]+1) == 0)
{
double
threshold;
(void) SolarizeImage(*image,threshold,exception);
break;
}
- if (LocaleCompare("sparse-color",option) == 0)
+ if (LocaleCompare("sparse-color",argv[0]+1) == 0)
{
SparseColorMethod
method;
arguments=DestroyString(arguments);
break;
}
- if (LocaleCompare("splice",option) == 0)
+ if (LocaleCompare("splice",argv[0]+1) == 0)
{
/*
Splice a solid color into the image.
new_image=SpliceImage(*image,&geometry,exception);
break;
}
- if (LocaleCompare("spread",option) == 0)
+ if (LocaleCompare("spread",argv[0]+1) == 0)
{
/*
Spread an image.
interpolate_method,exception);
break;
}
- if (LocaleCompare("statistic",option) == 0)
+ if (LocaleCompare("statistic",argv[0]+1) == 0)
{
StatisticType
type;
(size_t) geometry_info.sigma,exception);
break;
}
- if (LocaleCompare("stretch",option) == 0)
+ if (LocaleCompare("stretch",argv[0]+1) == 0)
{
if (*argv[0] == '+')
{
MagickStretchOptions,MagickFalse,argv[1]);
break;
}
- if (LocaleCompare("strip",option) == 0)
+ if (LocaleCompare("strip",argv[0]+1) == 0)
{
/*
Strip image of profiles and comments.
(void) StripImage(*image,exception);
break;
}
- if (LocaleCompare("stroke",option) == 0)
+ if (LocaleCompare("stroke",argv[0]+1) == 0)
{
ExceptionInfo
*sans;
exception);
break;
}
- if (LocaleCompare("strokewidth",option) == 0)
+ if (LocaleCompare("strokewidth",argv[0]+1) == 0)
{
draw_info->stroke_width=InterpretLocaleValue(argv[1],
(char **) NULL);
break;
}
- if (LocaleCompare("style",option) == 0)
+ if (LocaleCompare("style",argv[0]+1) == 0)
{
if (*argv[0] == '+')
{
MagickFalse,argv[1]);
break;
}
- if (LocaleCompare("swirl",option) == 0)
+ if (LocaleCompare("swirl",argv[0]+1) == 0)
{
/*
Swirl image.
}
case 't':
{
- if (LocaleCompare("threshold",option) == 0)
+ if (LocaleCompare("threshold",argv[0]+1) == 0)
{
double
threshold;
(void) BilevelImage(*image,threshold,exception);
break;
}
- if (LocaleCompare("thumbnail",option) == 0)
+ if (LocaleCompare("thumbnail",argv[0]+1) == 0)
{
/*
Thumbnail image.
exception);
break;
}
- if (LocaleCompare("tint",option) == 0)
+ if (LocaleCompare("tile",argv[0]+1) == 0)
+ {
+ if (*argv[0] == '+')
+ {
+ if (draw_info->fill_pattern != (Image *) NULL)
+ draw_info->fill_pattern=DestroyImage(draw_info->fill_pattern);
+ break;
+ }
+ draw_info->fill_pattern=GetImageCache(image_info,argv[1],
+ exception);
+ break;
+ }
+ if (LocaleCompare("tint",argv[0]+1) == 0)
{
/*
Tint the image.
new_image=TintImage(*image,argv[1],&fill,exception);
break;
}
- if (LocaleCompare("transform",option) == 0)
+ if (LocaleCompare("transform",argv[0]+1) == 0)
{
/*
Affine transform image.
exception);
break;
}
- if (LocaleCompare("transparent",option) == 0)
+ if (LocaleCompare("transparent",argv[0]+1) == 0)
{
PixelInfo
target;
exception);
break;
}
- if (LocaleCompare("transpose",option) == 0)
+ if (LocaleCompare("transpose",argv[0]+1) == 0)
{
/*
Transpose image scanlines.
new_image=TransposeImage(*image,exception);
break;
}
- if (LocaleCompare("transverse",option) == 0)
+ if (LocaleCompare("transverse",argv[0]+1) == 0)
{
/*
Transverse image scanlines.
new_image=TransverseImage(*image,exception);
break;
}
- if (LocaleCompare("treedepth",option) == 0)
+ if (LocaleCompare("treedepth",argv[0]+1) == 0)
{
quantize_info->tree_depth=StringToUnsignedLong(argv[1]);
break;
}
- if (LocaleCompare("trim",option) == 0)
+ if (LocaleCompare("trim",argv[0]+1) == 0)
{
/*
Trim image.
new_image=TrimImage(*image,exception);
break;
}
- if (LocaleCompare("type",option) == 0)
+ if (LocaleCompare("type",argv[0]+1) == 0)
{
ImageType
type;
}
case 'u':
{
- if (LocaleCompare("undercolor",option) == 0)
+ if (LocaleCompare("undercolor",argv[0]+1) == 0)
{
(void) QueryColorCompliance(argv[1],AllCompliance,&draw_info->undercolor,
exception);
break;
}
- if (LocaleCompare("unique",option) == 0)
+ if (LocaleCompare("unique",argv[0]+1) == 0)
{
if (*argv[0] == '+')
{
(void) SetImageArtifact(*image,"verbose","true");
break;
}
- if (LocaleCompare("unique-colors",option) == 0)
+ if (LocaleCompare("unique-colors",argv[0]+1) == 0)
{
/*
Unique image colors.
new_image=UniqueImageColors(*image,exception);
break;
}
- if (LocaleCompare("unsharp",option) == 0)
+ if (LocaleCompare("unsharp",argv[0]+1) == 0)
{
/*
Unsharp mask image.
}
case 'v':
{
- if (LocaleCompare("verbose",option) == 0)
+ if (LocaleCompare("verbose",argv[0]+1) == 0)
{
- (void) SetImageArtifact(*image,option,
+ (void) SetImageArtifact(*image,argv[0]+1,
*argv[0] == '+' ? "false" : "true");
break;
}
- if (LocaleCompare("vignette",option) == 0)
+ if (LocaleCompare("vignette",argv[0]+1) == 0)
{
/*
Vignette image.
ceil(geometry_info.psi-0.5),exception);
break;
}
- if (LocaleCompare("virtual-pixel",option) == 0)
+ if (LocaleCompare("virtual-pixel",argv[0]+1) == 0)
{
if (*argv[0] == '+')
{
}
case 'w':
{
- if (LocaleCompare("wave",option) == 0)
+ if (LocaleCompare("wave",argv[0]+1) == 0)
{
/*
Wave image.
geometry_info.sigma,interpolate_method,exception);
break;
}
- if (LocaleCompare("weight",option) == 0)
+ if (LocaleCompare("weight",argv[0]+1) == 0)
{
draw_info->weight=StringToUnsignedLong(argv[1]);
if (LocaleCompare(argv[1],"all") == 0)
draw_info->weight=400;
break;
}
- if (LocaleCompare("white-threshold",option) == 0)
+ if (LocaleCompare("white-threshold",argv[0]+1) == 0)
{
+ /*
+ White threshold image.
+ */
(void) SyncImageSettings(image_info,*image);
(void) WhiteThresholdImage(*image,argv[1],exception);
break;