public class SVGRenderer extends ImageRenderer<Float[],SVGImage>
ImageRenderer
for FImage
images. Supports both anti-aliased
and fast rendering.hints, targetImage
Constructor and Description |
---|
SVGRenderer(SVGImage targetImage)
Construct with given target image.
|
SVGRenderer(SVGImage img,
Graphics create) |
SVGRenderer(SVGImage img,
RenderHints renderHints,
Graphics create) |
SVGRenderer(SVGImage targetImage,
SVGRenderHints hints)
Construct with given target image and rendering hints.
|
SVGRenderer(SVGRenderHints hints)
Construct with given target image and rendering hints.
|
Modifier and Type | Method and Description |
---|---|
SVGRenderer |
clone() |
Float[] |
defaultBackgroundColour()
Get the default foreground colour.
|
Float[] |
defaultForegroundColour()
Get the default foreground colour.
|
protected void |
drawHorizLine(int x1,
int x2,
int y,
Float[] col)
Draw a horizontal line with the specified colour.
|
void |
drawImage(SVGImage image,
int x,
int y)
Draw into this image the provided image at the given coordinates.
|
void |
drawLine(float x0,
float y0,
float x1,
float y1,
int thickness,
Float[] col)
Draw a line from the coordinates specified by
(x0,y0) to the
coordinates specified by (x1,y1) using the given color and
thickness. |
void |
drawLine(int x1,
int y1,
double theta,
int length,
int thickness,
Float[] col)
Draw a line from the coordinates specified by
(x1,y1) at an
angle of theta with the given length, thickness and colour. |
void |
drawLine(int x0,
int y0,
int x1,
int y1,
int thickness,
Float[] col)
Draw a line from the coordinates specified by
(x0,y0) to the
coordinates specified by (x1,y1) using the given color and
thickness. |
void |
drawOIImage(Image<?,?> im) |
void |
drawPoint(Point2d p,
Float[] col,
int size)
Draw a dot centered on the given location (rounded to nearest integer
location) at the given size and with the given color.
|
void |
drawPolygon(Polygon p,
int thickness,
Float[] col)
Draw the given polygon in the specified colour with the given thickness
lines.
|
void |
drawPolygonFilled(Polygon p,
Float[] col)
Draw the given polygon, filled with the specified colour.
|
void |
drawShapeFilled(Shape s,
Float[] col)
Draw the given shape, filled with the specified colour.
|
Document |
getDocument() |
org.apache.batik.svggen.SVGGraphics2D |
getGraphics2D() |
protected Float[] |
sanitise(Float[] colour)
Sanitize the colour given to fit this image's pixel type.
|
void |
write(Writer out) |
drawConnectedPoints, drawCubicBezier, drawImage, drawLine, drawLine, drawLine, drawLine, drawLine, drawLines, drawPath, drawPaths, drawPoints, drawPolygon, drawQuadBezier, drawShape, drawShape, drawText, drawText, drawText, drawText, drawText, drawText, drawText, drawText, getImage, getRenderHints, setImage, setRenderHints
public SVGRenderer(SVGImage targetImage)
targetImage
- the target image.public SVGRenderer(SVGImage targetImage, SVGRenderHints hints)
targetImage
- the target image.hints
- the render hintspublic SVGRenderer(SVGRenderHints hints)
hints
- the render hintspublic SVGRenderer(SVGImage img, Graphics create)
img
- create
- public SVGRenderer(SVGImage img, RenderHints renderHints, Graphics create)
public void drawLine(int x1, int y1, double theta, int length, int thickness, Float[] col)
ImageRenderer
(x1,y1)
at an
angle of theta
with the given length, thickness and colour.drawLine
in class ImageRenderer<Float[],SVGImage>
x1
- The x-coordinate to start the line.y1
- The y-coordinate to start the line.theta
- The angle at which to draw the line.length
- The length to draw the line.thickness
- The thickness to draw the line.col
- The colour to draw the line.public void drawLine(int x0, int y0, int x1, int y1, int thickness, Float[] col)
ImageRenderer
(x0,y0)
to the
coordinates specified by (x1,y1)
using the given color and
thickness.drawLine
in class ImageRenderer<Float[],SVGImage>
x0
- The x-coordinate at the start of the line.y0
- The y-coordinate at the start of the line.x1
- The x-coordinate at the end of the line.y1
- The y-coordinate at the end of the line.thickness
- The thickness which to draw the line.col
- The colour in which to draw the line.public void drawLine(float x0, float y0, float x1, float y1, int thickness, Float[] col)
ImageRenderer
(x0,y0)
to the
coordinates specified by (x1,y1)
using the given color and
thickness.drawLine
in class ImageRenderer<Float[],SVGImage>
x0
- The x-coordinate at the start of the line.y0
- The y-coordinate at the start of the line.x1
- The x-coordinate at the end of the line.y1
- The y-coordinate at the end of the line.thickness
- The thickness which to draw the line.col
- The colour in which to draw the line.public void drawPoint(Point2d p, Float[] col, int size)
ImageRenderer
drawPoint
in class ImageRenderer<Float[],SVGImage>
p
- The coordinates at which to draw the pointcol
- The colour to draw the pointsize
- The size at which to draw the point.public void drawPolygon(Polygon p, int thickness, Float[] col)
ImageRenderer
drawPolygon
in class ImageRenderer<Float[],SVGImage>
p
- The polygon to draw.thickness
- The thickness of the lines to usecol
- The colour to draw the lines inpublic void drawPolygonFilled(Polygon p, Float[] col)
ImageRenderer
drawPolygonFilled
in class ImageRenderer<Float[],SVGImage>
p
- The polygon to draw.col
- The colour to fill the polygon with.public void drawShapeFilled(Shape s, Float[] col)
ImageRenderer
drawShapeFilled
in class ImageRenderer<Float[],SVGImage>
s
- The shape to draw.col
- The colour to fill the polygon with.protected void drawHorizLine(int x1, int x2, int y, Float[] col)
ImageRenderer
drawHorizLine
in class ImageRenderer<Float[],SVGImage>
x1
- starting x (inclusive)x2
- ending x (inclusive)y
- ycol
- the colourpublic Float[] defaultForegroundColour()
ImageRenderer
defaultForegroundColour
in class ImageRenderer<Float[],SVGImage>
public Float[] defaultBackgroundColour()
ImageRenderer
defaultBackgroundColour
in class ImageRenderer<Float[],SVGImage>
protected Float[] sanitise(Float[] colour)
ImageRenderer
sanitise
in class ImageRenderer<Float[],SVGImage>
public void write(Writer out) throws org.apache.batik.svggen.SVGGraphics2DIOException
out
- org.apache.batik.svggen.SVGGraphics2DIOException
public void drawOIImage(Image<?,?> im)
public SVGRenderer clone()
public void drawImage(SVGImage image, int x, int y)
ImageRenderer
drawImage
in class ImageRenderer<Float[],SVGImage>
image
- The image to draw.x
- The x-coordinate of the top-left of the imagey
- The y-coordinate of the top-left of the imagepublic org.apache.batik.svggen.SVGGraphics2D getGraphics2D()
public Document getDocument()