Skip to main content

Ink Data

The ink model keeps the digital ink content inside the Stroke Repository, which is a data repository, holding a collection of Stroke instances (see Figure 1). brush-spline Figure 1: Ink stroke

The following sections provide further details.

Geometry

The geometry of an ink stroke is represented by its Stroke.

Stroke

A Stroke is defined as a combination of:

  • A Catmull-Rom spline in the form of a sequence of data points (mandatory), including per-point transformational data (optional)
  • Rendering configuration about how the spline should be visualized (optional)
  • Reference to raw input data (SensorData instance), which the path originates from (optional)

Remarks:

Once a Stroke instance is added to the Strokes repository, it is considered immutable. A Stroke instance is serialized according to section 8.2 Protocol Buffers Serialization Scheme using the protobuf message Stroke.

The Catmull-Rom spline is defined in the scope of the Stroke using the following properties:

  • splineTs, splineTf - Spline start and end parameters
  • spline - A sequence of spline data points
  • color - A sequence of color values (per spline data point; if provided, the length of this sequence must be equal to the spline points count)
  • perPointTransform - A sequence of transformation matrices (per spline data point; if provided, the length of this sequence must be equal to the spline points count)

The Stroke may keep information about its origin raw input data-frame. This relationship is encoded using the following properties:

  • sensorData - A reference to a SensorData instance, provided by the SensorData repository
  • sensorDataOffset - A point index within the raw input data-frame, mapped to the first point of the Catmull-Rom spline
  • sensorDataMapping - An array of indices within the raw input data-frame, mapped to each point of the Catmull-Rom spline (if provided, the length of this array must be equal to the spline points count)

The Stroke may also keep additional information about how the spline should be visualized by defining a Style property, which is described in detail in the Rendering section, below.

Rendering

A Stroke instance may hold information about how it should be interpolated and rendered by the platform-specific rendering engine. This additional configuration is defined using the stroke's Style property.

Style

The Style is defined as a combination of a PathPointProperties configuration, reference to a Brush, a random number generator seed value, and rendering method type. Setting the Style property allows overriding of specific stroke point properties, color components, and/or matrix transformational components. A Style with PathPointProperties configuration should be normally used to define constant path components.

Remarks: A Style instance is serialized according to section 8.2 Protocol Buffers Serialization Scheme using the protobuf message Style.

Examples: A Stroke with per point color data and a Style with alpha value will result in a Stroke rendered with constant alpha.

PathPointProperties

A simple data model, which may hold size, color components, and matrix transformational components.

Remarks: A PathPointProperties instance is serialized according to section 8.2 Protocol Buffers Serialization Scheme using the protobuf message PathPointProperties.

The Information about how a Stroke shall be rendered is incorporated in the Style using the rendering method type (renderModeURI) and a reference to a Brush, holding rendering, and rasterization configuration. The ink model keeps all available rendering configurations in the Brush Repository, which is a data repository, holding a collection of Brush instances. The following definitions apply:

Brush

A rendering/rasterization configuration used during the path rendering phase. In terms of class hierarchy, the Brush should be considered an abstract class, which is specialized into the following classes:

  • VectorBrush - A configuration which allows rendering of an interpolated Catmull-Rom spline as a vector spline by applying a specific polygon for each interpolated point, depending on its size and merging result afterwards.
  • RasterBrush - A configuration which allows rendering of an interpolated Catmull-Rom spline as a raster image by applying a specific sprite for each interpolated point, depending on its size.

Remarks:

A VectorBrush instance is serialized according to section 8.2 Protocol Buffers Serialization Scheme using the protobuf message VectorBrush. A RasterBrush instance is serialized according to section 8.2 Protocol Buffers Serialization Scheme using the protobuf message RasterBrush. The Brush repository serializes its underlying collection of brush instances using the protobuf message Brushes in the repeated message fields Brushes.vectorBrushes and Brushes.rasterBrushes.