On Wed, Apr 22, 2009 at 02:50:01PM +0200, Nitro wrote:
> Am 22.04.2009, 14:28 Uhr, schrieb Nitro <nitro@dr-code.org>:
>
>> Am 22.04.2009, 04:38 Uhr, schrieb Robin Dunn <robin@alldunn.com>:
>>
>>> Christopher Barker wrote:
>>>> if self.USE_NUMPY:
>>>> bmp = wx.BitmapFromBuffer(width, height, self.__bytes)
>>>>
>>>
>>>> the first should be a simple pointer transfer, though it may make a
>>>> copy of the data.
>>>
>>> The wx.Bitmap's internal pixel buffer format is platform dependent
>>> and is not likely to be the same format as the buffer expected by
>>> wx.BitmapFromBuffer. However the copy that is made inside
>>> wx.BitmapFromBuffer (from the buffer to the wxBitmap) is using the wx
>>> raw bitmap APIs that, while abstracting out the platform differences,
>>> is still doing essentially a C pointer to pointer copy of the bytes.
>>> So given the circumstances it should be as fast as possible. It's
>>> still a copy though, so takes O(N) time to be done.
>
> Just as a little follow-up to my last post, you might try to use RGBA
> instead of RGB. In some cases I have found RGBA to be faster, probably
> because a) the driver uses rgba internally and has to convert rgb to rgba
> before it can be used and b) because rgba is 32-bit aligned in memory
> which processors somehow like. Not sure if all of this also applies to
> RGB/RGBA in wxPython/wxWidgets.
>
Nice tip! I'll give that a try. Thanks :)
--
Pablo Antonio (AKA crazy2k)
http://www.pablo-a.com.ar/
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
-->