Re: [AD] patches for color.c and graphics.c

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Fri, 2006-12-01 at 01:42 -0600, Robert Jr Ohannessian wrote:
> I think we should switch to round(x * 255.0 / 63) (or strictly 
> equivalent non-floating point function), to match every other reasonable 
> graphics API (and hardware) on the planet.

Yes. In fact, I converted all 256 values to 6-bit and back to 8-bit, and
summed up how much the value would go over the original value, and how
much below. The results:

*255/63: +90 -270 (standard deviation: 1.479)
<<2 + >>4: +160 -160 (standard deviation: 1.581)
Bob's way: +150 -150 (standard deviation: 1.479)

So there's a clear winner, which would explain why everyone uses it.

I'll try to make another patch (although of course, visually, hardly any
difference can be seen again)..

-- 
Elias Pschernig





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/