public class ShapeRasterizer extends Object
java.awt.Shape
.Modifier and Type | Class and Description |
---|---|
static class |
ShapeRasterizer.BresenhamLineRasterizer
The Bresenham Algorithm is the default algorithm used to rasterize lines.
|
static interface |
ShapeRasterizer.LinePixelVisitor
Visits each pixel of a rasterized line.
|
static interface |
ShapeRasterizer.LineRasterizer
An abstract representation of an algorithm used to rasterize lines.
|
Constructor and Description |
---|
ShapeRasterizer()
Constructs a new rasterizer with a no affine transformation, a flatness of
1.0 and a bresenham line
rasterizer. |
ShapeRasterizer(AffineTransform transform,
double flatness,
ShapeRasterizer.LineRasterizer lineRasterizer)
Constructs a new rasterizer with the specified affine transformation, flatness and line rasterizer.
|
Modifier and Type | Method and Description |
---|---|
double |
getFlatness()
Gets the flatness of the of the rasterized outlines to be created.
|
ShapeRasterizer.LineRasterizer |
getLineRasterizer()
Sets the rasterizing algorithm.
|
AffineTransform |
getTransform()
Gets the affine transformation to be applied before a shape is rasterized.
|
Point2D[] |
getVertices(Shape shape)
Converts the given shape into an array of vertices.
|
Point2D[] |
rasterize(Point2D[] vertices)
Rasterizes the given shape given as a vertices array.
|
Point2D[] |
rasterize(Point2D[] vertices,
int[] vertexIndexes)
Rasterizes the given shape given as a vertices array.
|
Point2D[] |
rasterize(Shape shape)
Rasterizes the given shape.
|
void |
setFlatness(double flatness)
Sets the flatness of the of the rasterized outlines to be created.
|
void |
setLineRasterizer(ShapeRasterizer.LineRasterizer lineRasterizer)
Sets the rasterizing algorithm.
|
void |
setTransform(AffineTransform transform)
Sets the affine transformation to be applied before a shape is rasterized.
|
public ShapeRasterizer()
1.0
and a bresenham line
rasterizer.ShapeRasterizer.BresenhamLineRasterizer
public ShapeRasterizer(AffineTransform transform, double flatness, ShapeRasterizer.LineRasterizer lineRasterizer)
transform
- the affine transformation to be applied before a shape is rasterized. Can be
null
.flatness
- the flatness of the rasterized outlines to be created.lineRasterizer
- the rasterizing algorithmpublic AffineTransform getTransform()
null
.public void setTransform(AffineTransform transform)
transform
- the affine transformation to be applied before a shape is rasterized. Can be null
.public double getFlatness()
public void setFlatness(double flatness)
flatness
- the flatness.public ShapeRasterizer.LineRasterizer getLineRasterizer()
public void setLineRasterizer(ShapeRasterizer.LineRasterizer lineRasterizer)
lineRasterizer
- the rasterizing algorithmpublic Point2D[] rasterize(Shape shape)
shape
- the shape to be rasterizedpublic Point2D[] rasterize(Point2D[] vertices)
vertices
- the shape to be rasterized given as verticespublic Point2D[] rasterize(Point2D[] vertices, int[] vertexIndexes)
vertices
- the shape to be rasterized given as verticesvertexIndexes
- if not null
, the method stores the original vertex indices in this arrayCopyright © 2014–2017 European Space Agency (ESA). All rights reserved.