public class Nvg_lite
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
VG_LITE_BLEND_ADDITIVE
Blending mode: "S + D"
|
static int |
VG_LITE_BLEND_DST_IN
Blending mode: "Sa * D"
|
static int |
VG_LITE_BLEND_DST_OVER
Blending mode: "(1 - Da) * S + D"
|
static int |
VG_LITE_BLEND_MULTIPLY
Blending mode: "S * (1 - Da) + D * (1 - Sa) + S * D"
|
static int |
VG_LITE_BLEND_NONE
Blending mode: "S, i.e.
|
static int |
VG_LITE_BLEND_SCREEN
Blending mode: "S + D - S * D"
|
static int |
VG_LITE_BLEND_SRC_IN
Blending mode: "Da * S"
|
static int |
VG_LITE_BLEND_SRC_OVER
Blending mode: "S + (1 - Sa) * D"
|
static int |
VG_LITE_BLEND_SUBTRACT
Blending mode: "D * (1 - S)"
|
static int |
VG_LITE_FILL_EVEN_ODD
Even-odd fill rule.
|
static int |
VG_LITE_FILL_NON_ZERO
Non-zero fill rule.
|
Constructor and Description |
---|
Nvg_lite() |
Modifier and Type | Method and Description |
---|---|
static int |
getDisplayColor(int color)
Convert RGB color to RGB color corresponding to the display configuration.
|
static int |
vg_lite_draw_gradient(byte[] gcArray,
float pathLeft,
float pathTop,
float pathRight,
float pathBottom,
byte[] path,
int pathOffset,
int pathLength,
int pathQuality,
int pathFormat,
int fillRule,
int matrixHandle,
int gradientHandle,
int blend)
Fill a path with a gradient pattern.
|
static int |
vg_lite_draw_path(byte[] sd,
float pathLeft,
float pathTop,
float pathRight,
float pathBottom,
byte[] path,
int pathOffset,
int pathLength,
int pathQuality,
int pathFormat,
int fillRule,
int matrixHandle,
int blend,
int color)
Draw a path to a target buffer.
|
static int |
vg_lite_init_grad(int handle)
Initializes the gradient to its default settings.
|
static int |
vg_lite_set_grad(int handle,
int count,
int[] colors,
int[] stops)
Sets the values for the members of the gradient definition.
|
static int |
vg_lite_update_grad(int handle)
Updates or generates the corresponding gradient to render with.
|
public static final int VG_LITE_FILL_NON_ZERO
For drawing any path, the hardware supports both non-zero and odd-even fill rules.
To determine whether any point is contained inside an object, imagine drawing a line from that point out to infinity in any direction such that the line does not cross any vertex of the path. For each edge that is crossed by the line, add 1 to the counter if the edge crosses from left to right, as seen by an observer walking across the line towards infinity, and subtract 1 if the edge crosses from right to left. In this way, each region of the plane will receive an integer value.
The non-zero fill rule says that a point is inside the shape if the resulting sum is not equal to zero. The even/odd rule says that a point is inside the shape if the resulting sum is odd, regardless of sign. See
public static final int VG_LITE_FILL_EVEN_ODD
VG_LITE_FILL_NON_ZERO
,
Constant Field Valuespublic static final int VG_LITE_BLEND_NONE
Some of the VGLite API functions calls support blending. S and D represent source and destination color channels and Sa and Da represent the source and destination alpha channels.
public static final int VG_LITE_BLEND_SRC_OVER
VG_LITE_BLEND_NONE
,
Constant Field Valuespublic static final int VG_LITE_BLEND_DST_OVER
VG_LITE_BLEND_NONE
,
Constant Field Valuespublic static final int VG_LITE_BLEND_SRC_IN
VG_LITE_BLEND_NONE
,
Constant Field Valuespublic static final int VG_LITE_BLEND_DST_IN
VG_LITE_BLEND_NONE
,
Constant Field Valuespublic static final int VG_LITE_BLEND_SCREEN
VG_LITE_BLEND_NONE
,
Constant Field Valuespublic static final int VG_LITE_BLEND_MULTIPLY
VG_LITE_BLEND_NONE
,
Constant Field Valuespublic static final int VG_LITE_BLEND_ADDITIVE
VG_LITE_BLEND_NONE
,
Constant Field Valuespublic static final int VG_LITE_BLEND_SUBTRACT
VG_LITE_BLEND_NONE
,
Constant Field Valuespublic static int vg_lite_draw_path(byte[] sd, float pathLeft, float pathTop, float pathRight, float pathBottom, byte[] path, int pathOffset, int pathLength, int pathQuality, int pathFormat, int fillRule, int matrixHandle, int blend, int color)
The specified path will be transformed by the given matrix and drawn into the specified target buffer using the supplied color. Blending can be specified.
See vg_lite_draw_path
C function. Target buffer is managed in C.
sd
- The byte array where to draw.pathLeft
- The path to draw bounding_box left coordinate.pathTop
- The path to draw bounding_box top coordinate.pathRight
- The path to draw bounding_box right coordinate.pathBottom
- The path to draw bounding_box bottom coordinate.path
- Array containing the physical description of the path.pathOffset
- The start index in the path array.pathLength
- Number of bytes in the path data.pathQuality
- Quality hint for the path.pathFormat
- Coordinate format.fillRule
- Fill rule for the path: VG_LITE_FILL_NON_ZERO
or VG_LITE_FILL_EVEN_ODD
.matrixHandle
- The matrix that defines the transformation matrix of the path.blend
- The blending mode to be applied to each drawn pixel. If no blending is required, set this value to
VG_LITE_BLEND_NONE
.color
- The color is formed using 8-bit ARGB channels. The blue channel is in the lower 8-bit of the color
value, followed by the green and red channels. The alpha channel is in the upper 8-bit of the color
value.public static int vg_lite_draw_gradient(byte[] gcArray, float pathLeft, float pathTop, float pathRight, float pathBottom, byte[] path, int pathOffset, int pathLength, int pathQuality, int pathFormat, int fillRule, int matrixHandle, int gradientHandle, int blend)
The specified path will be transformed by the given matrix and filled by the tranformed gradient pattern.
See vg_lite_draw_gradient
C function. Target buffer is managed in C.
gcArray
- The byte array where to draw.pathLeft
- The path to draw bounding_box left coordinate.pathTop
- The path to draw bounding_box top coordinate.pathRight
- The path to draw bounding_box right coordinate.pathBottom
- The path to draw bounding_box bottom coordinate.path
- Array containing the physical description of the path.pathOffset
- The start index in the path array.pathLength
- Number of bytes in the path data.pathQuality
- Quality hint for the path.pathFormat
- Coordinate format.fillRule
- Fill rule for the path: VG_LITE_FILL_NON_ZERO
or VG_LITE_FILL_EVEN_ODD
.matrixHandle
- The matrix that defines the transformation matrix of the path.gradientHandle
- The gradient that will be filled the path with.blend
- The blending mode to be applied to each drawn pixel. If no blending is required, set this value to
VG_LITE_BLEND_NONE
.public static int vg_lite_init_grad(int handle)
See vg_lite_init_grad
C function.
handle
- gradient to initializepublic static int vg_lite_set_grad(int handle, int count, int[] colors, int[] stops)
See vg_lite_set_grad
C function.
handle
- gradient to setcount
- The count of the colors in gradient.colors
- A color is formed using 8-bit ARGB channels. The blue channel is in the lower 8-bit of the color
value, followed by the green and red channels. The alpha channel is in the upper 8-bit of the color
value.stops
- Numbers ranging from 0 to 255 specifying the distribution of colors along the gradient.public static int vg_lite_update_grad(int handle)
The gradient has an internal buffer which is used to render the gradient pattern. The buffer will be created/updated by the corresponding gradient parameters.
See vg_lite_update_grad
C function.
handle
- gradient to updatepublic static int getDisplayColor(int color)
color
- RGB color code to convert.