Hi Casper,

There is a function that does exactly what you want:

cmsHPROFILE cmsCreateLinearizationDeviceLink(icColorSpaceSignature ColorSpace,
                                                       LPGAMMATABLE 
TransferFunctions[])


You have to allocate 3 gamma tables. They should have same number of entries.

LPGAMMATABLE TransferFunctions[3];

TransferFunction[0] = cmsBuildGamma(256, 1.0);
TransferFunction[1] = cmsBuildGamma(256, 1.0);
TransferFunction[2] = cmsBuildGamma(256, 1.0);

I'm using cmsBuildGamma() because it initializes the contents of the table. You 
could
use cmsAllocGamma() but this returns garbage inside tables, as you are supposed 
to
fill the required values.

After that, you can modify the L* curve.  It would be the first one in Lab 
space:
TransferFunctions[0].  Just make sure you normalize values in range 0..0xFFFF,
so first entry should be zero and last entry 0xFFFF. This assures black is 
mapped
on black and white on white.

Then pass those curves to the function, marking the profile as operating in Lab 
space.

hProfile = cmsCreateLinearizationDeviceLink(icSigLabData, TransferFunctions);

VoilĂ , all done. The profile is not marked as "abstract" but as "devicelink". 
If you want
this detail covered, you can mark the profile as abstract by using

cmsSetDeviceClass(hProfile, icSigAbstractClass);

Anyway, that latter is not required at all.

Regards,
--
Marti Maria
The littlecms project.
www.littlecms.com




----- Original Message ----- From: "Casper Boemann" <[EMAIL PROTECTED]>
To: <lcms-user@lists.sourceforge.net>
Sent: Friday, July 29, 2005 11:07 AM
Subject: [Lcms-user] writing an advanced brightness/contrast abstract profile


Hi

I have now made a widget that lets the user specify a spline curve for
transforming lightness. like an advanced brightness/contrast dialog.

Now I wonder how I  can make an abstract profile just like the one created
by cmsCreateBCHSWabstractProfile, but taking my spline curve as input.

I was looking at the cmsAllocGamma with a lot of entries in the table, but I
don't know if this is the right way to go?

best regards / venlig hilsen
Casper Boemann




-------------------------------------------------------
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



--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.9.4/57 - Release Date: 22/07/2005





--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.9.4/57 - Release Date: 22/07/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