]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Wed, 2 Nov 2011 19:04:05 +0000 (19:04 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Wed, 2 Nov 2011 19:04:05 +0000 (19:04 +0000)
MagickCore/fx.c

index 17dc2f93f59407decd8edd56da5b3a58f78f5d0f..c25452c73ca9cbd3882f8f25aef926d5c276a998 100644 (file)
@@ -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;