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