Skip to main content

Crate thorvg_sys

Crate thorvg_sys 

Source
Expand description

Raw FFI bindings to the ThorVG vector graphics library.

This crate provides unsafe, low-level bindings generated by bindgen from the ThorVG C API (thorvg_capi.h). For a safe, idiomatic Rust API, use the [thorvg] crate instead.

This crate is no_std compatible.

Structs§

Tvg_Color_Stop
@brief A data structure storing the information about the color and its relative position inside the gradient bounds.
Tvg_Glyph_Metrics
@brief Describes the layout metrics of a glyph.
Tvg_Matrix
@brief A data structure representing a three-dimensional matrix.
Tvg_Point
@brief A data structure representing a point in two-dimensional space.
Tvg_Text_Metrics
@brief Describes the font metrics of a text object.
_Tvg_Accessor
_Tvg_Animation
_Tvg_Canvas
_Tvg_Gradient
_Tvg_Paint
_Tvg_Saver

Enums§

Tvg_Blend_Method
@brief Enumeration indicates the method used for blending paint. Please refer to the respective formulas for each method.
Tvg_Colorspace
@brief Enumeration specifying the methods of combining the 8-bit color channels into 32-bit color.
Tvg_Engine_Option
@brief Enumeration to specify rendering engine behavior.
Tvg_Fill_Rule
@brief Enumeration specifying the algorithm used to establish which parts of the shape are treated as the inside of the shape.
Tvg_Filter_Method
@brief Defines the image filtering method used during image scaling or transformation.
Tvg_Mask_Method
@brief Enumeration indicating the method used in the masking of two objects - the target and the source.
Tvg_Result
@brief Enumeration specifying the result from the APIs.
Tvg_Stroke_Cap
@brief Enumeration determining the ending type of a stroke in the open sub-paths.
Tvg_Stroke_Fill
@brief Enumeration specifying how to fill the area outside the gradient bounds.
Tvg_Stroke_Join
@brief Enumeration specifying how to fill the area outside the gradient bounds.
Tvg_Text_Wrap
@brief A data structure storing the information about the color and its relative position inside the gradient bounds.
Tvg_Type
@brief Enumeration indicating the ThorVG object type value.

Constants§

TVG_PATH_COMMAND_CLOSE
< Ends the current sub-path and connects it with its initial point - corresponds to Z command in the svg path commands.
TVG_PATH_COMMAND_CUBIC_TO
< Draws a cubic Bezier curve from the current point to the given point using two given control points and sets a new value of the current point - corresponds to C command in the svg path commands.
TVG_PATH_COMMAND_LINE_TO
< Draws a line from the current point to the given point and sets a new value of the current point - corresponds to L command in the svg path commands.
TVG_PATH_COMMAND_MOVE_TO
< Sets a new initial point of the sub-path and a new current point - corresponds to M command in the svg path commands.
TVG_VERSION_MAJOR
TVG_VERSION_MICRO
TVG_VERSION_MINOR

Functions§

