[AD] Faster hsv_to_rgb()

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


I have optimised hsv_to_rgb() by reducing the equasion used to calculate the
colour-values. This saves 3 multiplies, 3 to 4 adds/subtracts and reduces by
one the number of temporary variables needed. The code is at this URL:

http://www.xs4all.nl/~ellman/ae-a/tmp/hsv2rgb.zip

In the code there are comments showing how I arrived at the reduced
expression. There are ways to optimise the code even further but they either
break the existing API or reduce the accuracy of the output.


AE.







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