]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authornicolas <nicolas@git.imagemagick.org>
Sun, 5 Aug 2012 21:47:04 +0000 (21:47 +0000)
committernicolas <nicolas@git.imagemagick.org>
Sun, 5 Aug 2012 21:47:04 +0000 (21:47 +0000)
MagickCore/enhance.c

index 71116e6c46186930b0019ee1d6f43881559280cb..d59bdd1138cb734cee7d3cd0b87c7e62b4e28769 100644 (file)
@@ -3371,27 +3371,27 @@ MagickExport MagickBooleanType SigmoidalContrastImage(Image *image,
     ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
       image->filename);
   (void) ResetMagickMemory(sigmoidal_map,0,(MaxMap+1)*sizeof(*sigmoidal_map));
-/* Sigmoidal with inflexion point moved to b and "slope constant" set to a.
- */
+  /* Sigmoidal with inflexion point moved to b and "slope constant" set to a.
  */
 #define SIGMOIDAL(a,b,x) ( 1.0/(1.0+exp((a)*((b)-(x)))) )
-/* Scaled sigmoidal formula: (1/(1+exp(a*(b-x))) - 1/(1+exp(a*b)))
- *                           /
- *                           (1/(1+exp(a*(b-1))) - 1/(1+exp(a*b))).
- * See http://osdir.com/ml/video.image-magick.devel/2005-04/msg00006.html and
- * http://www.cs.dartmouth.edu/farid/downloads/tutorials/fip.pdf.
- */
+  /* Scaled sigmoidal formula: (1/(1+exp(a*(b-x))) - 1/(1+exp(a*b)))
  *                           /
  *                           (1/(1+exp(a*(b-1))) - 1/(1+exp(a*b))).
  * See http://osdir.com/ml/video.image-magick.devel/2005-04/msg00006.html and
  * http://www.cs.dartmouth.edu/farid/downloads/tutorials/fip.pdf.
  */
 #define SCALED_SIGMOIDAL(a,b,x) (                   \
   (SIGMOIDAL((a),(b),(x))-SIGMOIDAL((a),(b),0.0)) / \
   (SIGMOIDAL((a),(b),1.0)-SIGMOIDAL((a),(b),0.0)) )
 #define INVERSE_SCALED_SIGMOIDAL(a,b,x) (                                   \
   (b) - log( -1.0+1.0/((SIGMOIDAL((a),(b),1.0)-SIGMOIDAL((a),(b),0.0))*(x)+ \
   SIGMOIDAL((a),(b),0.0)) ) / (a) )
-/* The limit of SCALED_SIGMOIDAL as a->0 is the identity, but a=0 gives a
- * division by zero. This is fixed below by hardwiring the identity when a is
- * small. This would appear to be safe because the series expansion of the
- * sigmoidal function around x=b is 1/2-a*(b-x)/4+... so that s(1)-s(0) is
- * about a/4.
- */
+  /* The limit of SCALED_SIGMOIDAL as a->0 is the identity, but a=0 gives a
  * division by zero. This is fixed below by hardwiring the identity when a is
  * small. This would appear to be safe because the series expansion of the
  * sigmoidal function around x=b is 1/2-a*(b-x)/4+... so that s(1)-s(0) is
  * about a/4.
  */
   if (contrast<4.0*MagickEpsilon)
     for (i=0; i <= (ssize_t) MaxMap; i++)
       sigmoidal_map[i]=