Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ToneFilter

Hierarchy

Index

Constructors

constructor

Properties

alpha

alpha: number

The opacity value to use when mixing the original and resultant colors.

When the value is 0, the original color is used without modification. When the value is 1, the result color is used. When in the range (0, 1) the color is interpolated between the original and result by this amount.

member

{number}

default

1

autoFit

autoFit: boolean

If enabled, PixiJS will fit the filter area into boundaries for better performance. Switch it off if it does not work for specific shader.

member

{boolean} PIXI.Filter#autoFit

blendMode

blendMode: number

Sets the blendmode of the filter

member

{number}

default

PIXI.BLEND_MODES.NORMAL

enabled

enabled: boolean

If enabled is true the filter is applied, if false it will not.

member

{boolean} PIXI.Filter#enabled

Readonly legacy

legacy: boolean

Legacy filters use position and uvs from attributes

member

{boolean} PIXI.Filter#legacy

readonly

matrix

matrix: number[]

The matrix of the color matrix filter

member

{number[]}

default

[1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]

padding

padding: number

The padding of the filter. Some filters require extra space to breath such as a blur. Increasing this will add extra width and height to the bounds of the object that the filter is applied to.

member

{number} PIXI.Filter#padding

program

program: Program

Program that the shader uses

member

{PIXI.Program} PIXI.Shader#program

resolution

resolution: number

The resolution of the filter. Setting this to be lower will lower the quality but increase the performance of the filter.

member

{number} PIXI.Filter#resolution

state

state: State

The WebGL state the filter requires to render

member

{PIXI.State} PIXI.Filter#state

Readonly uniforms

uniforms: any

Shader uniform values, shortcut for uniformGroup.uniforms

readonly
member

{object}

Static Protected SOURCE_KEY_MAP

SOURCE_KEY_MAP: any

Used for caching shader IDs

static

Static Readonly defaultFragmentSrc

defaultFragmentSrc: string

The default fragment shader source

static
constant

Static Readonly defaultVertexSrc

defaultVertexSrc: string

The default vertex shader source

static
constant

Methods

_loadMatrix

  • _loadMatrix(matrix: number[], multiply: boolean): void
  • Transforms current matrix and set the new one

    Parameters

    • matrix: number[]

      5x4 matrix

    • multiply: boolean

      if true, current matrix and matrix are multiplied. If false, just set the current matrix with @param matrix

    Returns void

adjustHue

  • adjustHue(value?: number): void

adjustSaturation

  • adjustSaturation(value?: number): void

adjustTone

  • adjustTone(r?: number, g?: number, b?: number): void
  • Changes the tone.

    method

    adjustTone

    Parameters

    • Optional r: number

      The red strength in the range (-255, 255)

    • Optional g: number

      The green strength in the range (-255, 255)

    • Optional b: number

      The blue strength in the range (-255, 255)

    Returns void

apply

blackAndWhite

  • blackAndWhite(multiply: boolean): void

brightness

  • brightness(b: number, multiply: boolean): void
  • Adjusts brightness

    Parameters

    • b: number

      value of the brigthness (0-1, where 0 is black)

    • multiply: boolean

      if true, current matrix and matrix are multiplied. If false, just set the current matrix with @param matrix

    Returns void

browni

  • browni(multiply: boolean): void
  • Brown delicious browni filter (thanks Dominic Szablewski)

    Parameters

    • multiply: boolean

      if true, current matrix and matrix are multiplied. If false, just set the current matrix with @param matrix

    Returns void

colorTone

  • colorTone(desaturation: number, toned: number, lightColor: string, darkColor: string, multiply: boolean): void
  • We don't know exactly what it does, kind of gradient map, but funny to play with!

    Parameters

    • desaturation: number

      Tone values.

    • toned: number

      Tone values.

    • lightColor: string

      Tone values, example: 0xFFE580

    • darkColor: string

      Tone values, example: 0xFFE580

    • multiply: boolean

      if true, current matrix and matrix are multiplied. If false, just set the current matrix with @param matrix

    Returns void

