[Bf-committers] edgeRender patch

LarstiQ bf-committers@blender.org
Thu, 27 Mar 2003 13:00:14 +0100


On Fri, Mar 28, 2003 at 03:20:36AM +0100, Jeroen Lamain wrote:
> 
> Hi guys,
> 
> I removed floating point calculations from addEdgeOver in edgeRender.c
> 
> I think the fixed point mathematics are correct. can someone check ?
> The clipping if's are not necessary anymore because
> (255-alpa)*src+(alpha*dst) can never be greater than 256*255.
> 
> Please correct me if I'm wrong.

I _think_ that is correct, functionally equivalent to the old code. It
does sort of assume an usigned char has 0xFF as a maximum value, but
that assumption was there before also. I have no idea what the tradeoff
is between not using float divisions and no more casting to float,
profiling might help here. 
I'm not familiar with the code, and not exactly great at this kind of
math, so could anyone who is step in? :)

LarstiQ