简体   繁体   中英

Korge: What does the bitmap `premultiplied` variable do?

In the Bitmap documentation, I noticed that there was this premultiplied variable in the bitmap. What does it mean and what does it do?

在此处输入图像描述

That property indicates how the Bitmap RGB (red, green, blue) components of each pixel are stored based on the alpha component. This is typically named premultiplied alpha.

premultiplied=true means that the RGB components are stored after being multiplied by the alpha component. For example:

StoredRGBA=R*A,G*A,B*A,A

while premultiplied=false :

StoredRGBA=R,G,B,A

So this refers to how the storage should be interpreted regarding to the real components of each pixel.

Premultiplied alpha allows to perform blending operations much faster and in OpenGL it is typically required when the render buffer also has alpha.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM