[PyKDE] Help:Anybody give me an example how to use sip.voidptr
gvermeul at grenoble.cnrs.fr
Wed Oct 1 09:19:01 BST 2003
On Tue, 30 Sep 2003 21:26:39 -0500
sfang <sfang at bcm.tmc.edu> wrote:
> Hello, Guys,
> I got a sip.voidptr through qt.QImage.bits(), and I read doc that sip.voidptr
> object is only useful if passed to another Python module. I try to pass to
> other python module like PIL to get those pixel data and fail, Anyone has the
> experienc of use sip.voidptr? Could you tell me how to use it or a piece code
> to show me how to use that kind of object, I am realy need such a hint. I try
> a lot of way to understand how to use it.
> Thank you very much!
This is bound to fail: PIL does not know anything about qt.QImage.bits()
PyQwt has support to convert Numerical Python arrays to QImage objects.
It is also possible to convert PIL images to Numerical Python arrays (support
comes with Numerical Python).
If you need to do mathemetical operations on you images (add, substract, FFT,
filter), Numerical Python is very useful. If not, it may get you started.
Check http://pyqwt.sf.net. Conversion code from Numerical Python arrays to
QImage sits in the numpy directory.
More information about the PyQt