diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-04-07 11:08:42 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-04-28 12:30:40 +0100 |
commit | b944f16a564f8a31d9a064980318ad690be31f8e (patch) | |
tree | 6fb5a572487943e7cdccee2b201ae526c23bd595 /source/pdf/pdf-resources.c | |
parent | 6ab232064f3fc9037e97157dd9a77f286ad85e23 (diff) | |
download | mupdf-b944f16a564f8a31d9a064980318ad690be31f8e.tar.xz |
Partial image decode.
Update the core fz_get_pixmap_from_image code to allow fetching
a subarea of a pixmap. We pass in the required subarea, together
with the transformation matrix for the whole image.
On return, we have a pixmap at least as big as was requested,
and the transformation matrix is updated to map the supplied
area to the correct place on the screen.
The draw device is updated to use this as required. Everywhere
else passes NULLs in, and so gets unchanged behaviour.
The standard 'get_pixmap' function has been updated to decode
just the required areas of the bitmaps.
This means that banded rendering of pages will decode just the
image subareas that are required for each band, limiting the
memory use. The downside to this is that each band will redecode
the image again to extract just the section we want.
The image subareas are put into the fz_store in the same way
as full images. Currently image areas in the store are only
matched when they match exactly; subareas are not identified
as being able to use existing images.
Diffstat (limited to 'source/pdf/pdf-resources.c')
-rw-r--r-- | source/pdf/pdf-resources.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/pdf/pdf-resources.c b/source/pdf/pdf-resources.c index 4fae6c87..212c57df 100644 --- a/source/pdf/pdf-resources.c +++ b/source/pdf/pdf-resources.c @@ -28,7 +28,7 @@ res_image_get_md5(fz_context *ctx, fz_image *image, unsigned char *digest) fz_pixmap *pixmap; fz_md5 state; - pixmap = fz_get_pixmap_from_image(ctx, image, 0, 0); + pixmap = fz_get_pixmap_from_image(ctx, image, NULL, NULL, 0, 0); fz_md5_init(&state); fz_md5_update(&state, pixmap->samples, pixmap->w * pixmap->h * pixmap->n); fz_md5_final(&state, digest); |