If a clip was defined by a use node pointing
to a basic shape subject to transformation, and
the use node itself was translated, the order
of applying these transformations was incorrect.
Properly build the cell cover value
when a new cell value is just overlapped.
This fixes certain weird visual artifacts at a corner case.
issue: https://github.com/thorvg/thorvg/issues/2929
Ensure they do not terminate prematurely for paths
with a step of 0 or exceptionally small values
when a valid stroke-width is present.
In my opinion, the optimal approach was to separate vertex generation
into dedicated methods: strokeRoundPoint and strokeSquarePoint.
My update supports two different stroke-cap styles.
I have also tested it with various files (JSON, SVG)
as well as a small example application similar
to the one included in the previous pull request (#3066).
issue: https://github.com/thorvg/thorvg/issues/3065
Resolved an issue where parsing failed due to mismatch
between file size obtained via `ftell` and the actual
bytes read by `fread`. This occurred because newline
translation (`\r\n` to `\n`) in text mode altered the byte
count, leading to incorrect assumptions about the data size.
- Allow the masking data even though they were mask None mode.
Those will be used by the layer stroke effect.
- Fixed masking Offset to apply to all masking chains.
- Optimized fast track masking with resolving the opaicty condition.
- Clean up the overall code.
The Tritone effect maps the scene's shadows, midtones, and highlights
to three specific colors, allowing for more complex and artistic color grading.
Applied Tritone Formula:
if (L < 0.5) Result = (1 - 2L) * Shadow + 2L * Midtone
else Result = (1 - 2(L - 0.5)) * Midtone + (2(L - 0.5)) * Highlight
Where the L is Luminance.
issue: https://github.com/thorvg/thorvg/issues/2718
The Tint effect in ThorVG is used to modify the overall color tone of a scene.
It works by blending a specified tint color with the existing colors of the scene.
This effect is useful for color grading, mood changes, or applying thematic filters
to vector graphics and animations.
Applied the equation is:
Result = (1 - L) * Black + L * White, where the L is Luminance.
issue: https://github.com/thorvg/thorvg/issues/2718
Shapes with boundaries outside the rendering area are ignored as non-visible.
The issue arises when such a shape serves as a clipper.
The expected behavior is for the entire clipee to be cut out,
but previously, the clipee remained fully visible as if no clip was applied.
The fix identifies these clippers and skips rendering clipees.
Please note that we can skip rendering at the Paint update stage
if the clipper's viewport is outside the canvas.
This optimization can improve performance, but only for this specific case.
The downside of the approach is that it disrupts multi-processing for clipper updates.
As a result, that approach was discarded.
issue: https://github.com/thorvg/thorvg/issues/3003
issue: https://github.com/thorvg/thorvg/issues/2684
Co-Authored-By: Mira Grudzinska <mira@lottiefiles.com>
Basically rewrite the PathTrim code, correct the Line and Bezier split
function calling.
Also the trim situation where start is greater than end can be handled correctly.
enhanced the rendering composition target to better support features such as
alpha blending, blending, masking, post effects, and more.
This allows rasterizers to prepare the composition context with more precise control.
Additionally, resolved a crash in the software engine's post-effect process
caused by a buffer size mismatch during XY buffer flipping.
issue: https://github.com/thorvg/thorvg/issues/3009
issue: https://github.com/thorvg/thorvg/issues/2984
Since longjmp is not yet fully supported on Wasm (emscripten uses
JS to make the jumps and requires slow jumps), but also because
longjmp is hard to reason about, this patch replaces it with
return values. The logic stays exactly the same.
certain systems, may not support file I/O operations.
ThorVG should provide users with an option to configure
builds according to their requirements.
This ensures that file I/O calls are avoided,
preventing potential crashes.
Please use the meson '-Dfile=true/false' option for this.
Please note that "THORVG_FILE_IO_SUPPORT" might be expected
for your thorvg manual build.
issue: https://github.com/thorvg/thorvg/issues/3008