Age | Commit message (Collapse) | Author |
|
|
|
We want to turn pdf_page into a thin wrapper around a pdf_obj, so that
any updates to the underlying PDF objects will be reflected without
having to reload the pdf_page.
|
|
|
|
|
|
The mark & sweep pass of garbage collection, and resolving indirect objects when grafting objects
was following the full chain of indirect references. In the unusual case where a numbered object
is itself only an indirect reference to another object, this intermediate numbered object would
be missed both when marking for garbage collection, and when copying objects for grafting.
Add a function to resolve only one step for these two uses.
The following is an example of a file that would break during garbage collection if we
follow full indirect reference chains:
%PDF-1.3
1 0 obj
<</Type/Catalog /Foo[2 0 R 3 0 R]>>
endobj
2 0 obj
4 0 R
endobj
3 0 obj
5 0 R
endobj
4 0 obj
<</Length 1>>
stream
A
endstream
endobj
5 0 obj
<</Length 1>>
stream
B
endstream
endobj
|
|
The generation number is only needed for decryption, and is assumed
to be zero or irrelevant for all other uses.
Store the original object number and generation in the xref slot, so
that we can decrypt them even when the objects have been renumbered,
without needing to pass the original object number around through
the stream loading APIs.
|
|
Affects pdfclean, pdfmerge, and pdfposter.
|
|
|
|
We had moved the ctm into the display device, which meant it
no longer transformed the bounds given to the list device to
do scissoring. Move it back.
Same fix for muraster.
|
|
In an earlier commit, I changed some of the band writing functions
to take the band starting offset, rather than the band number. This
was done to accomodate the idea of rendering the page in bands of
different heights.
Sadly, it seems I didn't push this all the way through, and had
different band writing functions still taking the band number.
Fix all the band writing functions to be consistent.
|
|
Regardless of whether rendering in background thread or not the
filename and the page number should be printed.
|
|
|
|
|
|
|
|
|
|
The argument processing was expecting an argument after I.
|
|
A cutdown mudraw that only copes with simple raster output.
|
|
|
|
To return the proper size from fz_bound_display_list, which has been
broken since the begin_page device call was removed.
|
|
Allows us to remove the out parameter 'transform' from fz_begin_page.
|
|
It was incorrectly missing the alpha in the header writing code.
|
|
Previously the API assumed that all bands had to be the same
height. By moving the multiplication into the caller, we can
lift that assumption.
|
|
This silences the many warnings we get when building for x64
in windows.
This does not address any of the warnings we get in thirdparty
libraries - in particular harfbuzz. These look (at a quick
glance) harmless though.
|
|
|
|
|
|
|
|
|
|
|
|
This has knock on effects in the store.
fix
|
|
|
|
|
|
Update the test device so it can be used 'wrapping' another
device.
In particular, it can be used to wrap the display list device
so that we can evaluate 'color or not' while building the
display list rather than having to rerun the display list
afterwards.
Also, give improved control over whether we test every pixel
of images/shadings.
|
|
|
|
|
|
PAM output was broken in the absence of alpha. Fixed now.
|
|
fz_pixmaps now have an explicit stride value. By default no change
from before, but code all copes with extra gaps at the end of the
line.
The alpha data in fz_pixmaps is no longer compulsory.
mudraw: use rgb not rgba (ppmraw), cmyk not cmyka (pkmraw).
Update halftone code to not expect alpha plane.
Update PNG writing to cope with alpha less input.
Also hide repeated params within the png output context.
ARM code needs updating.
|
|
|
|
Add some paranoid checks to pdf_graft_object to prevent user
errors from crashing mupdf.
|
|
Remove unnecessary extra indirect object; pdf_add_object returns
an indirect reference already, so we don't need to duplicate it.
|
|
|
|
|
|
|
|
Use comma-separated list of flags and key/value pairs, for
example: "linearize,resolution=72,colorspace=gray"
|
|
|
|
This makes it possible to redirect standard out and standard error output
streams to output streams of your liking.
This means that now you can, in gdb, type:
(gdb) call pdf_print_obj(ctx, fz_stdout(ctx), obj, 0)
(gdb) call fflush(0)
or when dealing with an unresolved indirect reference:
(gdb) call pdf_print_obj(ctx, fz_stdout(ctx), pdf_resolve_indirect(ctx, ref), 0)
(gdb) call fflush(0)
|
|
Calculations need to be done differently.
|
|
There was a race condition on bgprint.pagenum that could cause
the bgprint worker to close down early, leaving the main thread
waiting for notification of its closedown.
|
|
Add -P flag to mudraw to do 'parallel' rendering. We shift rendering
onto a background thread, so that the main thread can continue
interpreting page n+1 while page n is being rendered.
To do this, we extract the core of the drawpage routine into
'dodrawpage', and either call it directly (in the normal case)
or from a bgprint worker thread (in the parallel case).
The threading construction exactly parallels that of the threaded
band rendering. We have a semaphore to start the render process,
a semaphore to indicate when the process has stopped, and the
thread itself.
The most complex thing here is the rejigging of the printfs
required to ensure that we still get the timings displayed in a
sane way.
|
|
Apparently neither OSX nor iOS support unnnamed semaphores,
so steal the gs versions and use them instead.
|
|
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.
|