- Hue: Creates a result color with the luminance and saturation
of the base color and the hue of the blend color.
- Color: Creates a result color with the luminance of the base color
and the hue and saturation of the blend color. This preserves the gray
levels in the image and is useful for coloring monochrome images and
for tinting color images.
- Luminosity: reates a result color with the hue and saturation of the base color
and the luminance of the blend color. This mode creates the inverse effect of
Color mode.
- Saturation: Creates a result color with the luminance and hue of
the base color and the saturation of the blend color. Painting with this mode
in an area with no (0) saturation (gray) causes no change.
- HardMix: Adds the bottom & top. If the resulting sum for a channel is 255 or
greater, it receives a value of 255; if less than 255, a value of 0.
issue: https://github.com/thorvg/thorvg/issues/2701
- Introduced RGB, RGBA, and HSL structures
- Migrated hsl2Rgb() from SVG loader to common module
This is a refactoring for upcoming hsl color functionlaities.
- Use RenderPath common interfaces instead of
direct array manipulations.
- Replace multiple scalar operations with Point utility
operations where applicable.
added new functionality for bezier curves:
1. generate bezier curve as an arc
2. estimate the number of points for optimal tessellation
3. check that bezier curve is close to a straight line
This functionality is useful for gl/wg renderers
This commit has two purposes:
- refactoring to introduce y indexing method for the upcoming partial rendering.
- replaces the RLE-specific memory allocation with a shared array structure,
eliminating potential memory overflows during RLE clipping.
- modify the concept of AABB to apply only to transformed shapes.
- transform points before computing the bounding box min/max
to obtain a more compact shape region.
- trimmming memory by removing the cached matrix, about 36kb
of memory has been reduced per paint instance.
previously, the bounding box calculation was simply
determined by comparing all the points, which led to
incorrect sizing due to Bezier control points.
Now, it accurately computes the curve boundary,
properly addressing this issue.
Support the bindings to be more integrable with a system's coherent memory management.
Pleaes note that thorvg now only allow the desinated memory allocators here:
malloc -> tvg::malloc
calloc -> tvg::calloc
realloc -> tvg::realloc
free -> tvg::free
issue: https://github.com/thorvg/thorvg/issues/2652
According to tests in AE, the offset direction should
not depend on the direction of the shape. A positive
offset value expands the shape, while a negative value
contracts it. Fixed.
Text can be added in parts due to the presence
of the <tspan> tag. This requires that each
subsequent piece of text is appended rather than
overwriting the previous one.
A numerically motivated limit on the matrix determinant
set at 1e-6 was not sufficient. The limit has been increased
by checkoing whether 1/det is still a number.
An uint8_t version of the lerp function
is introduced to handle cases where
the interpolation factor t exceeds 1, which
previously caused overflow issues due to casting.
Due to the lack of an analytical solution for Bezier
curves offsetting, a simple and computationally cheap
approximation has been implemented. The algorithm shifts
the segments connecting control points and determines
new points based on their intersections.
@issue: https://github.com/thorvg/thorvg/issues/2230
For Bezier curves, we typically use 't' as a parameter
within the 0-1 range, while 'at' is used for the parameter
scaled by the curve's length. In one of the functions,
an incorrect name was used, which could be confusing.
No logical changes.
The epsilon value currently used for the precision
of Beziers calculations is sufficient for comparing
curve lengths. However, for the parameter t, which
ranges from 0 to 1, an accuracy of 1% can introduce
errors.
The solution is to increase the precision for the t
parameter while keeping the rest of the calculations
at the previously used epsilon value.
@Issue: https://github.com/thorvg/thorvg/issues/2619
This function computes a unique identifier value based on the provided string.
You can use this to assign a unique ID to the Paint object.
Experimental APIs:
- uint32_t Accessorr::id(const char* name)
- uint32_t tvg_accessor_id(const char* name)