Re: [AD] Small bugfix in hsv_to_rgb() and smaller fix in rgb_to_hsv()

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


> Strictly speaking, I think the threshold should be something like
> 1.0f/512.0f rather than FLT_EPSILON. The reason is, if saturation is
> smaller than 1/512, the difference between the greatest and smallest of
> the r,g,b components will be less than 0.5, i.e., less than the accuracy
> of the resulting int.

Yes, I think this is the right reasoning.

> Not that it matters in practice, of course, it will only improve speed
> (slightly) in 1/512 of the cases...

... at the expense of a slight speed decrease in all cases because of an 
additional 'load', at least when compiled by GCC.

-- 
Eric Botcazou




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