Cookies info

This website uses Google cookies to analyse traffic. Information about your use of our site is shared with Google for that purpose. See details.

Context Parameters

Context Parameter Set/Get API [5.2]

Each vgGet or vgSet function has four variants, depending on the data type of the value being set, differentiated by a suffix: i for scalar integral values, f for scalar floating-point values, and iv and fv for vectors of integers and floating-point values, respectively.
The vector variants may also be used to set scalar values using a count of 1. When setting a value of integral type using a floating-point vgSet variant (ending with f or fv), or retrieving a floating-point value using an integer vgGet function (ending with i or iv), the value is converted to an integer using a mathematical floor operation.

void vgSetf(VGParamType paramType, VGfloat val)
void vgSeti(VGParamType paramType, VGint val)
void vgSetfv(VGParamType paramType, VGint count, const VGfloat* val)
void vgSetiv(VGParamType paramType, VGint count, const VGint* val)
VGfloat vgGetf(VGParamType paramType)
VGint vgGeti(VGParamType paramType)
VGint vgGetVectorSize(VGParamType paramType)
void vgGetfv(VGParamType paramType, VGint count, VGfloat* val)
void vgGetiv(VGParamType paramType, VGint count, VGint* val)

Context Parameters [5.2.1]

The possible values of paramType from enumeration VGParamType are shown below, with the legal values for val. Default value is indicated in YELLOW.

Parameter nameParameter typePossible values / Notes
VG_MATRIX_MODEVGMatrixModeVG_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_FILL_RULEVGFillRuleVG_EVEN_ODD
VG_NON_ZERO
VG_IMAGE_QUALITYVGImageQualityVG_IMAGE_QUALITY_NONANTIALIASED
VG_IMAGE_QUALITY_FASTER
VG_IMAGE_QUALITY_BETTER
VG_RENDERING_QUALITYVGRenderingQualityVG_RENDERING_QUALITY_NONANTIALIASED
VG_RENDERING_QUALITY_FASTER
VG_RENDERING_QUALITY_BETTER
VG_BLEND_MODEVGBlendModeVG_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_IMAGE_MODEVGImageModeVG_DRAW_IMAGE_NORMAL
VG_DRAW_IMAGE_MULTIPLY
VG_DRAW_IMAGE_STENCIL
VG_SCISSOR_RECTSVGint*Format is:
{ xMin, yMin, width, height, ... }
Rects with width <= 0 or height <= 0 are ignored
{ }
VG_COLOR_TRANSFORMVGbooleanVG_TRUE
VG_FALSE
VG_COLOR_TRANSFORM_VALUESVGfloat[8]Format is:
{ Rscl, Gscl, Bscl, Ascl,
Rbias, Gbias, Bbias, Abias }
Scale parameters are clamped to:
[-127.0, +127.0]
Bias parameters are clamped to:
[-1.0, +1.0]
{ 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f }
VG_STROKE_LINE_WIDTHVGfloatAny positive value is valid (a value <=0 prevents stroking from taking place)
1.0f
VG_STROKE_CAP_STYLEVGCapStyleVG_CAP_BUTT
VG_CAP_ROUND
VG_CAP_SQUARE
VG_STROKE_JOIN_STYLEVGJoinStyleVG_JOIN_MITER
VG_JOIN_ROUND
VG_JOIN_BEVEL
VG_STROKE_MITER_LIMITVGfloatMiter limit values <=1 are silently clamped to 1
4.0f
VG_STROKE_DASH_PATTERNVGfloat*Format is:
{ on1, off1, on2, off2, ... }
If the dash pattern has length 0, dashing is not performed. If the dash pattern has an odd number of elements, the final element is ignored.
{ }
VG_STROKE_DASH_PHASEVGfloatAny float value is valid
0.0f
VG_STROKE_DASH_PHASE_RESETVGbooleanVG_TRUE
VG_FALSE
VG_TILE_FILL_COLORVGfloat[4]Format is:
{ red, green, blue, alpha } sRGBA
Values outside the [0, 1] range are interpreted as the nearest endpoint of the range
{ 0.0f, 0.0f, 0.0f, 0.0f }
VG_CLEAR_COLORVGfloat[4]Format is:
{ red, green, blue, alpha } sRGBA
Values outside the [0, 1] range are interpreted as the nearest endpoint of the range
{ 0.0f, 0.0f, 0.0f, 0.0f }
VG_GLYPH_ORIGINVGfloat[2]Format is:
{ xOrigin, yOrigin }
{ 0.0f, 0.0f }
VG_MASKINGVGbooleanVG_TRUE
VG_FALSE
VG_SCISSORINGVGbooleanVG_TRUE
VG_FALSE
VG_PIXEL_LAYOUT VGPixelLayoutVG_PIXEL_LAYOUT_UNKNOWN
VG_PIXEL_LAYOUT_RGB_VERTICAL
VG_PIXEL_LAYOUT_BGR_VERTICAL
VG_PIXEL_LAYOUT_RGB_HORIZONTAL
VG_PIXEL_LAYOUT_BGR_HORIZONTAL
VG_FILTER_FORMAT_LINEARVGbooleanVG_TRUE
VG_FALSE
VG_FILTER_FORMAT_PREMULTIPLIEDVGbooleanVG_TRUE
VG_FALSE
VG_FILTER_CHANNEL_MASKVGbitfieldAny combination of:
VG_RED, VG_GREEN, VG_BLUE, VG_ALPHA
VG_RED | VG_GREEN | VG_BLUE | VG_ALPHA

Read-Only Context Parameters [5.2.1]

Some context parameters are read-only, so they cannot be set through vgSet(i/f/iv/fv) functions.

Parameter nameParameter typeAmanithVGNotes
VG_MAX_SCISSOR_RECTSVGintVG_MAXINTAll implementations must support at least 32 scissor rectangles
VG_MAX_DASH_COUNTVGintVG_MAXINTAll implementations must must support at least 16 dash segments (8 on/off pairs)
VG_MAX_KERNEL_SIZEVGint255All implementations must define this value to be an integer no smaller than 7
VG_MAX_SEPARABLE_KERNEL_SIZEVGint255All implementations must define this value to be an integer no smaller than 15
VG_MAX_GAUSSIAN_STD_DEVIATIONVGfloat128All implementations must define this value to be no smaller than 16
VG_MAX_COLOR_RAMP_STOPSVGintVG_MAXINTAll implementations must support at least 32 stops
VG_MAX_IMAGE_WIDTHVGint4196Configurable on AmanithVG.
All implementations must define this value to be an integer no smaller than 256
VG_MAX_IMAGE_HEIGHTVGint4196Configurable on AmanithVG.
All implementations must define this value to be an integer no smaller than 256
VG_MAX_IMAGE_PIXELSVGint17606416All implementations must define this value to be an integer no smaller than 65536
VG_MAX_IMAGE_BYTESVGint70425664All implementations must define this value to be an integer no smaller than 65536
VG_MAX_FLOATVGfloat3.402823466e+38All implementations must define this value to be at least 10^10