]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 7 Jun 2012 11:09:49 +0000 (11:09 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 7 Jun 2012 11:09:49 +0000 (11:09 +0000)
MagickCore/statistic.c
MagickCore/version.h
config/ImageMagick.rdf
config/configure.xml

index 15d1d8d94c5d8966a81edd6629978f543f8b685b..f87c1661140515ad82609789c0b27b6f9e18ae9e 100644 (file)
@@ -1432,6 +1432,7 @@ MagickExport MagickBooleanType GetImageRange(const Image *image,double *minima,
     *image_view;
 
   MagickBooleanType
+    initialize,
     status;
 
   ssize_t
@@ -1442,11 +1443,12 @@ MagickExport MagickBooleanType GetImageRange(const Image *image,double *minima,
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   status=MagickTrue;
-  *maxima=(-MagickHuge);
-  *minima=MagickHuge;
+  initialize=MagickTrue;
+  *maxima=0.0;
+  *minima=0.0;
   image_view=AcquireVirtualCacheView(image,exception);
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
-  #pragma omp parallel for schedule(static) shared(status) \
+  #pragma omp parallel for schedule(static) shared(status,initialize) \
     dynamic_number_threads(image,image->columns,image->rows,1)
 #endif
   for (y=0; y < (ssize_t) image->rows; y++)
@@ -1493,10 +1495,19 @@ MagickExport MagickBooleanType GetImageRange(const Image *image,double *minima,
         #pragma omp critical (MagickCore_GetImageRange)
 #endif
         {
-          if ((double) p[i] < *minima)
-            *minima=(double) p[i];
-          if ((double) p[i] > *maxima)
-            *maxima=(double) p[i];
+          if (initialize != MagickFalse)
+            {
+              *minima=(double) p[i];
+              *maxima=(double) p[i];
+              initialize=MagickFalse;
+            }
+          else
+            {
+              if ((double) p[i] < *minima)
+                *minima=(double) p[i];
+              if ((double) p[i] > *maxima)
+                *maxima=(double) p[i];
+           }
         }
       }
       p+=GetPixelChannels(image);
@@ -1575,6 +1586,7 @@ MagickExport ChannelStatistics *GetImageStatistics(const Image *image,
     area;
 
   MagickStatusType
+    initialize,
     status;
 
   QuantumAny
@@ -1603,9 +1615,10 @@ MagickExport ChannelStatistics *GetImageStatistics(const Image *image,
   for (i=0; i <= (ssize_t) MaxPixelChannels; i++)
   {
     channel_statistics[i].depth=1;
-    channel_statistics[i].maxima=(-MagickHuge);
-    channel_statistics[i].minima=MagickHuge;
+    channel_statistics[i].maxima=0.0;
+    channel_statistics[i].minima=0.0;
   }
+  initialize=MagickTrue;
   for (y=0; y < (ssize_t) image->rows; y++)
   {
     register const Quantum
@@ -1652,10 +1665,19 @@ MagickExport ChannelStatistics *GetImageStatistics(const Image *image,
                 continue;
               }
           }
-        if ((double) p[i] < channel_statistics[channel].minima)
-          channel_statistics[channel].minima=(double) p[i];
-        if ((double) p[i] > channel_statistics[channel].maxima)
-          channel_statistics[channel].maxima=(double) p[i];
+        if (initialize != MagickFalse)
+          {
+            channel_statistics[channel].minima=(double) p[i];
+            channel_statistics[channel].maxima=(double) p[i];
+            initialize=MagickFalse;
+          }
+        else
+          {
+            if ((double) p[i] < channel_statistics[channel].minima)
+              channel_statistics[channel].minima=(double) p[i];
+            if ((double) p[i] > channel_statistics[channel].maxima)
+              channel_statistics[channel].maxima=(double) p[i];
+          }
         channel_statistics[channel].sum+=p[i];
         channel_statistics[channel].sum_squared+=(double) p[i]*p[i];
         channel_statistics[channel].sum_cubed+=(double) p[i]*p[i]*p[i];
index b4f47e65782e5046da88c3bb01fa8c26e17c7cb0..cd1725e63319eacd01085f0bfda555b7e06ac980 100644 (file)
@@ -34,7 +34,7 @@ extern "C" {
 #define MagickLibAddendum  "-0"
 #define MagickLibInterface  7
 #define MagickLibMinInterface  7
-#define MagickReleaseDate  "2012-06-03"
+#define MagickReleaseDate  "2012-06-07"
 #define MagickChangeDate   "20110801"
 #define MagickAuthoritativeURL  "http://www.imagemagick.org"
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
index f0854c68068aa9069f7d669319602f603c40d364..32ce1e417e0cf30efa9e47dd9783c1a03edd85b7 100644 (file)
@@ -5,7 +5,7 @@
     <name>ImageMagick</name>
     <shortdesc xml:lang="en">ImageMagick: convert, edit, and compose images.</shortdesc>
     <homepage rdf:resource="http://www.imagemagick.org/"/>
-    <created>2012-06-03</created>
+    <created>2012-06-07</created>
 
     <description xml:lang="en">
 ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 100) including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, and TIFF. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.
@@ -57,7 +57,7 @@ Examples of ImageMagick Usage shows how to use ImageMagick from the command-line
     <release>
       <Version>
           <name>stable</name>
-          <created>2012-06-03</created>
+          <created>2012-06-07</created>
           <revision>7.0.0</revision>
           <patch-level>-0</patch-level>
       </Version>
index 959b6bd82f1eca93b5b43510beab1a3b6529d614..4c26fe35ad3b7006485a6bf7d8201f31c31918c0 100644 (file)
@@ -11,7 +11,7 @@
   <configure name="LIB_VERSION" value="0x700"/>
   <configure name="LIB_VERSION_NUMBER" value="7,0,0,0"/>
   <configure name="SVN_REVISION" value="8118" />
-  <configure name="RELEASE_DATE" value="2012-06-03"/>
+  <configure name="RELEASE_DATE" value="2012-06-07"/>
   <configure name="CONFIGURE" value="./configure "/>
   <configure name="PREFIX" value="/usr/local"/>
   <configure name="EXEC-PREFIX" value="/usr/local"/>