edu.stanford.hci.r3.pen.ink
Class InkSimplification

java.lang.Object
  extended by edu.stanford.hci.r3.pen.ink.InkSimplification

public class InkSimplification
extends java.lang.Object

Handles real-time or batched simplification of ink strokes. This can make ink look better, or speed up the rendering of ink (by minimizing the number of samples to be drawn).

The stroke simplification algorithm this smooths out little bumps If the stroke is in the same general direction (within the 90 degree cone of the most recent velocity vectors), then we only add new points if they are far enough away... If the stroke is turning in a different direction, then the threshold is much smaller...

This software is distributed under the BSD License.


Constructor Summary
InkSimplification()
           
 
Method Summary
 boolean processNewSample(PenSample sample)
           
 void reset()
           
 void simplifyStroke(InkStroke currentStroke)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InkSimplification

public InkSimplification()
Method Detail

processNewSample

public boolean processNewSample(PenSample sample)
Parameters:
sample -
Returns:
true if we should KEEP this sample. false if we should just disregard it, as it is too close to the recent samples.

reset

public void reset()

simplifyStroke

public void simplifyStroke(InkStroke currentStroke)
Parameters:
currentStroke -

Copyright 2006 Stanford University