3 ThorVG is a platform independent standalone C++ library for drawing vector-based shapes and SVG.
7 - [Building ThorVG](#building-thorvg)
8 - [Meson Build](#meson-build)
9 - [Quick Start](#quick-start)
10 - [Issues or Feature Requests?](#issues-or-feature-requests)
13 thorvg supports [meson](https://mesonbuild.com/) build system.
16 install [meson](http://mesonbuild.com/Getting-meson.html) and [ninja](https://ninja-build.org/) if not already installed.
18 Run meson to configure ThorVG.
22 Run ninja to build & install ThorVG.
24 ninja -C build install
26 [Back to contents](#contents)
29 ThorVG renders vector shapes on a given canvas buffer.
31 You can initialize ThorVG engine first:
33 tvg::Initializer::init(tvg::CanvasEngine::Sw);
35 You can prepare a empty canvas for drawing on it.
37 static uint32_t buffer[WIDTH * HEIGHT]; //canvas target buffer
39 auto canvas = tvg::SwCanvas::gen(); //generate a canvas
40 canvas->target(buffer, WIDTH, WIDTH, HEIGHT); //stride, w, h
43 Next you can draw shapes onto the canvas.
45 auto shape = tvg::Shape::gen(); //generate a shape
46 shape->appendRect(0, 0, 200, 200, 0, 0); //x, y, w, h, rx, ry
47 shape->appendCircle(400, 400, 100, 100); //cx, cy, radiusW, radiusH
48 shape->fill(255, 255, 0, 255); //r, g, b, a
50 canvas->push(move(shape)); //push shape drawing command
52 Begin rendering & finish it at a particular time.
57 Lastly, you can acquire the rendered image in buffer memory.
59 [Back to contents](#contents)
61 ## Issues or Feature Requests?
62 For immidiate assistant or support please reach us in [Gitter](https://gitter.im/thorvg/community)