Canvas2dFilterBackend
Defined in: src/filters/Canvas2dFilterBackend.ts:7
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Canvas2dFilterBackend():
Canvas2dFilterBackend
Returns
Section titled “Returns”Canvas2dFilterBackend
Properties
Section titled “Properties”resources
Section titled “resources”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.
Methods
Section titled “Methods”applyFilters()
Section titled “applyFilters()”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.
Parameters
Section titled “Parameters”filters
Section titled “filters”BaseFilter
<string
, Record
<string
, any
>, Record
<string
, any
>>[]
The filter to apply.
sourceElement
Section titled “sourceElement”CanvasImageSource
The source to be filtered.
sourceWidth
Section titled “sourceWidth”number
The width of the source input.
sourceHeight
Section titled “sourceHeight”number
The height of the source input.
targetCanvas
Section titled “targetCanvas”HTMLCanvasElement
The destination for filtered output to be drawn.
Returns
Section titled “Returns”void
| T2DPipelineState