Skip to content

Canvas2dFilterBackend

Defined in: src/filters/Canvas2dFilterBackend.ts:7

new Canvas2dFilterBackend(): Canvas2dFilterBackend

Canvas2dFilterBackend

resources: TPipelineResources = {}

Defined in: src/filters/Canvas2dFilterBackend.ts:15

Experimental. This object is a sort of repository of help layers used to avoid of recreating them during frequent filtering. If you are previewing a filter with a slider you probably do not want to create help layers every filter step. in this object there will be appended some canvases, created once, resized sometimes cleared never. Clearing is left to the developer.

applyFilters(filters, sourceElement, sourceWidth, sourceHeight, targetCanvas): void | T2DPipelineState

Defined in: src/filters/Canvas2dFilterBackend.ts:27

Apply a set of filters against a source image and draw the filtered output to the provided destination canvas.

BaseFilter<string, Record<string, any>, Record<string, any>>[]

The filter to apply.

CanvasImageSource

The source to be filtered.

number

The width of the source input.

number

The height of the source input.

HTMLCanvasElement

The destination for filtered output to be drawn.

void | T2DPipelineState