From 2e4501b56bdc589397786ecc59f8c2d206547a36 Mon Sep 17 00:00:00 2001 From: anthony Date: Fri, 30 Mar 2012 04:41:54 +0000 Subject: [PATCH] --- MagickWand/animate.c | 4 +- MagickWand/display.c | 4 +- MagickWand/import.c | 14 +- MagickWand/mogrify.c | 13 +- MagickWand/operation.c | 321 ++++++++++++++++++++--------------------- 5 files changed, 178 insertions(+), 178 deletions(-) diff --git a/MagickWand/animate.c b/MagickWand/animate.c index b84281f05..f67725f90 100644 --- a/MagickWand/animate.c +++ b/MagickWand/animate.c @@ -386,10 +386,10 @@ WandExport MagickBooleanType AnimateImageCommand(ImageInfo *image_info, ParseCommandOption(MagickInterlaceOptions,MagickFalse,resource_value); resource_value=XGetResourceInstance(resource_database,GetClientName(), "verbose","False"); - image_info->verbose=IsMagickTrue(resource_value); + image_info->verbose=IsStringTrue(resource_value); resource_value=XGetResourceInstance(resource_database,GetClientName(), "dither","True"); - quantize_info->dither=IsMagickTrue(resource_value); + quantize_info->dither=IsStringTrue(resource_value); /* Parse command line. */ diff --git a/MagickWand/display.c b/MagickWand/display.c index 8871d3d47..427a8a4f2 100644 --- a/MagickWand/display.c +++ b/MagickWand/display.c @@ -448,10 +448,10 @@ WandExport MagickBooleanType DisplayImageCommand(ImageInfo *image_info, image_info->quality=StringToUnsignedLong(resource_value); resource_value=XGetResourceInstance(resource_database,GetClientName(), "verbose","False"); - image_info->verbose=IsMagickTrue(resource_value); + image_info->verbose=IsStringTrue(resource_value); resource_value=XGetResourceInstance(resource_database,GetClientName(), "dither","True"); - quantize_info->dither=IsMagickTrue(resource_value); + quantize_info->dither=IsStringTrue(resource_value); /* Parse command line. */ diff --git a/MagickWand/import.c b/MagickWand/import.c index 2574a9867..078986b1b 100644 --- a/MagickWand/import.c +++ b/MagickWand/import.c @@ -374,7 +374,7 @@ WandExport MagickBooleanType ImportImageCommand(ImageInfo *image_info, quantize_info=resource_info.quantize_info; resource_value=XGetResourceInstance(resource_database,GetClientName(), "border","False"); - ximage_info.borders=IsMagickTrue(resource_value); + ximage_info.borders=IsStringTrue(resource_value); resource_value=XGetResourceInstance(resource_database,GetClientName(), "delay","0"); resource_info.delay=(unsigned int) StringToUnsignedLong(resource_value); @@ -382,10 +382,10 @@ WandExport MagickBooleanType ImportImageCommand(ImageInfo *image_info, "density",(char *) NULL); resource_value=XGetResourceInstance(resource_database,GetClientName(), "descend","True"); - ximage_info.descend=IsMagickTrue(resource_value); + ximage_info.descend=IsStringTrue(resource_value); resource_value=XGetResourceInstance(resource_database,GetClientName(), "frame","False"); - ximage_info.frame=IsMagickTrue(resource_value); + ximage_info.frame=IsStringTrue(resource_value); resource_value=XGetResourceInstance(resource_database,GetClientName(), "interlace","none"); image_info->interlace=UndefinedInterlace; @@ -410,16 +410,16 @@ WandExport MagickBooleanType ImportImageCommand(ImageInfo *image_info, image_info->quality=StringToUnsignedLong(resource_value); resource_value=XGetResourceInstance(resource_database,GetClientName(), "screen","False"); - ximage_info.screen=IsMagickTrue(resource_value); + ximage_info.screen=IsStringTrue(resource_value); resource_value=XGetResourceInstance(resource_database,GetClientName(), "silent","False"); - ximage_info.silent=IsMagickTrue(resource_value); + ximage_info.silent=IsStringTrue(resource_value); resource_value=XGetResourceInstance(resource_database,GetClientName(), "verbose","False"); - image_info->verbose=IsMagickTrue(resource_value); + image_info->verbose=IsStringTrue(resource_value); resource_value=XGetResourceInstance(resource_database,GetClientName(), "dither","True"); - quantize_info->dither=IsMagickTrue(resource_value); + quantize_info->dither=IsStringTrue(resource_value); snapshots=1; status=MagickTrue; filename=(char *) NULL; diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c index ad3cc1e70..1ff0219ae 100644 --- a/MagickWand/mogrify.c +++ b/MagickWand/mogrify.c @@ -7422,6 +7422,12 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info, RectangleInfo geometry; + clip_to_self=IsStringTrue(GetImageOption(mogrify_info, + "compose:clip-to-self")); + value=GetImageOption(mogrify_info,"compose:outside-overlay"); + if (value != (const char *) NULL) + clip_to_self=IsFalse(IsStringTrue(value)); + (void) SyncImagesSettings(mogrify_info,*images,exception); image=RemoveFirstImageFromList(images); composite_image=RemoveFirstImageFromList(images); @@ -7459,13 +7465,8 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info, mask_image=DestroyImage(mask_image); } } - clip_to_self=MagickFalse; - value=GetImageArtifact(composite_image,"compose:outside-overlay"); - if (value != (const char *) NULL) - clip_to_self=IsMagickTrue(value) == MagickFalse ? MagickTrue : - MagickFalse; (void) CompositeImage(image,composite_image,image->compose, - clip_to_self,geometry.x,geometry.y,exception); + clip_to_self,geometry.x,geometry.y,exception); (void) SetImageMask(image,(Image *) NULL,exception); composite_image=DestroyImage(composite_image); *images=DestroyImageList(*images); diff --git a/MagickWand/operation.c b/MagickWand/operation.c index 7d972ea64..7187505b3 100644 --- a/MagickWand/operation.c +++ b/MagickWand/operation.c @@ -188,7 +188,7 @@ static Image *SparseColorOption(const Image *image, assert(image != (Image *) NULL); assert(image->signature == MagickSignature); - if (image->debug != MagickFalse) + if (IfTrue(image->debug)) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickSignature); @@ -206,7 +206,7 @@ static Image *SparseColorOption(const Image *image, (image->colorspace == CMYKColorspace)) number_colors++; if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) && - (image->matte != MagickFalse)) + IfTrue(image->matte)) number_colors++; /* @@ -223,11 +223,10 @@ static Image *SparseColorOption(const Image *image, else x++; /* floating point argument */ } - error=MagickTrue; /* control points and color values */ - error = ( x % (2+number_colors) != 0 ) ? MagickTrue : MagickFalse; + error = IsTrue( x % (2+number_colors) ); number_arguments=x; - if ( error ) { + if ( IfTrue(error) ) { (void) ThrowMagickException(exception,GetMagickModule(), OptionError, "InvalidArgument", "'%s': %s", "sparse-color", "Invalid number of Arguments"); @@ -286,7 +285,7 @@ static Image *SparseColorOption(const Image *image, (image->colorspace == CMYKColorspace)) sparse_arguments[x++] = QuantumScale*color.black; if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) && - (image->matte != MagickFalse)) + IfTrue(image->matte)) sparse_arguments[x++] = QuantumScale*color.alpha; } else { @@ -326,7 +325,7 @@ static Image *SparseColorOption(const Image *image, token[0] = ','; /* used this token - get another */ } if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) && - (image->matte != MagickFalse)) + IfTrue(image->matte)) { while ( token[0] == ',' ) GetMagickToken(p,&p,token); if ( token[0] == '\0' || isalpha((int)token[0]) || token[0] == '#' ) @@ -429,7 +428,7 @@ WandExport MagickCLI *AcquireMagickCLI(ImageInfo *image_info, cli_wand->column=0; cli_wand->signature=WandSignature; - if (cli_wand->wand.debug != MagickFalse) + if (IfTrue(cli_wand->wand.debug)) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",cli_wand->wand.name); return(cli_wand); } @@ -462,7 +461,7 @@ WandExport MagickCLI *DestroyMagickCLI(MagickCLI *cli_wand) assert(cli_wand != (MagickCLI *) NULL); assert(cli_wand->signature == WandSignature); assert(cli_wand->wand.signature == WandSignature); - if (cli_wand->wand.debug != MagickFalse) + if (IfTrue(cli_wand->wand.debug)) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",cli_wand->wand.name); /* Destroy CLI part of MagickCLI */ @@ -533,17 +532,15 @@ WandExport MagickBooleanType CLICatchException(MagickCLI *cli_wand, assert(cli_wand != (MagickCLI *) NULL); assert(cli_wand->signature == WandSignature); assert(cli_wand->wand.signature == WandSignature); - if (cli_wand->wand.debug != MagickFalse) + if (IfTrue(cli_wand->wand.debug)) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",cli_wand->wand.name); // FUTURE: '-regard_warning' should make this more sensitive. // Note pipelined options may like more control over this level - status = MagickFalse; - if (cli_wand->wand.exception->severity > ErrorException) - status = MagickTrue; + status = IsTrue(cli_wand->wand.exception->severity > ErrorException); - if ( status == MagickFalse || all_exceptions != MagickFalse ) + if ( IfFalse(status) || IfTrue(all_exceptions) ) CatchException(cli_wand->wand.exception); /* output and clear exceptions */ return(status); @@ -614,16 +611,16 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, assert(cli_wand != (MagickCLI *) NULL); assert(cli_wand->signature == WandSignature); assert(cli_wand->wand.signature == WandSignature); - if (cli_wand->wand.debug != MagickFalse) + if (IfTrue(cli_wand->wand.debug)) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",cli_wand->wand.name); -#define _image_info (cli_wand->wand.image_info) -#define _exception (cli_wand->wand.exception) -#define _draw_info (cli_wand->draw_info) -#define _quantize_info (cli_wand->quantize_info) +#define _image_info (cli_wand->wand.image_info) +#define _exception (cli_wand->wand.exception) +#define _draw_info (cli_wand->draw_info) +#define _quantize_info (cli_wand->quantize_info) #define IfSetOption (*option=='-') -#define ArgBoolean (IfSetOption?MagickTrue:MagickFalse) -#define ArgBooleanNot (IfSetOption?MagickFalse:MagickTrue) +#define ArgBoolean IsTrue(IfSetOption) +#define ArgBooleanNot IsFalse(IfSetOption) #define ArgBooleanString (IfSetOption?"true":"false") #define ArgOption(def) (IfSetOption?arg1:(const char *)(def)) @@ -654,7 +651,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, } if (LocaleCompare("attenuate",option+1) == 0) { - if (IfSetOption && IsGeometry(arg1) == MagickFalse) + if (IfSetOption && IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) SetImageOption(_image_info,option+1,ArgOption("1.0")); break; @@ -695,7 +692,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, SyncImageSettings() used to set per-image attribute. */ - if (IfSetOption && IsGeometry(arg1) == MagickFalse) + if (IfSetOption && IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) SetImageOption(_image_info,"convolve:bias",ArgOption(NULL)); break; @@ -715,7 +712,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, SyncImageSettings() used to set per-image attribute. */ arg1=ArgOption("0.0"); - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) SetImageOption(_image_info,option+1,arg1); break; @@ -757,7 +754,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, MagickSizeType limit; - if (IfSetOption && IsGeometry(arg1) == MagickFalse) + if (IfSetOption && IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); limit=MagickResourceInfinity; if (LocaleCompare("unlimited",arg1) != 0) @@ -870,7 +867,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, /* DefineImageOption() equals SetImageOption() but with '=' */ if (IfSetOption) (void) DefineImageOption(_image_info,arg1); - else if ( DeleteImageOption(_image_info,arg1) == MagickFalse ) + else if (IsFalse(DeleteImageOption(_image_info,arg1))) CLIWandExceptArgBreak(OptionError,"NoSuchOption",option,arg1); break; } @@ -880,7 +877,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, FUTURE: Option should also be used for "-morph" (color morphing) */ arg1=ArgOption("0"); - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) SetImageOption(_image_info,option+1,arg1); break; @@ -892,7 +889,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, SyncImageSettings() used to set per-image attribute. */ - if (IfSetOption && IsGeometry(arg1) == MagickFalse) + if (IfSetOption && IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) SetImageOption(_image_info,option+1,ArgOption(NULL)); (void) CloneString(&_image_info->density,ArgOption(NULL)); @@ -904,7 +901,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, /* This is also a SimpleImageOperator! for 8->16 vaule trunc !!!! SyncImageSettings() used to set per-image attribute. */ - if (IfSetOption && IsGeometry(arg1) == MagickFalse) + if (IfSetOption && IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); _image_info->depth=IfSetOption?StringToUnsignedLong(arg1) :MAGICKCORE_QUANTUM_DEPTH; @@ -1016,7 +1013,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, status=QueryColorCompliance(arg1,AllCompliance,&color,sans); sans=DestroyExceptionInfo(sans); - if (status == MagickFalse) + if (IfFalse(status)) _draw_info->fill_pattern=GetImageCache(_image_info,arg1,_exception); else _draw_info->fill=color; @@ -1063,7 +1060,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, remove direct sttribute from image_info */ arg1=ArgOption("0"); - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); _image_info->fuzz=StringToDoubleInterval(arg1,(double) QuantumRange+1.0); @@ -1093,7 +1090,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, Used directly by many coders */ arg1=ArgOption("0.0"); - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) SetImageOption(_image_info,option+1,arg1); break; @@ -1132,7 +1129,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, } if (LocaleCompare("interline-spacing",option+1) == 0) { - if (IfSetOption && IsGeometry(arg1) == MagickFalse) + if (IfSetOption && IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) SetImageOption(_image_info,option+1, ArgOption(NULL)); _draw_info->interline_spacing=StringToDouble(ArgOption("0"), @@ -1152,7 +1149,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, } if (LocaleCompare("interword-spacing",option+1) == 0) { - if (IfSetOption && IsGeometry(arg1) == MagickFalse) + if (IfSetOption && IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) SetImageOption(_image_info,option+1, ArgOption(NULL)); _draw_info->interword_spacing=StringToDouble(ArgOption("0"),(char **) NULL); @@ -1164,7 +1161,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, { if (LocaleCompare("kerning",option+1) == 0) { - if (IfSetOption && IsGeometry(arg1) == MagickFalse) + if (IfSetOption && IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) SetImageOption(_image_info,option+1,ArgOption(NULL)); _draw_info->kerning=StringToDouble(ArgOption("0"),(char **) NULL); @@ -1193,7 +1190,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, { /* SyncImageSettings() used to set per-image attribute. */ arg1=ArgOption("0"); - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) SetImageOption(_image_info,option+1,arg1); break; @@ -1299,7 +1296,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, if (LocaleCompare("pointsize",option+1) == 0) { if (IfSetOption) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); _image_info->pointsize = _draw_info->pointsize = @@ -1314,7 +1311,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, if (LocaleCompare("precision",option+1) == 0) { arg1=ArgOption("-1"); - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) SetMagickPrecision(StringToInteger(arg1)); break; @@ -1336,7 +1333,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, { if (LocaleCompare("quality",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); _image_info->quality= IfSetOption ? StringToUnsignedLong(arg1) : UNDEFINED_COMPRESSION_QUALITY; @@ -1382,7 +1379,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, SyncImageSettings() used to set per-image attribute. */ arg1=ArgOption("0.0"); - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) SetImageOption(_image_info,option+1,arg1); break; @@ -1400,7 +1397,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, if (LocaleCompare("sampling-factor",option+1) == 0) { /* FUTURE: should be converted to jpeg:sampling_factor */ - if (IfSetOption && IsGeometry(arg1) == MagickFalse) + if (IfSetOption && IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) CloneString(&_image_info->sampling_factor,ArgOption(NULL)); break; @@ -1410,7 +1407,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, /* SyncImageSettings() used to set this as a per-image attribute. What ??? Why ???? */ - if (IfSetOption && IsGeometry(arg1) == MagickFalse) + if (IfSetOption && IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) SetImageOption(_image_info,option+1,ArgOption(NULL)); _image_info->scene=StringToUnsignedLong(ArgOption("0")); @@ -1418,7 +1415,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, } if (LocaleCompare("seed",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); SeedPseudoRandomGenerator( IfSetOption ? (size_t) StringToUnsignedLong(arg1) @@ -1468,7 +1465,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, status=QueryColorCompliance(arg1,AllCompliance,&color,sans); sans=DestroyExceptionInfo(sans); - if (status == MagickFalse) + if (IfFalse(status)) _draw_info->stroke_pattern=GetImageCache(_image_info,arg1,_exception); else _draw_info->stroke=color; @@ -1476,7 +1473,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, } if (LocaleCompare("strokewidth",option+1) == 0) { - if (IfSetOption && IsGeometry(arg1) == MagickFalse) + if (IfSetOption && IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) SetImageOption(_image_info,option+1,ArgOption(NULL)); _draw_info->stroke_width=StringToDouble(ArgOption("1.0"), @@ -1528,7 +1525,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, { /* SyncImageSettings() used to set per-image attribute. ??? */ arg1=ArgOption("0"); - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) SetImageOption(_image_info,option+1,arg1); break; @@ -1542,7 +1539,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, Note that +transparent-color, means fall-back to image attribute so ImageOption is deleted, not set to a default. */ - if (IfSetOption && IsGeometry(arg1) == MagickFalse) + if (IfSetOption && IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) SetImageOption(_image_info,option+1,ArgOption(NULL)); (void) QueryColorCompliance(ArgOption("none"),AllCompliance, @@ -1660,7 +1657,7 @@ WandExport void CLISettingOptionInfo(MagickCLI *cli_wand, SyncImageSettings() used to set per-image attribute. */ arg1=ArgOption("0.0"); - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) SetImageOption(_image_info,option+1,arg1); break; @@ -1776,21 +1773,21 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, ssize_t parse; -#define _image_info (cli_wand->wand.image_info) -#define _image (cli_wand->wand.images) -#define _exception (cli_wand->wand.exception) -#define _draw_info (cli_wand->draw_info) -#define _quantize_info (cli_wand->quantize_info) +#define _image_info (cli_wand->wand.image_info) +#define _image (cli_wand->wand.images) +#define _exception (cli_wand->wand.exception) +#define _draw_info (cli_wand->draw_info) +#define _quantize_info (cli_wand->quantize_info) #define IfNormalOp (*option=='-') #define IfPlusOp (*option!='-') -#define normal_op (IfNormalOp?MagickTrue:MagickFalse) -#define plus_alt_op (IfNormalOp?MagickFalse:MagickTrue) +#define normal_op IsTrue(IfNormalOp) +#define plus_alt_op IsFalse(IfNormalOp) assert(cli_wand != (MagickCLI *) NULL); assert(cli_wand->signature == WandSignature); assert(cli_wand->wand.signature == WandSignature); assert(_image != (Image *) NULL); /* an image must be present */ - if (cli_wand->wand.debug != MagickFalse) + if (IfTrue(cli_wand->wand.debug)) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",cli_wand->wand.name); (void) SyncImageSettings(_image_info,_image,_exception); @@ -1808,7 +1805,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, { if (LocaleCompare("adaptive-blur",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); if ((flags & SigmaValue) == 0) @@ -1820,7 +1817,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, if (LocaleCompare("adaptive-resize",option+1) == 0) { /* FUTURE: Roll into a resize special operator */ - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) ParseRegionGeometry(_image,arg1,&geometry,_exception); new_image=AdaptiveResizeImage(_image,geometry.width,geometry.height, @@ -1829,7 +1826,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("adaptive-sharpen",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); if ((flags & SigmaValue) == 0) @@ -1854,7 +1851,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, *text, geometry[MaxTextExtent]; - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); SetGeometryInfo(&geometry_info); flags=ParseGeometry(arg1,&geometry_info); @@ -1944,7 +1941,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, { if (LocaleCompare("black-threshold",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) BlackThresholdImage(_image,arg1,_exception); break; @@ -1953,7 +1950,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, { geometry_info.rho=1.5; if (IfNormalOp) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); } @@ -1962,7 +1959,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("blur",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); if ((flags & SigmaValue) == 0) @@ -1979,7 +1976,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, const char* value; - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); value=GetImageOption(_image_info,"compose"); @@ -2007,7 +2004,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, MagickStatusType flags; - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); brightness=geometry_info.rho; @@ -2039,7 +2036,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("charcoal",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); if ((flags & SigmaValue) == 0) @@ -2052,7 +2049,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("chop",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) ParseGravityGeometry(_image,arg1,&geometry,_exception); new_image=ChopImage(_image,&geometry,_exception); @@ -2096,8 +2093,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, mask_image=GetImageCache(_image_info,arg1,_exception); if (mask_image == (Image *) NULL) break; - if (SetImageStorageClass(mask_image,DirectClass,_exception) - == MagickFalse) + if (IfFalse(SetImageStorageClass(mask_image,DirectClass,_exception))) break; /* Create a write mask from cli_wand mask image */ /* FUTURE: use Alpha operations instead and create a Grey Image */ @@ -2110,14 +2106,14 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, break; for (x=0; x < (ssize_t) mask_image->columns; x++) { - if (mask_image->matte == MagickFalse) + if (IfFalse(mask_image->matte)) SetPixelAlpha(mask_image,GetPixelIntensity(mask_image,q),q); SetPixelRed(mask_image,GetPixelAlpha(mask_image,q),q); SetPixelGreen(mask_image,GetPixelAlpha(mask_image,q),q); SetPixelBlue(mask_image,GetPixelAlpha(mask_image,q),q); q+=GetPixelChannels(mask_image); } - if (SyncCacheViewAuthenticPixels(mask_view,_exception) == MagickFalse) + if (IfFalse(SyncCacheViewAuthenticPixels(mask_view,_exception))) break; } /* clean up and set the write mask */ @@ -2134,7 +2130,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("colorize",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); new_image=ColorizeImage(_image,arg1,&_draw_info->fill,_exception); break; @@ -2198,7 +2194,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, MagickStatusType flags; - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); black_point=geometry_info.rho; @@ -2230,14 +2226,14 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, if (LocaleCompare("crop",option+1) == 0) { /* WARNING: This can generate multiple images! */ - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); new_image=CropImageToTiles(_image,arg1,_exception); break; } if (LocaleCompare("cycle",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) CycleColormapImage(_image,(ssize_t) StringToLong(arg1), _exception); @@ -2279,7 +2275,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, threshold; if (IfNormalOp) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); threshold=StringToDoubleInterval(arg1,(double) QuantumRange+1.0); } @@ -2323,7 +2319,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, ** Convert that to an appropriate distortion argument array. ** FUTURE: make a separate special resize operator Roll into a resize special operator */ - if (IsGeometry(arg2) == MagickFalse) + if (IfFalse(IsGeometry(arg2))) CLIWandExceptArgBreak(OptionError,"InvalidGeometry", option,arg2); (void) ParseRegionGeometry(_image,arg2,&geometry,_exception); @@ -2384,7 +2380,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, { if (LocaleCompare("edge",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); if ((flags & SigmaValue) == 0) @@ -2395,7 +2391,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("emboss",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); if ((flags & SigmaValue) == 0) @@ -2436,7 +2432,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, if ( parse < 0 ) CLIWandExceptArgBreak(OptionError,"UnrecognizedEvaluateOperator", option,arg1); - if (IsGeometry(arg2) == MagickFalse) + if (IfFalse(IsGeometry(arg2))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg2); constant=StringToDoubleInterval(arg2,(double) QuantumRange+1.0); (void) EvaluateImage(_image,(MagickEvaluateOperator)parse,constant, @@ -2445,7 +2441,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("extent",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGravityGeometry(_image,arg1,&geometry,_exception); if (geometry.width == 0) @@ -2485,7 +2481,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, PixelInfo target; - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) ParsePageGeometry(_image,arg1,&geometry,_exception); (void) QueryColorCompliance(arg2,AllCompliance,&target,_exception); @@ -2511,7 +2507,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, else compose=OverCompositeOp; /* use Over not _image->compose */ - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParsePageGeometry(_image,arg1,&geometry,_exception); frame_info.width=geometry.width; @@ -2591,7 +2587,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, { if (LocaleCompare("gamma",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); if (IfNormalOp) (void) GammaImage(_image,StringToDouble(arg1,(char **) NULL), @@ -2603,7 +2599,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, if ((LocaleCompare("gaussian-blur",option+1) == 0) || (LocaleCompare("gaussian",option+1) == 0)) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); if ((flags & SigmaValue) == 0) @@ -2626,7 +2622,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, _image->geometry=DestroyString(_image->geometry); break; } - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseRegionGeometry(_image,arg1,&geometry,_exception); if (((flags & XValue) != 0) || ((flags & YValue) != 0)) @@ -2672,7 +2668,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("implode",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) ParseGeometry(arg1,&geometry_info); new_image=ImplodeImage(_image,geometry_info.rho, @@ -2683,7 +2679,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, { /* FUTURE: New to IMv7 Roll into a resize special operator */ - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) ParseRegionGeometry(_image,arg1,&geometry,_exception); new_image=InterpolativeResizeImage(_image,geometry.width, @@ -2696,7 +2692,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, { if (LocaleCompare("lat",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); if ((flags & PercentValue) != 0) @@ -2716,7 +2712,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, MagickStatusType flags; - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); black_point=geometry_info.rho; @@ -2787,7 +2783,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, MagickStatusType flags; - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); black_point=geometry_info.rho; @@ -2808,7 +2804,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, if (LocaleCompare("liquid-rescale",option+1) == 0) { /* FUTURE: Roll into a resize special operator */ - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseRegionGeometry(_image,arg1,&geometry,_exception); if ((flags & XValue) == 0) @@ -2869,14 +2865,14 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, if (LocaleCompare("median",option+1) == 0) { /* DEPRECIATED - use -statistic Median */ - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); CLISimpleOperatorImage(cli_wand,"-statistic","Median",arg1); break; } if (LocaleCompare("mode",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); if ((flags & SigmaValue) == 0) @@ -2887,7 +2883,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("modulate",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) ModulateImage(_image,arg1,_exception); break; @@ -2940,7 +2936,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("motion-blur",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); if ((flags & SigmaValue) == 0) @@ -2962,7 +2958,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, { if (IfNormalOp) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); if ((flags & SigmaValue) == 0) @@ -3045,7 +3041,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, random_info=DestroyRandomInfo(random_info); } else { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); angle=geometry_info.rho; @@ -3057,7 +3053,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("posterize",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) ParseGeometry(arg1,&geometry_info); (void) PosterizeImage(_image,(size_t) geometry_info.rho, @@ -3142,7 +3138,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, { if (LocaleCompare("radial-blur",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); new_image=RadialBlurImage(_image,geometry_info.rho,_exception); @@ -3150,7 +3146,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("raise",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParsePageGeometry(_image,arg1,&geometry,_exception); if ((flags & SigmaValue) == 0) @@ -3160,7 +3156,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("random-threshold",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) RandomThresholdImage(_image,arg1,_exception); break; @@ -3181,7 +3177,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, { if (IfNormalOp) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option, arg1); (void) ResetImagePage(_image,arg1); @@ -3193,7 +3189,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, if (LocaleCompare("resample",option+1) == 0) { /* FUTURE: Roll into a resize special operation */ - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); if ((flags & SigmaValue) == 0) @@ -3204,7 +3200,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("resize",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) ParseRegionGeometry(_image,arg1,&geometry,_exception); new_image=ResizeImage(_image,geometry.width,geometry.height, @@ -3213,7 +3209,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("roll",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) ParsePageGeometry(_image,arg1,&geometry,_exception); new_image=RollImage(_image,geometry.x,geometry.y,_exception); @@ -3221,7 +3217,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("rotate",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); if (strchr(arg1,'>') != (char *) NULL) if (_image->columns <= _image->rows) @@ -3240,7 +3236,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, if (LocaleCompare("sample",option+1) == 0) { /* FUTURE: Roll into a resize special operator */ - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) ParseRegionGeometry(_image,arg1,&geometry,_exception); new_image=SampleImage(_image,geometry.width,geometry.height, @@ -3250,7 +3246,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, if (LocaleCompare("scale",option+1) == 0) { /* FUTURE: Roll into a resize special operator */ - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) ParseRegionGeometry(_image,arg1,&geometry,_exception); new_image=ScaleImage(_image,geometry.width,geometry.height, @@ -3259,7 +3255,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("segment",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); if ((flags & SigmaValue) == 0) @@ -3271,7 +3267,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("selective-blur",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); if ((flags & PercentValue) != 0) @@ -3289,7 +3285,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("sepia-tone",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); new_image=SepiaToneImage(_image,StringToDoubleInterval(arg1, (double) QuantumRange+1.0),_exception); @@ -3331,7 +3327,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("shade",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); if ((flags & SigmaValue) == 0) @@ -3342,7 +3338,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("shadow",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); if ((flags & SigmaValue) == 0) @@ -3358,7 +3354,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("sharpen",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); if ((flags & SigmaValue) == 0) @@ -3371,7 +3367,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("shave",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParsePageGeometry(_image,arg1,&geometry,_exception); new_image=ShaveImage(_image,&geometry,_exception); @@ -3379,7 +3375,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("shear",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); if ((flags & SigmaValue) == 0) @@ -3390,7 +3386,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("sigmoidal-contrast",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); if ((flags & SigmaValue) == 0) @@ -3405,7 +3401,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("sketch",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); if ((flags & SigmaValue) == 0) @@ -3416,7 +3412,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("solarize",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) SolarizeImage(_image,StringToDoubleInterval(arg1,(double) QuantumRange+1.0),_exception); @@ -3441,7 +3437,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("splice",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) ParseGravityGeometry(_image,arg1,&geometry,_exception); new_image=SpliceImage(_image,&geometry,_exception); @@ -3449,7 +3445,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("spread",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) ParseGeometry(arg1,&geometry_info); new_image=SpreadImage(_image,geometry_info.rho,_image->interpolate, @@ -3462,7 +3458,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, if ( parse < 0 ) CLIWandExceptArgBreak(OptionError,"UnrecognizedStatisticType", option,arg1); - if (IsGeometry(arg2) == MagickFalse) + if (IfFalse(IsGeometry(arg2))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg2); (void) ParseGeometry(arg2,&geometry_info); new_image=StatisticImage(_image,(StatisticType)parse, @@ -3477,7 +3473,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("swirl",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) ParseGeometry(arg1,&geometry_info); new_image=SwirlImage(_image,geometry_info.rho, @@ -3495,7 +3491,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, threshold=(double) QuantumRange/2; if (normal_op) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); threshold=StringToDoubleInterval(arg1,(double) QuantumRange+1.0); } @@ -3504,7 +3500,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("thumbnail",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) ParseRegionGeometry(_image,arg1,&geometry,_exception); new_image=ThumbnailImage(_image,geometry.width,geometry.height, @@ -3513,7 +3509,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("tint",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); new_image=TintImage(_image,arg1,&_draw_info->fill,_exception); break; @@ -3580,7 +3576,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("unsharp",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); if ((flags & SigmaValue) == 0) @@ -3609,7 +3605,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("vignette",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); if ((flags & SigmaValue) == 0) @@ -3629,7 +3625,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, { if (LocaleCompare("wave",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); flags=ParseGeometry(arg1,&geometry_info); if ((flags & SigmaValue) == 0) @@ -3640,7 +3636,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("white-threshold",option+1) == 0) { - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); (void) WhiteThresholdImage(_image,arg1,_exception); break; @@ -3680,7 +3676,7 @@ WandExport void CLISimpleOperatorImages(MagickCLI *cli_wand, assert(cli_wand->signature == WandSignature); assert(cli_wand->wand.signature == WandSignature); assert(cli_wand->wand.images != (Image *) NULL); /* images must be present */ - if (cli_wand->wand.debug != MagickFalse) + if (IfTrue(cli_wand->wand.debug)) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",cli_wand->wand.name); #if !USE_WAND_METHODS @@ -3699,7 +3695,7 @@ WandExport void CLISimpleOperatorImages(MagickCLI *cli_wand, cli_wand->wand.images=GetFirstImageInList(cli_wand->wand.images); #else MagickResetIterator(&cli_wand->wand); - while ( MagickNextImage(&cli_wand->wand) != MagickFalse ) + while ( IfTrue(MagickNextImage(&cli_wand->wand)) ) CLISimpleOperatorImage(cli_wand, option, arg1, arg2); MagickResetIterator(&cli_wand->wand); #endif @@ -3767,20 +3763,20 @@ WandExport void CLIListOperatorImages(MagickCLI *cli_wand, Image *new_images; -#define _image_info (cli_wand->wand.image_info) -#define _images (cli_wand->wand.images) -#define _exception (cli_wand->wand.exception) -#define _draw_info (cli_wand->draw_info) -#define _quantize_info (cli_wand->quantize_info) +#define _image_info (cli_wand->wand.image_info) +#define _images (cli_wand->wand.images) +#define _exception (cli_wand->wand.exception) +#define _draw_info (cli_wand->draw_info) +#define _quantize_info (cli_wand->quantize_info) #define IfNormalOp (*option=='-') #define IfPlusOp (*option!='-') -#define normal_op (IfNormalOp?MagickTrue:MagickFalse) +#define normal_op IsTrue(IfNormalOp) assert(cli_wand != (MagickCLI *) NULL); assert(cli_wand->signature == WandSignature); assert(cli_wand->wand.signature == WandSignature); assert(_images != (Image *) NULL); /* _images must be present */ - if (cli_wand->wand.debug != MagickFalse) + if (IfTrue(cli_wand->wand.debug)) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",cli_wand->wand.name); (void) SyncImagesSettings(_image_info,_images,_exception); @@ -3865,6 +3861,14 @@ WandExport void CLIListOperatorImages(MagickCLI *cli_wand, else compose=OverCompositeOp; /* use Over not source_image->compose */ + clip_to_self=IsStringTrue(GetImageOption(_image_info, + "compose:clip-to-self")); + value=GetImageOption(_image_info,"compose:outside-overlay"); + if (value != (const char *) NULL) { + /* FUTURE: depreciate warning for "compose:outside-overlay"*/ + clip_to_self= IsFalse(IsStringTrue(value)); + } + new_images=RemoveFirstImageFromList(&_images); source_image=RemoveFirstImageFromList(&_images); /* FUTURE - produce Exception, rather than silent fail */ @@ -3900,11 +3904,6 @@ WandExport void CLIListOperatorImages(MagickCLI *cli_wand, mask_image=DestroyImage(mask_image); } } - clip_to_self=MagickFalse; - value=GetImageArtifact(source_image,"compose:outside-overlay"); - if (value != (const char *) NULL) - clip_to_self=IsMagickTrue(value) == MagickFalse ? MagickTrue : - MagickFalse; (void) CompositeImage(new_images,source_image,compose,clip_to_self, geometry.x,geometry.y,_exception); (void) SetImageMask(new_images,(Image *) NULL,_exception); @@ -3939,7 +3938,7 @@ WandExport void CLIListOperatorImages(MagickCLI *cli_wand, size_t number_duplicates; - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option, arg1); number_duplicates=(size_t) StringToLong(arg1); @@ -3983,7 +3982,7 @@ WandExport void CLIListOperatorImages(MagickCLI *cli_wand, if (LocaleCompare("flatten",option+1) == 0) { /* REDIRECTED to use -layers flatten instead */ - CLIListOperatorImages(cli_wand,"-layer",option+1,NULL); + CLIListOperatorImages(cli_wand,"-layers",option+1,NULL); break; } if (LocaleCompare("fx",option+1) == 0) @@ -4041,7 +4040,7 @@ WandExport void CLIListOperatorImages(MagickCLI *cli_wand, ssize_t index; - if (IfNormalOp && IsGeometry(arg1) == MagickFalse) + if (IfNormalOp && IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); index=0; insert_image=RemoveLastImageFromList(&_images); @@ -4239,7 +4238,7 @@ WandExport void CLIListOperatorImages(MagickCLI *cli_wand, Image *morph_image; - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); morph_image=MorphImages(_images,StringToUnsignedLong(arg1), _exception); @@ -4252,7 +4251,7 @@ WandExport void CLIListOperatorImages(MagickCLI *cli_wand, if (LocaleCompare("mosaic",option+1) == 0) { /* REDIRECTED to use -layers mosaic instead */ - CLIListOperatorImages(cli_wand,"-layer",option+1,NULL); + CLIListOperatorImages(cli_wand,"-layers",option+1,NULL); break; } CLIWandExceptionBreak(OptionError,"UnrecognizedOption",option); @@ -4365,7 +4364,7 @@ WandExport void CLIListOperatorImages(MagickCLI *cli_wand, ssize_t offset; - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); offset=(ssize_t) StringToLong(arg1); smush_image=SmushImages(_images,normal_op,offset,_exception); @@ -4386,7 +4385,7 @@ WandExport void CLIListOperatorImages(MagickCLI *cli_wand, index, swap_index; - if (IsGeometry(arg1) == MagickFalse) + if (IfFalse(IsGeometry(arg1))) CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); index=-1; swap_index=-2; @@ -4528,7 +4527,7 @@ WandExport void CLISpecialOperator(MagickCLI *cli_wand, assert(cli_wand != (MagickCLI *) NULL); assert(cli_wand->signature == WandSignature); assert(cli_wand->wand.signature == WandSignature); - if (cli_wand->wand.debug != MagickFalse) + if (IfTrue(cli_wand->wand.debug)) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",cli_wand->wand.name); if(cli_wand->wand.images != (Image *)NULL) @@ -4557,7 +4556,7 @@ WandExport void CLISpecialOperator(MagickCLI *cli_wand, MagickBooleanType status=ExpandFilenames(&argc,&argv); - if (status == MagickFalse) + if (IfFalse(status)) ThrowConvertException(ResourceLimitError,"MemoryAllocationFailed", GetExceptionMessage(errno)); ...loop over images to read... @@ -4565,7 +4564,7 @@ WandExport void CLISpecialOperator(MagickCLI *cli_wand, #if !USE_WAND_METHODS Image * new_images; - if (cli_wand->wand.image_info->ping != MagickFalse) + if (IfFalse(cli_wand->wand.image_info->ping)) new_images=PingImages(cli_wand->wand.image_info,arg1,_exception); else new_images=ReadImages(cli_wand->wand.image_info,arg1,_exception); @@ -4612,8 +4611,8 @@ WandExport void CLISpecialOperator(MagickCLI *cli_wand, cli_wand->image_list_stack = node; /* handle respect-parenthesis */ - if (IsMagickTrue(GetImageOption(cli_wand->wand.image_info, - "respect-parenthesis")) != MagickFalse ) + if (IfTrue(IsStringTrue(GetImageOption(cli_wand->wand.image_info, + "respect-parenthesis")))) option="{"; /* fall-thru so as to push image settings too */ else return; @@ -4670,8 +4669,8 @@ WandExport void CLISpecialOperator(MagickCLI *cli_wand, node = cli_wand->image_info_stack; if ( node != (Stack *)NULL) { - if (IsMagickTrue(GetImageOption((ImageInfo *)node->data, - "respect-parenthesis")) != MagickFalse ) + if (IfTrue(IsStringTrue(GetImageOption(cli_wand->wand.image_info, + "respect-parenthesis")))) option="}"; /* fall-thru so as to pop image settings too */ else return; @@ -4705,7 +4704,7 @@ WandExport void CLISpecialOperator(MagickCLI *cli_wand, if (*option == '+') arg1="-1"; - if (IsSceneGeometry(arg1,MagickFalse) == MagickFalse) + if (IfFalse(IsSceneGeometry(arg1,MagickFalse))) CLIWandExceptionReturn(OptionError,"InvalidArgument",option); if ( cli_wand->image_list_stack == (Stack *)NULL) CLIWandExceptionReturn(OptionError,"UnableToCloneImage",option); @@ -4737,7 +4736,7 @@ WandExport void CLISpecialOperator(MagickCLI *cli_wand, ssize_t list; - list=ParseCommandOption(MagickListOptions,MagickFalse, arg1); + list=ParseCommandOption(MagickListOptions,MagickFalse,arg1); if ( list < 0 ) { CLIWandExceptionArg(OptionError,"UnrecognizedListType",option,arg1); return; -- 2.40.0