lv_svg.h

Defines

LV_SVG_NODE_CHILD(n, i)
LV_SVG_NODE(n)

Typedefs

typedef int8_t lv_svg_tag_t
typedef uint8_t lv_svg_attr_type_t
typedef uint8_t lv_svg_transform_type_t
typedef uint32_t lv_svg_aspect_ratio_t
typedef uint32_t lv_svg_color_t
typedef uint8_t lv_svg_fill_rule_t
typedef uint8_t lv_svg_line_cap_t
typedef uint8_t lv_svg_line_join_t
typedef uint8_t lv_svg_gradient_units_t
typedef uint8_t lv_svg_attr_value_type_t
typedef uint8_t lv_svg_attr_value_class_t

Enums

enum [anonymous]

Values:

enumerator LV_SVG_TAG_INVALID
enumerator LV_SVG_TAG_CONTENT
enumerator LV_SVG_TAG_SVG
enumerator LV_SVG_TAG_USE
enumerator LV_SVG_TAG_G
enumerator LV_SVG_TAG_PATH
enumerator LV_SVG_TAG_RECT
enumerator LV_SVG_TAG_CIRCLE
enumerator LV_SVG_TAG_ELLIPSE
enumerator LV_SVG_TAG_LINE
enumerator LV_SVG_TAG_POLYLINE
enumerator LV_SVG_TAG_POLYGON
enumerator LV_SVG_TAG_SOLID_COLOR
enumerator LV_SVG_TAG_LINEAR_GRADIENT
enumerator LV_SVG_TAG_RADIAL_GRADIENT
enumerator LV_SVG_TAG_STOP
enumerator LV_SVG_TAG_DEFS
enumerator LV_SVG_TAG_IMAGE
enumerator LV_SVG_TAG_MPATH
enumerator LV_SVG_TAG_SET
enumerator LV_SVG_TAG_ANIMATE
enumerator LV_SVG_TAG_ANIMATE_COLOR
enumerator LV_SVG_TAG_ANIMATE_TRANSFORM
enumerator LV_SVG_TAG_ANIMATE_MOTION
enumerator LV_SVG_TAG_TEXT
enumerator LV_SVG_TAG_TSPAN
enumerator LV_SVG_TAG_TEXT_AREA
enum [anonymous]

Values:

