Pete Shinners wrote:
> It looks like the Pygame will soon be wanting quicker
methods for sharing image
> data than the traditional tostring/fromstring. Both PIL
and Pygame now have a
> "frombuffer" command, which speeds up this
transaction by avoiding one of the
> two copies of pixel data.
This is crying out to be a use for the new "array
interface" proposed
(and used) by numpy:
http://
numeric.scipy.org/array_interface.html
Essentially, the idea is similar to a buffer, but with more
information
carried along with it. Rather than an arbitrary array of
bytes, the
interface provides a pointer to the data, and also
information about the
size, layout and type of the data.
The goal of the numpy team is to get this integrated into
the python
standard library, so that any package that deals with arrays
of data can
communicate easily with other such packages.
There are a lot of folks already transferring data back and
forth
between numpy arrays, PIL images, PyGame, OpenGL, wxPython,
etc. It
would be a really great thing to get a few more packages
sharing the
same protocol.
Please join the numpy team in this, it will really benefit
the Python
community to have one way of exchanging this kind of data.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker noaa.gov
_______________________________________________
Image-SIG maillist - Image-SIG python.org
htt
p://mail.python.org/mailman/listinfo/image-sig
|