API Docs for: 6.0.1
Show:

window.scrawl_Filters Class

window.scrawl

scrawlFilters extension adaptions to the scrawl-canvas library object

New library sections

  • scrawl.filter - for filter objects

Methods

compile

() chainable

Display function - requests Cells to compile their <canvas> element

Cells will compile in ascending order of their compileOrder attributes, if their compiled attribute = true

By default:

  • the initial base canvas has a compileOrder of 9999 and compiles last
  • the initial display canvas has compiled = false and will not compile

(As amended by Filters module)

Returns:

This

compileFilters

() chainable

Prepare to draw entitys onto the Cell's <canvas> element, in line with the Cell's group Array

(As amended by Filters module)

Returns:

always true

filtersCellInit

() private

Cell constructor hook function - modified by filters module

Adds the filters attribute to Cell objects

filtersEntityInit

() private

Entity constructor hook function - modified by filters module

Adds the filters, filterOnStroke and filterLevel attributes to Entity objects

filtersPadInit

() private

Pad constructor hook function - modified by filters module

Adds the filters attribute to Pad objects

makeBlurFilter

(
  • items
)

A factory function to generate new Blur filter objects

Parameters:

  • items Object

    Key:value Object argument for setting attributes

Returns:

BlurFilter object

makeBrightnessFilter

(
  • items
)

A factory function to generate new Brightness filter objects

Parameters:

  • items Object

    Key:value Object argument for setting attributes

Returns:

BrightnessFilter object

makeChannelsFilter

(
  • items
)

A factory function to generate new Channels filter objects

Parameters:

  • items Object

    Key:value Object argument for setting attributes

Returns:

ChannelsFilter object

makeChannelStepFilter

(
  • items
)

A factory function to generate new ChannelStep filter objects

Parameters:

  • items Object

    Key:value Object argument for setting attributes

Returns:

ChannelStepFilter object

makeGreyscaleFilter

(
  • items
)

A factory function to generate new Greyscale filter objects

Parameters:

  • items Object

    Key:value Object argument for setting attributes

Returns:

GreyscaleFilter object

makeInvertFilter

(
  • items
)

A factory function to generate new Invert filter objects

Parameters:

  • items Object

    Key:value Object argument for setting attributes

Returns:

InvertFilter object

makeLeachFilter

(
  • items
)

A factory function to generate new Leach filter objects

Parameters:

  • items Object

    Key:value Object argument for setting attributes

Returns:

LeachFilter object

makeMatrixFilter

(
  • items
)

A factory function to generate new Matrix filter objects

Parameters:

  • items Object

    Key:value Object argument for setting attributes

Returns:

MatrixFilter object

makeNoiseFilter

(
  • items
)

A factory function to generate new Noise filter objects

Parameters:

  • items Object

    Key:value Object argument for setting attributes

Returns:

NoiseFilter object

makePixelateFilter

(
  • items
)

A factory function to generate new Pixelate filter objects

Parameters:

  • items Object

    Key:value Object argument for setting attributes

Returns:

PixelateFilter object

makeSaturationFilter

(
  • items
)

A factory function to generate new Saturation filter objects

Parameters:

  • items Object

    Key:value Object argument for setting attributes

Returns:

SaturationFilter object

makeSeparateFilter

(
  • items
)

A factory function to generate new Separate filter objects

Parameters:

  • items Object

    Key:value Object argument for setting attributes

Returns:

SeparateFilter object

makeSharpenFilter

(
  • items
)

A factory function to generate new Sharpen filter objects

Parameters:

  • items Object

    Key:value Object argument for setting attributes

Returns:

SharpenFilter object

makeThresholdFilter

(
  • items
)

A factory function to generate new Threshold filter objects

Parameters:

  • items Object

    Key:value Object argument for setting attributes

Returns:

ThresholdFilter object

makeTintFilter

(
  • items
)

A factory function to generate new Tint filter objects

Parameters:

  • items Object

    Key:value Object argument for setting attributes

Returns:

TintFilter object

newBlurFilter

() deprecated

Alias for makeBlurFilter()

newBrightnessFilter

() deprecated

Alias for makeBrightnessFilter()

newChannelsFilter

() deprecated

Alias for makeChannelsFilter()

newChannelStepFilter

() deprecated

Alias for makeChannelStepFilter()

newGreyscaleFilter

() deprecated

Alias for makeGreyscaleFilter()

newInvertFilter

() deprecated

Alias for makeInvertFilter()

newLeachFilter

() deprecated

Alias for makeLeachFilter()

newMatrixFilter

() deprecated

Alias for makeMatrixFilter()

newNoiseFilter

() deprecated

Alias for makeNoiseFilter()

newPixelateFilter

() deprecated

Alias for makePixelateFilter()

newSaturationFilter

() deprecated

Alias for makeSaturationFilter()

newSeparateFilter

() deprecated

Alias for makeSeparateFilter()

newSepiaFilter

(
  • items
)

A factory function to generate new Sepia filter objects preset with values for creating a sepia tint

Parameters:

  • items Object

    Key:value Object argument for setting attributes

Returns:

TintFilter object

newSepiaFilter

() deprecated

Alias for makeSepiaFilter()

newSharpenFilter

() deprecated

Alias for makeSharpenFilter()

newThresholdFilter

() deprecated

Alias for makeThresholdFilter()

newTintFilter

() deprecated

Alias for makeTintFilter()

show

() chainable

Display function - requests Cells to show their <canvas> element

Cells will show in ascending order of their showOrder attributes, if their show attribute = true

By default, the initial base and display canvases have shown = false:

  • 'show' involves a cell copying itself onto the base cell; it makes no sense for the base cell to copy onto itself
  • the last action is to copy the base cell onto the display cell

(As amended by Filters module)

Returns:

This

stampFilter

() private

Entity.stamp hook function - add a filter to an Entity, and any background detail enclosed by the Entity

stampFilterActions

() private

reciprocal assignment - also occurs in scrawlFrame as there's no way to tell which file (scrawlFrame, scrawlFilters) will be loaded first

stampFilterActions (not a function)

() private

Entity.stampFilter helper object

stampFilterDefault

() private

Entity.stamp hook helper function

stampFilterPhrase

() private

Entity.stamp hook helper function

stampFilterPicture

() private

Entity.stamp hook helper function

stampFilterWheel

() private

Entity.stamp hook helper function

Properties

Cell.filters

Array

Array of FILTERNAME strings, for filters to be applied to the Cell

Default: []

Entity.filterLevel

String

The filterLevel attribute determines at which point in the display cycle the filter will be applied. Permitted values are:

  • 'entity' - filter is applied immediately after the Entity has stamped itself onto a cell
  • 'cell' - filter is applied after all Entites have completed stamping themselves onto the cell
  • 'pad' - filter is applied to the base canvas after all cells have completed copying themselves onto it, and before the base cell copies itself onto the display cell

Default: 'entity'

Entity.filterOnStroke

Boolean

Filter flag - when true, will draw the entity; on false (default), the clip method is used instead

Default: false

Entity.filters

Array

Array of FILTERNAME strings, for filters to be applied to this entity

Default: []

Pad.filters

Array

Array of FILTERNAME strings, for filters to be applied to the Pad

Default: []

scrawl.work.filterCanvas

CasnvasObject private

Utility canvases - never displayed

scrawl.work.filterCvx

CasnvasContextObject private

Utility canvas 2d context engine