General purpose compose operations usually include a division by 255 of
a number in the range 0 ... 65025. While fixing up Mozilla's alpha
compositor I disturbed a sleeping hacker who has provided a (tested and
working) macro which computes this operation much more quickly than
any other solution tested, including GCC -On speed-ups using similar
but different tricks.

Of course, GCC cannot use this FAST_DIVIDE_BY_255 because it is safe
only for 0 ... 65025, but I think it might be useful to Gimp, both in
the core (which I presume has several alpha compositors) and in
plug-ins, where alpha composition is also a popular operation.

So, does Gimp already have something like this in core? Or should we
consider borrowing this macro from wherever it originated and using
it throughout Gimp (after 1.2, naturally) ?

Nick.

Reply via email to