After the stroke clipper is introduced, using clipping
requires ensuring that clipping is based on fill rather
than on stroke. Fixed now.
regression by: 324bff30d1
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
GlRenderTarget contains framebuffer and render target objects,
these GPU resources need to be released before reusing the structure and calling init with the new size.
After resizing an animation, the base clipper for the viewport of the root scene did not update accordingly. This caused the animation to always be clipped by its initial size.
Additionally, this issue introduced a regression in v1 when the `Result Picture::size(float w, float h)` function was called.
issue: https://github.com/thorvg/thorvg/issues/3039
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.
clipping with a stroke is useful for various visual effects.
TVG can support this approach as it offers better efficiency
compared to alpha masking.
If a valid stroke is defined in the clipper shape,
the renderer prioritizes clipping with the stroke over
the shape's fill.
issue: https://github.com/thorvg/thorvg/issues/3063
- 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
ThorVG pImpl idiom caused internal data to be scattered
across hierarchical classes. This refactoring consolidates
the data by inheriting pImpl internally, reducing memory
allocation counts and eliminating unnecessary strategy methods.
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>
The only scenarios where 'check valid region' and
'check boundary' occur are when mathUpdateOutlineBBox()
returns true. This, in turn, happens only if mathClipBBox()
returns true. If that is the case, it means that just
before this return, exactly the same checks were performed.