% Graphic Gems - Graphic Support Methods %
% %
% Software Design %
-% John Cristy %
+% Cristy %
% August 1996 %
% %
% %
-% Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
assert(red != (double *) NULL);
assert(green != (double *) NULL);
assert(blue != (double *) NULL);
- ConvertLCHabToXYZ(100.0*luma,255.0*(chroma-0.5),255.0*(hue-0.5),&X,&Y,&Z);
+ ConvertLCHabToXYZ(100.0*luma,255.0*(chroma-0.5),360.0*hue,&X,&Y,&Z);
ConvertXYZToRGB(X,Y,Z,red,green,blue);
}
\f
assert(red != (double *) NULL);
assert(green != (double *) NULL);
assert(blue != (double *) NULL);
- ConvertLCHuvToXYZ(100.0*luma,354.0*chroma-134.0,262.0*hue-140.0,&X,&Y,&Z);
+ ConvertLCHuvToXYZ(100.0*luma,255.0*(chroma-0.5),360.0*hue,&X,&Y,&Z);
ConvertXYZToRGB(X,Y,Z,red,green,blue);
}
\f
*hue=180.0*atan2(255.0*(b-0.5),255.0*(a-0.5))/MagickPI/360.0;
if (*hue < 0.0)
*hue+=1.0;
- *hue+=0.5;
}
MagickPrivate void ConvertRGBToLCHab(const double red,const double green,
v;
ConvertXYZToLuv(X,Y,Z,luma,&u,&v);
- *chroma=(hypot(354.0*u-134.0,262.0*v-140.0)+134.0)/354.0;
+ *chroma=hypot(354.0*u-134.0,262.0*v-140.0)/255.0+0.5;
*hue=180.0*atan2(262.0*v-140.0,354.0*u-134.0)/MagickPI/360.0;
if (*hue < 0.0)
*hue+=1.0;
- *hue=(255.0**hue+140.0)/262.0;
}
MagickPrivate void ConvertRGBToLCHuv(const double red,const double green,