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)
Reduce duplicated image raster code between scaler approaches.
Although this allows for a function call per pixel,
this change does not noticeably impact performance (< error bound).
Binary Size diff: 222541 -> 218379 (-4kb)
Reduce excessive gradient filling code duplication by employing C++ template method.
This change does not affect performance or binary size adversely.
Binary Size Diff: 223399 -> 222693 (-706)
Unify textmap methods that are overly duplicated with each other.
Still trying to simplifying raster code so that thorvg could introduce
the a bunch of masking method code nicely.
This reduces the size like: 214773 -> 212843 (-2kb)
Compact blending instructions by distinquish the
shape & images. since we gurantee the shape color is
premultiplied alpha.
As a result, this enhanced performance by 0.002s in examples/Performance
on my local machine.
This also contains code cleanup chores.