Stroke operations
This part of the API performs stroke operations. (from March 2022)
Stroke enumerations
This section gives details on stroke enumerations.
vg_lite_cap_style_t
enumeration
Defines the style of cap at the end of a stroke (from March 2022).
Used in structure: vg_lite_stroke_t.
Used in function: vg_lite_set_stroke.
vg_lite_cap_style_t values |
Description |
---|---|
|
The butt end cap style terminates each segment with a line perpendicular to the tangent at each endpoint. |
|
The round end cap style appends a semicircle with a diameter equal to the line width centered around each endpoint. |
|
The square end cap style appends a rectangle with two sides of length equal to the line width perpendicular to the tangent, and two sides of length equal to half the line width parallel to the tangent, at each endpoint. |
Parent topic:Stroke enumerations
vg_lite_path_type_t
enumeration
Defines the type of draw path (from March 2022).
Used in structure: vg_lite_path_t, vg_lite_stroke_t.
Used in function: vg_lite_set_path_type
.
vg_lite_path_type_t string values |
Description |
---|---|
|
Draw path is fill. |
|
Draw path is stroke. |
|
Draw path is both fill and stroke. |
Parent topic:Stroke enumerations
vg_lite_join_style_t
enumeration
Defines the type of styles available for line joints. (from March 2022)
Used in structure: vg_lite_stroke_t.
Used in function: vg_lite_set_stroke.
vg_lite_join_style_t string values |
Description |
---|---|
|
The miter join style appends a trapezoid with one vertex at the intersection point of the two original lines, two adjacent vertices at the outer endpoints of the two “thickened” lines and a fourth vertex at the extrapolated intersection point of the outer perimeters of the two “thickened” lines. |
|
The round join style appends a wedge-shaped portion of a circle, centered at the intersection point of the two original lines, having a radius equal to half the line width. |
|
The bevel type join style appends a triangle with two vertices at the outer endpoints of the two “thickened” lines and a third vertex at the intersection point of the two original lines. |
Parent topic:Stroke enumerations
Parent topic:Stroke operations
Stroke structures
This section gives details on stroke structures.
vg_lite_path_t
structure
Defined under Vector Path Structures - vg_lite_path_t structure.
(additional members added for stroke from March 2022)
Parent topic:Stroke structures
vg_lite_path_list_t
structure
The structure vg_lite_path_list_ptr
points to the vg_lite_path_list
structure that provides divided path data according to MOVE/MOVE_REL.
(from Aug 2023)
Used (vg_lite_path_list_ptr
) in structures: vg_lite_stroke_t.
vg_lite_path_list_t members |
Type |
Description |
---|---|---|
path_points |
vg_lite_path_point_ptr |
|
path_end |
vg_lite_path_point_ptr |
|
point_count |
vg_lite_uint32_t |
|
next |
vg_lite_path_list_ptr |
|
closed |
vg_lite_uint8_t |
Parent topic:Stroke structures
vg_lite_path_point_t
structure
The structure vg_lite_path_point_ptr
points to the vg_lite_path_point
structure which provides path detail (from March 2022)
Used (vg_lite_path_point_ptr
) in structures: vg_lite_path_point_t, vg_lite_stroke_conversion. vg_lite_sub_path_t.
vg_lite_path_point_t members |
Type |
Description |
---|---|---|
|
|
X coordinate |
|
|
Y coordinate |
|
|
Flatten flag for flattened path |
|
|
Curve type for the stroke path |
|
|
X tangent (Note: #define centerX tangent) |
|
|
Y tangent (Note: #define centerX tangent) |
|
|
Line length |
|
|
Pointer to the previous point node |
Parent topic:Stroke structures
vg_lite_stroke_t
structure
The structure provides stroke parameters and pointers to temp storage for a stroke sub path. Refer to the function vg_lite_set_stroke
parameter descriptions for additional description for some members. (from March 2022)
Used in structure: vg_lite_path_t.
vg_lite_stroke_t members |
Type |
Description |
---|---|---|
|
|
Stroke cap style |
|
|
Stroke joint style |
|
|
Stroke line width |
|
|
Stroke miter limit |
|
|
Pointer to stroke dash pattern |
|
|
Number of dash pattern repetitions |
|
|
Stroke dash phrase |
|
|
Stroke dash initial length |
|
|
Stroke dash initial index |
|
|
Half line width |
|
|
Total length of stroke dash patterns. |
|
|
For fast checking |
|
|
Temp storage for stroke sub path |
|
|
Temp storage for stroke sub path |
|
|
Temp storage for stroke sub path |
|
|
Temp storage for stroke sub path |
|
|
Temp storage for stroke sub path |
|
|
Temp storage for stroke sub path |
|
|
Temp storage for stroke sub path |
|
|
Temp storage for stroke sub path |
|
|
Divide stroke path according to move or move_rel for avoiding implicit closure. (from Aug 2023) |
|
|
Pointer to current divided path data. (from Aug 2023) |
|
|
Flag that adds end_path in driver (from Aug 2023) |
|
|
(from Aug 2023) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The stroke line is a fat line. |
|
|
Parent topic:Stroke structures
vg_lite_sub_path_t
structure
The structure vg_lite_sub_path_ptr
points to the vg_lite_sub_path
structure that provides sub path detail and a pointer to the next sub path. (from March 2022)
Used in structure: vg_lite_stroke_conversion.
vg_lite_path_point_t members |
Type |
Description |
---|---|---|
next |
vg_lite_sub_path_ptr |
Pointer to the next sub path |
point_count |
vg_lite_uint32_t |
Number of points in the sub path |
point_list |
vg_lite_path_point_ptr |
Pointer to the point list. |
end_point |
vg_lite_path_point_ptr |
Pointer to the last point. |
closed |
vg_lite_uint8_t |
Indicates whether or not the path is closed. |
length |
vg_lite_float_t |
Length of the sub path. |
Parent topic:Stroke structures
Parent topic:Stroke operations
Stroke functions
All return vg_lite_error_t
status.
vg_lite_set_path_type
function
Description:
This function sets the path type*. (from March 2022)*
Syntax:
vg_lite_error_t vg_lite_set_path_type (
vg_lite_path_t *path,
vg_lite_path_type_t path_type
);
Parameters:
Parameter |
Description |
---|---|
|
Pointer to the vg_lite_path_t structure that describes the vector path. |
|
Pointer to a |
Returns:
Returns VG_LITE_SUCCESS
if successful. See vg_lite_error_t enum for other return codes.
Parent topic:Stroke functions
vg_lite_set_stroke
function
Description:
This function uses input parameters to set stroke attributes (from March 2022).
Syntax:
vg_lite_error_t vg_lite_set_stroke (
vg_lite_path_t *path,
vg_lite_cap_style_t cap_style,
vg_lite_join_style_t join_style,
vg_lite_float_t line_width,
vg_lite_float_t miter_limit,
vg_lite_float_t *dash_pattern,
vg_lite_uint32_t pattern_count,
vg_lite_float_t dash_phase,
vg_lite_color_t color
);
Parameters:
Parameter |
Description |
---|---|
|
Pointer to the |
|
The end cap style is defined by the |
|
The line join style defined by the |
|
The line width of the stroke path. A line width less than or equal to 0 prevents stroking from taking place. |
|
When stroking using the Miter stroke |
|
Pointer to a dash pattern that consists of a sequence of lengths of alternating “on” and “off” dash segments. The first value of the dash array defines the length, in user coordinates, of the first “on” dash segment. The second value defines the length of the following “off” segment. Each subsequent pair of values defines one “on” and one “off” segment. Note: If the dash pattern has an odd number of elements, the final element is ignored. |
|
The count of dash on/off segments. |
|
Defines the starting point in the dash pattern that is associated with the start of the first segment of the path. For example, if the dash pattern is [10 20 30 40] and the dash phase is 35, the path is stroked with an “on” segment of length 25 (skipping the first “on” segment of length 10, the following “off” segment of length 20, and the first 5 units of the next “on” segment), followed by an “off” segment of length 40. The pattern is then repeated from the beginning, with an “on” segment of length 10, an “off” segment of length 20, an “on” segment of length 30. |
|
The stroke color. |
Returns:
Returns VG_LITE_SUCCESS
if successful. See vg_lite_error_t enum for other return codes.
Parent topic:Stroke functions
vg_lite_update_stroke
function
Description:
This function uses the path and stroke attributes as specified with the function vg_lite_set_stroke
to update the stroke path’s parameters and generate stroke path data . (from March 2022)
Syntax:
vg_lite_error_t vg_lite_update_stroke (
vg_lite_path_t *path,
);
Parameters:
Parameter |
Description |
---|---|
|
Pointer to the vg_lite_path_t structure that describes the path. |
Returns:
Returns VG_LITE_SUCCESS
if successful. See vg_lite_error_t enum for other return codes.
Parent topic:Stroke functions
Parent topic:Stroke operations