diva.sketch.toolbox
Class InterpolateStrokeFilter

java.lang.Object
  extended by diva.sketch.toolbox.StrokeFilter
      extended by diva.sketch.toolbox.InterpolateStrokeFilter

public class InterpolateStrokeFilter
extends StrokeFilter

For every 2 consecutive points in a stroke, fill in with evenly spaced points until the distance in between any 2 consecutive points no longer exceeds the threshold distance.

Version:
$Revision: 1.1 $
Author:
Heloise Hse (hwawen@eecs.berkeley.edu)

Field Summary
static double DEFAULT_SPACING
           
 
Fields inherited from class diva.sketch.toolbox.StrokeFilter
PROPERTY_KEY
 
Constructor Summary
InterpolateStrokeFilter()
          Create a InterpolateStrokeFilter with the default parameters.
 
Method Summary
 TimedStroke apply(TimedStroke s)
          Interpolate the given stroke such that no 2 consecutive points in the stroke has a distance greater than the specified spacing.
 double getSpacing()
          Return the spacing parameter.
static TimedStroke interpolate(TimedStroke s)
          Interpolate the points in the given stroke using the default spacing value (20.0).
static TimedStroke interpolate(TimedStroke s, double spacing)
          Interpolate the points in the given stroke using the specified spacing value.
 void setSpacing(double val)
          Set the spacing value for adding interpolated points.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SPACING

public static final double DEFAULT_SPACING
See Also:
Constant Field Values
Constructor Detail

InterpolateStrokeFilter

public InterpolateStrokeFilter()
Create a InterpolateStrokeFilter with the default parameters.

Method Detail

apply

public TimedStroke apply(TimedStroke s)
Interpolate the given stroke such that no 2 consecutive points in the stroke has a distance greater than the specified spacing.

Specified by:
apply in class StrokeFilter

interpolate

public static TimedStroke interpolate(TimedStroke s)
Interpolate the points in the given stroke using the default spacing value (20.0).


interpolate

public static TimedStroke interpolate(TimedStroke s,
                                      double spacing)
Interpolate the points in the given stroke using the specified spacing value.


getSpacing

public double getSpacing()
Return the spacing parameter.


setSpacing

public void setSpacing(double val)
Set the spacing value for adding interpolated points. Throw an IllegalArgumentException if the input value is <= 0.



Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.