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:
Name | Type | Description |
---|---|---|
strokes | Stroke|Array.<Stroke> | Addition stroke(s) |
Returns:
Encoded data
Type
Uint8Array
composeAbort(pointerIDopt, strokeIDopt) → {Uint8Array}
Encodes InkController abort signal
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pointerID | int | <optional> | 0 | Relation between pointer and abort context |
strokeID | string.<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:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
segment | InkPath2D|InterpolatedSpline | Ink building path part | ||
endStroke | boolean | false | Last segment flag | |
pointerID | int | <optional> | 0 | Relation between pointer and particular style |
strokeID | string.<GUID> | <optional> | Relation between segment and rendering context |
Returns:
Encoded data
Type
Uint8Array
composeStyle(style, pointerIDopt, strokeIDopt) → {Uint8Array}
Encodes InkController configuration
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
style | Serialization.InkOperation.Style | |||
pointerID | int | <optional> | 0 | Relation between pointer and particular style / segment |
strokeID | string.<GUID> | <optional> | Relation between style and rendering context |
Returns:
Encoded data
Type
Uint8Array
decode(user, input) → {any}
InkOperation event trigger
Parameters:
Name | Type | Description |
---|---|---|
user | any | Remote user identity |
input | Uint8Array | Remote user ink operation |
Returns:
output Callback event result
Type
any
(abstract) getStroke(id) → Stroke
Stroke instance provider
Parameters:
Name | Type | Description |
---|---|---|
id | string | Stroke identifier |
Returns:
Stroke instance
Type
(abstract) onAdd(user, strokes)
Remote user strokes for addition
Parameters:
Name | Type | Description |
---|---|---|
user | any | |
strokes | Stroke|Array.<Stroke> |
(abstract) onComposeAbort(user, pointerID, strokeID)
Remote user InkController abort signal
Parameters:
Name | Type | Description |
---|---|---|
user | any | |
pointerID | int | Relation between pointer and abort context |
strokeID | string.<GUID> | Relation between abort context and rendering context |
(abstract) onComposeSegment(user, segment, endStroke, pointerID, strokeID)
Remote user runtime stroke segment
Parameters:
Name | Type | Description |
---|---|---|
user | any | |
segment | InkPath2D|InterpolatedSpline | Ink building path part |
endStroke | boolean | Last segment flag |
pointerID | int | Relation between pointer and particular style |
strokeID | string.<GUID> | Relation between segment and rendering context |
(abstract) onComposeStyle(user, pointerIDopt, strokeID, style)
Remote user rendering configuration
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
user | any | |||
pointerID | int | <optional> | 0 | Relation between pointer and particular style / segment |
strokeID | string.<GUID> | Relation between style and rendering context | ||
style | Serialization.InkOperation.Style |
(abstract) onRemove(user, strokes)
Remote user strokes for removal
Parameters:
Name | Type | Description |
---|---|---|
user | any | |
strokes | Array.<string> | Array.<Stroke> |
(abstract) onReplace(user, replacements)
Remote user replace
Parameters:
Name | Type | Description |
---|---|---|
user | any | |
replacements | JSON.<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:
Name | Type | Description |
---|---|---|
user | any |
(abstract) onSelectSelection(user, strokes)
Remote user selection
Parameters:
Name | Type | Description |
---|---|---|
user | any | |
strokes | Array.<string> | Array.<Stroke> |
(abstract) onSelectSelector(user, selector)
Remote user selector
Parameters:
Name | Type | Description |
---|---|---|
user | any | |
selector | Stroke |
(abstract) onSplit(user, intersections, affectedArea)
Remote user split
Parameters:
Name | Type | Description |
---|---|---|
user | any | |
intersections | JSON.<Manipulation.Intersection> | |
affectedArea | Common.Rect | Affected area |
(abstract) onTransform(user, matrix, strokesopt)
Remote user transformation
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
user | any | ||
matrix | Common.Matrix | Transform matrix | |
strokes | Array.<string> | Array.<Stroke> | <optional> |
(abstract) onUpdate(user, strokes, style, edit)
Remote user strokes for styling
Parameters:
Name | Type | Description |
---|---|---|
user | any | |
strokes | Array.<string> | Array.<Stroke> |
style | Serialization.InkOperation.Style | |
edit | boolean | Describes is update visual or model should be edited |
remove(strokes) → {Uint8Array}
Encodes strokes for removal
Parameters:
Name | Type | Description |
---|---|---|
strokes | Stroke|string|Array.<(Stroke|string)> | Strokes or their ids for removing |
Returns:
Encoded data
Type
Uint8Array
replace(replacements) → {Uint8Array}
Encodes replace operation
Parameters:
Name | Type | Description |
---|---|---|
replacements | JSON.<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:
Name | Type | Description |
---|---|---|
strokes | Stroke|string|Array.<(Stroke|string)> | Selected strokes |
Returns:
Encoded data
Type
Uint8Array
selectSelector(strokes) → {Uint8Array}
Encodes selector stroke
Parameters:
Name | Type | Description |
---|---|---|
strokes | Stroke | Selector stroke |
Returns:
Encoded data
Type
Uint8Array
split(intersections, affectedArea) → {Uint8Array}
Encodes split operation
Parameters:
Name | Type | Description |
---|---|---|
intersections | JSON.<Manipulation.Intersection> | |
affectedArea | Common.Rect | Affected area |
Returns:
Encoded data
Type
Uint8Array
transform(matrix, strokes) → {Uint8Array}
Encodes transform operation
Parameters:
Name | Type | Description |
---|---|---|
matrix | Common.Matrix | Transform matrix |
strokes | Stroke|string|Array.<(Stroke|string)> | Affected strokes |
Returns:
Encoded data
Type
Uint8Array
update(@param, style) → {Uint8Array}
Encodes strokes for update
Parameters:
Name | Type | Description |
---|---|---|
@param | Stroke|string|Array.<(Stroke|string)> | strokes Strokes for styling |
style | Serialization.InkOperation.Style |
Returns:
Encoded data
Type
Uint8Array
Type Definitions
Style
Rendering stroke configuration
Properties:
Name | Type | Description |
---|---|---|
pointerID | int | Style identifier |
color | Common.Color | |
brush | Rendering.Brush | |
randomSeed | int | Particles random seed, required for particle strokes |
blendMode | Rendering.BlendMode | Shorthand for render mode, renderMode property have priority, |
renderMode | URI | Defines custom stroke specifics, encodes BlendMode for generic strokes |