public class

StrokeOutlineBuilder

extends Object
java.lang.Object
   ↳ com.pdftron.pdf.StrokeOutlineBuilder

Class Overview

StrokeOutlineBuilder is a class used to generate a stroke outline. The main purpose of this class is to generate an outline given a variable width stroke from pressure data from a stylus. This class is still in the experimental stages. The API is not yet finalized and it should not be used for production.

Summary

Nested Classes
enum StrokeOutlineBuilder.TipOptions  
Public Constructors
StrokeOutlineBuilder(double strokeWidth)
Create a StrokeOutlineBuilder given a reference width.
Public Methods
void addPoint(double x, double y, double pressure)
Add a stroke point to the curve given position (x, y) and pressure.
double[] getLastSegmentOutline(int numPoints, StrokeOutlineBuilder.TipOptions options)
Returns the stroke outline Bezier curve generated from the last numPoints number of points added.
double[] getOutline()
Returns the entire stroke outline Bezier curve, including the curves generated at the start and end stroke tips.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public StrokeOutlineBuilder (double strokeWidth)

Create a StrokeOutlineBuilder given a reference width. The width of the stroke outline will be based on this reference width, where the minimum width will be (0.6 * width) and the maximum width will be (1.4 * width) This class is still in the experimental stages. The API is not yet finalized and it should not be used for production.

Parameters
strokeWidth used to constrain the stroke thickness

Public Methods

public void addPoint (double x, double y, double pressure)

Add a stroke point to the curve given position (x, y) and pressure. This class is still in the experimental stages. The API is not yet finalized and it should not be used for production.

Parameters
x x-coordinate
y y-coordinate
pressure value at (x, y) used to vary the stroke thickness

public double[] getLastSegmentOutline (int numPoints, StrokeOutlineBuilder.TipOptions options)

Returns the stroke outline Bezier curve generated from the last numPoints number of points added. Also generates the end stroke tip curve if specified. This class is still in the experimental stages. The API is not yet finalized and it should not be used for production.

Parameters
numPoints last number of points used to generate the stroke outline Bezier curve
options whether to add the end tip to the resulting outline
Returns
  • the stroke outline Bezier curve for generated

public double[] getOutline ()

Returns the entire stroke outline Bezier curve, including the curves generated at the start and end stroke tips. This class is still in the experimental stages. The API is not yet finalized and it should not be used for production.

Returns
  • the stroke outline Bezier curve