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