Class: OperationsStack

PhotoEditorSDK~ OperationsStack

Holds an array of PhotoEditorSDK.Operation instances and handles their dirtiness

new OperationsStack(operations)

sdk/core/lib/operations-stack.js, line 30

Creates an OperationsStack

Name Type Default Description
operations Array.<PhotoEditorSDK.Operation> [] optional

Methods

clear()

sdk/core/lib/operations-stack.js, line 45

Clears this operations stack

clone(){PhotoEditorSDK.OperationsStack}

sdk/core/lib/operations-stack.js, line 224

Returns a cloned instance of this stack

Returns:
Type Description
PhotoEditorSDK.OperationsStack

disableCache()

sdk/core/lib/operations-stack.js, line 81

Disables the cache on all operations

enableCache()

sdk/core/lib/operations-stack.js, line 74

Enables the cache on all operations

forEach(iterator){Array}

sdk/core/lib/operations-stack.js, line 90

Passes Array#forEach

Name Type Description
iterator function
Returns:
Type Description
Array

get(index){PhotoEditorSDK.Operation}

sdk/core/lib/operations-stack.js, line 233

Returns the operation at the given index

Name Type Description
index Number
Returns:
Type Description
PhotoEditorSDK.Operation

getByIdentifier(identifier){PhotoEditorSDK.Operation}

sdk/core/lib/operations-stack.js, line 242

Returns the first operation found with the given identifier

Name Type Description
identifier string
Returns:
Type Description
PhotoEditorSDK.Operation

getIndexByIdentifier(identifier){number}

sdk/core/lib/operations-stack.js, line 252

Returns the index in the stack of the first operation with the given identifier. Returns -1 if no such operation exists.

Name Type Description
identifier string
Returns:
Type Description
number

getStack(){Array.<PhotoEditorSDK.Operation>}

sdk/core/lib/operations-stack.js, line 320

Returns the stack

Returns:
Type Description
Array.<PhotoEditorSDK.Operation>

hasChanges(){Boolean}

sdk/core/lib/operations-stack.js, line 55

Checks if the operation has changes/modifications

Returns:
Type Description
Boolean

moveToTop(identifier)

sdk/core/lib/operations-stack.js, line 261

Moves the operation with a given identifier to the top of the stack.

Name Type Description
identifier String

pop()

sdk/core/lib/operations-stack.js, line 202

Remove the last operation from the stack

push(operation)

sdk/core/lib/operations-stack.js, line 194

Adds the given operation to this stack

Name Type Description
operation PhotoEditorSDK.Operation

remove(operation)

sdk/core/lib/operations-stack.js, line 292

Removes the given operation

Name Type Description
operation PhotoEditorSDK.Operation

removeAt(index)

sdk/core/lib/operations-stack.js, line 308

Removes the operation at the given index

Name Type Description
index Number

render(sdk, inputTexture){Promise}

sdk/core/lib/operations-stack.js, line 102

Renders all operations

Name Type Description
sdk PhotoEditorSDK
inputTexture PhotoEditorSDK.Engine.Texture
Returns:
Type Description
Promise

set(index, operation)

sdk/core/lib/operations-stack.js, line 279

Sets the operation at the given index to the given one

Name Type Description
index Number
operation PhotoEditorSDK.Operation

setAllToDirty(dimensionsChanged)

sdk/core/lib/operations-stack.js, line 167

Sets all operations to dirty

Name Type Default Description
dimensionsChanged Boolean false

= falses

unshift(operation)

sdk/core/lib/operations-stack.js, line 215

Adds the given operation before all existing operations

Name Type Description
operation PhotoEditorSDK.Operation

updateDirtinessForRenderer(renderer)

sdk/core/lib/operations-stack.js, line 175

Finds the first dirty operation and sets all following operations to dirty

Name Type Description
renderer PhotoEditorSDK.Engine.BaseRenderer

validateSettings(){Promise}

sdk/core/lib/operations-stack.js, line 155

Validates the settings of all operations

Returns:
Type Description
Promise