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 /include/mupdf/fitz/stream.h | |
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 'include/mupdf/fitz/stream.h')
-rw-r--r-- | include/mupdf/fitz/stream.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/mupdf/fitz/stream.h b/include/mupdf/fitz/stream.h index 233e2b06..90b5ec22 100644 --- a/include/mupdf/fitz/stream.h +++ b/include/mupdf/fitz/stream.h @@ -136,6 +136,17 @@ void fz_seek(fz_context *ctx, fz_stream *stm, fz_off_t offset, int whence); int fz_read(fz_context *ctx, fz_stream *stm, unsigned char *data, int len); /* + fz_skip: Read from a stream discarding data. + + stm: The stream to read from. + + len: The number of bytes to read. + + Returns the number of bytes read. May throw exceptions. +*/ +int fz_skip(fz_context *ctx, fz_stream *stm, int len); + +/* fz_read_all: Read all of a stream into a buffer. stm: The stream to read from |