[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
PATCH BUG: Re: [pygame] alpha blend bug
- To: pygame-users@xxxxxxxx
- Subject: PATCH BUG: Re: [pygame] alpha blend bug
- From: "Rene Dudfield" <renesd@xxxxxxxxx>
- Date: Tue, 25 Apr 2006 13:01:20 +1000
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Mon, 24 Apr 2006 23:01:25 -0400
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=hgZ8kUkumPiSIiHCqcIobVG5n8hKqVCpiKxwInrBQ3Hi9d3PhATAR20ij4E7yXkgH48JRGiDYZ27trYm8/lmNbyAYt/dCMZprJUT/AZ/c4h1Ek0kmh5tUB2unxWpHlx+JU1F1xCfTT699LRUOKVLBvjm1kkwxlWQU4GRen/8hzg=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Thanks!
It's applied in cvs. I've also added a tests/blit_test.py which tests
some of the blits.
Also... in cvs are some new blitting modes. add/sub/mult/min/max
On 4/25/06, Lenard Lindstrom <len-l@xxxxxxxxx> wrote:
> Hello everyone. First I would like to say that pygame is one of the
> best integrated Python packages I've seen so far; very slick. Anyway,
> down to business.
>
> While blitting from a surface with per-pixel alpha to a surface also
> with per-pixel alpha I found a bug when source alpha is 255. Each
> calculated color value is one less than that of the source. I have
> attached a program that illustrates the problem.
>
> I have also included a patch for alphablit.c in CVS which hopefully
> solves the problem. The C expression used is based on the formula:
>
> blend(s, sA, d) = ( (256 - sA)*d + (sA + 1)*s) / 256
>
> I have checked the expression to confirm the following:
>
> blend(s, 0, d) = d
> blend(s, 255, d) = s
> blend(0, sA, 0) = 0
> blend(255, sA, 255) = 255
> blend(s, sA, d) <= 255
>
> I am using pygame 1.7.1 with both Python 2.3 and 2.4 on Windows.
>
> Lenard Lindstrom
> <len-l@xxxxxxxxx>
>
>
>
> The following section of this message contains a file attachment
> prepared for transmission using the Internet MIME message format.
> If you are using Pegasus Mail, or any other MIME-compliant system,
> you should be able to save it or view it from within your mailer.
> If you cannot, please ask your system administrator for assistance.
>
> ---- File information -----------
> File: blit.py
> Date: 23 Apr 2006, 21:03
> Size: 1056 bytes.
> Type: Text
>
>
> The following section of this message contains a file attachment
> prepared for transmission using the Internet MIME message format.
> If you are using Pegasus Mail, or any other MIME-compliant system,
> you should be able to save it or view it from within your mailer.
> If you cannot, please ask your system administrator for assistance.
>
> ---- File information -----------
> File: alphablend.patch
> Date: 24 Apr 2006, 16:37
> Size: 885 bytes.
> Type: Text
>
>
>
>