API Documentation for: NEXT
Show:

AberrationFilter Class

Extends Filter
Defined in: AberrationFilter:38
Module: EaselJS

Separates and pushes each of the colour channels apart. I.E. shift the red channel slightly left. Allows specifying the direction and the ammount it affects each channel. Great for computer glitches and VCR like effects.

See Filter for an more information on applying filters.

Constructor

AberrationFilter

(
  • [xDir=0]
  • [yDir=0]
  • [redMultiplier=0]
  • [greenMultiplier=0]
  • [blueMultiplier=0]
  • [originalMix=0]
  • [alphaMax=false]
)

Defined in AberrationFilter:38

Parameters:

  • [xDir=0] Number optional

    Movement in x at a multiplier of 1, specified in pixels.

  • [yDir=0] Number optional

    Movement in y at a multiplier of 1, specified in pixels.

  • [redMultiplier=0] Number optional

    Multiplier for the movement of the Red channel. Negative values allowed.

  • [greenMultiplier=0] Number optional

    Multiplier for the movement of the Green channel. Negative values allowed.

  • [blueMultiplier=0] Number optional

    Multiplier for the movement of the Blue channel. Negative values allowed.

  • [originalMix=0] Number optional

    Amount of original image to keep, 0-1.

  • [alphaMax=false] Boolean optional

    Calculate combined alpha using maximum alpha available. Creates a stronger image.

Methods

_applyFilter

(
  • imageData
)
Boolean

Inherited from Filter: _applyFilter:206

Parameters:

  • imageData ImageData

    Target ImageData instance.

Returns:

applyFilter

(
  • ctx
  • x
  • y
  • width
  • height
  • [targetCtx=ctx]
)
Boolean

Inherited from Filter: applyFilter:161

Applies the filter to the specified context.

Parameters:

  • ctx CanvasRenderingContext2D

    The 2D context to use as the source.

  • x Number

    The x position to use for the source rect.

  • y Number

    The y position to use for the source rect.

  • width Number

    The width to use for the source rect.

  • height Number

    The height to use for the source rect.

  • [targetCtx=ctx] CanvasRenderingContext2D optional

    The 2D context to draw the result to. Defaults to the context passed to ctx.

Returns:

Boolean:

If the filter was applied successfully.

clone

() Filter

Inherited from Filter: clone:196

Returns a clone of this Filter instance.

Returns:

Filter:

A clone of the current Filter instance.

getBounds

(
  • [rect]
)
Rectangle

Inherited from Filter: getBounds:142

Provides padding values for this filter. That is, how much the filter will extend the visual bounds of an object it is applied to.

Parameters:

  • [rect] Rectangle optional

    If specified, the provided Rectangle instance will be expanded by the padding amounts and returned.

Returns:

Rectangle:

If a rect param was provided, it is returned. If not, either a new rectangle with the padding values, or null if no padding is required for this filter.

shaderParamSetup

(
  • gl
  • stage
  • shaderProgram
)

Inherited from Filter: shaderParamSetup:152

Assign any unique uniforms or other setup functionality here.

Parameters:

  • gl WebGLContext

    The context associated with the stage performing the render.

  • stage StageGL

    The stage instance that will be rendering.

  • shaderProgram ShaderProgram

    The compiled shader that is going to be used to perform the render.

toString

() String

Inherited from Filter: toString:187

Returns a string representation of this object.

Returns:

String:

a string representation of the instance.

Properties

_multiPass

Filter private

Inherited from Filter: _multiPass:88

Another filter that is required to act as part of this filter and created and managed under the hood.

Default: null

FRAG_SHADER

String readonly

Inherited from Filter: FRAG_SHADER:106

Pre-processed template shader code. It will be parsed before being fed in into the shader compiler. This should be based upon StageGL.SHADER_FRAGMENT_BODY_REGULAR

usesContext

Boolean

Inherited from Filter: usesContext:80

A flag stating that this filter uses a context draw mode and cannot be batched into imageData processing.

Default: false

VTX_SHADER

String readonly

Inherited from Filter: VTX_SHADER:97

Pre-processed template shader code. It will be parsed before being fed in into the shader compiler. This should be based upon StageGL.SHADER_VERTEX_BODY_REGULAR