Skip to main content

Class: InkOperation

Serialization.InkOperation()

Provides encode and decode functionality for ink operation

Constructor

new InkOperation()

Extends

Methods

add(strokes) → {Uint8Array}

Encodes newly created stroke

Parameters:
NameTypeDescription
strokesStroke|Array.<Stroke>Addition stroke(s)
Returns:

Encoded data

Type

Uint8Array

composeAbort(pointerIDopt, strokeIDopt) → {Uint8Array}

Encodes InkController abort signal

Parameters:
NameTypeAttributesDefaultDescription
pointerIDint<optional>0Relation between pointer and abort context
strokeIDstring.<GUID><optional>Relation between abort context and rendering context
Returns:

Encoded data

Type

Uint8Array

composeSegment(segment, endStroke, pointerIDopt, strokeIDopt) → {Uint8Array}

Encodes runtime stroke segment

Parameters:
NameTypeAttributesDefaultDescription
segmentInkPath2D|InterpolatedSplineInk building path part
endStrokebooleanfalseLast segment flag
pointerIDint<optional>0Relation between pointer and particular style
strokeIDstring.<GUID><optional>Relation between segment and rendering context
Returns:

Encoded data

Type

Uint8Array

composeStyle(style, pointerIDopt, strokeIDopt) → {Uint8Array}

Encodes InkController configuration

Parameters:
NameTypeAttributesDefaultDescription
styleSerialization.InkOperation.Style
pointerIDint<optional>0Relation between pointer and particular style / segment
strokeIDstring.<GUID><optional>Relation between style and rendering context
Returns:

Encoded data

Type

Uint8Array

decode(user, input) → {any}

InkOperation event trigger

Parameters:
NameTypeDescription
useranyRemote user identity
inputUint8ArrayRemote user ink operation
Returns:

output Callback event result

Type

any

(abstract) getStroke(id) → Stroke

Stroke instance provider

Parameters:
NameTypeDescription
idstringStroke identifier
Returns:

Stroke instance

Type

Stroke

(abstract) onAdd(user, strokes)

Remote user strokes for addition

Parameters:
NameTypeDescription
userany
strokesStroke|Array.<Stroke>

(abstract) onComposeAbort(user, pointerID, strokeID)

Remote user InkController abort signal

Parameters:
NameTypeDescription
userany
pointerIDintRelation between pointer and abort context
strokeIDstring.<GUID>Relation between abort context and rendering context

(abstract) onComposeSegment(user, segment, endStroke, pointerID, strokeID)

Remote user runtime stroke segment

Parameters:
NameTypeDescription
userany
segmentInkPath2D|InterpolatedSplineInk building path part
endStrokebooleanLast segment flag
pointerIDintRelation between pointer and particular style
strokeIDstring.<GUID>Relation between segment and rendering context

(abstract) onComposeStyle(user, pointerIDopt, strokeID, style)

Remote user rendering configuration

Parameters:
NameTypeAttributesDefaultDescription
userany
pointerIDint<optional>0Relation between pointer and particular style / segment
strokeIDstring.<GUID>Relation between style and rendering context
styleSerialization.InkOperation.Style

(abstract) onRemove(user, strokes)

Remote user strokes for removal

Parameters:
NameTypeDescription
userany
strokesArray.<string>Array.<Stroke>

(abstract) onReplace(user, replacements)

Remote user replace

Parameters:
NameTypeDescription
userany
replacementsJSON.<sting:Array.<Stroke>>JSON with pair strokeID as key and strokes as Array

(abstract) onSelectAbort(user)

Remote user selection abort, selection is not formed successfully

Parameters:
NameTypeDescription
userany

(abstract) onSelectSelection(user, strokes)

Remote user selection

Parameters:
NameTypeDescription
userany
strokesArray.<string>Array.<Stroke>

(abstract) onSelectSelector(user, selector)

Remote user selector

Parameters:
NameTypeDescription
userany
selectorStroke

(abstract) onSplit(user, intersections, affectedArea)

Remote user split

Parameters:
NameTypeDescription
userany
intersectionsJSON.<Manipulation.Intersection>
affectedAreaCommon.RectAffected area

(abstract) onTransform(user, matrix, strokesopt)

Remote user transformation

Parameters:
NameTypeAttributesDescription
userany
matrixCommon.MatrixTransform matrix
strokesArray.<string>Array.<Stroke><optional>

(abstract) onUpdate(user, strokes, style, edit)

Remote user strokes for styling

Parameters:
NameTypeDescription
userany
strokesArray.<string>Array.<Stroke>
styleSerialization.InkOperation.Style
editbooleanDescribes is update visual or model should be edited

remove(strokes) → {Uint8Array}

Encodes strokes for removal

Parameters:
NameTypeDescription
strokesStroke|string|Array.<(Stroke|string)>Strokes or their ids for removing
Returns:

Encoded data

Type

Uint8Array

replace(replacements) → {Uint8Array}

Encodes replace operation

Parameters:
NameTypeDescription
replacementsJSON.<sting:Array.<Stroke>>JSON with pair strokeID as key and strokes as Array
Returns:

Encoded data

Type

Uint8Array

selectAbort() → {Uint8Array}

Encodes selection abort, it is usable when selection is not formed

Returns:

Encoded data

Type

Uint8Array

selectSelection(strokes) → {Uint8Array}

Encodes selection operation. When strokes are not available, it results to abort operation

Parameters:
NameTypeDescription
strokesStroke|string|Array.<(Stroke|string)>Selected strokes
Returns:

Encoded data

Type

Uint8Array

selectSelector(strokes) → {Uint8Array}

Encodes selector stroke

Parameters:
NameTypeDescription
strokesStrokeSelector stroke
Returns:

Encoded data

Type

Uint8Array

split(intersections, affectedArea) → {Uint8Array}

Encodes split operation

Parameters:
NameTypeDescription
intersectionsJSON.<Manipulation.Intersection>
affectedAreaCommon.RectAffected area
Returns:

Encoded data

Type

Uint8Array

transform(matrix, strokes) → {Uint8Array}

Encodes transform operation

Parameters:
NameTypeDescription
matrixCommon.MatrixTransform matrix
strokesStroke|string|Array.<(Stroke|string)>Affected strokes
Returns:

Encoded data

Type

Uint8Array

update(@param, style) → {Uint8Array}

Encodes strokes for update

Parameters:
NameTypeDescription
@paramStroke|string|Array.<(Stroke|string)>strokes Strokes for styling
styleSerialization.InkOperation.Style
Returns:

Encoded data

Type

Uint8Array

Type Definitions

Style

Rendering stroke configuration

Properties:
NameTypeDescription
pointerIDintStyle identifier
colorCommon.Color
brushRendering.Brush
randomSeedintParticles random seed, required for particle strokes
blendModeRendering.BlendModeShorthand for render mode, renderMode property have priority,
renderModeURIDefines custom stroke specifics, encodes BlendMode for generic strokes

Home