Image
A width by height grid of RGBA pixels with 8 bits per channel, stored row by row from the top-left corner. Every pixel starts as transparent black.
Read and write pixels with get and set, or decode a PNG or JPEG file with Image.decode. fill, fillRect, fillCircle and drawLine paint shapes and draw lays another image, or a rectangle of it, over this one, all on the CPU and clipped to the image. A game turns an image into a texture it can draw with klyph.app.Assets.createTexture.
Throws
if width or height is not positive, or the image would need more than Int.MAX_VALUE bytes.
Types
Properties
Functions
Copies image, or the rectangle of it sourceWidth pixels wide and sourceHeight pixels tall whose top-left corner is at column sourceX and row sourceY, into this image with that corner at column x and row y. Texels are written as given, alpha included and nothing blended, so a transparent or half-transparent pixel replaces the one under it; draw is the call that blends.
Draws image, or the rectangle of it sourceWidth pixels wide and sourceHeight pixels tall whose top-left corner is at column sourceX and row sourceY, over this image with that corner at column x and row y, blending each of its pixels by its alpha.