Commit graph

178 commits

Author SHA1 Message Date
Hermet Park
92070fe0de examples: replaced the Lenna with free images
https://www.pexels.com/photo/lovebirds-cuddling-on-a-wooden-branch-30518529/
https://www.pexels.com/@hardeep/

issue: https://github.com/thorvg/thorvg/issues/3499
2025-06-03 11:26:00 +09:00
Hermet Park
4a5d0c84e8 examples: updated svg 2025-05-08 23:19:39 +09:00
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
RuiwenTang
ec26784266 gl_engine: dynamic load gl functions
no any 3rd-party libs, such as glfw or glad did not used
support windows, linux, macos and emsdk
only the actually used set of functions are loaded

Co-Authored-By: Sergii Liebodkin <sergii@lottiefiles.com>
Co-Authored-BY: Hermet Park <hermet@lottiefiles.com>

issue: https://github.com/thorvg/thorvg/issues/2453
2025-05-08 14:58:13 +09:00
Hermet Park
6008120d35 example: clean up++ 2025-05-06 11:43:47 +09:00
Hermet Park
4e64804839 examples: changed animatable window size.
just changed the size to another one for better showcase
since 800x800 is not preferred by intel arc chipset.
animations look stutter.
2025-05-06 11:02:30 +09:00
Hermet Park
aa1fa1e10a Revert "example: disable vsync of sw window for stability."
This reverts commit 2d695c4d46.

because of crashes on MacOS.
2025-05-06 10:16:40 +09:00
Hermet Park
2d695c4d46 example: disable vsync of sw window for stability.
SDL + software engine doesn't need the vsync?

Observed the rendering performance is noticeably unstable on Intel Arc chipsets
with certain window sizes (ie 800x800) when VSync is enabled on software-rendered windows.

This might be a workaround, or it could be an issue with the driver or SDL.

Either way, the SDL + software engine doesn't need VSync.
2025-05-05 17:36:57 +09:00
Hermet Park
53e5e783b7 api: revise engine initialization and termination
Simplified parameters and ensured proper backend engine
initialization by using reference checking through canvas
instances.

C++ API Modification:
- Result Initializer::init(uint32_t threads, CanvasEngine engine)
 -> Result Initializer::init(uint32_t threads)
- Result Initializer::term(CanvasEngine engine)
 -> Result Initializer::term()

C API Modification:
- Tvg_Result tvg_engine_init(Tvg_Engine engine_method, unsigned threads)
 -> Tvg_Result tvg_engine_init(unsigned threads);
- Tvg_Result tvg_engine_term(Tvg_Engine engine_method)
 ->  Tvg_Result tvg_engine_term()

issue: https://github.com/thorvg/thorvg/issues/3116
2025-04-23 15:46:49 +09:00
Hermet Park
0c259b41f4 examples: updated svg resources 2025-04-15 11:59:02 +09:00
Hermet Park
a4ed00b08e examples: ++bounding box 2025-04-10 12:32:06 +09:00
Hermet Park
bf3bd908ff examples: updated lottie samples 2025-04-09 12:19:39 +09:00
Hermet Park
d3afebfdec lottie: add custom layer effect with expressions support
effect(name) / effect(index)

effects finds the effect by its name in the Effect Controls panel.
The name can be the default name or a user-defined name.
If multiple effects have the same name,
the effect closest to the top of the Effect Controls panel is used.

example:
- effect("Fast Blur")("Blurriness")

issue: https://github.com/thorvg/thorvg/issues/3115
2025-04-08 15:35:36 +09:00
Jinny You
1928f46e6a examples: Add default font fallback to LottieExpressions demo
Text Doc Expressions sample requires default font to show.
2025-03-28 17:02:11 +09:00
Hermet Park
11f59c03ae lottie/expressions: support wiggle effect
usage: wiggle(freq, amp, octaves=1, amp_mult=.5, t=time)

