Scoop API

scoop:scoop.graphics:0.1.0

Canvas

class Canvas

source · line 7
public
public class Canvas internal constructor(private val handle: GraphicsResource)

A canvas borrowed by a render callback. Every operation checks the active scope and owner.

Extensions

function saveLayer

source · line 110
public
public fun saveLayer(opacity: Double = 1.0, filter: ImageFilter? = None, blendMode: BlendMode = BlendMode.SrcOver, bounds: Rect? = None): Unit

Filters the group on restore; optional source bounds guide allocation without adding a clip.

function gpuDevice

source · line 74
public
public fun gpuDevice(): GpuDevice?

Retains this GPU context and its native queue. Raster canvases return None.

function saveBackdropLayer

source · line 147
public
public fun saveBackdropLayer(opacity: Double = 1.0, backdrop: ImageFilter? = None, bounds: Rect? = None): Unit

Starts with the current layer's prior pixels, optionally filtering that backdrop first. Restore interpolates premultiplied RGBA between the prior pixels and the completed group. Bounds guide allocation without clipping; include all drawing and backdrop sample ranges. Use saveLayer for a transparent, isolated group instead.

function drawImageRegion

source · line 326
public
public fun drawImageRegion(image: Image, source: Rect, destination: Rect, sampling: ImageSampling = ImageSampling.Linear, opacity: Double = 1.0): Unit

Linear sampling may use neighboring source pixels, including a tile's gutter.