Draw and gradient structures
This section provides an overview of the draw and gradient structures.
vg_lite_buffer_t
structure
This structure is defined under the “Pixel buffer structures” section (see vg_lite_buffer_t structure).
Parent topic:Draw and gradient structures
vg_lite_color_ramp_t
structure
This structure defines the stops for the radial gradient. The five parameters provide the offset and color for the stop. Each stop is defined by a set of floating point values which specify the offset and the sRGBA color and alpha values. Color channel values are in the form of a non-premultiplied (R, G, B, alpha) quad. All parameters are in the range of [0,1]. The red, green, blue, alpha value of [0, 1] is mapped to an 8-bit pixel value [0, 255].(from November 2020, requires GC355 hardware)
The define for the max number of radial gradient stops is #define MAX_COLOR_RAMP_STOPS
256.
Used in radial gradient structure: vg_lite_radial_gradient_t.
vg_lite_color_ramp_t members |
Type |
Description |
---|---|---|
|
|
Offset value for the color stop |
|
|
Red color channel value for the color stop |
|
|
Green color channel value for the color stop |
|
|
Blue color channel value for the color stop |
|
|
Alpha color channel value for the color stop |
Parent topic:Draw and gradient structures
vg_lite_linear_gradient_t
structure
This structure defines the organization of a linear gradient in VGLite data. The linear gradient is applied to filling a path. It generates a 256x1 image according to the specified settings.
Used in init and draw functions: vg_lite_init_grad, vg_lite_set_grad, vg_lite_update_grad, vg_lite_get_grad_matrix, vg_lite_clear_grad, vg_lite_draw_grad.
vg_lite_linear_gradient_t constants |
Type |
Description |
---|---|---|
|
|
Constant. Maximum number of gradient colors = 16. |
vg_lite_linear_gradient_t members |
||
|
|
Color array for the gradient |
|
|
Number of colors |
|
|
Number of color stops, from 0 to 255 |
|
|
Struct for the matrix to transform the gradient color ramp |
|
|
Image object struct to represent the color ramp |
Parent topic:Draw and gradient structures
vg_lite_ext_linear_gradient
structure
This structure defines the organization of the extended parameters possible for a linear gradient (from April 2022).
Used in functions: vg_lite_draw_linear_grad.
vg_lite_ext_linear_gradient_t members |
Type |
Description |
---|---|---|
|
|
Count of colors, up to 256. |
|
|
The matrix to transform the gradient. |
|
|
The image for rendering as gradient pattern. |
|
|
Linear gradient parameters. Includes center point, focal point and radius. |
|
|
Color ramp length for gradient paints provided to the driver. |
|
|
Color ramp parameter for gradient paints provided to the driver. |
|
|
Converted internal color ramp length. |
|
|
Converted internal color ramp. |
|
|
If this value is set to 1, the color value of |
|
|
The spread mode that is applied to the pixels out of the image after transformed. |
|
Parent topic:Draw and gradient structures
vg_lite_linear_gradient_parameter
structure
This structure defines a radial direction for a linear gradient. (from April 2022)
Line0 connects point (X0, Y0) to point (X1, Y1) and represents the radial direction of the linear gradient.
Line1 is a line perpendicular to line0 which passes through point (X0, Y0).
Line2 is a line perpendicular to line0 which passes through point (X1, Y1)
The linear gradient paint is applied at the intersection of the path fill area and the plane starting from line 1 and ending at line 2.
Used in structure: vg_lite_ext_linear_gradient.
Used in functions: vg_lite_set_linear_grad.
vg_lite_linear_gradient_parameter_t members |
Type |
Description |
---|---|---|
X0 |
|
X origin of linear gradient radial direction. |
Y0 |
|
Y origin of linear gradient radial direction. |
X1 |
|
X end point of linear gradient radial direction. |
Y1 |
|
Y end point of linear gradient radial direction. |
Parent topic:Draw and gradient structures
vg_lite_matrix_t
structure
This structure is defined under the “Matrix control structures” section (see vg_lite_matrix_t structure).
Parent topic:Draw and gradient structures
vg_lite_path_t
structure
This structure is defined under the “Vector path structures” section (see vg_lite_path_t structure).
Parent topic:Draw and gradient structures
vg_lite_radial_gradient_parameter_t
structure
This structure defines the gradient radius and the X and Y coordinates for the center and focal points of the gradient (from November 2020, requires GC355 or GC555 hardware).
Used in radial gradient structure: vg_lite_radial_gradient_t
.
vg_lite_radial_gradient_parameter_t member |
Type |
Description |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Parent topic:Draw and gradient structures
vg_lite_radial_gradient_t
structure
This structure defines the application of the radial gradient to fill a path. (from November 2020, requires GC355 or GC555 hardware).
Used in radial gradient functions: vg_lite_draw_grad, vg_lite_set_radial_grad, vg_lite_update_radial_grad, vg_lite_get_radial_grad, vg_lite_clear_radial_grad
.
vg_lite_radial_gradient_t member |
Type |
Description |
---|---|---|
|
vg_lite_uint32_t |
Count of colors, up to 256 |
|
Structure that specifies the transform matrix for the gradient |
|
|
Structure that specifies the image for rendering as a gradient pattern |
|
|
Structure that specifies the location of the gradient’s center point (cx, cy), focal point(fx, fy) and radius(r) |
|
|
vg_lite_uint32_t |
Color ramp parameters for gradient paints provided to the driver |
|
Structure that specifies the color ramp |
|
|
vg_lite_uint32_t |
Converted internal color ramp. |
|
Structure that specifies the internal color ramp |
|
|
vg_lite_uint32_t |
If this value is set to 1, the color value of |
|
Enum that specifies the tiling mode, which is applied to the pixels out of the image after transformation |
Parent topic:Draw and gradient structures
Parent topic:Vector-dased draw operations