Am 06.02.03, 19:47 +0100 schrieb Mart� Maria:
 ...

> >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);  .

The encoding of src is double with an range of 0.0 - 1.0 for each of the
three samples. My most interesst is using floats with at least 16bit.

>
> 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,
                                     I have doules here-^
>                                        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.

Awaiting ;-)

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

I dont understand how it makes sense to switch from doubles to 8bit
integers for hLab? You really mean downsampling?

> 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);  .
> // ------

I think I did it with the my above code. Still, the result is not what I
expected. (I used f32 as simple float and with casting to double -> same
result.)
Maybe as You don't use floats anyway, I rewrite it and use 16bit integers.
That worked right.

> Regards,
> Mart�.

thanks
Kai-Uwe



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

Reply via email to