summaryrefslogtreecommitdiff
path: root/fitz/res_colorspace.c
AgeCommit message (Collapse)Author
2012-01-19Multi-threading support for MuPDFRobin Watts
When we moved over to a context based system, we laid the foundation for a thread-safe mupdf. This commit should complete that process. Firstly, fz_clone_context is properly implemented so that it makes a new context, but shares certain sections (currently just the allocator, and the store). Secondly, we add locking (to parts of the code that have previously just had placeholder LOCK/UNLOCK comments). Functions to lock and unlock a mutex are added to the allocator structure; omit these (as is the case today) and no multithreading is (safely) possible. The context will refuse to clone if these are not provided. Finally we flesh out the LOCK/UNLOCK comments to be real calls of the functions - unfortunately this requires us to plumb fz_context into the fz_keep_storable function (and all the fz_keep_xxx functions that call it). This is the largest section of the patch. No changes expected to any test files.
2011-12-15Fix warnings/errors on unix builds.Robin Watts
Fix warnings/errors thrown up by the last few commits (which were only tested on windows).
2011-12-15Rework pdf_store to fz_store, a part of fz_context.Robin Watts
Firstly, we rename pdf_store to fz_store, reflecting the fact that there are no pdf specific dependencies on it. Next, we rework it so that all the objects that can be stored in the store start with an fz_storable structure. This consists of a reference count, and a function used to free the object when the reference count reaches zero. All the keep/drop functions are then reimplemented by calling fz_keep_sharable/fz_drop_sharable. The 'drop' functions as supplied by the callers are thus now 'free' functions, only called if the reference count drops to 0. The store changes to keep all the items in the store in the linked list (which becomes a doubly linked one). We still make use of the hashtable to index into this list quickly, but we now have the objects in an LRU ordering within the list. Every object is put into the store, with a size record; this is an estimate of how much memory would be freed by freeing that object. The store is moved into the context and given a maximum size; when new things are inserted into the store, care is taken to ensure that we do not expand beyond this size. We evict any stored items (that are not in use) starting from the least recently used. Finding an object in the store now takes a reference to it already. LOCK and UNLOCK comments are used to indicate where locks need to be taken and released to ensure thread safety.
2011-09-21Add warning context.Tor Andersson
2011-09-15Add context to mupdf.Robin Watts
Huge pervasive change to lots of files, adding a context for exception handling and allocation. In time we'll move more statics into there. Also fix some for(i = 0; i < function(...); i++) calls.
2011-04-08Various patches from SumatraPDF.Tor Andersson
2011-04-06Rename internal color conversion functions to reflect what they do.Tor Andersson
We used to convert through the XYZ colorspace. For various reasons we changed to convert through RGB instead, but the function names didn't follow suit.
2011-04-04Le Roi est mort, vive le Roi!Tor Andersson
The run-together words are dead! Long live the underscores! The postscript inspired naming convention of using all run-together words has served us well, but it is now time for more readable code. In this commit I have also added the sed script, rename.sed, that I used to convert the source. Use it on your patches and application code.
2011-02-08Only interpolate upscaled images when the interpolate flag is set in the ↵Tor Andersson
image dictionary.
2011-02-04Use the CMYK-to-RGB transform from Poppler.Tor Andersson
2010-12-30Adhere to nil idiom.Sebastian Rasmussen
2010-10-20Special case the component scaling for Lab image data when color converting.Tor Andersson
2010-10-20Fix Lab colorspace conversions.Tor Andersson
2010-10-19Fix typo in memoization case of pixmap color conversion.Tor Andersson
2010-10-18Use lookup table for separation colorspaces and a color cache for device-n ↵Tor Andersson
colorspaces when converting pixmaps.
2010-07-24Slower but slightly more accurate CMYK to RGB conversion.Tor Andersson
2010-07-17Remove all trailing whitespace.Tor Andersson
2010-07-17Minor edits of multi-line comments.Tor Andersson
2010-07-17Move device colorspace contants into the fitz namespace.Tor Andersson
2010-07-11Refactor image pixel unpacking.Tor Andersson
2010-07-10Refactor colorspace and PDF image parsing code.Tor Andersson
2010-06-29Move over to RGBA instead of ARGB. Add missing gray-alpha 'duff' functions.Robin Watts
2010-06-19Floats everywhere!Tor Andersson
2009-12-03Consolidate include lines to a single fitz.h.Tor Andersson
2009-12-02Killing time. Butchered display tree and disabled all calls to it.Tor Andersson
2009-12-02Have image and colorspace freeing adhere to common naming scheme.Sebastian Rasmussen
2009-02-28Merge and move header files into the source directories.Tor Andersson
2009-02-28Moved Fitz files into one directory.Tor Andersson
2005-06-04new world orderTor Andersson
2005-03-30rename and shuffle -- part 2Tor Andersson