summaryrefslogtreecommitdiff
path: root/source
AgeCommit message (Collapse)Author
2016-05-23Bug 696795: Proper fix.Robin Watts
When affine plotting with linear interpolation, we need to perform different calculations for the texture and for the edge of the shape. The edge of the shape needs to be calculated in exactly the same way as for non-linear interpolated shapes. The 'texture' position needs to be offset by 1/2 a texture unit in each direction so that the 'pure' color is given in the middle of the texture cells image, not in the top left corner. To achieve these aims, we actually offset the u/v positions by 1/2 (32768, given the fixed point we are using) and adjust for this in the boundary tests. I have a test file that shows this working, which I will attach to the bug, and add to the regression suite.
2016-05-20murun: Add Buffer#writeBuffer to allow for concatenating buffers.Tor Andersson
2016-05-20murun: Add graftObject to javascript bindings.Tor Andersson
Add some paranoid checks to pdf_graft_object to prevent user errors from crashing mupdf.
2016-05-20html: Add SVG image support.Tor Andersson
2016-05-20Add images based on display lists.Tor Andersson
2016-05-20Fix typo.Robin Watts
2016-05-20Remove voodoo from draw-affine.Robin Watts
We had some code in draw-affine that we didn't really understand. Change this for some code that seems more plausible. The voodoo code was showing up problems with the plotter rework (don't really know why), but the non-voodoo code seems happier.
2016-05-16Fit another mistake in cmyk plotters.Robin Watts
2016-05-13Fix error in CMYK plotters.Robin Watts
2016-05-13Fix potential double free in pdfmerge.Tor Andersson
Remove unnecessary extra indirect object; pdf_add_object returns an indirect reference already, so we don't need to duplicate it.
2016-05-13Add common page range parsing function for tools.Tor Andersson
2016-05-13murun: Add document writer object.Tor Andersson
2016-05-13Reference count fz_device.Tor Andersson
Language bindings sometimes require objects to be reference counted.
2016-05-13Fix double free and memory leak.Tor Andersson
2016-05-13Add pdf write support to mutool convert.Tor Andersson
2016-05-13Add long output option parsing.Tor Andersson
Use comma-separated list of flags and key/value pairs, for example: "linearize,resolution=72,colorspace=gray"
2016-05-13Update MuJS.Tor Andersson
2016-05-13Remove fz_lookup_device_colorspace().Sebastian Rasmussen
It is not used by mupdf itself and was added in commit 9915a386ea1dab21c5bbd4a0c8012dd13dbda301 to make it easier for sumatrapdf, but sumatrapdf has stopped using the interface.
2016-05-13Make document handler reference counting thread-safe.Sebastian Rasmussen
2016-05-13Introduce a general output context.Sebastian Rasmussen
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)
2016-05-13Move string compare helper to other string functions.Sebastian Rasmussen
2016-05-12Add variadic versions of fz_throw and fz_warn.Simon Reinhardt
2016-05-12Fix Mudraw timings when using -P (bgprint).Robin Watts
Calculations need to be done differently.
2016-05-12Fix race condition in bgprint.Robin
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.
2016-05-09First implementation of parallel rendering ("bgprint")Robin Watts
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.
2016-05-09Bug 696759: Fix pdf image subregion decode.Robin Watts
When decoding < 8 bpp images, we need to allow for the fact that the data is byte aligned at the end of each row by being careful in our calculation of r_skip.
2016-05-06Fix pdf_delete_page_range.Robin Watts
And improve the header file commenting.
2016-05-06Mutool clean: Fix sanitisation of pages with Content arrays.Robin Watts
If the Contents of a page are an array, we were forgetting to write the new singleton replacement into the dictionary.
2016-05-06Mutool clean: Copy OCProperties when subsetting.Robin Watts
Otherwise files (such as bug696754.pdf) can go wrong.
2016-05-04Make minimum line thickness dependent on AA level.Robin Watts
The PDF spec says that line thickness of 0 should mean "1 device pixel". We have been doing some dodgy logic where if the line thickness as scaled by the ctm is small (< 0.1f), make it at least 1 device pixel. This can mean that a line can not qualify for being thickened at 36dpi, but can be thickened at 24dpi. The thickened line at 24dpi is much thicker than the unthickened line at 36dpi, meaning that we get a noticable shift in rendering. Why do we do this strange logic? Well, presumably it's to avoid thin lines dropping out completely. We therefore move to some new logic. Firstly, we create a fudged 'aa_level' value, dependent on the antialias level. With AA level 0 (no antialiasing), this corresponds to 1 device pixel. For maximum AA level (8), this corresponds to 1/5 of a device pixel. Thus we should get 'continuous' results across different dpis.
2016-05-04Avoid using unnamed semaphores.Robin Watts
Apparently neither OSX nor iOS support unnnamed semaphores, so steal the gs versions and use them instead.
2016-04-29muclean: Avoid warning when no Outlines present in document.Robin Watts
2016-04-28Fix JPX breakage caused during refactor.Robin Watts
I was using fz_compressed_image when I should have been using fz_pixmap_image.
2016-04-28Add FZ_ERROR_OOM, and make fz_malloc & co call it.Robin Watts
2016-04-28Refactor fz_image code cases.Robin Watts
Split compressed images (images based on a compressed buffer) and pixmap images (images based on a pixmap) out into separate subclasses.
2016-04-28Tweak fz_image in preparation for things to come.Robin Watts
Move from ints to bits where possible.
2016-04-28Introduce tuning context.Robin Watts
For now, just use it for controlling image decoding and image scaling.
2016-04-28Partial image decode.Robin Watts
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.
2016-04-28Mudraw: In low memory mode, flush the store after each page.Robin Watts
2016-04-27Tweak pdf-write option handling.Tor Andersson
The handling of not-decompressing images/fonts was geared towards pdfclean usage; but now that we can create new PDF files, it makes more sense to ask for images and fonts to be compressed, rather than asking for them not to be decompressed with quirky interaction with the 'expand' and 'deflate' flags. If -f or -i are set, we will never decompress images, and we will compress them if they are uncompressed. If -d is set, we will first decompress all streams (module -f or -i). If -z is set, we will then compress all uncompressed streams.
2016-04-27murun: Add pdf.deleteObject().Tor Andersson
2016-04-27Add fz_close_device function.Tor Andersson
Garbage collected languages need a way to signal that they are done with a device other than freeing it. Call it implicitly on fz_drop_device; so take care not to call it again in case it has been explicitly called already.
2016-04-27Fix exception bug: rethrow without a caught exception!Tor Andersson
2016-04-27Remove useless try/catch/rethrows.Tor Andersson
2016-04-27Fix 696649: remove fz_rethrow_message calls.Tor Andersson
2016-04-27Don't return a void function.Robin Watts
2016-04-26Mudraw: Set AA level in context before cloning context.Robin Watts
When we clone the context, we copy the AA levels from the base context into the cloned context. This means that we must set the AA levels in the base context BEFORE cloning if we want them to be the same everywhere (or set them explicitly in all contexts).
2016-04-26Allow text/graphics aa levels to be controlled separately.Robin Watts
2016-04-26Improve fz_new_documentRobin Watts
Use a macro to make fz_new_document nicer (akin to fz_malloc_struct).
2016-04-26MSVC: Fix MSVC builds.Robin Watts
Some new files hadn't been added to the solution, and we were calling strcasecmp instead of fz_strcasecmp.