HI,
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);
//////////////////////////////////////////////////
Am I right?
however I get a bad result ,can anyone tell me how to do the transform??
Regards
------------------------------------------------------------------------------------------------
Z. H. Cao
------------------------------------------------------------------------------------------------
___________________________________________________________
好玩贺卡等你发,邮箱贺卡全新上线!
http://card.mail.cn.yahoo.com/
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user