diff options
author | Robin Watts <robin.watts@artifex.com> | 2013-06-25 17:50:39 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-06-25 18:28:42 +0100 |
commit | a9e56e9f94515c109a912a50b4bc80466a11b075 (patch) | |
tree | 92d31f23c2c56e86867ff23aa6fbd95ca3251e43 /include | |
parent | 148e6b9dae3900f1acd053df10bc41f06be5c507 (diff) | |
download | mupdf-a9e56e9f94515c109a912a50b4bc80466a11b075.tar.xz |
Rework storing internal flags in PDF objects.
Before we render a page we need to evaluate whether we need
transparency or not. To establish this, we recursively walk the
resources looking for certain markers (blend modes, alpha levels,
smasks etc). To avoid doing this repeatedly we'd like to stash
the results somewhere.
Currently we write a '.useBM' entry into the top level dictionary
object, but with the recent changes to support incremental update
this is not ideal - it has the effect of forcing all resources
into the new section of the xref.
So we avoid that horrible hack and use a different one; we make use
of the new flags word in the pdf_obj structure. 1 bit is used to
indicate whether we have stashed a (boolean) value here, and another
bit is used to indicate what that value was.
Diffstat (limited to 'include')
-rw-r--r-- | include/mupdf/pdf/object.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/mupdf/pdf/object.h b/include/mupdf/pdf/object.h index 522ce411..96b9efd9 100644 --- a/include/mupdf/pdf/object.h +++ b/include/mupdf/pdf/object.h @@ -49,6 +49,12 @@ int pdf_obj_marked(pdf_obj *obj); int pdf_obj_mark(pdf_obj *obj); void pdf_obj_unmark(pdf_obj *obj); +/* obj stashing and stash reading functions - allows us to secretly stash + * a bool in an object, and to read back whether there was a stash, and + * if so, what it was. */ +void pdf_obj_stash(pdf_obj *obj, int stash); +int pdf_obj_stashed(pdf_obj *obj, int *stash); + /* safe, silent failure, no error reporting on type mismatches */ int pdf_to_bool(pdf_obj *obj); int pdf_to_int(pdf_obj *obj); |