]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Wed, 8 Aug 2012 12:22:45 +0000 (12:22 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Wed, 8 Aug 2012 12:22:45 +0000 (12:22 +0000)
MagickCore/colorspace-private.h
MagickCore/colorspace.c
MagickCore/pixel-accessor.h
MagickCore/xwindow-private.h

index b042a8e49009cbd81e062747572daf2b86112f0c..d5f598b59bd45d3bf73d7098ab4eaa0716e91c2f 100644 (file)
@@ -46,9 +46,9 @@ static inline void ConvertRGBToCMYK(PixelInfo *pixel)
     }
   else
     {
-      red=DecompandsRGB(pixel->red);
-      green=DecompandsRGB(pixel->green);
-      blue=DecompandsRGB(pixel->blue);
+      red=InversesRGBCompandor(pixel->red);
+      green=InversesRGBCompandor(pixel->green);
+      blue=InversesRGBCompandor(pixel->blue);
     }
   if ((fabs(red) < MagickEpsilon) && (fabs(green) < MagickEpsilon) &&
       (fabs(blue) < MagickEpsilon))
index e6a25067bf9bf1a467f6ca7863c0316c25daa6d3..e80d701afedd3c644db4435f683eefe6b10a2d8c 100644 (file)
@@ -268,9 +268,9 @@ static MagickBooleanType sRGBTransformImage(Image *image,
             magenta,
             yellow;
 
-          cyan=DecompandsRGB((double) GetPixelCyan(image,q));
-          magenta=DecompandsRGB((double) GetPixelMagenta(image,q));
-          yellow=DecompandsRGB((double) GetPixelYellow(image,q));
+          cyan=InversesRGBCompandor((double) GetPixelCyan(image,q));
+          magenta=InversesRGBCompandor((double) GetPixelMagenta(image,q));
+          yellow=InversesRGBCompandor((double) GetPixelYellow(image,q));
           SetPixelCyan(image,ClampToQuantum(QuantumRange-cyan),q);
           SetPixelMagenta(image,ClampToQuantum(QuantumRange-magenta),q);
           SetPixelYellow(image,ClampToQuantum(QuantumRange-yellow),q);
@@ -337,9 +337,9 @@ static MagickBooleanType sRGBTransformImage(Image *image,
         for (x=0; x < (ssize_t) image->columns; x++)
         {
           GetPixelInfoPixel(image,q,&pixel);
-          pixel.red=DecompandsRGB(pixel.red);
-          pixel.green=DecompandsRGB(pixel.green);
-          pixel.blue=DecompandsRGB(pixel.blue);
+          pixel.red=InversesRGBCompandor(pixel.red);
+          pixel.green=InversesRGBCompandor(pixel.green);
+          pixel.blue=InversesRGBCompandor(pixel.blue);
           ConvertRGBToCMYK(&pixel);
           SetPixelInfoPixel(image,&pixel,q);
           q+=GetPixelChannels(image);
@@ -401,9 +401,9 @@ static MagickBooleanType sRGBTransformImage(Image *image,
             green,
             red;
 
-          red=DecompandsRGB((double) GetPixelRed(image,q));
-          green=DecompandsRGB((double) GetPixelGreen(image,q));
-          blue=DecompandsRGB((double) GetPixelBlue(image,q));
+          red=InversesRGBCompandor((double) GetPixelRed(image,q));
+          green=InversesRGBCompandor((double) GetPixelGreen(image,q));
+          blue=InversesRGBCompandor((double) GetPixelBlue(image,q));
           gray=0.298839*red+0.586811*green+0.114350*blue;
           SetPixelGray(image,ClampToQuantum(gray),q);
           q+=GetPixelChannels(image);
@@ -465,9 +465,9 @@ static MagickBooleanType sRGBTransformImage(Image *image,
             luma,
             red;
 
-          red=DecompandsRGB((double) GetPixelRed(image,q));
-          green=DecompandsRGB((double) GetPixelGreen(image,q));
-          blue=DecompandsRGB((double) GetPixelBlue(image,q));
+          red=InversesRGBCompandor((double) GetPixelRed(image,q));
+          green=InversesRGBCompandor((double) GetPixelGreen(image,q));
+          blue=InversesRGBCompandor((double) GetPixelBlue(image,q));
           ConvertRGBToHCL(red,green,blue,&hue,&chroma,&luma);
           SetPixelRed(image,ClampToQuantum(QuantumRange*hue),q);
           SetPixelGreen(image,ClampToQuantum(QuantumRange*chroma),q);
@@ -530,9 +530,9 @@ static MagickBooleanType sRGBTransformImage(Image *image,
             red,
             saturation;
 
-          red=DecompandsRGB((double) GetPixelRed(image,q));
-          green=DecompandsRGB((double) GetPixelGreen(image,q));
-          blue=DecompandsRGB((double) GetPixelBlue(image,q));
+          red=InversesRGBCompandor((double) GetPixelRed(image,q));
+          green=InversesRGBCompandor((double) GetPixelGreen(image,q));
+          blue=InversesRGBCompandor((double) GetPixelBlue(image,q));
           ConvertRGBToHSB(red,green,blue,&hue,&saturation,&brightness);
           SetPixelRed(image,ClampToQuantum(QuantumRange*hue),q);
           SetPixelGreen(image,ClampToQuantum(QuantumRange*saturation),q);
@@ -595,9 +595,9 @@ static MagickBooleanType sRGBTransformImage(Image *image,
             red,
             saturation;
 
-          red=DecompandsRGB((double) GetPixelRed(image,q));
-          green=DecompandsRGB((double) GetPixelGreen(image,q));
-          blue=DecompandsRGB((double) GetPixelBlue(image,q));
+          red=InversesRGBCompandor((double) GetPixelRed(image,q));
+          green=InversesRGBCompandor((double) GetPixelGreen(image,q));
+          blue=InversesRGBCompandor((double) GetPixelBlue(image,q));
           ConvertRGBToHSL(red,green,blue,&hue,&saturation,&lightness);
           SetPixelRed(image,ClampToQuantum(QuantumRange*hue),q);
           SetPixelGreen(image,ClampToQuantum(QuantumRange*saturation),q);
@@ -660,9 +660,9 @@ static MagickBooleanType sRGBTransformImage(Image *image,
             red,
             whiteness;
 
-          red=DecompandsRGB((double) GetPixelRed(image,q));
-          green=DecompandsRGB((double) GetPixelGreen(image,q));
-          blue=DecompandsRGB((double) GetPixelBlue(image,q));
+          red=InversesRGBCompandor((double) GetPixelRed(image,q));
+          green=InversesRGBCompandor((double) GetPixelGreen(image,q));
+          blue=InversesRGBCompandor((double) GetPixelBlue(image,q));
           ConvertRGBToHWB(red,green,blue,&hue,&whiteness,&blackness);
           SetPixelRed(image,ClampToQuantum(QuantumRange*hue),q);
           SetPixelGreen(image,ClampToQuantum(QuantumRange*whiteness),q);
@@ -728,9 +728,9 @@ static MagickBooleanType sRGBTransformImage(Image *image,
             Y,
             Z;
 
-          red=DecompandsRGB((double) GetPixelRed(image,q));
-          green=DecompandsRGB((double) GetPixelGreen(image,q));
-          blue=DecompandsRGB((double) GetPixelBlue(image,q));
+          red=InversesRGBCompandor((double) GetPixelRed(image,q));
+          green=InversesRGBCompandor((double) GetPixelGreen(image,q));
+          blue=InversesRGBCompandor((double) GetPixelBlue(image,q));
           ConvertRGBToXYZ(red,green,blue,&X,&Y,&Z);
           ConvertXYZToLab(X,Y,Z,&L,&a,&b);
           SetPixelRed(image,ClampToQuantum(QuantumRange*L),q);
@@ -835,9 +835,9 @@ static MagickBooleanType sRGBTransformImage(Image *image,
             green,
             red;
 
-          red=DecompandsRGB((double) GetPixelRed(image,q));
-          green=DecompandsRGB((double) GetPixelGreen(image,q));
-          blue=DecompandsRGB((double) GetPixelBlue(image,q));
+          red=InversesRGBCompandor((double) GetPixelRed(image,q));
+          green=InversesRGBCompandor((double) GetPixelGreen(image,q));
+          blue=InversesRGBCompandor((double) GetPixelBlue(image,q));
           SetPixelRed(image,logmap[ScaleQuantumToMap(
             ClampToQuantum(red))],q);
           SetPixelGreen(image,logmap[ScaleQuantumToMap(
@@ -906,9 +906,9 @@ static MagickBooleanType sRGBTransformImage(Image *image,
             Y,
             Z;
 
-          red=DecompandsRGB((double) GetPixelRed(image,q));
-          green=DecompandsRGB((double) GetPixelGreen(image,q));
-          blue=DecompandsRGB((double) GetPixelBlue(image,q));
+          red=InversesRGBCompandor((double) GetPixelRed(image,q));
+          green=InversesRGBCompandor((double) GetPixelGreen(image,q));
+          blue=InversesRGBCompandor((double) GetPixelBlue(image,q));
           ConvertRGBToXYZ(red,green,blue,&X,&Y,&Z);
           ConvertXYZToLuv(X,Y,Z,&L,&u,&v);
           SetPixelRed(image,ClampToQuantum(QuantumRange*L),q);
@@ -970,9 +970,9 @@ static MagickBooleanType sRGBTransformImage(Image *image,
             green,
             red;
 
-          red=DecompandsRGB((double) GetPixelRed(image,q));
-          green=DecompandsRGB((double) GetPixelGreen(image,q));
-          blue=DecompandsRGB((double) GetPixelBlue(image,q));
+          red=InversesRGBCompandor((double) GetPixelRed(image,q));
+          green=InversesRGBCompandor((double) GetPixelGreen(image,q));
+          blue=InversesRGBCompandor((double) GetPixelBlue(image,q));
           gray=0.212600*red+0.715200*green+0.072200*blue;
           SetPixelGray(image,ClampToQuantum(gray),q);
           q+=GetPixelChannels(image);
@@ -1031,9 +1031,9 @@ static MagickBooleanType sRGBTransformImage(Image *image,
             green,
             red;
 
-          red=DecompandsRGB((double) GetPixelRed(image,q));
-          green=DecompandsRGB((double) GetPixelGreen(image,q));
-          blue=DecompandsRGB((double) GetPixelBlue(image,q));
+          red=InversesRGBCompandor((double) GetPixelRed(image,q));
+          green=InversesRGBCompandor((double) GetPixelGreen(image,q));
+          blue=InversesRGBCompandor((double) GetPixelBlue(image,q));
           SetPixelRed(image,ClampToQuantum(red),q);
           SetPixelGreen(image,ClampToQuantum(green),q);
           SetPixelBlue(image,ClampToQuantum(blue),q);
@@ -1095,9 +1095,9 @@ static MagickBooleanType sRGBTransformImage(Image *image,
             Y,
             Z;
 
-          red=DecompandsRGB((double) GetPixelRed(image,q));
-          green=DecompandsRGB((double) GetPixelGreen(image,q));
-          blue=DecompandsRGB((double) GetPixelBlue(image,q));
+          red=InversesRGBCompandor((double) GetPixelRed(image,q));
+          green=InversesRGBCompandor((double) GetPixelGreen(image,q));
+          blue=InversesRGBCompandor((double) GetPixelBlue(image,q));
           ConvertRGBToXYZ(red,green,blue,&X,&Y,&Z);
           SetPixelRed(image,ClampToQuantum(QuantumRange*X),q);
           SetPixelGreen(image,ClampToQuantum(QuantumRange*Y),q);
@@ -1435,11 +1435,11 @@ static MagickBooleanType sRGBTransformImage(Image *image,
           }
         for (x=0; x < (ssize_t) image->columns; x++)
         {
-          red=ScaleQuantumToMap(ClampToQuantum(DecompandsRGB((double) 
+          red=ScaleQuantumToMap(ClampToQuantum(InversesRGBCompandor((double) 
             GetPixelRed(image,q))));
-          green=ScaleQuantumToMap(ClampToQuantum(DecompandsRGB((double) 
+          green=ScaleQuantumToMap(ClampToQuantum(InversesRGBCompandor((double) 
             GetPixelGreen(image,q))));
-          blue=ScaleQuantumToMap(ClampToQuantum(DecompandsRGB((double) 
+          blue=ScaleQuantumToMap(ClampToQuantum(InversesRGBCompandor((double) 
             GetPixelBlue(image,q))));
           pixel.red=(x_map[red].x+y_map[green].x+z_map[blue].x)+
             (double) primary_info.x;
@@ -1487,11 +1487,11 @@ static MagickBooleanType sRGBTransformImage(Image *image,
         PixelInfo
           pixel;
 
-        red=ScaleQuantumToMap(ClampToQuantum(DecompandsRGB(
+        red=ScaleQuantumToMap(ClampToQuantum(InversesRGBCompandor(
           image->colormap[i].red)));
-        green=ScaleQuantumToMap(ClampToQuantum(DecompandsRGB(
+        green=ScaleQuantumToMap(ClampToQuantum(InversesRGBCompandor(
           image->colormap[i].green)));
-        blue=ScaleQuantumToMap(ClampToQuantum(DecompandsRGB(
+        blue=ScaleQuantumToMap(ClampToQuantum(InversesRGBCompandor(
           image->colormap[i].blue)));
         pixel.red=x_map[red].x+y_map[green].x+z_map[blue].x+primary_info.x;
         pixel.green=x_map[red].y+y_map[green].y+z_map[blue].y+primary_info.y;
@@ -2072,9 +2072,9 @@ static MagickBooleanType TransformsRGBImage(Image *image,
             magenta,
             yellow;
 
-          cyan=CompandsRGB((double) (QuantumRange-GetPixelCyan(image,q)));
-          magenta=CompandsRGB((double) (QuantumRange-GetPixelMagenta(image,q)));
-          yellow=CompandsRGB((double) (QuantumRange-GetPixelYellow(image,q)));
+          cyan=sRGBCompandor((double) (QuantumRange-GetPixelCyan(image,q)));
+          magenta=sRGBCompandor((double) (QuantumRange-GetPixelMagenta(image,q)));
+          yellow=sRGBCompandor((double) (QuantumRange-GetPixelYellow(image,q)));
           SetPixelCyan(image,ClampToQuantum(cyan),q);
           SetPixelMagenta(image,ClampToQuantum(magenta),q);
           SetPixelYellow(image,ClampToQuantum(yellow),q);
@@ -2138,9 +2138,9 @@ static MagickBooleanType TransformsRGBImage(Image *image,
         {
           GetPixelInfoPixel(image,q,&pixel);
           ConvertCMYKToRGB(&pixel);
-          pixel.red=CompandsRGB(pixel.red);
-          pixel.green=CompandsRGB(pixel.green);
-          pixel.blue=CompandsRGB(pixel.blue);
+          pixel.red=sRGBCompandor(pixel.red);
+          pixel.green=sRGBCompandor(pixel.green);
+          pixel.blue=sRGBCompandor(pixel.blue);
           SetPixelInfoPixel(image,&pixel,q);
           q+=GetPixelChannels(image);
         }
@@ -2199,7 +2199,7 @@ static MagickBooleanType TransformsRGBImage(Image *image,
           double
             gray;
 
-          gray=CompandsRGB((double) GetPixelGray(image,q));
+          gray=sRGBCompandor((double) GetPixelGray(image,q));
           SetPixelRed(image,ClampToQuantum(gray),q);
           SetPixelGreen(image,ClampToQuantum(gray),q);
           SetPixelBlue(image,ClampToQuantum(gray),q);
@@ -2265,9 +2265,9 @@ static MagickBooleanType TransformsRGBImage(Image *image,
           chroma=(double) (QuantumScale*GetPixelGreen(image,q));
           luma=(double) (QuantumScale*GetPixelBlue(image,q));
           ConvertHCLToRGB(hue,chroma,luma,&red,&green,&blue);
-          SetPixelRed(image,ClampToQuantum(CompandsRGB(red)),q);
-          SetPixelGreen(image,ClampToQuantum(CompandsRGB(green)),q);
-          SetPixelBlue(image,ClampToQuantum(CompandsRGB(blue)),q);
+          SetPixelRed(image,ClampToQuantum(sRGBCompandor(red)),q);
+          SetPixelGreen(image,ClampToQuantum(sRGBCompandor(green)),q);
+          SetPixelBlue(image,ClampToQuantum(sRGBCompandor(blue)),q);
           q+=GetPixelChannels(image);
         }
         sync=SyncCacheViewAuthenticPixels(image_view,exception);
@@ -2330,9 +2330,9 @@ static MagickBooleanType TransformsRGBImage(Image *image,
           saturation=(double) (QuantumScale*GetPixelGreen(image,q));
           brightness=(double) (QuantumScale*GetPixelBlue(image,q));
           ConvertHSBToRGB(hue,saturation,brightness,&red,&green,&blue);
-          SetPixelRed(image,ClampToQuantum(CompandsRGB(red)),q);
-          SetPixelGreen(image,ClampToQuantum(CompandsRGB(green)),q);
-          SetPixelBlue(image,ClampToQuantum(CompandsRGB(blue)),q);
+          SetPixelRed(image,ClampToQuantum(sRGBCompandor(red)),q);
+          SetPixelGreen(image,ClampToQuantum(sRGBCompandor(green)),q);
+          SetPixelBlue(image,ClampToQuantum(sRGBCompandor(blue)),q);
           q+=GetPixelChannels(image);
         }
         sync=SyncCacheViewAuthenticPixels(image_view,exception);
@@ -2395,9 +2395,9 @@ static MagickBooleanType TransformsRGBImage(Image *image,
           saturation=(double) (QuantumScale*GetPixelGreen(image,q));
           lightness=(double) (QuantumScale*GetPixelBlue(image,q));
           ConvertHSLToRGB(hue,saturation,lightness,&red,&green,&blue);
-          SetPixelRed(image,ClampToQuantum(CompandsRGB(red)),q);
-          SetPixelGreen(image,ClampToQuantum(CompandsRGB(green)),q);
-          SetPixelBlue(image,ClampToQuantum(CompandsRGB(blue)),q);
+          SetPixelRed(image,ClampToQuantum(sRGBCompandor(red)),q);
+          SetPixelGreen(image,ClampToQuantum(sRGBCompandor(green)),q);
+          SetPixelBlue(image,ClampToQuantum(sRGBCompandor(blue)),q);
           q+=GetPixelChannels(image);
         }
         sync=SyncCacheViewAuthenticPixels(image_view,exception);
@@ -2460,9 +2460,9 @@ static MagickBooleanType TransformsRGBImage(Image *image,
           whiteness=(double) (QuantumScale*GetPixelGreen(image,q));
           blackness=(double) (QuantumScale*GetPixelBlue(image,q));
           ConvertHWBToRGB(hue,whiteness,blackness,&red,&green,&blue);
-          SetPixelRed(image,ClampToQuantum(CompandsRGB(red)),q);
-          SetPixelGreen(image,ClampToQuantum(CompandsRGB(green)),q);
-          SetPixelBlue(image,ClampToQuantum(CompandsRGB(blue)),q);
+          SetPixelRed(image,ClampToQuantum(sRGBCompandor(red)),q);
+          SetPixelGreen(image,ClampToQuantum(sRGBCompandor(green)),q);
+          SetPixelBlue(image,ClampToQuantum(sRGBCompandor(blue)),q);
           q+=GetPixelChannels(image);
         }
         sync=SyncCacheViewAuthenticPixels(image_view,exception);
@@ -2529,9 +2529,9 @@ static MagickBooleanType TransformsRGBImage(Image *image,
           b=QuantumScale*GetPixelBlue(image,q);
           ConvertLabToXYZ(L,a,b,&X,&Y,&Z);
           ConvertXYZToRGB(X,Y,Z,&red,&green,&blue);
-          SetPixelRed(image,ClampToQuantum(CompandsRGB(red)),q);
-          SetPixelGreen(image,ClampToQuantum(CompandsRGB(green)),q);
-          SetPixelBlue(image,ClampToQuantum(CompandsRGB(blue)),q);
+          SetPixelRed(image,ClampToQuantum(sRGBCompandor(red)),q);
+          SetPixelGreen(image,ClampToQuantum(sRGBCompandor(green)),q);
+          SetPixelBlue(image,ClampToQuantum(sRGBCompandor(blue)),q);
           q+=GetPixelChannels(image);
         }
         sync=SyncCacheViewAuthenticPixels(image_view,exception);
@@ -2633,11 +2633,11 @@ static MagickBooleanType TransformsRGBImage(Image *image,
             green,
             red;
 
-          red=CompandsRGB((double) logmap[ScaleQuantumToMap(
+          red=sRGBCompandor((double) logmap[ScaleQuantumToMap(
             GetPixelRed(image,q))]);
-          green=CompandsRGB((double) logmap[ScaleQuantumToMap(
+          green=sRGBCompandor((double) logmap[ScaleQuantumToMap(
             GetPixelGreen(image,q))]);
-          blue=CompandsRGB((double) logmap[ScaleQuantumToMap(
+          blue=sRGBCompandor((double) logmap[ScaleQuantumToMap(
             GetPixelBlue(image,q))]);
           SetPixelRed(image,ClampToQuantum(red),q);
           SetPixelGreen(image,ClampToQuantum(green),q);
@@ -2709,9 +2709,9 @@ static MagickBooleanType TransformsRGBImage(Image *image,
           v=QuantumScale*GetPixelBlue(image,q);
           ConvertLuvToXYZ(L,u,v,&X,&Y,&Z);
           ConvertXYZToRGB(X,Y,Z,&red,&green,&blue);
-          SetPixelRed(image,ClampToQuantum(CompandsRGB(red)),q);
-          SetPixelGreen(image,ClampToQuantum(CompandsRGB(green)),q);
-          SetPixelBlue(image,ClampToQuantum(CompandsRGB(blue)),q);
+          SetPixelRed(image,ClampToQuantum(sRGBCompandor(red)),q);
+          SetPixelGreen(image,ClampToQuantum(sRGBCompandor(green)),q);
+          SetPixelBlue(image,ClampToQuantum(sRGBCompandor(blue)),q);
           q+=GetPixelChannels(image);
         }
         sync=SyncCacheViewAuthenticPixels(image_view,exception);
@@ -2767,9 +2767,9 @@ static MagickBooleanType TransformsRGBImage(Image *image,
             green,
             red;
 
-          red=CompandsRGB((double) GetPixelRed(image,q));
-          green=CompandsRGB((double) GetPixelGreen(image,q));
-          blue=CompandsRGB((double) GetPixelBlue(image,q));
+          red=sRGBCompandor((double) GetPixelRed(image,q));
+          green=sRGBCompandor((double) GetPixelGreen(image,q));
+          blue=sRGBCompandor((double) GetPixelBlue(image,q));
           SetPixelRed(image,ClampToQuantum(red),q);
           SetPixelGreen(image,ClampToQuantum(green),q);
           SetPixelBlue(image,ClampToQuantum(blue),q);
@@ -2835,9 +2835,9 @@ static MagickBooleanType TransformsRGBImage(Image *image,
           Y=QuantumScale*GetPixelGreen(image,q);
           Z=QuantumScale*GetPixelBlue(image,q);
           ConvertXYZToRGB(X,Y,Z,&red,&green,&blue);
-          SetPixelRed(image,ClampToQuantum(CompandsRGB(red)),q);
-          SetPixelGreen(image,ClampToQuantum(CompandsRGB(green)),q);
-          SetPixelBlue(image,ClampToQuantum(CompandsRGB(blue)),q);
+          SetPixelRed(image,ClampToQuantum(sRGBCompandor(red)),q);
+          SetPixelGreen(image,ClampToQuantum(sRGBCompandor(green)),q);
+          SetPixelBlue(image,ClampToQuantum(sRGBCompandor(blue)),q);
           q+=GetPixelChannels(image);
         }
         sync=SyncCacheViewAuthenticPixels(image_view,exception);
@@ -3202,11 +3202,11 @@ static MagickBooleanType TransformsRGBImage(Image *image,
                 pixel.blue)];
 #endif
             }
-          SetPixelRed(image,ClampToQuantum(CompandsRGB((double) 
+          SetPixelRed(image,ClampToQuantum(sRGBCompandor((double) 
             ScaleMapToQuantum(pixel.red))),q);
-          SetPixelGreen(image,ClampToQuantum(CompandsRGB((double) 
+          SetPixelGreen(image,ClampToQuantum(sRGBCompandor((double) 
             ScaleMapToQuantum(pixel.green))),q);
-          SetPixelBlue(image,ClampToQuantum(CompandsRGB((double) 
+          SetPixelBlue(image,ClampToQuantum(sRGBCompandor((double) 
             ScaleMapToQuantum(pixel.blue))),q);
           q+=GetPixelChannels(image);
         }
@@ -3267,11 +3267,11 @@ static MagickBooleanType TransformsRGBImage(Image *image,
 #endif
           }
         image->colormap[i].red=(double) ClampToQuantum(
-          CompandsRGB((double) ScaleMapToQuantum(pixel.red)));
+          sRGBCompandor((double) ScaleMapToQuantum(pixel.red)));
         image->colormap[i].green=(double) ClampToQuantum(
-          CompandsRGB((double) ScaleMapToQuantum(pixel.green)));
+          sRGBCompandor((double) ScaleMapToQuantum(pixel.green)));
         image->colormap[i].blue=(double) ClampToQuantum(
-          CompandsRGB((double) ScaleMapToQuantum(pixel.blue)));
+          sRGBCompandor((double) ScaleMapToQuantum(pixel.blue)));
       }
       (void) SyncImage(image,exception);
       break;
index 3367020661cd032c8d56e2f9ce271e3378fd65fb..f54166cb9d52a7ef6fd1cd8a41d0a59ec524193a 100644 (file)
@@ -31,20 +31,20 @@ extern "C" {
 
 #undef index
 
-static inline double CompandsRGB(const double pixel)
-{
-  if (pixel <= (0.0031308*QuantumRange))
-    return(12.92*pixel);
-  return(QuantumRange*(1.055*pow(QuantumScale*pixel,1.0/2.4)-0.055));
-}
-
-static inline double DecompandsRGB(const double pixel)
+static inline double InversesRGBCompandor(const double pixel)
 {
   if (pixel <= (0.04045*QuantumRange))
     return(pixel/12.92);
   return(QuantumRange*pow((QuantumScale*pixel+0.055)/1.055,2.4));
 }
 
+static inline double sRGBCompandor(const double pixel)
+{
+  if (pixel <= (0.0031308*QuantumRange))
+    return(12.92*pixel);
+  return(QuantumRange*(1.055*pow(QuantumScale*pixel,1.0/2.4)-0.055));
+}
+
 static inline Quantum GetPixela(const Image *restrict image,
   const Quantum *restrict pixel)
 {
@@ -220,9 +220,9 @@ static inline double GetPixelInfoIntensity(const PixelInfo *restrict pixel_info)
   if (pixel_info->colorspace != sRGBColorspace)
     return(0.298839*pixel_info->red+0.586811*pixel_info->green+
       0.114350*pixel_info->blue);
-  red=DecompandsRGB(pixel_info->red);
-  green=DecompandsRGB(pixel_info->green);
-  blue=DecompandsRGB(pixel_info->blue);
+  red=InversesRGBCompandor(pixel_info->red);
+  green=InversesRGBCompandor(pixel_info->green);
+  blue=InversesRGBCompandor(pixel_info->blue);
   return(0.298839*red+0.586811*green+0.114350*blue);
 }
 
@@ -238,9 +238,9 @@ static inline double GetPixelInfoLuminance(const PixelInfo *restrict pixel_info)
   if (pixel_info->colorspace != sRGBColorspace)
     return(0.21267*pixel_info->red+0.71516*pixel_info->green+
       0.07217*pixel_info->blue);
-  red=DecompandsRGB(pixel_info->red);
-  green=DecompandsRGB(pixel_info->green);
-  blue=DecompandsRGB(pixel_info->blue);
+  red=InversesRGBCompandor(pixel_info->red);
+  green=InversesRGBCompandor(pixel_info->green);
+  blue=InversesRGBCompandor(pixel_info->blue);
   return(0.21267*red+0.71516*green+0.07217*blue);
 }
 
@@ -259,11 +259,11 @@ static inline Quantum GetPixelIntensity(const Image *restrict image,
       0.298839*pixel[image->channel_map[RedPixelChannel].offset]+
       0.586811*pixel[image->channel_map[GreenPixelChannel].offset]+
       0.114350*pixel[image->channel_map[BluePixelChannel].offset]));
-  red=DecompandsRGB((double)
+  red=InversesRGBCompandor((double)
     pixel[image->channel_map[RedPixelChannel].offset]);
-  green=DecompandsRGB((double)
+  green=InversesRGBCompandor((double)
     pixel[image->channel_map[GreenPixelChannel].offset]);
-  blue=DecompandsRGB((double)
+  blue=InversesRGBCompandor((double)
     pixel[image->channel_map[BluePixelChannel].offset]);
   return(ClampToQuantum(0.298839*red+0.586811*green+0.114350*blue));
 }
@@ -289,11 +289,11 @@ static inline Quantum GetPixelLuminance(const Image *restrict image,
       0.298839*pixel[image->channel_map[RedPixelChannel].offset]+
       0.586811*pixel[image->channel_map[GreenPixelChannel].offset]+
       0.114350*pixel[image->channel_map[BluePixelChannel].offset]));
-  red=DecompandsRGB((double)
+  red=InversesRGBCompandor((double)
     pixel[image->channel_map[RedPixelChannel].offset]);
-  green=DecompandsRGB((double)
+  green=InversesRGBCompandor((double)
     pixel[image->channel_map[GreenPixelChannel].offset]);
-  blue=DecompandsRGB((double)
+  blue=InversesRGBCompandor((double)
     pixel[image->channel_map[BluePixelChannel].offset]);
   return(ClampToQuantum(0.21267*red+0.71516*green+0.07217*blue));
 }
index 098f5296c384f8912dacc9d1eb62f10709a48bef..7506c95c933e4514110946cfe3f36220ddf12a08 100644 (file)
@@ -606,9 +606,9 @@ static inline double XPixelIntensity(const XColor *pixel)
   double
     intensity;
 
-  red=DecompandsRGB(pixel->red);
-  green=DecompandsRGB(pixel->green);
-  blue=DecompandsRGB(pixel->blue);
+  red=InversesRGBCompandor(pixel->red);
+  green=InversesRGBCompandor(pixel->green);
+  blue=InversesRGBCompandor(pixel->blue);
   intensity=0.298839*red+0.586811*green+0.114350*blue;
   return(intensity);
 }