From: Peter N. <pn...@ya...> - 2000-06-03 18:58:51
|
Ok I cut and pasted a lot here: > Mark Baker writes: > > right now in pysdl, there's no way to go mess with > > pixels aside from the get_at and put_at. > This is inaccurate. You can manipulate surfaces > using the slice operator. So there is also the slice operator, but that turns out even slower: "David Clark <David Clark" <si...@te...> wrote: > A note: in my testing, writing individual pixels by > using the surface > object's "list of lists" structure is about 25% > slower than by using > set_at() (as expected). --- Pete Shinners <pe...@vi...> wrote: > i've been spending time with Numeric, and it > should be really simple to make some functions > to transfer between surfaces and arrays. once > this is done the fire demo should run swift > under python. (i would hope) From the NumPy page - http://numpy.sourceforge.net/ : >Why Numerical Python? >If x and y are Numerical Python arrays, then the >speed of the operation x + y is close to the speed of >doing it in C if the arrays are big enough. Thus, >Python can be extended with a full scientific array >language with sophisticated indexing and shaping >operations and yet be closer to the speed of a >compiled language than to the speed of Python itself. This is deep water for me but it seems like Pete Shinners' idea of numpy-arrays that could be treated as 'fake' software surfaces that could then use the blit operation would be a decent solution to these kinds of problems, if it can be done. The execute-buffer thing sounds like it would be better & faster but also a lot more work to implement, though I have no idea if this is true. Also I think it's really important to keep things simple because that's the whole reason to use Python instead of C anyway. I doubt anyone is ever going to use PySDL for hardcore mindblowing demo graphics, but it would be great to have a reasonably easy way to implement simple effects and not be totally limited to the sprite paradigm. --Peter __________________________________________________ Do You Yahoo!? Yahoo! Photos -- now, 100 FREE prints! http://photos.yahoo.com |