Sure, something simple would be like,
Although I strongly suggest accessing the bank directly using the same method as readpixel fastest above does, rather calling a function to do it, as that adds a lot of unneded overhead.
type img field pix,w,h end type function createFast(x,y,w,h) o.img=new img bank=createBank( w*h*3) lockbuffer for gy=x to y+h for gx=x to x+w pokeint bank,bo,readpixelfast(gx,gy) bo=bo+4 next next unlockbuffer o\pix=bank return handle(o) end function and then pass the returned handle to this func to retrieve pixel color very fastly. function readPixelFastest( img,x,y) in.img=object.img(img) return peekint(in\pix,(y*in\w+x)*4) end function
Although I strongly suggest accessing the bank directly using the same method as readpixel fastest above does, rather calling a function to do it, as that adds a lot of unneded overhead.