//void SetData( unsigned char *data );
%addmethods {
+ PyObject* GetDataBuffer() {
+ unsigned char* data = self->GetData();
+ int len = self->GetWidth() * self->GetHeight() * 3;
+ return PyBuffer_FromReadWriteMemory(data, len);
+ }
+
PyObject* GetData() {
unsigned char* data = self->GetData();
int len = self->GetWidth() * self->GetHeight() * 3;
dataPtr = (unsigned char*) malloc(len);
memcpy(dataPtr, PyString_AsString(data), len);
self->SetData(dataPtr);
+ // wxImage takes ownership of dataPtr...
}
}