Hi,
The matrix XYZ -
I'm trying to write a little application that produces ICC profiles for the simulation of color blindness (deuteranopia and protanopia).

I think the correct way to deal with that would be to build an
abstract XYZ -> XYZ profile holding the simulation. In this
way you got no dependencies on any RGB space.

XYZ can be readily obtained by chaining XYZ to LMS and LMS to XYZ matrices. You need not RGB anymore because all that is handled by the input/output profiles. A multiprofile transform may be used latter to obtain the RGB -> RGB, by means of icclink, for example.

As additional benefit you are not restricted to RGB anymore.

For bulding such abstract profile, you need a something like:

hProfile = cmsOpenProfileFromFile("abstract.icc", "w");
AToB0 = cmsAllocLUT();
cmsAlloc3DGrid(AToB0, GRID_POINTS, 3, 3);
cmsSample3DGrid(AToB0, Forward, NULL, 0);
cmsAddTag(hProfile, icSigAToB0Tag, AToB0);
cmsSetColorSpace(hProfile, icSigXYZData);
cmsSetPCS(hProfile, icSigXYZData);
cmsSetDeviceClass(hProfile, icSigAbstractClass);
cmsCloseProfile(hProfile);
cmsFreeLUT(AToB0);

Then, you need to write the callback:

static
int Forward(register WORD In[], register WORD Out[], register LPVOID Cargo)
{ cmsCIEXYZ XYZ;
cmsXYZEncoded2Float(&XYZ, In);
// ... apply here the transform XYZ = [M] * XYZ
cmsFloat2XYZEncoded(Out, &XYZ);
return TRUE;
}

Hope this helps
Regards,
--
Marti Maria
The littlecms project.
www.littlecms.com


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.18/91 - Release Date: 06/09/2005



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to