From: <ma...@li...> - 2001-05-03 08:36:20
|
Hi, > Marti, > One more question. I'm trying to figure out the proper coding for > TYPE_XYZ_16. I'm taking Kodak Q60 data and trying to feed the XYZ = values to > LCMS, but I don't seem to have the magnitude quite right. >=20 > For example, on my Q60 color chart, white (Dmin) is XYZ: 77.49, 80.31, = 69.06 >=20 > What is LCMS expecting to see for these XYZ values? For example, the = Y value > is 80.31. I know that LCMS expects to see a word (16 bit number), but = what is > the value for 80.31? I've tried these equations and neither seem to = give the > right result: lcms does expect values between 0 and 1.99996. The function for convert = from floating point to fixed point is: WORD XYZ2Fix(double d) { return (WORD) ((Fixed32) (DOUBLE_TO_FIXED(d) >> 1)); } In Delphi this is something like (round(x * 65536.0)) shr 1 XYZ does operate on 1.15 fixed point, so, doing * 65536 does convert to=20 15.16 and the shift right does convert to 1.15. About the 80.31, well, what happens is that IT8 does use "absolute" = values.=20 Just divide by 100 before passing to this function. Taking your data, 80.31 -> Divide by 10 -> 0.8031 -> Apply XYZ2Fix -> 26316 Besides, If you plan to use XYZ, be shure to include = cmsFLAGS_NOTPRECALC in the "flags" parameter of cmsCreateTransform(). This is needed since = trilinear interpolation could give slightly wrong numbers... XYZ does operate on = gamma 1.0, and the gamut is so big that interpolation would need twice as points as = it is currently=20 using. Regards, Mart=ED Maria The little cms project http://www.littlecms.com ma...@li... |