PluginImage
An image a plugin loaded with PluginContext.loadImage or PluginContext.createImage, for ToolView.image. It lasts until the plugin disposes of it or stops.
Properties
Section titled “Properties”height
Section titled “height”
readonlyheight:number
readonlywidth:number
Pixels.
Methods
Section titled “Methods”dispose()
Section titled “dispose()”dispose():
void
Frees the image’s pixels; views no longer draw it.
Returns
Section titled “Returns”void
pixels()
Section titled “pixels()”pixels():
Uint8Array
A copy of the image’s pixels: four bytes of red, green, blue and alpha each, in rows from the top, such as for reading a heightmap.
Returns
Section titled “Returns”Uint8Array
toPng()
Section titled “toPng()”toPng():
Uint8Array
The image encoded as a PNG file, to write with PluginFile.writeBytes.
Returns
Section titled “Returns”Uint8Array