Class: TensorFilter

TensorFilter

A TensorFilter and it's subclasses perform operations on logical 4D and 2D tensors. These are either simple mathematical operations, but might also be more complex operations like 2D convolutions. To do so, the TensorFilter provides an interface to access the textures values in a 2D ([height, width]) or 4D fashion ([batch, height, width, channels]) and allows uploads of additional data (e.g. filters and kernels) in separate textures. The actual management of render targets and supplementary textures is done within the graph.

new TensorFilter()

sdk/operations/art-filter-operation/filters/tensor-filter.js, line 36

Extends

Methods

getShaderForRenderer(renderer)

sdk/operations/art-filter-operation/filters/tensor-filter.js, line 73

Overwritten parent method to ensure compiled fragment shaders upon execution of filter.

Name Type Description
renderer PhotoEditorSDK.Engine.Renderer

getShaderIdentifier()

sdk/operations/art-filter-operation/filters/tensor-filter.js, line 153

Returns a unique identifier which might be used to cache the underlying WebGLProgram.

outputLogicalShape(){Array.<Number>}

sdk/operations/art-filter-operation/filters/tensor-filter.js, line 85

This filters output shape.

Returns:
Type Description
Array.<Number>

prepareUniforms()

sdk/operations/art-filter-operation/filters/tensor-filter.js, line 182

Populate this filters uniforms with all required values.

requiresFloatTextures(){Boolean}

sdk/operations/art-filter-operation/filters/tensor-filter.js, line 48

Used to determine the required target texture type.

Returns:
Type Description
Boolean

setTargetTextureSize()

sdk/operations/art-filter-operation/filters/tensor-filter.js, line 55

Before rendering the filter, we need to populate all of the uniforms.