]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 13 Jan 2015 01:23:56 +0000 (01:23 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 13 Jan 2015 01:23:56 +0000 (01:23 +0000)
MagickCore/fx.c

index 38b4e33aa8df5650e5739848dbda5a17be78f6f1..51a16bf26e1f339e8263b9e0cc7ba186e1112ee7 100644 (file)
@@ -2432,6 +2432,16 @@ static double FxEvaluateSubexpression(FxInfo *fx_info,
             exception);
           return((double) ceil((double) alpha));
         }
+      if (LocaleNCompare(expression,"clamp",5) == 0)
+        {
+          alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,beta,
+            exception);
+          if (alpha < 0.0)
+            return(0.0);
+          if (alpha > 1.0)
+            return(1.0);
+          return(alpha);
+        }
       if (LocaleNCompare(expression,"cosh",4) == 0)
         {
           alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+4,beta,