Hey, I¹m currently working on interfacing various python and C libraries to create the software infrastructure for a scientific visualization course, and I appear to have run into a snag trying to load data into a Qimage from a c void-pointer to the array data (provided by ctypes; default restype is int¹). The PySide.QtGui.QImage(data, width, height, format) constructor appears to to be the closest to what I need, but the signature suggests that it only supports buffer objects or unicode string literals...
PySide.QtGui.QImage() PySide.QtGui.QImage(unicode, int, int, PySide.QtGui.QImage.Format) PySide.QtGui.QImage(unicode, int, int, int, PySide.QtGui.QImage.Format) PySide.QtGui.QImage(PySide.QtGui.QImage) PySide.QtGui.QImage(PySide.QtCore.QSize, PySide.QtGui.QImage.Format) PySide.QtGui.QImage(unicode, str = None) PySide.QtGui.QImage(str) PySide.QtGui.QImage(int, int, PySide.QtGui.QImage.Format) PySide.QtGui.QImage(buffer, int, int, PySide.QtGui.QImage.Format) PySide.QtGui.QImage(buffer, int, int, int, PySide.QtGui.QImage.Format) I¹m automatically generating the ctypes wrapper for the library, so there¹s no way for me to have the C library implement the buffer interface required to get the function to return a Py_buffer object. I also took a look at the PySide.QtGui.QImage.loadFromData(data[, aformat=0]) function, but there doesn¹t appear to be any way to set it up referencing an already allocated chunk of memory... Is there some sort of workaround for creating a Qimage from a C pointer to data? - Sam
_______________________________________________ PySide mailing list [email protected] http://lists.pyside.org/listinfo/pyside
