On Feb 21, 2011, at 2:57 PM, Jon Cruz wrote:
So in general I think having a few modes with 'baked in' color ICC profiles instead of raw code to do a conversion would be more flexible and more useful to the end users. Also it would probably be easier to finish the last 20% of getting the code correct.
Let me know if you need a hand poking at that LCMS code. As a first step you can probably create a gray profile and use lcms calls to replace the 0.33 0.59 0.11 function implementation with lcms which will take care of the whole convert-to-linear-then-do-the-work-then-convert-back munge of math.
The CMS color picker code uses lcms to convert values one RGB triplet at a time, so you can use it that way. Or you can use a single lcms call to convert an entire buffer at once. That would probably be a very simple first step, and would be not nearly as complex as starting by changing the UI approach you have, etc.