Hi,
>> The range of Lab as given by cmsCreateLabProfile() is :
>>
>> CIELAB (16 bit) L* 0 -> 100.0 0x0000 -> 0xff00
>> CIELAB (16 bit) a* -128.0 -> +127.996 0x0000 -> 0xffff
>> CIELAB (16 bit) b* -128.0 -> +127.996 0x0000 -> 0xffff
>
>Does this mean:
>1. You use internally 16bit integers no clean floatconversion? .. and
Yes. lcms does all critical internal computation using 16 bits, and fixed point.
> 2. the doubles are in the same range as above?
Yes. But this is really a huge gamut. ab below or above 110 are self-flourescent
hypersaturated colors, that are hard if not impossible to find in real world.
L of course cannot be greater that 100 by Lab definition.
>Does it work with double input_buffer; char output_buffer; correct:
>
>hTrans_f32lab_rgb = cmsCreateTransform(hLab, TYPE_Lab_DBL,
> hsRGB, TYPE_RGB_8,
> INTENT_PERCEPTUAL, 0);
>
>
>I use:
> f32Lab[0] = src[0] * 100; // CIE L
> f32Lab[1] = (src[1] - 0.5 ) * 256 ; // CIE a
> f32Lab[2] = (src[2] - 0.5 ) * 256 ; // CIE b
> cmsDoTransform(hTrans_f32lab_u8rgb, f32Lab, u8RGB, 1); .
Humm... what is the encoding of src[]? Is this TIFF Lab? If so,
you don't need floating point. This will slow down whole transform.
Just open lcmstiff8.icm, use TYPE_Lab_8 and then apply transform
to raw data.
// ----
hLab = cmsOpenProfileFromFile("lcmstiff8.icm", "r");
sRGB = cmsCreate_sRGBProfile();
hTrans_f32lab_rgb = cmsCreateTransform(hLab, TYPE_Lab_8,
hsRGB, TYPE_RGB_8,
INTENT_PERCEPTUAL, 0);
cmsDoTransform(hTrans_f32lab_u8rgb, src, u8RGB, 1); .
// ------
This will be way faster since no floating point conversions are involved.
If what you want is really convert floating point values, then you could
use TYPE_Lab_DBL and pass the Lab as an array of doubles. In both
cases you need not the "f32Lab[1] = (src[1] - 0.5 ) * 256 " part.
// ------
hLab = cmsCreateLabProfile(NULL);
sRGB = cmsCreate_sRGBProfile();
hTrans_f32lab_rgb = cmsCreateTransform(hLab, TYPE_Lab_8,
hsRGB, TYPE_RGB_8,
INTENT_PERCEPTUAL, 0);
double Lab[3];
Lab[0] = 50; // The Lab value Lab=(50, -10.2, 23.6)
Lab[1] = -10.2;
Lab[2] = 23.6;
cmsDoTransform(hTrans_f32lab_u8rgb, Lab, u8RGB, 1); .
// ------
Regards,
Mart�.
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Lcms-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/lcms-user