码迷,mamicode.com
首页 > 其他好文 > 详细

premultiplied pixel formats的具体含义

时间:2016-01-03 00:52:22      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:agg premultiplied

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.

premultiplied pixel formats的具体含义

标签:agg premultiplied

原文地址:http://linuxstorm.blog.51cto.com/5218690/1730909

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!