aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Freilich <sfreilich@google.com>2022-02-10 10:28:06 -0500
committerSamuel Freilich <sfreilich@google.com>2022-02-10 12:06:35 -0500
commitd750abd4baac71ae8afc10e3547601539daa0882 (patch)
tree7edda4074fce2cb718e6ae5d71831ce3ad0621a6
parent30a0081e60a2b648d3d4aeaf78ea555b192119ad (diff)
downloadink-stroke-modeler-d750abd4baac71ae8afc10e3547601539daa0882.tar.gz
Remove [TOC] markup (not supported by GitHub) and add MathJax rendering script
The latter will only work on GitHub Pages, since the rendering on the github domain scrubs JS. Will add a link to that once it's set up. PiperOrigin-RevId: 427742617
-rw-r--r--README.md23
1 files changed, 12 insertions, 11 deletions
diff --git a/README.md b/README.md
index b94d73c..25c2999 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
# Ink Stroke Modeler
-[TOC]
+<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
This library smooths raw freehand input and predicts the input's motion to
minimize display latency. It turns noisy pointer input from touch/stylus/etc.
@@ -10,8 +11,8 @@ Be advised that this library was designed to model handwriting, and as such,
prioritizes smooth, good-looking curves over precise recreation of the input.
This library is designed to have minimal dependencies; the library itself relies
-only on the C++ Standard Library and Abseil (https://abseil.io/), and the
-tests use the GoogleTest framework (https://google.github.io/googletest/).
+only on the C++ Standard Library and Abseil (https://abseil.io/), and the tests
+use the GoogleTest framework (https://google.github.io/googletest/).
## Usage
@@ -43,9 +44,9 @@ if (absl::Status status = modeler.Reset(params); !status.ok()) {
```
You may also call `Reset()` on an already-initialized `StrokeModeler` to set new
-parameters; this also clears the in-progress stroke, if any. If the
-`Update` or `Predict` functions are called before `Reset`, they will
-return `absl::FailedPreconditionError`.
+parameters; this also clears the in-progress stroke, if any. If the `Update` or
+`Predict` functions are called before `Reset`, they will return
+`absl::FailedPreconditionError`.
To use the model, pass in an `Input` object to `StrokeModeler::Update()` each
time you recieve an input event:
@@ -101,11 +102,11 @@ If no input stream is in-progress, it will instead return
When the model is configured with `StrokeEndPredictorParams`, the last `Result`
returned by `Predict` will have a `time` slightly after the most recent `Input`.
-(This is the same as the points that would be added to the `Result`s returned
-by `Update` if the most recent input was `kUp` instead of `kMove`.) When the
-model is configured with `KalmanPredictorParams`, the prediction may take more
-time to "catch up" with the position of the last input, then take an additional
-interval to extend the stroke beyond that position.
+(This is the same as the points that would be added to the `Result`s returned by
+`Update` if the most recent input was `kUp` instead of `kMove`.) When the model
+is configured with `KalmanPredictorParams`, the prediction may take more time to
+"catch up" with the position of the last input, then take an additional interval
+to extend the stroke beyond that position.
The state of the most recent stroke can be represented by concatenating the
vectors of `Result`s returned by a series of successful calls to `Update`,