issue: https://github.com/thorvg/thorvg/issues/1640
2025-03-28 13:41:48 +09:00
Hermet Park
a4f927e3ef examples: updated lottie assets 2025-03-27 22:40:10 +09:00
Hermet Park
02baa6b462 examples: added LottieInteraction sample
The Interaction sample demonstrates
how to handle user input with ThorVG Lottie Expressions.
2025-03-24 12:11:15 +09:00
Hermet Park
eddd8961f3 common: hotfix regression bugs during recent dev
- fixed Duplicate/Text samples broken
- fixed a Lottie TextPath memory leaks
- fixed a broken SVG gaussian blur
2025-03-20 22:33:36 +09:00
Hermet Park
f01a9681ca example: ++bounding box 2025-03-20 13:26:25 +09:00
Mira Grudzinska
be32e97d96 svg: fix incorrect assignment of <stop> elements
If the svg contained an unsupported element with <stop> elements,
they were incorrectly assigned to the last loaded gradient. Now fixed.

@Issue: https://github.com/thorvg/thorvg/issues/3321
2025-03-12 15:02:25 +09:00
Hermet Park
6847d951d8 examples: updated Animation sample 2025-03-12 13:10:25 +09:00
Jinny You
010364174e examples/slot: added example for expressions slot overriding 2025-03-10 12:42:12 +09:00
Hermet Park
57dd66de1b example/capi: chores++ 2025-03-07 01:00:09 +09:00
Hermet Park
28d653e22f renderer: hotfix crash
addressed extra corner case errors by
9e6a514022
2025-03-06 23:46:15 +09:00
Hermet Park
97b48a97c1 examples: polished for a sleek initial screen appearance 2025-03-06 19:07:38 +09:00
Hermet Park
e2f1557de5 examples: chores++
- removed AnimatedMasking.
- unified ImageScaleUp/Down.
- build GifSaver only gif_saver is enabled.
2025-03-05 23:25:06 +09:00
Hermet Park
5c2e898cca examples: added bounding box sample 2025-03-05 14:46:55 +09:00
Hermet Park
67098793f0 renderer: revise the paint bounding box api
C++ API Modificaiton:
 - Result Paint::bounds(float* x, float* y, float* w, float* h, bool transform = false) const
  -> Result Paint::bounds(float* x, float* y, float* w, float* h) const

C++ API Addition:
 - Result Paint::bounds(Point* pt4) const

C API Modification:
- Tvg_Result tvg_paint_get_bounds(const Tvg_Paint* paint, float* x, float* y, float* w, float* h, bool transformed);
 -> Tvg_Result tvg_paint_get_aabb(const Tvg_Paint* paint, float* x, float* y, float* w, float* h);

C API Addition:
- Tvg_Result tvg_paint_get_obb(const Tvg_Paint* paint, Tvg_Point* pt4);

issue: https://github.com/thorvg/thorvg/issues/3290
2025-03-05 14:46:55 +09:00
Hermet Park
227a048752 examples: updated gifsaver
- walker.json has been removed
2025-02-27 23:32:48 +09:00
Hermet Park
e6ec370229 examples: removed Performance 2025-02-27 22:50:18 +09:00
Jinny You
bf5cea982c common: Support .lot extension
Add support for the .lot extension to recognize Lottie animation files, as this introduces an additional extension for Lottie.

issue: #3248
2025-02-27 16:46:30 +09:00
Hermet Park
01a4a4c806 examples: updated lottie samples 2025-02-25 23:00:10 +09:00
Hermet Park
4316498b8b examples: allow the engine name from the test script
Usage:
all.sh [engine name] [interval]

Example:
$./all.sh gl 3
2025-02-25 12:52:13 +09:00
Hermet Park
70f0ec9ff2 examples: renamed StrokeTrim -> TrimPath 2025-02-25 12:46:54 +09:00
Mira Grudzinska
b939a60bfa api: change api name strokeTrim() -> trimpath()
No changes in behaviour so far.
2025-02-24 15:05:38 +09:00
Hermet Park
02678b67f4 examples: unified samples and improved coverages
- Unify samples for simpler testing:
 - Masking + InvMasking
 - LumaMasking + InvLumaMasking

- Applied Dash for the Stroke Triming
2025-02-21 17:16:26 +09:00
Sergii Liebodkin
1416e99f34 example: fix types of drop shadows effect parameters (int to double) 2025-02-21 00:06:53 +09:00
Hermet Park
8e1cd7b4c6 examples: added a default font for flawless test 2025-02-20 23:16:15 +09:00
Hermet Park
8e5ca40250 text: allow the unnamed font
If the font name is not specified,
ThorVG will select any available font candidate.

