[Webkit-unassigned] [Bug 23462] Add RGB -> CMYK conversion algorithm

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 21 21:59:17 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=23462





------- Comment #7 from mitz at webkit.org  2009-01-21 21:59 PDT -------
(In reply to comment #6)
> I'm still confused.
> 
> If I have a value x in the range [0-1] and need to map that to the range [0-n],
> then I multiply x by n. Perhaps I'm not understanding your syntax though. Could
> you post what you think the code should look like?

Multiplication by n is correct if you are mapping floating point numbers to
floating point numbers, but your mapping is to the set of integers {0, 1, ...,
n}. static_cast<int>(n * x) truncates the result of the multiplication, meaning
the only x value mapping to n is 1. I think static_cast<int>(nextafter(n, 0) *
x) would map intervals of equal length to each integer in the set.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list