Commit graph

1920 commits

Author SHA1 Message Date
Vincenzo Pupillo
5f64baf642 Avx raster refactoring due to an internal change to support blending
methods.
2023-07-01 12:42:24 +09:00
Vincent Torri
dabd15c4c5 tvgArray: return a const reference for const methods 2023-06-30 17:18:04 +09:00
Hermet Park
36b311f0ca
Update README.md 2023-06-29 23:27:49 +09:00
Hermet Park
80f1720821
Update README.md
+codefactor badge
2023-06-29 23:26:55 +09:00
Hermet Park
b876427325 common array: revise the interface.
Implement a pair of access methods: last() and first().
2023-06-29 20:40:16 +09:00
Hermet Park
65f178620e
Update CODEOWNERS 2023-06-29 20:36:37 +09:00
Hermet Park
ec30301aec common shape: +tiny opimization.
don't update a frame, if the color is not changed.
2023-06-27 18:44:02 +09:00
Hermet Park
dce14a8449 common: promote MULTIPLY() to a common helper macro.
it's useful among the modules.
2023-06-27 18:44:02 +09:00
Hermet Park
4482664740 common array: ++enhance the usability.
+ end() which indicates the end of the data pointer.
2023-06-26 14:58:30 +09:00
Hermet Park
bd87f1398c common array: ++enhance the usability.
add last() which indicates the last element pointer.
2023-06-23 16:49:39 +09:00
Hermet Park
3fa33c0315
Update README.md
+ binary size badge
2023-06-20 23:56:46 +09:00
Hermet Park
be1984982e example stack: updated sample.
use paints() method instead of grabbing a manual list.

@Issue: https://github.com/thorvg/thorvg/issues/1501
2023-06-20 15:48:02 +09:00
Hermet Park
caa214e4db sw_engine: code refactoring.
Renamed internal methods; the name 'RGBA' is sometimes confusing
because the channel composition does not accurately reflect it.

Therefore, it should be removed or replaced with 'Pixel'.
2023-06-20 14:57:01 +09:00
Hermet Park
00a87825b9 sw_engine: optimize code.
Considering the fundamental scenario,
the masking feature would likely be used less frequently.

We sacrifice a small amount of performance
by substituting the multiple implementations with blender calls.

However, this trade-off can result in a reduction in binary size.

Bin size: 212089 -> 205907 (-6kb)
2023-06-20 14:57:01 +09:00
Hermet Park
5f4ee24dc6 updated AUTHORS 2023-06-20 11:40:50 +09:00
Hermet Park
3512beab9f test: ++blending 2023-06-20 11:30:18 +09:00
Hermet Park
f36455048a examples: add SceneBlending 2023-06-20 11:30:18 +09:00
Hermet Park
0b65d1fce5 sw_engine raster: ++tiny optimization
Attempt to perform as much computation as possible
before entering the rasterization stage.

This contains the code refactoring as well.
2023-06-20 11:30:18 +09:00
Hermet Park
0cc7833000 example: update blending sample 2023-06-20 11:30:18 +09:00
Hermet Park
c50d2fde5f common sw_engine: support blending methods.
The blending feature allows user to combine colors to create visually appealing effects,
including transparency, lighting, shading, and color mixing, among others.

Its process involves the combination of colors or images from the source paint object
with the destination (the lower layer image) using blending operations.

The blending operation is determined by the chosen @p BlendMethod,
which specifies how the colors or images are combined.

@APIs:
 - enum class BlendMethod::Normal, Add, Screen, Multiply, Overlay, Lighten, Difference, Exclusion, SrcOver, Darken, Lighten, ColorDodge, ColorBurn
 - BlendMethod Paint::blend() const noexcept;
 - Result Paint::blend(BlendMethod method) const noexcept;

@Issue: https://github.com/thorvg/thorvg/issues/307

Co-authored-by: Peter Vullings <peter@projectitis.com>
Co-authored-by: Hermet Park <hermetpark@lottiefiles.com>
2023-06-20 11:30:18 +09:00
Hermet Park
eea54f5fea sw_engine: code chores & fix gradient filling bugs.
renaming internal methods for integrating with upcoming blending features.
this also fixes minor wrong gradient filling blending equations.
2023-06-20 11:30:18 +09:00
Hermet Park
b60a291edc sw_engine: code refactoring
Removed the fake blender structure.
Unified matting and join as Surface methods.
2023-06-20 11:30:18 +09:00
Hermet Park
814d87626c common engines: optimizing data packing for compactness.
Standardized the opacity data type to use 1 byte
across all instances to maintain consistency and reduce scattered usage.
2023-06-15 10:35:34 +09:00
Hermet Park
e1d73b2c2e doc: fix wrong info by mistake 2023-06-14 12:17:50 +09:00
Hermet Park
9a494e0adb doc: update the CompositeMethod. 2023-06-14 12:06:39 +09:00
Hermet Park
4f26a84b53 common: optimize paint data size.
packing the data fields with the appropriate size.

