From a76ef50df393c5369ca0a25a40f68cfad9727a1b Mon Sep 17 00:00:00 2001 From: nicolas Date: Wed, 1 Aug 2012 20:49:26 +0000 Subject: [PATCH] +0.5 probably not for rounding --- MagickCore/enhance.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/MagickCore/enhance.c b/MagickCore/enhance.c index 96ce8b6d3..fad559646 100644 --- a/MagickCore/enhance.c +++ b/MagickCore/enhance.c @@ -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)); -- 2.50.1