summaryrefslogtreecommitdiff
path: root/source/tools/mudraw.c
AgeCommit message (Collapse)Author
2016-11-23Try drawing all pages in a document in mudraw if ignoring errors.Sebastian Rasmussen
2016-11-23Add 'X' option to disable document styles.Tor Andersson
2016-11-23Convert mudraw and muraster to use mu-threads.Robin Watts
Saves having the same threading code repeatedly.
2016-11-14Make fz_buffer structure private to fitz.Robin Watts
Move the definition of the structure contents into new fitz-imp.h file. Make all code outside of fitz access the buffer through the defined API. Add a convenience API for people that want to get buffers as null terminated C strings.
2016-11-11API improvements.Robin Watts
Add missing API comments. Move private definitions to implementation headers or C files. Move internal functions to implementation headers.
2016-11-11Add simple layer configuration feature to mutool draw.Robin Watts
This commit adds a new -y flag to mutool draw. -y takes an additional argument - this can either be a single 'l' meaning "list the layer configs available", or a comma separated list of numbers. The first number in the list says which "layer config" to select. Subsequent numbers identify lines in the config to toggle. For instance I might do: mutool draw -y l -o out.png layers.pdf and this will list me the layer configs in the file (as well as rendering normally). From this I might choose layer config 0: mutool draw -y 0 -o out.png layers.pdf This will select layer config 0, and show a table (max 1 layer per numbered line) that shows which layers are on or off. If I then decide that I want layers 3 and 4 to be toggled from their default state, I can run: mutool draw -y 0,3,4 -o out.png layers.pdf Short of implementing an interactive configuration mode, this is the simplest way to demonstrate the layer functionality.
2016-11-10Add mutool option (-l) for setting the minimum line width.Robin Watts
2016-10-18Avoid checking argument to fz_drop_*()/fz_free().Sebastian Rasmussen
As fz_drop_*()/fz_free() all must handle NULL.
2016-10-12Change code from using bandheight to using band_height.Robin Watts
Keep to our naming conventions.
2016-10-12Regularize band writer interface.Robin Watts
We have various functions that, for different image formats, write a header, then a band, then (sometimes) a trailer. Push them all through a single interface. This change also fixes potential problems caused by the trailer writing being an implicit destructor, which can cause problems in cleanup code if the trailer writing throws an error.
2016-09-22tools: Prefer fz_atof() to atof().Sebastian Rasmussen
2016-09-08Add options to control heuristics in structured text.Sebastian Rasmussen
2016-07-13Bug 696699: Fix Text extraction mediabox information.Robin Watts
Since the removal of the begin_page device function, structured text extraction has been unable to correctly establish the mediabox for extracted pages. Update the fz_new_stext_page call to take this mediabox information. This is an API change, but hopefully most people are calling fz_new_stext_page_from_page or fz_new_stext_page_from_display_list which are updated here to cope. Update all the apps/tools to behave properly.
2016-07-08Separate close and drop functionality for devices and writers.Tor Andersson
Closing a device or writer may throw exceptions, but much of the foreign language bindings (JNI and JS) depend on drop to never throw an exception (exceptions in finalizers are bad).
2016-06-28Mudraw: Fix interation with banding and display list.Robin Watts
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.
2016-06-28Fix inconsistency in band handling.Robin Watts
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.
2016-06-23Always print filenames in mudraw.Sebastian Rasmussen
Regardless of whether rendering in background thread or not the filename and the page number should be printed.
2016-06-22mudraw: Don't apply ctm twice when not using display list.Tor Andersson
2016-06-20Bug 696839: Fix -I option to mudraw.Robin Watts
The argument processing was expecting an argument after I.
2016-06-17Set pixmap resolution when creating pixmaps for draw device.Tor Andersson
2016-06-17Add mediabox argument to fz_new_display_list.Tor Andersson
To return the proper size from fz_bound_display_list, which has been broken since the begin_page device call was removed.
2016-06-17Add device space transform state to draw device.Tor Andersson
Allows us to remove the out parameter 'transform' from fz_begin_page.
2016-06-17Fix fz_write_pam code.Robin Watts
It was incorrectly missing the alpha in the header writing code.
2016-06-17Improve banding API.Robin Watts
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.
2016-06-16Drop save_alpha argument from image writing functions.Tor Andersson
2016-06-14Fix typos in various parts of the code.Sebastian Rasmussen
2016-06-08Move to using size_t for all mallocs.Robin Watts
This has knock on effects in the store. fix
2016-05-31Update test device with passthrough option.Robin Watts
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.
2016-05-30Respect FZ_ENABLE_PDF=0 to allow dropping all PDF specific code in tools.Tor Andersson
2016-05-27Mudraw: Move halftoning into render threads.Robin Watts
2016-05-26Bug 696803: Fix pam output.Robin Watts
PAM output was broken in the absence of alpha. Fixed now.
2016-05-24fz_pixmap revamp: add stride and make alpha optionalRobin Watts
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.
2016-05-13Add common page range parsing function for tools.Tor Andersson
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-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-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-28Mudraw: In low memory mode, flush the store after each page.Robin Watts
2016-04-27Fix 696649: remove fz_rethrow_message calls.Tor Andersson
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-26Change order of arguments to pdf_add_page etc.Tor Andersson
Resources are defined before they are used; so it's only logical to have the resource dictionary before the content buffer in the argument list.
2016-04-05Add 'Low Memory' mode to Mutool draw.Robin Watts
If used, PDF objects are cleared at the end of each page, and the store size is set to 1 byte, avoiding the caching of images. This trades repeated decoding of images/reading of file objects for memory usage. The purpose of this is to enable measurements to be made on the minimum possible memory level.
2016-04-05Add threaded operation to mudraw.Robin Watts
2016-03-25Fix PS output banded mode operation.Robin Watts
2016-03-25Refactor pcl output to work in bands.Robin Watts
2016-03-25Tweak the PCL page size handling/options.Robin Watts
Introduce a 'generic' PCL setting (basically ljet4 with custom page sizes for now). Ensure we send explicit sizes before the custom page sizes, and don't use Ricoh page sizes unless we are allowed to.
2016-03-25Add 24 bit RGB PCL output mode.Robin Watts
Output uses adaptive compression mode.
2016-03-23Mudraw: Enable banded operation for pkm.Robin Watts
All the groundwork was in place for this, I'd just forgotten to actually enable it.