Filter

Filter tool.

Constructor

new Filter(app)

Parameters:
NameTypeDescription
appApp

The associated application.

Classes

Filter

Members

keydown

Handle keydown event.

Methods

activate(bool)

Activate the tool.

Parameters:
NameTypeDescription
boolboolean

Flag to activate or not.

addEventListener(type, callback)

Add an event listener to this class.

Parameters:
NameTypeDescription
typestring

The event type.

callbackfunction

The function associated with the provided event type, will be called with the fired event.

getEventNames() → {Array}

Get the list of event names that this tool can fire.

Returns:

The list of event names.

Type: 
Array

getFilterList() → {Array}

Get the list of filters.

Returns:

The list of filter objects.

Type: 
Array

getOptionsType() → {string}

Get the type of tool options: here 'instance' since the filter list contains instances of each possible filter.

Returns:

The type.

Type: 
string

getSelectedFilter() → {object}

Get the selected filter.

Returns:

The selected filter.

Type: 
object

hasFilter(name) → {string}

Check if a filter is in the filter list.

Parameters:
NameTypeDescription
namestring

The name to check.

Returns:

The filter list element for the given name.

Type: 
string

init()

Initialise the filter. Called once the image is loaded.

removeEventListener(type, callback)

Remove an event listener from this class.

Parameters:
NameTypeDescription
typestring

The event type.

callbackfunction

The function associated with the provided event type.

setFeatures(features)

Set the tool live features: filter name.

Parameters:
NameTypeDescription
featuresobject

The list of features.

setOptions(options)

Set the tool options.

Parameters:
NameTypeDescription
optionsobject

The list of filter names amd classes.