[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] [bug] blit_array() fails with a 24 bit surface
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] [bug] blit_array() fails with a 24 bit surface
- From: "Charlie Nolan" <funnyman3595@xxxxxxxxx>
- Date: Wed, 22 Oct 2008 21:23:40 -0500
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Wed, 22 Oct 2008 22:23:44 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=9K0sPeJkcj7RKenFcda9vRVtseZKuOy9fbWWFhJACQY=; b=A8K1Ays8pPxtqexCO6xn7mbRD97bPn1K1kcg94K0kkeQQosHEMrOeQZQSZl9/IWSVB uT6d/GQdBqc1d56o7C8nt7Xu6Y+uEZKJaBuTXC5o7zx7W2PyJkkCvxO/BX8HgFMOMKyY HspA1/SIHi1sJvN0hFbbQT8PIKMEZJ71HNOv8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=gPRtfx8WzCOPuOoc809cKb1HdehVTDFeFvdA63iPLzaz/bETKwchopVEFif36meBqk lpRbX3rvvqDH0yBEPNH1mFOxkPlmd1rabZN5dJ8qLRJad1CAi2CUlNtiA1hqjr2x9qyb GFhVMLCYbtc3TTez2KmB/ZaSOSrhruWE117ng=
- In-reply-to: <48FF8E60.8080700@xxxxxxxxx>
- References: <48FF8E60.8080700@xxxxxxxxx>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
That may be a fundamental weakness of the method used, seeing as how
pixels*d doesn't work on 24-bit surfaces. If so, it should definitely
give a better error message and be mentioned in the docs.
-FM
On Wed, Oct 22, 2008 at 3:34 PM, Lenard Lindstrom <len-l@xxxxxxxxx> wrote:
> I've just filed bug 24 at http://pygame.motherhamster.org/bugzilla/
>
> Pygame-1.9.0a0 (rev. 1668)
> numpy 1.0.4
> Python 2.5.2
>
> pygame.surfarray.blit_array() raises an exception when a 3d array is copied
> to a 24 bit surface.
>
> Test Program:
>
> import pygame
>
> pygame.surfarray.use_arraytype('numpy')
> s = pygame.Surface((10,10), 0, 24)
> a = pygame.surfarray.array3d(s)
> pygame.surfarray.blit_array(s, a)
>
>
> Exception:
> Traceback (most recent call last):
> File "array_bug.py", line 6, in <module>
> pygame.surfarray.blit_array(s, a)
> File "C:\PRG\PYTHON25\lib\site-packages\pygame\surfarray.py", line 260, in
> bli
> t_array
> return numpysf.blit_array (surface, array)
> File "C:\PRG\PYTHON25\lib\site-packages\pygame\_numpysurfarray.py", line
> 381,
> in blit_array
> (array[:,:,1::3] >> losses[1] << shifts[1]) | \
> TypeError: unsupported operand type(s) for >>: 'float' and 'int'
>
>
> I will see what I can do with it.
>
> --
> Lenard Lindstrom
> <len-l@xxxxxxxxx>
>
>