Hi Jerome, This is documented in the tutorial, please take a look on the last section. (Annex B)
http://www.littlecms.com/TUTORIAL.TXT Using cmsFLAGS_NOTPRECALC solves the issue. Hope this helps, Regards Marti Maria The littleCMS project http://www.littlecms.com ----- Original Message ----- From: "Prevost Jerome" <[EMAIL PROTECTED]> To: <lcms-user@lists.sourceforge.net> Sent: Friday, May 18, 2007 5:40 PM Subject: [Lcms-user] Conversion problems Hello, I just tried to use Little CMS as an alternative to the Kodak CMS API, but I encounter some weird problems. Here is a very simple code that I don't succeeded in making it working. void Test(void) { double XYZ[3]={0.964220,1.0,0.8249}; double Lab[3]={100.0,0.0,0.0}; short sXYZ[3]={(short)(0.964220*32768+0.5),(short)(32768+0.5),(short)(0.82521* 32768+0.5)}; char RGB[3]; cmsHTRANSFORM Trans; memset(RGB,0,3); Trans=cmsCreateTransform(cmsCreateXYZProfile(),TYPE_XYZ_DBL,cmsCreate_sR GBProfile(),TYPE_RGB_8,0,0); cmsDoTransform(Trans,XYZ,RGB,1); cmsDeleteTransform(Trans); memset(RGB,0,3); Trans=cmsCreateTransform(cmsCreateXYZProfile(),TYPE_XYZ_16,cmsCreate_sRG BProfile(),TYPE_RGB_8,0,0); cmsDoTransform(Trans,sXYZ,RGB,1); cmsDeleteTransform(Trans); memset(RGB,0,3); Trans=cmsCreateTransform(cmsCreateLabProfile(NULL),TYPE_Lab_DBL,cmsCreat e_sRGBProfile(),TYPE_RGB_8,0,0); cmsDoTransform(Trans,Lab,RGB,1); cmsDeleteTransform(Trans); } The goal is simply to get RGB values for the D50 illuminant (normally 255,255,255). It works when creating transform using Lab as input profile (third case), but it does not work for XYZ versions (first two cases with double and 16 bit values). Why I can not get right RGB values when working in XYZ (249 253 253 instead of 255 255 255) ? I verified that these XYZ values are converted to 100, 0, 0 lab values when using functions like cmsXYZ2Lab. I use LCMS 1.16 with visual 2005. J. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user