summaryrefslogtreecommitdiff
path: root/source/gprf
AgeCommit message (Collapse)Author
2016-07-08Use fz_keep_imp and fz_drop_imp for all reference counting.Tor Andersson
2016-07-06Proofing - fix a bug in the use of gswin32.exe.fredrossperry
Surround the final filename parameter in quotes ("") so file and folder names with spaces can be used.
2016-06-27Fix GProof operation.Robin Watts
Broken due to recent API changes. Also retire SUPPORT_GPROOF in favour of FZ_ENABLE_GPRF.
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-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-26Improve fz_new_documentRobin Watts
Use a macro to make fz_new_document nicer (akin to fz_malloc_struct).
2016-04-26Rename fz_write_int32be to fz_write_int32_be to be consistent with ↵Tor Andersson
fz_read_int32_be.
2016-03-14Remove begin_page and end_page device calls.Tor Andersson
To be moved into a new document writer interface later.
2016-02-02Fix Gproof DLL calling on windows.Robin Watts
Unadorned calling works on 64bit, but on 32bit we need to ensure that the gsapi functions are declared as __stdcall.
2016-01-20Various formatting cleanups.Tor Andersson
2016-01-05Clean up trailing whitespace.Tor Andersson
2015-12-15Rename fz_write_x to fz_save_pixmap_as_x or fz_save_bitmap_as_x.Tor Andersson
Separate naming of functions that save complete files to disk from functions that write data to streams.
2015-12-11Use fz_output instead of FILE* for most of our output needs.Tor Andersson
Use fz_output in debug printing functions. Use fz_output in pdfshow. Use fz_output in fz_trace_device instead of stdout. Use fz_output in pdf-write.c. Rename fz_new_output_to_filename to fz_new_output_with_path. Add seek and tell to fz_output. Remove unused functions like fz_fprintf. Fix typo in pdf_print_obj.
2015-09-29add fz_separation_disabled_on_page() and related functionsfredrossperry
2015-09-29gproof: put the generated page file in the same directory as the gproof filefredrossperry
2015-09-29Support for proofingfredrossperry
- use core.fileFormat to decide whether a proof file is being viewed, - don't show the proofing button except for PDF files. - in a proofing activity, show the page that was being viewed when the proof was requested. - Add extra two arguments to fz_write_gproof_file in the Android build.
2015-09-02Add in support for icc profiles in gprf/gproof formatMichael Vrhel
The default profile case (sRGB and SWOP CMYK) are indicated by empty strings for those entries.
2015-08-28Update gproof document handler to cope with renamed gs device.Robin Watts
Ghostscript device has been changed from gproof to gprf for sanity. Also update the non-gsapi calling code to use the same options as the gsapi calling code.
2015-08-26Make the ICC color path the default when rendering the gproof pages with gs.Michael Vrhel
Setting the default post rendering ICC profile to sRGB will make the ghostscript code use the ICC path with a SWOP CMYK device profile followed by a conversion to sRGB for the RGB content in the gproof file.
2015-08-24GProof: Hook up fz_meta - just for 'format' currently.Robin Watts
This will be useful for identifying when we are proofing.
2015-08-19Add stdout and stderr procedures for use with gs api callsMichael Vrhel
gsview on windows does not support the use of stdout and stderr. The calls to write out to these will return 0 leading to an i/o error from gs. To avoid this we define dummy functions that simply return the length that was to be written. To avoid issues with including "iapi.h" in Android builds that do not support gproof we wrap all of gprf-doc.c in an ifdef SUPPORT_GPROOF
2015-08-17GPrf: Alter gsapi invocationRobin Watts
Michael reports that adding -I%rom%Resource/Init/ to the args solves some problems by ensuring that the ROM filing system is used.
2015-08-17Fix stupid ommission in gprf-doc.cRobin Watts
I missed a line when refactoring code.
2015-08-17gprf: Minor fixes for neatness.Robin Watts
We should use a void *instance, not a void **instance. And fz_read_string is more correct than fz_read_line.
2015-08-17GProof: Use better RGB -> CMYK conversion when working from seps.Robin Watts
When proofing an image without all the separations enabled, we reconstitute it using the equivalent cmyk colors, and then convert to rgb. The CMYK -> RGB step is important for quality, and the whole point of GProof mode is to give the best possible quality, so use the slower, but prettier code. Also, fix the blatent bugs in the slower but prettier code that I introduced when hurriedly fixpointing it.
2015-08-17GProof: Fix creating images from a selection of separationsRobin Watts
The code for this was broken; the wrong flag was being tested for selection number, and the values were being assembled per line rather than per pixel.
2015-08-17GProof: Fix a potential signed/unsigned problem in CMYK conversion.Robin Watts
Not sure if this is actually an issue at the moment, but it potentially could be.
2015-08-17Add fz_read_string function to read a null terminated stringRobin Watts
Use that within gproof. The existing use of fz_read_line was broken and was resulting in bad values for separations.
2015-08-17Add JNI interface to MuPDFCore to read/write separations on a page.Robin Watts
Get separation information out to the Java level.
2015-07-31Clean up fz_read_[u]intNN() functions and add big-endian versions.Tor Andersson
Use an endian-ness independent method of reading, instead of byte swapping.
2015-07-20Gproof doc handler; add ability to call gs via gsapi rather than exe.Robin Watts
2015-07-20Improve Grid fitting of images for .gproof files.Robin Watts
By default in MuPDF, when we render an axis aligned image, we 'gridfit' it. This is a heuristic used to improve the rendering of tiled images, and avoid the background showing through on the antialiased edges. The general algorithm we use is to expand any image outwards so that it completely covers any pixels that it touches any part of. This is 'safe' in that we never cause any pixels to not be covered that should otherwise be so, and is important when we have images that are aligned with (say) line art rectangles. For gproof files though, this gives nasty results - because we have multiple images tiled across the page all exactly abutting, in most cases the edges will not be on exact integer coordinates. This means we expand both images and 1 (destination) pixel is lost. This severely hurts the rendering (in particular on text based pages). We therefore introduce a new type of grid fitting, where we simply align the edges of images to the closest integer pixel. This is safe because we know that neighbouring images will be adjusted identically and edges will stay coincident. We enable/disable this behaviour through a new device flag, and make the gproof interpreter set/clear this flag when generating the page - thus normal rendering is unaffected. We *could* have just poked the dev->flags fields directly, but that would require magic in the display list device to check for them being set/unset and to poke the dev->flags fields on playback, so instead we introduce a new fz_render_flags function (that calls a device function) to set/unset flags. The other attraction of this is that if we ever have devices that 'filter', we can neatly handle passing flag changes on with those. Currently the display list implementation only copes with set/clear of the FZ_DEVFLAG_GRIDFIT_AS_TILED option. We only readily have 6 bits available to us, so we'll just extend this as required if we add new render flags.
2015-07-20Code to generate a GProof file from a currently opened document.Robin Watts
Given a document, generate a gproof file from it. This encapsulates the name of the file, the desired resolution for proofing, and the page dimensions of all the pages in the file. The idea is that an app will call this when it is asked to go into 'proofing' mode, and will reinvoke itself on this file. This gives the gprf document handler just enough information to fake up a document of n pages of the required sizes. Each page will then be autogenerated on demand.
2015-07-20First cut at gprf document handler.Robin Watts
Doesn't actually trigger generation from ghostscript, or load images from files generated by ghostscript yet.