]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 9 Aug 2011 13:07:05 +0000 (13:07 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 9 Aug 2011 13:07:05 +0000 (13:07 +0000)
MagickCore/enhance.c

index 8c37a2ebf635698a11662e728dbdd1fddbc05c02..daf030875aa9157cb74455c31cc53c1514ffd203 100644 (file)
@@ -1088,35 +1088,21 @@ MagickExport MagickBooleanType ContrastStretchImage(Image *image,
         status=MagickFalse;
         continue;
       }
-    if (image->sync != MagickFalse)
-      for (x=0; x < (ssize_t) image->columns; x++)
-      {
-        Quantum
-          intensity;
-
-        intensity=GetPixelIntensity(image,p);
-        histogram[ScaleQuantumToMap(intensity)].red++;
-        histogram[ScaleQuantumToMap(intensity)].green++;
-        histogram[ScaleQuantumToMap(intensity)].blue++;
-        histogram[ScaleQuantumToMap(intensity)].black++;
-        p+=GetPixelChannels(image);
-      }
-    else
-      for (x=0; x < (ssize_t) image->columns; x++)
-      {
-        if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
-          histogram[ScaleQuantumToMap(GetPixelRed(image,p))].red++;
-        if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
-          histogram[ScaleQuantumToMap(GetPixelGreen(image,p))].green++;
-        if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
-          histogram[ScaleQuantumToMap(GetPixelBlue(image,p))].blue++;
-        if (((GetPixelBlackTraits(image) & UpdatePixelTrait) != 0) &&
-            (image->colorspace == CMYKColorspace))
-          histogram[ScaleQuantumToMap(GetPixelBlack(image,p))].black++;
-        if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
-          histogram[ScaleQuantumToMap(GetPixelAlpha(image,p))].alpha++;
-        p+=GetPixelChannels(image);
-      }
+    for (x=0; x < (ssize_t) image->columns; x++)
+    {
+      if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
+        histogram[ScaleQuantumToMap(GetPixelRed(image,p))].red++;
+      if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
+        histogram[ScaleQuantumToMap(GetPixelGreen(image,p))].green++;
+      if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
+        histogram[ScaleQuantumToMap(GetPixelBlue(image,p))].blue++;
+      if (((GetPixelBlackTraits(image) & UpdatePixelTrait) != 0) &&
+          (image->colorspace == CMYKColorspace))
+        histogram[ScaleQuantumToMap(GetPixelBlack(image,p))].black++;
+      if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
+        histogram[ScaleQuantumToMap(GetPixelAlpha(image,p))].alpha++;
+      p+=GetPixelChannels(image);
+    }
   }
   /*
     Find the histogram boundaries by locating the black/white levels.