summaryrefslogtreecommitdiff
path: root/source/fitz
AgeCommit message (Collapse)Author
2018-01-11Only do lock checking if using custom locks.Sebastian Rasmussen
The lock checking functions are always enabled in debug mode, but since they are not thread safe they may not be used in a multi-threaded application. Multi-threaded applications are required to set their own locking functions so the lock checking functions should only be run if the default locking functions are in use.
2018-01-10Handle pixmaps without alpha in fz_tint_pixmap.Tor Andersson
2018-01-10Add colorspace type enum and use it instead of hardcoded checks on N.Tor Andersson
2018-01-10Refactor and fix hash lookups when decoding image subarea tiles.Tor Andersson
The subarea rect used for lookups could mismatch the subarea returned by the get_pixmap function due to adjusting to whole bytes. Refactor and use a common subarea adjustment function. Many image formats which do not support subarea tiles will decode and cache the full image, so if a subarea tile cannot be found, look for the full image tile as well.
2018-01-10Fix initializer syntax for VS2005.Tor Andersson
2018-01-04Bug 698836: Fix build with FZ_ENABLE_JPX=0.Tor Andersson
2018-01-04Add portable pseudo-random number generator based on the lrand48 family.Tor Andersson
2018-01-02Fix thread debugging code to always use ms_clock()Robin Watts
2017-12-20Bug 698827: Correct reference counting when creating pixmap from pixmap.Sebastian Rasmussen
Previously the copy had as many reference counts as the original pixmap which lead to leaks of pixmaps.
2017-12-13Parse XML using pool allocator.Tor Andersson
This needs adding a fz_xml_doc type to hold the pool.
2017-12-06Ensure that our ICC base spaces have colorant names.Robin Watts
2017-12-06Update fz_convert_separation_colors to cope with unnamed separations.Robin Watts
Well, at least not to crash.
2017-12-06Bug 698801: Always copy background in when clipping an imagemask.Robin Watts
Don't attempt to rely on alpha, as it is incompatible with the way we clip through the mask at the end.
2017-11-23Allow RGB based proofing profile and output intentMichael Vrhel
Also do not do the extra group push if the destination pixmap is in the proper color space and has all the required sep support.
2017-11-22Prefer using fz_snprintf over snprintf.Sebastian Rasmussen
This way the MuPDF library itself only uses fz_snprintf for consistent formatting.
2017-11-22Use custom allocator everywhere zlib is used.Sebastian Rasmussen
2017-11-22Warn on irretrievable glyph name.Sebastian Rasmussen
2017-11-17Fix build if lcms2 is not present.Tor Andersson
We NEED lcms2art (the artifex branch) and cannot build with stock lcms2. Disable ICC support if the lcms2 thirdparty library is not present.
2017-11-15Bug 698745: Avoid broken colorspaces in NO_ICC builds.Robin Watts
If we attempt to make an icc colorspace in a NO_ICC build, throw an exception. This stops us ending up with 'UNKNOWN' colorspaces in the system.
2017-11-13Bug 698369: Fix stroking issue when closepath is infinitessimal.Robin Watts
If the move due to a closepath is infinitessimal, fz_stroke_lineto skips it as it cannot accurately figure out what the direction is. It appears we have had some code in fz_stroke_closepath to cope with exactly this case, but it does the wrong thing. This dates back all the way to the initial import of the code, so presumably it worked at some point, and stopped working somewhere along the line.
2017-11-10Remove fz_android_fprintf.Tor Andersson
Use android logging for throw/warn like we do with OutputDebugString on windows.
2017-11-10Fix potential problem with null path segments leaving dots.Robin Watts
When stroking paths if we meet segments of 0 length, we can't determine a direction, thus start/end caps are omitted. Line widths are irrelevant, and we thus render nothing. (Note that moves on their own do NOT count as a line segment). The exception to this is where we are using round caps, whereupon whatever direction the path is taken to have, the appearance will be the same - and this we render the segment as a dot. We have code in the renderer already to do this, but it looks to me like it could be fooled into leaving a dot by us first doing a move, a lineto the same point, and then a lineto to somewhere else. The current code sets the 'dot' value to 1 when it detects the degenerate line, and doesn't reset when it meets a non-degenerate line later. Accordingly I've changed the code here to account for such a circumstance. This produces no diffs in the cluster testing, but seems more correct to me.
2017-11-10Remove unused variables.Tor Andersson
2017-11-09Bug 698307: Improve stdint.h detection logic in openjpeg wrapper.Robin Watts
Thanks to Tamir Evan for this tweak.
2017-11-09Bug 698353: Avoid having our API depend on DEBUG/NDEBUG.Robin Watts
Currently, our API uses static inlines for fz_lock and fz_unlock, the definitions for which depend on whether we build NDEBUG or not. This isn't ideal as it causes problems when people link a release binary with a debug lib (or vice versa). We really want to continue to use static inlines for the locking functions as used from MuPDF, as we hit them hard in the keep/drop functions. We therefore remove fz_lock/fz_unlock from the public API entirely. Accordingly, we move the fz_lock/fz_unlock static inlines into fitz-imp.h (an internal header), together with the fz_keep_.../fz_drop_... functions. We then have public fz_lock/fz_unlock functions for any external callers to use that are free of compilications. At the same time, to avoid another indirection, we change from holding the locking functions as a pointer to a struct to a struct itself.
2017-11-09Squash warning.Robin Watts
2017-11-08Clean up and speed up text searching.Tor Andersson
2017-11-08Select and copy structured text by lines.Tor Andersson
2017-11-08Remove broken bidi reordering code.Tor Andersson
TODO: Implement visual to logical reordering on the fly when building the structured text line.
2017-11-08Move static inline function out of header.Tor Andersson
2017-11-08Fix TGA banded operation.Robin Watts
Also, fix mudraw messages about what types can be banded.
2017-11-08Pixmap writers for formats with alpha should handle premultiplied data.Robin Watts
Any pixmap writers that can handle data with an alpha plane should accept that data in premultiplied form, and write it out appropriately for the file format. This avoids the need to unpremultiply data in mudraw, and solves the issue we were seeing where we want the png writer to be able to cope with premultiplied data (such as for the debug blending routines) and unpremultiplied data (such as that given after mudraw has unpremultiplied the data).
2017-11-02Fixes for win32 build.Tor Andersson
2017-11-01Add separate fz_close_output step.Tor Andersson
Closing flushes output and may throw exceptions. Dropping frees the state and never throws exceptions.
2017-11-01Use int64_t for public file API offsets.Tor Andersson
Don't mess with conditional compilation with LARGEFILE -- always expose 64-bit file offsets in our public API.
2017-11-01Don't use 'long' needlessly.Tor Andersson
2017-11-01Silence warning.Tor Andersson
2017-10-30Avoid UMR in fz_copy_pixmap_area_converting_seps.Robin Watts
When mapping spots down to process colors, don't try to map disabled spots.
2017-10-25Fix multithreaded crash with tiled regions.Robin Watts
Michael has found a crash when scrolling quickly through pages with gsview. 2 Threads are redrawing at the same time from a display list. The problem comes when both threads happen to be trying to draw the same tile from the cache at the same time. The current code alters the ->{x,y} values of the pixmap from the cache as it tiles. If 2 threads are using the same tile at the same time, this causes a race condition which can upset the clipping calculations and we can access out of range. The solution is to make a new 'wrapper' fz_pixmap around the same data, and to alter the x/y values there instead. We therefore introduce a (hopefully generally useful) function fz_new_pixmap_from_pixmap, and use that.
2017-10-25Fix pgm corruption with spots files.Robin Watts
When converting from a source space to a destination space with spots for our "overprint" group push, we were hitting problems in our use of the pixmap converters. Pixmap converters with copy_spots set can assume that the source and destination spots are the same - when copy spots is NOT set, we cannot assume this. This was leading us to have uninitialised group backgrounds. I believe we were only seeing this with pgm because of the device k to cmyk as K only special case. Also fix an error in the fast_gray_to_cmyk routine that failed to account for the change from subtractive to additive.
2017-10-25Ensure that fz_new_image_from_buffer doesn't leak a colorspace.Robin Watts
2017-10-25Fix colorspace reference counting in fz_load_*_info.Tor Andersson
These are called from fz_new_image_from_buffer.
2017-10-25Clean up ICC loading in PNG loader.Tor Andersson
2017-10-25Use ICC profile in tiff file if presentMichael Vrhel
2017-10-25Add CIE Lab color space support to tiff loaderMichael Vrhel
2017-10-25Get ICC information from JPEG imageMichael Vrhel
2017-10-25Use embedded ICC profile when rendering PNG imagesMichael Vrhel
2017-10-25Add fz_new_icc_colorspace_from_stream.Robin Watts
2017-10-24Add proper handling of bgr<->rgb for pixmap conversionsMichael Vrhel
2017-10-24Add interface for setting icc space to bgr formatMichael Vrhel
This is needed so that we can have bgr formatting with something other than the default sRGB