public class LLDWPainter extends Object
The equivalent of embedded structures and enumerations are LLDWPainter.DrawingFlip
and LLDWPainter.DrawingCap
. They are used
to identify the kind of drawing. Additionally, these methods requires LLUIPainter.MicroUIImage
,
LLUIPainter.MicroUIGraphicsContext
and LLUIPainter.MicroUIImageFormat
classes.
The methods implementations follow the same rules than LLUIPainter
(main important thing is to use the
framework object LLUIDisplay.Instance
as monitor to synchronize drawings).
Modifier and Type | Class and Description |
---|---|
static class |
LLDWPainter.DrawingCap
Defines the start and end caps to draw when rendering an anti-aliased drawing.
|
static class |
LLDWPainter.DrawingFlip
Defines the transformation to apply when drawing an image with flip.
|
Modifier and Type | Method and Description |
---|---|
static void |
drawFlippedImage(byte[] target,
byte[] source,
int regionX,
int regionY,
int width,
int height,
int x,
int y,
int flip,
int alpha)
ej.drawing native "drawFlippedImage".
|
static void |
drawRotatedImageBilinear(byte[] target,
byte[] source,
int x,
int y,
int rotationX,
int rotationY,
float angle,
int alpha)
ej.drawing native "drawRotatedImageBilinear".
|
static void |
drawRotatedImageNearestNeighbor(byte[] target,
byte[] source,
int x,
int y,
int rotationX,
int rotationY,
float angle,
int alpha)
ej.drawing native "drawRotatedImageNearestNeighbor".
|
static void |
drawScaledImageBilinear(byte[] target,
byte[] source,
int x,
int y,
float factorX,
float factorY,
int alpha)
ej.drawing native "drawScaledImageBilinear".
|
static void |
drawScaledImageNearestNeighbor(byte[] target,
byte[] source,
int x,
int y,
float factorX,
float factorY,
int alpha)
ej.drawing native "drawScaledImageNearestNeighbor".
|
static void |
drawThickCircle(byte[] target,
int x,
int y,
int diameter,
int thickness)
ej.drawing native "drawThickCircle".
|
static void |
drawThickCircleArc(byte[] target,
int x,
int y,
int diameter,
float startAngle,
float arcAngle,
int thickness)
ej.drawing native "drawThickCircleArc".
|
static void |
drawThickEllipse(byte[] target,
int x,
int y,
int width,
int height,
int thickness)
ej.drawing native "drawThickEllipse".
|
static void |
drawThickFadedCircle(byte[] target,
int x,
int y,
int diameter,
int thickness,
int fade)
ej.drawing native "drawThickFadedCircle".
|
static void |
drawThickFadedCircleArc(byte[] target,
int x,
int y,
int diameter,
float startAngle,
float arcAngle,
int thickness,
int fade,
int start,
int end)
ej.drawing native "drawThickFadedCircleArc".
|
static void |
drawThickFadedEllipse(byte[] target,
int x,
int y,
int width,
int height,
int thickness,
int fade)
ej.drawing native "drawAAEllipse".
|
static void |
drawThickFadedLine(byte[] target,
int x1,
int y1,
int x2,
int y2,
int thickness,
int fade,
int start,
int end)
ej.drawing native "drawThickFadedLine".
|
static void |
drawThickFadedPoint(byte[] target,
int x,
int y,
int thickness,
int fade)
ej.drawing native "drawThickFadedPoint".
|
static void |
drawThickLine(byte[] target,
int x1,
int y1,
int x2,
int y2,
int thickness)
ej.drawing native "drawThickLine".
|
static DWDrawing |
getDrawer()
Returns the current drawer used by all implementation of ej.drawing native methods.
|
static void |
setDrawer(DWDrawing drawer)
Sets the given drawer as current drawer.
|
public static void drawFlippedImage(byte[] target, byte[] source, int regionX, int regionY, int width, int height, int x, int y, int flip, int alpha)
target
- drawing destination target: a byte array to map on a LLUIPainter.MicroUIGraphicsContext
.source
- image source: a byte array to map on a LLUIPainter.MicroUIImage
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.public static void drawRotatedImageBilinear(byte[] target, byte[] source, 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.
target
- drawing destination target: a byte array to map on a LLUIPainter.MicroUIGraphicsContext
.source
- image source: a byte array to map on a LLUIPainter.MicroUIImage
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.public static void drawRotatedImageNearestNeighbor(byte[] target, byte[] source, 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.
target
- drawing destination target: a byte array to map on a LLUIPainter.MicroUIGraphicsContext
.source
- image source: a byte array to map on a LLUIPainter.MicroUIImage
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.public static void drawScaledImageBilinear(byte[] target, byte[] source, 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.
target
- drawing destination target: a byte array to map on a LLUIPainter.MicroUIGraphicsContext
.source
- image source: a byte array to map on a LLUIPainter.MicroUIImage
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.public static void drawScaledImageNearestNeighbor(byte[] target, byte[] source, 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.
target
- drawing destination target: a byte array to map on a LLUIPainter.MicroUIGraphicsContext
.source
- image source: a byte array to map on a LLUIPainter.MicroUIImage
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.public static void drawThickCircle(byte[] target, int x, int y, int diameter, int thickness)
If diameter is negative or zero, nothing is drawn.
target
- drawing destination target: a byte array to map on a LLUIPainter.MicroUIGraphicsContext
.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.public static void drawThickCircleArc(byte[] target, 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.
target
- drawing destination target: a byte array to map on a LLUIPainter.MicroUIGraphicsContext
.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.public static void drawThickEllipse(byte[] target, 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.
target
- drawing destination target: a byte array to map on a LLUIPainter.MicroUIGraphicsContext
.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 drawnwidth
- the width of the ellipse to drawheight
- the height of the ellipse to drawthickness
- the circle thickness.public static void drawThickFadedCircle(byte[] target, int x, int y, int diameter, int thickness, int fade)
target
- drawing destination target: a byte array to map on a LLUIPainter.MicroUIGraphicsContext
.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.public static void drawThickFadedCircleArc(byte[] target, int x, int y, int diameter, float startAngle, float arcAngle, int thickness, int fade, int start, int 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.
target
- drawing destination target: a byte array to map on a LLUIPainter.MicroUIGraphicsContext
.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 shapepublic static void drawThickFadedEllipse(byte[] target, 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.
target
- drawing destination target: a byte array to map on a LLUIPainter.MicroUIGraphicsContext
.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.public static void drawThickFadedLine(byte[] target, int x1, int y1, int x2, int y2, int thickness, int fade, int start, int end)
target
- drawing destination target: a byte array to map on a LLUIPainter.MicroUIGraphicsContext
.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 shapepublic static void drawThickFadedPoint(byte[] target, int x, int y, int thickness, int fade)
target
- drawing destination target: a byte array to map on a LLUIPainter.MicroUIGraphicsContext
.x
- the point X coordinate.y
- the point Y coordinate.thickness
- the point thickness.fade
- the fade to apply.public static void drawThickLine(byte[] target, int x1, int y1, int x2, int y2, int thickness)
target
- drawing destination target: a byte array to map on a LLUIPainter.MicroUIGraphicsContext
.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.public static DWDrawing getDrawer()
public static void setDrawer(DWDrawing drawer)
The drawer has the responsibility to check the clip (draw outside current clip is forbidden) and has to update
the new Display.flush()
area (dirty area) as mentioned in LLUIPainter
class comment.
Default drawer is the MicroUI graphical engine's internal software drawer.
drawer
- the new drawer to use or null to use the MicroUI graphical engine's internal software drawer.