XIAOCAO,

did you test all the intermediate results for existence, e.g.
if(!hInProfile) {
  error = 1; exit error; }
and so on.
The next would be to look at the input and output buffers content.
Step 5, personally I never needed.

kind regards
Kai-Uwe Behrmann
--
developing for colour management www.behrmann.name + www.oyranos.org


Am 03.12.08, 12:11 +0800 schrieb XIAOCAO:
I have trouble with converting some couples of RGB pixels into CIELAB color 
space based on an rgb icc profile(eg. sRGB.icm). I take the following steps:
Here are some variables: unsigned char *bufferIn;
         WORD *bufferOut;
         cmsCIELab lab;
         WORD wlab[3];
1) open a rgb profile to get the input handle
cmsHPROFILE hInProfile = cmsOpenProfileFromFile("sRGB.icm","r");
2) create a CIELAB profile as output profile
cmsHPROFILE hOutProfile = cmsCreateLabProfile(NULL);
3) build a transform
cmsHTRANSFORM Xform = 
cmsCreateTransform(hInProfile,TYPE_RGB_8,hOutProfile,TYPE_Lab_16,INTENT_PERCEPTUAL,cmsFLAGS_NOTPRECALC);
4) do the transform
 cmsDoTransform(bufferIn,bufferOut, size);
5) process the pixels one by one ( one pixel for example) and decode them into 
plane code
    cmsLabEncoded2Float(&lab,bufferOut);
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to