enumerator LV_SVG_ATTR_INVALID
enumerator LV_SVG_ATTR_ID
enumerator LV_SVG_ATTR_XML_ID
enumerator LV_SVG_ATTR_VERSION
enumerator LV_SVG_ATTR_BASE_PROFILE
enumerator LV_SVG_ATTR_VIEWBOX
enumerator LV_SVG_ATTR_PRESERVE_ASPECT_RATIO
enumerator LV_SVG_ATTR_VIEWPORT_FILL
enumerator LV_SVG_ATTR_VIEWPORT_FILL_OPACITY
enumerator LV_SVG_ATTR_DISPLAY
enumerator LV_SVG_ATTR_VISIBILITY
enumerator LV_SVG_ATTR_X
enumerator LV_SVG_ATTR_Y
enumerator LV_SVG_ATTR_WIDTH
enumerator LV_SVG_ATTR_HEIGHT
enumerator LV_SVG_ATTR_RX
enumerator LV_SVG_ATTR_RY
enumerator LV_SVG_ATTR_CX
enumerator LV_SVG_ATTR_CY
enumerator LV_SVG_ATTR_R
enumerator LV_SVG_ATTR_X1
enumerator LV_SVG_ATTR_Y1
enumerator LV_SVG_ATTR_X2
enumerator LV_SVG_ATTR_Y2
enumerator LV_SVG_ATTR_POINTS
enumerator LV_SVG_ATTR_D
enumerator LV_SVG_ATTR_PATH_LENGTH
enumerator LV_SVG_ATTR_FILL
enumerator LV_SVG_ATTR_FILL_RULE
enumerator LV_SVG_ATTR_FILL_OPACITY
enumerator LV_SVG_ATTR_STROKE
enumerator LV_SVG_ATTR_STROKE_WIDTH
enumerator LV_SVG_ATTR_STROKE_LINECAP
enumerator LV_SVG_ATTR_STROKE_LINEJOIN
enumerator LV_SVG_ATTR_STROKE_MITER_LIMIT
enumerator LV_SVG_ATTR_STROKE_DASH_ARRAY
enumerator LV_SVG_ATTR_STROKE_DASH_OFFSET
enumerator LV_SVG_ATTR_STROKE_OPACITY
enumerator LV_SVG_ATTR_OPACITY
enumerator LV_SVG_ATTR_SOLID_COLOR
enumerator LV_SVG_ATTR_SOLID_OPACITY
enumerator LV_SVG_ATTR_GRADIENT_UNITS
enumerator LV_SVG_ATTR_GRADIENT_STOP_OFFSET
enumerator LV_SVG_ATTR_GRADIENT_STOP_COLOR
enumerator LV_SVG_ATTR_GRADIENT_STOP_OPACITY
enumerator LV_SVG_ATTR_FONT_FAMILY
enumerator LV_SVG_ATTR_FONT_STYLE
enumerator LV_SVG_ATTR_FONT_VARIANT
enumerator LV_SVG_ATTR_FONT_WEIGHT
enumerator LV_SVG_ATTR_FONT_SIZE
enumerator LV_SVG_ATTR_TRANSFORM
enumerator LV_SVG_ATTR_TEXT_ANCHOR
enumerator LV_SVG_ATTR_ATTRIBUTE_NAME
enumerator LV_SVG_ATTR_ATTRIBUTE_TYPE
enumerator LV_SVG_ATTR_BEGIN
enumerator LV_SVG_ATTR_END
enumerator LV_SVG_ATTR_DUR
enumerator LV_SVG_ATTR_MIN
enumerator LV_SVG_ATTR_MAX
enumerator LV_SVG_ATTR_RESTART
enumerator LV_SVG_ATTR_REPEAT_COUNT
enumerator LV_SVG_ATTR_REPEAT_DUR
enumerator LV_SVG_ATTR_CALC_MODE
enumerator LV_SVG_ATTR_VALUES
enumerator LV_SVG_ATTR_KEY_TIMES
enumerator LV_SVG_ATTR_KEY_SPLINES
enumerator LV_SVG_ATTR_KEY_POINTS
enumerator LV_SVG_ATTR_FROM
enumerator LV_SVG_ATTR_TO
enumerator LV_SVG_ATTR_BY
enumerator LV_SVG_ATTR_ADDITIVE
enumerator LV_SVG_ATTR_ACCUMULATE
enumerator LV_SVG_ATTR_PATH
enumerator LV_SVG_ATTR_ROTATE
enumerator LV_SVG_ATTR_TRANSFORM_TYPE
enum [anonymous]

Values:

enumerator LV_SVG_TRANSFORM_TYPE_MATRIX
enumerator LV_SVG_TRANSFORM_TYPE_TRANSLATE
enumerator LV_SVG_TRANSFORM_TYPE_ROTATE
enumerator LV_SVG_TRANSFORM_TYPE_SCALE
enumerator LV_SVG_TRANSFORM_TYPE_SKEW_X
enumerator LV_SVG_TRANSFORM_TYPE_SKEW_Y
enum [anonymous]

Values:

enumerator LV_SVG_ANIM_REMOVE
enumerator LV_SVG_ANIM_FREEZE
enum [anonymous]

Values:

enumerator LV_SVG_ANIM_RESTART_ALWAYS
enumerator LV_SVG_ANIM_RESTART_WHEN_NOT_ACTIVE
enumerator LV_SVG_ANIM_RESTART_NEVER
enum [anonymous]

Values:

enumerator LV_SVG_ANIM_CALC_MODE_LINEAR
enumerator LV_SVG_ANIM_CALC_MODE_PACED
enumerator LV_SVG_ANIM_CALC_MODE_SPLINE
enumerator LV_SVG_ANIM_CALC_MODE_DISCRETE
enum [anonymous]

Values:

