]> granicus.if.org Git - imagemagick/commitdiff
+0.5 probably not for rounding
authornicolas <nicolas@git.imagemagick.org>
Wed, 1 Aug 2012 20:49:26 +0000 (20:49 +0000)
committernicolas <nicolas@git.imagemagick.org>
Wed, 1 Aug 2012 20:49:26 +0000 (20:49 +0000)
MagickCore/enhance.c

index 96ce8b6d3466df7b5e6834f63d6a4c24b406936d..fad559646d201c725a90aa9f72e981175b7c4c32 100644 (file)
@@ -3397,7 +3397,8 @@ MagickExport MagickBooleanType SigmoidalContrastImage(Image *image,
         *
         * "+epsilon" is to allow a=0 without division by zero.
          *
-        * "+0.5" below is to round by casting.
+        * Nicolas is still trying to figure out what the "+0.5" is for.
+        * They may be gone later.
          */
         sigmoidal_map[i]=(MagickRealType) ScaleMapToQuantum((MagickRealType)
           (MaxMap*(0.5+(uu-(u0+u1)/2.0)/(u1-u0+MagickEpsilon))+0.5));
@@ -3405,8 +3406,6 @@ MagickExport MagickBooleanType SigmoidalContrastImage(Image *image,
         /* Scaled sigmoidal formula: (1/(1+exp(a*(b-u))) - 1/(1+exp(a*b)))
          *                           /
          *                           (1/(1+exp(a*(b-1))) - 1/(1+exp(a*b)))
-        *
-        * "+0.5" below is to round by casting.
          */
         sigmoidal_map[i]=(MagickRealType) ScaleMapToQuantum((MagickRealType)
           (MaxMap*((uu-u0)/(u1-u0))+0.5));