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'.
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)
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>
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
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
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)