← back to roto on ba3a.dev

CanvasSampler

Renders what one frame shows inside its FrameBoxes box, at factor times the canvas size — the draft renders at four times the target and reduces later. Each output pixel takes the frame pixel under its centre, nearest-neighbour: no resampling filter, so every output colour or label is one the frame really held. What lies beyond the frame's edge is empty.

Functions

Link copied to clipboard
fun sample(labels: IndexedRaster, boxes: FrameBoxes, frame: Int, factor: Int): IndexedRaster

A label map — zones, palette labels — with 0, background, beyond the frame.

fun sample(mask: Mask, boxes: FrameBoxes, frame: Int, factor: Int): Mask

mask, a frame's foreground, sampled onto the canvas of boxes for frame; beyond the frame is background.

fun sample(raster: Raster, boxes: FrameBoxes, frame: Int, factor: Int): Raster

raster, a frame of the clip, sampled onto the canvas of boxes for frame; pixels beyond the frame are transparent.