
Ink Markup Language (InkML)
W3C Working Draft 23 October 2006
- This version:
- http://www.w3.org/TR/2006/WD-InkML-20061023
- Latest version:
- http://www.w3.org/TR/InkML
- Previous version:
- http://www.w3.org/TR/2004/WD-InkML-20040928
- Editors:
- Yi-Min Chee, IBM
Max Froumentin, W3C
Stephen M. Watt, University of Western Ontario
- Authors:
- Yi-Min Chee, IBM
Katrin Franke, Fraunhofer Gesellschaft
Max Froumentin, W3C
Sriganesh Madhvanath, HP
Jose-Antonio Magaña, HP
Gregory Russell, IBM
Giovanni Seni, Motorola
Christopher Tremblay, Corel
Stephen M. Watt, University of Western Ontario
Larry Yaeger, Apple
Copyright ©2006 W3C®
(MIT, ERCIM,
Keio), All Rights
Reserved. W3C liability, trademark and document use rules apply.
Abstract
This document describes the syntax and semantics for the Ink
Markup Language for use in the W3C Multimodal
Interaction Framework as proposed by the W3C Multimodal
Interaction Activity. The Ink Markup Language serves as the
data format for representing ink entered with an electronic pen or
stylus. The markup allows for the input and processing of
handwriting, gestures, sketches, music and other notational
languages in Web-based (and non
Web-based) applications. It provides a common format for the
exchange of ink data between components such as handwriting and
gesture recognizers, signature verifiers, and other ink-aware
modules.
Status of this document
This section describes the status of this document at the time of
its publication. Other documents may supersede this document. A list of
current W3C publications and the latest revision of this technical report
can be found in the W3C technical reports
index at http://www.w3.org/TR/.
Publication as a Working Draft does not imply endorsement by the W3C
Membership. This is a draft document and may be updated, replaced or
obsoleted by other documents at any time. It is inappropriate to cite
this document as other than work in progress.
The (archived)
public mailing list www-multimodal@w3.org (see instructions) is preferred for
discussion of this specification. When sending e-mail, please put the
text "[ink]" in the subject, preferably like this: "[ink] …summary
of comment…"
This document was produced by the Multimodal
Interaction Working Group (W3C Members Only), which is part
of the Multimodal Interaction Activity.
This document was produced by a group operating under the 5 February
2004 W3C Patent Policy. W3C maintains a public list of any patent
disclosures made in connection with the deliverables of the group;
that page also includes instructions for disclosing a patent. An
individual who has actual knowledge of a patent which the individual
believes contains Essential
Claim(s) must disclose the information in accordance with section 6 of
the W3C Patent Policy.
This document contains the InkML
W3C Last Call Working
Draft of 23 October 2006. The Last Call period ends on 18
December 2006.
This fourth version of the Working Draft includes a few
conceptual changes to simplify the definition while achieving
greater expressive power. It also contains many small changes of
details to make element and attribute use uniform accross the the
definition to make it easier to learn and simpler to process.
The main changes are:
- InkML now more robustly supports program transformations. The
text has been revised to remove any requirement for a particular
element order in archival ink. This allows applications to regroup
and organize traces into logical structures without losing
information.
- InkML now more robustly supports streaming. The content model
of the top-level ink element has been relaxed to allow
interspersion of more definitional elements. The definition of
continuation traces has been simplified.
- InkML now better supports optical devices and other
technologies. The language has been revised to be technology
neutral, where possible, and to keep technology-specific concepts
localized to specific elements.
- There is greater support for applications to use InkML as a
representation for their own application-defined structures. Trace
groups and trace references can be nested, allowing applications to
group ink into logical units, if desired. This may be done to the
explicit ink traces or by reference.
- The support for annotation has been enhanced to allow arbitrary
textual or XML-based annotation. This provides sufficient hooks for
rich semantic annotation of ink while keeping the standard simple.
The model is based on experience with MathML.
- The concepts of trace formats and capture devices have been
more clearly distinguished. Trace formats can be used to describe
all the logical properties of an ideal channel. They are used to
describe traces and the coordinates of shared canvases.
Consequently, the channel element has a richer set of attributes.
Capture devices are now seen as "ink sources" which may
additionally describe other characteristics of the ink source, such
as accuracy, latency, channel cross-coupling, etc.
- The notions of canvas transformations and channel mappings have
been converged into a single mapping type. As a consequence,
applications may agree on more general coordinate systems for
shared canvases. (For example, they may share tip force
information.)
Several changes of detail have been made to support the above,
to make the naming and use of elements and attributes consistent,
and to remove duplication.
For the full list of changes, see the appendix Changes from Previous Working
Draft.
1 Overview
As more electronic devices with pen interfaces have and continue
to become available for entering and manipulating information,
applications need to be more effective at usingleveraging
this method of input. Handwriting is an a powerful and
versatile input modality that is very familiar for most
users since everyone learns to write in school. Hence, users will
tend to use this as a mode of input and control when available.
A pen-based interface is enabled by a transducer device and a pen that
allowdevice that allows
movements of the pen to be captured as digital ink. A number of methods may be used for ink capture,
including those based on radio frequency, optical tracking,
physical pressure, or other technologies. Digital ink can be
passed on to recognition software that will convert the pen input
into appropriate computer actions. Alternatively, the handwritten
input can be organized into ink documents, notes or messages that
can be stored for later retrieval or exchanged through
telecommunications means. Such ink documents are appealing because
they capture information as the user composed it, including text in
any mix of languages and drawings such as equations and graphs.
Hardware and software vendors have typically stored and
represented digital ink using proprietary or restrictive formats.
The lack of a public and comprehensive digital ink format has
severely limited the capture, transmission, processing, and
presentation of digital ink across heterogeneous devices developed
by multiple vendors. In response to this need, the Ink Markup
Language (InkML) provides a simple and platform-neutral data format
to promote the interchange of digital ink between software
applications.
InkML supports a complete and accurate representation of digital
ink. For instance, inIn addition to the pen position over time, InkML
allows recording of information about transducer device characteristics and detailed
dynamic behavior to support applications such as handwriting
recognition and authentication. For example, there is support
to record additional information such as pen tilt and pen tip force (often referred to
as pressure in manufacturers'
documentation "pressure")
and information about the recording device
such as accuracy and dynamic distortion. InkML also provides features to support rendering of
digital ink captured optically to approximate the original
appearance. For example, stroke width and color information can be
recorded.
InkML provides means for extension. By virtue of being an
XML-based language, users may easily add application-specific
information to ink files to suit the needs of the application at
hand.
1.1 Uses of InkML
With the establishment of a non-proprietary ink standard, a
number of applications, old and new, are expanded where the pen can
be used as a very convenient and natural form of input. Here are a
few examples.
- Ink Messaging
Two-way transmission of digital ink, possibly wireless, offers
mobile-device users a compelling new way to communicate. Users can
draw or write with a pen on the device's screen to compose a note
in their own handwriting. Such an ink note can then be addressed
and delivered to other mobile users, desktop users, or fax
machines. The recipient views the message as the sender composed
it, including text in any mix of languages and drawings.
- Ink and SMIL
A photo taken with a digital camera can be annotated with a pen;
the digital ink can be coordinated with a spoken commentary. The
ink annotation could be used for indexing the photo (for example,
one could assign different handwritten glyphs to different
categories of pictures).
- Ink Archiving and Retrieval
A software application may allow users to archive handwritten
notes and retrieve them using either the time of creation of the
handwritten notes or the tags associated with keywords. The tags
are typically text strings created using a handwriting recognition
system.
- Electronic Form-Filling
In support of natural and robust data entry for electronic forms
on a wide spectrum of keyboardless devices, a handwriting
recognition engine developer may define an API that takes InkML as
input.
- Pen Input and Multimodal Systems
Robust and flexible user interfaces can be created that
integrate the pen with other input modalities such as speech.
Higher robustness is achievable because cross-modal redundancy can
be used to compensate for imperfect recognition on each individual
mode. Higher flexibility is possible because users can choose the
most appropriate from among various modes for achieving a task or
issuing commands. This choice might be based on user preferences,
suitability for the task, or external conditions. For instance,
when noise in the environment or privacy is a concern, the pen
modality is preferred over voice.
1.2 Elements
The current InkML specification defines a set of primitive
elements sufficient for all basic ink applications. Few semantics are attached to these elements. All
content of an InkML document is contained within a single
<ink> element. The fundamental data element in
an InkML file is the <trace>. A trace represents
a sequence of contiguous ink points, where
each point captures the values of particular quantities such
as -- e.g., the X and Y
coordinates of the pen's position. A sequence of traces accumulates
to meaningful units, such as characters,
words or diagrams. The <traceFormat> element is used to
define the format of data within a trace.
In its simplest form, an InkML file with its enclosed traces
looks like this:
<ink>
<trace>
10 0, 9 14, 8 28, 7 42, 6 56, 6 70, 8 84, 8 98, 8 112, 9 126, 10 140,
13 154, 14 168, 17 182, 18 188, 23 174, 30 160, 38 147, 49 135,
58 124, 72 121, 77 135, 80 149, 82 163, 84 177, 87 191, 93 205
</trace>
<trace>
130 155, 144 159, 158 160, 170 154, 179 143, 179 129, 166 125,
152 128, 140 136, 131 149, 126 163, 124 177, 128 190, 137 200,
150 208, 163 210, 178 208, 192 201, 205 192, 214 180
</trace>
<trace>
227 50, 226 64, 225 78, 227 92, 228 106, 228 120, 229 134,
230 148, 234 162, 235 176, 238 190, 241 204
</trace>
<trace>
282 45, 281 59, 284 73, 285 87, 287 101, 288 115, 290 129,
291 143, 294 157, 294 171, 294 185, 296 199, 300 213
</trace>
<trace>
366 130, 359 143, 354 157, 349 171, 352 185, 359 197,
371 204, 385 205, 398 202, 408 191, 413 177, 413 163,
405 150, 392 143, 378 141, 365 150
</trace>
</ink>
These traces consist simply of X and Y
value pairs, and may look like this when rendered:
Figure 1 shows a trace of a sampled handwriting
signalrepresenting. The dots mark the
sampling positions which were interpolated by the blue line. Green
points represent pen-downs whereas red dots indicate pen-ups.
More generally, traces consist of sequences of points. Each
point consists of a number of coordinate values whose meanings are
given by a <traceFormat> element. These
coordinates may provide values for such quantities as pen position,
angle, tip force, button states and so on.
Information about the transducer
device used to collect the ink (e.g., the sampling rate and
resolution) ismay be specified with the <inkSourcecaptureDevice> element.
The Multimodal Interaction Working Group is currently working
with the Device Independence Working Group to make sure that
transducer characteristics are also represented as a CC/PP profile
that can be included inside an InkML document by reference. See
[CC/PP].
Ink traces can have certain attributes such as color and width, writer identification, pen modes
(eraser vs writing), and so on. These and other attributes
are captured using the <brush> element. Traces
that share the same characteristics, such as being written with the
same brush, can be grouped together with the
<traceGroup> element.
Ink traces may also be organized into collections for
application-specific purposes either by grouping the traces objects
themselves, using the <traceGroup> element, or
by reference, using the <traceView> element.
Certain applications, such as collaborative whiteboards (where
ink coming from different devices is drawn on a common canvas) or
document review (where ink annotation from various sources is
combined), will require ink sharing. The
<context> element allows representation and
grouping of the pertinent information, such as the trace format,
brush, and canvas. Canvas transformations allow ink from different
devices to combined and manipulated by multiple parties.
InkML supports the semantic labelling of traces with attributes
on traces or collections of traces. These may be given with either
<annotation>, for text, or
<annotationXML>, for XML, using
application-defined encodings.
In all appropriate cases, the InkML specification defines
default values for elements that are not specified, and rules that
establish the scope of a given attribute.
Application-specific elements are expected to be defined to
provide a higher-level description of the digital ink captured in
the primitive elements. Some application-specific elements would
reference the primitive elements. For example, a page tag may be
useful in a document management application to indicate groups of
traces belonging to a particular page. In a form processing
application, a field tag might indicate a group of traces belonging
to a particular field. Another example of an application-specific
element is <writerInfo> which could be used to
record information about the age and handedness of the writer.
Finally, the InkML specification is limited in scope: It is currently oriented to fixed
Cartesian coordinate systems, it does not support sophisticated
compression of trace data, and it does not support non-ink events
(although the later could be handled via annotations).
1.3 Exchange Modes
Most ink-related applications fall into two broad categories:
"Streaming" and "Archival". Archival
ink applications capture and store digital ink for later
processing, such as document storage/retrieval applications and
remote on-linebatch forms processing (e.g., where forms are filled on electronic tablet
computers and processed remotely). In these applications,
all primitive elements are
an entire <ink> element
is written prior to processing. For ease of implementation, it is recommended that, in
archival mode, referenced elements be defined inside of a declaration block using the
<definitions>
element.
Streaming ink applications, on the other hand, transmit digital ink as it is captured, such as
in the electronic whiteboard example mentioned above. In order to
support a streaming style of ink markup generation, the InkML
language supports the notion of a "current" state (e.g., the
current brush) and allows for incremental changes to this
state.
1.4 Conventions used in this document
This document uses the following conventions:
- Syntax of element contents
- The syntax of the contents of InkML elements is expressed in
Backus-Naur Form, using the notation defined in the Trace section. Non-literal
symbols represent InkML markup and are linked to the relevant
section in this document. For example:
- Syntax of attribute contents
- In this specification attributes definitions are formatted as:
timeRef = xsd:IDREF
| "*" default = xsd:decimal |
xsd:boolean
The lefthand side of the '=' sign is
the name of the attribute and the right handside describes the
syntax of the attribute's contents, using the same Backus-Naur Form
notation as used for element definitions. In addition, a
non-literal symbol will represent a data type name. By convention,
this specification uses the prefix 'xsd:' to indicate that the
following name is that of a datatype formally defined in the XML
Schema Part 2: Datatypes Recommendation [XMLSCHEMA2]. The 'xsd' prefix
is used only as a notation in this specification, and does not
mandate any prefix when using XML Schema names in InkML.
2 Structure
InkML documents are well-formed XML documents which comply to
the syntax rules of this specification.
The namespace URI of InkML is
http://www.w3.org/2003/InkML
The media type of InkML document is
application/inkml+xml. See the Media Type definition for
details. This media type is expected to be registered with
IETFsoon.
2.1 <ink> element
The ink element is the root element of any InkML
instance. When combining InkML and other XML elements within
applications, elements from different namespaces must be
disambiguated by use of the namespace qualifier. The allowed sub-elements of the ink element
can occur any number of times, in any order.
Attributes:
documentID = xsd:anyURI
A URI that uniquely identifies this document. No two documents
with a distinct application intent may have the same
documentID contents. The value of this property is an
opaque URI whose interpretation is not defined in this
specification.
Required: no, Default: none
Contents:
Example:
<ink xmlns="http://www.w3.org/2003/InkML"
documentID="uuid:6B29FC40-CA47-1067-B31D-00DD010662DA"/>
...
</ink>
3 Traces and Trace Formatting
Traces are the basic element used to record the trajectory of
the pen as thea pen as a user writes digital ink. More
specifically, these recordings describe sequences of connected
points. On most devices, these sequences of points will be bounded
by pen contact change events (pen-up and pen-down), although some
devices may simply record proximity and force data without
providing an interpretation of pen-up or pen-down state.
The simplest form of encoding specifies the X and Y coordinates
of each sample point. For compactness, it may be desirable to
specify absolute coordinates only for the first point in the trace
and use delta-x and delta-y values to encode subsequent points.
Some devices record acceleration rather than absolute or relative
position; some provide additional data that may be encoded in the
trace, including Z coordinates or tip force, or the state of side
switches or buttons.
These variations in the information available from different
ink sourcecapture devices, or needed by different
applications, are supported in InkML through the
<traceFormat> and <trace>
elements. The <traceFormat> element specifies
the encoding format for each sample of a recorded trace, while
<trace> elements are used to represent the
actual trace data. If no <traceFormat> is
specified, a default encoding format of X and Y coordinates is
assumed.
Traces generated by different devices, or used in differing
applications, may contain different types of information. InkML
defines channels to describe the data that may be encoded
in a trace.
A channel can be characterized as either regular,
meaning that its value is recorded for every sample point of the
trace, or intermittent, meaning that its value may change
infrequently and thus will not necessarily be recorded for every
sample point. X and Y coordinates are examples of likely regular
channels, while the state of a pen button is likely to be an
intermittent channel.
xml:id =
xsd:ID
The unique identifier for this trace
format.
Required: no, Default: none
Contents:
The <traceFormat> element describes the
format used to encode points within <trace>
elements. In particular, it defines the sequence of channel values
that occurs within <trace> elements. The order
of declaration of channels in the <traceFormat>
element determines the order of appearance of their values within
<trace> elements.
Regular channels appear first in the <trace>,
followed by any intermittent channels. Correspondingly, the
<traceFormat> element contains an ordered sequence of <channel>s,
giving the regular channels (if any), followed by an
optional
<intermittentChannels> section. If no channels of a specific type exist, the
corresponding parts may be omitted. The order of the coordinates in each point of a trace is
determined by the order of the <channel>
elements in the trace format, including those from the intermittent
channels part.
3.1.2
<intermittentChannels> element
none
The <intermittentChannels> lists those
channels whose value may optionally be recorded for each sample
point. As with the
<regularChannels> element, t The order of the enclosed channel declarations
gives the order of the intermittent channel data samples within
traces having this format.
3.1.3 <channel> element
xml:id = xsd:ID
The unique identifier for this
element.
Required: no, Default: none
name =
xsd:IDxsd:string
The name of this channel.
Required: yes
type = "integer" | "decimal" | "boolean"
The data type of the point values for this
channel.
Required: no, Default: "decimal"
default = xsd:decimal | xsd:boolean
The default value of
the point data for this channel. This only applies to intermittent
channels.
Required: no, Default: 0 (for integer or decimal
channel), falseF (for boolean channel)
min = xsd:number
The lower boundary for the values of this
channel.
Required: no, Default: none
max = xsd:number
The upper boundary for the values of this
channel.
Required: no, Default: none
orientation = "+ve" | "-ve"
The orientation of increasing channel values
with respect to the default direction of the channel's coordinate
axis, where applicable.
Required: no, Default: "+ve"
respectTo = xsd:anyURI
Specifies that the values are relative to
another reference point.
Required: no, Default: none
units = xsd:string
The units in which the values of the channel
are xpressed (numerical channels only).
Required: no, Default: none
Within a
<regularChannels> or
<intermittentChannels> element,
cChannels are described using
the <channel> element, with name, type, and default
various attributes.
The required name attribute specifies the interpretation
of the channel in the trace data. The following channel names, with
their specified meanings, are reserved:
| channel name |
dimension |
interpretation |
| X |
length |
X coordinate.
This is the horizontal pen position on the writing surface,
increasing to the right for +ve orientation. |
| Y |
length |
Y coordinate.
This is the vertical position on the writing surface, increasing
downward for +ve orientation. |
| Z |
length |
Z coordinate.
This is the height of pen above the writing suface, increasing
upward for +ve orientation. |
| F |
force |
pen tip force |
| S |
|
tip switch state (touching/not touching
the digitizerwriting surface) |
| B1...Bn |
|
side button states |
| OTx |
angle |
tilt along the x-axis |
| OTy |
angle |
tilt along the y-axis |
| OA |
angle |
azimuth angle of the pen (yaw) |
| OE |
angle |
elevation angle of the pen (pitch) |
| OR |
angle |
rotation (rotation about pen axis
- i.e., like the roll axis of an
airplane) |
| C |
|
color value
(device-specific encoding) |
| CR,CG,CB |
|
color values
(Red/Green/Blue) |
| CC,CM,CY,CK |
|
color values
(Cyan/Magenta/Yellow/Black) |
| W |
length |
stroke width
(orthogonal to stroke) |
| T |
time |
time (of the sample point) |
The type attribute defines the encoding type for the
channel (either boolean, decimal, or integer). If type is
not specified, it defaults to decimal.
A default value can be specified for the channel using the
default attribute; the use of default values within a trace
is described in the next section. If no default is
specified, it is assumed to be zero for integer and decimal-valued
channels, and false for boolean channels.
The min and max attributes, if given, specify the
minimum and maximum possible values for a channel of type integer
or decimal. If neither is given, then there is no a prior bound on
the channel values. If one is given, then the channel values are
bounded above or below but unbounded in the other direction. If
both are given, then all channel values must fall within the
specified range.
The orientation attribute is applicable to channels of
integer or decimal type. It gives the meaning of increasing value.
For example, whether X increases to the left or the right. The
value may be given as "+ve" or "-ve", with "+ve" being the
default.
The respectTo attribute specifies the origin for channels
of integer or decimal type. For time channels, this is given as a
URI for a <timestamp> element. For other
dimensions the meaning is application-dependent.
Typically, a channel in the <traceFormat>
will map directly to a corresponding channel provided by the
digitizing device, and its values as recorded in the trace data
will be the original channel values recorded by the device.
However, for some applications, it may be useful to store
normalized channel values instead, or even to remap the channels
provided by the digitizing device to different channels in the
trace data. This correspondence between the trace data and the
device channels is recorded using a <mapping>
element (described in the Mappings section) within the
<channel> element. If no
mapping is specified for a channel, it is assumed to be
unknown.
The <mapping> element can specify the
identity mapping, or a formula expressed in MathML, or a lookup
table. For a detailed description of the types of mappings
supported by the <mapping> element and its
usage, see the Mappings
section.
If no mapping is specified for a channel, it is assumed to be
unknown.
3.1.4 Orientation Channels
The channels OTx, OTy, OA,
OE and OR are defined for recording of pen orientation
data. Implementers may choose to use either pen azimuth
OA and pen elevation OE, or alternatively tilt angles OTx and OTy. The
latter are the angles of projections of the pen axis onto the XZ
and YZ planes, measured from the vertical. It is often useful to
record the sine of this angle, rather than the angle itself, as
this is usually more useful in calculations involving angles. The
<mapping> element described in the Mappings section can be employed to specify an
applied sine transformation.
The third degree of freedom in orientation is generally defined
as the rotation of the pen about its axis. This is potentially
useful (in combination with tilt) in application such as
illustration or calligraphy, and signature verification.
Figure 2a displays the pen orientation using Azimuth and
Elevation. The origin of the Azimuth is at the Y-axis. Azimuth
increases anticlockwise up to 360 degrees. The origin of Elevation
is located within the XY-plane. Elevation increases up to 90
degrees, at which point the pen is perpendicular to the
XY-plane.
Figure 2b explains the definition of the Tilt-X and the Tilt-Y
angles. For both the origin is along the Z-axis. Tilt-X increases
up to +90 degrees for inclinations along the positive X-axis and
decreases up to -90 degrees for inclinations along the negative
X-axis. Respectively, Tilt-Y is defined for pen inclinations along
the Y-axis.
Figure 3a displays the pen orientation decomposition as
functions of Azimuth/Elevation or alternatively as function of
Tilt-X/Tilt-Y. Thereby, Elevations of the pen which are mapped to
the XZ- and to the YZ- plane lead to Tilt-X and Tilt-Y.
Figure 3b shows the Rotation of the pen along its longitudinal
axis.
3.1.5 Color Channels
The channels CR, CG, CB, CC, CM, CY, CK and C are defined to
record color data as captured by an optical device, software
settings or other means.
The channels CR, CG, CB provide an additive color model for the
colors red, green and blue. The channels CC, CY, CM, CK provide a
subtractive color model for the colors cyan, magenta, yellow and
black. The channel C provides a mechanism to give color as a single
numerical value, e.g. as a gray scale or a device-dependent
hex-encoded number.
Color channels are intended for use when these values are part
of the data itself and hence potentially changing from one sample
to the next. Strokes with constant color may more economically be
described with reference to a <brush>
element.
3.1.6 Width
Channel
The channel W is provided for recording stroke width. This
allows optical devices to record measured stroke width and allows
applications that generate InkML to specify desired width for
rendering. The value is in length units, measured orthogonally to
the stroke direction.
As with the color channels, the width channel is intended for
use when this quantity is part of the data itself and hence
potentially changing from one sample to the next. Strokes with
constant width may more economically be described with reference to
a <brush> element.
3.1.7 Time Channel
The time channel allows for detailed recording of the timing
information for each sample point within a trace. This can be
useful if the digitizing device has a non-uniform sampling rate,
for example, or in cases where duplicate point data is removed for
the sake of compactness.
The time channel can be specified as either a regular or
intermittent channel. When specified as a regular channel, the
single quote prefix can be used to record incremental time between
successive points. Otherwise, the value of the time channel for a
given sample point is defined to be the timestamp of that point in
the units and frame of reference specified by its corresponding
<inkSourcecaptureDevice> description (more
precisely, by the <traceFormat><channelDef> element for
the channel).
As with the other predefined channels, the meaning of the
integer or decimal values recorded by the time channel in a given
trace is defined by the <inkSourcecaptureDevice> information associated
with the trace's traceFormat. In the case of the time channel, its
<channelDef><channel> element contains both a
units and relativeTorespectTo attribute.
The units attribute gives the units of the recorded time
values, and the relativeTo attribute describes the frame of
reference for those recorded values. The value of the
relativeTo attribute is a reference
to a time stamp. If it is not given, the time channel values
are relative to the beginning timestamps of the individual traces
in which they appear.
The following example defines a time channel whose values for a
given point are the relative to the timestamp refered to to by
#ts1:
<channel name="T"
type="integer"
units="ms"
respectTo="#ts1"/>
If no <inkSourcecaptureDevice> information is provided,
or if no value is specified for the respectTo attribute, the ink processor
cannot make any assumption about the relative timing of points
within different traces. Likewise, if no units are specified, no
assumption can be made about the units of the time channel
data.
3.1.8 User Defined Channels
In addition, user-defined channels are allowed, although their
interpretation is not required by conforming ink markup
processors.
When specifying a number of related channels, it is recommended
to use a common prefix. For example, direction-sensitive stylus
force could be named FX, FY, FZ.
3.1.9 Specifying Trace Formats
The following example defines a
<traceFormat> which reports decimal-valued X and
Y coordinates for each point, and intermittent boolean values for
the states of two buttons B1 and B2, which have default values of
F ("false"):
<traceFormat xml:id="xyb1b2">
<regularChannels>
<channel name="X" type="decimal">
<mapping type="identity"/>
</channel>
<channel name="Y" type="decimal">
<mapping type="identity"/>
</channel>
</regularChannels>
<intermittentChannels>
<channel name="B1" type="boolean" default="F">
<mapping type="identity"/>
</channel>
<channel name="B2" type="boolean" default="F">
<mapping type="identity"/>
</channel>
</intermittentChannels>
</traceFormat>
The appearance of a
<traceFormat> element in an ink markup file both
defines the format and installs it as the current format for
subsequent traces (except within a <definitions> block). The id
attribute of a <traceFormat> allows the format
to be reused by multiple contexts (see the Context section). If no
<traceFormat> is specified, the following
default format is assumed for all
traces:
<traceFormat xml:id="DefaultTraceFormat">
<regularChannels>
<channel name="X" type="decimal"/>
<channel name="Y" type="decimal"/>
</regularChannels>
</traceFormat>
Thus, in the simplest case, an InkML file may contain nothing
but <trace> elements.
3.2 Traces
3.2.1 <trace> element
xml:id =
xsd:ID
The identifier for this trace.
Required: no, Default: none
type = "penDown" | "penUp" | "indeterminate"
| "continuation"
The type of this trace.
Required: no, Default: "penDownindeterminate"
continuation = "begin" | "end" |
"middle"
This attribute indicates whether this trace is
a continuation trace, and if it is the case, where this trace is
located in the set of continuation traces
Required: no, Default: none
priorRef = xsd:anyURI
The URI of the trace this one is a
continuation of.
Required:if and only if continuation has
values end or middle, Default:
none
contextRef = xsd:
IDREFanyURI
The context for this trace.
Required: no, Default: none
brushRef = xsd:
IDREFanyURI
The brush for this trace.
Required: no, Default: Inherited from context.
timeRef = xsd:anyURI | "*"
The element providing the reference timestamp
for the start time of this trace.
Required: no, Default: Inherited from
context.
start = xsd:integer
The absolute timestamp for the start of this
trace, in milliseconds since 1 January 1970 00:00:00 UTC.
Required: no, Default: "unknown"
duration =
xsd:integerxsd:decimal
The duration of this trace, in
milliseconds.
Required: no, Default: unknown
timeOffset =
xsd:integerxsd:decimal
The relative timestamp or time-of-day for the
start of this trace, in milliseconds.
Required: no, Default: unknown
The following grammar defines the syntax of the data that
appears within a <trace> element. It is
described in Backus-Naur Form (BNF) using the following
notation:
- *: 0 or more
- +: 1 or more
- ?: 0 or 1
- (): grouping
- |: separates alternatives
- double quotes surround literals
- #x precedes hex character codes
The grammar is as follows:
trace ::=
point ("," point)* ","?
point ::=
value+
value ::=
qualifier? "-"? decimal | hex | "T" | "F" | "*" | "?"
decimal ::=
digit+ ("." digit*)? | "." digit+
hex ::=
"#" (digit | "A" | "B" | "C" | "D" | "E" | "F")+
qualifier ::=
"!" | "'" | """
digit ::=
"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
wsp ::=
#x20 | #x9 | #xD | #xA
Additionally,
wsp may occur anywhere except within
a
decimal or
hex and
must occur if
required to separate two
valuess. Otherwise the longest
token is matched. For example, "3245" requires an internal
wsp character if it is to be interpreted as two decimal
numbers, "32" and "45". On the other hand, "0.923.45" will be
interpreted as "0.923" and ".45".
The number of value tokens appearing within each point
must be at least equal to the number of regular channels and be no
more than the number of regular channels plus the number of
intermittent channels.
The <trace> element is used to record the
data captured by the digitizer. It contains a sequence of points
encoded according to the specification given by the
<traceFormat> element.
The type attribute of a <trace>
indicates the pen contact state (either "penUp" or
"penDown") during its recording. A value of
"indeterminate" is used if the contact-state is
neither pen-up nor pen-down, and may be either unknown or variable
within the trace. For example, a signature may be captured as a
single indeterminate trace containing both the actual writing and
the trajectory of the pen between strokes. A
value of "continuation" means both that the pen
contact state is retained from the previous trace element and that
the points of the current trace element are a temporally contiguous
continuation of (and thus should be connected to) the previous
trace. This allows a trace to be spread across several elements for
purposes such as streaming.
If a continuation attribute is present, it
indicates that the current trace is a continuation trace, i.e. its
points are a temporally contiguous continuation of (and thus should
be connected to) another trace element. The possible values of the
attribute are:
begin: the current trace is the first of the set
of continuation traces
end: the current trace is the last of the set of
continuation traces
middle: the current trace is a continuation trace,
but is neither the first nor the last in the set of traces
If the current trace is a continuation trace but is not the
first trace in the set (i.e. the continuation
attribute has value middle or end) then a
priorRef attribute must be present and must contain
the URI of the trace of which the current trace is a
continuation.
Regular channels may be reported as explicit values,
differences, or second differences: Prefix symbols are used to
indicate the interpretation of a value: a preceding exclamation
point (!) indicates an explicit value, a
single quote (') indicates a single
difference, and a double quote prefix (")
indicates a second difference. If there is no prefix, then the
channel value is interpreted as explicit, difference, or second
difference based on the last prefix for the channel. If there is no
last prefix, the value is interpreted as explicit.
A second difference encoding must be preceded by a single
difference representation; which, in turn, must be preceded with an
explicit encoding.
NOTE: All traces must begin with
an explicit value, not with a first or second difference. This is
true of continuation traces as well. This allows the location and
velocity state information to be discarded at the end of each
trace, simplifying parser design.
Intermittent channels are always encoded explicitly,
and prefixesi.e. the qualifiers ' and " are not
allowed.
Both regular and intermittent channels may be encoded with the
wildcard character "*". This wildcard
character means either that the value of the channel remains at the
previous channel value (if explicit), or that the channel continues
integrating with the previous
velocity andor acceleration values, as
appropriate.
Intermittent channels may be encoded with the wildcard character
"?". This means that a value of a channel is not given at that
point. It is useful when there are several independent intermittent
channels, and they do not always report simultaneously, e.g.
<trace> 11 12 9, 21 22 ? T, 31 32, 41 42 5, 51 52 ? F</trace>
Booleans are encoded as "T" or "F".
For each point in the trace, regular channel values are reported
first in the order given by the <traceFormat>.
If any intermittent values are reported for
the point, they are given next, in the order they are specified in
the <traceFormat>. Unreported intermittent
channels are interpreted as though they were given by the wildcard
"*". If any intermittent values are
reported for the point, the set of intermittent values is preceded
by a colon and ended with a semicolon. Within these delimiters, the
intermittent channels are represented in the order given by the
<traceFormat>. The list may be terminated early
with the semicolon, and the unreported intermittent channels are
interpreted with wildcards.
Here is an example of a trace of 11 points, using
the following traceFormat:
<traceFormat>
<regularChannels>
<channel name="X" type="decimal"/>
<channel name="Y" type="decimal"/>
</regularChannels>
<intermittentChannels>
<channel name="B1" type="boolean" default="F"/>
<channel name="B2" type="boolean" default="F"/>
</intermittentChannels>
</traceFormat>
<trace id = "id4525abc">
1125 18432,'23'43,"7"-8,3-5,7 -3,6 2,6 8,3 6 T,2 4*T,3 6,3-6 F F
</trace>
The trace is interpreted as follows:
| Trace |
X |
Y |
vx |
vy |
B1 |
B2 |
Comments |
| 1125 18432 |
1125 |
18432 |
? |
? |
F |
F |
button default values |
| '23'43 |
1148 |
18475 |
23 |
43 |
F |
F |
velocity values |
| "7"-8 |
1178 |
18510 |
30 |
35 |
F |
F |
acceleration Values |
| 3-5 |
1211 |
18540 |
33 |
30 |
F |
F |
implicit acceleration
no whitespace needed |
| 7 -3 |
1251 |
18567 |
40 |
27 |
F |
F |
optional whitespace |
| 6 2 |
1297 |
18596 |
46 |
29 |
F |
F |
whitespace
required |
| 6 8 |
1349 |
18633 |
52 |
37 |
F |
F |
|
| 3
6 T |
1404 |
18676 |
55 |
43 |
T |
F |
an optional value |
| 2
4*T |
1461 |
18723 |
57 |
47 |
T |
T |
wildcard |
| 3 6 |
1521 |
18776 |
60 |
53 |
T |
T |
optional keep last |
| 3-6 F F |
1584 |
18823 |
63 |
47 |
F |
F |
optionals |
An ink markup generator might also include additional whitespace
formatting for clarity. The following trace specification is
identical in meaning to the more compact version shown above:
<trace id = "id4525abc">
1125 18432,
'23 '43,
"7 "-8,
3 -5,
7 -3,
6 2,
6 8,
3 6 T,
2 4 * T,
3 6,
3 -6 F F
</trace>
Note: the trace syntax defined here makes the InkML file sizes
(as well as the XML DOM trees) smaller while keeping the benefits
of XML. However some applications, for instance those concerned with transmitting InkML documents
across the Web, might require even smaller file sizes. It is thus
recommended (but not required) that InkML implementations support
the gzip standard compression scheme (see [RFC1952]).
Open Issue
There is currently some discussion about whether to make
continuation a separate attribute, rather than a type. This
would allow specification of whether a continuation trace was
pen-up, pen-down, or indeterminate in addition to the fact that it
is a continuation.
Open Issues
The working group has been inquiring into the compression ratios
achieved with the alternative trace formats, alone and in
combination with gzip. In combination with gzip, the best results
achieve approximately 9 bits per sample, for two channel data,
which is only about 50% worse than compression with binary
compression algorithms.
However, results of approximately 11 to 12 bps can be achieved
using the velocity feature (without the ascii encoding or
acceleration) in combination with gzip. Compression without
velocity encoding results in files more than a factor of two
larger.
On the other hand, if compactness is desired without using
external compression, the addition of acceleration encoding and
"compact" encoding results in approximately 40% smaller
representation than the velocity representation alone.
The working group is currently considering whether, based on
these results, to simplify the range of encoding options, perhaps
retaining only the verbose representation and the velocity
encoding, as this, in combination with general compression schemes,
would achieve approximately 75% of the effectiveness of the more
complex representations.
3.3 Trace Collections
InkML provides mechanisms to gather traces into structured
collections via the <traceGroup> and
<traceView> elements. These allow multiple
traces or groups to be treated as a flat or structured unit for the
purposes of referencing, attaching context information, semantic
labelling, or application-specific needs. The
<traceGroup> element gathers
<trace> or other <traceGroup>
elements into a unit. The <traceView> element
refers to existing <trace>,
<traceGroup> or other
<traceView> elements to provide alternative
views or organization on the ink. For example, a diagramming
application may record fixed-length <trace>
packages, organized as continuations within
<traceGroup> elements, and use
<traceView> elements to record the logical
structure of the diagram.
3.3.1 <traceGroup>
element
xml:id =
xsd:ID
The identifier for this traceGroup.
Required: no, Default: none
contextRef = xsd:
IDREFanyURI
The context associated with this
traceGroup.
Required: no, Default: none
brushRef = xsd:
IDREFanyURI
The brush associated with this
traceGroup.
Required: no, Default: none
The <traceGroup> element is used to group
successive traces which share common characteristics, such as the
same <traceFormat>. The brush and context
sections describe other contextual values that can be specified for
a <traceGroup>. In the following example the two
traces enclosed in the <traceGroup> share the
same brush (see the Brushes
section for a description of brushes).
<traceGroup brushRef="#penA">
<trace>...</trace>
<trace>...</trace>
</traceGroup>
The use
of<traceGroup> is
reserved forelement may be used for
various purposes, such as the containment of traces
according to their properties at the time of capture. The element
may not be nested, and it
is not meant to bemay be used as a generic grouping
mechanism, e.g. for the semantic
labelling of traces. For that purpose, InkML
provides the <traceRef> element.
Trace groups are the primary mechanism for assigning
<context> to traces in archival ink markup. For
additional details about this usage, see the Archival Applications section.
3.3.2 <traceView>
element
xml:id = xsd:ID
The identifier for this traceView.
Required: no, Default: none
contextRef = xsd:anyURI
The context associated with this
traceView.
Required: no, Default: none
traceDataRef = xsd:anyURI
A URI reference to a
<trace>, <traceGroup> or
<traceView> element.
Required: no, Default: none
from = xsd:integer [ ':' xsd:integer ]*
The index of the first point that this
<traceView> element annotates.
Required: no, Default: the index of the first
referenced point (see prose)
to = xsd:integer[ ':' xsd:integer ]*
The index of the last point in the trace or
trace group that this <traceView> element
annotates.
Required: no, Default: the index of the last
referenced point (see prose)
The <traceView> element is used to group
traces by reference from the current document or other documents.
The grouping may be used to provide common contextual values or
structure for semantic labelling. Additional context information
may be supplied via <annotation> or
<annotationXML> child elements. A given
<traceView> may have either a
traceDataRef attribute or
<traceView> children, but not both.
If a traceDataRef attribute is given, then a
to and/or from attribute may be given.
Together, traceDataRef, from and
to refer to another element and select part of it. An
traceDataRef attribute may refer to a
<trace>, a <traceGroup> or
another <traceView>.
A missing from attribute is equivalent to selecting
the first point in the (recursively) first child of the referenced
element. A missing to attribute is equivalent to
selecting the last point in the (recursively) last child of the
referenced element. With these defaults, the
<traceView> selects the portion of the
referenced element from the first point to the last point,
inclusive. If neither a to nor from
attribute is given, this implies the entire referenced element is
selected.
Any value of a from or to attribute is
a colon-separated list of integers, whose meaning is defined as
follows: An empty list of integers selects the entire referenced
object (point, <trace>,
<traceGroup> or <traceView>).
If the list is non-empty, then its first element is taken as a
1-based index into the referenced object, and the remaining list is
used to select within the object. It is an error to try to select
within a single point.
If the referenced object is a <traceView>,
then the indexing is relative to the tree selected by the
<traceView>, not relative to the original
object.
If a <traceGroup> contains continuation
traces, they are counted independently.
If a contextRef attribute is given, then it overrides the
context of the referenced trace data.
Suppose we have the following ink element:
<ink>
<trace xml:id="L1">911 912, 921 922, 931 932</trace>
<traceGroup xml:id="L2">
<trace>111 112, 121 122</trace>
<traceGroup xml:id="L2-Larry">
<trace>221 212, 221 222</trace>
<trace>311 312, 321 322</trace>
</traceGroup>
<trace>411 412, 421 422</trace>
<traceGroup>
<traceGroup>
<trace xml:id="L2-Moe">521 512, 521 522</trace>
<trace>611 612, 621 622</trace>
</traceGroup>
</traceGroup>
<trace>711 712, 721 722</trace>
</traceGroup>
<traceView xml:id="L3">
<traceView traceDataRef="#L1" from="2"/>
<traceView traceDataRef="#L2" from="2" to="4:1:1"/>
</traceView>
<traceView xml:id="L4" traceDataRef="#L3" from="1:2" to="2:1:2:1"/>
</ink>
With reference "#L1", the from index "2" refers to the
point (921, 922). With reference "#L2", the from index "2"
refers to the <traceGroup> with id "L2-Larry",
the index "4:1:1" refers to the element with id "L2-Moe", the index
"4:1:1:2" refers to the point (521, 522), and the index "4:1:1:2:1"
is illegal.
The <traceView> with id "L3" selects the
following structure
<traceGroup>
<trace>921 922, 931 932</trace>
<traceGroup>
<traceGroup>
<trace>221 212, 221 222</trace>
<trace>311 312, 321 322</trace>
</traceGroup>
<trace>411 412, 421 422</trace>
<traceGroup>
<traceGroup>
<trace>521 512, 521 522</trace>
</traceGroup>
</traceGroup>
</traceGroup>
</traceGroup>
and the
<traceView> with id "L4" selects
<traceGroup>
<trace>931 932</trace>
<traceGroup>
<traceGroup>
<trace>221 212, 221 222</trace>
<trace>311 312</trace>
</traceGroup>
</traceGroup>
</traceGroup>
4 ContextContexts
A number of details comprise the context in
which ink is written and recorded. Examples include the size of the
surface the traces were recorded on, the pen tip used or the
accuracy of the pressure measurements. This contextual information
needs to be captured by InkML in order to fully characterize the
recorded ink data. This section defines markup that provides a way
to describe this information, including the <context>
element which provides a means to associate a defined context with
trace data.
The format of trace data -- both in the channels available and
their particulars -- may vary from device to device, including from
stylus to stylus with the same tablet. Therefore, the
<context> element may refer to or contain a
specific <traceFormat> and <inkSource>
element for the device.
As the ink is generated, there may be various context-dependent
attributes associated with the pen. For this, a <brush> element
may be used to record the attributes of the pen during the capture
of the digital ink.
The start times of traces are often given relative to a
specified point in time. A context may provide a <timestamp>
element for this.
For applications that require the sharing of ink, contexts may
relate their ink to a shared canvas, given by a <canvas>
element. The trace format of the ink source is related to the trace
format of a shared canvas by means of a <canvasTransform> element.
4.1 The <context>
element
This section describes the <context> element
and its attributes: canvas,
canvasTransformRef, traceFormatRef,
captureDeviceRef, and brushRef, and
timestampRef. The context element both defines provides access
to a useful shared context (canvas) and serves as a
convenient agglomeration of contextual attributes. It is used by
the <traceGroup> and <traceView> elements to define
the complete shared context of a group of traces or may be referred
to as part of a context change in streaming mode. In either mode,
individual attributes may be overridden at time of use.
Additionally, individual traces may refer to a previously defined
context (again optionally overriding its attributes) to describe a
context change that persists only for the duration of that
trace.
Although the use of the <context> element and
attributes is strongly encouraged, default interpretations are
provided so that they are not required in an ink markup file if all
trace data is recorded in the same virtual coordinate system, and
its relationship to digitizer coordinates is either not needed or
unknown.
xml:id =
xsd:ID
The unique identifier for this
context.
Required: no (yes for archival InkML), Default:
none
contextRef = xsd:
IDREFanyURI
A previously defined context upon which this
context is to be based.
Required: no, Default: none
canvas = xsd:ID
The identifier of the canvas for this
context.
Required: no, Default: "default", or inherited
from contextRef
canvasRef = xsd:anyURI
The URI of a canvas element for this
context.
Required: no, Default: "DefaultCanvas", or
inherited from contextRef
canvasTransformRef = xsd:anyURI
This is a reference to a mapping from the
coordinate system of the trace to the coordinate system of the
canvas.
Required: no, Default: (identity), or
inherited from contextRef
traceFormatRef = xsd:
IDREFanyURI
A reference to the traceFormat for this
context.
Required: no, Default: default trace format, or
inherited from contextRef
captureDeviceRefinkSourceRef = xsd:
IDREFanyURI
A reference to the inkSourcecaptureDevice for this context.
Required: no, Default: default capture device, or
inherited from contextRef
brushRef = xsd:
IDREFanyURI
A reference to the brush for this
context.
Required: no, Default: none, or inherited from
contextRef
timestampRef = xsd:anyURI
A reference to the timestamp for this
context.
Required: no, Default: none, or inherited from
contextRef
<context id="context1" canvas="canvas1"
traceFormatRef="format1" brushRef="brush1"/>
<context id="context2" contextRef="context1"
brushRef="brush2"/>
<context id="context3" canvas="canvas1"
canvasTransform="2 0 0 0 2 0"
traceFormatRef="format2" brushRef="brush3"/>
The <context> element consolidates all
salient characteristics of one or more ink traces. It may be
specified by declaring all non-default attributes, or by referring
to a previously defined context and overriding specific attributes.
The element is found either in the definitions element or as a child of
the ink element
in Streaming InkML
Each constituent part of a context may be provided either by a
referencing attribute or as a child element, but not both. Thus it
is possible to have either a traceFormatRef attribute or a
<traceFormat> child element, but not both.
The first example above is a hypothetical device #1, using a
previously defined format1 and brush1, and indicating that it can
share trace data using canvas1. Its trace coordinates are mapped to
this shared canvas using the default identity matrix with zero
offset.
The second example is the same device #1, using a different
brush: brush2.
The third example is a hypothetical device #2, using previously
defined format2 and brush3, and sharing trace data with the first
device by using the common canvas1. Its trace coordinates require a
scale factor of 2 to map to the canvas.
4.2 captureDeviceInk
Sources
One of the important requirements for the ink format is to allow
accurate recording of metadata about the format and quality of ink
as it is reported by the source. The source is typically hardware
as embodied in a digitizer device, but may in general be any
"virtual" source of ink, such as a software application that is
tracking the trajectory of an object. This is accomplished in the
<inkSource> element, which supports capture of
basic information about the make and model of the device and the
ink channels captured, as well as very detailed information about a
number of source characteristics.
Some of these characteristics are already commonly used in
digitizer specifications, while others are somewhat more esoteric,
but nonetheless potentially very useful. In general, these source
characteristics describe signal fidelity, allow understanding of
the quality of the data, and impose some limits on how the data can
be used. They are not intended to be used for repair of bad data
from the source.
One of the important requirements for the ink format is to allow
accurate recording of metadata about the hardware that was used to
acquire the ink contained in a file. This is accomplished in the
<captureDevice> block, which may contain either
very basic information, or very detailed information about a number
of device characteristics.
Some of these characteristics are already commonly used in
digitizer specifications, while others are somewhat more esoteric,
but nonetheless potentially very useful. Most digitizer
manufacturers do not specify them, and many are not able to measure
them. However, these device characteristics influence signal
fidelity and impose some limits on how the data can be used.
Hopefully by beginning to standardize the recording of these
characteristics, we can raise awareness and encourage device
manufacturers to take them into consideration.
4.2.1 <inkSourcecaptureDevice> element
xml:id =
xsd:ID
The unique identifier for this
inkSourcecaptureDevice element.
Required: yes
manufacturer = xsd:string
String identifying the digitizer device
manufacturer.
Required: no, Default: unknown
model = xsd:string
String identifying the digitizer
model.
Required: no, Default: unknown
serialNo = xsd:string
Unique manufacturer (or other) serial number
for the device.
Required: no, Default: unknown
specificationRef = xsd:anyURI
URI of a page providing detailed or additional
specifications.
Required: no, Default: unknown
description = xsd:string
String describing the ink source, especially
one implemented in software.
Required: no, Default: unknown
sampleRate = xsd:decimal
The basic sample rate in
samples/second.
Required: no, Default: unknown
uniform = xsd:boolean
Is the sample rate consistent, with no dropped
points?
Required: no, Default: unknown
latency = xsd:decimal
The basic device latency that applies to all
channels, in milliseconds.
Required: no, Default: unknown
<inkSource xml:id = "mytablet"
manufacturer = "Example.com"
model = "ExampleTab 2000 USB"
specificationRef="http://www.example.com/products/exampletab/2000usb.html">
<traceFormat href="#XYF"/>
<sampleRate uniform="True" value="200"/>
<activeArea size="A6" height="100" width="130" units="mm"/>
<srcProperty name="weight" value="100" units="g"/>
<channelProperties>
<resolution channel="X" value="5000" units="1/in"/>
<resolution channel="Y" value="5000" units="1/in"/>
<channelProperty
channel="Y"
name="peakRate"
value="50"
units="cm/s">
<resolution channel="F" value="1024" units="dev"/>
</channelProperties>
</inkSource>
<captureDevice id="foo"
manufacturer="AcmePen"
model="FooBar 2000 USB"
sampleRate="100"
uniform="TRUE"
latency="50">
<channelList>
...
</channelList>
</captureDevice>
The <inkSourcecaptureDevice>
element will allow specification of:
- Manufacturer, model and serial number (of a hardware
device)
- Text description of source, and reference (URI) to detailed or
additional information
- Trace format - regular and intermitent channels reported by
source
- Sampling rate, latency and active area
- Additional properties of the device in the form of
name-value-units triples
- Properties of individual channels
- Manufacturer and model
- Basic sampling rate - samples/second
- Sampling uniformity: must be designated non-uniform if
any pen-down points are skipped or if the sampling is
irregular
- Latency: latency of the real-time channel, in msec, from
physical action to the API time stamp. This is typically specified
at the device level, since all channels often are subject to a
common processing and communications latency.
- Channel List
The <inkSourcecaptureDevice>
block, including
<channelList>, will often be specified by
reference to a separate xml document, either local or at some
remote URI. Ideally, <inkSourcecaptureDevice> blocks for common
devices will become publicly available.
4.2.2 <sampleRate>
element
The <sampleRate> element captures the rate at
which ink samples are reported by the ink source. Many devices
report at a uniform rate; other devices may skip duplicate points
or report samples only when there is a change in direction. This is
indicated using the uniform attribute, which must be
designated "false" (non-uniform) if any pen-down points are
skipped or if the sampling is irregular.
uniform = xsd:boolean
Sampling uniformity: Is the sample rate
consistent, with no dropped points?
Required: no, Default: unknown
value = xsd:decimal
The basic sample rate in
samples/second.
Required: yes
EMPTY
<sampleRate uniform="True" value="200"/>
4.2.3 <latency> element
The <latency> element captures the basic
device latency that applies to all channels, in milliseconds, from
physical action to the API time stamp. This is specified at the
device level, since all channels often are subject to a common
processing and communications latency.
value = xsd:decimal
Latency in milliseconds.
Required: yes
EMPTY
<latency value="50"/>
4.2.4 <activeArea>
element
Many ink capture devices have a notion of active area, which
describes the two-dimensional area within which the device is
capable of sensing the pen position. This element allows the
specification of a rectangular active area.
size = xsd:string
The active area, described using an
international paper size standard such as ISO216.
Required: no, Default: unknown
height = xsd:decimal
Height of the active area (corresponding to
the Y channel).
Required: no, Default: unknown
width = xsd:decimal
Width of the active area (corresponding to the
X channel).
Required: no, Default: unknown
units = xsd:string
Units used for width and height.
Required:no, Default: unknown
EMPTY
<activeArea size="A6" height="100" width="130" units="mm"/>;
4.2.5 <srcProperty>
element
The <srcProperty> element provides a simple
mechanism for the capture of additional numeric properties
of the ink source as a whole.
name = xsd:string
Name of property of device or ink
source.
Required: yes
value = xsd:decimal
Value of named property.
Required: yes
units = xsd:string
Units used for value.
Required:no, Default: unknown
EMPTY
<srcProperty name="weight" value="100" units="g"/>
4.2.6
<channelProperties> element
The <channelProperties> element is meant for
describing properties of specific channels reported by the ink
source. Properties such as range and resolution may be specified
using corresponding elements. For more esoteric properties (from a
lay user's standpoint) the generic channelProperty element may be
used.
None
<channelProperties>
<channelProperty channel="X" name="resolution" value="5000" units="1/in"/>
<channelProperty channel="Y" name="resolution" value="5000" units="1/in"/>
<channelProperty channel="Y" name="peakRate" value="50" units="cm/s">
<channelProperty channel="F" name="resolution" value="1024" units="dev"/>
</channelProperties>
4.2.7 <channelProperty>
element
The <channelProperty> element provides a
simple mechanism for the capture of additional numeric
properties of specific channels when known and appropriate. The
following channel property names, with their specified meanings,
are reserved. Other properties may be defined by the user.
| Property name |
Interpretation |
| threshold |
Threshold - e.g. for a binary channel,
the threshold force at which the tip switch is activated |
| resolution |
Resolution - the scale of the values
recorded. This may be expressed as fractions of a unit, e.g. 1/1000
in (inches), 0.1 mm, 1 deg (degrees). It
may also be expressed, more more popularly, in inverse units, e.g.
"1000 points per inch" would be given as 1000 in units
1/in. |
| quantization |
Quantization - the unit of smallest
change in the reported values. If the value is reported as integer,
this is assumed to be the same as the resolution. Note that if
decimal values are recorded for resolution, the quantization of the
data may be smaller than the "resolution". |
| noise |
Noise - the RMS value of noise
typically observed on the channel. This is distinct from accuracy!
It is an indication of the difference observed in the data from the
device when the same path is traced out multiple times (e.g. by a
robot). |
| accuracy |
Accuracy - the typical accuracy of the
data on the channel (e.g. "0.5 mm", "10 degrees" or "0.1 newton")
This is the typical difference between the reported position and
the actual position of the pen tip (or tilt ...) |
| crossCoupling |
Cross-coupling - the distortion in the
data from one channel due to changes in another channel. For
example, the X and Y coordinates in an electromagnetic digitizer
are influenced by the tilt of the pen. This would be specified by
dX/dOTx = ... or max delta X vs. OTx = ... If the influencing
channels are also recorded, and the cross-couplings are accurately
specified, it may be possible to compensate for the cross-coupling
by subtracting the influence, at the expense of higher noise. The
cross-coupling is always expressed in the units of the two
channels, e.g. if X mm and OTx is in degrees, then cross-coupling
is in mm/deg. |
| skew |
Skew - the temporal skew of this
channel relative to the basic device latency, if any. For example,
some devices actually sample X and Y at different points in time,
so one might have a skew of -5 millisecond, and the other +5
millisecond. |
| minBandwidth |
Minimum bandwidth (in Hz) - the minimum
bandwidth of the channel, in Hz (not samples/second), i.e., the
frequency of input motion up to which the signal is accurate to
within 3dB. |
| peakRate |
Peak rate - the maximum speed at which
the device can accurately track motion |
| distortion |
Dynamic distortion, e.g., how velocity
affects position accuracy. This is expressed in inverse seconds,
e.g. 0.01 mm / mm / s. This kind of distortion is often cross
channel, but this specification only allows a generic,
channel-specific value. |
channel = xsd:string
The name of the channel. Must be one among
those defined by the ink source's trace format.
Required: yes
name = xsd:string
Name of property of device or ink
source.
Required: yes
value = xsd:decimal
Value of named property.
Required: yes
units = xsd:string
Units used for value.
Required:no, Default: unknown
EMPTY
<channelProperty channel="F" name="threshold" value="0.1" units="N"/>
<channelProperty channel="X" name="quantization" value="0.01" units="mm"/>
4.2.8 <channelList>
element
id = xsd:ID
The unique identifier for this channel
list.
Required: no, Default: none
<channelList id="foo">
<channelDef name="X">
...
</channelDef>
</channelList>
The <channelList> element lists all data
channels that the device is capable of reporting. Channels
include:
- X coordinate (horizontal pen position, relative or
absolute)
- Y coordinate (up/down or vertical pen position, relative or
absolute)
- Z coordinate (height of pen above paper/digitizer, relative or
absolute)
- Force (pen tip force) [NOTE: this is often referred to as
"pressure" by manufacturers]
- Tip switch state (touching, not touching digitizer)
- Side switches and Buttons (for example, bezel buttons, cursor
buttons...)
- Tilt angle in X dimension
- Tilt angle in Y dimension
- Pen Azimuth (alternative to tilt)
- Pen Elevation (alternative to tilt)
- Pen Rotation (around the pen axis)
In addition, devices may define their own data channels for the
recording of device-specific information.
4.2.9 <channelDef>
element
name = xsd:NMTOKENS
The name of the channel described by this
<channelDef> element.
Required: yes
<channelDef name="S">
<representation type="boolean"/>
<threshold value="0.1" units="newtons"/>
<skew value="5" units="ms"/>
</channelDef>
<channelDef name="X">
<representation type="integer"/>
<range min="0" max="8191"/>
<resolution value="0.1" units="mm"/>
<quantization value="0.01" units="mm"/>
<noise value="0.05" units="mm"/>
<accuracy value="0.5" units="mm"/>
<crossCoupling>
<bind source="Tx"/>
<bind source="Ty"/>
<mapping type="mathml" apply="relative">
<math>
...
</math>
</mapping>
</crossCoupling>
<skew value="2" units="ms"/>
<minBandwidth value="15.0"/>
<distortion value=".001"/>
</channelDef>
For each data channel that a device is capable of reporting, its
characteristics are described using a
<channelDef> element. Each channel may specify
any of the following when known and appropriate:
- Value representation - for example, Boolean, integer, or
decimal
- Range - the range of possible values that may be reported
- Threshold - (for binary channels) - e.g. the threshold force at
which the tip switch is activated
For continuous channels, like X, Y and Z, and Force, these
additional characteristics may be specified:
- Resolution - the scale of the values recorded, expressed as
"fraction units", e.g. "1/1000 inch") or "decimal units", e.g. "0.1
mm" or "1 degrees" Note that if decimal values are recorded, the
quantization of the data may be smaller than the "resolution"
- Quantization - the unit of smallest change in the reported
values. If the value is reported as integer, this is assumed to be
the same as the resolution
- Noise - the RMS value of noise typically observed on the
channel. This is distinct from accuracy! It is an indication of the
difference observed in the data from the device when the same path
is traced out multiple times (e.g. by a robot).
- Accuracy - the typical accuracy of the data on the channel
(e.g. "0.5 mm", "10 degrees" or "0.1 newton") This is the typical
difference between the reported position and the actual position of
the pen tip (or tilt ...)
- Cross-coupling - the distortion in the data from one channel
due to changes in another channel. For example, the X and Y
coordinates in an electromagnetic digitizer are influenced by the
tilt of the pen. This would be specified by dX/dTx = ... ??? or max
delta X vs. Tx = ... ??? If the influencing channels are also
recorded, and the cross-couplings are accurately specified, it may
be possible to compensate for the cross-coupling by subtracting the
influence, at the expense of higher noise. The cross-coupling is
always expressed in the units of the two channels, e.g. if X mm and
Tx is in degrees, then cross-coupling is in mm/deg
- Skew - the temporal skew of this channel relative to the basic
device latency, if any. For example, some devices actually sample X
and Y at different points in time, so one might have a skew of -5
millisecond, and the other +5 millisecond.
- Minimum bandwidth (in Hz) - the minimum bandwidth of the
channel, in Hz (not samples/second), i.e., the frequency of input
motion up to which the signal is accurate to within 3dB.
- Peak rate - the maximum speed at which the device can
accurately track motion
- Dynamic distortion, e.g., how velocity affects position
accuracy. This is expressed in inverse seconds, e.g. 0.01 mm / mm /
s. This kind of distortion is often cross channel, but this spec
only allows a generic, channel independent specificat