]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 5 Jan 2014 00:51:38 +0000 (00:51 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 5 Jan 2014 00:51:38 +0000 (00:51 +0000)
MagickCore/attribute.c

index 1ae0a31a3511b3735bc293d4b8c8cbaf923eedeb..ec953ec4e2ea01dfc1b1174b70843c5c9bb24f25 100644 (file)
@@ -947,21 +947,17 @@ MagickExport MagickBooleanType SetImageDepth(Image *image,
       for (i=0; i < (ssize_t) image->colors; i++)
       {
         if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
-          image->colormap[i].red=(double) ClampToQuantum(ScaleAnyToQuantum(
-            ScaleQuantumToAny(ClampToQuantum(image->colormap[i].red),range),
-            range));
+          image->colormap[i].red=(double) ScaleAnyToQuantum(ScaleQuantumToAny(
+            ClampPixel(image->colormap[i].red),range),range);
         if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
-          image->colormap[i].green=(double) ClampToQuantum(ScaleAnyToQuantum(
-            ScaleQuantumToAny(ClampToQuantum(image->colormap[i].green),range),
-            range));
+          image->colormap[i].green=(double) ScaleAnyToQuantum(ScaleQuantumToAny(
+            ClampPixel(image->colormap[i].green),range),range);
         if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
-          image->colormap[i].blue=(double) ClampToQuantum(ScaleAnyToQuantum(
-            ScaleQuantumToAny(ClampToQuantum(image->colormap[i].blue),range),
-            range));
+          image->colormap[i].blue=(double) ScaleAnyToQuantum(ScaleQuantumToAny(
+            ClampPixel(image->colormap[i].blue),range),range);
         if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
-          image->colormap[i].alpha=(double) ClampToQuantum(ScaleAnyToQuantum(
-            ScaleQuantumToAny(ClampToQuantum(image->colormap[i].alpha),range),
-            range));
+          image->colormap[i].alpha=(double) ScaleAnyToQuantum(ScaleQuantumToAny(
+            ClampPixel(image->colormap[i].alpha),range),range);
       }
     }
   status=MagickTrue;
@@ -1092,8 +1088,7 @@ MagickExport MagickBooleanType SetImageDepth(Image *image,
         if ((traits == UndefinedPixelTrait) || (channel == IndexPixelChannel) ||
             (channel == ReadMaskPixelChannel))
           continue;
-        q[i]=ClampToQuantum(ScaleAnyToQuantum(ScaleQuantumToAny(q[i],range),
-          range));
+        q[i]=ScaleAnyToQuantum(ScaleQuantumToAny(ClampPixel(q[i]),range),range);
       }
       q+=GetPixelChannels(image);
     }