tvg_accessor_del
@brief Deletes the given accessor object.
tvg_accessor_generate_id
@brief Generate a unique ID (hash key) from a given name.
tvg_accessor_get_name
@brief Retrieve the original name string from a given unique ID.
tvg_accessor_new
/ /** @brief Creates a new accessor object.
tvg_accessor_set
@brief Sets the paint of the accessor then iterates through its descendents.
tvg_animation_del
@brief Deletes the given Tvg_Animation object.
tvg_animation_get_duration
@brief Retrieves the duration of the animation in seconds.
tvg_animation_get_frame
@brief Retrieves the current frame number of the animation.
tvg_animation_get_picture
@brief Retrieves a picture instance associated with this animation instance.
tvg_animation_get_segment
@brief Gets the current segment range information.
tvg_animation_get_total_frame
@brief Retrieves the total number of frames in the animation.
tvg_animation_new
@brief Creates a new Animation object.
tvg_animation_set_frame
@brief Specifies the current frame in the animation.
tvg_animation_set_segment
@brief Specifies the playback segment of the animation.
tvg_canvas_add
@brief Adds a paint object to the canvas for rendering.
tvg_canvas_destroy
/ /** @brief Clears the canvas internal data, releases all paints stored by the canvas and destroys the canvas object itself.
tvg_canvas_draw
@brief Requests the canvas to render the Paint objects.
tvg_canvas_insert
@brief Inserts a paint object into the canvas root scene.
tvg_canvas_remove
@brief Removes a paint object from the root scene.
tvg_canvas_set_viewport
@brief Sets the drawing region of the canvas.
tvg_canvas_sync
@brief Guarantees that drawing task is finished.
tvg_canvas_update
@brief Requests the canvas to update modified paint objects in preparation for rendering.
tvg_engine_init
/ /** @brief Initializes the ThorVG engine.
tvg_engine_term
@brief Terminates the ThorVG engine.
tvg_engine_version
@brief Retrieves the version of the TVG engine.
tvg_font_load
@brief Loads a scalable font data from a file.
tvg_font_load_data
@brief Loads a scalable font data from a memory block of a given size.
tvg_font_unload
@brief Unloads the specified scalable font data that was previously loaded.
tvg_glcanvas_create
@brief Creates a new OpenGL/ES Canvas object with optional rendering engine settings.
tvg_glcanvas_set_target
@brief Sets the drawing target for rasterization.
tvg_gradient_del
@brief Deletes the given gradient object.
tvg_gradient_duplicate
@brief Duplicates the given Tvg_Gradient object.
tvg_gradient_get_color_stops
@brief Gets the parameters of the colors of the gradient, their position and number
tvg_gradient_get_spread
@brief Gets the FillSpread value of the gradient object.
tvg_gradient_get_transform
@brief Gets the matrix of the affine transformation of the gradient object.
tvg_gradient_get_type
@brief Gets the unique value of the gradient instance indicating the instance type.
tvg_gradient_set_color_stops
@brief Sets the parameters of the colors of the gradient and their position.
tvg_gradient_set_spread
@brief Sets the Tvg_Stroke_Fill value, which specifies how to fill the area outside the gradient bounds.
tvg_gradient_set_transform
@brief Sets the matrix of the affine transformation for the gradient object.
tvg_linear_gradient_get
@brief Gets the linear gradient bounds.
tvg_linear_gradient_new
/ /** @brief Creates a new linear gradient object.
tvg_linear_gradient_set
@brief Sets the linear gradient bounds.
tvg_lottie_animation_apply_slot
@brief Applies a previously generated slot to the animation.
tvg_lottie_animation_assign
@brief Updates the value of an expression variable for a specific layer.
tvg_lottie_animation_del_slot
@brief Deletes a previously generated slot.
tvg_lottie_animation_gen_slot
@brief Generates a new slot from the given slot data.
tvg_lottie_animation_get_marker
@brief Gets the marker name by a given index.
tvg_lottie_animation_get_marker_info
@brief Retrieves marker information by index.
tvg_lottie_animation_get_markers_cnt
@brief Gets the marker count of the animation.
tvg_lottie_animation_new
@brief Creates a new LottieAnimation object.
tvg_lottie_animation_set_marker
@brief Specifies a segment by marker.
tvg_lottie_animation_set_quality
@brief Sets the quality level for Lottie effects.
tvg_lottie_animation_tween
@brief Interpolates between two frames over a specified duration.
tvg_paint_duplicate
@brief Duplicates the given Tvg_Paint object.
tvg_paint_get_aabb
@brief Retrieves the axis-aligned bounding box (AABB) of the paint object in canvas space.
tvg_paint_get_clip
@brief Get the clipper shape of the paint object.
tvg_paint_get_id
@brief Gets the ID of the Paint object.
tvg_paint_get_mask_method
@brief Gets the masking target object and the masking method.
tvg_paint_get_obb
@brief Retrieves the object-oriented bounding box (OBB) of the paint object in canvas space.
tvg_paint_get_opacity
@brief Gets the opacity of the given Tvg_Paint.
tvg_paint_get_parent
@brief Retrieves the parent paint object.
tvg_paint_get_ref
@brief Retrieve the current reference count of the Tvg_Paint object.
tvg_paint_get_transform
@brief Gets the matrix of the affine transformation of the given Tvg_Paint object.
tvg_paint_get_type
@brief Gets the unique value of the paint instance indicating the instance type.
tvg_paint_get_visible
@brief Gets the current visibility status of the Paint object.
tvg_paint_intersects
@brief Checks whether a given region intersects the filled area of the paint.
tvg_paint_ref
@brief Increment the reference count for the Tvg_Paint object.
tvg_paint_rel
@brief Safely releases a Tv_Paint object.
tvg_paint_rotate
@brief Rotates the given Tvg_Paint by the given angle.
tvg_paint_scale
@brief Scales the given Tvg_Paint object by the given factor.
tvg_paint_set_blend_method
@brief Sets the blending method for the paint object.
tvg_paint_set_clip
@brief Clip the drawing region of the paint object.
tvg_paint_set_id
@brief Sets the ID of the Paint object.
tvg_paint_set_mask_method
@brief Sets the masking target object and the masking method.
tvg_paint_set_opacity
@brief Sets the opacity of the given Tvg_Paint.
tvg_paint_set_transform
@brief Transforms the given Tvg_Paint using the augmented transformation matrix.
tvg_paint_set_visible
@brief Sets the visibility of the Paint object.
tvg_paint_translate
@brief Moves the given Tvg_Paint in a two-dimensional space.
tvg_paint_unref
@brief Decrement the reference count for the Tvg_Paint object.
tvg_picture_get_origin
@brief Gets the normalized origin point of the Picture object.
tvg_picture_get_paint
@brief Retrieve a paint object from the Picture scene by its Unique ID.
tvg_picture_get_size
@brief Gets the size of the loaded picture.
tvg_picture_load
@brief Loads a picture data directly from a file.
tvg_picture_load_data
@brief Loads a picture data from a memory block of a given size.
tvg_picture_load_raw
@brief Loads raw image data in a specific format from a memory block of the given size.
tvg_picture_new
@brief Creates a new Picture object.
tvg_picture_set_accessible
@brief Enable or disable accessible mode for a Picture.
tvg_picture_set_asset_resolver
@brief Sets the asset resolver callback for handling external resources (e.g., images and fonts).
tvg_picture_set_filter
@brief Sets the image filtering method for rendering this picture.
tvg_picture_set_origin
@brief Sets the normalized origin point of the Picture object.
tvg_picture_set_size
@brief Resizes the picture content to the given width and height.
tvg_radial_gradient_get
@brief The function gets radial gradient attributes.
tvg_radial_gradient_new
@brief Creates a new radial gradient object.
tvg_radial_gradient_set
@brief Sets the radial gradient attributes.
tvg_saver_del
@brief Deletes the given Tvg_Saver object.
tvg_saver_new
/ /** @brief Creates a new Tvg_Saver object.
tvg_saver_save_animation
@brief Exports the given @p animation data to the given @p path
tvg_saver_save_paint
@brief Exports the given @p paint data to the given @p path
tvg_saver_sync
@brief Guarantees that the saving task is finished.
tvg_scene_add
@brief Adds a paint object to the scene.
tvg_scene_add_effect_drop_shadow
@brief Adds a drop shadow effect to the scene.
tvg_scene_add_effect_fill
@brief Adds a fill color effect to the scene.
tvg_scene_add_effect_gaussian_blur
@brief Adds a Gaussian blur effect to the scene.
tvg_scene_add_effect_tint
@brief Adds a tint effect to the scene.
tvg_scene_add_effect_tritone
@brief Adds a tritone color effect to the scene.
tvg_scene_clear_effects
@brief Clears all previously applied scene effects.
tvg_scene_insert
@brief Inserts a paint object into the scene.
tvg_scene_new
@brief Creates a new Scene object.
tvg_scene_remove
@brief Removes a paint object from the scene.
tvg_shape_append_circle
@brief Appends an ellipse to the path.
tvg_shape_append_path
@brief Appends a given sub-path to the path.
tvg_shape_append_rect
@brief Appends a rectangle to the path.
tvg_shape_close
@brief Closes the current sub-path by drawing a line from the current point to the initial point of the sub-path.
tvg_shape_cubic_to
@brief Adds new points to the sub-path, which results in drawing a cubic Bezier curve.
tvg_shape_get_fill_color
@brief Gets the shape’s solid color.
tvg_shape_get_fill_rule
@brief Retrieves the current fill rule used by the shape.
tvg_shape_get_gradient
@brief Gets the gradient fill of the shape.
tvg_shape_get_path
@brief Retrieves the current path data of the shape.
tvg_shape_get_stroke_cap
@brief Gets the stroke cap style used for stroking the path.
tvg_shape_get_stroke_color
@brief Gets the shape’s stroke color.
tvg_shape_get_stroke_dash
@brief Gets the dash pattern of the stroke.
tvg_shape_get_stroke_gradient
@brief Gets the gradient fill of the shape’s stroke.
tvg_shape_get_stroke_join
@brief The function gets the stroke join method
tvg_shape_get_stroke_miterlimit
@brief The function gets the stroke miterlimit.
tvg_shape_get_stroke_width
@brief Gets the shape’s stroke width.
tvg_shape_line_to
@brief Adds a new point to the sub-path, which results in drawing a line from the current point to the given end-point.
tvg_shape_move_to
@brief Sets the initial point of the sub-path.
tvg_shape_new
@brief Creates a new Shape object.
tvg_shape_reset
@brief Resets the shape path properties.
tvg_shape_set_fill_color
@brief Sets the shape’s solid color.
tvg_shape_set_fill_rule
@brief Sets the fill rule for the shape.
tvg_shape_set_gradient
@brief Sets the gradient fill for all of the figures from the path.
tvg_shape_set_paint_order
@brief Sets the rendering order of the stroke and the fill.
tvg_shape_set_stroke_cap
@brief Sets the cap style used for stroking the path.
tvg_shape_set_stroke_color
@brief Sets the shape’s stroke color.
tvg_shape_set_stroke_dash
@brief Sets the shape’s stroke dash pattern.
tvg_shape_set_stroke_gradient
@brief Sets the gradient fill of the stroke for all of the figures from the path.
tvg_shape_set_stroke_join
@brief Sets the join style for stroked path segments.
tvg_shape_set_stroke_miterlimit
@brief Sets the stroke miterlimit.
tvg_shape_set_stroke_width
@brief Sets the stroke width for the path.
tvg_shape_set_trimpath
@brief Sets the trim of the shape along the defined path segment, allowing control over which part of the shape is visible.
tvg_swcanvas_create
@brief Creates a new Software Canvas object with optional rendering engine settings.
tvg_swcanvas_set_target
@brief Sets the buffer used in the rasterization process and defines the used colorspace.
tvg_text_align
@brief Sets text alignment or anchor per axis.
tvg_text_get_glyph_metrics
@brief Retrieves the layout metrics of a glyph in the text object.
tvg_text_get_text
@brief Returns the currently assigned unicode text.
tvg_text_get_text_metrics
@brief Retrieves the layout metrics of the text object.
tvg_text_layout
@brief Sets the virtual layout box (constraints) for the text.
tvg_text_line_count
@brief Returns the number of text lines.
tvg_text_new
@brief Creates a new Text object.
tvg_text_set_color
@brief Sets the text solid color.
tvg_text_set_font
@brief Sets the font family for the text.
tvg_text_set_gradient
@brief Sets the gradient fill for the text.
tvg_text_set_italic
@brief Apply an italic (slant) transformation to the text.
tvg_text_set_outline
@brief Sets an outline (stroke) around the text object.
tvg_text_set_size
@brief Sets the font size for the text.
tvg_text_set_text
@brief Assigns the given unicode text to be rendered.
tvg_text_spacing
@brief Set the spacing scale factors for text layout.
tvg_text_wrap_mode
@brief Sets the text wrapping mode for this text object.
tvg_wgcanvas_create
@brief Creates a new WebGPU Canvas object with optional rendering engine settings.
tvg_wgcanvas_set_target
@brief Sets the drawing target for the rasterization.

Type Aliases§

Tvg_Accessor
@brief A structure representing an object that enables iterating through a scene’s descendents.
Tvg_Animation
@brief A structure representing an animation controller object.
Tvg_Canvas
@brief A structure responsible for managing and drawing graphical elements.
Tvg_Gradient
@brief A structure representing a gradient fill of a Tvg_Paint object.
Tvg_Paint
@brief A structure representing a graphical element.
Tvg_Path_Command
@brief Enumeration specifying the values of the path commands accepted by ThorVG.
Tvg_Picture_Asset_Resolver
@brief Callback function type for resolving external assets.
Tvg_Saver
@brief A structure representing an object that enables to save a Tvg_Paint object into a file.
_bindgen_ty_1