assert(Pr != (double *) NULL);
*Y=QuantumScale*(0.298839*red+0.586811*green+0.114350*blue);
*Pb=QuantumScale*((-0.1687367)*red-0.331264*green+0.5*blue)+0.5;
- *Pr=QuantumScale*(0.5*QuantumScale*red-0.418688*green-0.081312*blue)+0.5;
+ *Pr=QuantumScale*(0.5*red-0.418688*green-0.081312*blue)+0.5;
}
static void ConvertRGBToYCbCr(const double red,const double green,
const double blue,double *Y,double *Cb,double *Cr)
{
/*
- Convert RGB to -YCbCr colorspace.
+ Convert RGB to YCbCr colorspace.
*/
assert(Y != (double *) NULL);
assert(Cb != (double *) NULL);
const double Cr,double *red,double *green,double *blue)
{
/*
- Convert -YCbCr to RGB colorspace.
+ Convert YCbCr to RGB colorspace.
*/
assert(red != (double *) NULL);
assert(green != (double *) NULL);
static inline double gamma_pow(const double value,const double gamma)
{
- return(value < 0.0 ? value : pow(value,1.0/gamma));
+ return(value < 0.0 ? value : pow(value,gamma));
}
MagickExport MagickBooleanType GammaImage(Image *image,const double gamma,
ClampToQuantum(image->colormap[i].alpha))];
#else
if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
- image->colormap[i].red=gamma_pow(image->colormap[i].red,1.0/gamma);
+ image->colormap[i].red=QuantumRange*gamma_pow(QuantumScale*
+ image->colormap[i].red,1.0/gamma);
if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
- image->colormap[i].green=gamma_pow(image->colormap[i].green,1.0/gamma);
+ image->colormap[i].green=QuantumRange*gamma_pow(QuantumScale*
+ image->colormap[i].green,1.0/gamma);
if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
- image->colormap[i].blue=gamma_pow(image->colormap[i].blue,1.0/gamma);
+ image->colormap[i].blue=QuantumRange*gamma_pow(QuantumScale*
+ image->colormap[i].blue,1.0/gamma);
if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
- image->colormap[i].alpha=gamma_pow(image->colormap[i].alpha,1.0/gamma);
+ image->colormap[i].alpha=QuantumRange*gamma_pow(QuantumScale*
+ image->colormap[i].alpha,1.0/gamma);
#endif
}
/*
#if !defined(MAGICKCORE_HDRI_SUPPORT)
q[i]=gamma_map[ScaleQuantumToMap(q[i])];
#else
- q[i]=gamma_pow((double) q[i],1.0/gamma);
+ q[i]=QuantumRange*gamma_pow(QuantumScale*q[i],1.0/gamma);
#endif
}
q+=GetPixelChannels(image);