]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 24 Apr 2012 13:18:02 +0000 (13:18 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 24 Apr 2012 13:18:02 +0000 (13:18 +0000)
MagickCore/colorspace.c
tests/validate-colorspace.sh

index dd20344bd7dd8176f345b591599af9d8b5ff4dfe..564c0b9d85025a90b0a3e0aaf5c844aa5d9e2814 100644 (file)
@@ -2602,12 +2602,9 @@ static MagickBooleanType TransformsRGBImage(Image *image,
             default:
               break;
           }
-          SetPixelRed(image,ScaleMapToQuantum((MagickRealType) MaxMap*
-            QuantumScale*pixel.red),q);
-          SetPixelGreen(image,ScaleMapToQuantum((MagickRealType) MaxMap*
-            QuantumScale*pixel.green),q);
-          SetPixelBlue(image,ScaleMapToQuantum((MagickRealType) MaxMap*
-            QuantumScale*pixel.blue),q);
+          SetPixelRed(image,ScaleMapToQuantum(pixel.red),q);
+          SetPixelGreen(image,ScaleMapToQuantum(pixel.green),q);
+          SetPixelBlue(image,ScaleMapToQuantum(pixel.blue),q);
           q+=GetPixelChannels(image);
         }
         sync=SyncCacheViewAuthenticPixels(image_view,exception);
@@ -2659,12 +2656,12 @@ static MagickBooleanType TransformsRGBImage(Image *image,
           case YCCColorspace:
           {
 #if !defined(MAGICKCORE_HDRI_SUPPORT)
-            image->colormap[i].red=(double) (QuantumRange*YCCMap[
-              RoundToYCC(1024.0*QuantumScale*pixel.red)]);
-            image->colormap[i].green=(double) (QuantumRange*YCCMap[
-              RoundToYCC(1024.0*QuantumScale*pixel.green)]);
-            image->colormap[i].blue=(double) (QuantumRange*YCCMap[
-              RoundToYCC(1024.0*QuantumScale*pixel.blue)]);
+            pixel.red=QuantumRange*YCCMap[RoundToYCC(1024.0*QuantumScale*
+              pixel.red)];
+            pixel.green=QuantumRange*YCCMap[RoundToYCC(1024.0*QuantumScale*
+              pixel.green)];
+            pixel.blue=QuantumRange*YCCMap[RoundToYCC(1024.0*QuantumScale*
+              pixel.blue)];
 #endif
             break;
           }
@@ -2685,19 +2682,13 @@ static MagickBooleanType TransformsRGBImage(Image *image,
             else
               pixel.blue=(MagickRealType) QuantumRange*(1.055*
                 pow(QuantumScale*pixel.blue,(1.0/2.4))-0.055);
-            break;
           }
           default:
-          {
-            image->colormap[i].red=(double) ScaleMapToQuantum((MagickRealType)
-              MaxMap*QuantumScale*pixel.red);
-            image->colormap[i].green=(double) ScaleMapToQuantum((MagickRealType)
-              MaxMap*QuantumScale*pixel.green);
-            image->colormap[i].blue=(double) ScaleMapToQuantum((MagickRealType)
-              MaxMap*QuantumScale*pixel.blue);
             break;
-          }
         }
+        image->colormap[i].red=(double) ScaleMapToQuantum(pixel.red);
+        image->colormap[i].green=(double) ScaleMapToQuantum(pixel.green);
+        image->colormap[i].blue=(double) ScaleMapToQuantum(pixel.blue);
       }
       (void) SyncImage(image,exception);
       break;
index fc0d320ef21d2ed7922db1b93f40c8c71053ac92..73be522518f8864d90701a480e48eede0484e969 100755 (executable)
 #
 . ${srcdir}/tests/common.sh
 
-depth=`eval ${MAGICK} xc:none -format '%[fx:QuantumRange]' info:-`
-echo $depth
-if [ "$depth" != "65535" ]; then
-  exit 0
-fi
-
 # how to generate a one pixel (average rose) color and output its values
 in="rose: -scale 1x1"    # a one pixel image of the average color.
 out="-format '%[fx:int(255*r+.5)],%[fx:int(255*g+.5)],%[fx:int(255*b+.5)]' info:-"