1
Lua / TI.Image: Get pixel color
« on: April 18, 2014, 11:27:10 am »
Is there a way to obtain the color of one pixel and plot that to the screen. I'd like to do some textured 3D rendering.
I don't think there is a method to do that and image metatables are hiden.
I thought of implementing it like this:
I don't think there is a method to do that and image metatables are hiden.
I thought of implementing it like this:
Code: [Select]
function plotPixelFromImage(gc, sx, sy, img, ix, iy)
gc:clipRect("set", sx, sy, 1, 1)
gc:drawImage(img, sx-ix, sy-iy)
gc:clipRect("reset")
end
but I think it would be quite CPU intensive. Or would it be easier to make my own image format?