X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bf7df69ef66934a877dbec910b02029bd8706590..3af4da323ab401ad41e2eca2c6afbc2c3d632da6:/wxPython/src/_image.i diff --git a/wxPython/src/_image.i b/wxPython/src/_image.i index 43e9f24626..f083ba0d17 100644 --- a/wxPython/src/_image.i +++ b/wxPython/src/_image.i @@ -54,6 +54,11 @@ public: void SetExtension(const wxString& extension); void SetType(long type); void SetMimeType(const wxString& mimetype); + + %property(Extension, GetExtension, SetExtension, doc="See `GetExtension` and `SetExtension`"); + %property(MimeType, GetMimeType, SetMimeType, doc="See `GetMimeType` and `SetMimeType`"); + %property(Name, GetName, SetName, doc="See `GetName` and `SetName`"); + %property(Type, GetType, SetType, doc="See `GetType` and `SetType`"); }; @@ -983,6 +988,17 @@ range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees", ""); %pythoncode { def __nonzero__(self): return self.Ok() } + + %property(AlphaBuffer, GetAlphaBuffer, SetAlphaBuffer, doc="See `GetAlphaBuffer` and `SetAlphaBuffer`"); + %property(AlphaData, GetAlphaData, SetAlphaData, doc="See `GetAlphaData` and `SetAlphaData`"); + %property(Data, GetData, SetData, doc="See `GetData` and `SetData`"); + %property(DataBuffer, GetDataBuffer, SetDataBuffer, doc="See `GetDataBuffer` and `SetDataBuffer`"); + %property(Height, GetHeight, doc="See `GetHeight`"); + %property(MaskBlue, GetMaskBlue, doc="See `GetMaskBlue`"); + %property(MaskGreen, GetMaskGreen, doc="See `GetMaskGreen`"); + %property(MaskRed, GetMaskRed, doc="See `GetMaskRed`"); + %property(Size, GetSize, doc="See `GetSize`"); + %property(Width, GetWidth, doc="See `GetWidth`"); }; @@ -1017,12 +1033,11 @@ range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees", ""); def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None): """ Creates a `wx.Image` from the data in dataBuffer. The dataBuffer - parameter must be a Python object that implements the buffer interface, or - is convertable to a buffer object, such as a string, array, etc. The - dataBuffer object is expected to contain a series of RGB bytes and be - width*height*3 bytes long. A buffer object can optionally be supplied for - the image's alpha channel data, and it is expected to be width*height - bytes long. + parameter must be a Python object that implements the buffer interface, + such as a string, array, etc. The dataBuffer object is expected to + contain a series of RGB bytes and be width*height*3 bytes long. A buffer + object can optionally be supplied for the image's alpha channel data, and + it is expected to be width*height bytes long. The wx.Image will be created with its data and alpha pointers initialized to the memory address pointed to by the buffer objects, thus saving the @@ -1040,10 +1055,6 @@ def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None): the objects used for the data and alpha buffers in a way that would cause them to change size. """ - if not isinstance(dataBuffer, buffer): - dataBuffer = buffer(dataBuffer) - if alphaBuffer is not None and not isinstance(alphaBuffer, buffer): - alphaBuffer = buffer(alphaBuffer) image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer) image._buffer = dataBuffer image._alpha = alphaBuffer