Class: EffectsComponent

EffectsComponent()

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) → {CancellablePromise}

Generates a specific thumbnail for a given effect.
Parameters:
Name Type Description
effect String The effect to generate the thumbnail for.
imageData ImageData The image data to apply the effect to.
Source:
Returns:
A promise to be fullfilled when the thumbnail has been generated.
Type
CancellablePromise

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) → {CancellablePromise}

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 to be fullfilled when all thumbnails have been generated.
Type
CancellablePromise

prefetchEffects_() → {CancellablePromise}

Starts optimistically prefetching all the effect results.
Source:
Returns:
A promise to be fullfilled when all the effects have been prefetched
Type
CancellablePromise

preview(imageData) → {CancellablePromise}

Applies the selected effect to the image.
Parameters:
Name Type Description
imageData ImageData ImageData representation of the image.
Source:
Returns:
A promise that will resolve when the webworker finishes processing the image.
Type
CancellablePromise

previewEffect(event)

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

process(imageData, effectName) → {CancellablePromise}

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

scrollLeft()

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

scrollRight()

Makes the caousel scroll right to reveal options off the visible area
Source:
Returns:
void

spawnWorker_(workerURI, message) → {CancellablePromise}

Spawns the a webworker to do the image processing in a different thread.
Parameters:
Name Type Description
workerURI String URI of the worker to spawn.
message Object An object with the image and effect preset.
Source:
Returns:
A promise that will resolve when the webworker finishes processing the image.
Type
CancellablePromise