From 33c7671cbeb4b5c59e9d675f4badceed8caeda30 Mon Sep 17 00:00:00 2001 From: nicolas Date: Wed, 8 Aug 2012 17:15:05 +0000 Subject: [PATCH] --- MagickCore/enhance.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/MagickCore/enhance.c b/MagickCore/enhance.c index c3f811afb..7bee15ecd 100644 --- a/MagickCore/enhance.c +++ b/MagickCore/enhance.c @@ -3313,19 +3313,6 @@ MagickExport MagickBooleanType SigmoidalContrastImage(Image *image, ssize_t y; - /* - Allocate and initialize sigmoidal maps. - */ - assert(image != (Image *) NULL); - assert(image->signature == MagickSignature); - if (image->debug != MagickFalse) - (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); - sigmoidal_map=(Quantum *) AcquireQuantumMemory(MaxMap+1UL, - sizeof(*sigmoidal_map)); - if (sigmoidal_map == (Quantum *) NULL) - 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. */ @@ -3350,6 +3337,20 @@ MagickExport MagickBooleanType SigmoidalContrastImage(Image *image, sigmoidal function around x=b is 1/2-a*(b-x)/4+... so that s(1)-s(0) is about a/4. */ + + /* + Allocate and initialize sigmoidal maps. + */ + assert(image != (Image *) NULL); + assert(image->signature == MagickSignature); + if (image->debug != MagickFalse) + (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); + sigmoidal_map=(Quantum *) AcquireQuantumMemory(MaxMap+1UL, + sizeof(*sigmoidal_map)); + if (sigmoidal_map == (Quantum *) NULL) + ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", + image->filename); + (void) ResetMagickMemory(sigmoidal_map,0,(MaxMap+1)*sizeof(*sigmoidal_map)); if (contrast<4.0*MagickEpsilon) for (i=0; i <= (ssize_t) MaxMap; i++) sigmoidal_map[i]=ScaleMapToQuantum((double) i); -- 2.50.1