Ok, I see the logic. Even if I don't use Lcms v2.0 (but the 1.9), the AToB0 can contains only a matrix, with linear tone curves, so I can find a way to do this with the LUT functions of the 1.9 version... And, I suppose that I have to add the reverse BtoA0 because the profile could be used both ways, in this case, I would create a "colorspace" profile instead of "abstract" one and add the other tags (AtoB1...), but it's only semantic...
The goal is to create a transform that accept PCS in other viewing conditions than D50/2°. By using the chromatic adaptation matrix inside the profile before using the profile itself (by using for example cmsCreateMultiprofileTransform() or similar functions), I can drive directly the transform with the values in the right conditions, creating a kind of ICC profile with a "non-D50" PCS. All right, I'll dig into this ! Thanks for all, J. -----Message d'origine----- De : marti.ma...@littlecms.com [mailto:marti.ma...@littlecms.com] Envoyé : mardi 18 mai 2010 13:49 À : Prevost Jerome Cc : lcms-user@lists.sourceforge.net Objet : Re: [Lcms-user] Building a lightweight abstract profile. Hi, > I would like to know if there is a way to create a simple abstract > profile using only a 3x3 matrix, for example a XYZ<->XYZ profile with > a Bradford matrix transform without creating heavy 3D Luts or other > big structures. A profile similar to a monitor one but with PCS<->PCS > transform would be great, but I don't know if it's possible or even > accepted by the ICC standard... It is certainly possible. You need, however, a V4 profile. AToB0 tag needs tone curves + matrix/offset + tone curves The code in lcms 2 would be something like the code I'm attaching below. Hope this helps Marti --- #include "lcms2.h" int main(void) { cmsHPROFILE hProfile; cmsPipeline* Pipeline = cmsPipelineAlloc(0, 3, 3); cmsFloat64Number Data[] = { 1, 0, 0, 0, 1, 0, 0, 0, 1}; cmsFloat64Number Offset[] = { 0, 0, 0 }; cmsToneCurve* Linear3[3]; hProfile = cmsCreateProfilePlaceholder(0); cmsSetProfileVersion(hProfile, 4.2); cmsSetDeviceClass(hProfile, cmsSigAbstractClass); cmsSetColorSpace(hProfile, cmsSigXYZData); cmsSetPCS(hProfile, cmsSigXYZData); Linear3[0] = Linear3[1] = Linear3[2] = cmsBuildGamma(0, 1.0); cmsPipelineInsertStage(Pipeline, cmsAT_BEGIN, cmsStageAllocToneCurves(0, 3, Linear3)); cmsPipelineInsertStage(Pipeline, cmsAT_END, cmsStageAllocMatrix(0, 3, 3, Data, Offset)); cmsPipelineInsertStage(Pipeline, cmsAT_END, cmsStageAllocToneCurves(0, 3, Linear3)); cmsFreeToneCurve(Linear3[0]); cmsWriteTag(hProfile, cmsSigAToB0Tag, Pipeline); cmsPipelineFree(Pipeline); cmsSaveProfileToFile(hProfile, "abstract_xyz.icc"); cmsCloseProfile(hProfile); return 0; } ------------------------------------------------------------------------------ _______________________________________________ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user