InkSimplification Class Reference

List of all members.

Public Member Functions

 InkSimplification ()
boolean processNewSample (PenSample sample)
void reset ()
void simplifyStroke (InkStroke currentStroke)

Detailed Description

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.

Author:
Ron B Yeh (ronyeh(AT)cs.stanford.edu)

Definition at line 32 of file InkSimplification.java.


Member Function Documentation

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.

Definition at line 47 of file InkSimplification.java.

References PenSample.timestamp, PenSample.x, and PenSample.y.

Referenced by InkSimplification.simplifyStroke().

void simplifyStroke ( InkStroke  currentStroke  ) 

Parameters:
currentStroke 

Definition at line 135 of file InkSimplification.java.

References InkStroke.getSamples(), InkSimplification.processNewSample(), InkSimplification.reset(), and InkStroke.setSamples().

Referenced by PenSimulator.mouseReleased().


The documentation for this class was generated from the following file:
Generated on Sat Apr 14 18:21:43 2007 for R3 Paper Toolkit by  doxygen 1.4.7