Hi,
That's just math. If you have anything coming in 16 bits, the range is
0..0xffff, then we want to convert to the range 0..1.0, so we have to
multiply by the new range and then divide by the old range
1.0
x * --------
65535
Since lcms uses fixed point to encode values, 1.0 is represented as
0x10000, which is 65536, and the factor comes:
65536
x * -----
65535
This can be optimized as (x + x7fff) / xffff
Whithout this ajust, results are not accurate.
Regards
Marti
Original Message:
-----------------
From: Will Cook [email protected]
Date: Mon, 20 Dec 2010 07:33:32 -0600
To: [email protected]
Subject: [Lcms-user] cmsToFixedDomain
I've been using LCMS for a while now. I think its great!
I have a question:
Why does it call "_cmsToFixedDomain" at every stage in
the BToA pipeline? To my thinking, this messes up the
values, because the results of one transform are modified
slightly before they go through the next translation. This
makes it difficult, if not impossible, to align the interpolations
in even boundaries, so that creating accurate profiles is very difficult.
Here is what I see as the typical Curve/LUT/Curve translation,
using the BtoA table as an example, with LAB PCS.
1. start with lab [0..100 -128..0..127 -128.0.127 ]
2. convert lab to uint16 encoding [L* a* b*]:
[ 0..65280 0..32768..65280 0..32768..65280 ]
[ 0..xFF00 0..x8000..xFF00 0..x8000..xFF00 ]
3. first curve:
3a. convert to "fixed domain"
a -> a + ((a + x7fff) / xffff);
3b. look up in table to get N
4. LUT
4a. convert N to fixed domain
N -> N + ((N + x7fff) / xffff);
4b. look up in LUT to get M
5. second curve
5a. convert M to fixed domain
M -> M + ((M + x7fff) / xffff);
5b. look up in table to get Result
The fact that (X + x7fff) / xffff gets added in at each
stage is very annoying.. is there a good way to think
about this that makes sense?
Note that the ICC spec says this:
"If the input is the XYZ PCS, 1+(32767/32768) shall be mapped to the value
1,0. If the output is the XYZ PCS, the value 1,0 shall be mapped to
1+(32767/32768)."
But this only happens when using XYZ. Whe does LCMS do it with Lab?
Will
----------------------------------------------------------------------------
--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment,
and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Lcms-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lcms-user
--------------------------------------------------------------------
mail2web.com – Enhanced email for the mobile individual based on Microsoft®
Exchange - http://link.mail2web.com/Personal/EnhancedEmail
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Lcms-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lcms-user