diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2011-04-04 00:10:32 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2011-04-04 00:10:32 +0200 |
commit | 19a4d970f4530ad330e5a7ae28c84692ee5f6bc0 (patch) | |
tree | e6661319d07b2215f9caf86d018323f163f80d21 | |
parent | 9eb7d89c1609f9ebec4ab8545c95de3f8874e2da (diff) | |
download | mupdf-19a4d970f4530ad330e5a7ae28c84692ee5f6bc0.tar.xz |
pdf: Also interpolate images that aren't to be interpolated up to 200%
-rw-r--r-- | draw/imagedraw.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/draw/imagedraw.c b/draw/imagedraw.c index c44a3ba1..044b2938 100644 --- a/draw/imagedraw.c +++ b/draw/imagedraw.c @@ -289,14 +289,20 @@ fz_paintimageimp(fz_pixmap *dst, fz_bbox scissor, fz_pixmap *img, fz_matrix ctm, /* turn on interpolation for upscaled and non-rectilinear transforms */ dolerp = 0; - if (img->interpolate) + if (!fz_isrectilinear(ctm)) + dolerp = 1; + if (sqrtf(ctm.a * ctm.a + ctm.b * ctm.b) > img->w) + dolerp = 1; + if (sqrtf(ctm.c * ctm.c + ctm.d * ctm.d) > img->h) + dolerp = 1; + + /* except when we shouldn't, at large magnifications */ + if (!img->interpolate) { - if (!fz_isrectilinear(ctm)) - dolerp = 1; - if (sqrtf(ctm.a * ctm.a + ctm.b * ctm.b) > img->w) - dolerp = 1; - if (sqrtf(ctm.c * ctm.c + ctm.d * ctm.d) > img->h) - dolerp = 1; + if (sqrtf(ctm.a * ctm.a + ctm.b * ctm.b) > img->w * 2) + dolerp = 0; + if (sqrtf(ctm.c * ctm.c + ctm.d * ctm.d) > img->h * 2) + dolerp = 0; } bbox = fz_roundrect(fz_transformrect(ctm, fz_unitrect)); |