[Lcms-user] Idiots guide to CMYK->RGB conversions
An ICC-based CMM for color management
Brought to you by:
mm2
From: Brian F. <br...@da...> - 2001-08-28 22:16:38
|
Hi, I've looked at every message on this list and I can't figure out how to = convert CMYK values into RGB values using the API I understand fully the concepts beign used here but I'm a total beginner = when it comes to the C language. Please, please, could you send me some code on how to do this... If not = please explain my question below. I've looked at the 'simple.c' file included with the source and I cant = figure how to use it? What type are inputBuffer & outputBuffer. Do I = pass an array of values into the function cmsDoTransform()? here is what I have being messing around with so far (see below), If = anyone could make this work I would be able to adapt it into a simple = program and that's all I need. Thanks a million.... Brian Fallon SHORT inputBuffer[] =3D {0x00,0x00,0x00,0x00}; SHORT outputBuffer[3]; cmsHPROFILE hInProfile, hOutProfile; cmsHTRANSFORM hTransform; hInProfile =3D = cmsOpenProfileFromFile("D:/Downloads/Development/lcms/lcms107b/profiles/t= r01_d50.icm", "r"); hOutProfile =3D = cmsOpenProfileFromFile("D:/Downloads/Development/lcms/Lcms107b/profiles/s= RGB Color Space Profile.ICM", "r");=20 hTransform =3D cmsCreateTransform(hInProfile, TYPE_CMYK_16, = hOutProfile, TYPE_RGB_8, INTENT_PERCEPTUAL, 0); cmsDoTransform(hTransform, inputBuffer, outputBuffer, 1); cmsDeleteTransform(hTransform); cmsCloseProfile(hInProfile); cmsCloseProfile(hOutProfile); printf("Input values: cmyk( %d, %d, %d, %d )\n", inputBuffer[0], = inputBuffer[1], inputBuffer[2], inputBuffer[3]); printf("Input values: rgb( %d, %d, %d)\n", outputBuffer[0], = outputBuffer[1], outputBuffer[2]); return 0;=20 } |