Commit graph

53 commits

Author SHA1 Message Date
Hermet Park
0b77659136 infra: added opengl_es extra option for explicit selection
usages:
meson setup build -Dengines="gl"  //opengl
meson setup build -Dengines="gl" -Dextra="opengl_es"  //opengl es
2025-05-08 12:00:22 +03:00
Hermet Park
1422c4ca5f renderer: make the file io configurable
certain systems, may not support file I/O operations.
ThorVG should provide users with an option to configure
builds according to their requirements.

This ensures that file I/O calls are avoided,
preventing potential crashes.

Please use the meson '-Dfile=true/false' option for this.

Please note that "THORVG_FILE_IO_SUPPORT" might be expected
for your thorvg manual build.

issue: https://github.com/thorvg/thorvg/issues/3008
2024-12-02 11:50:59 +09:00
Hermet Park
0e45fabb3d spec out tvg binary format
issue: https://github.com/thorvg/thorvg/issues/2721
2024-10-12 21:07:31 +09:00
Hermet Park
145195baac infra: removed beta tag from WebGPU
Removed beta tag for dev convenience. Also, ensures that
ThorVG will officially release WebGPU in the next version (v1.0)
2024-10-07 21:08:52 +09:00
Hermet Park
ec792d2e9a infra: promote the GL engine to an official one.
The ThorVG OpenGL/ES engine has been stabilized and improved
significantly. Now, as a graphics engine, its drawing features
are quite functional. It is time to officially release the
engine and maintain it in the release process.

Thanks @Ruiwen for going above and beyond!

issue: https://github.com/thorvg/thorvg/issues/2435
2024-06-21 11:53:37 +09:00
Hermet Park
db71bc5b55 infra: add extra build options for flexible ThorVG composition
this commit introduces an additional build options:

- lottie expressions: this advanced feature in Lottie can
significantly increase binary size. Users now have the option
to enable or disable it based on their requirements.

Note that, this change introduces one config definitions:

- THORVG_LOTTIE_EXPRESSIONS_SUPPORT
2024-05-09 10:27:39 +09:00
Hermet Park
5d22b6fb9e infra: enable ttf loader in default. 2024-04-22 11:10:44 +09:00
Hermet Park
fa4b2cb704 infra: revise the vector build script
Note that this change renames the Meson option from 'vector' to 'simd',
separates the NEON types into 'neon-arm' and 'neon-aarch',
and designates the 'mfpu' option solely for 'neon-arm'.
2024-04-15 00:08:34 +09:00
Junsu Choi
df4f93e79f loader/webp: Support static webp loader
Built to libwebp code in to support the static option of webp loader.
Code from :https://github.com/jacklicn/libwebp

This forking version only contains the minimal webp decoding feature.

Binary Size: +68kb

Co-authored-by: Hermet Park <hermet@lottiefiles.com>

issue: https://github.com/thorvg/thorvg/issues/1427
2024-02-07 10:58:25 +09:00
Hermet Park
a49532a818 common: STM32 portability enhancement
Some systems such as micro-processor might not support
the thread feature on the system.

Enhance the portability by compiling the thorvg with toggling the
threading depepdency through the build option.

For this, thorvg newly introduced the internal Key/ScopedLock abstraction
for transparent thread-locking dependnecy.

To turn off the thread feature, please use the next build option:

$meson setup build -Dthreads=false ...

Note that, the thread feature is enabled in default.
Turning off the thread feature could reduce the binary size by 7kb.

issue: https://github.com/thorvg/thorvg/issues/1900
2024-01-18 10:20:21 +09:00
Hermet Park
8375c53461 ttf: removed the beta tag.
incorporate TTF support into the CI build tests.
2024-01-03 12:57:07 +09:00
Hermet Park
3c4e434b39 loader/ttf: introduce a new sfnt(scalable font) loader.
ttf is an industry standard format that is the most widely used
in the products. Now thorvg supports the basic features of
the font to supplement the text drawing.

The implementation is followed the ttf spec,
the covered features are:

- horizontal layouting with kerning.
- utf8 -> utf32 converted glyph drawing.

To use the feature, please enable ttf loader:
$meson -Dloaders="ttf_beta, ..."

@Issue: https://github.com/thorvg/thorvg/issues/969
2023-12-25 12:40:12 +09:00
Hermet Park
024e879ee6 tools/lottie2gif: introduce a new converter tool.
Usage:
   lottie2gif [Lottie file] or [Lottie folder] [-r resolution] [-f fps]

Examples:
    $ lottie2gif input.json
    $ lottie2gif input.json -f 30
    $ lottie2gif input.json -r 600x600 -f 30
    $ lottie2gif lottiefolder
    $ lottie2gif lottiefolder -r 600x600
    $ lottie2gif lottiefolder -r 600x600 -f 30
2023-11-03 17:19:05 +09:00
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