RE: [AD] small bug in 15 and 16 bit asm color converters |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Sat, 2004-10-23 at 11:09 -0700, Robert Ohannessian wrote:
> You'd normally do:
>
> Red8 = (red5 << 3) | (red5 >> 2);
>
> This will replicate the upper bits of red5 into the bottom of red8. This
> effectively makes 31 map to 255 and 0 map to 0.
>
Ah, yes. Quite simple. And probably faster than a LUT. But it definitely
will be slower than a single POR. So, before implementing it, is there
really a problem with having 7/3/7 as black? It feels wrong of course
(same as having 248/251/248 as white, like Allegro currently does) - but
the former doesn't look wrong, while the latter does (on my monitor).
--
Elias Pschernig