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

Re: [pygame] numpy array module now in the pygame development tree



Marcus von Appen wrote:
Hi,

I just added a surface array module using numpy to pygame. You can find
it in pygame's latest SVN revision (starting from rev. 1063).

Additionally the compile time dependency on Numeric has been resolved by
importing the necessary headers directly into pygame. So you won't need
Numeric at compile time anymore to build the surfarray module, but still
will have to install it later on, if you need to use pygame.surfarray.

To use the numpy array functions, take a look at the pygame.numpyarray
documentation. The functions are exactly the same as for
pygame.surfarray except for the 16-bit representation, which uses
unsigned integer values instead of signed ones.

I'd like to thank Alex Holkner explicitly here for his work on
pygame-ctypes, which helped me a lot to get the whole numpy stuff
wrapped up in Python :-).


It's good to see. Unfortunately I have already found a bug in the numpyarray.py module, line 217. A 3d array can also handle 24 bit pixels. So the third element of the shape needs be calculated.

--
Lenard Lindstrom
<len-l@xxxxxxxxx>