public interface LLVGEngine
LLUIDisplay for MicroVG: it provides some methods to map MicroVG byte arrays in MicroVG
Graphics Context objects, to manipulate MicroVG linear gradient, etc.
An instance of this framework is available via the Instance field. To use the framework methods, caller must
synchronize its calls on this Instance field.
| Modifier and Type | Field and Description |
|---|---|
static ej.microui.display.MicroUIImageFormat |
BUFFERED_VECTOR_IMAGE_FORMAT
Buffered Vector Image RAW format (same format is used in application library).
|
static int |
DEFAULT_LETTER_SPACING
Defines the letter spacing to use to let the vector font engine use the internal vector font's letter spacing.
|
static LLVGEngine |
Instance
Unique instance of MicroVG Engine.
|
static ej.microui.display.MicroUIFontFormat |
VECTOR_FONT_FORMAT
Vector Font format (same format is used in application library).
|
| Modifier and Type | Method and Description |
|---|---|
default void |
convertColorToColorToDraw(ej.microui.display.MicroUIGraphicsContext gc,
java.awt.geom.Rectangle2D bounds)
Truncates the pixels' colors of the given region to take in consideration the hardware display pixel
representation constraints.
|
int |
drawString(ej.microui.display.MicroUIGraphicsContext gc,
char[] string,
int face,
float size,
float x,
float y,
float[] matrix,
int blendMode,
VGPaint p,
float letterSpacing,
float radius,
int direction)
Decomposes a string in glyphs and draws them using the drawer for the given graphics context
(
VGDrawing.drawPath(MicroUIGraphicsContext, GeneralPath, float, float, float[], int, int, VGPaint). |
BufferedVectorImageDrawer |
getBufferedVectorImageDrawer()
Gets the buffered vector image drawer that can be used to draw in a buffered vector image.
|
java.awt.Composite |
getComposite(int blend)
Gets the AWT composite according to the MicroVG blend mode.
|
int |
getFillRule(int fillRule)
Gets the AWT fill rule according to the MicroVG fill rule.
|
VGDrawing |
getVGDrawer(ej.microui.display.MicroUIGraphicsContext gc)
Gets the drawer used to draw on the given graphics context.
|
VGDrawing |
getVGDrawer(ej.microui.display.MicroUIImageFormat format)
Gets the drawer used to draw with the given format.
|
VGPaint |
mapGradient(int[] gradient,
float[] gradientMatrix,
float[] globalMatrix,
int globalAlpha)
Maps a
VGPaint from the gradient's array, applying the gradient's transformation, the drawing's
transformation and the drawing's opacity. |
java.awt.geom.GeneralPath |
mapPath(byte[] path)
Maps an AWT general path on the MicroVG path array.
|
MicroVGImage |
mapVectorImage(byte[] sniContext)
Gets the unique image identifier from the SNI context.
|
void |
registerVGDrawer(VGDrawing drawer)
Registers a drawer that supports a specific format.
|
void |
setClip(java.awt.Graphics2D g2d,
ej.microui.display.MicroUIGraphicsContext gc,
java.awt.geom.GeneralPath path,
java.awt.geom.AffineTransform at)
Sets a clip; cannot be higher than master clip.
|
void |
unregisterVGDrawer(ej.microui.display.MicroUIImageFormat format)
Unregisters the drawer registered for the given format.
|
static final ej.microui.display.MicroUIImageFormat BUFFERED_VECTOR_IMAGE_FORMAT
static final ej.microui.display.MicroUIFontFormat VECTOR_FONT_FORMAT
static final int DEFAULT_LETTER_SPACING
static final LLVGEngine Instance
To use the framework methods, caller must synchronize its calls on this Instance field.
void registerVGDrawer(VGDrawing drawer)
drawer - the drawerVGDrawing.handledFormat()void unregisterVGDrawer(ej.microui.display.MicroUIImageFormat format)
format - the now unsupported formatVGDrawing.handledFormat()VGDrawing getVGDrawer(ej.microui.display.MicroUIGraphicsContext gc)
gc - the graphics context to draw onVGDrawing getVGDrawer(ej.microui.display.MicroUIImageFormat format)
format - the formatjava.awt.geom.GeneralPath mapPath(byte[] path)
path - the MicroVG pathVGPaint mapGradient(int[] gradient, float[] gradientMatrix, float[] globalMatrix, int globalAlpha)
VGPaint from the gradient's array, applying the gradient's transformation, the drawing's
transformation and the drawing's opacity.gradient - the gradient's arraygradientMatrix - the gradient's transformationglobalMatrix - the drawing's transformationglobalAlpha - the drawing's opacityMicroVGImage mapVectorImage(byte[] sniContext)
sniContext - the representation of the MicroVG imagenull if the image has been closedvoid setClip(java.awt.Graphics2D g2d,
ej.microui.display.MicroUIGraphicsContext gc,
java.awt.geom.GeneralPath path,
java.awt.geom.AffineTransform at)
g2d - Graphics2D drawing objectgc - MicroUI GraphicsContext where performing the drawingpath - the path to clip.at - the path transformationint getFillRule(int fillRule)
fillRule - a MicroVG fill rule (example: LLVGConstants.FILLTYPE_EVEN_ODDPath2D.WIND_EVEN_ODDjava.awt.Composite getComposite(int blend)
blend - a MicroVG blend mode (example: LLVGConstants.BLEND_SRCint drawString(ej.microui.display.MicroUIGraphicsContext gc,
char[] string,
int face,
float size,
float x,
float y,
float[] matrix,
int blendMode,
VGPaint p,
float letterSpacing,
float radius,
int direction)
VGDrawing.drawPath(MicroUIGraphicsContext, GeneralPath, float, float, float[], int, int, VGPaint).gc - the destinationstring - the array of characters to drawface - the font face to usesize - the font size, in pixelsx - the destination X coordinatey - the destination Y coordinatematrix - the deformation to applyblendMode - the blend modep - the color representation to useletterSpacing - the extra letter spacing to useradius - the radius of the circledirection - the direction of the text along the circleLLVGPainter.RETURN_SUCCESS on success or LLVGPainter.RESOURCE_CLOSED if the font is
closeddefault void convertColorToColorToDraw(ej.microui.display.MicroUIGraphicsContext gc,
java.awt.geom.Rectangle2D bounds)
gc - the target to updatebounds - the region to updateBufferedVectorImageDrawer getBufferedVectorImageDrawer()