Introducing the gradient transform() apis and changing the grad
algorithms made it possible to apply the shape's transformation
before saving the tvg file, in case the shape (or its stroke)
has a fill.
The values in absolute units are calculated based on the pixel unit.
Till now the default value of 90dpi was used. Since CSS3 (now CSS4 is
the most recent) 1 inch equals to 96 pixels. The necessary constants
are introduces in this commit.
After 362d2df the fastTrack cases were applied even for shapes with clips.
These changes fixed this - the check whether a shape is a rect should be done
only if it has no clips.
This reverts commit cd5116b053.
Ah this breaks the Stress example due to Picture::duplicate() is not available...
Need to consider and come back again.
* common: added colorSpace() function
This patch introduces colorSpace() function for SW and GL engine.
* infra: change LoadModule:read() into LoadModule:read(uint32_t colorspace)
This patch changes LoadModule:read() into LoadModule:read(uint32_t colorspace)
* picture: implement passing colorspace into loader
This patch implements passing colorspace into loaders.
Loader->read is now called on the first update.
* external_jpg_loader: support colorspaces
* external_png_loader: support colorspaces
This patch introduces _STRAIGHT colorspaces (ABGR8888_STRAIGHT and
ARGB8888_STRAIGHT) whose colors are un-alpha-premultiplied. Unmultiplicated
colors are especially needed for wasm thorvg loader and svg2png / tvg2png.
Only C version now.
@issue: #791
removed invalid nullptr checks.
New allocation doesn't gurantee that returns nullptr when it's failed.
It's useless on the modern compliers and our policy respects it.
The final gradient transformation depends on the coordinate system.
It can not be applied during an svg loading. The transformation matrix
has to be passed via api for further gradient processing.
Since no antialiasing is applied for the fastTracking cases,
the shape's rasterization region needs to be edited. To establish
the rastered bbox, the rounding is performed before the bbox corners
are casted to the SwCoords.
Adds an alternative static jpg loader.
The jpg loader copied the jpeg decoding implementation from this open-source
repo: https://github.com/richgel999/jpeg-compressor
That opensource has the public-domain license, it doesn't have any restriction
of the copy.
note: jpgd.cpp is modified version (changed decompress_jpeg_image_from_stream)
for returning BGRA