Update README.md

Add examples section.
This commit is contained in:
Hermet Park 2020-09-19 01:04:34 +09:00 committed by GitHub
parent 729fee5a23
commit e60c948e3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,6 +13,7 @@ ThorVG is a platform independent lightweight standalone C++ library for drawing
## Contents
- [Building ThorVG](#building-thorvg)
- [Meson Build](#meson-build)
- [Quick Start](#quick-start)
- [Examples](#examples)
- [Tools](#tools)
- [SVG to PNG](#svg-to-png)
@ -22,10 +23,10 @@ ThorVG is a platform independent lightweight standalone C++ library for drawing
[](#contents)
<br />
## Building ThorVG
thorvg supports [meson](https://mesonbuild.com/) build system.
Basically, ThorVG supports [meson](https://mesonbuild.com/) build system.
<br />
### Meson Build
install [meson](http://mesonbuild.com/Getting-meson.html) and [ninja](https://ninja-build.org/) if not already installed.
Install [meson](http://mesonbuild.com/Getting-meson.html) and [ninja](https://ninja-build.org/) if not already installed.
Run meson to configure ThorVG.
```
@ -38,10 +39,10 @@ ninja -C build install
[Back to contents](#contents)
<br />
<br />
## Examples
ThorVG renders vector shapes on a given canvas buffer.
## Quick Start
ThorVG renders vector shapes on a given canvas buffer. Here shows quick start to learn basic API usages.
You can initialize ThorVG engine first:
First, You can initialize ThorVG engine.
```cpp
tvg::Initializer::init(tvg::CanvasEngine::Sw, 0); //engine method, thread count
@ -150,6 +151,18 @@ Lastly, terminate the engine after usage.
```cpp
tvg::Initializer::term(tvg::CanvasEngine::Sw);
```
[Back to contents](#contents)
<br />
<br />
## Examples
There are various examples to understand ThorVG APIs, Please check sample code in `thorvg/src/examples`
To execute examples, you can build them with this meson option.
```
meson -Dexamples=true . build
```
Note that these examples are required EFL `elementary` package for launching. If you're using Linux-based OS, you could easily install its package from your OS distribution server. Otherwise, please visit the official [EFL page](https://enlightenment.org/) for more information.
[Back to contents](#contents)
<br />
<br />
@ -173,13 +186,12 @@ Examples:
$ svg2png input.svg 200x200
$ svg2png input.svg 200x200 ff00ff
```
[Back to contents](#contents)
<br />
<br />
## API Bindings
Our main development APIs are written in C++ but ThorVG also provides API bindings such as: C.
<br />
[Back to contents](#contents)
<br />
<br />