public class CharcoalStroke extends Objectimplements FilteredStroke
CharcoalEffect to another
Stroke. By default this is built on top of a
BasicStroke, but you can use any other relatively simple stroke. The nature of the charcoal effect requires continuous areas of at least 2 pixels to really be visible.
It is not recommended to layer a CharcoalStroke on top of another CharcoalStroke, because they are very complex.
| Constructor and Description |
|---|
CharcoalStroke(float width, float crackSize)
This creates a
CharcoalStroke on top of a simple
BasicStroke, with a fixed angle of 45 degrees.
|
CharcoalStroke(float width, float crackSize, float angle)
Create a new
CharcoalStroke built on top of a
BasicStroke.
|
CharcoalStroke(Stroke
Create a new
CharcoalStroke built on top of another
Stroke.
|
| Modifier and Type | Method and Description |
|---|---|
Shape |
createStrokedShape(Shape
|
CharcoalStroke |
deriveStroke(float cracks)
Creates a similar stroke where only the crack depth (0-1) is redefined.
|
FilteredStroke |
deriveStroke(Stroke
Creates a similar stroke where the underlying stroke is redefined.
|
float |
getAngle()
|
float |
getCrackSize()
Returns the crack size.
|
int |
getRandomSeed()
|
Stroke |
getStroke()
Returns the underlying stroke this
CharcoalStroke is layered on top of.
|
public CharcoalStroke(float width,
float crackSize,
float angle)
CharcoalStroke built on top of a
BasicStroke.
width - the width of the
BasicStroke.
crackSize - a value from 0-1 indicating how deep the crack should be.
angle - the angle, in radians.
public CharcoalStroke(Strokes, float crackSize, float angle, int randomSeed)
CharcoalStroke built on top of another
Stroke.
s - the stroke to apply the charcoal effect to.
crackSize - a value from 0-1 indicating how deep the crack should be.
angle - the angle, in radians.
randomSeed - the random seed to use.
public CharcoalStroke(float width,
float crackSize)
CharcoalStroke on top of a simple
BasicStroke, with a fixed angle of 45 degrees.
width - the width of the
BasicStroke
crackSize - a value from 0-1 indicating how deep the crack should be.
public int getRandomSeed()
public float getAngle()
public CharcoalStrokederiveStroke(float cracks)
cracks - the new crack depth.
public FilteredStrokederiveStroke(Stroke newStroke)
deriveStroke in interface
FilteredStroke
newStroke - the new underlying Stroke. This could be a
BasicShape, or your own stroke. It is not recommended to layer a
CharcoalStroke on top of another
CharcoalStroke, because they are very complex.
s
public StrokegetStroke()
CharcoalStroke is layered on top of.
getStroke in interface
FilteredStroke
public float getCrackSize()