mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-28 17:15:57 +00:00
sw_engine raster: allow image interpolation by increasing tolerance.
current image interpolation method is a bit awkward, because xy scale different scale factor is not allowed. we must improve the algorithm, but now considering floating point precision, we allow the interpolation by less ratio floating fraction.
This commit is contained in:
parent
ed640630c1
commit
1527f70221
1 changed files with 2 additions and 5 deletions
|
@ -1555,12 +1555,9 @@ bool rasterImage(SwSurface* surface, SwImage* image, const Matrix* transform, co
|
|||
scale = sqrtf((transform->e11 * transform->e11) + (transform->e21 * transform->e21));
|
||||
auto scaleY = sqrtf((transform->e22 * transform->e22) + (transform->e12 * transform->e12));
|
||||
//TODO:If the x and y axis scale is different, a separate interpolation algorithm for each axis should be applied.
|
||||
if (fabsf(scale - scaleY) > FLT_EPSILON) scale = 1.0f;
|
||||
if (fabsf(scale - scaleY) > 0.01f) scale = 1.0f;
|
||||
if (!mathIdentity(transform)) transformed = true;
|
||||
//TODO: Figure out the scale factor by the image size & drawing region
|
||||
} else {
|
||||
mathIdentity(&itransform);
|
||||
}
|
||||
} else mathIdentity(&itransform);
|
||||
|
||||
auto translucent = _translucent(surface, opacity);
|
||||
auto downScaleTolerance = 0.5f;
|
||||
|
|
Loading…
Add table
Reference in a new issue