pyrex and GIMP
I've been working on using Pyrex for a GIMP plug-in. It works now. If
that sounds interesting to you, there's a link to the code at
http://gimp-plug-ins.sourceforge.net/refract/
The parts implemented in Pyrex are a PixelFetcher, functions for
calculating displacement and interpolation, and the main processing loop
iterating over a row buffer. The speed is comparable to the C version
(within 5% on my 256x256 test image). I haven't tried a pure Python or
a Python+psyco implementation yet.
I'm not sure yet how to distribute the pyrex definitions for libgimp.
Since I only have one program using it so far, I'm distributing it all
in one tarball and linking "pyxgimp.pxd" into the source directory.
There are some sloppy bits where I convert between pygimp classes (the
libgimp Python bindings included with GIMP) and my pyrex ones.
Eventually, I should pick a set of bindings and stick with them, but
there's much of pygimp's functionality I haven't duplicated yet. The
things in libgimp I wrapped with pyrex are Drawable, Tile, and
PixelRegion -- the structures I needed to access in my pixel processing
loop.