96 -> 24 (-9 bytes per one paint)
2023-06-14 10:46:30 +09:00
Hermet Park
90c9810b97 test: ++coverage of Canvas::paints(), Scene::paints() 2023-06-14 10:46:21 +09:00
Hermet Park
075e3e6b2a tvg: support stroke miterlimit property.
implement the miterlimit property that was introduced by
44a750ee5d

@Issue: https://github.com/thorvg/thorvg/issues/1490
2023-06-14 10:46:12 +09:00
Hermet Park
f9816a9e6f
Update README.md 2023-06-13 20:15:41 +09:00
Hermet Park
467feabf65
Update README.md 2023-06-13 20:13:41 +09:00
Hermet Park
218a452cf1
Update README.md 2023-06-13 20:08:34 +09:00
Hermet Park
767c50d9d8
Update README.md 2023-06-13 12:27:19 +09:00
Hermet Park
8398fdbca7 tvg: recover the broken compatibility.
The issue was introduced by b214fd23bc
2023-06-13 12:23:17 +09:00
Hermet Park
4627daf6f7 api: enhance API usability
Set the default values of rx = 0 and ry = 0 for the shape.
Only the round rectangle shape requires the usage of these values.
2023-06-13 10:42:57 +09:00
Hermet Park
8305383989 sw_engine: optimize 64-bit rasterization.
Write the pixels per 64-bit data.
This optimization can potentially double the performance in the best case scenario.
It's visually noticeable, especially when the resolution is sufficiently large.

@Issue: https://github.com/thorvg/thorvg/issues/1471
2023-06-13 10:42:40 +09:00
Martin Capitanio
a597d3bb49 API, sw_engine: add stroke-miterlimit example. 2023-06-13 10:42:20 +09:00
Martin Capitanio
44a750ee5d API, CAPI, sw_engine: add suport for stroke-miterlimit. 2023-06-13 10:42:20 +09:00
Hermet Park
07dc68f655 capi: --redundant tag 2023-06-12 11:29:29 +09:00
Hermet Park
84b36e92df api: -- a redundant util func. 2023-06-09 18:50:37 +09:00
Hermet Park
a0e6aead95 infra github: keep the loader tries load all. 2023-06-09 11:13:28 +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
b214fd23bc common canvas/scene: introduce paints() api that returns the list of the paints.
These new apis would enable users to easily modify the motion scene,
The data structure of the paints has been changed from an array to a list.

@APIs:
std::list<Paint*>& Canvas::paints() noexcept;
std::list<Paint*>& Scene::paints() noexcept;

@Deprecated:
Result Canvas::reserve(uint32_t size) noexcept;
Result Scene::reserve(uint32_t size) noexcept;

@Issue: https://github.com/thorvg/thorvg/issues/1203
2023-06-09 10:54:03 +09:00
Martin Capitanio
4def2a679c Fix clang compiler warnings in unit tests.
[clang] Warn on unqualified calls to std::move and std::forward
See: https://reviews.llvm.org/D119670

[141/166] Compiling C++ object test/tvgUnitTests.p/testAccessor.cpp.o
../thorvg-git/test/testAccessor.cpp:58:29: warning: unqualified call to
'std::move' [-Wunqualified-std-cast-call]
    picture = accessor->set(move(picture), nullptr);
                            ^
                            std::
...
2023-06-07 16:56:30 +09:00
Hermet Park
6cbc1de570 api: enhance Shape::stroke() method usage.
Designate a default value for alpha which is mostly optional.
2023-06-07 12:10:31 +09:00
Hermet Park
1ae92daa9d api: enhance Shape::fill() method usage.
Designate a default value for alpha which is mostly optional.
2023-06-07 12:10:31 +09:00
Hermet Park
fbf8e8dfce Revert "api: remove deprecated apis"
This reverts commit aa000f7c56.

TVG will move forward to v0.10, so we still need to keep the deprecated APIs.
2023-06-07 10:49:20 +09:00
Hermet Park
dbdf103e82 sw_engine texmap: code clean up.
eliminate logic duplication by introducing a c++ template mechanism.

This will retain the opacity condition branches to minimize binary size.
2023-06-05 16:52:57 +09:00
Hermet Park
3399da198f sw_engine fill: code clean up.
eliminate logic duplication by introducing direct blend operation.
2023-06-05 16:52:57 +09:00
Hermet Park
fbe1b1fb5f sw_engine raster: code clean up.
eliminate logic duplication by introducing functions.
2023-06-05 16:52:57 +09:00
Hermet Park
92265ef0f1 sw_engine: Keep compact masking raster code.
Reduce duplicated masking raster code by replacing with c++ templates
this change does not noticeably impact performance (< error bound).

Binary Size diff: 218379 -> 217851 (-0.5kb)
2023-06-03 15:50:48 +09:00