lua.wetgenes.grd.pixels
g:pixels(x,y,w,h)
g:pixels(x,y,z,w,h,d)
Read the area of pixels as a table of numerical values, the amount of numbers you get per pixel depends on the format of the grd.
g:pixels(x,y,w,h,"")
g:pixels(x,y,z,w,h,d,"")
Read the area of pixels as a string of byte values, the amount of bytes you get per pixel depends on the format of the grd. Note the passing in of an empty string to indicate that you with to receive a string.
g:pixels(x,y,w,h,tab)
g:pixels(x,y,z,w,h,d,tab)
Write the area of pixels from a table of numerical values which is provided in tab, the amount of numbers you need to provide per pixel depends on the format of the grd.
g:pixels(x,y,w,h,str)
g:pixels(x,y,z,w,h,d,str)
Write the area of pixels from a string of bytes which is provided in str, the amount of bytes you need to provide per pixel depends on the format of the grd.
g:pixels(x,y,w,h,grd)
g:pixels(x,y,z,w,h,d,grd)
Write the area of pixels from a grd which is provided in grd. use clip/layer functions to select a portion of a larger grd.
As you can see depending on the arguments given this does one of two things, read some pixels or write some pixels. The area that is to be used is provided first, as a 2d(x,y,w,h) or 3d(x,y,z,w,h,d) area. To read or write the entire 2d image or the first frame of an animation use (0,0,g.width,g.height)
Returns nil,error if something goes wrong so can be used with assert otherwise returns the requested data.