Read-only view of the current params. Use setParam(key, value)
to mutate so values like count are sanitized. (External tools
such as tweakpane bind directly to the underlying object and
skip the validation; the type marker is for programmatic use.)
The rect this stage draws into, as [x, y, w, h].
Coordinates are in physical pixels, relative to the element, with
the origin at the bottom-left.
Omit this method (or return undefined) when the effect does not
change the size of the content, such as a grayscale or invert
filter. The stage then draws into the same rect as its input.
Some common rects to return:
dims.contentRect — just the element, with no extra space.px extra pixels on every side, for effects[-px, -px, elementPixel[0] + 2 * px, elementPixel[1] + 2 * px].dims.canvasRect — the whole canvas, including thescrollPadding area around the viewport.Each stage picks its own rect. If one stage returns 100×100 and
the next returns 50×50, those are the sizes used; rects do not
grow as the chain runs.
Render phase. Omit to make this effect transparent in the chain.
Validated bulk setter. Pass any subset of params; bad inputs
(NaN / negative count, etc) are coerced to valid values
before applying.
Effect interface.
Lifecycle hooks:
init: called once on effect registerupdate: called every frame, beforerenderrender: called every frame. Bypassed if omitteddispose: called once on removaloutputRectdeclares the rect this stage writes into, inelement-local physical px. Defaults to the source rect (no growth).