Commit graph

677 commits

Author SHA1 Message Date
Hermet Park
516e8bf042 loader/lottie: minimum support for 3D transform
It lacks perspective projection information,
so it transforms 3D axes with orthogonal projection.
2023-09-07 17:59:52 +09:00
Hermet Park
b5fcc90e5d loader/lottie: fix a wrong precomp time remapping.
the remapped frame number should be applied to the only referenced
precomp layer.
2023-09-07 17:59:52 +09:00
Hermet Park
a49ac81543 loader/lottie: support the repeater property 2023-09-07 12:17:16 +09:00
Hermet Park
2fab9fb7d9 loader/lottie: fix the incorrect viewport clip condition.
the viewport clip should be applied when it has a precomposition reference
but should not apply to image assets.
2023-09-07 12:17:16 +09:00
Hermet Park
dae6636d29 loader/lottie: filled a missing gradient stroke dash body. 2023-09-05 18:41:20 +09:00
Hermet Park
64a444aeb6 loader/lottie: support focal property in the radial gradient 2023-09-05 10:29:12 +09:00
Hermet Park
e0d1c947e6 infra: renamed the files for the consistency. 2023-09-04 17:26:43 +09:00
Mira Grudzinska
fd014df1a9 loader/svg: support the focal property in the radial gradient.
@Issue: https://github.com/thorvg/thorvg/issues/1555
2023-09-04 16:48:38 +09:00
Hermet Park
ac8f3b8be6 loader/lottie: support hold interpolation. 2023-09-04 11:16:01 +09:00
Hermet Park
ad9d9d0ecd loader/lottie: support trimpath feature 2023-09-01 13:16:18 +09:00
Hermet Park
22771b5d8a loader/lottie: fix a broken masking feature.
the inverse alpha should keep its own value.
previously, it's modified to alpha by a mistake.
2023-09-01 13:16:18 +09:00
Hermet Park
7c669f622f loader/lottie: enhanced the coverage of the rounded corner feature.
Rounded corners should now be applied not only to rectangles
but also to path strokes. This enhancement changes the stroke join style
to round when a rounded corner is present.

Indeed, rounded corners ensure the accurate calculation of roundness based on the join style.
However, this patch has not yet been designed to handle it.
2023-09-01 13:16:18 +09:00
Hermet Park
c23c556f61 loader/lottie: fix a default color of the solid layer.
we assume the default color is black.
before this fix, the value is not designated properly.
2023-08-30 17:46:32 +09:00
Hermet Park
ce5ac1c114 loader/lottie: fix a crash issue caused by incorrect gradient alpha handling.
This fix addresses the interpretation of gradient alpha values,
preventing a potential crash due to invalid memory access.
2023-08-30 17:46:27 +09:00
Hermet Park
5a73bcaa8f common/array: code refactoring
easy access to a specific data with a operator.
2023-08-29 12:28:38 +09:00
Hermet Park
07069f6640 loader/lottie: introduce chaining maskings more effectively. 2023-08-28 11:55:17 +09:00
Hermet Park
7b40c741ac loader/lottie: correct a polystar transform.
Properly propagate the transform information to the merged shapes.
This corrects the incorrect transformation applied to the subsequent shapes.
2023-08-24 10:57:38 +09:00
Hermet Park
3d5c5ef0fa loader/lottie: support the stroke offset property 2023-08-24 10:56:07 +09:00
Hermet Park
7d797ee548 Yet we don't break apis, this patch reverts the next:
cb36c25aff
8c0fc2b25a
c1e4e0808a

Those reverted changes sholud be in the bucket, the next issue item:

@Issue: https://github.com/thorvg/thorvg/issues/1372
2023-08-24 01:00:57 +09:00
Hermet Park
68f4193378 loader/lottie: support the polystar property. 2023-08-23 13:12:26 +09:00
Mira Grudzinska
478e45f9f3 common: stroke dash offset support added
The feature is supported also in the svg loader.

@Issue: https://github.com/thorvg/thorvg/issues/1591
2023-08-23 12:40:27 +09:00
Mira Grudzinska
c1e4e0808a Revert "api: enhance Shape::stroke() method usage."
This reverts commit 6cbc1de570.
Setting def value for 'a' makes it impossible to overload
the 'stroke' api with 3 values (needed for introducing dash offset).
2023-08-23 12:40:27 +09:00
Hermet Park
4127f4ce7a loader/lottie: revised the key-frame searching
Replace the linear search algorithm with binary-search.

The performance enhancement may not yield significant benefits in normal cases.
However, it becomes crucial if the animation comprises an extensive number of frames...
2023-08-22 21:25:51 +09:00
Hermet Park
345b867c38 loader/lottie: optimize the matrix computation.
Do not multiply the matrices if either one is identity.
2023-08-22 21:25:42 +09:00
Hermet Park
b240e781d9 loader/lottie: ++optimization.
Removed intermediate scenes that were nothing more than transformations.
2023-08-22 21:25:37 +09:00
Hermet Park
f399491557 loader/svg: ++optimization
flush out the used internal memory immediately.
2023-08-22 13:29:49 +09:00
Hermet Park
5d32cf1e3b loader/svg: ++optimization
share the image data to bypass the need for multiple bitmap memory copies.
2023-08-22 13:29:49 +09:00
Hermet Park
cd71c66703 loader/jpg: fix a sanitizer report.
Bypass the operation involving a negative value shift.

