Commit graph

40 commits

Author SHA1 Message Date
JunsuChoi
d03bf7a089 saver GifSaver: Introduce GifSaver for animation
Add save() API that takes tvg::Animation as a parameter.
This API uses gif.h to create each animation frame as a gif frame.
Gif creation do not support threads because they must be added sequentially.
Please see example/GifSaver.cpp

ex)
auto animation = tvg::Animation::gen();
auto picture = animation->picture();
picture->load(EXAMPLE_DIR"/walker.json");
auto saver = tvg::Saver::gen();
saver->save(std::move(animation), EXAMPLE_DIR"/test.gif");
saver->sync();

New API:
Result Saver::save(std::unique_ptr<Animation> animation, const std::string& path, uint32_t quality = 100, uint32_t fps = 0);

Issue: https://github.com/thorvg/thorvg/issues/1712
2023-11-02 17:50:27 +09:00
SergeyLebedkin
8d5c728119
wg_engine: introduce a webgpu canvas(engine)
WebGPU is a Render Hardware Interface built on top of the various APIs 
provided by the driver/OS depending on your platform. 

WebGPU exposes an API for performing operations, 
such as rendering and computation, on a Graphics Processing Unit.

WebGPU official documentation: https://www.w3.org/TR/webgpu/

The new engine type introduced: tvg::CanvasEngine::Wg

The new canvas type introduced: tvg::WgCanvas

Example:
$meson setup build -Dengines=wg_beta

`
    // init engine webgpu
    tvg::Initializer::init(tvg::CanvasEngine::Wg, 0);

    // create wg canvas
    auto canvasWg = tvg::WgCanvas::gen();
    canvas_wg->target(glfwGetWin32Window(window), width, height);

    // ...

    // terminate engine and window
    tvg::Initializer::term(tvg::CanvasEngine::Wg);
`
Still this feature is under the beta

Issue: https://github.com/thorvg/thorvg/issues/1479
2023-10-13 22:59:32 +09:00
Hermet Park
03976b02b3 infra/build: enable the lottie feature by default.
Lottie animation is a powerful feature in vector ux,
We can make this one of mandatory guidelines.
2023-08-11 15:00:09 +09:00
Hermet Park
da1b036e4f loader lottie: -- beta tag.
Now, it's quite workable. Include it in our default integration test suite.
2023-08-07 10:56:35 +09:00
Hermet Park
052cfea4b1 binding wasm: tag it as beta version.
wasm interfaces are fragile now.
we dont'guarantee compatibility yet.
2023-08-04 15:09:28 +09:00
Hermet Park
6ab32cae0b infra wasm: migrate wasm into bindings. 2023-08-04 15:09:28 +09:00
Hermet Park
3fe6c7126a infra build: revise the binding builds.
The thorvg lib should not have a dependency on the bindings.
In fact, it's inverted.
2023-08-03 10:52:40 +09:00
Hermet Park
60f81b7da7 loader lottie: added empty interface body
This marks the first step towards implementing the Lottie feature.
2023-07-27 00:31:27 +09:00
JunsuChoi
595cc56e86 webp_loader: Introduce Webp image loader
Add external_webp loader which uses libwebp library.
2023-06-09 10:58:01 +09:00
Hermet Park
0dec5a44b6 engine gl: specify gl as beta
The engine hasn't been maintained propelry and it's not functional.
2023-05-12 12:06:00 +09:00
Hermet Park
b2692484b7 infra - add 'all' option for savers.
ex) meson . build -Dsavers="all", ...
2023-04-07 13:54:29 +09:00
Hermet Park
2d830eae8b infra: update meson option description 2021-11-02 13:18:17 +09:00
JunsuChoi
590381f68b infra meson: Add -Dstatic option
Add an option for use in environments where
the use of static libraries must be enforced.
2021-11-02 13:14:16 +09:00
Hermet Park
f4d284df2a infra: add "all" option for tools.
just for developer convenience.
2021-10-14 14:54:24 +09:00
Hermet Park
a2ac28d0c5
infra: add all option to enable all loader formats.
just for developer convenience (including me)

