I would imagine that any kind of manipulation would need to be returned as an array to operate on. opengl makes it pretty easy to get a buffer of the pixels, not sure how easy it is to shove that back into the texture though. I would assume you would prolly end up with something like:
pixelArray = myImage.getPixels()
– manipulate on r,g,b,a * w *h
myImage.setPixels(pixelArray);
Granted this would be operating directly on the floating point values of a very large array. I have no clue how well lua handles really large loops like that on a mobile device.
I just read this thread a little more carefully, especially Eric’s comment.
I almost think this thread could fall into 2 buckets.
- Flash BitmapData style manipulation to gain performance.
- Generative drawing.
BitmapData style could be something that could be handled with framebuffer objects. This has a lot of potential of actually INCREASING performance on things like tilemaps, parallax scrolling, and drawing applications. Basically they could be setup just like images, but you are able to draw other textures to the texture and only clear it when you want. Example of something that could really benefit from it would be lime. Another example would be a drawing application where you had a canvas that you wanted to “stamp” sprites onto without it being cleared.
Generative drawing would make more sense as something that could happen up front, like when you prepare your scene. I do think it would be nice to at least have some options to do this, with disclaimers about performance. Would give people a lot of room to create dynamic bitmap art.
Anyhow hope these suggestions help. [import]uid: 4555 topic_id: 894 reply_id: 22522[/import]