public interface UIDrawing
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
ui_drawing_soft.h
. See LLUIDisplay.getUIDrawerSoftware()
.
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 UIDrawing.UIDrawingDefault
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 MicroUI graphical engine's internal software drawer.
Modifier and Type | Interface and Description |
---|---|
static interface |
UIDrawing.UIDrawingDefault
Default implementation of
UIDrawing which uses the MicroUI graphical engine's internal software drawer to
perform all drawings. |
Modifier and Type | Method and Description |
---|---|
void |
drawCircle(LLUIPainter.MicroUIGraphicsContext gc,
int x,
int y,
int diameter)
Draws a circle covering the square defined by top-left point x,y (included) and bottom-right point
x+diameter-1,y+diameter-1 (included).
|
void |
drawCircleArc(LLUIPainter.MicroUIGraphicsContext gc,
int x,
int y,
int diameter,
float startAngle,
float arcAngle)
Draws a circular arc covering the square defined by top-left point x,y (included) and bottom-right point
x+diameter-1,y+diameter-1 (included).
|
void |
drawEllipse(LLUIPainter.MicroUIGraphicsContext gc,
int x,
int y,
int width,
int height)
Draws an ellipse covering the rectangle defined by top-left point x,y (included) and bottom-right point
x+width-1,y+height-1 (included).
|
void |
drawEllipseArc(LLUIPainter.MicroUIGraphicsContext gc,
int x,
int y,
int width,
int height,
float startAngle,
float arcAngle)
Draws an elliptical arc covering the rectangle defined by top-left point x,y (included) and bottom-right point
x+width-1,y+height-1 (included) .
|
void |
drawHorizontalLine(LLUIPainter.MicroUIGraphicsContext gc,
int x1,
int x2,
int y)
Draws a horizontal line at between points x1,y (included) and x2,y (included).
|
void |
drawImage(LLUIPainter.MicroUIGraphicsContext gc,
LLUIPainter.MicroUIImage img,
int regionX,
int regionY,
int width,
int height,
int x,
int y,
int alpha)
Draws a region of an image.
|
void |
drawLine(LLUIPainter.MicroUIGraphicsContext gc,
int x1,
int y1,
int x2,
int y2)
Draws a line at between points x1,y1 (included) and x2,y2 (included).
|
void |
drawRectangle(LLUIPainter.MicroUIGraphicsContext gc,
int x1,
int y1,
int x2,
int y2)
Draws a rectangle at from top-left point x1,y1 (included) and bottom-right point x2,y2 (included).
|
void |
drawRoundedRectangle(LLUIPainter.MicroUIGraphicsContext gc,
int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
Draws a rounded rectangle at from top-left point x,y (included) and bottom-right point x+width-1,y+height-1
(included).
|
void |
drawVerticalLine(LLUIPainter.MicroUIGraphicsContext gc,
int x,
int y1,
int y2)
Draws a vertical line at between points x,y1 (included) and x,y2 (included).
|
void |
fillCircle(LLUIPainter.MicroUIGraphicsContext gc,
int x,
int y,
int diameter)
Fills a circle covering the square defined by top-left point x,y (included) and bottom-right point
x+diameter-1,y+diameter-1 (included).
|
void |
fillCircleArc(LLUIPainter.MicroUIGraphicsContext gc,
int x,
int y,
int diameter,
float startAngle,
float arcAngle)
Fills a circular arc covering the square defined by top-left point x,y (included) and bottom-right point
x+diameter-1,y+diameter-1 (included).
|
void |
fillEllipse(LLUIPainter.MicroUIGraphicsContext gc,
int x,
int y,
int width,
int height)
Fills an ellipse covering the rectangle defined by top-left point x,y (included) and bottom-right point
x+width-1,y+height-1 (included).
|
void |
fillEllipseArc(LLUIPainter.MicroUIGraphicsContext gc,
int x,
int y,
int width,
int height,
float startAngle,
float arcAngle)
Fills an arc covering the rectangle defined by top-left point x,y (included) and bottom-right point
x+width-1,y+height-1 (included).
|
void |
fillRectangle(LLUIPainter.MicroUIGraphicsContext gc,
int x1,
int y1,
int x2,
int y2)
Fills a rectangle at from top-left point x1,y1 (included) and bottom-right point x2,y2 (included).
|
void |
fillRoundedRectangle(LLUIPainter.MicroUIGraphicsContext gc,
int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
Fills a rounded rectangle at from top-left point x,y (included) and bottom-right point x+width-1,y+height-1
(included).
|
void |
writePixel(LLUIPainter.MicroUIGraphicsContext gc,
int x,
int y)
Draws a pixel at given position.
|
void drawCircle(LLUIPainter.MicroUIGraphicsContext gc, int x, int y, int diameter)
If the given diameter is negative or zero, nothing is drawn.
gc
- the MicroUI GraphicsContext target.x
- the top-left pixel X coordinate.y
- the top-left pixel Y coordinate.diameter
- the circle square size.void drawCircleArc(LLUIPainter.MicroUIGraphicsContext gc, int x, int y, int diameter, float startAngle, float arcAngle)
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 either the given diameter is negative or zero, or if arcAngle is 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.
gc
- the MicroUI GraphicsContext target.x
- the top-left pixel X coordinate.y
- the top-left pixel Y coordinate.diameter
- the diameter of the arc to draw.startAngle
- the beginning angle of the arc to drawarcAngle
- the angular extent of the arc from startAnglevoid drawEllipse(LLUIPainter.MicroUIGraphicsContext gc, int x, int y, int width, int height)
If either the given width or height is negative or zero, nothing is drawn.
gc
- the MicroUI GraphicsContext target.x
- the top-left pixel X coordinate.y
- the top-left pixel Y coordinate.width
- the ellipse width.height
- the ellipse height.void drawEllipseArc(LLUIPainter.MicroUIGraphicsContext gc, int x, int y, int width, int height, float startAngle, float arcAngle)
The arc is drawn from startAngle up to arcAngle degrees. The center of the arc 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.
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 either the given width or height is negative or zero, or if arcAngle is zero, nothing is drawn.
The angles are given relative to the rectangle. For instance an angle of 45 degrees is always defined by the line from the center of the rectangle to the upper right corner of the rectangle. Thus for a non squared rectangle angles are skewed along either height or width.
gc
- the MicroUI GraphicsContext target.x
- the top-left pixel X coordinate.y
- the top-left pixel Y coordinate.width
- the rectangle width.height
- the rectangle height.startAngle
- the beginning angle of the arc to drawarcAngle
- the angular extent of the arc from startAnglevoid drawHorizontalLine(LLUIPainter.MicroUIGraphicsContext gc, int x1, int x2, int y)
gc
- the MicroUI GraphicsContext target.x1
- the first pixel line X coordinate.x2
- the last pixel line X coordinate.y
- the both pixels line Y coordinate.void drawImage(LLUIPainter.MicroUIGraphicsContext gc, LLUIPainter.MicroUIImage img, int regionX, int regionY, int width, int height, int x, int y, int alpha)
If the specified source region exceeds the image bounds, the copied region is limited to the image boundary. If the copied region goes out of the bounds of the graphics context area, pixels out of the range will not be drawn.
A global opacity value is given. When this value is 0xff (255, opaque), that means the image is drawn on the graphics context without managing an extra opacity. Only the image transparent pixels must have been merged with destination. All image opaque pixels override destination.
When this value is a value between 0 and 0xff, that means each pixel of the image must be merged with destination in addition with the image transparent pixels. An image opaque pixel becomes transparent (its opacity is the given alpha) and the opacity of an image transparent pixel becomes (alpha * alpha(pixel)) / 255.
gc
- the MicroUI GraphicsContext target.img
- the MicroUI Image to draw.regionX
- the x coordinate of the upper-left corner of the region to copy.regionY
- the x coordinate of the upper-left corner of the region to copy.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.alpha
- the opacity level to apply to the region.void drawLine(LLUIPainter.MicroUIGraphicsContext gc, int x1, int y1, int x2, int y2)
gc
- drawing destination target.x1
- the first pixel line X coordinate.y1
- the first pixel line Y coordinate.x2
- the last pixel line X coordinate.y2
- the last pixel line Y coordinate.void drawRectangle(LLUIPainter.MicroUIGraphicsContext gc, int x1, int y1, int x2, int y2)
gc
- the MicroUI GraphicsContext target.x1
- the top-left pixel X coordinate.y1
- the top-left pixel Y coordinate.x2
- the bottom-right pixel X coordinate.y2
- the top-right pixel Y coordinate.void drawRoundedRectangle(LLUIPainter.MicroUIGraphicsContext gc, int x, int y, int width, int height, int arcWidth, int arcHeight)
gc
- the MicroUI GraphicsContext target.x
- the top-left pixel X coordinate.y
- the top-left pixel Y coordinate.width
- the rectangle width.height
- the rectangle height.arcWidth
- the horizontal diameter of the arc at the corners.arcHeight
- the vertical diameter of the arc at the corners.void drawVerticalLine(LLUIPainter.MicroUIGraphicsContext gc, int x, int y1, int y2)
gc
- the MicroUI GraphicsContext target.x
- the both pixels line X coordinate.y1
- the first pixel line Y coordinate.y2
- the last pixel line Y coordinate.void fillCircle(LLUIPainter.MicroUIGraphicsContext gc, int x, int y, int diameter)
If the given diameter is negative or zero, nothing is drawn.
gc
- the MicroUI GraphicsContext target.x
- the top-left pixel X coordinate.y
- the top-left pixel Y coordinate.diameter
- the circle square size.void fillCircleArc(LLUIPainter.MicroUIGraphicsContext gc, int x, int y, int diameter, float startAngle, float arcAngle)
gc
- the MicroUI GraphicsContext target.x
- the top-left pixel X coordinate.y
- the top-left pixel Y coordinate.diameter
- the diameter of the arc to draw.startAngle
- the beginning angle of the arc to drawarcAngle
- the angular extent of the arc from startAnglevoid fillEllipse(LLUIPainter.MicroUIGraphicsContext gc, int x, int y, int width, int height)
If either the given width or height is negative or zero, nothing is drawn.
gc
- the MicroUI GraphicsContext target.x
- the top-left pixel X coordinate.y
- the top-left pixel Y coordinate.width
- the ellipse width.height
- the ellipse height.void fillEllipseArc(LLUIPainter.MicroUIGraphicsContext gc, int x, int y, int width, int height, float startAngle, float arcAngle)
The arc is drawn from startAngle up to arcAngle degrees. The center of the arc 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.
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 either the given width or height is negative or zero, or if arcAngle is zero, nothing is drawn.
The angles are given relative to the rectangle. For instance an angle of 45 degrees is always defined by the line from the center of the rectangle to the upper right corner of the rectangle. Thus for a non squared rectangle angles are skewed along either height or width.
gc
- the MicroUI GraphicsContext target.x
- the top-left pixel X coordinate.y
- the top-left pixel Y coordinate.width
- the rectangle width.height
- the rectangle height.startAngle
- the beginning angle of the arc to drawarcAngle
- the angular extent of the arc from startAnglevoid fillRectangle(LLUIPainter.MicroUIGraphicsContext gc, int x1, int y1, int x2, int y2)
gc
- drawing destination target.x1
- the top-left pixel X coordinate.y1
- the top-left pixel Y coordinate.x2
- the bottom-right pixel X coordinate.y2
- the top-right pixel Y coordinate.void fillRoundedRectangle(LLUIPainter.MicroUIGraphicsContext gc, int x, int y, int width, int height, int arcWidth, int arcHeight)
gc
- the MicroUI GraphicsContext target.x
- the top-left pixel X coordinate.y
- the top-left pixel Y coordinate.width
- the rectangle width.height
- the rectangle height.arcWidth
- the horizontal diameter of the arc at the corners.arcHeight
- the vertical diameter of the arc at the corners.void writePixel(LLUIPainter.MicroUIGraphicsContext gc, int x, int y)
gc
- drawing destination target.x
- the pixel X coordinate.y
- the pixel Y coordinate.