summaryrefslogtreecommitdiff
path: root/source/fitz/draw-affine.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2013-07-02 13:30:37 +0100
committerRobin Watts <robin.watts@artifex.com>2013-09-30 17:21:43 +0100
commit6a6284ddfa453f909ba6576b85166b7cf26941ee (patch)
treeb331a80469ef7dee1cc4414bfb2d42221a991605 /source/fitz/draw-affine.c
parenta8aec7875aaf6c8d8d4ed37ce74705988b73e9c1 (diff)
downloadmupdf-6a6284ddfa453f909ba6576b85166b7cf26941ee.tar.xz
Disable image interpolation with a hint.
Set the hint in mudraw when AA bits is set to 0.
Diffstat (limited to 'source/fitz/draw-affine.c')
-rw-r--r--source/fitz/draw-affine.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/fitz/draw-affine.c b/source/fitz/draw-affine.c
index 1a7e1c57..284ca8df 100644
--- a/source/fitz/draw-affine.c
+++ b/source/fitz/draw-affine.c
@@ -941,7 +941,7 @@ fz_gridfit_matrix(fz_matrix *m)
/* Draw an image with an affine transform on destination */
static void
-fz_paint_image_imp(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz_pixmap *img, const fz_matrix *ctm, byte *color, int alpha)
+fz_paint_image_imp(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz_pixmap *img, const fz_matrix *ctm, byte *color, int alpha, int lerp_allowed)
{
byte *dp, *sp, *hp;
int u, v, fa, fb, fc, fd;
@@ -961,11 +961,11 @@ fz_paint_image_imp(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz
dolerp = 0;
is_rectilinear = fz_is_rectilinear(&local_ctm);
if (!is_rectilinear)
- dolerp = 1;
+ dolerp = lerp_allowed;
if (sqrtf(local_ctm.a * local_ctm.a + local_ctm.b * local_ctm.b) > img->w)
- dolerp = 1;
+ dolerp = lerp_allowed;
if (sqrtf(local_ctm.c * local_ctm.c + local_ctm.d * local_ctm.d) > img->h)
- dolerp = 1;
+ dolerp = lerp_allowed;
/* except when we shouldn't, at large magnifications */
if (!img->interpolate)
@@ -1084,15 +1084,15 @@ fz_paint_image_imp(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz
}
void
-fz_paint_image_with_color(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz_pixmap *img, const fz_matrix *ctm, byte *color)
+fz_paint_image_with_color(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz_pixmap *img, const fz_matrix *ctm, byte *color, int lerp_allowed)
{
assert(img->n == 1);
- fz_paint_image_imp(dst, scissor, shape, img, ctm, color, 255);
+ fz_paint_image_imp(dst, scissor, shape, img, ctm, color, 255, lerp_allowed);
}
void
-fz_paint_image(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz_pixmap *img, const fz_matrix *ctm, int alpha)
+fz_paint_image(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz_pixmap *img, const fz_matrix *ctm, int alpha, int lerp_allowed)
{
assert(dst->n == img->n || (dst->n == 4 && img->n == 2));
- fz_paint_image_imp(dst, scissor, shape, img, ctm, NULL, alpha);
+ fz_paint_image_imp(dst, scissor, shape, img, ctm, NULL, alpha, lerp_allowed);
}