[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Pre-multiplied alpha



On 8/4/07, Greg Ewing <greg.ewing@xxxxxxxxxxxxxxxx> wrote:
> If that's the case, it could be worth having a function
> in pygame for easily creating premultiplied alpha surfaces.
>
I agree it would be worth it having a pyame function to get your
pygame surfaces into openGL with color scaled by alpha, so I wrote
something for that.

attached is a patch that will add a "RGBA_PREMULT" and "ARGB_PREMULT"
format type for image.tostring. The returned string is ready for
source*ONE + dest*ONE_MINUS_SRC_ALPHA type blending

also attached is a patch that will add a test for this to the
image_test.py unittest

Attachment: AddPremultipliedAlphaToString.patch
Description: Binary data

Attachment: AddPremultipliedAlphaToStringTest.patch
Description: Binary data