]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 19 Jun 2012 17:51:30 +0000 (17:51 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 19 Jun 2012 17:51:30 +0000 (17:51 +0000)
MagickCore/pixel-accessor.h

index 78bf4711543c7ccb2ba1f5727bcd4f5c87dcfd7a..4b4dad0487d9abff96c55522706f537c187cb1c9 100644 (file)
@@ -189,6 +189,8 @@ static inline Quantum GetPixelInfoIntensity(
     green,
     red;
 
+  if (pixel_info->colorspace == GRAYColorspace)
+    return(pixel_info->red);
   if (pixel_info->colorspace != sRGBColorspace)
     {
       red=pixel_info->red;
@@ -219,6 +221,8 @@ static inline Quantum GetPixelInfoLuminance(
   Quantum
     luminance;
 
+  if (pixel_info->colorspace == GRAYColorspace)
+    return((Quantum) pixel_info->red);
   if (pixel_info->colorspace != sRGBColorspace)
     {
       red=pixel_info->red;
@@ -290,6 +294,8 @@ static inline Quantum GetPixelLuminance(const Image *restrict image,
     green,
     red;
 
+  if (image->colorspace == GRAYColorspace)
+    return(pixel[image->channel_map[GrayPixelChannel].offset]);
   if (image->colorspace != sRGBColorspace)
     {
       red=(double) pixel[image->channel_map[RedPixelChannel].offset];