OSL ‐ Canvas System - Mistium/Origin-OS GitHub Wiki
What is a canvas
An osl canvas is an image held in memory that can be modified quickly and easily by osl.
This is to allow for fast drawing apps and other applications that would not be possible otherwise
Manage your canvases
canv "create" id width height #colour
// creates a new canvas (used for rendering)
// much faster than the uri commands
canv "remove" id
// deletes the canvas
canv "expand" id width height #colour
// resizes the image with #colour filling in the added parts
canv "stretch" id width height
// stretches the canvas
Get data about canvases
log id.canvWidth()
log id.canvHeight()
// log the width and height of the canvas with this specific id
log id.canvPixels()
// log the number of pixels in the canvas
log id.canvData()
// log the data uri of the canvas
Set and get pixels
canv "set_pixel" id index #colour
// update the canvas pixel at index in "id" to #colour
log id.canvPixel(index)
// log the colour of the pixel at a specific index