ex) $meson . build -Dloaders="all" ...
2021-10-06 11:13:49 +09:00
Hermet Park
9128272ee3 infra: turn off the simd option in default.
avx is unstable, we can't recommend to use it.
2021-09-24 11:34:42 +09:00
Hermet Park
75e1310c7a prepare to release tvg format feature. 2021-09-16 17:46:10 +09:00
Hermet Park
ca16e8b403 build: renamed the cpu vectorization option. 2021-08-18 19:00:48 +09:00
Michal Szczecinski
e3eaa05548 build: Fixed simd options detection 2021-08-18 18:58:12 +09:00
Hermet Park
6ad1b1bf73 infra: tvg format is still fragile, we gonna release it under the beta. 2021-08-09 12:46:17 +09:00
Michal Szczecinski
1acc25b5ac sw_engine common: Added neon version of rasterRGBA32 API.
Changes:
- Added 'neon' vector option in build system
- Introduced neon version of rasterRGBA32 API, which improves
speed of the funciton on ARM cpu's around ~35%
2021-07-28 19:17:23 +09:00
Hermet Park
f66af5c8f5 tools svg2tvg: introduce a new tool for exporting tvg.
This is an utility to convert a file from svg to tvg
To use this, enable the feature by toggling in the meson option.

$meson build -Dtools="svg2tvg" ...

See also the usage:

Usage:
   svg2tvg [SVG file]

Examples:
    $ svg2tvg input.svg
2021-07-27 10:56:31 +09:00
Hermet Park
fe00e54257 tvg_saver: introduce a new module tvg saver
tvg saver is a new module to export tvg files.

In this patch, it also contains the infrastructure of saver module
to expand other types of savers such as png, jpg, etc.

To save the tvg file from a paint, you can use the Saver feature, for example:

auto saver = tvg::Saver::gen();
saver->save(paint, "sample.tvg");
saver->sync();

Later, you can read the "sample.tvg" using Picture.

auto picture = tvg::Picture::gen();
picture->load("sample.tvg");
...

The behavior of the saver will work on sync/async based on the threading setting of the initializer.
Thus if you wish to have a benefit of it, you must call sync() after the save() in the proper delayed time.

Otherwise, you can call sync() immediately.

Note that, the asynchronous tasking is depent on the saver module implementation.
Also, you need to enable tvg saver/loader modules from meson option. (yet this feature is under the beta)

@API Addition:
Result Saver::save(std::unique_ptr<Paint> paint, const std::string& path) noexcept;
Result Saver::sync() noexcept;

@Examples: tvgSaver

@Co-author: Mira Grudzinska <m.grudzinska@samsung.com>
2021-07-21 19:30:15 +09:00
Michal Maciola
0435f29f11 jpg_loader: introduced jpg decode using libjpeg-turbo
This patch introduces a jpg loader.
For decoding the image, libjpeg-turbo library is used. Library was found to be
fast (SIMD instructions accelerated) and portable.

@issue: #517
2021-07-07 13:44:16 +09:00
Hermet Park
15b56a66de tvg_loader: code refactoring.
revise it under the tvg coding convention.
2021-06-11 20:51:50 +09:00
Hermet Park
6b7aa8ad9e
tests: introduce catch2 unit tests infrastructure.
Catch2 is a multi-paradigm test framework for C++.
It is primarily distributed as a single header file,
very easy and simple to adopt this to thorvg project.

This patch introduces catch2 infrastsructure and one prototype as a sample.

You can refer "testInitializer.cpp", how to add unit test!
while ignoring else files such as "catch2.hpp", "testMain.cpp"

Also, enable Unit-tests with meson option when you change any thorvg code.

$meson build -Dtests=true.

