[visionegg] changes to texture functions

Hi All,

The recently-added ability to put (sub) images into textures already allocated in video memory is an important and long overdue addition to the Vision Egg. To make this code cleaner, I have made some changes which will break code written for recent CVS check outs, but should have no effect on code written for the most recent (0.9.3) release (unless that code manipulated attributes inside classes directly).

Here's a quick guide to the changes you may have to make to your source if you get the latest CVS version. I expect that this will be the final interface for texture code in the upcoming 0.9.4 and future releases.

1) The Texture class now works directly wil PIL images and Numeric arrays, so there is no need for separate sub-classes to handle the two cases. Replace calls to the TextureFromPILImage() and TextureFromNumpyArray() constructors with Texture().

2) The get_texture_object() method of the Texture class replaces the get_texture_buffer() method. Functionally, this is just a name change, but reflects re-organization of the underlying code.

3) The put_sub_image_pil() and put_sub_image_numpy() methods of the old TextureBuffer class have been replaced by a single put_sub_image() method from the new TextureObject class which can handle both forms of data.

4) Any references to the "orig" attribute of the Textures class will no longer work. The most frequent reason for this was to get the size of the texture. There's a new attribute called "size" which is a tuple containing the size of the texture. So, change "texture.orig.size" to "texture.size".

I have updated the demo scripts image_sequence.py, visual_jitter.py, and texture.py to reflect the changes.

Cheers!
Andrew

======================================
The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html

Other related posts: