Releases: thorvg/thorvg
ThorVG v0.8.2
This release contains the following bug fixes.
- Fix SVG loader invaild '<' nested check for doctype elements.
- Fix FreeBSD compilation issues.
- Fix GCC13 compilation issues.
ThorVG v0.8.1
This release contains the following bug fixes.
- Fix MinGW build compatibility issue.
- Fix SVG loader that wrongly handles viewbox width/height info from the symbol node.
- Fix segfault when SVG gradient has no 'id' attribute.
- Fix SVG loader color issue when it's given in percentages, ex."rgb(10%,20%,30%)".
- Fix the lack of data capacity at the big size shape dash strokes. (this results in rendering issue)
ThorVG v0.8.0
Passed 70 days, we're pleased to release a new version of ThorVG.
In this release, we mainly focused on developing SVG styling feature, ThorVG v0.8 now begins to support CSS styling in SVG. In this release, "inline & internal styling" are working in ThorVG. Inline styling is a method with the highest precedence - it overwrites the values set using the attributes and all other methods of CSS styling:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 20 20">
<rect width="10" height="10" style="fill:blue; stroke: #3399ff" fill="red" stroke-width="3"/>
</svg>
The result should look as follows:
It's worth to notice, that the fill="red" attribute, as it has the lowest precedence, does not overwrite the one set in the style attribute. In the meanwhile, Internal CSS style sheets is currently incrementally improved. Within the internal CSS styling different selectors have different precedence - the more specific the selector is, the higher its precedence. For the selectors currently introduced into the TVG, starting with the one with the highest precedence:
- Type and class selector
- Class selector
- Type selector
The next svg sample below, you can see the usage of each of mentioned selectors:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 150 100">
<defs>
<style>
rect.mineStyle1 {
fill: blue; stroke: #3399ff;
}
.mineStyle2 {
fill: red; stroke: pink;
}
rect {
fill: #00cc00; stroke: #99ff33; stroke-width: 5;
}
</style>
</defs>
<!-- type selector: a green rect -->
<rect x="5" y="5" width="50" height="50" />
<!-- type and class selector: a blue rect -->
<rect x="45" y="25" width="50" height="50" class="mineStyle1" />
<!-- class selector: a red shape -->
<rect x="85" y="45" width="50" height="50" class="mineStyle2" />
<circle cx="110" cy="70" r="15" class="mineStyle2" stroke-width="5"/>
<!-- selector with the highest precedence overwrites the other ones: a blue rect -->
<rect x="5" y="75" width="20" height="20" class="mineStyle1" class="mineStyle2" />
</svg>
The result should look as follows:
For more information, please visit this page: https://github.com/Samsung/thorvg/wiki/CSS-Support-in-SVG
One another feature enhancement is that Luminance((0.0721B + 0.7154G + 0.2125*R) * A) Image for Masking Composition. It's source pixels are converted to Grayscale (Luma value) and alpha blended with the target. As a result, only the part of the source, which intersects with the target is visible. For more information, please check its interface: enum class CompositeMethod::LumaMask;
Here list notes major enhancements & bug fixes since v0.7.0.
- Fix crash issues, memory leaks, enhance the SVG loader robustness.
- Fix SVG loader that wrongly parses the gradient fill data.
- Fix SVG loader that wrongly inherits the color attributes.
- Fix SVG loader that misses the transformation information from "use" nodes.
- Fix SVG loader that wrongly implements the "preserveAspectRatio"
- Fix potential memory leak from PNG loader.
- Improve SVG loader that mis-implements the parsing "CDATA" specifier.
- Improve SVG loader that mis-implements the logic when "defs" tag is not used.
- Improve SVG loader that mis-implements the “group” tags.
- Improve SVG loader that mis-implements the image transformation.
- Improve SVG loader that news supports "symbol" tag.
- Improve the build compatibility for MinGW & Visual Studio.
Be aware that a few BETA APIs have been added.
Though some of them are working, we recommend you to avoid using them because they could be modified or removed in the next version.
- enum class CompositeMethod::LumaMask;
Special thanks to dedicated contributors:
ThorVG v0.7.1
This release contains the following bug fixes.
- Fix crash issues, memory leaks, enhance the SVG loader robustness.
- Fix SVG loader that wrongly parses the gradient fill data.
- Fix SVG loader that wrongly inherits the color attributes.
- Improve SVG loader that mis-implements the parsing "CDATA" specifier.
- Improve SVG loader that mis-implements the logic when "defs" tag is not used.
- Improve SVG loader that mis-implements the “group” tags.
- Improve the build compatibility for MinGW & Visual Studio.
ThorVG v0.7.0
Passed 50 days, we're pleased to release a new version of ThorVG.
In this release, we mainly focused on the bitmap based image rendering implementation to improve the image quality and its rendering performance. For achieving this, we introduced the texmap component in the sw raster. This texmap is designed to support the traditional polygon based texture mapping & rasterization applying linear interpolation (see: lysator.liu.se/~mikaelk/doc/perspectivetexture/). Meanwhile, this texmap combines the fast edge tracking anti-aliasing mechanism (see: hermet.pe.kr/122) for a better quality. Eventually, ThorVG could support any arbitrary forms of the image rendering, not just for rectangular but also for such a trapezoid shape forms. On the other hand, we tuned the image rasterizer to perform the optimal rendering path by comparing the rendering condition & image formats. Lastly, in this release we fixed memory leaks and memory violations from a couple of scenarios.
Here list notes major enhancements & bug fixes since v0.6.0.
- Fix PNG loader to pre-multiply the alpha channel value properly.
- Fix SVG loader to compute the boundary of the scene properly by correcting the shape stroking region.
- Enhance the SVG Loader to support "clipPathUnits" and "maskContentUnits" properties.
- Enhance the SW Raster to support the rendering of the clipped masking images.
- Enhance the SW Raster performance by supporting AVX in the translucent RLE rasterizing.
- Enhance the quality of the transformed image by applying anti-aliasing.
Here are new official APIs:
- Result Paint::bounds(float* x, float* y, float* w, float* h, bool transformed) const noexcept;
- Result Fill::transform(const Matrix& m) noexcept;
- Matrix Fill::transform() const noexcept;
Be aware that a few BETA APIs have been added.
Though some of them are working, we recommend you to avoid using them because they could be modified or removed in the next version.
- std::unique_ptr Accessor::access(std::unique_ptr picture, bool(func)(const Paint paint)) noexcept;
- static std::unique_ptr Accessor::gen() noexcept;
Special thanks to dedicated contributors:
ThorVG v0.6.0
After one month, we're pleased to release a new version of ThorVG!
In this release, we officially released ThorVG CAPI binding. You can turn on the CAPI build by your demand using the meson build option.
$meson -Dbindings="capi" ...
As the standalone library, ThorVG begins to support static PNG/JPG loaders, that means you can use image rendering without any external decoders. To use the static modules, you can turn on them using the meson build option as the following:
$meson -Dstatic=true -Dloaders="png, jpg" ...
ThorVG static PNG loader introduced the lodepng open-source code (https://lodev.org/lodepng/), static JPG loader introduced the richgen999's (https://github.com/richgel999/jpeg-compressor). Though they might not be perfect for all various formats integration in ThorVG, it supports the basic use-case and it will be enhanced from this release.
In the meantime, we enhanced the ThorVG Viewer (https://www.thorvg.org/viewer) functionalities. It newly supports multiple file handling, a console box for resource info & tips and the compression option for the TVG exporting.
Next, we enhanced the svg2png and svg2tvg tools to support the input folder to convert the massive files with an easy command. You can read the svg2png section in https://github.com/Samsung/thorvg#readme for more details.
Lastly, we focused on improving the Windows CI & ThorVG for the stabilizing and the portability on the Windows OS.
Here list notes major enhancements & bug fixes since v0.5.0.
- Fix to complete the rendering scenes even if intermediate paints are invalid.
- Fix SVG Loader to handle the width / height properly even though they have different value units (percentage).
- Fix SVG Loader to work properly when "vw=width and vh=height, vx or vy > 0".
- Fix SVG Loader to support absolute embedded image paths.
- Fix SVG Loader to support gradient filling with percentage units properly.
- Fix SVG memory corruption when "url" is longer than 50 characters.
- Fix the axis-aligned rectangle drawing to be pixel perfection.
- Fix Sw engine memory leak when image has the clipping.
- Enhanced SVG Loader to define the scaling factor for unit changing.
- Enhanced SVG Loader to support geometry tags (x/y/width/height).
- Enhanced to support Linear/Gradient Filling transformation.
- Newly support static PNG/JPG module loaders.
- Improved Windows OS portability.
Be aware that a few BETA APIs have been added.
Though some of them are working, we recommend you to avoid using them because they could be modified or removed in the next version.
- Result Fill::transform(const Matrix& m) noexcept
- uint32_t Paint::identifier()
- uint32_t Fill::identifier()
- uint32_t LinearGradient::identifier()
- uint32_t RadialGradient::identifier()
- uint32_t Picture::identifier()
- uint32_t Scene::identifier()
- uint32_t Shape::identifier()
- SwCanvas::ColorSpace::ABGR8888_STRAIGHT
- SwCanvas::ColorSpace::ARGB8888_STRAIGHT
Special thanks to dedicated contributors:
ThorVG v0.5.0
After one and half months, we're pleased to release a new version of ThorVG!
In this release, we mainly focused on TVG Picture development, we began to officially support the TVG Picture format that has been stabilized and optimized.
The TVG Picture stores a list of properties of the Paint nodes of a scene in binary form. The data saved in a TVG Picture is optimized beforehand, keeping the resulting file small and the data loading process fast and efficient.
To convert any SVG files to TVG files, you can immediately use the ThorVG Viewer (https://www.thorvg.org/viewer). Otherwise you can use the command-line tool in the thorvg project. ($meson . -Dtools="svg2tvg")
In the meantime, we re-designed the ThorVG Viewer. You can check the quick-guide of new ThorVG viewer from the demo video (https://youtu.be/Dk3unJWjszA)
For more details, please visit https://www.thorvg/about the Picture section.
Next, we improved the svg2png tool to convert the multiple svg files at once. This helps developers to test & verify how thorvg lib stabilized and check the svg rendering performance. You can read the svg2png section in https://github.com/Samsung/thorvg#readme for more details.
Lastly, we enhanced our test suites for the stabilizing and maintenance of the thorvg library. For this, we reached 100% API tests and over 80% Line coverage. Please check more details here: https://github.com/Samsung/thorvg/wiki/Unit-Tests
Here list notes major enhancements & bug fixes since v0.4.0.
- Fix a crash when ClipPath bounds have negative positions.
- Fix the Picture crash issue if it reloads the image again.
- Fix SVG Loader that wrongly parses the opacity percentage values.
- Fix the Picture to return the bounds() size with the designated view size.
- Fix the crash issue when the wrong pair of commands & points of Shapes are given.
- Fix invalid memory access issues of TVG Loader.
- Fix Sw Raster to clip the shapes properly.
- Fix the dashed line which mistakenly has square or round caps.
- Fix the incorrectly clipped image rendering issue.
- Fix the incorrect size of the SVG if the vx, vy are smaller than 0 and width/height are different with the values of the viewbox.
- Fix the SVG which fills with the color unexpectedly when its image url is invalid.
- Fix the Paint::bounds() to return the size correctly.
- Allow composing shapes & connected stroke lines all in one.
- Stabilize SIMD Neon & AVX rasterization
- Add TranslucentRect drawing Neon version.
- Add AlphaBlend & TranslucentRect drawing AVX version.
- Enhance the image quality by adding scale-down interpolation.
Here are new official APIs:
- Result Picture::load(const char* data, uint32_t size, const std::string& mimeType, bool copy = false) noexcept;
- CompositeMethod Paint::composite(const Paint** target) const noexcept;
- Result Saver::save(std::unique_ptr paint, const std::string& path, bool compress = true) noexcept;
- Result Saver::sync() noexcept;
- static std::unique_ptr Saver::gen() noexcept;
Here are new deprecated APIs, you can read their API documentation to see how you can replace it with proper APIs.
- Result Paint::bounds(float* x, float* y, float* w, float* h) const noexcept;
Be aware that a few BETA APIs have been added.
Though some of them are working, we recommend you to avoid using them because they could be modified or removed in the next version.
- Result Paint::bounds(float* x, float* y, float* w, float* h, bool transformed) const noexcept;
Special thanks to dedicated contributors:
ThorVG v0.4.2
This release contains the following bug fixes.
- Fix the Picture crash issue if it reloads the image again.
- Fix SVG Loader that wrongly parses the opacity percentage values.
- Fix the Picture to return the bounds() size with the designated view size.
- Fix the crash issue when the wrong pair of commands & points of Shapes are given.
ThorVG v0.4.1
This release contains the following bug fixes.
- Fix a crash when ClipPath bounds have negative positions.
- Allow composing shapes & connected stroke lines all in one.
- Correct incorrect memory alignment in the Neon Translucent RLE Rasterization.
ThorVG v0.4.0
After one month, we're pleased to release a new version of ThorVG!
In this release, we introduced the JPG Loader which uses libjpeg-turbo. We confirmed that the library is the most efficient and faster one among other JPG libraries. Though it requires the external library like PNG Loader, it's not mandatory guidance by us. You can optionally choose it using the build option. In the meanwhile, the SVG loader starts to support the image tag if the PNG/JPG image loaders are available. Thus if the TVG compile condition is satisfied, you can properly use SVG resources which include image data.
One more major update is that ThorVG is starting to provide the designated binary format which extension is "tvg". By this release, we've developed TVG Saver & Loader, they are actually working now. TVG binary stores the list of properties of the Paints of the scenes after pre-processing the scene-tree & property data in the saving step. In the preprocessing, Tvg Saver removes the unnecessary data, compromises duplicated properties, reduces the size of the properties while keeping them compatible with ThorVG behavior policy. Thus its data is more optimal than text-based vector formats such as SVG, also loading time is faster because it can skip the interpreting stage. In both cases, TVG format is approximately more than +30% better. Yet TVG format feature is under the beta since we should strongly verify the stability of it not to break any compatibility in the future enhancement. We still need more tests. We believe it will be released officially in the next major version upgrade. Ah, plus we added a svg2tvg tool for converting the svg resources to the tvgs.
Lastly, we have improved Sw Rasterizer by adding the SIMD operations. In this release we newly support NEON vectorization though it's only applied for the Solid / Blending scanline rasterization. If you want the faster ThorVG, please enable the vector options in meson like this: -Dvectors="avx" or -Dvectors="neon"
Here list notes major enhancements & bug fixes since v0.3.0.
- Fix Picture to return the current image size from the bounds().
- Fix Shape to check the null argument of the cmds to prevent an invalid argument case.
- Prevent a Svg corruption by skipping parsing If the d attribute of SVG path is not parsed through.
- Fix a broken visualization of SVG occured by the race condition on arc processing.
- Preventing a double application of the opacity that occurred the incorrect color density.
- Allow SVG to handle defs tags without any corruption even if it's specified multiple times.
- Fix Svg memory leak when improper stop tag is used.
- Fix Svg dead loop on non digit char in stroke dash array.
- Fix Svg to set the higher priority of style attributes.
- Fix Svg to support the percentage unit of the dash-array.
- Fix Svg to properly recognize elements through a whole svg file.
- Fix Svg to prevent gradient memory leak.
- Fix Picture to return the proper image size from picture::size().
- Fix Composition memory leak from the Sw raster engine.
- Correct Linear Gradient to allow zero size linear.
- Correct Sw raster engine to interpolate opacity values between gradient stops.
- Correct Sw raster engine to blend the gradient fill color using the correct range of alpha (256 -> 255).
- Improve SVG Loader to support image tag.
- Improve SVG to support both Clip Path and Masking altogether.
- Improve Png Loader to support the image from the memory.
- Accelerate Sw raster by applying Neon SIMD operations for solid color rasterization.
- Improve Sw raster to support bilinear interpolation of the image down-scaling.
Here are new official APIs:
- Matrix Paint::transform() noexcept
- Result SwCanvas::mempool(MempoolPolicy policy) noexcept
Here are new deprecated APIs, you can read their API documentation to see how you can replace it with proper APIs.
- Result Picture::load(const char* data, uint32_t size, bool copy = false) noexcept
Be aware that a few BETA APIs have been added.
Though some of them are working, we recommend you to avoid using them because they could be modified or removed in the next version.
- Result Picture::load(const char* data, uint32_t size, const std::string& mimeType, bool copy = false) noexcept
- Result Saver::save(std::unique_ptr paint, const std::string& path) noexcept
- Result Saver::sync() noexcept;
- static std::unique_ptr Saver::gen() noexcept
- Tvg_Result tvg_picture_load_data(Tvg_Paint* paint, const char *data, uint32_t size, const char *mimetype, bool copy)
Lastly, special thanks to dedicated contributors: