From: cristy Date: Wed, 2 Nov 2011 19:04:05 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~6701 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9eeedea89e69f45aa171f60930f7e6a3818a2139;p=imagemagick --- diff --git a/MagickCore/fx.c b/MagickCore/fx.c index 17dc2f93f..c25452c73 100644 --- a/MagickCore/fx.c +++ b/MagickCore/fx.c @@ -404,7 +404,7 @@ MagickExport Image *AddNoiseImage(const Image *image,const NoiseType noise_type, if ((traits == UndefinedPixelTrait) || (noise_traits == UndefinedPixelTrait)) continue; - if ((noise_traits & CopyPixelTrait) != 0) + if ((noise_traits & CopyPixelTrait) != 0) { SetPixelChannel(noise_image,channel,p[i],q); continue; @@ -2585,6 +2585,13 @@ static MagickRealType FxEvaluateSubexpression(FxInfo *fx_info, case 'G': case 'g': { + if (LocaleNCompare(expression,"gauss",5) == 0) + { + alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,beta, + exception); + gamma=exp((double) (-alpha*alpha/2.0))/sqrt(2.0*MagickPI); + return((MagickRealType) gamma); + } if (LocaleCompare(expression,"g") == 0) return(FxGetSymbol(fx_info,channel,x,y,expression,exception)); break; @@ -2803,6 +2810,12 @@ static MagickRealType FxEvaluateSubexpression(FxInfo *fx_info, exception); return((MagickRealType) sqrt((double) alpha)); } + if (LocaleNCompare(expression,"squish",6) == 0) + { + alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+6,beta, + exception); + return((MagickRealType) (1.0/(1.0+exp((double) (4.0*alpha))))); + } if (LocaleCompare(expression,"s") == 0) return(FxGetSymbol(fx_info,channel,x,y,expression,exception)); break; @@ -2853,6 +2866,15 @@ static MagickRealType FxEvaluateSubexpression(FxInfo *fx_info, case 'W': case 'w': { + if (LocaleNCompare(expression,"while",5) == 0) + { + do + { + alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,beta, + exception); + } while (fabs((double) alpha) >= MagickEpsilon); + return((MagickRealType) *beta); + } if (LocaleCompare(expression,"w") == 0) return(FxGetSymbol(fx_info,channel,x,y,expression,exception)); break;