|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface VG10
Contains the BlackBerry Java™ programming language bindings for OpenVG® 1.0 core functionality.
OpenVG documentation is available at the Khronos web site.
OpenVG provides a drawing model similar to other two-dimensional drawing APIs and formats, such as Adobe PostScript®, PDF, Flash; Sun Microsystems Java2D, and SVG. It is designed to support all drawing features required by a SVG Tiny 1.2 renderer and, additionally, to support functions that may be useful for implementing an SVG Basic renderer.
Where possible, the syntax of OpenVG is intended to be similar to that of OpenGL,
to make learning OpenVG as easy as possible for OpenGL developers.
Most of the OpenVG state is encapsulated in a set of primitive-valued variables
that are manipulated using the vgSet
and vgGet
functions.
Extensions may add new state variables to add new features to the pipeline without needing to
add new functions.
The easiest way to start using OpenVG on BlackBerry is VGField
.
It greatly simplifies EGL initialization and management.
In order to initialize EGL and use OpenVG, it is necessary to pass javax.microedition.khronos.egl.EGL12#EGL_OPENVG_BIT
as the
javax.microedition.khronos.egl.EGL12#EGL_RENDERABLE_TYPE
when calling
EGL10.eglChooseConfig(EGLDisplay, int[], EGLConfig[], int, int[])
.
EGL12 egl = (EGL12)EGLContext.getEGL(); EGLDisplay display = egl.eglGetDisplay(Displays.getPrimaryDisplay()); if (egl.eglGetError() != EGL10.EGL_SUCCESS) throw new RuntimeException(); int[] version = new int[2]; egl.eglInitialize(display, version); if (egl.eglGetError() != EGL10.EGL_SUCCESS) throw new RuntimeException(); int[] attribs = { EGL11.EGL_RED_SIZE, 8, EGL11.EGL_GREEN_SIZE, 8, EGL11.EGL_BLUE_SIZE, 8, EGL11.EGL_ALPHA_SIZE, 8, EGL11.EGL_SURFACE_TYPE, EGL10.EGL_WINDOW_BIT, EGL12.EGL_RENDERABLE_TYPE, EGL12.EGL_OPENVG_BIT, EGL11.EGL_NONE }; EGLConfig[] configs = new EGLConfig[1]; int[] num_configs = new int[1]; egl.eglChooseConfig(display, attribs, configs, 1, num_configs); if (egl.eglGetError() != EGL10.EGL_SUCCESS) throw new RuntimeException(); EGLConfig config = configs[0];
// Bind to the OpenVG API egl.eglBindAPI(EGL12.EGL_OPENVG_API); if (egl.eglGetError() != EGL10.EGL_SUCCESS) throw new RuntimeException(); // Create the supporting OpenVG EGLContext context = egl.eglCreateContext(display, config, EGL11.EGL_NO_CONTEXT, null); if (egl.eglGetError() != EGL10.EGL_SUCCESS) throw new RuntimeException(); // Get the OpenVG interface. VG11 vg = (VG11)VGUtils.getVG(context);
VG10.vgGetError()
to query the VG Error code.
Unless otherwise specified, any value returned from a function following an error is undefined.
VG10.vgGetError()
returns the oldest error code provided by an API call on the current context since the previous call to VG10.vgGetError()
on that context
(or since the creation of the context). No error is indicated by a return value of 0 (VG10.VG_NO_ERROR
). After the call, the error code is cleared to 0.
The possible errors that may be generated by each OpenVG function (apart from VG10.VG_OUT_OF_MEMORY_ERROR
) are shown below the definition of the function.
Refer to the OpenVG documentation at the Khronos website for more information about OpenVG errors.
VGUtils
,
EGL12
,
VGField
Field Summary | ||
---|---|---|
static int |
VG_ABSOLUTE
OpenVG 1.0 constant. |
|
static int |
VG_ALPHA
OpenVG 1.0 constant. |
|
static int |
VG_A_8
OpenVG 1.0 constant. |
|
static int |
VG_BAD_HANDLE_ERROR
OpenVG 1.0 constant. |
|
static int |
VG_BLEND_ADDITIVE
OpenVG 1.0 constant. |
|
static int |
VG_BLEND_DARKEN
OpenVG 1.0 constant. |
|
static int |
VG_BLEND_DST_IN
OpenVG 1.0 constant. |
|
static int |
VG_BLEND_DST_OVER
OpenVG 1.0 constant. |
|
static int |
VG_BLEND_LIGHTEN
OpenVG 1.0 constant. |
|
static int |
VG_BLEND_MODE
OpenVG 1.0 constant. |
|
static int |
VG_BLEND_MULTIPLY
OpenVG 1.0 constant. |
|
static int |
VG_BLEND_SCREEN
OpenVG 1.0 constant. |
|
static int |
VG_BLEND_SRC
OpenVG 1.0 constant. |
|
static int |
VG_BLEND_SRC_IN
OpenVG 1.0 constant. |
|
static int |
VG_BLEND_SRC_OVER
OpenVG 1.0 constant. |
|
static int |
VG_BLUE
OpenVG 1.0 constant. |
|
static int |
VG_BW_1
OpenVG 1.0 constant. |
|
static int |
VG_CAP_BUTT
OpenVG 1.0 constant. |
|
static int |
VG_CAP_ROUND
OpenVG 1.0 constant. |
|
static int |
VG_CAP_SQUARE
OpenVG 1.0 constant. |
|
static int |
VG_CLEAR_COLOR
OpenVG 1.0 constant. |
|
static int |
VG_CLEAR_MASK
OpenVG 1.0 constant. |
|
static byte |
VG_CLOSE_PATH
OpenVG 1.0 constant. |
|
static int |
VG_COLOR_RAMP_SPREAD_PAD
OpenVG 1.0 constant. |
|
static int |
VG_COLOR_RAMP_SPREAD_REFLECT
OpenVG 1.0 constant. |
|
static int |
VG_COLOR_RAMP_SPREAD_REPEAT
OpenVG 1.0 constant. |
|
static byte |
VG_CUBIC_TO
OpenVG 1.0 constant. |
|
static byte |
VG_CUBIC_TO_ABS
OpenVG 1.0 constant. |
|
static byte |
VG_CUBIC_TO_REL
OpenVG 1.0 constant. |
|
static int |
VG_DRAW_IMAGE_MULTIPLY
OpenVG 1.0 constant. |
|
static int |
VG_DRAW_IMAGE_NORMAL
OpenVG 1.0 constant. |
|
static int |
VG_DRAW_IMAGE_STENCIL
OpenVG 1.0 constant. |
|
static int |
VG_EVEN_ODD
OpenVG 1.0 constant. |
|
static int |
VG_EXTENSIONS
OpenVG 1.0 constant. |
|
static int |
VG_FALSE
OpenVG 1.0 constant. |
|
static int |
VG_FILL_MASK
OpenVG 1.0 constant. |
|
static int |
VG_FILL_PATH
OpenVG 1.0 constant. |
|
static int |
VG_FILL_RULE
OpenVG 1.0 constant. |
|
static int |
VG_FILTER_CHANNEL_MASK
OpenVG 1.0 constant. |
|
static int |
VG_FILTER_FORMAT_LINEAR
OpenVG 1.0 constant. |
|
static int |
VG_FILTER_FORMAT_PREMULTIPLIED
OpenVG 1.0 constant. |
|
static int |
VG_GREEN
OpenVG 1.0 constant. |
|
static int |
VG_HARDWARE_ACCELERATED
OpenVG 1.0 constant. |
|
static int |
VG_HARDWARE_UNACCELERATED
OpenVG 1.0 constant. |
|
static byte |
VG_HLINE_TO
OpenVG 1.0 constant. |
|
static byte |
VG_HLINE_TO_ABS
OpenVG 1.0 constant. |
|
static byte |
VG_HLINE_TO_REL
OpenVG 1.0 constant. |
|
static int |
VG_ILLEGAL_ARGUMENT_ERROR
OpenVG 1.0 constant. |
|
static int |
VG_IMAGE_FORMAT
OpenVG 1.0 constant. |
|
static int |
VG_IMAGE_FORMAT_QUERY
OpenVG 1.0 constant. |
|
static int |
VG_IMAGE_HEIGHT
OpenVG 1.0 constant. |
|
static int |
VG_IMAGE_IN_USE_ERROR
OpenVG 1.0 constant. |
|
static int |
VG_IMAGE_MODE
OpenVG 1.0 constant. |
|
static int |
VG_IMAGE_QUALITY
OpenVG 1.0 constant. |
|
static int |
VG_IMAGE_QUALITY_BETTER
OpenVG 1.0 constant. |
|
static int |
VG_IMAGE_QUALITY_FASTER
OpenVG 1.0 constant. |
|
static int |
VG_IMAGE_QUALITY_NONANTIALIASED
OpenVG 1.0 constant. |
|
static int |
VG_IMAGE_WIDTH
OpenVG 1.0 constant. |
|
static int |
VG_INTERSECT_MASK
OpenVG 1.0 constant. |
|
static int |
VG_INVALID_HANDLE
OpenVG 1.0 constant. |
|
static int |
VG_JOIN_BEVEL
OpenVG 1.0 constant. |
|
static int |
VG_JOIN_MITER
OpenVG 1.0 constant. |
|
static int |
VG_JOIN_ROUND
OpenVG 1.0 constant. |
|
static byte |
VG_LCCWARC_TO
OpenVG 1.0 constant. |
|
static byte |
VG_LCCWARC_TO_ABS
OpenVG 1.0 constant. |
|
static byte |
VG_LCCWARC_TO_REL
OpenVG 1.0 constant. |
|
static byte |
VG_LCWARC_TO
OpenVG 1.0 constant. |
|
static byte |
VG_LCWARC_TO_ABS
OpenVG 1.0 constant. |
|
static byte |
VG_LCWARC_TO_REL
OpenVG 1.0 constant. |
|
static byte |
VG_LINE_TO
OpenVG 1.0 constant. |
|
static byte |
VG_LINE_TO_ABS
OpenVG 1.0 constant. |
|
static byte |
VG_LINE_TO_REL
OpenVG 1.0 constant. |
|
static int |
VG_MASKING
OpenVG 1.0 constant. |
|
static int |
VG_MATRIX_FILL_PAINT_TO_USER
OpenVG 1.0 constant. |
|
static int |
VG_MATRIX_IMAGE_USER_TO_SURFACE
OpenVG 1.0 constant. |
|
static int |
VG_MATRIX_MODE
OpenVG 1.0 constant. |
|
static int |
VG_MATRIX_PATH_USER_TO_SURFACE
OpenVG 1.0 constant. |
|
static int |
VG_MATRIX_STROKE_PAINT_TO_USER
OpenVG 1.0 constant. |
|
static int |
VG_MAX_COLOR_RAMP_STOPS
OpenVG 1.0 constant. |
|
static int |
VG_MAX_DASH_COUNT
OpenVG 1.0 constant. |
|
static int |
VG_MAX_FLOAT
OpenVG 1.0 constant. |
|
static int |
VG_MAX_GAUSSIAN_STD_DEVIATION
OpenVG 1.0 constant. |
|
static int |
VG_MAX_IMAGE_BYTES
OpenVG 1.0 constant. |
|
static int |
VG_MAX_IMAGE_HEIGHT
OpenVG 1.0 constant. |
|
static int |
VG_MAX_IMAGE_PIXELS
OpenVG 1.0 constant. |
|
static int |
VG_MAX_IMAGE_WIDTH
OpenVG 1.0 constant. |
|
static int |
VG_MAX_KERNEL_SIZE
OpenVG 1.0 constant. |
|
static int |
VG_MAX_SCISSOR_RECTS
OpenVG 1.0 constant. |
|
static int |
VG_MAX_SEPARABLE_KERNEL_SIZE
OpenVG 1.0 constant. |
|
static byte |
VG_MOVE_TO
OpenVG 1.0 constant. |
|
static byte |
VG_MOVE_TO_ABS
OpenVG 1.0 constant. |
|
static byte |
VG_MOVE_TO_REL
OpenVG 1.0 constant. |
|
static int |
VG_NON_ZERO
OpenVG 1.0 constant. |
|
static int |
VG_NO_CONTEXT_ERROR
OpenVG 1.0 constant. |
|
static int |
VG_NO_ERROR
OpenVG 1.0 constant. |
|
static int |
VG_OUT_OF_MEMORY_ERROR
OpenVG 1.0 constant. |
|
static int |
VG_PAINT_COLOR
OpenVG 1.0 constant. |
|
static int |
VG_PAINT_COLOR_RAMP_PREMULTIPLIED
OpenVG 1.0 constant. |
|
static int |
VG_PAINT_COLOR_RAMP_SPREAD_MODE
OpenVG 1.0 constant. |
|
static int |
VG_PAINT_COLOR_RAMP_STOPS
OpenVG 1.0 constant. |
|
static int |
VG_PAINT_LINEAR_GRADIENT
OpenVG 1.0 constant. |
|
static int |
VG_PAINT_PATTERN_TILING_MODE
OpenVG 1.0 constant. |
|
static int |
VG_PAINT_RADIAL_GRADIENT
OpenVG 1.0 constant. |
|
static int |
VG_PAINT_TYPE
OpenVG 1.0 constant. |
|
static int |
VG_PAINT_TYPE_COLOR
OpenVG 1.0 constant. |
|
static int |
VG_PAINT_TYPE_LINEAR_GRADIENT
OpenVG 1.0 constant. |
|
static int |
VG_PAINT_TYPE_PATTERN
OpenVG 1.0 constant. |
|
static int |
VG_PAINT_TYPE_RADIAL_GRADIENT
OpenVG 1.0 constant. |
|
static int |
VG_PATH_BIAS
OpenVG 1.0 constant. |
|
static int |
VG_PATH_CAPABILITY_ALL
OpenVG 1.0 constant. |
|
static int |
VG_PATH_CAPABILITY_APPEND_FROM
OpenVG 1.0 constant. |
|
static int |
VG_PATH_CAPABILITY_APPEND_TO
OpenVG 1.0 constant. |
|
static int |
VG_PATH_CAPABILITY_ERROR
OpenVG 1.0 constant. |
|
static int |
VG_PATH_CAPABILITY_INTERPOLATE_FROM
OpenVG 1.0 constant. |
|
static int |
VG_PATH_CAPABILITY_INTERPOLATE_TO
OpenVG 1.0 constant. |
|
static int |
VG_PATH_CAPABILITY_MODIFY
OpenVG 1.0 constant. |
|
static int |
VG_PATH_CAPABILITY_PATH_BOUNDS
OpenVG 1.0 constant. |
|
static int |
VG_PATH_CAPABILITY_PATH_LENGTH
OpenVG 1.0 constant. |
|
static int |
VG_PATH_CAPABILITY_PATH_TRANSFORMED_BOUNDS
OpenVG 1.0 constant. |
|
static int |
VG_PATH_CAPABILITY_POINT_ALONG_PATH
OpenVG 1.0 constant. |
|
static int |
VG_PATH_CAPABILITY_TANGENT_ALONG_PATH
OpenVG 1.0 constant. |
|
static int |
VG_PATH_CAPABILITY_TRANSFORM_FROM
OpenVG 1.0 constant. |
|
static int |
VG_PATH_CAPABILITY_TRANSFORM_TO
OpenVG 1.0 constant. |
|
static int |
VG_PATH_DATATYPE
OpenVG 1.0 constant. |
|
static int |
VG_PATH_DATATYPE_F
OpenVG 1.0 constant. |
|
static int |
VG_PATH_DATATYPE_QUERY
OpenVG 1.0 constant. |
|
static int |
VG_PATH_DATATYPE_S_16
OpenVG 1.0 constant. |
|
static int |
VG_PATH_DATATYPE_S_32
OpenVG 1.0 constant. |
|
static int |
VG_PATH_DATATYPE_S_8
OpenVG 1.0 constant. |
|
static int |
VG_PATH_FORMAT
OpenVG 1.0 constant. |
|
static int |
VG_PATH_FORMAT_STANDARD
OpenVG 1.0 constant. |
|
static int |
VG_PATH_NUM_COORDS
OpenVG 1.0 constant. |
|
static int |
VG_PATH_NUM_SEGMENTS
OpenVG 1.0 constant. |
|
static int |
VG_PATH_SCALE
OpenVG 1.0 constant. |
|
static int |
VG_PIXEL_LAYOUT
OpenVG 1.0 constant. |
|
static int |
VG_PIXEL_LAYOUT_BGR_HORIZONTAL
OpenVG 1.0 constant. |
|
static int |
VG_PIXEL_LAYOUT_BGR_VERTICAL
OpenVG 1.0 constant. |
|
static int |
VG_PIXEL_LAYOUT_RGB_HORIZONTAL
OpenVG 1.0 constant. |
|
static int |
VG_PIXEL_LAYOUT_RGB_VERTICAL
OpenVG 1.0 constant. |
|
static int |
VG_PIXEL_LAYOUT_UNKNOWN
OpenVG 1.0 constant. |
|
static byte |
VG_QUAD_TO
OpenVG 1.0 constant. |
|
static byte |
VG_QUAD_TO_ABS
OpenVG 1.0 constant. |
|
static byte |
VG_QUAD_TO_REL
OpenVG 1.0 constant. |
|
static int |
VG_RED
OpenVG 1.0 constant. |
|
static int |
VG_RELATIVE
OpenVG 1.0 constant. |
|
static int |
VG_RENDERER
OpenVG 1.0 constant. |
|
static int |
VG_RENDERING_QUALITY
OpenVG 1.0 constant. |
|
static int |
VG_RENDERING_QUALITY_BETTER
OpenVG 1.0 constant. |
|
static int |
VG_RENDERING_QUALITY_FASTER
OpenVG 1.0 constant. |
|
static int |
VG_RENDERING_QUALITY_NONANTIALIASED
OpenVG 1.0 constant. |
|
static byte |
VG_SCCWARC_TO
OpenVG 1.0 constant. |
|
static byte |
VG_SCCWARC_TO_ABS
OpenVG 1.0 constant. |
|
static byte |
VG_SCCWARC_TO_REL
OpenVG 1.0 constant. |
|
static int |
VG_SCISSORING
OpenVG 1.0 constant. |
|
static int |
VG_SCISSOR_RECTS
OpenVG 1.0 constant. |
|
static int |
VG_SCREEN_LAYOUT
OpenVG 1.0 constant. |
|
static byte |
VG_SCUBIC_TO
OpenVG 1.0 constant. |
|
static byte |
VG_SCUBIC_TO_ABS
OpenVG 1.0 constant. |
|
static byte |
VG_SCUBIC_TO_REL
OpenVG 1.0 constant. |
|
static byte |
VG_SCWARC_TO
OpenVG 1.0 constant. |
|
static byte |
VG_SCWARC_TO_ABS
OpenVG 1.0 constant. |
|
static byte |
VG_SCWARC_TO_REL
OpenVG 1.0 constant. |
|
static int |
VG_SET_MASK
OpenVG 1.0 constant. |
|
static byte |
VG_SQUAD_TO
OpenVG 1.0 constant. |
|
static byte |
VG_SQUAD_TO_ABS
OpenVG 1.0 constant. |
|
static byte |
VG_SQUAD_TO_REL
OpenVG 1.0 constant. |
|
static int |
VG_STROKE_CAP_STYLE
OpenVG 1.0 constant. |
|
static int |
VG_STROKE_DASH_PATTERN
OpenVG 1.0 constant. |
|
static int |
VG_STROKE_DASH_PHASE
OpenVG 1.0 constant. |
|
static int |
VG_STROKE_DASH_PHASE_RESET
OpenVG 1.0 constant. |
|
static int |
VG_STROKE_JOIN_STYLE
OpenVG 1.0 constant. |
|
static int |
VG_STROKE_LINE_WIDTH
OpenVG 1.0 constant. |
|
static int |
VG_STROKE_MITER_LIMIT
OpenVG 1.0 constant. |
|
static int |
VG_STROKE_PATH
OpenVG 1.0 constant. |
|
static int |
VG_SUBTRACT_MASK
OpenVG 1.0 constant. |
|
static int |
VG_TILE_FILL
OpenVG 1.0 constant. |
|
static int |
VG_TILE_FILL_COLOR
OpenVG 1.0 constant. |
|
static int |
VG_TILE_PAD
OpenVG 1.0 constant. |
|
static int |
VG_TILE_REFLECT
OpenVG 1.0 constant. |
|
static int |
VG_TILE_REPEAT
OpenVG 1.0 constant. |
|
static int |
VG_TRUE
OpenVG 1.0 constant. |
|
static int |
VG_UNION_MASK
OpenVG 1.0 constant. |
|
static int |
VG_UNSUPPORTED_IMAGE_FORMAT_ERROR
OpenVG 1.0 constant. |
|
static int |
VG_UNSUPPORTED_PATH_FORMAT_ERROR
OpenVG 1.0 constant. |
|
static int |
VG_VENDOR
OpenVG 1.0 constant. |
|
static int |
VG_VERSION
OpenVG 1.0 constant. |
|
static byte |
VG_VLINE_TO
OpenVG 1.0 constant. |
|
static byte |
VG_VLINE_TO_ABS
OpenVG 1.0 constant. |
|
static byte |
VG_VLINE_TO_REL
OpenVG 1.0 constant. |
|
static int |
VG_lABGR_8888
OpenVG 1.0 constant. |
|
static int |
VG_lABGR_8888_PRE
OpenVG 1.0 constant. |
|
static int |
VG_lARGB_8888
OpenVG 1.0 constant. |
|
static int |
VG_lARGB_8888_PRE
OpenVG 1.0 constant. |
|
static int |
VG_lBGRA_8888
OpenVG 1.0 constant. |
|
static int |
VG_lBGRA_8888_PRE
OpenVG 1.0 constant. |
|
static int |
VG_lBGRX_8888
OpenVG 1.0 constant. |
|
static int |
VG_lL_8
OpenVG 1.0 constant. |
|
static int |
VG_lRGBA_8888
OpenVG 1.0 constant. |
|
static int |
VG_lRGBA_8888_PRE
OpenVG 1.0 constant. |
|
static int |
VG_lRGBX_8888
OpenVG 1.0 constant. |
|
static int |
VG_lXBGR_8888
OpenVG 1.0 constant. |
|
static int |
VG_lXRGB_8888
OpenVG 1.0 constant. |
|
static int |
VG_sABGR_1555
OpenVG 1.0 constant. |
|
static int |
VG_sABGR_4444
OpenVG 1.0 constant. |
|
static int |
VG_sABGR_8888
OpenVG 1.0 constant. |
|
static int |
VG_sABGR_8888_PRE
OpenVG 1.0 constant. |
|
static int |
VG_sARGB_1555
OpenVG 1.0 constant. |
|
static int |
VG_sARGB_4444
OpenVG 1.0 constant. |
|
static int |
VG_sARGB_8888
OpenVG 1.0 constant. |
|
static int |
VG_sARGB_8888_PRE
OpenVG 1.0 constant. |
|
static int |
VG_sBGRA_4444
OpenVG 1.0 constant. |
|
static int |
VG_sBGRA_5551
OpenVG 1.0 constant. |
|
static int |
VG_sBGRA_8888
OpenVG 1.0 constant. |
|
static int |
VG_sBGRA_8888_PRE
OpenVG 1.0 constant. |
|
static int |
VG_sBGRX_8888
OpenVG 1.0 constant. |
|
static int |
VG_sBGR_565
OpenVG 1.0 constant. |
|
static int |
VG_sL_8
OpenVG 1.0 constant. |
|
static int |
VG_sRGBA_4444
OpenVG 1.0 constant. |
|
static int |
VG_sRGBA_5551
OpenVG 1.0 constant. |
|
static int |
VG_sRGBA_8888
OpenVG 1.0 constant. |
|
static int |
VG_sRGBA_8888_PRE
OpenVG 1.0 constant. |
|
static int |
VG_sRGBX_8888
OpenVG 1.0 constant. |
|
static int |
VG_sRGB_565
OpenVG 1.0 constant. |
|
static int |
VG_sXBGR_8888
OpenVG 1.0 constant. |
|
static int |
VG_sXRGB_8888
OpenVG 1.0 constant. |
Method Summary | ||
---|---|---|
void |
vgAppendPath(int dstPath,
int srcPath)
The vgAppendPath function appends a copy of all path segments from srcPath onto the end
of the existing data in dstPath . |
|
void |
vgAppendPathData(int dstPath,
ByteBuffer pathSegments,
Buffer pathData)
The vgAppendPathData function appends data taken from a client-side representation stored
in pathData to the given path dstPath . |
|
int |
vgChildImage(int parent,
int x,
int y,
int width,
int height)
The vgChildImage function returns a new VGImage handle
that refers to a portion of the parent image. |
|
void |
vgClear(int x,
int y,
int width,
int height)
The vgClear function fills the portion of the drawing surface intersecting the rectangle
extending from pixel (x, y) and having the given width and height
with a constant color value, taken from the VG_CLEAR_COLOR parameter. |
|
void |
vgClearImage(int image,
int x,
int y,
int width,
int height)
The vgClearImage function fills a given rectangle of an image with the
color specified by the VG_CLEAR_COLOR parameter. |
|
void |
vgClearPath(int path,
int capabilities)
The vgClearPath function removes all segment command and coordinate data associated with a path. |
|
void |
vgColorMatrix(int dst,
int src,
float[] matrix,
int offset)
The vgColorMatrix function computes a linear combination of color
and alpha values (Rsrcsrc, Gsrcsrc, Bsrcsrc, ? |
|
void |
vgColorMatrix(int dst,
int src,
FloatBuffer matrix)
The floating-point Buffer version of vgColorMatrix . |
|
void |
vgConvolve(int dst,
int src,
int kernelWidth,
int kernelHeight,
int shiftX,
int shiftY,
ShortBuffer kernel,
float scale,
float bias,
int tilingMode)
The vgConvolve function applies a user-supplied convolution kernel
to a normalized source image src . |
|
void |
vgCopyImage(int dst,
int dx,
int dy,
int src,
int sx,
int sy,
int width,
int height,
boolean dither)
The vgCopyImage function copies pixels between images. |
|
void |
vgCopyPixels(int dx,
int dy,
int sx,
int sy,
int width,
int height)
The vgCopyPixels function copies pixels from one region
of the drawing surface to another. |
|
int |
vgCreateImage(int format,
int width,
int height,
int allowedQuality)
The vgCreateImage function creates an image with the
given width , height , and pixel format
and returns a VGImage handle to it. |
|
int |
vgCreatePaint()
The vgCreatePaint function creates a new paint object that is initialized
to a set of default values and returns a VGPaint handle to it. |
|
int |
vgCreatePath(int pathFormat,
int datatype,
float scale,
float bias,
int segmentCapacityHint,
int coordCapacityHint,
int capabilities)
The vgCreatePath function creates a new path that is ready to accept segment data and returns a
VGPath handle as an int to it. |
|
void |
vgDestroyImage(int image)
The vgDestroyImage function deallocates resources associated with an image. |
|
void |
vgDestroyPaint(int paint)
The vgDestroyPaint function deallocates resources associated with a paint object. |
|
void |
vgDestroyPath(int path)
The vgDestroyPath function releases any resources associated with path , and makes the
handle invalid in all contexts that shared it. |
|
void |
vgDrawImage(int image)
The vgDrawImage function draws an image to the current drawing surface. |
|
void |
vgDrawPath(int path,
int paintModes)
The vgDrawPath function can fill and/or stroke a path. |
|
void |
vgFinish()
The vgFinish function forces all outstanding requests on the current context to complete,
returning only when the last request has completed. |
|
void |
vgFlush()
The vgFlush function ensures that all outstanding requests on the current context
will complete in finite time. |
|
void |
vgGaussianBlur(int dst,
int src,
float stdDeviationX,
float stdDeviationY,
int tilingMode)
The vgGaussianBlur function computes the convolution of a
normalized source image src with a separable kernel defined
in each dimension by the Gaussian function G(x, s):
G(x,s) = 1 / sqrt(2PI s^2 e? |
|
int |
vgGetColor(int paint)
The vgGetColor function returns the current setting of
the VG_PAINT_COLOR parameter on a given paint object
may be queried as a 32-bit non-premultiplied sRGBA_8888 value. |
|
int |
vgGetError()
vgGetError returns the oldest error code provided by an API call
on the current context since the previous call to
vgGetError on that context (or since the
creation of the context). |
|
void |
vgGetImageSubData(int image,
Buffer data,
int dataStride,
int dataFormat,
int x,
int y,
int width,
int height)
The vgGetImageSubData function reads pixel values from a rectangular portion of
an image , performs format conversion if necessary, and stores the
resulting pixels into memory. |
|
void |
vgGetMatrix(float[] m,
int offset)
The vgGetMatrix function retrieves the value of the current transformation. |
|
void |
vgGetMatrix(FloatBuffer m)
The floating-point Buffer version of vgLoadMatrix . |
|
int |
vgGetPaint(int paintMode)
The vgGetPaint function returns the paint object currently set for the given paintMode ,
or VG_INVALID_HANDLE if an error occurs or if no paint object is set (i.e., the default
paint is present) on the given context with the given paintMode . |
|
int |
vgGetParameterVectorSize(int object,
int paramType)
The vgGetParameterVectorSize function returns the number of elements in the vector
that will be returned by the vgGetParameteriv or
vgGetParameterfv functions if called with the given paramType
argument. |
|
float |
vgGetParameterf(int object,
int paramType)
The vgGetParameterf function returns a floating-point object parameter. |
|
void |
vgGetParameterfv(int object,
int paramType,
int count,
float[] values,
int offset)
The vgGetParameterfv function returns a floating-point vector object parameter. |
|
void |
vgGetParameterfv(int object,
int paramType,
FloatBuffer values)
The floating-point Buffer version of vgGetParameterfv . |
|
int |
vgGetParameteri(int object,
int paramType)
The vgGetParameteri function returns an integer object parameter. |
|
void |
vgGetParameteriv(int object,
int paramType,
int count,
int[] values,
int offset)
The vgGetParameteriv function returns an integer vector object parameter. |
|
void |
vgGetParameteriv(int object,
int paramType,
IntBuffer values)
The integer Buffer version of vgGetParameteriv . |
|
int |
vgGetParent(int image)
The vgGetParent function returns the parent of the given image . |
|
int |
vgGetPathCapabilities(int path)
The vgGetPathCapabilities function returns the current capabilities of the
path , as a bitwise OR of VGPathCapabilities constants. |
|
void |
vgGetPixels(int dst,
int dx,
int dy,
int sx,
int sy,
int width,
int height)
The vgGetPixels function retrieves pixel data from the drawing surface into
the image dst . |
|
String |
vgGetString(int name)
The vgGetString function returns information about the OpenVG implementation,
including extension information. |
|
int |
vgGetVectorSize(int paramType)
The vgGetVectorSize function returns the maximum number of elements in the vector
that will be retrieved by the vgGetiv or vgGetfv
functions if called with the given paramType argument. |
|
float |
vgGetf(int paramType)
The vgGetf function returns a floating-point API parameter value. |
|
void |
vgGetfv(int paramType,
int count,
float[] values,
int offset)
The vgGetfv function returns a floating-point vector API parameter value. |
|
void |
vgGetfv(int paramType,
FloatBuffer values)
The floating-point Buffer version of vgGetfv . |
|
int |
vgGeti(int paramType)
The vgGeti function returns an integer API parameter value. |
|
void |
vgGetiv(int paramType,
int count,
int[] values,
int offset)
The vgGetiv function returns an integer API vector parameter value. |
|
void |
vgGetiv(int type,
IntBuffer values)
The integer Buffer version of vgGetiv . |
|
int |
vgHardwareQuery(int key,
int setting)
The vgHardwareQuery function returns a value indicating whether a
given setting of a property of a type given by key
is generally accelerated in hardware on the currently running
OpenVG implementation. |
|
void |
vgImageSubData(int image,
Buffer data,
int dataStride,
int dataFormat,
int x,
int y,
int width,
int height)
The vgImageSubData function reads pixel values from memory,
performs format conversion if necessary, and stores the resulting
pixels into a rectangular portion of an image . |
|
boolean |
vgInterpolatePath(int dstPath,
int startPath,
int endPath,
float amount)
The vgInterpolatePath function appends a path, defined by interpolation (or extrapolation)
between the paths startPath and endPath by the given amount,
to the path dstPath . |
|
void |
vgLoadIdentity()
The vgLoadIdentity function sets the current matrix M to the identity matrix:
M = | 1 0 0 |
| 0 1 0 |
| 0 0 1 |
|
|
void |
vgLoadMatrix(float[] m,
int offset)
The vgLoadMatrix function loads an arbitrary set of matrix values into
the current matrix. |
|
void |
vgLoadMatrix(FloatBuffer m)
The floating-point Buffer version of vgLoadMatrix . |
|
void |
vgLookup(int dst,
int src,
Buffer redLUT,
Buffer greenLUT,
Buffer blueLUT,
Buffer alphaLUT,
boolean outputLinear,
boolean outputPremultiplied)
The vgLookup function passes each image channel of the
normalized source image src through a separate lookup table. |
|
void |
vgLookupSingle(int dst,
int src,
IntBuffer lookupTable,
int sourceChannel,
boolean outputLinear,
boolean outputPremultiplied)
The vgLookupSingle function passes a single image channel of the
normalized source image src , selected by
the sourceChannel parameter, through a combined lookup
table that produces whole pixel values. |
|
void |
vgMask(int mask,
int operation,
int x,
int y,
int width,
int height)
The vgMask function modifies the alpha mask values according to a given operation ,
possibly using alpha values taken from a mask image. |
|
void |
vgModifyPathCoords(int dstPath,
int startIndex,
int numSegments,
Buffer pathData)
The vgModifyPathCoords function modifies the coordinate data for a contiguous range of segments
of dstPath , starting at startIndex (where 0 is the index of the first
path segment) and having length numSegments . |
|
void |
vgMultMatrix(float[] m,
int offset)
The vgMultMatrix function right-multiplies the current matrix M
by a given matrix:
M = M · | sx shx tx |
| shy sy ty |
| w0 w1 w2 |
Nine matrix values are read from m in the order:
{ sx, shy, w0, shx, sy, w1, tx, ty, w2 }
and the current matrix is multiplied by the resulting matrix. |
|
void |
vgMultMatrix(FloatBuffer m)
The floating-point Buffer version of vgLoadMatrix . |
|
void |
vgPaintPattern(int paint,
int pattern)
The vgPaintPattern function replaces any previous pattern image defined
on the given paint object for the given set of paint modes with a new pattern image. |
|
void |
vgPathBounds(int path,
float[] bounds,
int offset)
The vgPathBounds function returns an axis-aligned bounding box that tightly bounds
the interior of the given path. |
|
void |
vgPathBounds(int path,
FloatBuffer bounds)
The floating-point Buffer version of vgPathBounds . |
|
float |
vgPathLength(int path,
int startSegment,
int numSegments)
The vgPathLength function returns the length of a given portion of a path in the
user coordinate system (that is, in the path’s own coordinate system, disregarding
any matrix settings). |
|
void |
vgPathTransformedBounds(int path,
float[] bounds,
int offset)
The vgPathTransformedBounds function returns an axis-aligned
bounding box that is guaranteed to enclose the geometry of the given path
following transformation by the current path-user-to-surface transform. |
|
void |
vgPathTransformedBounds(int path,
FloatBuffer bounds)
The floating-point Buffer version of vgPathTransformedBounds . |
|
void |
vgPointAlongPath(int path,
int startSegment,
int numSegments,
float distance,
float[] pointData,
int offset)
The vgPointAlongPath function returns the point lying a given
distance along a given portion of a path and the unit-length tangent
vector at that point. |
|
void |
vgPointAlongPath(int path,
int startSegment,
int numSegments,
float distance,
FloatBuffer pointData)
The floating-point Buffer version of vgPointAlongPath . |
|
void |
vgReadPixels(Buffer data,
int dataStride,
int dataFormat,
int sx,
int sy,
int width,
int height)
The vgReadPixels function enables you to copy pixel data from the drawing
surface without the creation of a VGImage object. |
|
void |
vgRemovePathCapabilities(int path,
int capabilities)
The vgRemovePathCapabilities function requests the set of capabilities specified
in the capabilities argument to be disabled for the given path . |
|
void |
vgRotate(float angle)
The vgRotate function modifies the current transformation by appending a
counter-clockwise rotation by a given angle (expressed in degrees) about the origin. |
|
void |
vgScale(float sx,
float sy)
The vgScale function modifies the current transformation by appending a scale. |
|
void |
vgSeparableConvolve(int dst,
int src,
int kernelWidth,
int kernelHeight,
int shiftX,
int shiftY,
ShortBuffer kernelX,
ShortBuffer kernelY,
float scale,
float bias,
int tilingMode)
The vgSeparableConvolve function applies a user-supplied separable
convolution kernel to a normalized source image src . |
|
void |
vgSetColor(int paint,
int rgba)
The vgSetColor function acts as a shorthand to allow the VG_PAINT_COLOR
parameter of a given paint object to be set using a 32-bit non-premultiplied sRGBA_8888
representation. |
|
void |
vgSetPaint(int paint,
int paintModes)
The vgSetPaint function sets Paint definitions on the current context. |
|
void |
vgSetParameterf(int object,
int paramType,
float value)
The vgSetParameterf function sets a floating-point object parameter. |
|
void |
vgSetParameterfv(int object,
int paramType,
int count,
float[] values,
int offset)
The vgSetParameterfv function sets a floating-point vector object parameter. |
|
void |
vgSetParameterfv(int object,
int paramType,
FloatBuffer values)
The floating-point Buffer version of vgSetParameterfv . |
|
void |
vgSetParameteri(int object,
int paramType,
int value)
The vgSetParameteri function sets an integer object parameter. |
|
void |
vgSetParameteriv(int object,
int paramType,
int count,
int[] values,
int offset)
The vgSetParameteriv function sets a integer vector object parameter. |
|
void |
vgSetParameteriv(int object,
int paramType,
IntBuffer values)
The integer Buffer version of vgSetParameteriv . |
|
void |
vgSetPixels(int dx,
int dy,
int src,
int sx,
int sy,
int width,
int height)
The vgSetPixels function copies pixel data from the image src
onto the drawing surface. |
|
void |
vgSetf(int paramType,
float value)
The vgSetf function sets a floating-point API parameter value. |
|
void |
vgSetfv(int paramType,
int count,
float[] values,
int offset)
The vgSetfv function sets a floating-point vector API parameter value. |
|
void |
vgSetfv(int paramType,
FloatBuffer values)
The floating-point Buffer version of vgSetfv . |
|
void |
vgSeti(int paramType,
int value)
The vgSeti function sets an integer API parameter value. |
|
void |
vgSetiv(int paramType,
int count,
int[] values,
int offset)
The vgSetiv function sets an integer vector API parameter value. |
|
void |
vgSetiv(int paramType,
IntBuffer values)
The integer Buffer version of vgSetiv . |
|
void |
vgShear(float shx,
float shy)
The vgShear function modifies the current transformation by appending a shear. |
|
void |
vgTransformPath(int dstPath,
int srcPath)
The vgTransformPath function appends a transformed copy of srcPath to the
current contents of dstPath . |
|
void |
vgTranslate(float tx,
float ty)
The vgTranslate function modifies the current transformation by appending a
translation. |
|
void |
vgWritePixels(Buffer data,
int dataStride,
int dataFormat,
int dx,
int dy,
int width,
int height)
The vgWritePixels function allows pixel data to be copied to the
drawing surface without the creation of a VGImage object. |
Field Detail |
---|
static final int VG_FALSE
static final int VG_TRUE
static final int VG_NO_ERROR
static final int VG_BAD_HANDLE_ERROR
static final int VG_ILLEGAL_ARGUMENT_ERROR
static final int VG_OUT_OF_MEMORY_ERROR
static final int VG_PATH_CAPABILITY_ERROR
static final int VG_UNSUPPORTED_IMAGE_FORMAT_ERROR
static final int VG_UNSUPPORTED_PATH_FORMAT_ERROR
static final int VG_IMAGE_IN_USE_ERROR
static final int VG_NO_CONTEXT_ERROR
static final int VG_MATRIX_MODE
static final int VG_FILL_RULE
static final int VG_IMAGE_QUALITY
static final int VG_RENDERING_QUALITY
static final int VG_BLEND_MODE
static final int VG_IMAGE_MODE
static final int VG_SCISSOR_RECTS
static final int VG_STROKE_LINE_WIDTH
static final int VG_STROKE_CAP_STYLE
static final int VG_STROKE_JOIN_STYLE
static final int VG_STROKE_MITER_LIMIT
static final int VG_STROKE_DASH_PATTERN
static final int VG_STROKE_DASH_PHASE
static final int VG_STROKE_DASH_PHASE_RESET
static final int VG_TILE_FILL_COLOR
static final int VG_CLEAR_COLOR
static final int VG_MASKING
static final int VG_SCISSORING
static final int VG_PIXEL_LAYOUT
static final int VG_SCREEN_LAYOUT
static final int VG_FILTER_FORMAT_LINEAR
static final int VG_FILTER_FORMAT_PREMULTIPLIED
static final int VG_FILTER_CHANNEL_MASK
static final int VG_MAX_SCISSOR_RECTS
static final int VG_MAX_DASH_COUNT
static final int VG_MAX_KERNEL_SIZE
static final int VG_MAX_SEPARABLE_KERNEL_SIZE
static final int VG_MAX_COLOR_RAMP_STOPS
static final int VG_MAX_IMAGE_WIDTH
static final int VG_MAX_IMAGE_HEIGHT
static final int VG_MAX_IMAGE_PIXELS
static final int VG_MAX_IMAGE_BYTES
static final int VG_MAX_FLOAT
static final int VG_MAX_GAUSSIAN_STD_DEVIATION
static final int VG_RENDERING_QUALITY_NONANTIALIASED
static final int VG_RENDERING_QUALITY_FASTER
static final int VG_RENDERING_QUALITY_BETTER
static final int VG_PIXEL_LAYOUT_UNKNOWN
static final int VG_PIXEL_LAYOUT_RGB_VERTICAL
static final int VG_PIXEL_LAYOUT_BGR_VERTICAL
static final int VG_PIXEL_LAYOUT_RGB_HORIZONTAL
static final int VG_PIXEL_LAYOUT_BGR_HORIZONTAL
static final int VG_MATRIX_PATH_USER_TO_SURFACE
static final int VG_MATRIX_IMAGE_USER_TO_SURFACE
static final int VG_MATRIX_FILL_PAINT_TO_USER
static final int VG_MATRIX_STROKE_PAINT_TO_USER
static final int VG_CLEAR_MASK
static final int VG_FILL_MASK
static final int VG_SET_MASK
static final int VG_UNION_MASK
static final int VG_INTERSECT_MASK
static final int VG_SUBTRACT_MASK
static final int VG_PATH_FORMAT_STANDARD
static final int VG_PATH_DATATYPE_S_8
static final int VG_PATH_DATATYPE_S_16
static final int VG_PATH_DATATYPE_S_32
static final int VG_PATH_DATATYPE_F
static final int VG_ABSOLUTE
static final int VG_RELATIVE
static final byte VG_CLOSE_PATH
static final byte VG_MOVE_TO
static final byte VG_LINE_TO
static final byte VG_HLINE_TO
static final byte VG_VLINE_TO
static final byte VG_QUAD_TO
static final byte VG_CUBIC_TO
static final byte VG_SQUAD_TO
static final byte VG_SCUBIC_TO
static final byte VG_SCCWARC_TO
static final byte VG_SCWARC_TO
static final byte VG_LCCWARC_TO
static final byte VG_LCWARC_TO
static final byte VG_MOVE_TO_ABS
static final byte VG_MOVE_TO_REL
static final byte VG_LINE_TO_ABS
static final byte VG_LINE_TO_REL
static final byte VG_HLINE_TO_ABS
static final byte VG_HLINE_TO_REL
static final byte VG_VLINE_TO_ABS
static final byte VG_VLINE_TO_REL
static final byte VG_QUAD_TO_ABS
static final byte VG_QUAD_TO_REL
static final byte VG_CUBIC_TO_ABS
static final byte VG_CUBIC_TO_REL
static final byte VG_SQUAD_TO_ABS
static final byte VG_SQUAD_TO_REL
static final byte VG_SCUBIC_TO_ABS
static final byte VG_SCUBIC_TO_REL
static final byte VG_SCCWARC_TO_ABS
static final byte VG_SCCWARC_TO_REL
static final byte VG_SCWARC_TO_ABS
static final byte VG_SCWARC_TO_REL
static final byte VG_LCCWARC_TO_ABS
static final byte VG_LCCWARC_TO_REL
static final byte VG_LCWARC_TO_ABS
static final byte VG_LCWARC_TO_REL
static final int VG_PATH_CAPABILITY_APPEND_FROM
static final int VG_PATH_CAPABILITY_APPEND_TO
static final int VG_PATH_CAPABILITY_MODIFY
static final int VG_PATH_CAPABILITY_TRANSFORM_FROM
static final int VG_PATH_CAPABILITY_TRANSFORM_TO
static final int VG_PATH_CAPABILITY_INTERPOLATE_FROM
static final int VG_PATH_CAPABILITY_INTERPOLATE_TO
static final int VG_PATH_CAPABILITY_PATH_LENGTH
static final int VG_PATH_CAPABILITY_POINT_ALONG_PATH
static final int VG_PATH_CAPABILITY_TANGENT_ALONG_PATH
static final int VG_PATH_CAPABILITY_PATH_BOUNDS
static final int VG_PATH_CAPABILITY_PATH_TRANSFORMED_BOUNDS
static final int VG_PATH_CAPABILITY_ALL
static final int VG_PATH_FORMAT
static final int VG_PATH_DATATYPE
static final int VG_PATH_SCALE
static final int VG_PATH_BIAS
static final int VG_PATH_NUM_SEGMENTS
static final int VG_PATH_NUM_COORDS
static final int VG_CAP_BUTT
static final int VG_CAP_ROUND
static final int VG_CAP_SQUARE
static final int VG_JOIN_MITER
static final int VG_JOIN_ROUND
static final int VG_JOIN_BEVEL
static final int VG_EVEN_ODD
static final int VG_NON_ZERO
static final int VG_STROKE_PATH
static final int VG_FILL_PATH
static final int VG_PAINT_TYPE
static final int VG_PAINT_COLOR
static final int VG_PAINT_COLOR_RAMP_SPREAD_MODE
static final int VG_PAINT_COLOR_RAMP_STOPS
static final int VG_PAINT_COLOR_RAMP_PREMULTIPLIED
static final int VG_PAINT_LINEAR_GRADIENT
static final int VG_PAINT_RADIAL_GRADIENT
static final int VG_PAINT_PATTERN_TILING_MODE
static final int VG_PAINT_TYPE_COLOR
static final int VG_PAINT_TYPE_LINEAR_GRADIENT
static final int VG_PAINT_TYPE_RADIAL_GRADIENT
static final int VG_PAINT_TYPE_PATTERN
static final int VG_COLOR_RAMP_SPREAD_PAD
static final int VG_COLOR_RAMP_SPREAD_REPEAT
static final int VG_COLOR_RAMP_SPREAD_REFLECT
static final int VG_TILE_FILL
static final int VG_TILE_PAD
static final int VG_TILE_REPEAT
static final int VG_TILE_REFLECT
static final int VG_sRGBX_8888
static final int VG_sRGBA_8888
static final int VG_sRGBA_8888_PRE
static final int VG_sRGB_565
static final int VG_sRGBA_5551
static final int VG_sRGBA_4444
static final int VG_sL_8
static final int VG_lRGBX_8888
static final int VG_lRGBA_8888
static final int VG_lRGBA_8888_PRE
static final int VG_lL_8
static final int VG_A_8
static final int VG_BW_1
static final int VG_sXRGB_8888
static final int VG_sARGB_8888
static final int VG_sARGB_8888_PRE
static final int VG_sARGB_1555
static final int VG_sARGB_4444
static final int VG_lXRGB_8888
static final int VG_lARGB_8888
static final int VG_lARGB_8888_PRE
static final int VG_sBGRX_8888
static final int VG_sBGRA_8888
static final int VG_sBGRA_8888_PRE
static final int VG_sBGR_565
static final int VG_sBGRA_5551
static final int VG_sBGRA_4444
static final int VG_lBGRX_8888
static final int VG_lBGRA_8888
static final int VG_lBGRA_8888_PRE
static final int VG_sXBGR_8888
static final int VG_sABGR_8888
static final int VG_sABGR_8888_PRE
static final int VG_sABGR_1555
static final int VG_sABGR_4444
static final int VG_lXBGR_8888
static final int VG_lABGR_8888
static final int VG_lABGR_8888_PRE
static final int VG_IMAGE_QUALITY_NONANTIALIASED
static final int VG_IMAGE_QUALITY_FASTER
static final int VG_IMAGE_QUALITY_BETTER
static final int VG_IMAGE_FORMAT
static final int VG_IMAGE_WIDTH
static final int VG_IMAGE_HEIGHT
static final int VG_DRAW_IMAGE_NORMAL
static final int VG_DRAW_IMAGE_MULTIPLY
static final int VG_DRAW_IMAGE_STENCIL
static final int VG_RED
static final int VG_GREEN
static final int VG_BLUE
static final int VG_ALPHA
static final int VG_BLEND_SRC
static final int VG_BLEND_SRC_OVER
static final int VG_BLEND_DST_OVER
static final int VG_BLEND_SRC_IN
static final int VG_BLEND_DST_IN
static final int VG_BLEND_MULTIPLY
static final int VG_BLEND_SCREEN
static final int VG_BLEND_DARKEN
static final int VG_BLEND_LIGHTEN
static final int VG_BLEND_ADDITIVE
static final int VG_IMAGE_FORMAT_QUERY
static final int VG_PATH_DATATYPE_QUERY
static final int VG_HARDWARE_ACCELERATED
static final int VG_HARDWARE_UNACCELERATED
static final int VG_VENDOR
static final int VG_RENDERER
static final int VG_VERSION
static final int VG_EXTENSIONS
static final int VG_INVALID_HANDLE
Method Detail |
---|
int vgGetError()
vgGetError
returns the oldest error code provided by an API call
on the current context since the previous call to
vgGetError
on that context (or since the
creation of the context).
No error is indicated by a return value of 0 (VG_NO_ERROR
).
After the call, the error code is cleared to 0.
The possible errors that may be generated by each OpenVG
function (apart from VG_OUT_OF_MEMORY_ERROR
) are
shown below the definition of the function.
Initially, all error flags are set to VG_NO_ERROR
.
If no context is current at the time vgGetError
is called, the
error code VG_NO_CONTEXT_ERROR
is returned. Pending error codes
on existing contexts are not affected by the call.
The following errors are currently defined:
VG_NO_ERROR
VG_BAD_HANDLE_ERROR
VG_ILLEGAL_ARGUMENT_ERROR
VG_PATH_CAPABILITY_ERROR
VG_UNSUPPORTED_IMAGE_FORMAT_ERROR
VG_UNSUPPORTED_PATH_FORMAT_ERROR
VG_IMAGE_IN_USE_ERROR
VG_NO_CONTEXT_ERROR
When an error flag is set, results of a VG operation are
undefined only if VG_OUT_OF_MEMORY
has occurred.
In all other cases, the command generating the error is ignored
and has no effect on the VG state or opaque handle contents. If
the generating command returns a value, it returns 0. If
vgGetError
itself generates an error, it returns 0.
void vgFlush()
vgFlush
function ensures that all outstanding requests on the current context
will complete in finite time. May return prior to the actual completion of all requests.
void vgFinish()
vgFinish
function forces all outstanding requests on the current context to complete,
returning only when the last request has completed.
void vgSetf(int paramType, float value)
vgSetf
function sets a floating-point API parameter value.
VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid parameter type.paramType
refers to a vector parameter.value
is not a legal enumerated value for the given parameter.
paramType
- The parameter type to set.value
- the value to set the parameter to.VG10.vgSeti(int, int)
void vgSeti(int paramType, int value)
vgSeti
function sets an integer API parameter value.
The following symbolic constants are accepted by paramType
:
paramType | Datatype | Default Value |
---|---|---|
VG_MATRIX_MODE | VG_MATRIX_PATH_USER_TO_SURFACE , VG_MATRIX_IMAGE_USER_TO_SURFACE , VG_MATRIX_FILL_PAINT_TO_USER , VG_MATRIX_STROKE_PAINT_TO_USER , VG_MATRIX_GLYPH_USER_TO_SURFACE | VG_MATRIX_PATH_USER_TO_SURFACE |
VG_FILL_RULE | VG_EVEN_ODD , VG_NON_ZERO | VG_EVEN_ODD |
VG_IMAGE_QUALITY | VG_IMAGE_QUALITY_NONANTIALIASED , VG_IMAGE_QUALITY_FASTER , VG_IMAGE_QUALITY_BETTER | VG_IMAGE_QUALITY_FASTER |
VG_RENDERING_QUALITY | VG_RENDERING_QUALITY_NONANTIALIASED , VG_RENDERING_QUALITY_FASTER , VG_RENDERING_QUALITY_BETTER | VG_RENDERING_QUALITY_BETTER |
VG_BLEND_MODE | VG_BLEND_SRC , VG_BLEND_SRC_OVER , VG_BLEND_DST_OVER , VG_BLEND_SRC_IN , VG_BLEND_DST_IN , VG_BLEND_MULTIPLY , VG_BLEND_SCREEN , VG_BLEND_DARKEN , VG_BLEND_LIGHTEN , VG_BLEND_ADDITIVE | VG_BLEND_SRC_OVER |
VG_IMAGE_MODE | VG_DRAW_IMAGE_NORMAL , VG_DRAW_IMAGE_MULTIPLY , VG_DRAW_IMAGE_STENCIL | VG_DRAW_IMAGE_NORMAL |
VG_SCISSOR_RECTS | int[] | (array of length 0) |
VG_COLOR_TRANSFORM | VG_TRUE , VG_FALSE | VG_FALSE (disabled) |
VG_COLOR_TRANSFORM_VALUES | float[8] | {1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f} |
VG_STROKE_LINE_WIDTH | float | 1.0f |
VG_STROKE_CAP_STYLE | VG_CAP_BUTT , VG_CAP_ROUND , VG_CAP_SQUARE | VG_CAP_BUTT |
VG_STROKE_JOIN_STYLE | VG_JOIN_MITER , VG_JOIN_ROUND , VG_JOIN_BEVEL | VG_JOIN_MITER |
VG_STROKE_MITER_LIMIT | float | 4.0f |
VG_STROKE_DASH_PATTERN | float[] | { } (array of length 0) (disabled) |
VG_STROKE_DASH_PHASE | float | 0.0f |
VG_STROKE_DASH_PHASE_RESET | VG_TRUE , VG_FALSE | VG_FALSE (disabled) |
VG_TILE_FILL_COLOR | float[4] | {0.0f, 0.0f, 0.0f, 0.0f} |
VG_CLEAR_COLOR | float[4] | {0.0f, 0.0f, 0.0f, 0.0f} |
VG_GLYPH_ORIGIN | float[2] | {0.0f, 0.0f} |
VG_MASKING | VG_TRUE , VG_FALSE | VG_FALSE (disabled) |
VG_SCISSORING | VG_TRUE , VG_FALSE | VG_FALSE (disabled) |
VG_PIXEL_LAYOUT | VG_PIXEL_LAYOUT_UNKNOWN , VG_PIXEL_LAYOUT_RGB_VERTICAL , VG_PIXEL_LAYOUT_BGR_VERTICAL , VG_PIXEL_LAYOUT_RGB_HORIZONTAL , VG_PIXEL_LAYOUT_BGR_HORIZONTAL | VG_PIXEL_LAYOUT_UNKNOWN |
VG_SCREEN_LAYOUT | VG_PIXEL_LAYOUT_UNKNOWN , VG_PIXEL_LAYOUT_RGB_VERTICAL , VG_PIXEL_LAYOUT_BGR_VERTICAL , VG_PIXEL_LAYOUT_RGB_HORIZONTAL , VG_PIXEL_LAYOUT_BGR_HORIZONTAL | Layout of the drawing surface |
VG_FILTER_FORMAT_LINEAR | VG_TRUE , VG_FALSE | VG_FALSE (disabled) |
VG_FILTER_FORMAT_PREMULTIPLIED | VG_TRUE , VG_FALSE | VG_FALSE (disabled) |
VG_FILTER_CHANNEL_MASK | Bit wise OR of VG_RED , VG_GREEN , VG_BLUE , VG_ALPHA | (VG_RED | VG_GREEN | VG_BLUE | VG_ALPHA ) |
VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid parameter type.paramType
refers to a vector parameter.value
is not a legal enumerated value for the given parameter.
paramType
- The parameter type to set.value
- the value to set the parameter to.VG10.vgGeti(int)
void vgSetfv(int paramType, int count, float[] values, int offset)
vgSetfv
function sets a floating-point vector API parameter value.
VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid parameter type.values[i]
is not a legal enumerated value for the given parameter for 0 <= i < count
.values
is not properly aligned.count
or offset
are less than 0.count
is not a valid value for the given parameter.
paramType
- The parameter type to set.count
- The number of values to be used from the array.values
- The array of parameter values.offset
- The offset into the values array.
IllegalArgumentException
- if offset
is negative or values.length - offset
is less than count.VG10.vgSeti(int, int)
void vgSetfv(int paramType, FloatBuffer values)
Buffer
version of vgSetfv
.
VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid parameter type.values[i]
is not a legal enumerated value for the given parameter for 0 <= i < values.remaining()
.values
is not properly aligned.
paramType
- The vg parameter to set.values
- the value to set the parameter to.VG10.vgSetfv(int,int,float[],int)
,
VG10.vgSeti(int, int)
void vgSetiv(int paramType, int count, int[] values, int offset)
vgSetiv
function sets an integer vector API parameter value.
VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid parameter type.values[i]
is not a legal enumerated value for the given
parameter for 0 <= i < count
.values
is not properly aligned.count
or offset
are less than 0.count
is not a valid value for the given parameter.
paramType
- The parameter type to set.count
- The number of values to be used from the array.values
- The array of parameter values.offset
- The offset into the values array.
IllegalArgumentException
- if offset
is negative or values.length - offset
is less than count.VG10.vgSeti(int, int)
void vgSetiv(int paramType, IntBuffer values)
Buffer
version of vgSetiv
.
VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid parameter type.values[i]
is not a legal enumerated value for the given parameter for 0 <= i < values.remaining()
.values
is not properly aligned.
paramType
- The parameter type to set.values
- The buffer containing the parameter values.VG10.vgSetiv(int,int,int[],int)
float vgGetf(int paramType)
vgGetf
function returns a floating-point API parameter value.
VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid parameter type.paramType
refers to a vector parameter.
paramType
- The parameter type to get.
VG10.vgGeti(int)
int vgGeti(int paramType)
vgGeti
function returns an integer API parameter value.
The following symbolic constants are accepted by paramType
:
paramType | Datatype | Default Value |
---|---|---|
VG_MATRIX_MODE | VG_MATRIX_PATH_USER_TO_SURFACE , VG_MATRIX_IMAGE_USER_TO_SURFACE , VG_MATRIX_FILL_PAINT_TO_USER , VG_MATRIX_STROKE_PAINT_TO_USER , VG_MATRIX_GLYPH_USER_TO_SURFACE | VG_MATRIX_PATH_USER_TO_SURFACE |
VG_FILL_RULE | VG_EVEN_ODD , VG_NON_ZERO | VG_EVEN_ODD |
VG_IMAGE_QUALITY | VG_IMAGE_QUALITY_NONANTIALIASED , VG_IMAGE_QUALITY_FASTER , VG_IMAGE_QUALITY_BETTER | VG_IMAGE_QUALITY_FASTER |
VG_RENDERING_QUALITY | VG_RENDERING_QUALITY_NONANTIALIASED , VG_RENDERING_QUALITY_FASTER , VG_RENDERING_QUALITY_BETTER | VG_RENDERING_QUALITY_BETTER |
VG_BLEND_MODE | VG_BLEND_SRC , VG_BLEND_SRC_OVER , VG_BLEND_DST_OVER , VG_BLEND_SRC_IN , VG_BLEND_DST_IN , VG_BLEND_MULTIPLY , VG_BLEND_SCREEN , VG_BLEND_DARKEN , VG_BLEND_LIGHTEN , VG_BLEND_ADDITIVE | VG_BLEND_SRC_OVER |
VG_IMAGE_MODE | VG_DRAW_IMAGE_NORMAL , VG_DRAW_IMAGE_MULTIPLY , VG_DRAW_IMAGE_STENCIL | VG_DRAW_IMAGE_NORMAL |
VG_SCISSOR_RECTS | int[] | (array of length 0) |
VG_COLOR_TRANSFORM | VG_TRUE , VG_FALSE | VG_FALSE (disabled) |
VG_COLOR_TRANSFORM_VALUES | float[8] | {1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f} |
VG_STROKE_LINE_WIDTH | float | 1.0f |
VG_STROKE_CAP_STYLE | VG_CAP_BUTT , VG_CAP_ROUND , VG_CAP_SQUARE | VG_CAP_BUTT |
VG_STROKE_JOIN_STYLE | VG_JOIN_MITER , VG_JOIN_ROUND , VG_JOIN_BEVEL | VG_JOIN_MITER |
VG_STROKE_MITER_LIMIT | float | 4.0f |
VG_STROKE_DASH_PATTERN | float[] | { } (array of length 0) (disabled) |
VG_STROKE_DASH_PHASE | float | 0.0f |
VG_STROKE_DASH_PHASE_RESET | VG_TRUE , VG_FALSE | VG_FALSE (disabled) |
VG_TILE_FILL_COLOR | float[4] | {0.0f, 0.0f, 0.0f, 0.0f} |
VG_CLEAR_COLOR | float[4] | {0.0f, 0.0f, 0.0f, 0.0f} |
VG_GLYPH_ORIGIN | float[2] | {0.0f, 0.0f} |
VG_MASKING | VG_TRUE , VG_FALSE | VG_FALSE (disabled) |
VG_SCISSORING | VG_TRUE , VG_FALSE | VG_FALSE (disabled) |
VG_PIXEL_LAYOUT | VG_PIXEL_LAYOUT_UNKNOWN , VG_PIXEL_LAYOUT_RGB_VERTICAL , VG_PIXEL_LAYOUT_BGR_VERTICAL , VG_PIXEL_LAYOUT_RGB_HORIZONTAL , VG_PIXEL_LAYOUT_BGR_HORIZONTAL | VG_PIXEL_LAYOUT_UNKNOWN |
VG_SCREEN_LAYOUT | VG_PIXEL_LAYOUT_UNKNOWN , VG_PIXEL_LAYOUT_RGB_VERTICAL , VG_PIXEL_LAYOUT_BGR_VERTICAL , VG_PIXEL_LAYOUT_RGB_HORIZONTAL , VG_PIXEL_LAYOUT_BGR_HORIZONTAL | Layout of the drawing surface |
VG_FILTER_FORMAT_LINEAR | VG_TRUE , VG_FALSE | VG_FALSE (disabled) |
VG_FILTER_FORMAT_PREMULTIPLIED | VG_TRUE , VG_FALSE | VG_FALSE (disabled) |
VG_FILTER_CHANNEL_MASK | Bit wise OR of VG_RED , VG_GREEN , VG_BLUE , VG_ALPHA | (VG_RED | VG_GREEN | VG_BLUE | VG_ALPHA ) |
VG_MAX_SCISSOR_RECTS | int | Implementation defined |
VG_MAX_DASH_COUNT | int | Implementation defined |
VG_MAX_KERNEL_SIZE | int | Implementation defined |
VG_MAX_SEPARABLE_KERNEL_SIZE | int | Implementation defined |
VG_MAX_COLOR_RAMP_STOPS | int | Implementation defined |
VG_MAX_IMAGE_WIDTH | int | Implementation defined |
VG_MAX_IMAGE_HEIGHT | int | Implementation defined |
VG_MAX_IMAGE_PIXELS | int | Implementation defined |
VG_MAX_IMAGE_BYTES | int | Implementation defined |
VG_MAX_FLOAT | float | Implementation defined |
VG_MAX_GAUSSIAN_STD_DEVIATION | int | Implementation defined |
VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid parameter type.paramType
refers to a vector parameter.
paramType
- The parameter type to get.
VG10.vgSeti(int, int)
int vgGetVectorSize(int paramType)
vgGetVectorSize
function returns the maximum number of elements in the vector
that will be retrieved by the vgGetiv
or vgGetfv
functions if called with the given paramType
argument.
For scalar values, 1 is returned. If vgGetiv
or vgGetfv
is called with a smaller value for count
than that returned by vgGetVectorSize
,
only the first count
elements of the vector are retrieved. Use of a greater
value for count
will result in an error.
paramType
- The parameter type to get the vector size for.
VG10.vgGeti(int)
void vgGetfv(int paramType, int count, float[] values, int offset)
vgGetfv
function returns a floating-point vector API parameter value.
VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid parameter type.values
is null
.values
is not properly aligned.count
is less than or equal to 0.count
is greater than the value returned by vgGetVectorSize
for the given parameter.
paramType
- The parameter type to get.count
- The number of values to be used from the array.values
- The array of parameter values.offset
- The offset into the values array.
IllegalArgumentException
- if offset
is negative or values.length - offset
is less than count.VG10.vgGeti(int)
void vgGetfv(int paramType, FloatBuffer values)
Buffer
version of vgGetfv
.
VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid parameter type.values
is null
.values
is not properly aligned.values.remaining()
is equal to 0.values.remaining()
is greater than the value returned by vgGetVectorSize
for the given parameter.
paramType
- The parameter type to get.values
- The buffer containing the parameter values.VG10.vgGeti(int)
void vgGetiv(int paramType, int count, int[] values, int offset)
vgGetiv
function returns an integer API vector parameter value.
VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid parameter type.values
is null
.values
is not properly aligned.count
is less than or equal to 0.count
is greater than the value returned by vgGetVectorSize
for the given parameter.
paramType
- The parameter type to get.count
- The number of values to be used from the array.values
- The array of parameter values.offset
- The offset into the values array.
IllegalArgumentException
- if offset
is negative or values.length - offset
is less than count.VG10.vgGeti(int)
void vgGetiv(int type, IntBuffer values)
Buffer
version of vgGetiv
.
VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid parameter type.values
is null
.values
is not properly aligned.values.remaining()
is equal to 0.values.remaining()
is greater than the value
returned by vgGetVectorSize
for the given parameter.
type
- The parameter type to get.values
- The buffer containing the parameter values.VG10.vgGetiv(int,int,int[],int)
,
VG10.vgGeti(int)
void vgSetParameterf(int object, int paramType, float value)
vgSetParameterf
function sets a floating-point object parameter.
VG_BAD_HANDLE_ERROR
is generated:
object
is not a valid handle, or is not shared with the current context.VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid value from the appropriate enumerationparamType
refers to a vector parameter.value
is not a legal enumerated value for the given parameter
object
- The object to set the parameter for.paramType
- The parameter type to set.value
- The value to be set for the specified parameter type.VG10.vgSetParameteri(int, int, int)
void vgSetParameteri(int object, int paramType, int value)
vgSetParameteri
function sets an integer object parameter.
The following symbolic constants are accepted by paramType
:
VGHandle | paramType |
---|---|
VGPath |
VG_PATH_FORMAT , VG_PATH_DATATYPE , VG_PATH_SCALE , VG_PATH_BIAS , VG_PATH_NUM_SEGMENTS , VG_PATH_NUM_COORDS |
VGPaint |
VG_PAINT_TYPE , VG_PAINT_COLOR , VG_PAINT_COLOR_RAMP_SPREAD_MODE , VG_PAINT_COLOR_RAMP_PREMULTIPLIED , VG_PAINT_COLOR_RAMP_STOPS , VG_PAINT_LINEAR_GRADIENT , VG_PAINT_RADIAL_GRADIENT , VG_PAINT_PATTERN_TILING_MODE |
VGImage |
VG_IMAGE_FORMAT , VG_IMAGE_WIDTH , VG_IMAGE_HEIGHT |
VGFont |
VG_FONT_NUM_GLYPHS |
VG_BAD_HANDLE_ERROR
is generated:
object
is not a valid handle, or is not shared with the current context.VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid value from the appropriate enumerationparamType
refers to a vector parameter.value
is not a legal enumerated value for the given parameter
object
- The object to set the parameter for.paramType
- The parameter type to set.value
- The value to be set for the specified parameter type.void vgSetParameterfv(int object, int paramType, int count, float[] values, int offset)
vgSetParameterfv
function sets a floating-point vector object parameter.
VG_BAD_HANDLE_ERROR
is generated:
object
is not a valid handle, or is not shared with the current context.VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid value from the appropriate enumeration.paramType
refers to a scalar parameter and count
is not equal to 1.values[i]
is not a legal enumerated value for the given parameter in for 0 <= i < count
.values
is null
and count is greater than 0.values
is not properly aligned.count
is less than 0.count
is not a valid value for the given parameter.
object
- The object to set the parameter for.paramType
- The parameter type to set.count
- The number of values to be used from the array.values
- The array of parameter values.offset
- The offset into the values array.
IllegalArgumentException
- if offset
is negative or values.length - offset
is less than count.VG10.vgSetParameteri(int, int, int)
void vgSetParameterfv(int object, int paramType, FloatBuffer values)
Buffer
version of vgSetParameterfv
.
VG_BAD_HANDLE_ERROR
is generated:
object
is not a valid handle, or is not shared with the current context.VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid value from the appropriate enumeration.paramType
refers to a scalar parameter and values.remaining()
is not equal to 1.values[i]
is not a legal enumerated value for the given parameter in for 0 <= i < values.remaining()
.values
is not properly aligned.
object
- The object to set the parameter for.paramType
- The parameter type to set.values
- The buffer containing the parameter values.VG10.vgSetParameterfv(int,int,int,float[],int)
void vgSetParameteriv(int object, int paramType, int count, int[] values, int offset)
vgSetParameteriv
function sets a integer vector object parameter.
VG_BAD_HANDLE_ERROR
is generated:
object
is not a valid handle, or is not shared with the current context.VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid value from the appropriate enumeration.paramType
refers to a scalar parameter and count
is not equal to 1.values[i]
is not a legal enumerated value for the given parameter in for 0 <= i < count
.values
is null
and count is greater than 0.values
is not properly aligned.count
is less than 0.count
is not a valid value for the given parameter.
object
- The object to set the parameter for.paramType
- The parameter type to set.count
- The number of values to be used from the array.values
- The array of parameter values.offset
- The offset into the values array.
IllegalArgumentException
- if offset
is negative or values.length - offset
is less than count.VG10.vgSetParameteri(int, int, int)
void vgSetParameteriv(int object, int paramType, IntBuffer values)
Buffer
version of vgSetParameteriv
.
VG_BAD_HANDLE_ERROR
is generated:
object
is not a valid handle, or is not shared with the current context.VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid value from the appropriate enumeration.paramType
refers to a scalar parameter and values.remaining()
is not equal to 1.values[i]
is not a legal enumerated value for the given parameter in for 0 <= i < values.remaining()
.values
is not properly aligned.
object
- The object to set the parameter for.paramType
- The parameter type to set.values
- The buffer containing the parameter values.VG10.vgSetParameteri(int, int, int)
float vgGetParameterf(int object, int paramType)
vgGetParameterf
function returns a floating-point object parameter.
VG_BAD_HANDLE_ERROR
is generated:
object
is not a valid handle, or is not shared with the current context.VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid value from the appropriate enumeration.paramType
refers to a vector parameter.
object
- The object to get the parameter for.paramType
- The parameter type to get.
int vgGetParameteri(int object, int paramType)
vgGetParameteri
function returns an integer object parameter.
The following symbolic constants are accepted by paramType
:
VGHandle | paramType |
---|---|
VGPath |
VG_PATH_FORMAT , VG_PATH_DATATYPE , VG_PATH_SCALE , VG_PATH_BIAS , VG_PATH_NUM_SEGMENTS , VG_PATH_NUM_COORDS |
VGPaint |
VG_PAINT_TYPE , VG_PAINT_COLOR , VG_PAINT_COLOR_RAMP_SPREAD_MODE , VG_PAINT_COLOR_RAMP_PREMULTIPLIED , VG_PAINT_COLOR_RAMP_STOPS , VG_PAINT_LINEAR_GRADIENT , VG_PAINT_RADIAL_GRADIENT , VG_PAINT_PATTERN_TILING_MODE |
VGImage |
VG_IMAGE_FORMAT , VG_IMAGE_WIDTH , VG_IMAGE_HEIGHT |
VGFont |
VG_FONT_NUM_GLYPHS |
VG_BAD_HANDLE_ERROR
is generated:
object
is not a valid handle, or is not shared with the current context.VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid value from the appropriate enumeration.paramType
refers to a vector parameter.
object
- The object to get the parameter for.paramType
- The parameter type to get.
int vgGetParameterVectorSize(int object, int paramType)
vgGetParameterVectorSize
function returns the number of elements in the vector
that will be returned by the vgGetParameteriv
or
vgGetParameterfv
functions if called with the given paramType
argument. For scalar values, 1 is returned. If vgGetParameteriv
or vgGetParameterfv
is called with a smaller value for
count
than that returned by vgGetParameterVectorSize
,
only the first count
elements of the vector are retrieved.
Use of a greater value for count
will result in an error.
object
- The object to get the parameter vector size for.paramType
- The parameter type to get the vector size for.
VG10.vgGetParameteri(int, int)
void vgGetParameterfv(int object, int paramType, int count, float[] values, int offset)
vgGetParameterfv
function returns a floating-point vector object parameter.
VG_BAD_HANDLE_ERROR
is generated:
object
is not a valid handle, or is not shared with the current context.
VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid value from the appropriate enumeration.values
is null
.values
is not properly aligned.count
is less than or equal to 0.count
is greater than the value returned by vgGetParameterVectorSize
for the given parameter.
object
- The object to get the parameter for.paramType
- The parameter type to get.count
- The number of values to be used from the array.values
- The array of parameter values.offset
- The offset into the values array.
IllegalArgumentException
- if offset
is negative or values.length - offset
is less than count.void vgGetParameterfv(int object, int paramType, FloatBuffer values)
Buffer
version of vgGetParameterfv
.
VG_BAD_HANDLE_ERROR
is generated:
object
is not a valid handle, or is not shared with the current context.
VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid value from the appropriate enumeration.values
is null
.values
is not properly aligned.values.remaining()
is equal to 0.values.remaining()
is greater than the value returned by vgGetParameterVectorSize
for the given parameter.
object
- The object to get the parameter for.paramType
- The parameter type to get.values
- The buffer containing the parameter values.VG10.vgGetParameterfv(int,int,int,float[],int)
void vgGetParameteriv(int object, int paramType, int count, int[] values, int offset)
vgGetParameteriv
function returns an integer vector object parameter.
VG_BAD_HANDLE_ERROR
is generated:
object
is not a valid handle, or is not shared with the current context.
VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid value from the appropriate enumeration.values
is null
.values
is not properly aligned.count
is less than or equal to 0.count
is greater than the value returned by vgGetParameterVectorSize
for the given parameter.
object
- The object to get the parameter for.paramType
- The parameter type to get.count
- The number of values to be used from the array.values
- The array of parameter values.offset
- The offset into the values array.
IllegalArgumentException
- if offset
is negative or values.length - offset
is less than count.void vgGetParameteriv(int object, int paramType, IntBuffer values)
Buffer
version of vgGetParameteriv
.
VG_BAD_HANDLE_ERROR
is generated:
object
is not a valid handle, or is not shared with the current context.
VG_ILLEGAL_ARGUMENT_ERROR
is generated:
paramType
is not a valid value from the appropriate enumeration.values
is null
.values
is not properly aligned.values.remaining()
is equal to 0.values.remaining()
is greater than the value returned by vgGetParameterVectorSize
for the given parameter.
object
- The object to get the parameter for.paramType
- The parameter type to get.values
- The buffer containing the parameter values.VG10.vgGetParameteriv(int,int,int,int[],int)
void vgLoadIdentity()
vgLoadIdentity
function sets the current matrix M to the identity matrix:
M = | 1 0 0 | | 0 1 0 | | 0 0 1 |
void vgLoadMatrix(float[] m, int offset)
vgLoadMatrix
function loads an arbitrary set of matrix values into
the current matrix. Nine matrix values are read from M
, in the order:
{ sx, shy, w0, shx, sy, w1, tx, ty, w2 }defining the matrix:
M = | sx shx tx | | shy sy ty | | w0 w1 w2 |
However, if the targeted matrix is affine (i.e., the matrix mode is not
VG_MATRIX_IMAGE_USER_TO_SURFACE
), the values { w0, w1, w2 }
are ignored and replaced by the values { 0, 0, 1 }, resulting in the
affine matrix:
M = | sx shx tx | | shy sy ty | | 0 0 1 |
VG_ILLEGAL_ARGUMENT_ERROR
is generated:
m
is null
.m
is not properly aligned.
m
- Arbitrary set of matrix values to load into the current matrix.offset
- The offset into the array of matrix values m
.
IllegalArgumentException
- if offset
is negative or m.length - offset
is less than 9.void vgLoadMatrix(FloatBuffer m)
Buffer
version of vgLoadMatrix
.
VG_ILLEGAL_ARGUMENT_ERROR
is generated:
m
is null
.
m
- A buffer of arbitrary matrix values to load into the current matrix.
IllegalArgumentException
- if m.GetRemaining()
is less than 9.VG10.vgLoadMatrix(float[],int)
void vgGetMatrix(float[] m, int offset)
vgGetMatrix
function retrieves the value of the current transformation.
Nine values are written to m in the order:
{ sx, shy, w0, shx, sy, w1, tx, ty, w2 }
For an affine matrix, w0 and w1 will always be 0 and w2 will always be 1.
VG_ILLEGAL_ARGUMENT_ERROR
is generated:
m
is null
.m
is not properly aligned.
m
- Array to hold the the nine values from the current transformation.offset
- The offset into the array of matrix values m
.
IllegalArgumentException
- if offset
is negative or m.length - offset
is less than 9.void vgGetMatrix(FloatBuffer m)
Buffer
version of vgLoadMatrix
.
VG_ILLEGAL_ARGUMENT_ERROR
is generated:
m
is null
.
m
- A buffer to hold the nine values from the current transformation.
IllegalArgumentException
- if m.GetRemaining()
is less than 9.VG10.vgGetMatrix(float[],int)
void vgMultMatrix(float[] m, int offset)
vgMultMatrix
function right-multiplies the current matrix M
by a given matrix:
M = M · | sx shx tx | | shy sy ty | | w0 w1 w2 |
Nine matrix values are read from m in the order:
{ sx, shy, w0, shx, sy, w1, tx, ty, w2 }and the current matrix is multiplied by the resulting matrix. However, if the targeted matrix is affine (i.e., the matrix mode is not
VG_MATRIX_IMAGE_USER_TO_SURFACE
), the
values { w0, w1, w2 } are ignored and replaced by the values { 0, 0, 1 }
prior to multiplication.
VG_ILLEGAL_ARGUMENT_ERROR
is generated:
m
is null
.m
is not properly aligned
m
- Matrix to multiply the current matrix M by.offset
- The offset into the array of matrix values m
.
IllegalArgumentException
- if offset
is negative or m.length - offset
is less than 9.void vgMultMatrix(FloatBuffer m)
Buffer
version of vgLoadMatrix
.
VG_ILLEGAL_ARGUMENT_ERROR
is generated:
m
is null
.
m
- Buffer representing a matrix to multiply the current matrix M by.
IllegalArgumentException
- if m.GetRemaining()
is less than 9.VG10.vgMultMatrix(float[],int)
void vgTranslate(float tx, float ty)
vgTranslate
function modifies the current transformation by appending a
translation. This is equivalent to right-multiplying the current matrix M by
a translation matrix:
M = M · | 1 0 tx | | 0 1 ty | | 0 0 1 |
tx
- Specifies the x coordinate of a translation vector.ty
- Specifies the y coordinate of a translation vector.void vgScale(float sx, float sy)
vgScale
function modifies the current transformation by appending a scale.
This is equivalent to right-multiplying the current matrix M by a scale matrix:
M = M · | sx 0 0 | | 0 sy 0 | | 0 0 1 |
sx
- Specifies the scale factor along the x axis.sy
- Specifies the scale factor along the y axis.void vgShear(float shx, float shy)
vgShear
function modifies the current transformation by appending a shear.
This is equivalent to right-multiplying the current matrix M by a shear matrix:
M = M · | 1 shx 0 | | shy 1 0 | | 0 0 1 |
shx
- Specifies the shear factor along the x axis.shy
- Specifies the shear factor along the y axis.void vgRotate(float angle)
vgRotate
function modifies the current transformation by appending a
counter-clockwise rotation by a given angle (expressed in degrees) about the origin.
This is equivalent to right-multiplying the current matrix M by the following
matrix (using the symbol a to represent the value of the angle
parameter):
M = M · | cos(a) -sin(a) 0 | | sin(a) cos(a) 0 | | 0 0 1 |
To rotate about a center point (cx, cy) other than the origin, the application may perform a translation by (-cx, -cy), followed by the rotation, followed by a translation by (cx, cy).
angle
- The angle (in degrees) to rotate the transformation counter-clockwise around the origin.void vgMask(int mask, int operation, int x, int y, int width, int height)
vgMask
function modifies the alpha mask values according to a given operation
,
possibly using alpha values taken from a mask
image. If no alpha mask is configured,
vgMask
has no effect.
The affected region is the intersection of the drawing surface bounds with the rectangle extending
from pixel (x, y) of the drawing surface and having the given width
and
height
in pixels. For operations that make use of the mask
image parameter
(i.e., operations other than VG_CLEAR_MASK
and VG_FILL_MASK
),
mask image pixels starting at (0, 0) are used, and the region is further limited to the width and height
of mask
. For the VG_CLEAR_MASK
and VG_FILL_MASK
operations, the
mask
parameter is ignored and does not affect the region being modified. The value
VG_INVALID_HANDLE
may be supplied in place of an actual image handle.
The mask
image defines alpha values at each of its pixels as follows. If the image pixel
format includes an alpha channel, the alpha channel is used. Otherwise, values from the red (for color
image formats) or grayscale (for grayscale formats) channel are used. The value is divided by the
maximum value for the channel to obtain an alpha value between 0 and 1. If the image is bi-level (black
and white), black pixels receive an alpha value of 0 and white pixels receive an alpha value of 1.
VG_BAD_HANDLE_ERROR
is generated:
operation
is not VG_CLEAR_MASK
or VG_FILL_MASK
, and
mask
is not a valid image handle, or is not shared with the current context.VG_IMAGE_IN_USE_ERROR
is generated:
mask
is currently a rendering targetVG_ILLEGAL_ARGUMENT_ERROR
is generated:
operation
is not a valid value from the VGMaskOperation
enumeration.width
or height is less than or equal to 0.mask
is a VGMaskLayer
and is not compatible with the current surface mask.
mask
- Image defining alpha values at each of its pixels or VG_INVALID_HANDLEoperation
- Operation used to modify the alpha masks.
The following symbolic values are accepted:
VG_CLEAR_MASK
, VG_FILL_MASK
, VG_SET_MASKVG_UNION_MASK
,
VG_INTERSECT_MASK
, and VG_SUBTRACT_MASK
.x
- position of the affected region along the x axis.y
- position of the affected region along the y axis.width
- width of the affected region.height
- height of the affected region.void vgClear(int x, int y, int width, int height)
vgClear
function fills the portion of the drawing surface intersecting the rectangle
extending from pixel (x, y) and having the given width
and height
with a constant color value, taken from the VG_CLEAR_COLOR parameter. The color value is expressed in
non-premultiplied sRGBA (sRGB color plus alpha)format. Values outside the [0, 1] range are interpreted
as the nearest endpoint of the range. The color is converted to the destination color space in the same
manner as if a rectangular path were being filled. Clipping and scissoring take place in the usual
fashion, but antialiasing, masking, and blending do not occur.
VG_ILLEGAL_ARGUMENT_ERROR
width
or height
is less than or equal to 0.
x
- position of the affected region along the x axis.y
- position of the affected region along the y axis.width
- width of the affected region.height
- height of the affected region.int vgCreatePath(int pathFormat, int datatype, float scale, float bias, int segmentCapacityHint, int coordCapacityHint, int capabilities)
vgCreatePath
function creates a new path that is ready to accept segment data and returns a
VGPath
handle as an int to it. The path data will be formatted in the format given by
pathFormat
, typically VG_PATH_FORMAT_STANDARD
. The datatype parameter
contains a value from the VGPathDatatype
enumeration indicating the datatype that will
be used for coordinate data. The capabilities
argument is a bitwise OR of the desired
VGPathCapabilities
values. Bits of capabilities
that do not correspond to
values from VGPathCapabilities
have no effect. If an error occurs,
VG_INVALID_HANDLE
is returned.
The scale
and bias
parameters are used to interpret each coordinate of the
path data; an incoming coordinate value v will be interpreted as the value (scale*v + bias).
scale
must not equal 0. The datatype, scale, and bias together define a valid coordinate data range
for the path; segment commands that attempt to place a coordinate in the path that is outside this range will
overflow silently, resulting in an undefined coordinate value. Functions that query a path containing such
values, such as vgPathLength
and vgPointAlongPath
, also return undefined results.
The segmentCapacityHint
parameter provides a hint about the total number of segments that will
eventually be stored in the path. The coordCapacityHint
parameter provides a hint about the
total number of specified coordinates that will eventually be stored in the path. A value less than or equal
to 0 for either hint indicates that the capacity is unknown. The path storage space will in any case grow as
needed, regardless of the hint values. However, supplying hints may improve performance by reducing the need
to allocate additional space as the path grows.
VG_UNSUPPORTED_PATH_FORMAT_ERROR
pathFormat
is not a supported format.VG_ILLEGAL_ARGUMENT_ERROR
dataType
is not a valid.scale
is equal to 0.
pathFormat
- format to be used to format the path data, typically VG_PATH_FORMAT_STANDARD.datatype
- the datatype to be used for the coordinate data.
The following symbolic values are accepted:
VG_PATH_DATATYPE_S_8
, VG_PATH_DATATYPE_S_16
,
VG_PATH_DATATYPE_S_32
, and VG_PATH_DATATYPE_F
.scale
- amount to scale each coordinate of path data by.bias
- amount of bias to be applied to each coordinate of path data.segmentCapacityHint
- hint to the total number of segments that will eventually be stored in the path.coordCapacityHint
- hint to the total number of specified coordinates that will eventually be stored in the path.capabilities
- bitwise OR of the desired VGPathCapabilities
values.
The symbolic values starting with VG_PATH_CAPABILITY_
except VG_PATH_CAPABILITY_ERROR
are accepted.
VGPath
handle to the newly created path; VG_INVALID_HANDLE
if an error occurs.void vgClearPath(int path, int capabilities)
vgClearPath
function removes all segment command and coordinate data associated with a path.
The handle continues to be valid for use in the future, and the path format and datatype retain their
existing values. The capabilities
argument is a bitwise OR of the desired
VGPathCapabilities
values. Bits of capabilities
that do not correspond to values
from VGPathCapabilities
have no effect. Using vgClearPath
may be more
efficient than destroying and re-creating a path for short-lived paths.
VG_BAD_HANDLE_ERROR
is generated:
path
is not a valid path handle; or is not shared with the current context.
path
- VGPath
handle of the path to remove all segment and command data for.capabilities
- bitwise OR of the desired VGPathCapabilities
values.
The symbolic values starting with VG_PATH_CAPABILITY_
except VG_PATH_CAPABILITY_ERROR
are accepted.void vgDestroyPath(int path)
vgDestroyPath
function releases any resources associated with path
, and makes the
handle invalid in all contexts that shared it.
VG_BAD_HANDLE_ERROR
path
is not a valid path handle, or is not shared with the current context
path
- VGPath
handle of the path to destroy.void vgRemovePathCapabilities(int path, int capabilities)
vgRemovePathCapabilities
function requests the set of capabilities specified
in the capabilities
argument to be disabled for the given path
.
The capabilities
argument is a bitwise OR of the VGPathCapabilities
values whose removal is requested. Attempting to remove a capability that is already
disabled has no effect. Bits of capabilities
that do not correspond to values from
VGPathCapabilities
have no effect.
VG_BAD_HANDLE_ERROR
path
is not a valid path handle, or is not shared with the current context
path
- VGPath
handle of the path to remove capabilities for.capabilities
- bitwise OR of the desired VGPathCapabilities
values.
The symbolic values starting with VG_PATH_CAPABILITY_
except VG_PATH_CAPABILITY_ERROR
are accepted.int vgGetPathCapabilities(int path)
vgGetPathCapabilities
function returns the current capabilities of the
path
, as a bitwise OR of VGPathCapabilities
constants. If an
error occurs, 0 is returned.
VG_BAD_HANDLE_ERROR
path
is not a valid path handle, or is not shared with the current context
path
- VGPath
handle of the path to get capabilities for.
VGPathCapabilities
applied to the given path
.void vgAppendPath(int dstPath, int srcPath)
vgAppendPath
function appends a copy of all path segments from srcPath
onto the end
of the existing data in dstPath
. It is legal for srcPath
and dstPath
to be handles to the same path object, in which case the contents of the path are duplicated. If
srcPath
and dstPath
are handles to distinct path objects, the contents of
srcPath
will not be affected by the call.
The VG_PATH_CAPABILITY_APPEND_FROM
capability must be enabled for srcPath
,
and the VG_PATH_CAPABILITY_APPEND_TO
capability must be enabled for dstPath
.
If the scale and bias of dstPath
define a narrower range than that of srcPath
,
overflow may occur silently.
VG_BAD_HANDLE_ERROR
dstPath
or srcPath
is not a valid path handle, or is not
shared with the current context.VG_PATH_CAPABILITY_ERROR
VG_PATH_CAPABILITY_APPEND_FROM
is not enabled for srcPath
.VG_PATH_CAPABILITY_APPEND_TO
is not enabled for dstPath
.
dstPath
- VGPath
handle of the path to append the srcPath
to.srcPath
- VGPath
handle of the path to append to dstPath
.void vgAppendPathData(int dstPath, ByteBuffer pathSegments, Buffer pathData)
vgAppendPathData
function appends data taken from a client-side representation stored
in pathData
to the given path dstPath
. The data are formatted using the
path format of dstPath
(as returned by querying the path’s VG_PATH_FORMAT
parameter using vgGetParameteri
). Legal values for the pathSegments
buffer
are the values from the VGPathCommand
enumeration as well as VG_CLOSE_PATH
and (VG_CLOSE_PATH | VG_RELATIVE
) (which are synonymous).
The pathData
must be aligned on a 1-, 2-, or 4-byte boundary depending on the size of the
coordinate datatype (as returned by querying the path’s VG_PATH_DATATYPE
parameter using
vgGetParameteri
). The VG_PATH_CAPABILITY_APPEND_TO
capability must be enabled
for dstPath
.
Each incoming coordinate value, regardless of datatype, is transformed by the scale factor and bias of the path.
VG_BAD_HANDLE_ERROR
dstPath
is not a valid path handle, or is not shared with the current context.VG_PATH_CAPABILITY_ERROR
VG_PATH_CAPABILITY_APPEND_TO
is not enabled for dstPath
VG_ILLEGAL_ARGUMENT_ERROR
pathSegments
or pathData
is null
.pathData
is not properly aligned.pathSegments
contains an illegal command.pathSegments.remaining()
is equal to 0.
dstPath
- VGPath
handle of the path to append path data to.pathSegments
- path segment commands contained within the VGPathCommand
enumeration.pathData
- path data to append the dstPath
.
IllegalArgumentException
- if the type of pathData
does not correspond
to the datatype of dstPath.
IllegalArgumentException
- if pathData.remaining()
is less than the number
of coordinates required by the given segments.void vgModifyPathCoords(int dstPath, int startIndex, int numSegments, Buffer pathData)
vgModifyPathCoords
function modifies the coordinate data for a contiguous range of segments
of dstPath
, starting at startIndex
(where 0 is the index of the first
path segment) and having length numSegments
. The data in pathData
must
be formatted in exactly the same manner as the original coordinate data for the given segment range,
unless the path has been transformed using vgTransformPath
or interpolated using
vgInterpolatePath
. In these cases, the path will have been subject to the segment
promotion rules as specified in those functions.
The pathData
must be aligned on a 1-, 2-, or 4-byte boundary depending on the size of
the coordinate datatype (as returned by querying the path’s VG_PATH_DATATYPE
parameter
using vgGetParameteri
). The VG_PATH_CAPABILITY_MODIFY
capability must be
enabled for dstPath
.
Each incoming coordinate value, regardless of datatype, is transformed by the scale factor and bias of the path.
VG_BAD_HANDLE_ERROR
dstPath
is not a valid path handle, or is not shared with the current context.VG_PATH_CAPABILITY_ERROR
VG_PATH_CAPABILITY_MODIFY
is not enabled for dstPath
VG_ILLEGAL_ARGUMENT_ERROR
dstPath
is null
.pathData
is null
.pathData
is not properly aligned.startIndex
is less than 0.numSegments
is less than or equal to 0.startIndex + numSegments
is greater than the number of segments in the path.
dstPath
- VGPath
handle of the path to modify path coordinates for.startIndex
- index into dstPath
to begin modifying segments at.numSegments
- number of segments to modify on dstPath
.pathData
- path data used to modify dstPath
.
IllegalArgumentException
- if the type of pathData
does not correspond
to the datatype of dstPath.
IllegalArgumentException
- if pathData.remaining()
is less than the number
of coordinates required by segments to be modified.void vgTransformPath(int dstPath, int srcPath)
vgTransformPath
function appends a transformed copy of srcPath
to the
current contents of dstPath
. The appended path is equivalent to the results
of applying the current path-user-to-surface transformation
(VG_MATRIX_PATH_USER_TO_SURFACE
) to srcPath
.
It is legal for srcPath
and dstPath
to be handles to the
same path object, in which case the the transformed path will be appended to the
existing path. If srcPath
and dstPath
are handles to
distinct path objects, the contents of srcPath
will not be affected
by the call.
All HLINE_TO_*
and VLINE_TO_*
segments present in
srcPath
are implicitly converted to LINE_TO_*
segments
prior to applying the transformation. The original copies of these segments
in srcPath
remain unchanged.
Any *ARC_TO
segments are transformed, but the endpoint
parametrization of the resulting arc segments are implementation-dependent.
The results of calling vgInterpolatePath
on a transformed path
that contains such segments are undefined.
The VG_PATH_CAPABILITY_TRANSFORM_FROM
capability must be
enabled for srcPath
, and the VG_PATH_CAPABILITY_TRANSFORM_TO
capability must be enabled for dstPath
.
Overflow may occur silently if coordinates are transformed outside the
datatype range of dstPath
.
VG_BAD_HANDLE_ERROR
dstPath
or srcPaths
are not a valid path handle, or is not shared with the current contextVG_PATH_CAPABILITY_ERROR
VG_PATH_CAPABILITY_TRANSFORM_FROM
is not enabled for srcPath
VG_PATH_CAPABILITY_TRANSFORM_TO
is not enabled for dstPath
dstPath
- The destination VGPath
handle of the path to be transformed.srcPath
- The source VGPath
handle of the path to transform from.boolean vgInterpolatePath(int dstPath, int startPath, int endPath, float amount)
vgInterpolatePath
function appends a path, defined by interpolation (or extrapolation)
between the paths startPath
and endPath
by the given amount,
to the path dstPath
. It returns VG_TRUE
if interpolation was
successful (i.e., the paths had compatible segment types after normalization),
and VG_FALSE
otherwise. If interpolation is unsuccessful, dstPath
is left unchanged.
It is legal for dstPath
to be a handle to the same path object as
either startPath
or endPath
or both, in which case the contents
of the source path or paths referenced by dstPath
will have the interpolated path appended.
If dstPath
is not the a handle to the same path object as either startPath
or endPath
, the contents of startPath
and endPath
will not be
affected by the call.
Overflow may occur silently if the datatype of dstPath
has insufficient range to store an
interpolated coordinate value.
The VG_PATH_CAPABILITY_INTERPOLATE_FROM
capability must be enabled for both of
startPath
and endPath
, and the VG_PATH_CAPABILITY_INTERPOLATE_TO
capability must be enabled for dstPath
.
VG_BAD_HANDLE_ERROR
dstPath
, startPath
or endPath
are not a valid path handle,
or is not shared with the current contextVG_PATH_CAPABILITY_ERROR
VG_PATH_CAPABILITY_PATH_INTERPOLATE_TO
is not enabled for dstPath
VG_PATH_CAPABILITY_PATH_INTERPOLATE_FROM
is not enabled for
stargPath
and endPath
dstPath
- The destination VGPath
handle of the path to be transformed.startPath
- The starting VGPath
handle to interpolate from.endPath
- The ending VGPath
handle to interpolate to.amount
- The factor amount to interpolate or extrapolate by.
EGL_TRUE
if interpolation was successful and EGL_FALSE
if otherwise.float vgPathLength(int path, int startSegment, int numSegments)
vgPathLength
function returns the length of a given portion of a path in the
user coordinate system (that is, in the path’s own coordinate system, disregarding
any matrix settings). Only the subpath consisting of the numSegments
path
segments beginning with startSegment
(where the initial path segment
has index 0) is used. If an error occurs, -1.0f is returned.
The VG_PATH_CAPABILITY_PATH_LENGTH
capability must be enabled for path.
The length of a path is an approximation to the geometric length of a portion of a path
may be obtained by calling the vgPathLength function. MOVE_TO
segments and
implicit path closures (see Section 8.7.1) do not contribute to the path length.
CLOSE_PATH
segments have the same length as a LINE_TO
segment with the same endpoints.
VG_BAD_HANDLE_ERROR
path
are not a valid path handle, or is not shared with the current context.VG_PATH_CAPABILITY_ERROR
VG_PATH_CAPABILITY_PATH_LENGTH
is not enabled for path.VG_ILLEGAL_ARGUMENT_ERROR
startSegment
is less than 0 or greater than the index of the final path segment.numSegments
is less than or equal to 0.startSegment
+ numSegments
– 1) is less than 0 or greater than the
index of the final path segment.
path
- The VGPath
handle to measure on.startSegment
- The index of the starting segment to measure from.numSegments
- The number of segment to measure the path length across.
void vgPointAlongPath(int path, int startSegment, int numSegments, float distance, float[] pointData, int offset)
vgPointAlongPath
function returns the point lying a given
distance along a given portion of a path and the unit-length tangent
vector at that point. Only the subpath consisting of the numSegments
path segments beginning with startSegment
(where the initial path
segment has index 0) is used. For the remainder of this section we refer only
to this subpath when discussing paths.
If distance is less than or equal to 0, the starting point of the path is used.
If distance is greater than or equal to the path length (i.e., the value returned
by vgPathLength
when called with the same startSegment
and
numSegments
parameters), the visual ending point of the path is used.
Intermediate values return the (x, y) coordinates and tangent vector of the point at the given distance along the path. Because it is not possible in general to compute exact distances along a path, an implementation is not required to use exact computation even for segments where such computation would be possible. For example, the path:
MOVE_TO 0, 0; LINE_TO 10, 0 // draw a line of length 10 MOVE_TO 10, 10 // create a discontinuity LINE_TO 10, 20 // draw a line of length 10may return either (10, 0) or (10, 10) (or points nearby) as the point at distance 10.0. Implementations are not required to compute distances exactly, as long as they satisfy the constraint that as distance increases monotonically the returned point and tangent move forward monotonically along the path.
Where the implementation is able to determine that the point being queried lies exactly at a discontinuity or cusp, the incoming point and tangent should be returned. In the example above, returning the pre-discontinuity point (10, 0) and incoming tangent (1, 0) is preferred to returning the post-discontinuity point (10, 10) and outgoing tangent (0, 1).
The VG_PATH_CAPABILITY_POINT_ALONG_PATH
capability must be enabled for path.
If the reference arguments x and y are both non-NULL, and the
VG_PATH_CAPABILITY_POINT_ALONG_PATH
capability is enabled for path, the
point (x, y) is returned in x and y. Otherwise the variables referenced by
x and y are not written. If the reference arguments tangentX and tangentY are both
non-NULL, and the VG_PATH_CAPABILITY_TANGENT_ALONG_PATH
capability is
enabled for path, the geometric tangent vector at the point (x, y) is returned
in tangentX and tangentY. Otherwise the variables referenced by
tangentX and tangentY are not written.
Where the incoming tangent is defined, vgPointAlongPath
returns it.
Where only the outgoing tangent is defined, the outgoing tangent is returned.
The points returned by vgPointAlongPath
are not guaranteed to match
the path as rendered; some deviation is to be expected.
VG_BAD_HANDLE_ERROR
path
is not a valid path handle, or is not shared
with the current context.VG_PATH_CAPABILITY_ERROR
VG_PATH_CAPABILITY_POINT_ALONG_PATH
is not enabled for path.VG_PATH_CAPABILITY_TANGENT_ALONG_PATH
capability is not
enabled for path.VG_ILLEGAL_ARGUMENT_ERROR
startSegment
is less than 0 or greater than the index of the final path segment.numSegments
is less than or equal to 0.startSegment
+ numSegments
– 1) is less than 0 or greater than the
index of the final path segment.pointData
is null
.pointData
is not properly aligned.
path
- The VGPath
handle to find the point along.startSegment
- The index of the starting segment to measure from.numSegments
- The number of segment to measure the path length across.distance
- The distance along the path to calculate the point for.pointData
- The array of size 4. The data return in this is indexed x,y,tangentX,tangentY.offset
- The offset into the array.
IllegalArgumentException
- if offset
is negative or pointData.length - offset
is less than 4.void vgPointAlongPath(int path, int startSegment, int numSegments, float distance, FloatBuffer pointData)
Buffer
version of vgPointAlongPath
.
path
- The VGPath
handle to find the point along.startSegment
- The index of the starting segment to measure from.numSegments
- The number of segment to measure the path length across.distance
- The distance along the path to calculate the point for.pointData
- A buffer to store The data returned indexed as x,y,tangentX,tangentY.
IllegalArgumentException
- if pointData.GetRemaining()
is less than 4.VG10.vgPointAlongPath(int, int, int, float, float[], int)
void vgPathBounds(int path, float[] bounds, int offset)
vgPathBounds
function returns an axis-aligned bounding box that tightly bounds
the interior of the given path. Stroking parameters are ignored. If path is empty, the
bounds
minX and minY are set to 0 and width and height are set to -1.
If path contains a single point, minX and minY are set to the coordinates of the
point and width and height are set to 0.
The VG_PATH_CAPABILITY_PATH_BOUNDS
capability must be enabled for path.
VG_BAD_HANDLE_ERROR
path
are not a valid path handle, or is not shared with the current contextVG_PATH_CAPABILITY_ERROR
is not enabled for path
VG_ILLEGAL_ARGUMENT_ERROR
bounds
is null
.
path
- The VGPath
handle to find the bounds for.bounds
- The array of size 4, which will be filled with the bounds indexed as x, y, width, height.offset
- The offset into the bounds array.
IllegalArgumentException
- if offset
is negative or bounds.length - offset
is less than 4.void vgPathBounds(int path, FloatBuffer bounds)
Buffer
version of vgPathBounds
.
path
- The VGPath
handle to find the bounds for.bounds
- A buffer to store The data returned indexed as x,y,width,height.
IllegalArgumentException
- if bounds.GetRemaining()
is less than 4.VG10.vgPathBounds(int, float[], int)
void vgPathTransformedBounds(int path, float[] bounds, int offset)
vgPathTransformedBounds
function returns an axis-aligned
bounding box that is guaranteed to enclose the geometry of the given path
following transformation by the current path-user-to-surface transform.
The returned bounding box is not guaranteed to fit tightly around
the path geometry. If path
is empty, minX
and minY
are set to 0 and width
and height
are set to -1. If path
contains a single point, minX
and
minY
are set to the transformed coordinates of the point
and width
and height
are set to 0.
The VG_PATH_CAPABILITY_PATH_TRANSFORMED_BOUNDS
capability must be
enabled for path.
VG_BAD_HANDLE_ERROR
path
are not a valid path handle, or is not shared with the current contextVG_PATH_CAPABILITY_ERROR
is not enabled for path
VG_ILLEGAL_ARGUMENT_ERROR
bounds
is null
.
path
- The VGPath
handle to find the bounds for.bounds
- The array of size 4, which will be filled with the bounds indexed as x, y, width, height.offset
- The offset into the bounds array.
IllegalArgumentException
- if offset
is negative or bounds.length - offset
is less than 4.void vgPathTransformedBounds(int path, FloatBuffer bounds)
Buffer
version of vgPathTransformedBounds
.
path
- The VGPath
handle to find the bounds for.bounds
- A buffer to store The data returned indexed as x,y,width,height.
IllegalArgumentException
- if bounds.GetRemaining()
is less than 4.VG10.vgPathTransformedBounds(int,FloatBuffer)
void vgDrawPath(int path, int paintModes)
vgDrawPath
function can fill and/or stroke a path.
The paintModes
argument is a bitwise OR of values
from enumeration, determining whether the path is to be filled
(VG_FILL_PATH
), stroked (VG_STROKE_PATH
),
or both (VG_FILL_PATH
| VG_STROKE_PATH
).
If both filling and stroking are to be performed, the path is
first filled, then stroked.
Calling vgDrawPath
with a paintModes
argument of
VG_FILL_PATH
causes the given path to be filled, using
the paint defined for the VG_FILL_PATH
paint mode and
the current fill rule.
The matrix currently set for the VG_MATRIX_FILL_PAINT_TO_USER
matrix mode is applied to the paint used to fill the path outline.
The matrix currently set for the VG_MATRIX_PATH_USER_TO_SURFACE
matrix mode is used to transform the outline of the path and the
paint into surface coordinates.
Calling vgDrawPath
with a paintModes
argument
of VG_STROKE_PATH
causes the given path to be
stroked, using the paint defined for the VG_STROKE_PATH
paint mode and the current set of stroke parameters.
The matrix currently set for the VG_MATRIX_STROKE_PAINT_TO_USER
matrix mode is applied to the paint used to fill the stroked path outline.
The matrix currently set for the VG_MATRIX_PATH_USER_TO_SURFACE
matrix mode is used to transform the outline of the stroked path
and the paint into surface coordinates.
VG_BAD_HANDLE_ERROR
path
are not a valid path handle, or is not shared with the current contextVG_ILLEGAL_ARGUMENT_ERROR
VG_FILL_PATH
or VG_STROKE_PATH
.
path
- The VGPath
handle to draw.paintModes
- The drawing paint modes to be applied. Must be bitwise OR of values
from VG_FILL_PATH
or VG_STROKE_PATH
.int vgCreatePaint()
vgCreatePaint
function creates a new paint object that is initialized
to a set of default values and returns a VGPaint
handle to it.
If insufficient memory is available to allocate a new object,
VG_INVALID_HANDLE
is returned.
The VGPaint
represents an opaque handle to a paint object.
A VGPaint
object is live; changes to a VGPaint
object (using vgSetParameter
, or by altering an attached
pattern image) attached to a context will immediately affect drawing
calls on that context. If a VGPaint
object is accessed from multiple
threads, the application must ensure (using vgFinish along with application-level
synchronization primitives) that the paint definition is not altered from one
context while another context may still be using it for drawing.
VGPaint
object created or VG_INVALID_HANDLE
if
insufficient memory is available to allocate a new object.void vgDestroyPaint(int paint)
vgDestroyPaint
function deallocates resources associated with a paint object.
Following the call, the paint
handle is no longer valid in any of the
contexts that shared it. If the paint object is currently active in a drawing context,
the context continues to access it until it is replaced or the context is destroyed.
VG_BAD_HANDLE_ERROR
path
are not a valid path handle, or is not shared with the current context
paint
- The VGPaint
object to be destroyed.void vgSetPaint(int paint, int paintModes)
vgSetPaint
function sets Paint definitions on the current context.
The paintModes
argument is a bitwise OR of values from the enumeration,
VG_FILL_PATH
or VG_STROKE_PATH
, determining whether the paint object
is to be used for filling ( VG_FILL_PATH
), stroking ( VG_STROKE_PATH
),
or both ( VG_FILL_PATH
| VG_STROKE_PATH
). The current paint replaces
the previously set paint object, if any, for the given paint mode or modes. If paint
is
equal to VG_INVALID_HANDLE
, the previously set paint object for the given mode
(if present) is removed and the paint settings are restored to their default values.
VG_BAD_HANDLE_ERROR
paint
is neither a valid paint handle nor equal to VG_INVALID_HANDLE
,
or is not shared with the current contextVG_ILLEGAL_ARGUMENT_ERROR
VG_FILL_PATH
or VG_STROKE_PATH
.
paint
- The VGPaint
to be set on the current context.paintModes
- The paint modes to be used for this paint specified. Must be bitwise OR of values
from VG_FILL_PATH
or VG_STROKE_PATH
.int vgGetPaint(int paintMode)
vgGetPaint
function returns the paint object currently set for the given paintMode
,
or VG_INVALID_HANDLE
if an error occurs or if no paint object is set (i.e., the default
paint is present) on the given context with the given paintMode
.
VG_ILLEGAL_ARGUMENT_ERROR
VG_FILL_PATH
or VG_STROKE_PATH
.
paintMode
- The paint mode VG_FILL_PATH
or VG_STROKE_PATH
to return the current paint for.
void vgSetColor(int paint, int rgba)
vgSetColor
function acts as a shorthand to allow the VG_PAINT_COLOR
parameter of a given paint object to be set using a 32-bit non-premultiplied sRGBA_8888
representation. The rgba parameter is a int with 8 bits of red starting at the most
significant bit, followed by 8 bits each of green, blue, and alpha. Each color or
alpha channel value is conceptually divided by 255.0f to obtain a value between 0 and 1.
The code:
int paint; int rgba; vgSetColor(paint, rgba)Is equivalent to the code:
float rgba_f[4]; rgba_f[0] = ((rgba >> 24) & 0xff)/255.0f; rgba_f[1] = ((rgba >> 16) & 0xff)/255.0f; rgba_f[2] = ((rgba >> 8) & 0xff)/255.0f; rgba_f[3] = ( rgba & 0xff)/255.0f; vgSetParameterfv(paint, VG_PAINT_COLOR, 4, rgba_f);
VG_BAD_HANDLE_ERROR
paint
is not a valid paint handle, or is not shared
with the current context.
paint
- The VGPaint
to be set the color for.rgba
- The 32-bit non-premultiplied sRGBA_8888 color to be set.int vgGetColor(int paint)
vgGetColor
function returns the current setting of
the VG_PAINT_COLOR
parameter on a given paint object
may be queried as a 32-bit non-premultiplied sRGBA_8888 value.
Each color channel or alpha value is clamped to the [0, 1] range,
multiplied by 255, and rounded to obtain an 8-bit integer;
the resulting values are packed into a 32-bit value in the same
format as for vgSetColor
.
The code:
int paint; int rgba; rgba = vgGetColor(paint);Is equivalent to the code:
#define CLAMP(x) ((x) < 0.0f ? 0.0f : ((x) > 1.0f ? 1.0f : (x))) float rgba_f[4]; int red, green, blue, alpha; vgGetParameterfv(paint, VG_PAINT_COLOR, 4, rgba_f); // Clamp color and alpha values from vgGetParameterfv to the [0, 1] range, // scale to 8 bits, and round to integer. red = (int)(CLAMP(rgba_f[0])*255.0f + 0.5f); green = (int)(CLAMP(rgba_f[1])*255.0f + 0.5f); blue = (int)(CLAMP(rgba_f[2])*255.0f + 0.5f); alpha = (int)(CLAMP(rgba_f[3])*255.0f + 0.5f); rgba = (red << 24) | (green << 16) | (blue << 8) | alpha;
VG_BAD_HANDLE_ERROR
paint
is not a valid paint handle, or is not shared
with the current context.
paint
- The VGPaint
to be retrieve the color for.
void vgPaintPattern(int paint, int pattern)
vgPaintPattern
function replaces any previous pattern image defined
on the given paint object for the given set of paint modes with a new pattern image.
A value of VG_INVALID_HANDLE
for the pattern parameter removes the
current pattern image from the paint object.
If the current paint object has its VG_PAINT_TYPE
parameter set
to VG_PAINT_TYPE_PATTERN
, but no pattern image is set, the
paint object behaves as if VG_PAINT_TYPE
were set to VG_PAINT_TYPE_COLOR
.
While an image is set as the paint pattern for any paint object, it may not be used as a rendering target. Conversely, an image that is currently a rendering target may not be set as a paint pattern.
VG_BAD_HANDLE_ERROR
paint
is not a valid paint handle, or is not shared with the current contextpattern
is neither a valid image handle nor equal to VG_INVALID_HANDLE
,
or is not shared with the current contextVG_IMAGE_IN_USE_ERROR
pattern
is currently a rendering target
paint
- the VGPaint
to set the image pattern on.pattern
- The VGImage
to bet applied as the patter image for the paint.int vgCreateImage(int format, int width, int height, int allowedQuality)
vgCreateImage
function creates an image with the
given width
, height
, and pixel format
and returns a VGImage
handle to it. If an error
occurs, VG_INVALID_HANDLE
is returned. All color and
alpha channel values are initially set to zero. The format parameter
must contain a format value. The allowedQuality
parameter is a
bitwise OR of values VG_IMAGE_QUALITY_NONANTIALIASED
,
VG_IMAGE_QUALITY_FASTER
or VG_IMAGE_QUALITY_BETTER
indicating which levels of resampling quality may be used to draw the image.
It is always possible to draw an image using the
VG_IMAGE_QUALITY_NONANTIALIASED
quality setting even if it is
not explicitly specified.
The VG_IMAGE_QUALITY_NONANTIALIASED
setting disables resampling;
images are drawn using point sampling (also known as nearest-neighbor interpolation) only.
VG_IMAGE_QUALITY_FASTER
enables low-to-medium quality resampling that does
not require extensive additional resource allocation. VG_IMAGE_QUALITY_BETTER
enables high-quality resampling that may allocate additional memory for pre-filtering,
tables, and the like. Implementations are not required to provide three distinct resampling
algorithms, but the non-antialiased (point sampling) mode must be supported.
VG_UNSUPPORTED_IMAGE_FORMAT_ERROR
format
is not a valid image format.VG_ILLEGAL_ARGUMENT_ERROR
width
or height
are less than or equal to 0width
is greater than VG_MAX_IMAGE_WIDTH
height
is greater than VG_MAX_IMAGE_HEIGHT
width
*height
is greater than VG_MAX_IMAGE_PIXELS
width
*height
*(pixel size of format
) is
greater than VG_MAX_IMAGE_BYTES
allowedQuality
is not a bitwise OR of values from VG_IMAGE_QUALITY_NONANTIALIASED
,
VG_IMAGE_QUALITY_FASTER
or VG_IMAGE_QUALITY_BETTER
.
format
- The image format to be used.
The following symbolic values are accepted:
VG_sRGBX_8888
, VG_sRGBA_8888
, VG_sRGBA_8888_PRE
,
VG_sRGB_565
, VG_sRGBA_5551
, VG_sRGBA_4444
,
VG_sL_8
, VG_lRGBX_8888
, VG_lRGBA_8888
,
VG_lRGBA_8888_PRE
, VG_lL_8
, VG_A_8
,
VG_BW_1
, VG_A_1
, VG_A_4
, VG_sXRGB_8888
,
VG_sARGB_8888
, VG_sARGB_8888_PRE
, VG_sARGB_1555
,
VG_sARGB_4444
, VG_lXRGB_8888
, VG_lARGB_8888
,
VG_lARGB_8888_PRE
, VG_sBGRX_8888
, VG_sBGRA_8888
,
VG_sBGRA_8888_PRE
, VG_sBGR_565
, VG_sBGRA_5551
,
VG_sBGRA_4444
, VG_lBGRX_8888
, VG_lBGRA_8888
,
VG_lBGRA_8888_PRE
, VG_sXBGR_8888
, VG_sABGR_8888
,
VG_sABGR_8888_PRE
, VG_sABGR_1555
, VG_sABGR_4444
,
VG_lXBGR_8888
, VG_lABGR_8888
, and VG_lABGR_8888_PRE
.width
- The width of the image to be created.height
- The height of the image to be created.allowedQuality
- The quality allowed as a bitwise OR of values
from VG_IMAGE_QUALITY_NONANTIALIASED
, VG_IMAGE_QUALITY_FASTER
or VG_IMAGE_QUALITY_BETTER
.
VGImage
or VG_INVALID_HANDLE
if an error occurred.void vgDestroyImage(int image)
vgDestroyImage
function deallocates resources associated with an image.
Following the call, the image
handle is no longer valid in any context
that shared it. If the image
is currently in use as a rendering target,
is the ancestor of another image (see vgChildImage
), or is set as a paint
pattern image on a VGPaint
object, its definition remains available to
those consumers as long as they remain valid, but the handle may no longer be used.
When those uses cease, the image’s resources will automatically be deallocated.
VG_BAD_HANDLE_ERROR
image
is not a valid image handle, or is not shared
with the current context
image
- The image to be destroyed.void vgClearImage(int image, int x, int y, int width, int height)
vgClearImage
function fills a given rectangle of an image
with the
color specified by the VG_CLEAR_COLOR
parameter. The rectangle to be cleared is
given by x
, y
, width
, and height
,
which must define a positive region. The rectangle is clipped to the bounds of the image
.
VG_BAD_HANDLE_ERROR
image
is not a valid image handle, or is not shared with the current contextVG_IMAGE_IN_USE_ERROR
image
is currently a rendering targetVG_ILLEGAL_ARGUMENT_ERROR
width
or height
is less than or equal to 0.
image
- The VGImage
to be cleared.x
- The x position of the rectangular clear bounds.y
- The y position of the rectangular clear bounds.width
- The width of the rectangular clear bounds.height
- The height of the rectangular clear bounds.void vgImageSubData(int image, Buffer data, int dataStride, int dataFormat, int x, int y, int width, int height)
vgImageSubData
function reads pixel values from memory,
performs format conversion if necessary, and stores the resulting
pixels into a rectangular portion of an image
.
Pixel values are read starting at the address given by the pointer data
;
adjacent scanlines are separated by dataStride
bytes. Negative or zero
values of dataStride are allowed. The region to be written is given
by x
, y
, width
, and height
,
which must define a positive region. Pixels that fall outside the bounds of
the image are ignored.
Pixel values in memory are formatted according to the dataFormat
parameter,
which must contain a valid image format. The data
must be aligned according
to the number of bytes of the pixel format specified by dataFormat
, unless
dataFormat
is equal to VG_BW_1
, in which case 1 byte alignment
is sufficient. Each pixel is converted into the format of the destination image as it
is written.
If dataFormat
is not equal to VG_BW_1
, the destination image
pixel (x + i, y + j) for 0 <= i < width and 0 <= j < height is taken from the N bytes
of memory starting at data + j*dataStride + i*N, where N is the number of bytes per pixel
given in Table 12. For multi-byte pixels, the bits are arranged in the same order used to
store native multi-byte primitive datatypes. For example, a 16-bit pixel would be written
to memory in the same format as when writing through a pointer with a
native 16-bit integral datatype.
If dataFormat
is equal to VG_BW_1
, pixel (x + i, y + j) of the
destination image is taken from the bit at position (i % 8) within the byte at
data + j*dataStride + floor(i/8) where the least significant bit (LSB) of a byte is
considered to be at position 0 and the most significant bit (MSB) is at position 7.
Each scanline must be padded to a multiple of 8 bits. Note that dataStride is always
given in terms of bytes, not bits.
If dataFormat
specifies a premultiplied format (VG_sRGBA_8888_PRE
or VG_lRGBA_8888_PRE
), color channel values of a pixel greater than their
corresponding alpha value are clamped to the alpha value.
VG_BAD_HANDLE_ERROR
image
is not a valid image handle, or is not shared with the current context.VG_IMAGE_IN_USE_ERROR
image
is currently a rendering target.VG_UNSUPPORTED_IMAGE_FORMAT_ERROR
dataFormat
is not a valid value.VG_ILLEGAL_ARGUMENT_ERROR
width
or height
is less than or equal to 0.data
is null
.data
is not properly aligned.
image
- The VGImage
to be loaded.data
- the Buffer
of data to be loaded into the image.dataStride
- The stride of the image to be used reading the data.dataFormat
- The image data format to be loaded as.
The following symbolic values are accepted:
VG_sRGBX_8888
, VG_sRGBA_8888
, VG_sRGBA_8888_PRE
,
VG_sRGB_565
, VG_sRGBA_5551
, VG_sRGBA_4444
,
VG_sL_8
, VG_lRGBX_8888
, VG_lRGBA_8888
,
VG_lRGBA_8888_PRE
, VG_lL_8
, VG_A_8
,
VG_BW_1
, VG_A_1
, VG_A_4
, VG_sXRGB_8888
,
VG_sARGB_8888
, VG_sARGB_8888_PRE
, VG_sARGB_1555
,
VG_sARGB_4444
, VG_lXRGB_8888
, VG_lARGB_8888
,
VG_lARGB_8888_PRE
, VG_sBGRX_8888
, VG_sBGRA_8888
,
VG_sBGRA_8888_PRE
, VG_sBGR_565
, VG_sBGRA_5551
,
VG_sBGRA_4444
, VG_lBGRX_8888
, VG_lBGRA_8888
,
VG_lBGRA_8888_PRE
, VG_sXBGR_8888
, VG_sABGR_8888
,
VG_sABGR_8888_PRE
, VG_sABGR_1555
, VG_sABGR_4444
,
VG_lXBGR_8888
, VG_lABGR_8888
, and VG_lABGR_8888_PRE
.x
- The x position of data buffer to be loaded.y
- The y position of data buffer to be loaded.width
- The width of data buffer to be loaded.height
- The height of data buffer to be loaded.void vgGetImageSubData(int image, Buffer data, int dataStride, int dataFormat, int x, int y, int width, int height)
vgGetImageSubData
function reads pixel values from a rectangular portion of
an image
, performs format conversion if necessary, and stores the
resulting pixels into memory. Pixel values are written starting at the address given by
the data
; adjacent scanlines are separated by dataStride
bytes.
Negative or zero values of dataStride
are allowed. The region to be read is
given by x
, y
, width
, and height
,
which must define a positive region.
Pixels that fall outside the bounds of the image are ignored.
Pixel values in memory are formatted according to the dataFormat
parameter,
which must contain a value. The data
must be aligned according to the
number of bytes of the pixel format specified by dataFormat
,
unless dataFormat
is equal to VG_BW_1
, in which case 1 byte
alignment is sufficient. Each pixel is converted from the format of the source
image as it is read.
The pixel layout in memory is identical to that of vgImageSubData
.
VG_BAD_HANDLE_ERROR
image
is not a valid image handle, or is not shared with the current context.VG_IMAGE_IN_USE_ERROR
image
is currently a rendering target.VG_UNSUPPORTED_IMAGE_FORMAT_ERROR
dataFormat
is not a valid value.VG_ILLEGAL_ARGUMENT_ERROR
width
or height
is less than or equal to 0.data
is null
.data
is not properly aligned.
image
- The VGImage
to be loaded.data
- the Buffer
of data to be loaded into the image.dataStride
- The stride of the image to be used reading the data.dataFormat
- The image data format to be loaded as.
The following symbolic values are accepted:
VG_sRGBX_8888
, VG_sRGBA_8888
, VG_sRGBA_8888_PRE
,
VG_sRGB_565
, VG_sRGBA_5551
, VG_sRGBA_4444
,
VG_sL_8
, VG_lRGBX_8888
, VG_lRGBA_8888
,
VG_lRGBA_8888_PRE
, VG_lL_8
, VG_A_8
,
VG_BW_1
, VG_A_1
, VG_A_4
, VG_sXRGB_8888
,
VG_sARGB_8888
, VG_sARGB_8888_PRE
, VG_sARGB_1555
,
VG_sARGB_4444
, VG_lXRGB_8888
, VG_lARGB_8888
,
VG_lARGB_8888_PRE
, VG_sBGRX_8888
, VG_sBGRA_8888
,
VG_sBGRA_8888_PRE
, VG_sBGR_565
, VG_sBGRA_5551
,
VG_sBGRA_4444
, VG_lBGRX_8888
, VG_lBGRA_8888
,
VG_lBGRA_8888_PRE
, VG_sXBGR_8888
, VG_sABGR_8888
,
VG_sABGR_8888_PRE
, VG_sABGR_1555
, VG_sABGR_4444
,
VG_lXBGR_8888
, VG_lABGR_8888
, and VG_lABGR_8888_PRE
.x
- The x position of data buffer to be loaded.y
- The y position of data buffer to be loaded.width
- The width of data buffer to be loaded.height
- The height of data buffer to be loaded.int vgChildImage(int parent, int x, int y, int width, int height)
vgChildImage
function returns a new VGImage
handle
that refers to a portion of the parent
image. The region is given
by the intersection of the bounds of the parent
image with the rectangle
beginning at pixel (x
, y
) with dimensions width
and height
, which must define a positive region contained entirely
within parent
.
A child image is an image that shares physical storage with a portion of an existing image, known as its parent. An image may have any number of children, but each image has only one parent (that may be itself). An ancestor of an image is defined as the image itself, its parent, its parent’s parent, etc. Thus a pair of images share storage if and only if they have a common ancestor. Changes to an image are immediately reflected in all other images that share storage with it.
A child image remains valid even following a call to vgDestroyImage on one of its ancestors (other than itself). When the last image of a set of images that share pixel storage is destroyed, the storage will be reclaimed. Implementations may use a reference count to determine when image storage may be reclaimed.
An image that shares storage with any other image may not be used as a rendering target until all the images with which it shares storage have been destroyed.
VG_BAD_HANDLE_ERROR
parent
is not a valid image handle, or is not shared with the current context.VG_IMAGE_IN_USE_ERROR
parent
is currently a rendering target.VG_ILLEGAL_ARGUMENT_ERROR
x
is less than 0 or greater than or equal to the parent
width.y
is less than 0 or greater than or equal to the parent
height.width
or height
is less than or equal to 0.x
+ width
is greater than the parent
width.y
+ height
is greater than the parent
height.
parent
- The parent image to create the child image from.x
- The x position of the shared region of the parent image.y
- The y position of the shared region of the parent image.width
- The width of the shared region of the parent image.height
- The height of the shared region of the parent image.
int vgGetParent(int image)
vgGetParent
function returns the parent of the given image
.
If image
has no parent, image
is returned.
VG_BAD_HANDLE_ERROR
image
is not a valid image handle, or is not shared with the current context.VG_IMAGE_IN_USE_ERROR
image
is currently a rendering target.
image
- The image to retrieve the parent image of.
image
or the
image
if it has not parent.void vgCopyImage(int dst, int dx, int dy, int src, int sx, int sy, int width, int height, boolean dither)
vgCopyImage
function copies pixels between images.
The source image pixel (sx + i, sy + j) is copied to the destination image
pixel (dx + i, dy + j), for 0 <= i < width and 0 <= j < height.
Pixels whose source or destination lie outside of the bounds of the
respective image are ignored. Pixel format conversion is applied as needed.
If the dither
flag is equal to VG_TRUE
, an
implementation-dependent dithering algorithm may be applied. This may be
useful when copying into a destination image with a smaller color bit
depth than that of the source image. Implementations should choose an
algorithm that will provide good results when the output images are
displayed as successive frames in an animation.
If src
and dst
are the same image, or have a common
ancestor and thus share storage, the copy will occur in a consistent fashion
as though the source pixels were first copied into a temporary buffer
and then copied from the temporary buffer to the destination.
VG_BAD_HANDLE_ERROR
dst
or src
is not a valid image handle,
or is not shared with the current context.VG_IMAGE_IN_USE_ERROR
dst
or src
are currently a rendering target.VG_ILLEGAL_ARGUMENT_ERROR
width
or height
is less than or equal to 0.
dst
- The destination image to copy to.dx
- The destination x position to copy to.dy
- The destination y position to copy to.src
- The source image to copy from.sx
- The source x position to copy from.sy
- The source y position to copy from.width
- The copy width.height
- The copy height.dither
- true
if the copy should also apply a platform-independent dither.void vgDrawImage(int image)
vgDrawImage
function draws an image to the current drawing surface.
The current image-user-to-surface transformation Ti is applied to the image,
so that the image pixel centered at (px + ½, py + ½) is mapped to the
point (Ti)(px + ½, py + ½). In practice, backwards mapping may be used.
That is, a sample located at (x, y) in the surface coordinate system is
colored according to an interpolated image pixel value at the point (Ti)-1(x, y)
in the image coordinate system. If Ti is non-invertible (or nearly so, within
the limits of numerical accuracy), no drawing occurs.
Interpolation is done in the color space of the image. Image color values are processed in premultiplied alpha format during interpolation.
When a projective transformation is used (i.e., the bottom row of the image-user-to-surface transformation contains values [ w0 w1 w2 ] different from [ 0 0 1 ]), each corner point (x, y) of the image must result in a positive value of d = (x*w0 + y*w1 + w2), or else nothing is drawn. This rule prevents degeneracies due to transformed image points passing through infinity, which occurs when d passes through 0. By requiring d to be positive at the corners, it is guaranteed to be positive at all interior points as well.
When a projective transformation is used, the value of the VG_IMAGE_MODE
parameter is ignored and the behavior of VG_DRAW_IMAGE_NORMAL
is
substituted. This avoids the need to generate paint pixels in perspective.
The set of pixels affected consists of the quadrilateral with vertices (Ti)(0, 0), (Ti)(w, 0), (Ti)(w, h), and (Ti)(0, h) (where w and h are respectively the width and height of the image), plus a boundary of up to 1½ pixels for filtering purposes.
Clipping, masking, and scissoring are applied in the same manner
as with vgDrawPath
. To limit drawing to a subregion of the image,
create a child image using vgChildImage
.
The image quality will be the maximum quality allowed by the
image (as determined by the allowedQuality
parameter to
vgCreateImage
) that is not higher than the current setting
of VG_IMAGE_QUALITY
.
VG_BAD_HANDLE_ERROR
image
is not a valid image handle, or is not shared with
the current context.VG_IMAGE_IN_USE_ERROR
image
is currently a rendering target.
image
- The VGImage
to be drawn to the current surface.void vgSetPixels(int dx, int dy, int src, int sx, int sy, int width, int height)
vgSetPixels
function copies pixel data from the image src
onto the drawing surface. The image pixel (sx + i, sy + j) is copied
to the drawing surface pixel (dx + i, dy + j), for 0 <= i < width and 0 <= j < height.
Pixels whose source lies outside of the bounds of src
or whose destination
lies outside the bounds of the drawing surface are ignored. Pixel format conversion
is applied as needed. Scissoring takes place normally. Transformations, masking,
and blending are not applied.
VG_BAD_HANDLE_ERROR
src
is not a valid image handle, or is not shared with the current context.VG_IMAGE_IN_USE_ERROR
src
are currently a rendering target.VG_ILLEGAL_ARGUMENT_ERROR
width
or height
is less than or equal to 0.
dx
- The destination x position to copy.dy
- The destination y position to copy.src
- The source image to copy from.sx
- The source x position to copy from.sy
- The source y position to copy from.width
- The copy width.height
- The copy height.void vgWritePixels(Buffer data, int dataStride, int dataFormat, int dx, int dy, int width, int height)
vgWritePixels
function allows pixel data to be copied to the
drawing surface without the creation of a VGImage
object. The pixel values
to be drawn are taken from the data pointer at the time of the vgWritePixels
call, so future changes to the data have no effect. The effects of changes to the
data by another thread at the time of the call to vgWritePixels
are undefined.
The dataFormat
parameter must contain a value from the VGImageFormat
.
If dataFormat
is not equal to VG_BW_1
, data must be aligned
according to the number of bytes of dataFormat
, and the pixel at memory
location data + j*dataStride + i*(bytes per pixel of dataFormat) is written to the
drawing surface pixel (dx + i, dy + j), for 0 <= i < width and 0 <= j < height.
If dataFormat
is equal to VG_BW_1
, data must only be
1-byte aligned, and pixel (dx + i, dy + j) of the destination image is taken from the bit
at position (i % 8) within the byte at data + j*dataStride + floor(i/8) where the least
significant bit (LSB) of a byte is considered to be at position 0 and the most significant
bit (MSB) is at position 7.
If dataFormat
specifies a premultiplied format (VG_sRGBA_8888_PRE
or
VG_lRGBA_8888_PRE
), color channel values of a pixel greater than their
corresponding alpha value are clamped to the alpha value.
Pixels whose destination coordinate lies outside the bounds of the drawing surface are ignored. Pixel format conversion is applied as needed. Scissoring takes place normally. Transformations, masking, and blending are not applied.
The code:
Buffer data; int dataFormat; int dataStride; int dx, dy, width, height; vgWritePixels(data, dataStride, dataFormat, dx, dy, width, height);Is equivalent to the code:
int image; Buffer data; int dataFormat; int dataStride; int dx, dy, width, height; image = vgCreateImage(dataFormat, width, height, 0); vgImageSubData(image, data, dataStride, dataFormat, 0, 0, width, height); vgSetPixels(dx, dy, image, width, height); vgDestroyImage(image);
VG_UNSUPPORTED_IMAGE_FORMAT_ERROR
dataFormat
is not a valid value.VG_ILLEGAL_ARGUMENT_ERROR
width
or height
is less than or equal to 0.data
is null
.data
is not properly aligned.
data
- The data Buffer
to copy.dataStride
- The data stride to use when reading the data.dataFormat
- The image format of the data.
The following symbolic values are accepted:
VG_sRGBX_8888
, VG_sRGBA_8888
, VG_sRGBA_8888_PRE
,
VG_sRGB_565
, VG_sRGBA_5551
, VG_sRGBA_4444
,
VG_sL_8
, VG_lRGBX_8888
, VG_lRGBA_8888
,
VG_lRGBA_8888_PRE
, VG_lL_8
, VG_A_8
,
VG_BW_1
, VG_A_1
, VG_A_4
, VG_sXRGB_8888
,
VG_sARGB_8888
, VG_sARGB_8888_PRE
, VG_sARGB_1555
,
VG_sARGB_4444
, VG_lXRGB_8888
, VG_lARGB_8888
,
VG_lARGB_8888_PRE
, VG_sBGRX_8888
, VG_sBGRA_8888
,
VG_sBGRA_8888_PRE
, VG_sBGR_565
, VG_sBGRA_5551
,
VG_sBGRA_4444
, VG_lBGRX_8888
, VG_lBGRA_8888
,
VG_lBGRA_8888_PRE
, VG_sXBGR_8888
, VG_sABGR_8888
,
VG_sABGR_8888_PRE
, VG_sABGR_1555
, VG_sABGR_4444
,
VG_lXBGR_8888
, VG_lABGR_8888
, and VG_lABGR_8888_PRE
.dx
- The destination x position to copy to.dy
- The destination y position to copy to.width
- The copy width.height
- The copy height.void vgGetPixels(int dst, int dx, int dy, int sx, int sy, int width, int height)
vgGetPixels
function retrieves pixel data from the drawing surface into
the image dst
. The drawing surface pixel (sx + i, sy + j) is
copied to pixel (dx + i, dy + j) of the image dst, for 0 <= i < width and 0 <= j < height.
Pixels whose source lies outside of the bounds of the drawing surface or whose
destination lies outside the bounds of dst are ignored. Pixel format conversion
is applied as needed. The scissoring region does not affect the reading of pixels.
VG_BAD_HANDLE_ERROR
dst
is not a valid image handle, or is not shared with the current context.VG_IMAGE_IN_USE_ERROR
dst
is currently a rendering target.VG_ILLEGAL_ARGUMENT_ERROR
width
or height
is less than or equal to 0
dst
- The destination image to store the pixel data to.dx
- The destination x postion.dy
- The destination y postion.sx
- The source x position.sy
- The source x position.width
- The copy width.height
- The copy height.void vgReadPixels(Buffer data, int dataStride, int dataFormat, int sx, int sy, int width, int height)
vgReadPixels
function enables you to copy pixel data from the drawing
surface without the creation of a VGImage
object.
The dataFormat
parameter must contain a value.
If dataFormat
is not equal to VG_BW_1
, data must be aligned
according to the number of bytes of dataFormat
, and the drawing surface
pixel (sx + i, sy + j) is written to the memory location data + j*dataStride + i*(bytes
per pixel of dataFormat), for 0 <= i < width and 0 <= j < height.
If dataFormat
is equal to VG_BW_1
, data must only be 1-byte
aligned, and the drawing surface pixel (sx + i, sy + j) is written to the bit at
position (i % 8) within the byte at data + j*dataStride + floor(i/8) where the
least significant bit (LSB) of a byte is considered to be at position 0 and the
most significant bit (MSB) is at position 7.
Pixels whose source lies outside of the bounds of the drawing surface are ignored. Pixel format conversion is applied as needed. The scissoring region does not affect the reading of pixels.
The code:
Buffer data; int dataFormat; int dataStride; int sx, sy, width, height; vgReadPixels(data, dataStride, dataFormat, sx, sy, width, height);Is equivalent to the code:
int image; Buffer data; int dataFormat; int sx, sy, width, height; image = vgCreateImage(dataFormat, width, height, 0); vgGetPixels(image, 0, 0, sx, sy, width, height); vgGetImageSubData(image, data, dataStride, dataFormat, width, height); vgDestroyImage(image);
VG_UNSUPPORTED_IMAGE_FORMAT_ERROR
dataFormat
is not a valid valueVG_ILLEGAL_ARGUMENT_ERROR
width
or height
is less than or equal to 0data
is null
.data
is not properly aligned
data
- The data Buffer
to copy.dataStride
- The data stride to use when reading the data.dataFormat
- The image format of the data.
The following symbolic values are accepted:
VG_sRGBX_8888
, VG_sRGBA_8888
, VG_sRGBA_8888_PRE
,
VG_sRGB_565
, VG_sRGBA_5551
, VG_sRGBA_4444
,
VG_sL_8
, VG_lRGBX_8888
, VG_lRGBA_8888
,
VG_lRGBA_8888_PRE
, VG_lL_8
, VG_A_8
,
VG_BW_1
, VG_A_1
, VG_A_4
, VG_sXRGB_8888
,
VG_sARGB_8888
, VG_sARGB_8888_PRE
, VG_sARGB_1555
,
VG_sARGB_4444
, VG_lXRGB_8888
, VG_lARGB_8888
,
VG_lARGB_8888_PRE
, VG_sBGRX_8888
, VG_sBGRA_8888
,
VG_sBGRA_8888_PRE
, VG_sBGR_565
, VG_sBGRA_5551
,
VG_sBGRA_4444
, VG_lBGRX_8888
, VG_lBGRA_8888
,
VG_lBGRA_8888_PRE
, VG_sXBGR_8888
, VG_sABGR_8888
,
VG_sABGR_8888_PRE
, VG_sABGR_1555
, VG_sABGR_4444
,
VG_lXBGR_8888
, VG_lABGR_8888
, and VG_lABGR_8888_PRE
.sx
- The source x position to copy to.sy
- The source y position to copy to.width
- The read width.height
- The read height.void vgCopyPixels(int dx, int dy, int sx, int sy, int width, int height)
vgCopyPixels
function copies pixels from one region
of the drawing surface to another. Copies between overlapping regions
are allowed and always produce consistent results identical to copying
the entire source region to a scratch buffer followed by copying the
scratch buffer into the destination region.
The drawing surface pixel (sx + i, sy + j) is copied to pixel (dx + i, dy + j) for 0 <= i < width and 0 <= j < height. Pixels whose source or destination lies outside of the bounds of the drawing surface are ignored. Transformations, masking, and blending are not applied. Scissoring is applied to the destination, but does not affect the reading of pixels.
VG_ILLEGAL_ARGUMENT_ERROR
width
or height
is less than or equal to 0
dx
- The destination x postion.dy
- The destination y postion.sx
- The source x position.sy
- The source x position.width
- The copy width.height
- The copy height.void vgColorMatrix(int dst, int src, float[] matrix, int offset)
vgColorMatrix
function computes a linear combination of color
and alpha values (Rsrcsrc, Gsrcsrc, Bsrcsrc, ?srcsrc) from the normalized
source image src at each pixel:
|Rdst| |m00 m01 m02 m03| |Rsrc| |m04| |Gdst| = |m10 m11 m12 m13| * |Rsrc| + |m14| |Bdst| |m20 m21 m22 m23| |Rsrc| |m24| |Adst| |m30 m31 m32 m33| |Rsrc| |m34| or: Rdst = m00*Rsrc + m01*Gsrc + m02*Bsrc + m03*Asrc + m04 Gdst = m10*Rsrc + m11*Gsrc + m12*Bsrc + m13*Asrc + m14 Bdst = m20*Rsrc + m21*Gsrc + m22*Bsrc + m23*Asrc + m24 Adst = m30*Rsrc + m31*Gsrc + m32*Bsrc + m33*Asrc + m34
The matrix
entries are supplied in the matrix
argument in the order:
{ m00, m10, m20, m30, m01, m11, m21, m31, m02, m12, m22, m32, m03, m13, m23, m33, m04, m14, m24, m34 }.
VG_BAD_HANDLE_ERROR
dst
or src
is not a valid image handle,
or is not shared with the current context.VG_IMAGE_IN_USE_ERROR
dst
or src
is currently a rendering target.VG_ILLEGAL_ARGUMENT_ERROR
dst
or src
overlap.matrix
is null
.matrix
is not properly aligned.
dst
- The destination VGImage
src
- The source VGImage
matrix
- The matrix to be used.offset
- The offset into the array.
IllegalArgumentException
- if offset
is negative or matrix.length - offset
is less than 16.void vgColorMatrix(int dst, int src, FloatBuffer matrix)
Buffer
version of vgColorMatrix
.
dst
- The destination VGImage
src
- The source VGImage
matrix
- The matrix buffer to be used.
IllegalArgumentException
- if matrix.GetRemaining()
is less than 16.VG10.vgColorMatrix(int dst, int src, float[] matrix, int offset)
void vgConvolve(int dst, int src, int kernelWidth, int kernelHeight, int shiftX, int shiftY, ShortBuffer kernel, float scale, float bias, int tilingMode)
vgConvolve
function applies a user-supplied convolution kernel
to a normalized source image src
. The dimensions of the kernel are
given by kernelWidth
and kernelHeight
; the kernel values
are specified as kernelWidth
*kernelHeight
shorts in
column-major order. That is, the kernel entry (i, j) is located at
position i*kernelHeight + j in the input sequence.
The shiftX and shiftY parameters specify a translation between the
source and destination images. The result of the convolution is multiplied by a
scale factor, and a bias is added.
The output pixel (x, y) is defined as:
s( ? 0 ? i < w ? 0 ? j < h k(w ? i ? 1),(h ? j ? 1) p(x + i – shiftX, y + j – shiftY )) + b,
where w = kernelWidth
, h = kernelHeight
, ki,ji,j is the kernel
element at position (i, j), s is the scale
, b is the bias
,
and p(x, y) is the source pixel at (x, y), or the result of source edge extension
defined by tilingMode
.
Note that the use of the kernel index (w–i–1, h–j–1) implies that the kernel is rotated 180 degrees relative to the source image in order to conform to the mathematical definition of convolution. Figure 23 depicts the flipping of the kernel relative to the image pixels for a 3x3 kernel.
The operation is applied to all channels (color and alpha) independently.
VG_BAD_HANDLE_ERROR
dst
or src
is not a valid image handle,
or is not shared with the current context.VG_IMAGE_IN_USE_ERROR
dst
or src
is currently a rendering target.VG_ILLEGAL_ARGUMENT_ERROR
dst
or src
overlap.kernelWidth
or kernelHeight
is less than or equal to 0
or greater than VG_MAX_KERNEL_SIZE
.kernel
is null
.kernel
is not properly aligned.tilingMode
is not valid.
dst
- The destination VGImage
.src
- The source VGImage
.kernelWidth
- The width of the convolution area.kernelHeight
- The width of the convolution area.shiftX
- The convolution shift in the x.shiftY
- The convolution shift in the y.kernel
- The convolution kernal buffer to use.scale
- The convolution scale.bias
- The convolution bias.tilingMode
- The tiling mode to use.
The following symbolic values are accepted:
VG_TILE_FILL
, VG_TILE_PAD
,
VG_TILE_REPEAT
, and VG_TILE_REFLECT
.
IllegalArgumentException
- if kernel.GetRemaining()
is less than kernelWidth * kernelHeight.void vgSeparableConvolve(int dst, int src, int kernelWidth, int kernelHeight, int shiftX, int shiftY, ShortBuffer kernelX, ShortBuffer kernelY, float scale, float bias, int tilingMode)
vgSeparableConvolve
function applies a user-supplied separable
convolution kernel to a normalized source image src
. A separable
kernel is a two-dimensional kernel in which each entry kijij is equal to a
product kxi i * kyj of elements from two one-dimensional kernels, one
horizontal and one vertical.
The lengths of the one-dimensional arrays kernelX
and kernelY
are given by kernelWidth
and kernelHeight
,
respectively; the kernel values are specified as arrays of VGshorts.
The shiftX
and shiftY
parameters specify a translation
between the source and destination images. The result of the convolution is
multiplied by a scale factor, and a bias is added.
The output pixel (x, y) is defined as:
s(? 0 ? i < w ? 0 ? j < h kx(w ? i ? 1) ky( h ? j ? i) p(x+i – shiftX, y+j – shiftY )) + b,
where w = kernelWidth
, h = kernelHeight
, kxi is the
one-dimensional horizontal kernel element at position i, kyj is the
one-dimensional vertical kernel element at position j, s is the scale
,
b is the bias
, and p(x, y) is the source pixel at (x, y), or the
result of source edge extension defined by tilingMode
.
Note that the use of the kernel indices (w–i–1) and (h–j–1) implies that the kernel is rotated 180 degrees relative to the source image in order to conform to the mathematical definition of convolution.
The operation is applied to all channels (color and alpha) independently.
VG_BAD_HANDLE_ERROR
dst
or src
is not a valid image handle,
or is not shared with the current context.VG_IMAGE_IN_USE_ERROR
dst
or src
is currently a rendering target.VG_ILLEGAL_ARGUMENT_ERROR
dst
or src
overlap.kernelWidth
or kernelHeight
is less than or equal to 0
or greater than VG_MAX_KERNEL_SIZE
.kernelX
or kernelY
is null
.
kernelX
or kernelY
is not properly aligned.tilingMode
is not valid.
dst
- The destination VGImage
.src
- The source VGImage
.kernelWidth
- The width of the convolution area.kernelHeight
- The width of the convolution area.shiftX
- The convolution shift in the x.shiftY
- The convolution shift in the y.kernelX
- The convolution kernal buffer to use for the x dimention.kernelY
- The convolution kernal buffer to use for the y dimention.scale
- The convolution scale.bias
- The convolution bias.tilingMode
- The tiling mode to use.
The following symbolic values are accepted:
VG_TILE_FILL
, VG_TILE_PAD
,
VG_TILE_REPEAT
, and VG_TILE_REFLECT
.
IllegalArgumentException
- if kernelX.GetRemaining()
is less than kernelWidth.
IllegalArgumentException
- if kernelY.GetRemaining()
is less than kernelHeight.void vgGaussianBlur(int dst, int src, float stdDeviationX, float stdDeviationY, int tilingMode)
vgGaussianBlur
function computes the convolution of a
normalized source image src
with a separable kernel defined
in each dimension by the Gaussian function G(x, s):
G(x,s) = 1 / sqrt(2PI s^2 e?x^2 / 2s^2)
where s is the standard deviation.
The two-dimensional kernel is defined by multiplying together two one-dimensional kernels, one for each axis:
k(x,y) = G(x,sx) ? G(y,sy) = 1/ 2PIsxsye?(x^2 / 2sx + 2^y2 / 2sy^2)
where sx
and sy
are the (positive) standard
deviations in the horizontal and vertical directions, given by
the stdDeviationX
and stdDeviationY
parameters
respectively. This kernel has special properties that allow for very
efficient implementation; for example, the implementation may use multiple
passes with simple kernels to obtain the same overall result with higher
performance than direct convolution. If stdDeviationX
and stdDeviationY
are equal, the kernel is rotationally
symmetric.
Source pixels outside the source image bounds are defined by tilingMode.
The operation is applied to all channels (color and alpha) independently.
VG_BAD_HANDLE_ERROR
dst
or src
is not a valid image handle,
or is not shared with the current context.VG_IMAGE_IN_USE_ERROR
dst
or src
is currently a rendering target.VG_ILLEGAL_ARGUMENT_ERROR
dst
or src
overlap.stdDeviationX
or stdDeviationY
is less than or equal to 0
or greater than VG_MAX_GAUSSIAN_STD_DEVIATION
.tilingMode
is not valid.
dst
- The destination VGImage
.src
- The source VGImage
.stdDeviationX
- The standard deviation for the horizonatal direction.stdDeviationY
- The standard deviation for the vertical direction.tilingMode
- The tiling mode to use.
The following symbolic values are accepted:
VG_TILE_FILL
, VG_TILE_PAD
,
VG_TILE_REPEAT
, and VG_TILE_REFLECT
.void vgLookup(int dst, int src, Buffer redLUT, Buffer greenLUT, Buffer blueLUT, Buffer alphaLUT, boolean outputLinear, boolean outputPremultiplied)
vgLookup
function passes each image channel of the
normalized source image src through a separate lookup table.
Each channel of the normalized source pixel is used as an index
into the lookup table for that channel by multiplying the
normalized value by 255 and rounding to obtain an 8-bit integral value.
Each LUT parameter should contain 256 VGubyte entries. The outputs
of the lookup tables are concatenated to form an RGBA_8888 pixel value,
which is interpreted as lRGBA_8888, lRGBA_8888_PRE, sRGBA_8888, or
sRGBA_8888_PRE, depending on the values of outputLinear
and outputPremultiplied
.
The resulting pixels are converted into the destination format using the normal pixel format conversion rules.
VG_BAD_HANDLE_ERROR
dst
or src
is not a valid image handle,
or is not shared with the current context.VG_IMAGE_IN_USE_ERROR
dst
or src
is currently a rendering target.VG_ILLEGAL_ARGUMENT_ERROR
dst
or src
overlap.Buffer
parameter is null.
dst
- The destination VGImage
.src
- The source VGImage
.redLUT
- The lookup table for the red color channel.greenLUT
- The lookup table for the green color channel.blueLUT
- The lookup table for the blue color channel.alphaLUT
- The lookup table for the alpha color channel.outputLinear
- true
if the color should be interpreted linearly.outputPremultiplied
- true
if the color should be
interpreted as premultiplied color.
IllegalArgumentException
- if redLUT.GetRemaining()
is less than 256.
IllegalArgumentException
- if greenLUT.GetRemaining()
is less than 256.
IllegalArgumentException
- if blueLUT.GetRemaining()
is less than 256.
IllegalArgumentException
- if alphaLUT.GetRemaining()
is less than 256.void vgLookupSingle(int dst, int src, IntBuffer lookupTable, int sourceChannel, boolean outputLinear, boolean outputPremultiplied)
vgLookupSingle
function passes a single image channel of the
normalized source image src
, selected by
the sourceChannel
parameter, through a combined lookup
table that produces whole pixel values. Each normalized source channel
value is multiplied by 255 and rounded to obtain an 8 bit integral value.
The specified sourceChannel
of the normalized source pixel
is used as an index into the lookup table. If the source image is in a
single-channel grayscale (VG_lL_8
, VG_sL_8
,
or VG_BW_1
) or alpha-only (VG_A_8
) format,
the sourceChannel
parameter is ignored and the single
channel is used. The lookupTable parameter should contain 256 4-byte
aligned entries in an RGBA_8888 pixel value, which is interpreted as
lRGBA_8888, lRGBA_8888_PRE, sRGBA_8888, or sRGBA_8888_PRE,
depending on the values of outputLinear
and outputPremultiplied
.
The resulting pixels are converted into the destination format using the normal pixel format conversion rules.
VG_BAD_HANDLE_ERROR
dst
or src
is not a valid image handle,
or is not shared with the current context.VG_IMAGE_IN_USE_ERROR
dst
or src
is currently a rendering target.VG_ILLEGAL_ARGUMENT_ERROR
dst
or src
overlap.src
is in an RGB pixel format and sourceChannel
is not
one of VG_RED
, VG_GREEN
, VG_BLUE
or VG_ALPHA
.lookupTable
is null
.lookupTable
is not properly aligned
dst
- The destination VGImage
.src
- The source VGImage
.lookupTable
- The lookup table buffer to use.sourceChannel
- The source color channel to use.
The following symbolic values are accepted:
VG_RED
, VG_GREEN
,
VG_BLUE
, and VG_ALPHA
.outputLinear
- true
if the color should be interpreted linearly.outputPremultiplied
- true
if the color should be
interpreted as premultiplied color.
IllegalArgumentException
- if lookupTable.GetRemaining()
is less than 256.int vgHardwareQuery(int key, int setting)
vgHardwareQuery
function returns a value indicating whether a
given setting
of a property of a type given by key
is generally accelerated in hardware on the currently running
OpenVG implementation.
VG_ILLEGAL_ARGUMENT_ERROR
key
- The key to query for VG_IMAGE_FORMAT_QUERY
or VG_PATH_DATATYPE_QUERY
setting
- The setting as a image format or path format.
VG_HARDWARE_ACCELERATED
or VG_HARDWARE_UNACCELERATED
.String vgGetString(int name)
vgGetString
function returns information about the OpenVG implementation,
including extension information. The values returned may vary according to the
display (e.g., the EGLDisplay
when using EGL
) associated with the
the current context. If no context is current, vgGetString
returns null
.
The combination of VG_VENDOR
and VG_RENDERER
may be used together
as a platform identifier by applications that wish to recognize a particular platform and
adjust their algorithms based on prior knowledge of platform bugs and performance
characteristics .
If name is VG_VENDOR
, the name of company responsible for this OpenVG
implementation is returned. This name does not change from release to release.
If name is VG_RENDERER
, the name of the renderer is returned.
This name is typically specific to a particular configuration of a hardware
platform, and does not change from release to release.
If name is VG_VERSION
, the version number of the specification
implemented by the renderer is returned as a string in the form major_number.minor_number.
For this specification, “1.0” is returned.
If name is VG_EXTENSIONS
, a space-separated list of supported extensions to
OpenVG is returned.
For other values of name, null is returned.
name
- The name of the string to get.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal