X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b96c7a38a84ff9f6dfecd3885fba1971d30b9c0b..bffe56c5d19df9926686722fc09ad096afb47633:/wxPython/src/image.i diff --git a/wxPython/src/image.i b/wxPython/src/image.i index c38b899a59..84d1c7c5f0 100644 --- a/wxPython/src/image.i +++ b/wxPython/src/image.i @@ -127,6 +127,21 @@ public: unsigned char GetGreen( int x, int y ); unsigned char GetBlue( int x, int y ); + // find first colour that is not used in the image and has higher + // RGB values than + bool FindFirstUnusedColour( byte *OUTPUT, byte *OUTPUT, byte *OUTPUT, + byte startR = 0, byte startG = 0, byte startB = 0 ) const; + + // Set image's mask to the area of 'mask' that has colour + 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 */ ) ; + static bool CanRead( const wxString& name ); static int GetImageCount( const wxString& name, long type = wxBITMAP_TYPE_ANY ); @@ -152,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; @@ -170,6 +191,7 @@ public: dataPtr = (unsigned char*) malloc(len); memcpy(dataPtr, PyString_AsString(data), len); self->SetData(dataPtr); + // wxImage takes ownership of dataPtr... } }