Package icyllis.arc3d.sketch
Class PathStroker
java.lang.Object
icyllis.arc3d.sketch.PathStroker
- All Implemented Interfaces:
PathConsumer
PathStroker is a
PathConsumer that converts paths by stroking paths.
This is invoked when a Path is drawn in a canvas with the
Paint.STROKE bit set in the paint. The new path consists of
closed contours, and the style change from thick stroke to fill.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interface -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the current contour by drawing a straight line back to the point of the lastPathConsumer.moveTo(float, float).voidcubicTo(float x1, float y1, float x2, float y2, float x3, float y3) Accepts a curved segment, defined by three new points, to the path by drawing a cubic Bézier curve that intersects both the current point and the specified point(x3,y3), using the specified points(x1,y1)and(x2,y2)as cubic control points.voiddone()Called after the last segment of the last sub-path when the iteration of the path segments is completely done.voidinit(@NonNull PathConsumer out, float radius, int cap, int join, float miterLimit, float resScale) voidlineTo(float x, float y) Accepts a point to the path by drawing a straight line from the current point to the new specified point(x,y).voidmoveTo(float x, float y) Accepts a point to the path consumer by moving to the specified point(x,y).voidquadTo(float x1, float y1, float x2, float y2) Accepts a curved segment, defined by two new points, to the path by drawing a quadratic Bézier curve that intersects both the current point and the specified point(x2,y2), using the specified point(x1,y1)as a quadratic control point.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface icyllis.arc3d.sketch.PathConsumer
cubicTo, quadTo
-
Constructor Details
-
PathStroker
public PathStroker()
-
-
Method Details
-
init
public void init(@NonNull PathConsumer out, float radius, int cap, int join, float miterLimit, float resScale) -
moveTo
public void moveTo(float x, float y) Description copied from interface:PathConsumerAccepts a point to the path consumer by moving to the specified point(x,y).- Specified by:
moveToin interfacePathConsumer- Parameters:
x- the specified X coordinatey- the specified Y coordinate
-
lineTo
public void lineTo(float x, float y) Description copied from interface:PathConsumerAccepts a point to the path by drawing a straight line from the current point to the new specified point(x,y).- Specified by:
lineToin interfacePathConsumer- Parameters:
x- the specified X coordinatey- the specified Y coordinate
-
quadTo
public void quadTo(float x1, float y1, float x2, float y2) Description copied from interface:PathConsumerAccepts a curved segment, defined by two new points, to the path by drawing a quadratic Bézier curve that intersects both the current point and the specified point(x2,y2), using the specified point(x1,y1)as a quadratic control point.- Specified by:
quadToin interfacePathConsumer- Parameters:
x1- the X coordinate of the quadratic control pointy1- the Y coordinate of the quadratic control pointx2- the X coordinate of the final end pointy2- the Y coordinate of the final end point
-
cubicTo
public void cubicTo(float x1, float y1, float x2, float y2, float x3, float y3) Description copied from interface:PathConsumerAccepts a curved segment, defined by three new points, to the path by drawing a cubic Bézier curve that intersects both the current point and the specified point(x3,y3), using the specified points(x1,y1)and(x2,y2)as cubic control points.- Specified by:
cubicToin interfacePathConsumer- Parameters:
x1- the X coordinate of the first cubic control pointy1- the Y coordinate of the first cubic control pointx2- the X coordinate of the second cubic control pointy2- the Y coordinate of the second cubic control pointx3- the X coordinate of the final end pointy3- the Y coordinate of the final end point
-
close
public void close()Description copied from interface:PathConsumerCloses the current contour by drawing a straight line back to the point of the lastPathConsumer.moveTo(float, float). If the path is already closed then this method has no effect.- Specified by:
closein interfacePathConsumer
-
done
public void done()Description copied from interface:PathConsumerCalled after the last segment of the last sub-path when the iteration of the path segments is completely done.- Specified by:
donein interfacePathConsumer
-