Hi, Kai-Uwe Behrmann :
Thanks for your kindness!!
I look through the codes carefully and finally find the mistake!  I have set a 
wrong buffer type and after I correct it , it performs well.
I noticed in your letter you wrote that: 
>5, personally I never needed.
Why? The function decodes the encoded values into plane codes just as what we 
usually see it. I think it's more intuitively.



--------------------------------------------------------------------------------
Kind regards
Z.H. Cao
--------------------------------------------------------------------------------




________________________________
发件人: Kai-Uwe Behrmann <k...@gmx.de>
收件人: XIAOCAO <chaohui...@yahoo.cn>
抄送: lcms <lcms-user@lists.sourceforge.net>
已发送: 2008/12/15(周一), 下午3:12:11
主题: Re: [Lcms-user] Trouble with converting rgb to lab

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);


      ___________________________________________________________ 
  好玩贺卡等你发,邮箱贺卡全新上线! 
http://card.mail.cn.yahoo.com/
------------------------------------------------------------------------------
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