|
From: Pierre A. <pie...@op...> - 2004-06-19 08:12:58
|
Maxim Shemanarev wrote:
> I must admit AGG uses some messy combination of regular and premultiplied
> methods. We'll need to clean it up and I think there should be both,
> reguilar and premultiplied colorspaces.
Indeed, since both are useful. For instance, the Intel Integrated Perf.
Primitives Imaging Library (or whatever the IPPI stands for) offers
both premultiplied alpha composition and plain aRGB composition. The
premultiplied version is significantly faster.
"To save a significant amount of computation for some of the alpha
compositing operations, use functions ippiAlphaPremul, ippiAlphaPremulC
for pre-multiplying color channel values by the alpha values. This
reduces the number of multiplications required in the compositing
operations, which is especially efficient for a repeated compositing
of an image."
The Alpha Composition in IPPI is defined as :
OVER C = a*A+(1-a)*b*B A occludes B
c = a+(1-a)*b
There are also other operations IN, OUT, ATOP, XOR and PLUS which are
just strange to me. If you are interested in the formulae, I can retype
them or maybe you'd want to peek at the manual (7.3MB PDF).
> So, if we finally come up with some good method, combining the correct
> model, Stephan's gamma correction method and Marc's speed it'll be just
> great!
I'd love to see that ! I guess that Stephan's gamma correction method
will produce crisper anti-aliasing for text too :-)
Pierre
|