diff options
author | Robin Watts <robin.watts@artifex.com> | 2013-07-02 13:30:37 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-09-30 17:21:43 +0100 |
commit | 6a6284ddfa453f909ba6576b85166b7cf26941ee (patch) | |
tree | b331a80469ef7dee1cc4414bfb2d42221a991605 /source/fitz/draw-device.c | |
parent | a8aec7875aaf6c8d8d4ed37ce74705988b73e9c1 (diff) | |
download | mupdf-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-device.c')
-rw-r--r-- | source/fitz/draw-device.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/fitz/draw-device.c b/source/fitz/draw-device.c index bcd93edb..66c670ba 100644 --- a/source/fitz/draw-device.c +++ b/source/fitz/draw-device.c @@ -561,7 +561,7 @@ fz_draw_fill_text(fz_device *devp, fz_text *text, const fz_matrix *ctm, else { fz_matrix mat = {pixmap->w, 0.0, 0.0, pixmap->h, x + pixmap->x, y + pixmap->y}; - fz_paint_image(state->dest, &state->scissor, state->shape, pixmap, &mat, alpha * 255); + fz_paint_image(state->dest, &state->scissor, state->shape, pixmap, &mat, alpha * 255, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES)); } fz_drop_glyph(dev->ctx, glyph); } @@ -1093,7 +1093,7 @@ fz_draw_fill_image(fz_device *devp, fz_image *image, const fz_matrix *ctm, float pixmap = converted; } - if (dx < pixmap->w && dy < pixmap->h) + if (dx < pixmap->w && dy < pixmap->h && !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES)) { int gridfit = alpha == 1.0f && !(dev->flags & FZ_DRAWDEV_FLAGS_TYPE3); scaled = fz_transform_pixmap(dev, pixmap, &local_ctm, state->dest->x, state->dest->y, dx, dy, gridfit, &clip); @@ -1126,7 +1126,7 @@ fz_draw_fill_image(fz_device *devp, fz_image *image, const fz_matrix *ctm, float } } - fz_paint_image(state->dest, &state->scissor, state->shape, pixmap, &local_ctm, alpha * 255); + fz_paint_image(state->dest, &state->scissor, state->shape, pixmap, &local_ctm, alpha * 255, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES)); if (state->blendmode & FZ_BLEND_KNOCKOUT) fz_knockout_end(dev); @@ -1198,7 +1198,7 @@ fz_draw_fill_image_mask(fz_device *devp, fz_image *image, const fz_matrix *ctm, colorbv[i] = colorfv[i] * 255; colorbv[i] = alpha * 255; - fz_paint_image_with_color(state->dest, &state->scissor, state->shape, pixmap, &local_ctm, colorbv); + fz_paint_image_with_color(state->dest, &state->scissor, state->shape, pixmap, &local_ctm, colorbv, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES)); if (scaled) fz_drop_pixmap(dev->ctx, scaled); @@ -1304,7 +1304,7 @@ fz_draw_clip_image_mask(fz_device *devp, fz_image *image, const fz_rect *rect, c if (scaled) pixmap = scaled; } - fz_paint_image(mask, &bbox, state->shape, pixmap, &local_ctm, 255); + fz_paint_image(mask, &bbox, state->shape, pixmap, &local_ctm, 255, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES)); } fz_always(ctx) { |