[cairo] Replicating top bits in conversion from 565 to 8888
sandmann at daimi.au.dk
Sun Sep 14 12:41:06 PDT 2008
Another issue I noticed: When converting from 565 to 8888, currently
we are just appending zeros. This is problematic in a number of cases;
for example a pure white gets converted to a shade of gray. The
standard way to do these kinds of conversions is to replicate the top
bits, ie., to do
12345 -> 12345123
12345 -> 12345000
The attached patch implements that. If it looks ok to you, I'll push
it for the 0.12.0 release.
I also noticed that it doesn't use the multiplication trick that is
used in the MMX code. Would it be worthwhile doing that? I originally
copied the trick from code that Owen wrote, but I never checked that
it is actually faster than just shifting.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 0 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20080914/0838c8b1/attachment.bin
More information about the cairo