This could be useful for font fallback mechanism.
2025-02-20 18:47:01 +09:00
Hermet Park
424953ad7b examples: build LottieTweening only if enabled 2025-02-18 12:31:10 +09:00
Jakub Marcowski
4042c7a6a7 Optimize all .png images using oxipng 2025-02-17 16:06:37 +09:00
Fabian Blatz
71bb4163ed common: fixed double-precision promotion compilation warnings
Co-Authored-By: Hermet Park <hermet@lottiefiles.com>
2025-02-12 20:23:34 +09:00
Hermet Park
eab9d68e67 api: remove SwCanvas::mempool()
We have improved the functionality to manage the memory pool safely,
by figuring out the current working threads. Users no longer need to
manually configure memory pool management, and the related APIs
have been removed.

API Removals:
- Result SwCanvas::mempool(MempoolPolicy policy)
- enum SwCanvas::MempoolPolicy

- Tvg_Result tvg_swcanvas_set_mempool(Tvg_Canvas* canvas,  Tvg_Mempool_Policy policy)
- enum Tvg_Mempool_Policy

issue: https://github.com/thorvg/thorvg/issues/3116
2025-02-12 13:19:12 +09:00
Hermet Park
cc4c18d6c6 renderer: revise the Shape rect/circle features
The path direction of shapes is now functional for path trimming.
Replace the main logic with Lottie's by default
to align the spec, migrate the original logic to svg loader side.

This revision helps to reduce the binary size by 2–3 KB for lottie loader.

API Modifications:

- Result Shape::appendRect(float x, float y, float w, float h, float rx = 0, float ry = 0)
 -> Result Shape::appendRect(float x, float y, float w, float h, float rx = 0, float ry = 0, bool cw = true)
- Result Shape::appendCircle(float cx, float cy, float rx, float ry)
 -> Result Shape::appendCircle(float cx, float cy, float rx, float ry, bool cw = true)
- TVG_API Tvg_Result tvg_shape_append_circle(Tvg_Paint* paint, float cx, float cy, float rx, float ry)
 -> TVG_API Tvg_Result tvg_shape_append_circle(Tvg_Paint* paint, float cx, float cy, float rx, float ry, bool cw)
- Tvg_Result tvg_shape_append_rect(Tvg_Paint* paint, float x, float y, float w, float h, float rx, float ry)
 -> Tvg_Result tvg_shape_append_rect(Tvg_Paint* paint, float x, float y, float w, float h, float rx, float ry, bool cw)

issue: https://github.com/thorvg/thorvg/issues/3179
2025-02-12 01:41:02 +09:00
Hermet Park
4f0f2e4c08 example: removed interaction sample
LottieTweening is replaced with it.
2025-02-06 19:09:27 +09:00
Hermet Park
be0949339c example: added lottie tweening sample 2025-02-06 19:09:27 +09:00
Popolon
02be99185e include <cstring> in examples/Example.h 2025-02-03 11:23:34 +09:00
Hermet Park
97f85d44cb example/interaction: chores++ 2025-01-22 13:22:24 +09:00
Hermet Park
fdd760a34f api: revised the animation segment specification
Changed the unit of the segment from a normalized value to frame numbers,
ensuring alignment with other frame control interfaces.

Note that This change may break backward compatibility.

issue: https://github.com/thorvg/thorvg/issues/3116
2025-01-22 13:03:48 +09:00
Hermet Park
48c8094d19 api: path api revision for v1.0
Unify the Path commands & pts getters.

C++ API modiciation:
- uint32_t Shape::pathCommands(const PathCommand** cmds) const
- uint32_t Shape::pathCoords(const PathCommand** cmds) const
 -> Result Shape::path(const PathCommand** cmds, uint32_t* cmdsCnt, const Point** pts, uint32_t* ptsCnt)

C API modification:
- Tvg_Result tvg_shape_get_path_coords(const Tvg_Paint* paint, const Tvg_Point** pts, uint32_t* cnt)
- Tvg_Result tvg_shape_get_path_commands(const Tvg_Paint* paint, const Tvg_Path_Commands** cmds, uint32_t* cnt)
 -> Tvg_Result tvg_shape_get_path(const Tvg_Paint* paint, const Tvg_Path_Command** cmds, uint32_t* cmdsCnt, const Tvg_Point** pts, uint32_t* ptsCnt)

issue: https://github.com/thorvg/thorvg/issues/3116
2025-01-14 11:47:28 +09:00