Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Shujal

Pages: [1]
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:
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?

Pages: [1]