launch tvgUnitTest in the build result then verify 100% coverage
before submitting any patches.
2021-06-04 16:46:34 +09:00
Hermet Park
bbfbe95ecc test: remove gtest & its infra.
thorvg is going to use catch2 framework, this is a cleanup work
before introducing catch2 utc.

See Catch2:
https://github.com/catchorg/Catch2/tree/v2.x
2021-06-03 17:38:07 +09:00
Hermet Park
3a538340aa infra: disable capi in default.
capi is not mandatory option in v0.1.

we can manually toggle it on when it's necessary.
2021-04-30 19:15:05 +09:00
Hermet Park
9e725226da
meson: revise png loader meson script.
We hate spagettie code, not even build script.
this revise it to keep the build script consistency.
2021-04-02 12:49:18 +09:00
Mateusz Palkowski
832568e07a Added libpng based png loading 2021-04-01 19:38:00 +09:00
JunsuChoi
54816339ed svg_loader XmlParser: Print unsupported elements, attribute with log option
* Using printf is temporary. We are planning a proper way to print the log.
When parsing a Svg file, Loader print unsupported elements and attributes.
2020-12-15 14:07:38 +09:00
JunsuChoi
9859a48714 test Canvas: Set up unit test based on gtest.
In test directory, set up unit_test based on gtest
First, add a test for SwCanvas generate.
2020-11-02 14:15:50 +09:00
Hermet Park
729fee5a23 examples: move tests to src/examples
tests is now officially placed in src/examples,
default is turned off, only necessaries turn it on.

ex) meson . build -Dexamples=true

+ this examples are required efl 'elementary' package.
2020-09-19 00:39:25 +09:00
Hermet Park
f11a4d9b7b build: renamed utilities to tools 2020-09-17 20:53:54 +09:00
Hermet Park
64c958cd2c bin svg2png: revise abe7187f5b
revise previous patch code.

1. turned off it in default.
2. + copyright declaration.
3. fix coding convention.
2020-09-16 11:22:54 +09:00
JunsuChoi
abe7187f5b
ThorVG/Utils: Convert svg to png (#8)
* thorVG/example: added thorVG example app to convert svg to png

Rasterazing the svg file and extracting it as a png file.
The png encoder uses the 'lodepng' library.
(https://lodev.org/lodepng/)

Usage:
   svg2png [svgFileName] [Resolution] [bgColor]

Examples:
    $ svg2png input.svg
    $ svg2png input.svg 200x200
    $ svg2png input.svg 200x200 ff00ff

* ThorVG/Utils: Change examples to utils

* ThorVG/Utils: Move svg2png from util to src/bin

Renamed the build option for svg2png.
2020-09-16 11:11:50 +09:00
Hermet Park
93b517df06 disable gl_engine in default.
We don't include gl compile before it works properly.

For development & test please turn it on in meson_option.txt locally.

Change-Id: I2ff8b06f8e1b496922f70ec580662e8886a9b93d
2020-08-14 17:45:13 +09:00
Hermet Park
9876d685cf capi: support c interfaces
this capi is under the beta,
we quickly provide this working prototype for collaboration.

Change-Id: Ie246abc306feb9a1305d1b593c4f3ef7f40ab5a9
2020-07-15 16:00:09 +09:00
Hermet Park
9e1ba8d2c0 sw_engine: introduce avx simd instruction
avx is the cutting edge method for intel & amd cpus simd instruction.
We are going to support this feature for the desktop environment (instead of sse)

You can turn on this with configuration something like this:

$meson . build -Dvectors=avx

Current patch supports only for raster solid color

Change-Id: I068ba30a1f63d480415e2762f8021fc8d6d28a39
2020-07-11 20:58:09 +09:00
Hermet Park
99428ee80a build: support features toggling in meson option.
Change-Id: Id1ebda70fe8380aaa913f79af26e5c39893a6df5
2020-07-08 15:30:12 +09:00