replaced 32-bit operations with 8-bit operations for masking buffers.
We might need a grasycale image support for applying 1-byte channel masking input(Picture).
Some of masking implementation are disabled by this reason.
Also, I don't expecct it's necessary for the thorvg now.
Corrected subtract/intersect masking behaviors that were inaccurately functioning
within chain-masking.
This also helps to enhance the masking performance by reducing the
masking region when applying subtract/intersect.
@Issue: https://github.com/thorvg/thorvg/issues/1606
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>
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.
replace the transformed rle rgba image with the texmap raster.
this patch removes the several scattered transformed image rasterizer,
reuse the unified one texmap method instead.
yay, it's much clean and optimal.
Introduced the texture-mapping algorithm for the image-scaler.
With this approach, we can support any arbitrary forms of the transformed shapes
while appling the scale factors - x/y separately.
Also this is more efficient when the transformed image is far from the rectangular form
because our current normal image rasterizer based on the given drawing region whereas
our new approach is span-based.
Thus, we applied this mechanism only for the transformed images.