new PhotoEditorSDK(preferredRenderer, options)
Creates a PhotoEditorSDK instance
Name | Type | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
preferredRenderer |
String | webgl |
optional
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
Object |
|
Classes
Namespaces
Members
-
constantOptionTypeString
-
The available option types for classes inheriting PhotoEditorSDK.Configurable
Properties:
Name Type Description NUMBER
string VECTOR2
string COLOR_MATRIX
string COLOR
string ARRAY
string OBJECT
string STRING
string BOOLEAN
string CONFIGURABLE
string IMAGE
string FUNCTION
string TEXTURE
string ALL
string -
static,constantPhotoEditorSDK.exports.ImageFormatString
-
The available image types
Properties:
Name Type Description PNG
string image/png
JPEG
string image/jpeg
RAW
string raw
-
static,constantPhotoEditorSDK.exports.RenderTypeString
-
The available render types
Properties:
Name Type Description IMAGE
string image
DATAURL
string data-url
BUFFER
string buffer (Only supported by the Server SDK)
BLOB
string blob
MSBLOB
string ms-blob
-
staticPhotoEditorSDK.version
-
The current version of the SDK
-
constantRendererTypeString
-
The available renderer types
Properties:
Name Type Description WEBGL
string CANVAS
string -
constantUniformTypeString
-
The available uniform types for WebGL shaders
Properties:
Name Type Description SAMPLER2D
string INT
string INT1
string FLOAT
string FLOAT1
string FLOAT2
string FLOAT_VECTOR2
string FLOAT3
string FLOAT4
string MAT3
string MAT3FV
string MAT4
string
Methods
-
_disposeTextures()
sdk/core/sdk.js, line 820 -
Dispose the flagged textures.
-
addOperation(operation)
sdk/core/sdk.js, line 535 -
Adds the given operation to the operations stack
Name Type Description operation
PhotoEditorSDK.Operation -
createOperation(identifier, options, addToStack){PhotoEditorSDK.Operation}
sdk/core/sdk.js, line 518 -
Creates an operation with the given identifier
Name Type Default Description identifier
String options
Object {} optional addToStack
Boolean true optional Returns:
Type Description PhotoEditorSDK.Operation -
dispose()
sdk/core/sdk.js, line 1130 -
Disposes the SDK
-
disposeTexture(texture)
sdk/core/sdk.js, line 813 -
Flag a texture for disposal at the end of the next render.
Name Type Description texture
PhotoEditorSDK.Engine.Texture -
export(renderType, imageFormat, quality){Promise}
sdk/core/sdk.js, line 303 -
Exports the image with the given options. Result of the Promise is the exported image or data url.
Name Type Default Description renderType
PhotoEditorSDK.RenderType PhotoEditorSDK.RenderType.DATAURL optional The output type
imageFormat
PhotoEditorSDK.ImageFormat PhotoEditorSDK.ImageFormat.PNG optional The output image format
quality
Number 0.8 optional The image quality, between 0 and 1
Returns:
Type Description Promise -
getCanvas(){HTMLCanvasElement}
sdk/core/sdk.js, line 894 -
Returns the canvas
Returns:
Type Description HTMLCanvasElement -
getContainer(){PhotoEditorSDK.Engine.Container}
sdk/core/sdk.js, line 918 -
Returns the container
Returns:
Type Description PhotoEditorSDK.Engine.Container -
getExif(){PhotoEditorSDK.Exif}
sdk/core/sdk.js, line 1073 -
Returns the Exif instance
Returns:
Type Description PhotoEditorSDK.Exif [description] -
getFinalDimensions(incorporateSpriteScale){PhotoEditorSDK.Math.Vector2}
sdk/core/sdk.js, line 564 -
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}
sdk/core/sdk.js, line 805 -
Returns the image
Returns:
Type Description Image -
getInputDimensions(){PhotoEditorSDK.Math.Vector2}
sdk/core/sdk.js, line 553 -
Returns the initial image dimensions
Returns:
Type Description PhotoEditorSDK.Math.Vector2 -
getInputTexture(){PhotoEditorSDK.Engine.Texture}
sdk/core/sdk.js, line 1089 -
Returns the input texture
Returns:
Type Description PhotoEditorSDK.Engine.Texture -
getOffset(){PhotoEditorSDK.Math.Vector2}
sdk/core/sdk.js, line 963 -
Returns the rendering offset
Returns:
Type Description PhotoEditorSDK.Math.Vector2 -
getOperations(){Array.<Operation>}
sdk/core/sdk.js, line 947 -
Returns the available operations
Returns:
Type Description Array.<Operation> -
getOperationsStack(){PhotoEditorSDK.OperationsStack}
sdk/core/sdk.js, line 926 -
Returns the operation stack
Returns:
Type Description PhotoEditorSDK.OperationsStack -
getOptions(){Object}
sdk/core/sdk.js, line 1081 -
Returns the options
Returns:
Type Description Object -
getOutputDimensions(incorporateSpriteScale){Vector2}
sdk/core/sdk.js, line 585 -
Returns the current sprite dimensions
Name Type Default Description incorporateSpriteScale
Boolean false = false
Returns:
Type Description Vector2 -
getOutputTextureDimensions(incorporateSpriteScale){Vector2}
sdk/core/sdk.js, line 596 -
Returns the dimensions of the output texture
Name Type Default Description incorporateSpriteScale
Boolean false = false
Returns:
Type Description Vector2 -
getPixelRatio(){Number}
sdk/core/sdk.js, line 1065 -
Returns the pixel ratio
Returns:
Type Description Number -
getRenderer(){PhotoEditorSDK.Engine.BaseRenderer}
sdk/core/sdk.js, line 955 -
Returns the renderer
Returns:
Type Description PhotoEditorSDK.Engine.BaseRenderer -
getRenderMode(){String}
sdk/core/sdk.js, line 984 -
Returns the current render mode
Returns:
Type Description String -
getRotation()
sdk/core/sdk.js, line 1114 -
Returns the current rotation
-
getSprite(){PhotoEditorSDK.Engine.Sprite}
sdk/core/sdk.js, line 910 -
Returns the sprite
Returns:
Type Description PhotoEditorSDK.Engine.Sprite -
getSpriteScale(){Number}
sdk/core/sdk.js, line 1047 -
Returns the output sprite's scale
Returns:
Type Description Number -
getTextureQuality(){Number}
sdk/core/sdk.js, line 1018 -
Returns the texture quality
Returns:
Type Description Number -
getZoom(){Number}
sdk/core/sdk.js, line 1000 -
Returns the zoom level
Returns:
Type Description Number -
hasChanges(){Boolean}
sdk/core/sdk.js, line 1122 -
Check if the OperationsStack has changes
Returns:
Type Description Boolean -
hasImage(){Boolean}
sdk/core/sdk.js, line 797 -
Checks if an image is provided
Returns:
Type Description Boolean [description] -
registerOperations(operations)
sdk/core/sdk.js, line 497 -
Registers the given operations
Name Type Description operations
Array.<PhotoEditorSDK.Operation> -
removeOperation(operation)
sdk/core/sdk.js, line 543 -
Removes the given operation from the operations stack
Name Type Description operation
PhotoEditorSDK.Operation -
render(renderOutput){Promise}
sdk/core/sdk.js, line 329 -
Renders the current image to the canvas
Name Type Default Description renderOutput
Boolean true = true
Returns:
Type Description Promise -
reset()
sdk/core/sdk.js, line 666 -
Resets all custom and selected operations
-
resizeTo(dimensions)
sdk/core/sdk.js, line 659 -
Resizes the renderer to the given dimensions
Name Type Description dimensions
PhotoEditorSDK.Math.Vector2 -
setAllOperationsToDirty(dimensionsChanged)
sdk/core/sdk.js, line 507 -
Sets all operations in the stack to dirty
Name Type Default Description dimensionsChanged
Boolean false = false
-
setCanvas(canvas)
sdk/core/sdk.js, line 902 -
Sets the canvas
Name Type Description canvas
HTMLCanvasElement -
setImage(image, exif, dimensions)
sdk/core/sdk.js, line 834 -
Sets the image and parses the exif data
Name Type Default Description image
Image exif
PhotoEditorSDK.Exif null optional dimensions
PhotoEditorSDK.Math.Vector2 null optional -
setInputTexture(texture)
sdk/core/sdk.js, line 886 -
Set the input texture for this SDK as an alternative to passing in an image
Name Type Description texture
PhotoEditorSDK.Engine.Texture -
setOffset(offset, y)
sdk/core/sdk.js, line 972 -
Sets the rendering offset
Name Type Description offset
PhotoEditorSDK.Math.Vector2 | Number y
Number -
setOperationsStack(operationsStack)
sdk/core/sdk.js, line 934 -
Sets the operations stack
Name Type Description operationsStack
PhotoEditorSDK.OperationsStack -
setRenderMode(renderMode)
sdk/core/sdk.js, line 992 -
Sets the render mode
Name Type Description renderMode
String -
setRotation(rotation)
sdk/core/sdk.js, line 1107 -
Sets the rotation to the given value
Name Type Description rotation
Number -
setSmoothDownscaling(smoothDownscaling)
sdk/core/sdk.js, line 1097 -
Sets the smooth downscaling flag for the output sprite
Name Type Description smoothDownscaling
Boolean -
setSpriteScale(spriteScale)
sdk/core/sdk.js, line 1055 -
Sets the sprite scale to the given value
Name Type Description spriteScale
Number -
setTextureQuality(textureQuality)
sdk/core/sdk.js, line 1030 -
Sets the texture quality
Name Type Description textureQuality
Number -
setZoom(zoom)
sdk/core/sdk.js, line 1008 -
Sets the zoom level
Name Type Description zoom
Number