../src/loaders/jpg/tvgJpgd.cpp:434:36: runtime error: left shift of negative value -5
2023-08-21 17:16:45 +09:00
Mira Grudzinska
70fff186b2 svg_loader: support other units for mask and clip
Added support for the objectBoundingBox value of
the clipPathUnits and for the userSpaceOnUse value
of the maskContentUnits.

@Issue: https://github.com/thorvg/thorvg/issues/429
2023-08-19 13:10:03 +09:00
Hermet Park
664f028c15 loader/lottie: fix all data conversion compiler warnings on windows 2023-08-18 16:36:15 +09:00
Hermet Park
c90962a26c lottie/loader: fix memory leaks 2023-08-18 15:16:34 +09:00
Hermet Park
cf826bee5d lottie/builder: --compiler warning on MacOS 2023-08-18 13:14:06 +09:00
Hermet Park
994c1b99a5 lottie/loader: support the masking features.
Enhancing the basic masking options by providing additional support.
2023-08-17 23:03:37 +09:00
Hermet Park
3b2c040f70 loader/lottie: add the missing solid color layer. 2023-08-17 23:03:37 +09:00
Hermet Park
e7d29e166b loaders: unify duplicated b64 decoders.
- move the svg/lottie b64 decoders to tvgLzw.
- renames tvgLzw -> tvgCompressor
2023-08-17 21:28:58 +09:00
Hermet Park
e4b8f70f4f loader/svg: remove the redundant copyright.
The SVG scene builder has undergone significant changes.
It no longer retains the shadow of the original source.
2023-08-17 21:28:58 +09:00
Hermet Park
381dfb06d4 renderer paint: tiny optimization
Skip the unnecessary assignment of the value when the initial values
come.
2023-08-17 21:28:58 +09:00
Mira Grudzinska
5bafdcbfa3 lottie_loader: return false for frameRate = 0
Loading a png file without giving a mimetype, resulted
in an error from the lottie loader.
2023-08-17 18:47:51 +09:00
Hermet Park
15c09f260f loader/lottie: Fix the incorrect precomp layer frame time
The frame number of the referenced layer should be
reduced by the precomp start frame.
2023-08-17 15:53:12 +09:00
Hermet Park
5778bda4db loader/lottie: do not build layers if the frame is out. 2023-08-15 15:49:10 +09:00
Hermet Park
86aabb4df0 loader lottie: image optimization
In every frame, the image undergoes a Colorspace conversion attempt.

This approach aims to bypass the step by retaining the pre-converted image data.

I acknowledge that this might not be the best approach,
but it is proving to be quite effective at the moment.
2023-08-15 15:49:05 +09:00
Hermet Park
df43f91644 loader/lottie: optimize the header task.
To achieve full threading efficiency,
the header should return the necessary properties:
view size, framerate, and duration.

This commit adds duration parsing.

Also don't do the header task in case of single thread
because there wouldn't be parallel effects.
2023-08-15 15:48:53 +09:00
Hermet Park
9e0a3aa678 loader lottie: tiny data copy optimization.
This patch tries to skip the matrix data copy as possible.
2023-08-15 15:48:48 +09:00
Mira Grudzinska
b5aa6e42be svg_loader: clips with multiple transf shapes/use nodes
Up until now, loading a clip composed of multiple
shapes worked correctly provided that they did not
undergo separate transformations. Now, such a case
has been handled.
Also the 'use' node inside the clip is supported.
2023-08-11 23:16:46 +09:00
Hermet Park
80ce345660 loader\lottie: Fixed incorrect b64 decoding
Image padding size should be increased by 1 for '\0'."
2023-08-11 22:57:16 +09:00
Hermet Park
3601d3db3a loader/png: revert force colorspace conversion.
We have a base color space conversion in the renderer,
so there's no need to forcefully align with BGRA.
2023-08-11 22:57:08 +09:00
Hermet Park
374a125280 loader/lottie: enhance stability
Addressed corner cases to prevent memory violations.
2023-08-11 15:00:09 +09:00
Hermet Park
1b020f70c4 loader lottie: support for stroke dash style
However, dash offset is still missing.
The TVG canvas needs to add the stroke offset feature.
2023-08-11 11:41:28 +09:00
Hermet Park
345ef54e26 loader/lottie: add the rounded corner feature
The rounded rectangle property should be propagated to the root
through the lottie model scene-tree.
2023-08-09 21:30:25 +09:00
Hermet Park
8f4f3d6f1b loader/lottie: Add radial gradient support
This allows for the creation of basic radial gradients,
without support for focal points.
2023-08-09 21:30:25 +09:00