X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/68bc8549d81adc1b6f031bdbb03b91a71944197c..d8f3f983596d288daa840ffb7510ffa1cc67be0f:/wxPython/src/image.i diff --git a/wxPython/src/image.i b/wxPython/src/image.i index f3d7dc9294..84d1c7c5f0 100644 --- a/wxPython/src/image.i +++ b/wxPython/src/image.i @@ -136,11 +136,11 @@ public: bool SetMaskFromImage(const wxImage & mask, byte mr, byte mg, byte mb); - void DoFloodFill (wxCoord x, wxCoord y, - const wxBrush & fillBrush, - const wxColour& testColour, - int style = wxFLOOD_SURFACE, - int LogicalFunction = wxCOPY /* currently unused */ ) ; +// void DoFloodFill (wxCoord x, wxCoord y, +// const wxBrush & fillBrush, +// const wxColour& testColour, +// int style = wxFLOOD_SURFACE, +// int LogicalFunction = wxCOPY /* currently unused */ ) ; static bool CanRead( const wxString& name ); static int GetImageCount( const wxString& name, long type = wxBITMAP_TYPE_ANY ); @@ -167,6 +167,12 @@ public: //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; @@ -185,6 +191,7 @@ public: dataPtr = (unsigned char*) malloc(len); memcpy(dataPtr, PyString_AsString(data), len); self->SetData(dataPtr); + // wxImage takes ownership of dataPtr... } }