After three months of hard work, version 0.15 of the ThorVG vector graphics library has been released. It is written in C++ (C++14 standard) and distributed under the MIT license. 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 for rendering vector scenes and animations, including formats SVG Tiny 1.2, Lottie and its own TVG format (SVG compressed by the algorithm Lzw).
The library provides convenient APIs for importing, creating and displaying vector graphics, as well as for exporting them to various graphic formats, making it universal for use in various 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 lottie2gif, svg2png and svg2tvg utilities.
The new version contains a number of significant improvements:
- The performance, functionality and stability of the WebGPU engine have been significantly improved;
- approximately three times faster stroke rendering performance;
- Improved performance of masking and various overlay methods;
- significantly reduced load on GPU memory;
- added support for contour clipping and control over visible areas of the screen;
- Lottie animation implementation has been significantly improved;
- The biggest addition to ThorVG is support for layers in Lottie animations;
- Added interactive features to Lottie animations;
- improved text animation;
- improved algorithm for calculating control points of Bezier curves with offset;
- added the ability to apply various post-processing effects to the scene;
- Added support for composite text glyphs;
- The OpenGL engine has improved composition performance;
- added new stable and experimental APIs;
- Many bugs have been fixed.
Source: linux.org.ru
