After three months of hard work, version 0.15 of the ThorVG vector graphics library, written in C++ (C++14 standard) and distributed under the MIT license, has been released. The library is used for rendering vector graphics in projects such as Tizen OS, Godot Engine, LVGL and players dotLottie.
Thor Vector Graphics (ThorVG) – is a lightweight and portable open-source library designed for visualizing vector scenes and animations, including formats SVG Tiny 1.2, Lottie and its own TVG format (SVG, compressed with the LZW).
The library provides convenient APIs algorithm for importing, creating, and displaying vector graphics, as well as exporting them to various graphic formats, making it versatile for use across different software platforms and applications for visualizing graphic content:
#include "Example.h" using namespace std; void exportGif() { auto animation = tvg::Animation::gen(); auto picture = animation->picture(); if (!tvgexam::verify(picture->load(EXAMPLE_DIR"/lottie/walker.json"))) return; picture->size(800, 800); auto saver = tvg::Saver::gen(); if (!tvgexam::verify(saver->save(std::move(animation), "./test.gif"))) return; saver->sync(); cout << "Successfully exported to test.gif." << endl; } int main(int argc, char **argv) { if (tvgexam::verify(tvg::Initializer::init(0))) { exportGif(); tvg::Initializer::term(); } return 0; }
The library also comes with the utilities lottie2gif, svg2png, and svg2tvg.
The new version includes a number of significant improvements:
- performance, functionality, and stability of the WebGPU engine have been significantly enhanced;
- approximately a threefold increase in rendering performance for strokes;
- improved performance in masking and various blending methods;
- significantly reduced GPU memory load;
- added support for contour clipping and control of visible screen areas;
- greatly improved implementation of Lottie animations;
- the biggest addition to ThorVG is layer support in Lottie animations;
- interactive capabilities have been added to Lottie animations;
- text animation has been improved;
- the algorithm for calculating the control points of offset Bézier curves has been enhanced;
- the ability to apply various post-processing effects to the scene has been added;
- support for composite text glyphs has been introduced;
- composition performance has been improved in the OpenGL engine;
- new stable and experimental APIs have been added;
- numerous bugs have been fixed.
Source: linux.org.ru
