From: cristy Date: Fri, 27 Apr 2012 00:32:37 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~5710 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba7e9b3ba18f395bf9da1d9e2be997630f4cef77;p=imagemagick --- diff --git a/MagickCore/colorspace.c b/MagickCore/colorspace.c index 564c0b9d8..beacb74d9 100644 --- a/MagickCore/colorspace.c +++ b/MagickCore/colorspace.c @@ -125,17 +125,17 @@ static inline void ConvertRGBToXYZ(const Quantum red,const Quantum green, assert(Y != (double *) NULL); assert(Z != (double *) NULL); r=QuantumScale*red; - if (r > 0.04045) + if (r > 0.0404482362771082) r=pow((r+0.055)/1.055,2.4); else r/=12.92; g=QuantumScale*green; - if (g > 0.04045) + if (g > 0.0404482362771082) g=pow((g+0.055)/1.055,2.4); else g/=12.92; b=QuantumScale*blue; - if (b > 0.04045) + if (b > 0.0404482362771082) b=pow((b+0.055)/1.055,2.4); else b/=12.92; @@ -883,7 +883,7 @@ static MagickBooleanType sRGBTransformImage(Image *image, v; v=(MagickRealType) i/(MagickRealType) MaxMap; - if (((MagickRealType) i/(MagickRealType) MaxMap) <= 0.04045f) + if (((MagickRealType) i/(MagickRealType) MaxMap) <= 0.0404482362771082f) v/=12.92f; else v=(MagickRealType) pow((((double) i/MaxMap)+0.055)/1.055,2.4); @@ -1386,15 +1386,15 @@ static inline void ConvertXYZToRGB(const double x,const double y,const double z, r=3.2404542*x-1.5371385*y-0.4985314*z; g=(-0.9692660*x+1.8760108*y+0.0415560*z); b=0.0556434*x-0.2040259*y+1.0572252*z; - if (r > 0.0031308) + if (r > 0.00313066844250063) r=1.055*pow(r,1.0/2.4)-0.055; else r*=12.92; - if (g > 0.0031308) + if (g > 0.00313066844250063) g=1.055*pow(g,1.0/2.4)-0.055; else g*=12.92; - if (b > 0.0031308) + if (b > 0.00313066844250063) b=1.055*pow(b,1.0/2.4)-0.055; else b*=12.92; @@ -2318,7 +2318,7 @@ static MagickBooleanType TransformsRGBImage(Image *image, v; v=(MagickRealType) i/(MagickRealType) MaxMap; - if (((MagickRealType) i/(MagickRealType) MaxMap) <= 0.0031308) + if (((MagickRealType) i/(MagickRealType) MaxMap) <= 0.00313066844250063) v*=12.92f; else v=(MagickRealType) (1.055*pow((double) i/MaxMap,1.0/2.4)-0.055); @@ -2583,17 +2583,17 @@ static MagickBooleanType TransformsRGBImage(Image *image, } case RGBColorspace: { - if ((QuantumScale*pixel.red) <= 0.0031308) + if ((QuantumScale*pixel.red) <= 0.00313066844250063) pixel.red*=12.92f; else pixel.red=(MagickRealType) QuantumRange*(1.055*pow( QuantumScale*pixel.red,(1.0/2.4))-0.055); - if ((QuantumScale*pixel.green) <= 0.0031308) + if ((QuantumScale*pixel.green) <= 0.00313066844250063) pixel.green*=12.92f; else pixel.green=(MagickRealType) QuantumRange*(1.055*pow( QuantumScale*pixel.green,(1.0/2.4))-0.055); - if ((QuantumScale*pixel.blue) <= 0.0031308) + if ((QuantumScale*pixel.blue) <= 0.00313066844250063) pixel.blue*=12.92f; else pixel.blue=(MagickRealType) QuantumRange*(1.055*pow( @@ -2667,17 +2667,17 @@ static MagickBooleanType TransformsRGBImage(Image *image, } case RGBColorspace: { - if ((QuantumScale*pixel.red) <= 0.0031308) + if ((QuantumScale*pixel.red) <= 0.00313066844250063) pixel.red*=12.92f; else pixel.red=(MagickRealType) QuantumRange*(1.055* pow(QuantumScale*pixel.red,(1.0/2.4))-0.055); - if ((QuantumScale*pixel.green) <= 0.0031308) + if ((QuantumScale*pixel.green) <= 0.00313066844250063) pixel.green*=12.92f; else pixel.green=(MagickRealType) QuantumRange*(1.055* pow(QuantumScale*pixel.green,(1.0/2.4))-0.055); - if ((QuantumScale*pixel.blue) <= 0.0031308) + if ((QuantumScale*pixel.blue) <= 0.00313066844250063) pixel.blue*=12.92f; else pixel.blue=(MagickRealType) QuantumRange*(1.055*