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
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
According to the svg standard, in a case when 'x1==x2 and y1==y2'
for a linear gradient or when 'r==0' for a radial gradient, the area
should be painted as a single color - the last gradient stop color.
tvg file stores the version info of thorvg when it's generated,
in order to compare it with the runtime thorvg version when it's loaded.
For this, thorvg builds up the current version of symbol on the initilaization step,
that can be referred by the tvg loader.
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%
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>
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
for optimial library, we removed some peripheral information in default,
this breaks asan environment.
This patch changes it to make it both.
if you want to use asan, please change the meson option.
default is disabled.
example)
$meson . build -Db_sanitize=address
$meson . build -Db_sanitize=address,undefined
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.