Robin Dunn wrote:
> Something else that is new that may help is we now have the ability to
> get raw access to a wx.Bitmap's internal buffer.  You can either use an
> iterator interface to access the RGB(A) data, or there are some
> convenience functions to create a wx.Bitmap from a buffer of RGB(A)
> data, where the buffer can be anything that supports the Python buffer
> interface, such as a string, array.array, or even a numpy array.  The
> latter can allow repeating patterns like gradients to be built fairly
> fast.  See the RawBitmapAccess sample in the wxPython demo for examples.

I looked at those, but it seems like the most expensive thing in
MakeGradientBrush are the color value calculations for each pixel.
Still, I tested by using the wx samples, and I could not make the method
any faster than it is (only slightly slower) - even though my code was
not creating intermediate image or bitmap objects.

Like I said, this method takes about 8% in the resize case. 3% each goes
to the vector multiply and addition operations. So the whole
MakeGradientBrush should move into C to make this faster, I think - or
in other words, if we could use some of the higher level wx gradient
methods.

-- 
  Heikki Toivonen


Attachment: signature.asc
Description: OpenPGP digital signature

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Open Source Applications Foundation "chandler-dev" mailing list
http://lists.osafoundation.org/mailman/listinfo/chandler-dev

Reply via email to