Class Invert

Example

const filter = new Invert();
object.filters.push(filter);
object.applyFilters(canvas.renderAll.bind(canvas));

Hierarchy

Constructors

Properties

alpha: boolean

Invert also alpha.

Param

Default


invert: boolean

Filter invert. if false, does nothing

Param

Default


mainParameter?: keyof Invert

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

vertexSource: string = vertexSource

Array of attributes to send with buffers. do not modify

defaults: Partial<TClassProperties<Invert>> = invertDefaultValues
type: string = 'Invert'

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 | boolean | ((gl, program) => TWebGLAttributeLocationMap) | ((options) => TWebGLProgramCacheItem) | (() => {
        type: string;
    }) | (() => {
        type: string;
    }) | ((gl, program) => TWebGLUniformLocationMap) | ((gl, uniformLocations) => void) | (() => string) | ((options) => void) | (() => boolean) | ((options) => void) | ((gl, fragmentSource?, vertexSource?) => {
        attributeLocations: TWebGLAttributeLocationMap;
        program: WebGLProgram;
        uniformLocations: TWebGLUniformLocationMap;
    }) | ((gl, attributeLocations, aPositionData) => void) | ((options) => void) | ((options) => void) | ((options) => void) | ((gl, texture, textureUnit) => void) | ((gl, textureUnit) => void) | (() => undefined | string | boolean | ((gl, program) => TWebGLAttributeLocationMap) | ((options) => TWebGLProgramCacheItem) | (() => {
        type: string;
    }) | (() => {
        type: string;
    }) | ((gl, program) => TWebGLUniformLocationMap) | ((gl, uniformLocations) => void) | (() => string) | ((options) => void) | (() => boolean) | ((options) => void) | ((gl, fragmentSource?, vertexSource?) => {
        attributeLocations: TWebGLAttributeLocationMap;
        program: WebGLProgram;
        uniformLocations: TWebGLUniformLocationMap;
    }) | ((gl, attributeLocations, aPositionData) => void) | ((options) => void) | ((options) => void) | ((options) => void) | ((gl, texture, textureUnit) => void) | ((gl, textureUnit) => void) | (() => string | boolean | ((gl: WebGLRenderingContext, program: WebGLProgram) => TWebGLAttributeLocationMap) | ... 19 more ... | undefined) | ((value) => void) | ((options) => void)) | ((value) => void) | ((options) => void)

  • Invert filter isNeutralState implementation Used only in image applyFilters to discard filters that will not have an effect on the image

    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 data from this filter to its shader program's uniforms.

    Parameters

    • gl: WebGLRenderingContext

      The GL canvas context used to compile this filter's shader.

    • uniformLocations: TWebGLUniformLocationMap

      A map of string uniform names to WebGLUniformLocation objects

    Returns void

  • Returns object representation of an instance

    Returns {
        type: string;
    }

    Object representation of an instance

    • type: string

Generated using TypeDoc