Title: [commits] (alecf) [7645] more performance improvements - stop using wx.Image_RGBValue and just use the color tuple directly
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

[email protected] wrote:
Revision
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

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 [email protected] http://lists.osafoundation.org/mailman/listinfo/commits


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

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

Reply via email to