contrast

  • contrast(amount: number, multiply: boolean): void
  • Set the contrast matrix, increase the separation between dark and bright Increase contrast : shadows darker and highlights brighter Decrease contrast : bring the shadows up and the highlights down

    Parameters

    • amount: number

      value of the contrast (0-1)

    • multiply: boolean

      if true, current matrix and matrix are multiplied. If false, just set the current matrix with @param matrix

    Returns void

desaturate

  • desaturate(): void

greyscale

  • greyscale(scale: number, multiply: boolean): void
  • Set the matrices in grey scales

    Parameters

    • scale: number

      value of the grey (0-1, where 0 is black)

    • multiply: boolean

      if true, current matrix and matrix are multiplied. If false, just set the current matrix with @param matrix

    Returns void

hue

  • hue(rotation: number, multiply: boolean): void
  • Set the hue property of the color

    Parameters

    • rotation: number

      in degrees

    • multiply: boolean

      if true, current matrix and matrix are multiplied. If false, just set the current matrix with @param matrix

    Returns void

kodachrome

  • kodachrome(multiply: boolean): void
  • Color reversal film introduced by Eastman Kodak in 1935. (thanks Dominic Szablewski)

    Parameters

    • multiply: boolean

      if true, current matrix and matrix are multiplied. If false, just set the current matrix with @param matrix

    Returns void

lsd

  • lsd(multiply: boolean): void
  • LSD effect

    Multiply the current matrix

    Parameters

    • multiply: boolean

      if true, current matrix and matrix are multiplied. If false, just set the current matrix with @param matrix

    Returns void

negative

  • negative(multiply: boolean): void
  • Negative image (inverse of classic rgb matrix)

    Parameters

    • multiply: boolean

      if true, current matrix and matrix are multiplied. If false, just set the current matrix with @param matrix

    Returns void

night

  • night(intensity: number, multiply: boolean): void
  • Night effect

    Parameters

    • intensity: number

      The intensity of the night effect.

    • multiply: boolean

      if true, current matrix and matrix are multiplied. If false, just set the current matrix with @param matrix

    Returns void

polaroid

  • polaroid(multiply: boolean): void

predator

  • predator(amount: number, multiply: boolean): void
  • Predator effect

    Erase the current matrix by setting a new indepent one

    Parameters

    • amount: number

      how much the predator feels his future victim

    • multiply: boolean

      if true, current matrix and matrix are multiplied. If false, just set the current matrix with @param matrix

    Returns void

reset

  • reset(): void

saturate

  • saturate(amount: number, multiply: boolean): void
  • Set the saturation matrix, increase the separation between colors Increase saturation : increase contrast, brightness, and sharpness

    Parameters

    • amount: number

      The saturation amount (0-1)

    • multiply: boolean

      if true, current matrix and matrix are multiplied. If false, just set the current matrix with @param matrix

    Returns void

sepia

  • sepia(multiply: boolean): void

technicolor

  • technicolor(multiply: boolean): void
  • Color motion picture process invented in 1916 (thanks Dominic Szablewski)

    Parameters

    • multiply: boolean

      if true, current matrix and matrix are multiplied. If false, just set the current matrix with @param matrix

    Returns void

toBGR

  • toBGR(multiply: boolean): void
  • Filter who transforms : Red -> Blue and Blue -> Red

    Parameters

    • multiply: boolean

      if true, current matrix and matrix are multiplied. If false, just set the current matrix with @param matrix

    Returns void

vintage

  • vintage(multiply: boolean): void
  • Vintage filter (thanks Dominic Szablewski)

    Parameters

    • multiply: boolean

      if true, current matrix and matrix are multiplied. If false, just set the current matrix with @param matrix

    Returns void

Static from

  • from(vertexSrc?: string, fragmentSrc?: string, uniforms?: any): Shader
  • A short hand function to create a shader based of a vertex and fragment shader

    Parameters

    • Optional vertexSrc: string
    • Optional fragmentSrc: string
    • Optional uniforms: any

    Returns Shader

    an shiny new Pixi shader!

Generated using TypeDoc