Hi Marti,
just grabbed and tested it. Working perfectly now. Thx.
I've gone through some code to better understand pipelines and found the
function EvaluateXYZ2Lab in cmslut.c
I see both Lab and XYZ are encoded from 0...1 internally.
Is Lab and XYZ float data always within the range 0...1?
Can you share the reason why.
// From 0..1.0 to XYZ
XYZ.X = In[0] * XYZadj;
XYZ.Y = In[1] * XYZadj;
XYZ.Z = In[2] * XYZadj;
cmsXYZ2Lab(NULL, &Lab, &XYZ);
// From V4 Lab to 0..1.0
Out[0] = (cmsFloat32Number) (Lab.L / 100.0);
Out[1] = (cmsFloat32Number) ((Lab.a + 128.0) / 255.0);
Out[2] = (cmsFloat32Number) ((Lab.b + 128.0) / 255.0);
Best regards
Mark
On 31.05.2010, at 11:38, [email protected] wrote:
>
>
> Hi Mark,
>
> Fixed in git. I have also added Lab+alpha formatters to
> lcms2.h default list.
>
> Regards
> Marti
>
>
> Quoting Mark <[email protected]>:
>
>> Great, many thanks!
>>
>>
>> BTW:
>> I'm just in the middle of updating some Cocoa wrapper classes to use LCMS
>> 2.0.
>> Since the "internals" of LCMS changed a lot from 1.x to 2.x some refactoring
>> is needed.
>>
>> But the new concept of Pipelines is awesome!
>>
>> Thank's a lot Marti. This is an awesome library.
>>
>> Best regards
>> Mark
>>
>>
>> On 29.05.2010, at 15:57, [email protected] wrote:
>>
>>>
>>> Hi Mark,
>>>
>>> I see. The formatter selection code does revert
>>> your types to the generic formatter instead of
>>> using the Lab template. As a result Lab space
>>> is encoded in range 0..1.0 instead of 0..100,
>>> -127...+128.
>>>
>>> Ok, it may be regarded as a bug, and I have it
>>> already fixed. Will commit the changes on git
>>> probably on monday, as right now the server
>>> where I keep the sandbox is down.
>>>
>>> Thanks for reporting.
>>> Marti
>>>
>>>
>>>
>>> Quoting Mark <[email protected]>:
>>>
>>>> Hi,
>>>>
>>>> I'd like to use 16 byte float pixels for RGA, Lab and XYZ conversions - so
>>>> I tried defining these:
>>>>
>>>> #define TYPE_XYZA_FLT
>>>> (FLOAT_SH(1)|COLORSPACE_SH(PT_XYZ)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(4))
>>>> #define TYPE_LabA_FLT
>>>> (FLOAT_SH(1)|COLORSPACE_SH(PT_Lab)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(4))
>>>> #define TYPE_RGBA_FLT
>>>> (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(4))
>>>>
>>>> But it looks like something is wrong.
>>>>
>>>> Using the LCMS built in formats (TYPE_RGB_FLT, TYPE_XYZ_FLT, TYPE_Lab_FLT)
>>>> I get the following:
>>>>
>>>> sRGB -> XYZ -> sRGB
>>>> 1.000000, 1.000000, 1.000000
>>>> 0.964200, 1.000000, 0.824900
>>>> 1.000000, 1.000000, 1.000000
>>>>
>>>> sRGB -> Lab -> sRGB
>>>> 1.000000, 1.000000, 1.000000
>>>> 100.000000, 0.000008, -0.000008
>>>> 1.000000, 1.000000, 1.000000
>>>>
>>>> Lab -> XYZ -> Lab
>>>> 100.000000, 0.000000, 0.000000
>>>> 0.964200, 1.000000, 0.824900
>>>> 100.000000, 0.000008, 0.000008
>>>>
>>>>
>>>> Using the formats I defined (TYPE_XYZA_FLT, TYPE_LabA_FLT, TYPE_RGBA_FLT):
>>>>
>>>> sRGB -> XYZ -> sRGB
>>>> 1.000000, 1.000000, 1.000000, 0.000000
>>>> 0.482107, 0.500008, 0.412456, 0.000000
>>>> 1.000000, 1.000000, 1.000000, 0.000000
>>>>
>>>> sRGB -> Lab -> sRGB
>>>> 1.000000, 1.000000, 1.000000, 0.000000
>>>> 1.000000, 0.501961, 0.501961, 0.000000
>>>> 1.000000, 1.000000, 1.000000, 0.000000
>>>>
>>>> Lab -> XYZ -> Lab
>>>> 100.000000, 0.000000, 0.000000, 0.000000
>>>> 307598.437500, 321873.781250, 271461.625000, 0.000000
>>>> 100.000000, -0.000001, 0.000000, 0.000000
>>>>
>>>> Any ideas what I'm doing wrong?
>>>>
>>>> Thanks
>>>> Mark
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>> _______________________________________________
>> Lcms-user mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/lcms-user
>>
>
>
------------------------------------------------------------------------------
_______________________________________________
Lcms-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lcms-user