premultiplied pixel formats的具体含义

Anti-aliasing problem  with  render_scanlines_compound_layered
> However, I have no clue what this change means. I read about
> premultiplied pixel formats here and there, but never really
> understood what they are.

Search in Google for "premultiplied alpha. Use it, love it, pass it on" :-)

In the compound renderering function there's operation "Color ADD" is used
implicitly, instead of alpha-blend. Then the composed image is rendered as a
color span. It means that for proper compositing everything needs to be
premultiplied.

> Especially, where is the _pre version needed, and where not? It seems
> that the compiler never complains when I mix pre and non-pre colors.

It's because the color structure is exactly the same. When you read an image
from a file you cannot detect it on the basis of color values only. You just
need to know, or there should be some flag in the image header (I don't know
whether PNG has it).

I tried to serapare the premultiplied from plain with some tags in the color
structures, but it so much of complex and rather useless code that I decided
to keep it simpler.

你可能感兴趣的:(agg,premultiplied,具体含义)