This identifier is useful when user identify the instance type in runtime.
ThorVG basically don't prefer to dynamic_cast() nor typeid(),
it compiles with -fno-rtti option for the optimial size.
Here is an example for the simple usage.
if (paint->identifier() == Shape::identifier())
auto shape = static_cast<Shape*>(paint);
@Issue: https://github.com/Samsung/thorvg/issues/693
meson's find_library() throws an error when the package cannot be found.
png static library is added, so it should be passed when package is not found.
Therefore, delete unnecessary find_library.
Copied only necessary decoding functions from the lodepng opensource.
See: https://lodev.org/lodepng/
additional changes:
- disabled crc for the optimal size.
- converted the format bgr -> rgb for our png example.
Still we don't have a concrete idea for the image formats,
We should fix the converting methods between bgra <-> rgba.
@Issue: https://github.com/Samsung/thorvg/issues/594
1.
Remove macro function. The existing macro function
was doing meaningless nested `return false`.
2.
Extract the logic to find the type as a function.
3.
The SimpleXMLType::Error case is not actually used,
and in case of invalid XML, Do 'return false' immediately.
The next api of c++ version has been deprecated
Tvg_Result tvg_paint_get_bounds(const Tvg_Paint* paint, float* x, float* y, float* w, float* h);
instead, we introduce the next one under the beta.
Tvg_Result tvg_paint_get_bounds(const Tvg_Paint* paint, float* x, float* y, float* w, float* h, bool transformed);
According to the svg standard, in a case when 'x1==x2 and y1==y2'
for a linear gradient or when 'r==0' for a radial gradient, the area
should be painted as a single color - the last gradient stop color.
This patch has 2 purposes,
1. revise the loaders infrastructure to support both static/external linking loaders.
2. add a template for static jpg/png loaders after external jpg/png.
Our default loaders prefer static linking, external loaders are only available
when dependent libraries on the build system are found.
You might wonder why we have the external loaders together,
they might be faster than static loaders since the popular libraries are likely to be well maintained,
fine-grained optimized.
Thus in this patch, meson tries to apply the external loaders first
then see if the dependencies were found or not,
if it's failed, it turns to the default static loaders.
Next this patch, we need the contribution for actual static jpg/png loaders implementation.
@Issue: https://github.com/Samsung/thorvg/issues/594