Class Gamma

Gamma filter class

Example

const filter = new Gamma({
gamma: [1, 0.5, 2.1]
});
object.filters.push(filter);
object.applyFilters();

Hierarchy

Constructors

Properties

gamma: GammaInput

Gamma array value, from 0.01 to 2.2.

Param

Default


mainParameter?: keyof Gamma

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

rgbValues?: {
    b: Uint8Array;
    g: Uint8Array;
    r: Uint8Array;
}

Type declaration

  • b: Uint8Array
  • g: Uint8Array
  • r: Uint8Array
vertexSource: string = vertexSource

Array of attributes to send with buffers. do not modify

defaults: Partial<TClassProperties<Gamma>> = gammaDefaultValues
type: string = 'Gamma'

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 | ((gl, program) => TWebGLAttributeLocationMap) | ((options) => TWebGLProgramCacheItem) | ((options?) => boolean) | GammaInput | (() => {
        type: string;
    }) | (() => {
        type: string;
    }) | ((gl, program) => TWebGLUniformLocationMap) | ((gl, uniformLocations) => void) | (() => string) | (() => string) | ((options) => void) | ((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 | ((gl, program) => TWebGLAttributeLocationMap) | ((options) => TWebGLProgramCacheItem) | ((options?) => boolean) | GammaInput | (() => {
        type: string;
    }) | (() => {
        type: string;
    }) | ((gl, program) => TWebGLUniformLocationMap) | ((gl, uniformLocations) => void) | (() => string) | (() => string) | ((options) => void) | ((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 | ((gl: WebGLRenderingContext, program: WebGLProgram) => TWebGLAttributeLocationMap) | ((options: TWebGLPipelineState) => TWebGLProgramCacheItem) | ... 21 more ... | undefined) | ((value) => void) | ((options) => void) | {
        b: Uint8Array;
        g: Uint8Array;
        r: Uint8Array;
    }) | ((value) => void) | ((options) => void) | {
        b: Uint8Array;
        g: Uint8Array;
        r: Uint8Array;
    }

  • 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 )

    Parameters

    • Optional options: any

    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