enumerator LV_SVG_ANIM_ADDITIVE_REPLACE
enumerator LV_SVG_ANIM_ADDITIVE_SUM
enum [anonymous]

Values:

enumerator LV_SVG_ANIM_ACCUMULATE_NONE
enumerator LV_SVG_ANIM_ACCUMULATE_SUM
enum [anonymous]

Values:

enumerator LV_SVG_ASPECT_RATIO_NONE
enumerator LV_SVG_ASPECT_RATIO_XMIN_YMIN
enumerator LV_SVG_ASPECT_RATIO_XMID_YMIN
enumerator LV_SVG_ASPECT_RATIO_XMAX_YMIN
enumerator LV_SVG_ASPECT_RATIO_XMIN_YMID
enumerator LV_SVG_ASPECT_RATIO_XMID_YMID
enumerator LV_SVG_ASPECT_RATIO_XMAX_YMID
enumerator LV_SVG_ASPECT_RATIO_XMIN_YMAX
enumerator LV_SVG_ASPECT_RATIO_XMID_YMAX
enumerator LV_SVG_ASPECT_RATIO_XMAX_YMAX
enum [anonymous]

Values:

enumerator LV_SVG_ASPECT_RATIO_OPT_MEET
enumerator LV_SVG_ASPECT_RATIO_OPT_SLICE
enum [anonymous]

Values:

enumerator LV_SVG_FILL_NONZERO
enumerator LV_SVG_FILL_EVENODD
enum [anonymous]

Values:

enumerator LV_SVG_LINE_CAP_BUTT
enumerator LV_SVG_LINE_CAP_SQUARE
enumerator LV_SVG_LINE_CAP_ROUND
enum [anonymous]

Values:

enumerator LV_SVG_LINE_JOIN_MITER
enumerator LV_SVG_LINE_JOIN_BEVEL
enumerator LV_SVG_LINE_JOIN_ROUND
enum [anonymous]

Values:

enumerator LV_SVG_GRADIENT_UNITS_OBJECT
enumerator LV_SVG_GRADIENT_UNITS_USER_SPACE
enum [anonymous]

Values:

enumerator LV_SVG_PATH_CMD_MOVE_TO
enumerator LV_SVG_PATH_CMD_LINE_TO
enumerator LV_SVG_PATH_CMD_CURVE_TO
enumerator LV_SVG_PATH_CMD_QUAD_TO
enumerator LV_SVG_PATH_CMD_CLOSE
enum [anonymous]

Values:

enumerator LV_SVG_ATTR_VALUE_DATA
enumerator LV_SVG_ATTR_VALUE_PTR
enum [anonymous]

Values:

enumerator LV_SVG_ATTR_VALUE_NONE
enumerator LV_SVG_ATTR_VALUE_INITIAL
enumerator LV_SVG_ATTR_VALUE_INHERIT

Functions

lv_svg_node_t *lv_svg_load_data(const char *svg_data, uint32_t data_len)

Loading SVG data and creating the DOM tree.

参数:
  • svg_data -- pointer to the SVG data

  • data_len -- the SVG data length

lv_svg_node_t *lv_svg_node_create(lv_svg_node_t *parent)

Create an SVG DOM node.

参数:

parent -- pointer to the parent node

返回:

true: an new SVG DOM node, false: NULL

void lv_svg_node_delete(lv_svg_node_t *node)

Delete an SVG DOM subtree.

参数:

node -- pointer to an SVG DOM subtree

struct lv_svg_point_t

Public Members

float x
float y
struct lv_svg_matrix_t

Public Members

float m[3][3]
union lv_svg_attr_value_t

Public Members

int32_t ival
uint32_t uval
float fval
char *sval
void *val
struct lv_svg_attr_values_list_t

Public Members

uint32_t length
uint8_t data[1]
struct lv_svg_attr_path_value_t

Public Members

uint32_t cmd
uint8_t data[1]
struct lv_svg_attr_t
struct lv_svg_node_t

Public Members

lv_tree_node_t base
char *xml_id
lv_svg_tag_t type
lv_array_t attrs
struct _lv_svg_render_obj *render_obj