Package com.itextpdf.awt.geom
Class FlatteningPathIterator
java.lang.Object
com.itextpdf.awt.geom.FlatteningPathIterator
- All Implemented Interfaces:
PathIterator
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) double[]
The points buffer(package private) boolean
The indicator of empty points bufferprivate static final int
The points buffer capacityprivate static final int
The default curve subdivision limitprivate static final int
The default points buffer size(package private) int
The inner cursor position in points buffer(package private) int
The curve subdivision limit(package private) int
The current points buffer size(package private) int
The current subdivision count(package private) int
The type of current segment to be flat(package private) double[]
The tamporary buffer for getting points from PathIterator(package private) double
The flatness of new path(package private) double
The square of flatness(package private) PathIterator
The source PathIterator(package private) double
The x coordinate of previous path segment(package private) double
The y coordinate of previous path segmentFields inherited from interface com.itextpdf.awt.geom.PathIterator
SEG_CLOSE, SEG_CUBICTO, SEG_LINETO, SEG_MOVETO, SEG_QUADTO, WIND_EVEN_ODD, WIND_NON_ZERO
-
Constructor Summary
ConstructorsConstructorDescriptionFlatteningPathIterator
(PathIterator path, double flatness) FlatteningPathIterator
(PathIterator path, double flatness, int limit) -
Method Summary
Modifier and TypeMethodDescriptionint
currentSegment
(double[] coords) int
currentSegment
(float[] coords) (package private) void
evaluate()
Calculates flat path points for current segment of the source shape.double
int
int
boolean
isDone()
void
next()
-
Field Details
-
BUFFER_SIZE
private static final int BUFFER_SIZEThe default points buffer size- See Also:
-
BUFFER_LIMIT
private static final int BUFFER_LIMITThe default curve subdivision limit- See Also:
-
BUFFER_CAPACITY
private static final int BUFFER_CAPACITYThe points buffer capacity- See Also:
-
bufType
int bufTypeThe type of current segment to be flat -
bufLimit
int bufLimitThe curve subdivision limit -
bufSize
int bufSizeThe current points buffer size -
bufIndex
int bufIndexThe inner cursor position in points buffer -
bufSubdiv
int bufSubdivThe current subdivision count -
buf
double[] bufThe points buffer -
bufEmpty
boolean bufEmptyThe indicator of empty points buffer -
p
The source PathIterator -
flatness
double flatnessThe flatness of new path -
flatness2
double flatness2The square of flatness -
px
double pxThe x coordinate of previous path segment -
py
double pyThe y coordinate of previous path segment -
coords
double[] coordsThe tamporary buffer for getting points from PathIterator
-
-
Constructor Details
-
FlatteningPathIterator
-
FlatteningPathIterator
-
-
Method Details
-
getFlatness
public double getFlatness() -
getRecursionLimit
public int getRecursionLimit() -
getWindingRule
public int getWindingRule()- Specified by:
getWindingRule
in interfacePathIterator
-
isDone
public boolean isDone()- Specified by:
isDone
in interfacePathIterator
-
evaluate
void evaluate()Calculates flat path points for current segment of the source shape. Line segment is flat by itself. Flatness of quad and cubic curves evaluated by getFlatnessSq() method. Curves subdivided until current flatness is bigger than user defined and subdivision limit isn't exhausted. Single source segment translated to series of buffer points. The less flatness the bigger serries. Every currentSegment() call extract one point from the buffer. When series completed evaluate() takes next source shape segment. -
next
public void next()- Specified by:
next
in interfacePathIterator
-
currentSegment
public int currentSegment(float[] coords) - Specified by:
currentSegment
in interfacePathIterator
-
currentSegment
public int currentSegment(double[] coords) - Specified by:
currentSegment
in interfacePathIterator
-