Linear gradient extended functions
The following functions are available only with IP that includes hardware support for extended linear gradient capabilities, such as GC355 and GC555. These functions are not available with GCNanoLiteV, GCNanoUltraV, or GCNanoV. Applications can use VGLite API vg_lite_query_feature (gcFEATURE_BIT_VG_LINEAR_GRADIENT_EXT)
to determine HW support for linear gradient.
vg_lite_set_linear_grad
function
Description:
This function is used to set the values that define the linear gradient. (from April 2022)
Syntax:
vg_lite_error_t vg_lite_set_linear_grad (
vg_lite_ext_linear_gradient_t *grad,
vg_lite_uint32_t count,
vg_lite_color_ramp_t *color_ramp,
vg_lite_linear_gradient_parameter_t grad_param,
vg_lite_radial_gradient_spreadmode_t spread_mode,
vg_lite_uint8_t pre_mult
);
Parameters:
Parameter |
Description |
---|---|
|
Pointer to the |
|
Count of the colors in the gradient. The maximum color stop count is defined by |
|
It is the array of stops for the linear gradient. The number of parameters for each stop is 5, and gives the offset and color of the stop. Each stop is defined by a floating-point offset value and four floating-point values containing the sRGBA color and alpha value associated with each stop, in the form of a non-premultiplied (R, G, B, alpha) quad. The range of all parameters is [0,1]. |
|
Gradient parameters as specified in the structure |
|
The fill mode is applied to the pixels out of the paint after transformation. Uses the same spread mode enumeration types as radial gradient. For details, see |
|
This parameter controls whether color and alpha values are interpolated in premultiplied or non-premultiplied form. |
Returns:
Returns VG_LITE_INVALID_ARGUMENTS
to indicate the parameters are wrong.
Parent topic:Linear gradient extended functions
vg_lite_get_linear_grad_matrix
function
Description:
This function returns a pointer to an extended linear gradient object’s matrix.(from March 2023).
Syntax:
vg_lite_matrix_t* vg_lite_get_linear_grad_matrix (
vg_lite_ext_linear_gradient_t *grad,
);
Parameters:
Parameter |
Description |
---|---|
|
Pointer to the |
Returns:
Returns a pointer to vg_lite_matrix_t
for the specified extended linear gradient.
Parent topic:Linear gradient extended functions
vg_lite_draw_linear_grad
function
Description:
This function returns a pointer to an extended linear gradient object’s matrix.(from March 2023).
Syntax:
vg_lite_error_t vg_lite_draw_linear_grad (
vg_lite_buffer_t *target,
vg_lite_path_t *path,
vg_lite_fill_t fill_rule,
vg_lite_matrix_t *path_matrix,
vg_lite_ext_linear_gradient_t *grad,
vg_lite_color_t paint_color,
vg_lite_blend_t blend,
vg_lite_filter_t filter
);
Parameters:
Parameter |
Description |
---|---|
|
Pointer to the |
|
Pointer to the |
|
Specifies the |
|
Pointer to a |
|
Pointer to the |
|
Specifies the paint color |
|
Specifies blend mode in the |
|
Specified the filter mode |
Returns:
Returns VG_LITE_SUCCESS
if successful. See vg_lite_error_t enum for other return codes.
Parent topic:Linear gradient extended functions
vg_lite_update_linear_grad
function
Description:
This function is used to update or generate the corresponding image object to render (from April 2022).
The vg_lite_ext_linear_gradient_t
object has an image buffer that is used to render the linear gradient paint. The image buffer is created/updated according to the specified grad parameters.
Syntax:
vg_lite_error_t vg_lite_update_linear_grad (
vg_lite_ext_linear_gradient_t *grad,
);
Parameters:
Parameter |
Description |
---|---|
|
Pointer to the |
Returns:
Returns VG_LITE_SUCCESS
if successful. See vg_lite_error_t enum for other return codes.
Parent topic:Linear gradient extended functions
vg_lite_clear_linear_grad
function
Description:
This function is used to clear the linear gradient object. This resets the grad members and free the image buffer’s memory (from April 2022).
Syntax:
vg_lite_error_t vg_lite_clear_linear_grad (
vg_lite_ext_linear_gradient_t *grad,
);
Parameters:
Parameter |
Description |
---|---|
|
Pointer to the |
Returns:
Returns VG_LITE_SUCCESS
if successful. See vg_lite_error_t enum for other return codes.
Parent topic:Linear gradient extended functions
Parent topic:Vector-dased draw operations