On 08/28/06 12:19, Christopher Barker wrote:
>
> wx is really due for an update to support alpha properly. But I guess
> you'll always have problems with different data formats.

I think they added preliminary support for alpha channels in 2.5, in the form 
of wx.Image.HasAlpha().  My beef is that you have to convert everything to a 
wx.Bitmap before you can do anything useful with it.

> Anyway, this thread started because people were having binary 
> compatibility issues. Even if this doesn't speed up the accelerator, it 
> may be possible to get the same performance without using 
> wx-version-specific compiled code -- i.e. pure python.

As near as I can tell, the primary slowdown at this point is the way wxWidgets 
distinguishes from RGB image data (wx.Image) as opposed to displayed image 
data (wx.Bitmap).  Right now you cannot draw a wx.Image without first 
converting it into a wx.Bitmap, nor can you use a MemoryDC to blit or 
otherwise munge a wx.Image directly.  My impression is that this made sense 
when wxWindows was getting started (Win16 and Motif), but is more of an 
artificial distinction at this point.

I don't think we're going to be able to get performance similar to that of the 
accelerator using straight Python code unless something changes in the 
wxWidgets' Image/Bitmap/MemoryDC department.  That being said, I'd love to be 
proven wrong!  If you're interested in the gory details, you should check out 
the pure-Python implementation of the image conversion functions, at the end 
of `backend_wxagg.py'.

> I do have one question -- does the agg back-end really need to use an 
> alpha channel for it's buffer? Isn't it the whole image anyway? What is 
> is it going to get blended with?

I don't know enough about Agg to venture an educated guess.  My un-educated 
guess is that there's an RGBA buffer to support alpha in the drawing 
operations... how can Agg alpha-composite new pixels into the buffer when you 
draw something, unless you know the alpha values of the existing pixels?

Ken

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to