X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/396fb5091dce8f2160a224c3377111256bf053ea..5f57b149e60ac95a47d45409ae3a9c9acaee04be:/wxPython/src/msw/_core.py diff --git a/wxPython/src/msw/_core.py b/wxPython/src/msw/_core.py index b85b8576e7..065a985f49 100644 --- a/wxPython/src/msw/_core.py +++ b/wxPython/src/msw/_core.py @@ -85,6 +85,7 @@ SIMPLE_BORDER = _core_.SIMPLE_BORDER STATIC_BORDER = _core_.STATIC_BORDER TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW NO_BORDER = _core_.NO_BORDER +DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER TAB_TRAVERSAL = _core_.TAB_TRAVERSAL WANTS_CHARS = _core_.WANTS_CHARS POPUP_WINDOW = _core_.POPUP_WINDOW @@ -2033,6 +2034,9 @@ def MemoryFSHandler_RemoveFile(*args, **kwargs): """MemoryFSHandler_RemoveFile(String filename)""" return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) +IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT +IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD +IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE #--------------------------------------------------------------------------- class ImageHandler(Object): @@ -2113,6 +2117,31 @@ class ImageHistogram(object): """ return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs) + def GetCount(*args, **kwargs): + """ + GetCount(self, unsigned long key) -> unsigned long + + Returns the pixel count for the given key. Use `MakeKey` to create a + key value from a RGB tripple. + """ + return _core_.ImageHistogram_GetCount(*args, **kwargs) + + def GetCountRGB(*args, **kwargs): + """ + GetCountRGB(self, unsigned char r, unsigned char g, unsigned char b) -> unsigned long + + Returns the pixel count for the given RGB values. + """ + return _core_.ImageHistogram_GetCountRGB(*args, **kwargs) + + def GetCountColour(*args, **kwargs): + """ + GetCountColour(self, Colour colour) -> unsigned long + + Returns the pixel count for the given `wx.Colour` value. + """ + return _core_.ImageHistogram_GetCountColour(*args, **kwargs) + class ImageHistogramPtr(ImageHistogram): def __init__(self, this): @@ -2216,6 +2245,15 @@ class Image(Object): """ return _core_.Image_InitAlpha(*args, **kwargs) + def IsTransparent(*args, **kwargs): + """ + IsTransparent(self, int x, int y, unsigned char threshold=IMAGE_ALPHA_THRESHOLD) -> bool + + Returns True if this pixel is masked or has an alpha value less than + the spcified threshold. + """ + return _core_.Image_IsTransparent(*args, **kwargs) + def FindFirstUnusedColour(*args, **kwargs): """ FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) @@ -2228,7 +2266,7 @@ class Image(Object): def ConvertAlphaToMask(*args, **kwargs): """ - ConvertAlphaToMask(self, byte threshold=128) -> bool + ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool If the image has alpha channel, this method converts it to mask. All pixels with alpha value less than ``threshold`` are replaced with mask colour and the @@ -2330,27 +2368,58 @@ class Image(Object): return _core_.Image_Paste(*args, **kwargs) def GetData(*args, **kwargs): - """GetData(self) -> PyObject""" + """ + GetData(self) -> PyObject + + Returns a string containing a copy of the RGB bytes of the image. + """ return _core_.Image_GetData(*args, **kwargs) def SetData(*args, **kwargs): - """SetData(self, PyObject data)""" + """ + SetData(self, buffer data) + + Resets the Image's RGB data from a buffer of RGB bytes. Accepts + either a string or a buffer object holding the data and the length of + the data must be width*height*3. + """ return _core_.Image_SetData(*args, **kwargs) def GetDataBuffer(*args, **kwargs): - """GetDataBuffer(self) -> PyObject""" + """ + GetDataBuffer(self) -> PyObject + + Returns a writable Python buffer object that is pointing at the RGB + image data buffer inside the wx.Image. + """ return _core_.Image_GetDataBuffer(*args, **kwargs) def SetDataBuffer(*args, **kwargs): - """SetDataBuffer(self, PyObject data)""" + """ + SetDataBuffer(self, buffer data) + + Sets the internal image data pointer to point at a Python buffer + object. This can save a copy of the data but you must ensure that the + buffer object lives longer than the wx.Image does. + """ return _core_.Image_SetDataBuffer(*args, **kwargs) def GetAlphaData(*args, **kwargs): - """GetAlphaData(self) -> PyObject""" + """ + GetAlphaData(self) -> PyObject + + Returns a string containing a copy of the alpha bytes of the image. + """ return _core_.Image_GetAlphaData(*args, **kwargs) def SetAlphaData(*args, **kwargs): - """SetAlphaData(self, PyObject data)""" + """ + SetAlphaData(self, buffer alpha) + + Resets the Image's alpha data from a buffer of bytes. Accepts either + a string or a buffer object holding the data and the length of the + data must be width*height. + """ return _core_.Image_SetAlphaData(*args, **kwargs) def GetAlphaBuffer(*args, **kwargs): @@ -2358,7 +2427,7 @@ class Image(Object): return _core_.Image_GetAlphaBuffer(*args, **kwargs) def SetAlphaBuffer(*args, **kwargs): - """SetAlphaBuffer(self, PyObject data)""" + """SetAlphaBuffer(self, buffer alpha)""" return _core_.Image_SetAlphaBuffer(*args, **kwargs) def SetMaskColour(*args, **kwargs): @@ -2503,25 +2572,46 @@ def ImageFromStreamMime(*args, **kwargs): return val def EmptyImage(*args, **kwargs): - """EmptyImage(int width=0, int height=0, bool clear=True) -> Image""" + """ + EmptyImage(int width=0, int height=0, bool clear=True) -> Image + + Construct an empty image of a given size, optionally setting all + pixels to black. + """ val = _core_.new_EmptyImage(*args, **kwargs) val.thisown = 1 return val def ImageFromBitmap(*args, **kwargs): - """ImageFromBitmap(Bitmap bitmap) -> Image""" + """ + ImageFromBitmap(Bitmap bitmap) -> Image + + Construct an Image from a `wx.Bitmap`. + """ val = _core_.new_ImageFromBitmap(*args, **kwargs) val.thisown = 1 return val def ImageFromData(*args, **kwargs): - """ImageFromData(int width, int height, unsigned char data) -> Image""" + """ + ImageFromData(int width, int height, buffer data) -> Image + + Construct an Image from a buffer of RGB bytes. Accepts either a + string or a buffer object holding the data and the length of the data + must be width*height*3. + """ val = _core_.new_ImageFromData(*args, **kwargs) val.thisown = 1 return val def ImageFromDataWithAlpha(*args, **kwargs): - """ImageFromDataWithAlpha(int width, int height, unsigned char data, unsigned char alpha) -> Image""" + """ + ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image + + Construct an Image from a buffer of RGB bytes with an Alpha channel. + Accepts either a string or a buffer object holding the data and the + length of the data must be width*height*3. + """ val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs) val.thisown = 1 return val