Method GLUE.BaseTexture()->set_image_data()
- Method
set_image_data
voidset_image_data(Image.Image|mapping(string:mixed)data,bool|voidno_resize)- Description
Set the contents (and size) of the texture from the supplied data. The
datais identical to what would normally be sent as the last argument to glTex[Sub]Image2D() or an Image.Image object.If
no_resizeis specified, it is assumed that the data will fit in the texture, otherwise the parts that extend beyond it will be discarded.- Parameter
data Besides being an Image.Image object,
datacan be either of two types of mappins. First it can be a mapping with Image data."rgb":Image.ImageTexture image data.
"alpha":Image.ImageOptional alpha channel.
"luminance":Image.ImageOptional luminance channel.
Second it can be a mapping pointing out a shared memory segment.
"mem":System.MemoryThe shared memory segment.
"mem_w":intThe width and height of the memory segment.
"mem_h":int"mem_format":intThe format of the memory segment, e.g. GL.GL_RGB.
"mem_type":intThe low level format of the memory segment, e.g. GL.GL_UNSIGNED_BYTE.