Class: Editor

Editor

The Editor class is an interface to the SDK (managing operations)

new Editor()

server/lib/editor.js, line 33

Methods

broadcastFlip(direction)

server/lib/editor.js, line 273

Broadcasts a flip to all operations that need to be changed

Name Type Description
direction String

broadcastRotate(degrees)

server/lib/editor.js, line 288

Broadcasts a rotation to all operations that need to be changed

Name Type Description
degrees Number

broadcastTransform(transformOperation, options)

server/lib/editor.js, line 255

Broadcasts a transform to all operations that need to be changed

Name Type Description
transformOperation PhotoEditorSDK.Operations.TransformOperation
options Object

deserialize(data){Promise}

server/lib/editor.js, line 341

Deserializes the given data

Name Type Description
data Object
Returns:
Type Description
Promise

dispose()

server/lib/editor.js, line 365

Cleans this instance up

export(download){Promise}

server/lib/editor.js, line 220

Exports an image

Name Type Default Description
download Boolean false

= false

Returns:
Type Description
Promise

getCrossOrigin()

server/lib/editor.js, line 147

Returns the crossOrigin value to be set to image elements, according to the passed crossOrigin option.

Returns:
String

getFinalDimensions(incorporateSpriteScale){PhotoEditorSDK.Math.Vector2}

server/lib/editor.js, line 177

Returns the final dimensions that the input image would have after all existing operations have been applied

Name Type Default Description
incorporateSpriteScale Boolean false

= false

Returns:
Type Description
PhotoEditorSDK.Math.Vector2

getImage(){Image}

server/lib/editor.js, line 395

Returns the image

Returns:
Type Description
Image

getInputDimensions(){PhotoEditorSDK.Math.Vector2}

server/lib/editor.js, line 389

Returns the input image dimensions

Returns:
Type Description
PhotoEditorSDK.Math.Vector2 s

getOptions(){Object}

server/lib/editor.js, line 403

Returns the options

Returns:
Type Description
Object

getOutputDimensions(incorporateSpriteScale){PhotoEditorSDK.Math.Vector2}

server/lib/editor.js, line 158

Returns the output sprite's current dimensions

Name Type Default Description
incorporateSpriteScale Boolean false

= false

Returns:
Type Description
PhotoEditorSDK.Math.Vector2

getOutputTextureDimensions(incorporateSpriteScale){PhotoEditorSDK.Math.Vector2}

server/lib/editor.js, line 167

Returns the output texture's current dimensions

Name Type Default Description
incorporateSpriteScale Boolean false

= false

Returns:
Type Description
PhotoEditorSDK.Math.Vector2

getRenderer(){PhotoEditorSDK.Engine.BaseRenderer}

server/lib/editor.js, line 377

Returns the renderer

Returns:
Type Description
PhotoEditorSDK.Engine.BaseRenderer

getSDK(){PhotoEditorSDK}

server/lib/editor.js, line 383

Returns the SDK

Returns:
Type Description
PhotoEditorSDK

getUI(){DesktopUI}

server/lib/editor.js, line 411

Returns the UI

Returns:
Type Description
DesktopUI

reset()

server/lib/editor.js, line 355

Resets everything

serialize(options, version){Promise}

server/lib/editor.js, line 327

Serializes the editor state for the given version

Name Type Default Description
options Object

= {}

version String 3.8.0

= '3.4.0'

Returns:
Type Description
Promise

setImage(image, resetEditor)

server/lib/editor.js, line 76

Sets the given image to be rendered. If the image needs to be resized to fit into a WebGL texture or to match the maxMegaPixels option, resizing is done before setting the image.

Name Type Default Description
image Image
resetEditor Boolean true

[description]