Any idea how to put the processing elements in the right order during 
creation of a transform from sRGB to XYZ floats?.

Following code demonstrates the issue:

/* gcc -Wall -g transforms.c -o transforms `pkg-config --cflags --libs lcms2` */
#include <lcms2.h>

void errorHandlerFunction            ( cmsContext          ContextID,
                                        cmsUInt32Number     ErrorCode,
                                        const char        * ErrorText )
{ printf( "lcms2: %s\n", ErrorText ); }


int main(int argc, char **argv)
{
   cmsSetLogErrorHandler( lcm2ErrorHandlerFunction );
   /* adapt profile paths to your needs */
   cmsHPROFILE p_in = cmsOpenProfileFromFile(
          "/usr/share/color/icc/sRGB.icc","rb");
   cmsHPROFILE p_out = cmsOpenProfileFromFile(
          "/usr/share/color/icc/XYZ.icc","rb");

   cmsUInt32Number format_in = TYPE_RGB_FLT,
                   format_out = TYPE_XYZ_FLT;
   cmsHTRANSFORM xform = cmsCreateTransform( p_in, format_in,
                                             p_out, format_out,
                                             0, 0 );
   cmsHPROFILE dl = cmsTransform2DeviceLink( xform, 4.2, 0 );

   if(!cmsSaveProfileToFile( dl, "sRGB-XYZ_dl.icc" ))
     printf("error in writing  sRGB-XYZ_dl.icc\n");

   return 0;
}


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


------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to