Class Composed

A container class that knows how to apply a sequence of filters to an input image.

Hierarchy

Constructors

Properties

mainParameter?: keyof Composed

Name of the parameter that can be changed in the filter. Some filters have more than one parameter and there is no mainParameter

subFilters: BaseFilter[]

A non sparse array of filters to apply

vertexSource: string = vertexSource

Array of attributes to send with buffers. do not modify

defaults: Record<string, any>
type: string = 'Composed'

The class type. Used to identify which class this is. This is used for serialization purposes and internally it can be used to identify classes. As a developer you could use instance of Class but to avoid importing all the code and blocking tree shaking we try to avoid doing that.

Accessors

Methods

  • Returns a string that represent the current selected shader code for the filter. Used to force recompilation when parameters change or to retrieve the shader from cache

    Returns string

  • Returns undefined | string | BaseFilter[] | ((gl, program) => TWebGLUniformLocationMap) | ((gl, program) => TWebGLAttributeLocationMap) | ((gl, uniformLocations) => void) | ((options) => void) | ((options) => TWebGLProgramCacheItem) | ((gl, fragmentSource?, vertexSource?) => {
        attributeLocations: TWebGLAttributeLocationMap;
        program: WebGLProgram;
        uniformLocations: TWebGLUniformLocationMap;
    }) | ((gl, attributeLocations, aPositionData) => void) | ((options) => void) | ((options) => void) | (() => boolean) | ((options) => void) | (() => string) | ((options) => void) | ((gl, texture, textureUnit) => void) | ((gl, textureUnit) => void) | (() => undefined | string | BaseFilter[] | ((gl, program) => TWebGLUniformLocationMap) | ((gl, program) => TWebGLAttributeLocationMap) | ((gl, uniformLocations) => void) | ((options) => void) | ((options) => TWebGLProgramCacheItem) | ((gl, fragmentSource?, vertexSource?) => {
        attributeLocations: TWebGLAttributeLocationMap;
        program: WebGLProgram;
        uniformLocations: TWebGLUniformLocationMap;
    }) | ((gl, attributeLocations, aPositionData) => void) | ((options) => void) | ((options) => void) | (() => boolean) | ((options) => void) | (() => string) | ((options) => void) | ((gl, texture, textureUnit) => void) | ((gl, textureUnit) => void) | (() => string | BaseFilter[] | ((gl: WebGLRenderingContext, program: WebGLProgram) => TWebGLUniformLocationMap) | ... 19 more ... | undefined) | (() => {
        subFilters: {
            type: string;
        }[];
        type: string;
    }) | (() => {
        type: string;
    }) | ((value) => void) | ((options) => void)) | (() => {
        subFilters: {
            type: string;
        }[];
        type: string;
    }) | (() => {
        type: string;
    }) | ((value) => void) | ((options) => void)

  • Generic isNeutral implementation for one parameter based filters. Used only in image applyFilters to discard filters that will not have an effect on the image Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter )

    Returns boolean

  • Send attribute data from this filter to its shader program on the GPU.

    Parameters

    • gl: WebGLRenderingContext

      The canvas context used to compile the shader program.

    • attributeLocations: Record<string, number>

      A map of shader attribute names to their locations.

    • aPositionData: Float32Array

    Returns void

  • Send uniform data from this filter to its shader program on the GPU.

    Intended to be overridden by subclasses.

    Parameters

    • gl: WebGLRenderingContext

      The canvas context used to compile the shader program.

    • uniformLocations: TWebGLUniformLocationMap

      A map of shader uniform names to their locations.

    Returns void

  • Serialize this filter into JSON.

    Returns {
        subFilters: {
            type: string;
        }[];
        type: string;
    }

    A JSON representation of this filter.

    • subFilters: {
          type: string;
      }[]
    • type: string

Generated using TypeDoc