Skip to main content

Class: InkCodec

Serialization.InkCodec()

Provides encode and decode functionality for ink modle

Constructor

new InkCodec()

Properties:
NameTypeDescription
precisionCalculatorSerialization.PrecisionDetection.PrecisionCalculatorPrecision detector calculator

Methods

decodeBrushes(input) → {Array.<Rendering.Brush>}

Parameters:
NameTypeDescription
inputUint8ArrayPROTO content
Returns:

Decode result

Type

Array.<Rendering.Brush>

decodeInkData(input) → {Array.<Stroke>}

Parameters:
NameTypeDescription
inputUint8ArrayPROTO content
Returns:

Decode result

Type

Array.<Stroke>

(async) decodeInkModel(input, modelopt) → InkModel

Parameters:
NameTypeAttributesDescription
inputUint8ArrayRIFF data
modelInkModel<optional>Target for views and knowledge graphMerge will import views which are not part of source model.Knowledge graphs will be merged through view import.
Returns:

Decode result

Type

InkModel

decodeInputData(input) → {Array.<InkInput.SensorData>}

Parameters:
NameTypeDescription
inputUint8ArrayPROTO content
Returns:

Decode result

Type

Array.<InkInput.SensorData>

decodeJSON(input) → {InkModel.InkModel|decode.<Type>}

Build ink object based on JSON data

Parameters:
NameTypeDescription
inputJSONInk object content
Returns:

InkModel if encoded or decoded result of InkCodec decoding methods

Type

InkModel.InkModel|decode.<Type>

decodeProperties(input) → {object.<string, string>}

Parameters:
NameTypeDescription
inputUint8ArrayPROTO content
Returns:

Decode result

Type

object.<string, string>

decodeTripleStore(input) → Semantics.TripleStore

Parameters:
NameTypeDescription
inputUint8ArrayPROTO content
Returns:

Decode result

Type

Semantics.TripleStore

(async) encodeBrushes(brushes) → {Uint8Array}

Parameters:
NameTypeDescription
brushesArray.<Rendering.Brush>
Returns:

Encoded PROTO content

Type

Uint8Array

encodeInkData(strokes) → {Uint8Array}

Parameters:
NameTypeDescription
strokesArray.<Stroke>
Returns:

Encoded PROTO content

Type

Uint8Array

(async) encodeInkModel(model) → {Uint8Array}

Parameters:
NameTypeDescription
modelInkModel
Returns:

Encoded RIFF content

Type

Uint8Array

encodeInputData(strokes) → {Uint8Array}

Parameters:
NameTypeDescription
strokesArray.<InkInput.SensorData>
Returns:

Encoded PROTO content

Type

Uint8Array

encodeProperties(props) → {Uint8Array}

Parameters:
NameTypeDescription
propsobject.<string, string>
Returns:

Encoded PROTO content

Type

Uint8Array

encodeTripleStore(tripleStore) → {Uint8Array}

Parameters:
NameTypeDescription
tripleStoreSemantics.TripleStore
Returns:

Encoded PROTO content

Type

Uint8Array

(async, static) buildJSON(input, typeopt) → {JSON}

Build javascript plain object, based on binary input

Parameters:
NameTypeAttributesDefaultDescription
inputUint8Array|ArrayBufferRIFF / PROTO content
typestring<optional>InkModelBinary input type. Supported types: InkModel, InputData, InkData, Brushes, Properties, TripleStore, InkTool, InkOperation.
Returns:

Encoded data as plain object

Type

JSON

Home