public class FImageRenderer extends ImageRenderer<Float,FImage>
ImageRenderer
for FImage
images. Supports both anti-aliased
and fast rendering.hints, targetImage
Constructor and Description |
---|
FImageRenderer(FImage targetImage)
Construct with given target image.
|
FImageRenderer(FImage targetImage,
RenderHints hints)
Construct with given target image and rendering hints.
|
Modifier and Type | Method and Description |
---|---|
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 |
drawLine(float x0,
float y0,
float x1,
float y1,
int thickness,
Float grey)
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 grey)
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 grey)
Draw a line from the coordinates specified by
(x0,y0) to the
coordinates specified by (x1,y1) using the given color and
thickness. |
protected void |
drawLineBresenham(int x0,
int y0,
int x1,
int y1,
int thickness,
Float grey) |
protected void |
drawLineXiaolinWu(float x1,
float y1,
float x2,
float y2,
Float grey) |
void |
drawPoint(Point2d p,
Float grey,
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 grey)
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.
|
protected Float |
sanitise(Float colour)
Sanitize the colour given to fit this image's pixel type.
|
drawConnectedPoints, drawCubicBezier, drawImage, drawImage, drawLine, drawLine, drawLine, drawLine, drawLine, drawLines, drawPath, drawPaths, drawPoints, drawPolygon, drawQuadBezier, drawShape, drawShape, drawShapeFilled, drawText, drawText, drawText, drawText, drawText, drawText, drawText, drawText, getImage, getRenderHints, setImage, setRenderHints
public FImageRenderer(FImage targetImage)
targetImage
- the target image.public FImageRenderer(FImage targetImage, RenderHints hints)
targetImage
- the target image.hints
- the render hintspublic Float defaultForegroundColour()
ImageRenderer
defaultForegroundColour
in class ImageRenderer<Float,FImage>
public Float defaultBackgroundColour()
ImageRenderer
defaultBackgroundColour
in class ImageRenderer<Float,FImage>
public void drawLine(int x1, int y1, double theta, int length, int thickness, Float grey)
(x1,y1)
at an
angle of theta
with the given length, thickness and colour.drawLine
in class ImageRenderer<Float,FImage>
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.grey
- The colour to draw the line.ImageRenderer.drawLine(int, int, double,
int, int, java.lang.Object)
public void drawLine(int x0, int y0, int x1, int y1, int thickness, Float grey)
(x0,y0)
to the
coordinates specified by (x1,y1)
using the given color and
thickness.drawLine
in class ImageRenderer<Float,FImage>
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.grey
- The colour in which to draw the line.ImageRenderer.drawLine(int, int, int,
int, int, java.lang.Object)
public void drawLine(float x0, float y0, float x1, float y1, int thickness, Float grey)
ImageRenderer
(x0,y0)
to the
coordinates specified by (x1,y1)
using the given color and
thickness.drawLine
in class ImageRenderer<Float,FImage>
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.grey
- The colour in which to draw the line.protected void drawLineXiaolinWu(float x1, float y1, float x2, float y2, Float grey)
protected void drawLineBresenham(int x0, int y0, int x1, int y1, int thickness, Float grey)
public void drawPoint(Point2d p, Float grey, int size)
drawPoint
in class ImageRenderer<Float,FImage>
p
- The coordinates at which to draw the pointgrey
- The colour to draw the pointsize
- The size at which to draw the point.ImageRenderer.drawPoint(org.openimaj.math.geometry.point.Point2d,
java.lang.Object, int)
public void drawPolygon(Polygon p, int thickness, Float grey)
drawPolygon
in class ImageRenderer<Float,FImage>
p
- The polygon to draw.thickness
- The thickness of the lines to usegrey
- The colour to draw the lines inImageRenderer.drawPolygon(org.openimaj.math.geometry.shape.Polygon,
int, java.lang.Object)
protected void drawHorizLine(int x1, int x2, int y, Float col)
ImageRenderer
drawHorizLine
in class ImageRenderer<Float,FImage>
x1
- starting x (inclusive)x2
- ending x (inclusive)y
- ycol
- the colourprotected Float sanitise(Float colour)
ImageRenderer
sanitise
in class ImageRenderer<Float,FImage>
public void drawPolygonFilled(Polygon p, Float col)
ImageRenderer
drawPolygonFilled
in class ImageRenderer<Float,FImage>
p
- The polygon to draw.col
- The colour to fill the polygon with.