Class: InkCodec
Serialization.InkCodec()
Provides encode and decode functionality for ink modle
Constructor
new InkCodec()
Properties:
Name | Type | Description |
---|---|---|
precisionCalculator | Serialization.PrecisionDetection.PrecisionCalculator | Precision detector calculator |
Methods
decodeBrushes(input) → {Array.<Rendering.Brush>}
Parameters:
Name | Type | Description |
---|---|---|
input | Uint8Array | PROTO content |
Returns:
Decode result
Type
Array.<Rendering.Brush>
decodeInkData(input) → {Array.<Stroke>}
Parameters:
Name | Type | Description |
---|---|---|
input | Uint8Array | PROTO content |
Returns:
Decode result
Type
Array.<Stroke>
(async) decodeInkModel(input, modelopt) → InkModel
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
input | Uint8Array | RIFF data | |
model | InkModel | <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
decodeInputData(input) → {Array.<InkInput.SensorData>}
Parameters:
Name | Type | Description |
---|---|---|
input | Uint8Array | PROTO content |
Returns:
Decode result
Type
Array.<InkInput.SensorData>
decodeJSON(input) → {InkModel.InkModel|decode.<Type>}
Build ink object based on JSON data
Parameters:
Name | Type | Description |
---|---|---|
input | JSON | Ink object content |
Returns:
InkModel if encoded or decoded result of InkCodec decoding methods
Type
InkModel.InkModel|decode.<Type>
decodeProperties(input) → {object.<string, string>}
Parameters:
Name | Type | Description |
---|---|---|
input | Uint8Array | PROTO content |
Returns:
Decode result
Type
object.<string, string>
decodeTripleStore(input) → Semantics.TripleStore
Parameters:
Name | Type | Description |
---|---|---|
input | Uint8Array | PROTO content |
Returns:
Decode result
Type
(async) encodeBrushes(brushes) → {Uint8Array}
Parameters:
Name | Type | Description |
---|---|---|
brushes | Array.<Rendering.Brush> |
Returns:
Encoded PROTO content
Type
Uint8Array
encodeInkData(strokes) → {Uint8Array}
Parameters:
Name | Type | Description |
---|---|---|
strokes | Array.<Stroke> |
Returns:
Encoded PROTO content
Type
Uint8Array
(async) encodeInkModel(model) → {Uint8Array}
Parameters:
Name | Type | Description |
---|---|---|
model | InkModel |
Returns:
Encoded RIFF content
Type
Uint8Array
encodeInputData(strokes) → {Uint8Array}
Parameters:
Name | Type | Description |
---|---|---|
strokes | Array.<InkInput.SensorData> |
Returns:
Encoded PROTO content
Type
Uint8Array
encodeProperties(props) → {Uint8Array}
Parameters:
Name | Type | Description |
---|---|---|
props | object.<string, string> |
Returns:
Encoded PROTO content
Type
Uint8Array
encodeTripleStore(tripleStore) → {Uint8Array}
Parameters:
Name | Type | Description |
---|---|---|
tripleStore | Semantics.TripleStore |
Returns:
Encoded PROTO content
Type
Uint8Array
(async, static) buildJSON(input, typeopt) → {JSON}
Build javascript plain object, based on binary input
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
input | Uint8Array|ArrayBuffer | RIFF / PROTO content | ||
type | string | <optional> | InkModel | Binary input type. Supported types: InkModel, InputData, InkData, Brushes, Properties, TripleStore, InkTool, InkOperation. |
Returns:
Encoded data as plain object
Type
JSON