public interface DWDrawing
This interface is implemented by the MicroUI graphical engine's internal software drawer. This drawer implements all
drawings in software. The rendering is exactly the same than the embedded algorithms listed in
dw_drawing_soft.h
. See LLUIDisplay.getDWDrawerSoftware()
.
This interface can be fully implemented by a dedicated platform class in platform front panel project. This allows to implement drawing algorithms like embedded platform.
Additionally, this interface can be only partially implemented by a dedicated platform class in platform front panel
project. This class must implement DWDrawing.DWDrawingDefault
interface instead and override only a set of drawing
methods. This allows to implement same drawing algorithms like embedded platform. All others drawing algorithms are
using the front panel's internal software drawer.
Modifier and Type | Interface and Description |
---|---|
static interface |
DWDrawing.DWDrawingDefault
Default implementation of
DWDrawing which uses the getUIDrawerSoftware's internal software drawer to
perform all drawings. |
Modifier and Type | Method and Description |
---|---|
void |
drawFlippedImage(LLUIPainter.MicroUIGraphicsContext gc,
LLUIPainter.MicroUIImage img,
int regionX,
int regionY,
int width,
int height,
int x,
int y,
LLDWPainter.DrawingFlip flip,
int alpha)
Draws an image applying a flip (0, 90, 180 or 270 degrees with or without mirror).
|
void |
drawRotatedImageBilinear(LLUIPainter.MicroUIGraphicsContext gc,
LLUIPainter.MicroUIImage img,
int x,
int y,
int rotationX,
int rotationY,
float angle,
int alpha)
Draws an image applying a free rotation (0 to 360 degrees).
|
void |
drawRotatedImageNearestNeighbor(LLUIPainter.MicroUIGraphicsContext gc,
LLUIPainter.MicroUIImage img,
int x,
int y,
int rotationX,
int rotationY,
float angle,
int alpha)
Draws an image applying a free rotation (0 to 360 degrees).
|
void |
drawScaledImageBilinear(LLUIPainter.MicroUIGraphicsContext gc,
LLUIPainter.MicroUIImage img,
int x,
int y,
float factorX,
float factorY,
int alpha)
Draws an image applying a scaling.
|
void |
drawScaledImageNearestNeighbor(LLUIPainter.MicroUIGraphicsContext gc,
LLUIPainter.MicroUIImage img,
int x,
int y,
float factorX,
float factorY,
int alpha)
Draws an image applying a scaling.
|
void |
drawThickCircle(LLUIPainter.MicroUIGraphicsContext gc,
int x,
int y,
int diameter,
int thickness)
Draws a thick circle covering the square specified by its diameter.
|
void |
drawThickCircleArc(LLUIPainter.MicroUIGraphicsContext gc,
int x,
int y,
int diameter,
float startAngle,
float arcAngle,
int thickness)
Draws a thick arc covering the square specified by its diameter.
|
void |
drawThickEllipse(LLUIPainter.MicroUIGraphicsContext gc,
int x,
int y,
int width,
int height,
int thickness)
Draws a thick ellipse covering the specified rectangle.
|
void |
drawThickFadedCircle(LLUIPainter.MicroUIGraphicsContext gc,
int x,
int y,
int diameter,
int thickness,
int fade)
Draws a thick circle with fade covering the square specified by its diameter.
|
void |
drawThickFadedCircleArc(LLUIPainter.MicroUIGraphicsContext gc,
int x,
int y,
int diameter,
float startAngle,
float arcAngle,
int thickness,
int fade,
LLDWPainter.DrawingCap start,
LLDWPainter.DrawingCap end)
Draws a thick circle with fade arc covering the specified square.
|
void |
drawThickFadedEllipse(LLUIPainter.MicroUIGraphicsContext gc,
int x,
int y,
int width,
int height,
int thickness,
int fade)
Draws a thick ellipse with fade covering the specified rectangle.
|
void |
drawThickFadedLine(LLUIPainter.MicroUIGraphicsContext gc,
int x1,
int y1,
int x2,
int y2,
int thickness,
int fade,
LLDWPainter.DrawingCap start,
LLDWPainter.DrawingCap end)
Draws a thick line with fade between given points.
|
void |
drawThickFadedPoint(LLUIPainter.MicroUIGraphicsContext gc,
int x,
int y,
int thickness,
int fade)
Draws a thick point with fade at given position.
|
void |
drawThickLine(LLUIPainter.MicroUIGraphicsContext gc,
int x1,
int y1,
int x2,
int y2,
int thickness)
Draws a thick line between given points.
|
void drawFlippedImage(LLUIPainter.MicroUIGraphicsContext gc, LLUIPainter.MicroUIImage img, int regionX, int regionY, int width, int height, int x, int y, LLDWPainter.DrawingFlip flip, int alpha)
gc
- the MicroUI GraphicsContext target.img
- the MicroUI Image to draw.regionX
- the x coordinate of the upper-left corner of the region to draw.regionY
- the x coordinate of the upper-left corner of the region to draw.width
- the width of the region to copy.height
- the height of the region to copy.x
- the x coordinate of the top-left point in the destination.y
- the y coordinate of the top-left point in the destination.flip
- the flip to apply.alpha
- the opacity level to apply to the region.void drawRotatedImageBilinear(LLUIPainter.MicroUIGraphicsContext gc, LLUIPainter.MicroUIImage img, int x, int y, int rotationX, int rotationY, float angle, int alpha)
The rotation is specified by the center and the angle. The reference point is the graphical object top-left corner. The rotation point is relative where the graphical object will be drawn.
This method uses the bilinear algorithm to render the content. This algorithm performs better rendering than nearest neighbor algorithm but it is slower to apply.
gc
- the MicroUI GraphicsContext target.img
- the MicroUI Image to draw.x
- the x coordinate of the image reference anchor top-left point.y
- the y coordinate of the image reference anchor top-left point.rotationX
- the x coordinate of the rotation center.rotationY
- the y coordinate of the rotation center.angle
- the rotation angle.alpha
- the opacity level to apply to the region.void drawRotatedImageNearestNeighbor(LLUIPainter.MicroUIGraphicsContext gc, LLUIPainter.MicroUIImage img, int x, int y, int rotationX, int rotationY, float angle, int alpha)
The rotation is specified by the center and the angle. The reference point is the graphical object top-left corner. The rotation point is relative where the graphical object will be drawn.
This method uses the nearest neighbor algorithm to render the content. This algorithm is faster than bilinear algorithm but its rendering is faster.
gc
- the MicroUI GraphicsContext target.img
- the MicroUI Image to draw.x
- the x coordinate of the image reference anchor top-left point.y
- the y coordinate of the image reference anchor top-left point.rotationX
- the x coordinate of the rotation center.rotationY
- the y coordinate of the rotation center.angle
- the rotation angle.alpha
- the opacity level to apply to the region.void drawScaledImageBilinear(LLUIPainter.MicroUIGraphicsContext gc, LLUIPainter.MicroUIImage img, int x, int y, float factorX, float factorY, int alpha)
This method uses the bilinear algorithm to render the content. This algorithm performs better rendering than nearest neighbor algorithm but it is slower to apply.
gc
- the MicroUI GraphicsContext target.img
- the MicroUI Image to draw.x
- the x coordinate of the image reference anchor top-left point.y
- the y coordinate of the image reference anchor top-left point.factorX
- scaling X factor.factorY
- scaling Y factor.alpha
- the opacity level to apply to the region.void drawScaledImageNearestNeighbor(LLUIPainter.MicroUIGraphicsContext gc, LLUIPainter.MicroUIImage img, int x, int y, float factorX, float factorY, int alpha)
This method uses the nearest neighbor algorithm to render the content. This algorithm is faster than bilinear algorithm but its rendering is faster.
gc
- the MicroUI GraphicsContext target.img
- the MicroUI Image to draw.x
- the x coordinate of the image reference anchor top-left point.y
- the y coordinate of the image reference anchor top-left point.factorX
- scaling X factor.factorY
- scaling Y factor.alpha
- the opacity level to apply to the region.void drawThickCircle(LLUIPainter.MicroUIGraphicsContext gc, int x, int y, int diameter, int thickness)
If diameter is negative or zero, nothing is drawn.
gc
- the MicroUI GraphicsContext target.x
- the x coordinate of the upper-left corner of the square where the circle is drawny
- the y coordinate of the upper-left corner of the square where the circle is drawndiameter
- the diameter of the circle to drawthickness
- the circle thickness.void drawThickCircleArc(LLUIPainter.MicroUIGraphicsContext gc, int x, int y, int diameter, float startAngle, float arcAngle, int thickness)
The arc is drawn from startAngle up to arcAngle degrees. The center of the arc is defined as the center of the square whose origin is at (x,y) (upper-left corner) and whose dimension is given by diameter.
Angles are interpreted such that 0 degrees is at the 3 o'clock position. A positive value indicates a counter-clockwise rotation while a negative value indicates a clockwise rotation.
If diameter is negative, nothing is drawn.
gc
- the MicroUI GraphicsContext target.x
- the x coordinate of the upper-left corner of the square where the arc is drawny
- the y coordinate of the upper-left corner of the square where the arc is drawndiameter
- the diameter of the circle to drawstartAngle
- the beginning angle of the arc to drawarcAngle
- the angular extent of the arc from startAnglethickness
- the arc thickness.void drawThickEllipse(LLUIPainter.MicroUIGraphicsContext gc, int x, int y, int width, int height, int thickness)
The center of the ellipse is defined as the center of the rectangle whose origin is at (x,y) (upper-left corner) and whose dimension is given by width and height.
If either width or height is negative or zero, nothing is drawn.
gc
- the MicroUI GraphicsContext target.x
- the x coordinate of the upper-left corner of the rectangle where the ellipse is drawny
- the y coordinate of the upper-left corner of the rectangle where the ellipse is drawnwidth
- the width of the ellipse to drawheight
- the height of the ellipse to drawthickness
- the ellipse thickness.void drawThickFadedCircle(LLUIPainter.MicroUIGraphicsContext gc, int x, int y, int diameter, int thickness, int fade)
gc
- the MicroUI GraphicsContext target.x
- the x coordinate of the upper-left corner of the square where the circle is drawny
- the y coordinate of the upper-left corner of the square where the circle is drawndiameter
- the diameter of the circle to drawthickness
- the circle thickness.fade
- the fade to apply.void drawThickFadedCircleArc(LLUIPainter.MicroUIGraphicsContext gc, int x, int y, int diameter, float startAngle, float arcAngle, int thickness, int fade, LLDWPainter.DrawingCap start, LLDWPainter.DrawingCap end)
The center of the arc is defined as the center of the square whose origin is at (x,y) (upper-left corner) and whose dimension is given by diameter.
Angles are interpreted such that 0 degrees is at the 3 o'clock position. A positive value indicates a counter-clockwise rotation while a negative value indicates a clockwise rotation.
If diameter is negative or zero, nothing is drawn.
The angles are given relative to the square. For instance an angle of 45 degrees is always defined by the line from the center of the square to the upper right corner of the square. Thus for a non squared square angles are skewed along either height or width.
gc
- the MicroUI GraphicsContext target.x
- the x coordinate of the upper-left corner of the square where the arc is drawny
- the y coordinate of the upper-left corner of the square where the arc is drawndiameter
- the diameter of the circle to drawstartAngle
- the beginning angle of the arc to drawarcAngle
- the angular extent of the arc from startAnglethickness
- the arc thickness.fade
- the fade to apply.start
- cap representation of start of shapeend
- cap representation of end of shapevoid drawThickFadedEllipse(LLUIPainter.MicroUIGraphicsContext gc, int x, int y, int width, int height, int thickness, int fade)
The center of the ellipse is defined as the center of the rectangle whose origin is at (x,y) (upper-left corner) and whose dimension is given by width and height.
If either width or height is negative or zero, nothing is drawn.
gc
- the MicroUI GraphicsContext target.x
- the x coordinate of the upper-left corner of the rectangle where the ellipse is drawny
- the y coordinate of the upper-left corner of the rectangle where the ellipse is drawnwidth
- the width of the ellipse to drawheight
- the height of the ellipse to drawthickness
- the ellipse thickness.fade
- the fade to apply.void drawThickFadedLine(LLUIPainter.MicroUIGraphicsContext gc, int x1, int y1, int x2, int y2, int thickness, int fade, LLDWPainter.DrawingCap start, LLDWPainter.DrawingCap end)
gc
- the MicroUI GraphicsContext target.x1
- the x coordinate of the start of the liney1
- the y coordinate of the start of the linex2
- the x coordinate of the end of the liney2
- the y coordinate of the end of the linethickness
- the line thickness.fade
- the fade to apply.start
- cap representation of start of shapeend
- cap representation of end of shapevoid drawThickFadedPoint(LLUIPainter.MicroUIGraphicsContext gc, int x, int y, int thickness, int fade)
gc
- the MicroUI GraphicsContext target.x
- the point X coordinate.y
- the point Y coordinate.thickness
- the point thickness.fade
- the fade to apply.void drawThickLine(LLUIPainter.MicroUIGraphicsContext gc, int x1, int y1, int x2, int y2, int thickness)
gc
- the MicroUI GraphicsContext target.x1
- the x coordinate of the start of the liney1
- the y coordinate of the start of the linex2
- the x coordinate of the end of the liney2
- the y coordinate of the end of the linethickness
- the line thickness.