X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dd9f7fea29e3f8bb61861f52984b7943512346ac..da397248d3293b4336ec900e1eeac3d75a62c631:/wxPython/src/_image.i diff --git a/wxPython/src/_image.i b/wxPython/src/_image.i index cdf9ecebb8..d248f1a0fa 100644 --- a/wxPython/src/_image.i +++ b/wxPython/src/_image.i @@ -52,7 +52,7 @@ class wxImageHistogram /* : public wxImageHistogramBase */ public: wxImageHistogram(); - DocStr(MakeKey, "Get the key in the histogram for the given RGB values"); + DocStr(MakeKey, "Get the key in the histogram for the given RGB values", ""); static unsigned long MakeKey(unsigned char r, unsigned char g, unsigned char b); @@ -65,9 +65,9 @@ public: unsigned char startG = 0, unsigned char startB = 0 ) const, "FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)", - "Find first colour that is not used in the image and has higher RGB values than\n" - "startR, startG, startB. Returns a tuple consisting of a success flag and rgb\n" - "values."); + "Find first colour that is not used in the image and has higher RGB +values than startR, startG, startB. Returns a tuple consisting of a +success flag and rgb values.", ""); }; @@ -90,7 +90,8 @@ public: else return new wxImage; } - + + MustHaveApp(wxImage(const wxBitmap &bitmap)); %name(ImageFromBitmap) wxImage(const wxBitmap &bitmap) { return new wxImage(bitmap.ConvertToImage()); } @@ -129,9 +130,9 @@ public: bool, FindFirstUnusedColour( byte *OUTPUT, byte *OUTPUT, byte *OUTPUT, byte startR = 0, byte startG = 0, byte startB = 0 ) const, "FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)", - "Find first colour that is not used in the image and has higher RGB values than\n" - "startR, startG, startB. Returns a tuple consisting of a success flag and rgb\n" - "values."); + "Find first colour that is not used in the image and has higher RGB +values than startR, startG, startB. Returns a tuple consisting of a +success flag and rgb values.", ""); // Set image's mask to the area of 'mask' that has colour @@ -161,6 +162,13 @@ public: int GetWidth(); int GetHeight(); + %extend { + wxSize GetSize() { + wxSize size(self->GetWidth(), self->GetHeight()); + return size; + } + } + wxImage GetSubImage(const wxRect& rect); wxImage Copy(); void Paste( const wxImage &image, int x, int y ); @@ -204,7 +212,7 @@ public: unsigned char* buffer; int size; - wxPyBeginBlockThreads(); + bool blocked = wxPyBeginBlockThreads(); if (!PyArg_Parse(data, "t#", &buffer, &size)) goto done; @@ -214,7 +222,7 @@ public: } self->SetData(buffer); done: - wxPyEndBlockThreads(); + wxPyEndBlockThreads(blocked); } @@ -258,7 +266,7 @@ public: unsigned char* buffer; int size; - wxPyBeginBlockThreads(); + bool blocked = wxPyBeginBlockThreads(); if (!PyArg_Parse(data, "t#", &buffer, &size)) goto done; @@ -268,7 +276,7 @@ public: } self->SetAlpha(buffer); done: - wxPyEndBlockThreads(); + wxPyEndBlockThreads(blocked); } } @@ -305,6 +313,9 @@ public: static wxString GetImageExtWildcard(); +MustHaveApp(ConvertToBitmap); +MustHaveApp(ConvertToMonoBitmap); + %extend { wxBitmap ConvertToBitmap() { wxBitmap bitmap(*self); @@ -325,7 +336,17 @@ public: -void wxInitAllImageHandlers(); +///void wxInitAllImageHandlers(); + +%pythoncode { + def InitAllImageHandlers(): + """ + The former functionality of InitAllImageHanders is now done internal to + the _core_ extension module and so this function has become a simple NOP. + """ + pass +} + // See also wxPy_ReinitStockObjects in helpers.cpp