Class: EffectsComponent

EffectsComponent()

Creates an Effects component.

Constructor

new EffectsComponent()

Source:

Members

(static, non-null) STATE :Object

State definition.
Type:
  • Object
Source:

Methods

attached()

Source:

detached()

Source:

generateThumbnail_(effect, imageData) → {Promise}

Generates a thumbnail for a given effect.
Parameters:
Name Type Description
effect String The effect to generate the thumbnail for.
imageData ImageData The image data to which the effect is applied.
Source:
Returns:
A promise that resolves when the thumbnail is generated.
Type
Promise

generateThumbnailImageData_(imageData) → {ImageData}

Generates a resized version of the image data to generate the thumbnails more efficiently.
Parameters:
Name Type Description
imageData ImageData The original image data.
Source:
Returns:
The resized image data.
Type
ImageData

generateThumbnails_(imageData) → {Promise}

Generates the complete set of thumbnails for the component effects.
Parameters:
Name Type Description
imageData ImageData The thumbnail image data (small version).
Source:
Returns:
A promise that resolves when the thumbnails are generated.
Type
Promise

prefetchEffects_() → {Promise}

Prefetches all the effect results.
Source:
Returns:
A promise that resolves when all the effects are prefetched.
Type
Promise

preview(imageData) → {Promise}

Applies the selected effect to the image.
Parameters:
Name Type Description
imageData ImageData The image data representation of the image.
Source:
Returns:
A promise that resolves when the webworker finishes processing the image.
Type
Promise

previewEffect(event)

Notifies the editor that the component wants to generate a new preview of the current image.
Parameters:
Name Type Description
event MouseEvent The mouse event.
Source:

process(imageData, effectName) → {Promise}

Applies the selected effect to the image.
Parameters:
Name Type Description
imageData ImageData The image data representation of the image.
effectName String The effect to apply to the image.
Source:
Returns:
A promise that resolves when the webworker finishes processing the image.
Type
Promise

scrollLeft()

Makes the carousel scroll left to reveal options of the visible area.
Source:
Returns:
void

scrollRight()

Makes the carousel scroll right to reveal options of the visible area.
Source:
Returns:
void

spawnWorker_(workerURI, message) → {Promise}

Spawns a webworker to process the image in a different thread.
Parameters:
Name Type Description
workerURI String The URI of the worker to spawn.
message Object The image and effect preset.
Source:
Returns:
A promise that resolves when the webworker finishes processing the image.
Type
Promise