On, Mon May 25, 2009, Arnaud Bergeron wrote:
> Looking around the pygame documentation I came upon the PixelArray
> module. I noted that its interface was really similar to the numpy
> one so I replaced all calls to array3d() in the DefaultEngine by calls
> to PixelArray and eliminated the calls to blit_array, since the
> default behavior with PixelArray is to share the pixel data.
> Success! Timings show that it's at least 10x faster (or more if you
> draw a lot of borders) and the delay is barely noticeable now.
> The downside is that PixelArray is new in pygame 1.8.0 and the
> required interface is new in pygame 1.8.1.
That's not so critical. We can test for the version in another place and
bind either the one other classes and functions. This should guarantee
backwards compatibility up to a certain degree.
> So I am wondering if there is any interest in getting this change in.
> It completely eliminate reliance on numpy (or Numeric) while requiring
> pygame 1.8.1.
> It should be possible to implement and compromise solution that would
> allow to use PixelArray in pygame 1.8.1 and the current method on
> other versions.
> I will produce a proper patch if required.
As you did that already, thanks a lot for it. I'll take it and implement
it properly for different versions within the next days.