From: Robert V C. <Rob...@us...> - 2009-09-30 14:58:12
|
I should have replied all to post. Sorry for the duplicate Isaac. Thanks Isaac, that was the problem, I forgot the divide by 100. The conversion seems to be in D50, I set the white point to D65 at 10 degrees but the results always seem to be in D50 space 2 degree. I am comparing it to Lindblooms calculator and I get the D50 answer not D65. Any clue? Thanks again, Bob "Case, Isaac" <Isa...@xe...> 09/30/2009 09:50 AM To Robert V Canning/AE/DuPont@DuPont, <lcm...@li...> cc Subject RE: [Lcms-user] XYZ to RGB Conversion What range of values are you passing in as XYZ. I just tried and got X:0.5 Y:0.5 Z:0.5 -> R:190 G:185 B:207 However, if you are expecting a range of X from 0 to 95.047 Y from 0 to 100.000 Z from 0 to 108.883 You’ll need to divide by 100 for everything. -Isaac Case From: Robert V Canning [mailto:Rob...@us...] Sent: Wednesday, September 30, 2009 8:11 AM To: lcm...@li... Subject: [Lcms-user] XYZ to RGB Conversion Hi, I want to be able to convert an XYZ value to RGB. I took the following steps: - created a XYZ profile used as input. - created a sRGB profile used as output - intent is set to perceptual - created a transform - loaded the XYZ values - did the transform The problem is no matter what the XYZ value I always get 255 for the RGB values. What am I doing wrong? Thanks for any help. void XYZtoRGB(double X, double Y, double Z, unsigned char &red, unsigned char &green, unsigned char &blue) cmsCIEXYZ XYZ; BYTE output[3]; XYZ.X = X; XYZ.Y = Y; XYZ.Z = Z; cmsHTRANSFORM hXYZtoRGBTransform; cmsHPROFILE hXYZProfile; cmsHPROFILE hsRGBProfile; hXYZProfile = cmsCreateXYZProfile(); hsRGBProfile = cmsCreate_sRGBProfile(); // Rendering intent is perceptual hXYZtoRGBTransform = cmsCreateTransform(hXYZProfile, TYPE_XYZ_DBL, hsRGBProfile, TYPE_RGB_8, 0, cmsFLAGS_NOTPRECALC); cmsDoTransform(hXYZtoRGBTransform, &XYZ, output, 1); red = output[0]; green = output[1]; blue = output[2]; cmsDeleteTransform(hXYZtoRGBTransform); cmsCloseProfile(hXYZProfile); cmsCloseProfile(hsRGBProfile); } This communication is for use by the intended recipient and contains information that may be Privileged, confidential or copyrighted under applicable law. If you are not the intended recipient, you are hereby formally notified that any use, copying or distribution of this e-mail, in whole or in part, is strictly prohibited. Please notify the sender by return e-mail and delete this e-mail from your system. Unless explicitly and conspicuously designated as "E-Contract Intended", this e-mail does not constitute a contract offer, a contract amendment, or an acceptance of a contract offer. This e-mail does not constitute a consent to the use of sender's contact information for direct marketing purposes or for transfers of data to third parties. Francais Deutsch Italiano Espanol Portugues Japanese Chinese Korean http://www.DuPont.com/corp/email_disclaimer.html This communication is for use by the intended recipient and contains information that may be Privileged, confidential or copyrighted under applicable law. If you are not the intended recipient, you are hereby formally notified that any use, copying or distribution of this e-mail, in whole or in part, is strictly prohibited. Please notify the sender by return e-mail and delete this e-mail from your system. Unless explicitly and conspicuously designated as "E-Contract Intended", this e-mail does not constitute a contract offer, a contract amendment, or an acceptance of a contract offer. This e-mail does not constitute a consent to the use of sender's contact information for direct marketing purposes or for transfers of data to third parties. Francais Deutsch Italiano Espanol Portugues Japanese Chinese Korean http://www.DuPont.com/corp/email_disclaimer.html |