[Dev] Re: [commits] (alecf) [7645] more performance improvements -
stop using wx.Image_RGBValue and just use the color tuple directly
John Anderson
john at osafoundation.org
Wed Oct 5 11:22:09 PDT 2005
Hi Alec:
I briefly looked into the cost of wx.Image_RGBValue and it looks like
the overhead is the same as creating any wx object, which we're using
all over the place. On first glance it seems like the only place this
would matter is if you are calling it a lot, e.g. on every pixel of a
bitmap. Did you measure any benefit in any other situation?
John
commits at osafoundation.org wrote:
> Revision
> 7645 <http://viewcvs.osafoundation.org/chandler?view=rev&rev=7645>
> Author
> alecf
> Date
> 2005-10-05 11:08:22 -0700 (Wed, 05 Oct 2005)
>
>
> Log Message
>
> more performance improvements - stop using wx.Image_RGBValue and just
> use the color tuple directly
>
>
> Modified Paths
>
> * trunk/chandler/parcels/osaf/framework/blocks/DrawingUtilities.py
> <#trunkchandlerparcelsosafframeworkblocksDrawingUtilitiespy>
>
>
> Diff
>
>
> Modified:
> trunk/chandler/parcels/osaf/framework/blocks/DrawingUtilities.py
> (7644 => 7645)
>
>--- trunk/chandler/parcels/osaf/framework/blocks/DrawingUtilities.py 2005-10-05 17:51:59 UTC (rev 7644)
>+++ trunk/chandler/parcels/osaf/framework/blocks/DrawingUtilities.py 2005-10-05 18:08:22 UTC (rev 7645)
>@@ -200,8 +200,7 @@
> # now calculate the actual color from the gradient index
> sat = satStart + satStep * gradientIndex
> color = rgb2color(*hsv_to_rgb(hue, sat, value))
>- rgb = wx.Image_RGBValue(*color)
>- image.SetRGB(x,0, rgb.red, rgb.green, rgb.blue)
>+ image.SetRGB(x,0, *color)
>
> # and now we have to go from Image -> Bitmap. Yuck.
> brush = wx.Brush(wx.WHITE, wx.STIPPLE)
>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Commits mailing list
>Commits at osafoundation.org
>http://lists.osafoundation.org/mailman/listinfo/commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osafoundation.org/pipermail/dev/attachments/20051005/40dc2080/attachment.html
More information about the Dev
mailing list