summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-colorspace.c
AgeCommit message (Collapse)Author
2018-09-06Bug 699723: Free alternative colorspace upon error when loading ICC colorspace.Sebastian Rasmussen
2018-09-05Use colorspace type enum instead of magic profile names.Tor Andersson
2018-04-27Use pdf_dict_get_int, etc.Tor Andersson
2018-04-24Remove need for namedump by using macros and preprocessor.Tor Andersson
Add a PDF_NAME(Foo) macro that evaluates to a pdf_obj for /Foo. Use the C preprocessor to create the enum values and string table from one include file instead of using a separate code generator tool.
2018-01-10Add colorspace type enum and use it instead of hardcoded checks on N.Tor Andersson
2017-10-24Change colorspace 'device_n' field to be a flags word.Robin Watts
2017-10-24Logic for Sep and DeviceN colorspaces with C,M,Y, or K.Michael Vrhel
Special care is required when the DeviceN color space has cyan, magenta, yellow or black. For example, even if we support separations in the destination, if the color space has CMY or K as one of its colorants and we are drawing to an RGB or Gray pixmap we will want to do the tint transform. Also if the pixmap has no seps memember present, we support the separations if the destination is CMYK and the DeviceN colorspace has no "Spot" (non-CMYK) colorants.
2017-09-07Initialize variables to appease clang scan-build.Sebastian Rasmussen
2017-07-27Remove unnecessary check of colorspace pointer.Sebastian Rasmussen
2017-07-19Add some consts to color conversions.Robin Watts
2017-07-19Extend fz_colorspaces to better cope with DeviceN.Robin Watts
We now keep a list of colorant names for every colorspace, along with a an 'is_device_n' flag, set for all separation and deviceN spaces.
2017-07-17Set colorspace name field.Tor Andersson
2017-07-04Remove is_static from fz_new{,_icc}_colorspace.Robin Watts
No longer required, and causes leaks. Also, fix some reference counting problems with colorspaces.
2017-06-22Add Color Management interface to MuPDF, with LCMS implementation.Michael Vrhel
This commit adds an interface for a color management engine to MuPDF, together with the internal changes required to use it. We also add an implementation of this interface using the LCMS2 library. This commit is the "lcms" development branch squashed to a single commit. The individual commits that make it up are as follows: ------ Add LCMS2 submodule. Add required source files to MSVC libthirdparty project. Plus changes to the Makefile. ------ Change name of libfont to libresources The library can hold things other than fonts including ICC profiles and eventually halftone screens etc. ------ Generate and include icc profiles on windows solution Makefile for linux needs to be updated ------ Initial cut at interface to little cms Methods for getting profile handles, link handles and transform buffers as well as individual colors. ------ Install ICC profiles from source When the source color space is an ICC profile install the ICC space. Use alternative color space if ICC is invalid. ------ Rename ICC resources The way that fontdump generates the names was causing some redundant prefix/suffix combinations. ------ Make resource ICC profiles usable This brings in the resource profiles for use with the target device. When mudraw is invoked with the icc color type, it will set up the target pixmap to have an icc based color space. ------ Make Default ICC color spaces not storable The ICC color spaces in the color context should not be put into the store. ICC color spaces that are contained in the source document are however storable. ------ Add in support for single color conversion This adds in the selection of the icc single color converter. Note that we may want to look at using the float conversion in lcms here since we are going from and to float. The down side is that the creation of such converters may be expensive. ------ Pixmap ICC conversion Also clean up and further simplify some of the code. Use common dst, src in function parameters instead of src, dst. ------ Add md5 calculation for profiles Compare md5 of source and destination. If they are the same set link as identity and do not bother creating link from cmm. ------ Initial attempt at adding links to store Next need to make sure I have all the dropping set up correctly and that the links are getting freed when we are all done with them. ------ Add drop for link Make sure that we drop the links when we are done with them. ------ Fix icc link store ref. counting + rendering intent The key allocations, rc and removal was wrong for the icc links. Also added in support on the graphic state for rendering intent. ------ Add ICC profiles to Makefile. ------ Move ICC profile loading to colorspace.c ------ Fix build on linux. ------ Use hexdump in creating icc profiles ------ First cut at CalRGB CalGray handling These color spaces are converted to equivalent ICC profiles when the drawing operation occurs. ToDo still is avoid creating brand new CalGray, CalRGB or ICC color spaces when we encounter the same object in the source file. Instead we should make use of the store. ------ Adding fz_color_params into device API Stroke and fill of paths and text which will have color rendering related settings including overprint, overprint mode, rendering intent and black point settings. Images have a fz_color_params member added to them. ------ Rendering intent support for graphic and text Graphic fills and strokes as well as text fill and strokes handle the rendering intent settings. This works through the display list. The parameters related to color rendering, ri, bp, op, opm are packed in the flags bits through the display list. To do: Add support for images and shadings. ------ Add support for rendering intent with images Required change to fill_image api, hence the large number of files touched. ------ Add support for shadings rendering intent and DeviceN This adds support for the rendering intent in shading fills. Also, adds in support for color management of DeviceN and Separation color spaces where the base space is defined to be ICC. ------ Add clamping proc to colorspace-imp.h In the head of mupdf, the index color values were not being clamped properly. I moved the clamping operation to be performed by a procedure in of the color space. The a*, b* values in LAB will need to include a range value for proper clamping as well as the ICC color space at some point. ------ Fix assert test with index images ------ Support for DeviceN images color managed The base space for DeviceN and separation images is now color managed when the ICC work flow is used. ------ Add DefaultGray etc to names.txt The DefaultGray, DefaultRGB, and DefaultCMYK settings in the pdf page resource dictionary need to be parsed and handled if present. ------ Remove methods for setting color space in context The methods that existed for setting the color spaces in the color space context were broken and we will not be changing them from their initial setting at startup. ------ Add front end support for default color spaces PDF can specify in the resource dictionary color spaces that should be used for DeviceGray, DeviceRGB and DeviceCMYK. This commit handles the extraction of these color spaces and passes them through the display list and gets them into a structure on a draw device (if one is used). Next step is to have the draw device make use of them. ------ Backend of default color spaces This handles the use of page level definitions for DefaultGray, DefaultRGB, DefaultCMYK in the draw device. The interface for the pixmap color conversion had to be expanded a bit to pass the default_cs object. This was needed due to the fact that the image could be DeviceN or Separation and have a base space that needs to be replaced by a page level Default color space. Tested this with a file that had two pages each with an common reference image object but different DefaultCMYK definitions in the page resource dictionary. Proper rendering was obtained. ------ Add icc support to band-writer and png output For image viewers that support icc profiles, it is important that we include the icc profile into those formats that support. Currently the only output format we have that supports it is PNG. But if we decide to do tiff, jpeg or psd those also support the embedding of icc profiles. ------ Work toward multithreading Each cloned context creates a new cmm context to reduce contention. This may not be optimal though as it may create conflicts in any shared store. ------ Add missing files. Failed to check in icc-imp.h and icc34.h ------ Fix default device color calls copy and paste errors. ------ Fixes ------ Fix clamping of lab colors The lab colors when used with the lab resource profile need to be properly clamped and scaled. ------ Turn off ICC create debug define ------ Fix memory leak issues ------ Set clamp proc in color context color spaces When NO_ICC is enabled there was an issue as the default spaces did not have the clamp proc (which was added in the lcms branch). ------ Fix several issues after rebase During rebase of the branch there were several issues that came up. In addition there was a fix related to the use of the lcms2 context branch that did not make it in for some reason. ------ Fix for fz_store_type structure changes ------ Fixes for multithreaded This fixes a few issues. One issue is that we can not be changing the input and output formatter for the links if they are being shared among threads. This adds the format as part of the link definition. Next step is to create a link clone operation in lcms so that we can readily create a different one with everything the same except the formatter. Also, this shares the profiles that exist in the color context among the threads. When a context is cloned, it will use the profiles in the current context but it will create a new cmm context.c ------ Fix NO_ICC issues There were a few issues that occurred when we compiled and ran with the NO_ICC setting. ------ Change CMM to use lower resolution tables in links The table resolution greatly affects the performance for some files. I don't see any significant color rendering issues going with a lower resolution. Selecting cmsFLAGS_LOWRESPRECALC uses a MLUT resolution of 17. This is going to be sufficient color wise and gives a large improvement performance wise especially for files where the color link creation is significant compared to the rendering. ------ Fix link key creation to populate alpha and bit depth. The store key for icc links needs to include the bit depth and if the transform has to handle an alpha value. This is needed due to the fact that we can't change the formatter when we are sharing links among different threads. ------ Pull in some MSVC 2005 fixes for lcms2 ------ Fix non-prototype prototype. ------ Miscellaneous typos, whitespace fixes. ------ Tidy colorspace creation API. Rather than pass a magic implementation reference count value (-1 for static, 1 for normal), pass a boolean "is_static" flag. This gives a nicer API (IMAO etc). ------ Make all colorspaces use an fz_buffer. ------ Fix internal naming of MSVC project file. ------ Fix some error handling. ------ Add some consts. ------ Tweak fz_color_params and fz_store_hash. Use uint8_t for fz_color_param entries - no need to use larger. Same change in fz_store_hash. This limits the size required for the hash table too. ------ Throw on errors, rather than returning NULL. fz_cmm_transform_pixmap should throw if it's fed pixmaps incompatible with its transforms. fz_cmm_new_ctx should throw if the cmm fails to initialise. ------ Ensure LCMS2_OBJs are built/linked using Makefile. Also ensure that ICC_OBJs are included. ------ Fix some unused variable warnings. ------ cs_params fixes. Use the ones that are passed. ------ fz_color_params tweaks. Make them const in many places. Cope with cs_params == NULL meaning default (i.e. fz_cs_param(ctx)). Minimise the places we call fz_cs_params(ctx). Consistently use cs_params rather than a mix of cs_param and cs_params. ------ Improve PDF color params handling. PDF allows different OP settings for strokes and fills. This means that either we need to keep separate entries in each fz_color_param structure for the stroke one or the fill one, OR we need to duplicate the fz_color_param structure. It seems neatest to do the latter (not least because this means we don't pass more information to each device function than it actually needs). Accordingly, we put an fz_color_param in each pdf_material. We update the code that reads ExtGStates to set the values appropriately. We take the opportunity to add support for the PDF 2.0 UseBlackPtComp option too. ------ Fix colorspace ref count problems. 1) Don't drop colorspace until we've finished using it. 2) Don't drop it twice. ------ Convert NULL deref into a thrown error. Seen with: mutool draw -D -o out.png ../tests_private/comparefiles/Bug689760.pdf We seem to have a pdf-cal space with no profile. Talk to Michael about this. ------ Avoid using colorspace names to distinguish colorspaces. Using strcmp is slow. ------ Cope with failure to parse default colorspaces during PDF page load. ------ Avoid SEGV due to to pdf_cal space with no profile. As seen in: tests_private/pdf/PDFIA1.7_SUBSET/CATX4879.pdf ------ Handle cases where base space of sep is pdf-cal We handled this for images, but not for solid fills. ------ Accelerate ICC color conversion. ------ Cope with indexed images in the color management. Some images (JPX images) come to the cm code still in the indexed color space. Their base space could be DevN so we need to cope with multiple base decodes. This continues the decode until we get to a space for which we can create an ICC link. ------ Ignore alpha presence in component count check ------ Eliminate recursion in fz_source_colorspace_cm. ------ Cope with bare ICCBased colorspace defs. Bug692137.pdf has ICCBased colorspaced definitions given directly as a stream, rather than as [ /ICCBased <stream reference> ] Acrobat copes with these, as does gs. We therefore update our code to cope too. Also, the PDF spec says that any problems found when reading the Default spaces should be ignored (or at least not to abort rendering). Update our code to do that too. ------ Tweak color converter logic for speed. When we are using an icc profile based conversion, avoid ever having to lookup the color converter for each conversion call; do it at the lookup stage. ------ Harden us against failures during ICC link creation. Seen with corrupted profiles. ------ Fix for handling alpha with lcms. Note that this currently maintains an alpha when it is present. We may need to do some work for the gray scale conversion to alpha mask. ------ Delay pdf-cal profile creation Put the creation of the pdf cal profile into the link creation function (rather than have it scattered). Also be robust in the condition of failure to create the profile. ------ Proper clamping with embedded CIELAB ICC profile If the ICC profiles alternate color space is LAB then use the LAB clamping proc. ------ Use the color space clamp when converting to base color spaces In many of the Ghent test files, we have a DeviceN image whose alternate color space is CIELAB. We need to make sure to use the CIELAB clamping operation in this case. ------ Make ICC runtime configurable. Add fz_icc_flowflow, fz_set_icc_workflow functions to read ICC workflow state, and set the ICC workflow state. The latter will throw an error if trying to enable ICC workflow in a NO_ICC build. Add -N flag to mutool to disable ICC. Incorporates build fixes from Michael. ------ Ensure fz_draw_fill_image uses the pixmap colorspace It appears that the image colorspace historically has been able to differ from the pixmap colorspace. While we've fixed the cases that we know about for this (see the previous commits), tweak fz_draw_fill_image to work the way it always has in the past. ------ Add support for output intent PDF documents can have an ICC profile defined in their Catalog which defines the output color space and the color space to use for one of the Device color spaces (e.g. DeviceGray, DeviceRGB or DeviceCMYK). ------ Catch errors in default color spaces Before setting the default color space contained in the file, make sure it is the correct type. Bug692213.pdf ------ Clamp to base space during sep color conversion This was the source of a problem when the base space was CIELAB. ------ Rename some functions to be more MuPDFy drop rather than free etc. ------ Fix "casting away const" warning. srcv is a const *. Do the clamping operation on src_map (the same value) before it is assigned into the const variable. ------ Rejig top level color management interface slightly. Same code, just change the encapsulation. ------ Remove pre-multiplied alpha prior to color management The pixmaps in mupdf use a premultiplied alpha format. Prior to doing any color management we need to undo the alpha and then reapply after color management. ------ Remove global output intent as unused. ------ Move fz_color_params to be the final arg in dev calls. Frequently this will be NULL, and it doesn't form part of the colorspace/color/alpha triple. ------ Rename fz_default_xxx static variables. Remove fz prefix, to prepare for a later renaming that would conflict. ------ Rename cs_params to color_params. ------ Rename lcms branch identifiers. ------ Return device colorspaces if the default colorspace is NULL. ------ Clean up device call function for set_default_colorspaces. ------ Add missing rethrow. ------ Load page default colorspaces lazily. ------ murun: Add color params device argument. Stubbed to always be NULL at the moment. ------ Rename extgstate processor ops. ------ Fix a few minor issues from Tor Removes icc-imp.h Rename color-icccreate.c Add context to some methods ------ Fix javalib with recent lcms dev changes. ------ Update lcms2 with sub project fixes. ------ Fix build failure. ------ Add icc profile into other PNG output methods ------ Fix some ints that should be size_t's. ------ Tweak fz_new_icc_data_from_icc_colorspace. Ensure that the colorspace is const, and that we set size to 0 if we don't find any data. ------ Combine band writer methods for header and ICC writing For many formats (like PSD), we need to delay writing some of the header until we know whether we are getting an ICC profile to write or not. Makes more sense to just write them at the same time. ------ Miscellaneous tweaks in colorspace.c Mainly to avoid pointer aliasing, "nicer" whitespace, and a leak on error. ------ Avoid rightward drift in get_base_icc. ------ Ensure that pdf_load_output_intent copes with exceptions. If load_icc_based throws and exception, warn and continue. Don't not render a file just because the inbuilt default profiles are broken. ------ Revert change in pdf-page.c The page resources load had been moved so we could get the default colorspaces, but this has been moved into run_contents, so putting stuff back as it was before. ------ Revert changes in mudraw. We had added some colorspages in mudraw, and then later removed them. Revert the changes to accomodate this to make the overall branch diffs smaller. ------ Use fz_buffer in color-icc-create.c ------ Force mapping through proof icc profile always. ------ Fix behaviour on fz_cmm_new_profile failure. If the profile fails to be made, return an error code, and have the callers take sane steps. ------ Tweak load_icc_based Cope better with errors in reading the ICC space not stopping us loading the alternate. ------ Remove unused variable. ------ Get page resource for DefaultCS look-up res = pdf_dict_get(ctx, PDF_NAME_Resources, page->obj); was not returning resource. Replaced with res = pdf_page_resources(ctx, page); ------ Move default color space set up to pdf_run_page_contents_with_usage ------ Review fixes for lcms branch. ------ Fixes for calibrated colorspace loading. ------ Add fz_document_output_intent wrapper. Lazy load intent for PDF. ------ Copy DefaultCS logic into pdf_run_annot_with_usage. Same code as from pdf_run_page_contents_with_usage. ------ More review fixes. ------ Avoid rightward drift in pdf_load_cal_common ------ Rename color_converter functions to be find/drop. Better than than lookup/discard. lookup suggests something that doesn't need dropping, and we use drop rather than discard by convention. ------ Move cmm from context into colorspace context. ------ Review fixes: Remove recursion and rename functions. ------ Don't access doc->oi directly in pdf_load_default_colorspaces. ------ Rename fz_colorspace_is_pdf_cal to fz_colorspace_is_cal and make it public. ------ Tweak function naming to be more consistent. ------ fz_md5_icc can be implemented using fz_md5_buffer. ------ Print full md5 checksums in link key debug prints. ------ Make fz_md5_buffer NULL safe. ------ Simplify debug saving of ICC profiles. ------ Rename fz_cmm_new/drop_profile to init/fin. ------ Indentation cleanups. ------ Move CMM static inline functions from private header to C file. ------ Tweak fz_icc_data_from_icc_colorspace to return a buffer. Also, remove the _new_ from the name to reflect the fact that we are passed a borrowed handle, not given a new reference. ------ java: Add ColorParams.pack() function. ------ Generate one C file for the embedded ICC profiles. ------ Return const pointer from fz_default_color_params. ------ Change misleading argument names to fz_new_colorspace. ------ Rename fz_cmm_new/drop_link to fz_cmm_init/fin_link. ------ Change definition of fz_cmm_instance. Rather than void, use an undefined struct in keeping with the rest of the code. ------ Add support for color managed bgr color space ------ Return unsigned char array from fz_lookup_icc. ------ Make default_color_params immutable. Changing the defaults used by the draw device should happen via a device call, should we need the functionality in the future. ------ Clean up error handling in color-lcms.c ------ Fix signed/unsigned warning.
2017-06-16Strip doc out of color space load methodMichael Vrhel
Also the pdf_load_function call. Doc was not used in either of these.
2017-04-27Include required system headers.Tor Andersson
2017-04-27Remove fz_function abstract structure.Tor Andersson
There is only one implementation, so don't bother with the abstraction. Just use pdf_function directly.
2017-03-28pdf: Use FZ_ERROR_SYNTAX code for syntax errors.Tor Andersson
2016-12-27Strip extraneous blank lines.Tor Andersson
2016-12-27Common code to ensure we only premultiply pixmaps with additive colors.Tor Andersson
2016-12-08Fix incorrect recursive object marking.Robin Watts
We use pdf_mark_obj/pdf_unmark_obj to catch cycles when traversing PDF structures. In some cases we were failing to actually test the return code, making it pointless.
2016-10-19Rename internal headers to follow pattern *-imp.h.Sebastian Rasmussen
2016-10-06Hide internals of fz_colorspaceRobin Watts
The implementation does not need to be in the public API.
2016-09-01Use fz_convert_color().Sebastian Rasmussen
In preference to colorspace internal to_rgb() function pointer.
2016-09-01pdf: Load/open streams by indirect reference object when possible.Tor Andersson
2016-07-06pdf: Drop generation number from public interfaces.Tor Andersson
The generation number is only needed for decryption, and is assumed to be zero or irrelevant for all other uses. Store the original object number and generation in the xref slot, so that we can decrypt them even when the objects have been renumbered, without needing to pass the original object number around through the stream loading APIs.
2016-07-06Expose LAB colorspaceSebastian Rasmussen
2016-06-17Use 'size_t' instead of int as appropriate.Robin Watts
This silences the many warnings we get when building for x64 in windows. This does not address any of the warnings we get in thirdparty libraries - in particular harfbuzz. These look (at a quick glance) harmless though.
2016-04-27Fix exception bug: rethrow without a caught exception!Tor Andersson
2016-04-27Fix 696649: remove fz_rethrow_message calls.Tor Andersson
2016-01-21Drop const from fz_colorspace.Tor Andersson
It's an opaque immutable structure, that we don't expect to ever want to change after creation. Therefore the const keyword is not useful, and is only line noise.
2016-01-13Add lots of consts.Robin Watts
In general, we should use 'const fz_blah' in device calls whenever the callee should not alter the fz_blah. Push this through. This shows up various places where we fz_keep and fz_drop these const things. I've updated the fz_keep and fz_drops with appropriate casts to remove the consts. We may need to do the union dance to avoid the consts for some compilers, but will only do that if required. I think this is nicer overall, even allowing for the const<->no const problems.
2015-03-24Rework handling of PDF names for speed and memory.Robin Watts
Currently, every PDF name is allocated in a pdf_obj structure, and comparisons are done using strcmp. Given that we can predict most of the PDF names we'll use in a given file, this seems wasteful. The pdf_obj type is opaque outside the pdf-object.c file, so we can abuse it slightly without anyone outside knowing. We collect a sorted list of names used in PDF (resources/pdf/names.txt), and we add a utility (namedump) that preprocesses this into 2 header files. The first (include/mupdf/pdf/pdf-names-table.h, included as part of include/mupdf/pdf/object.h), defines a set of "PDF_NAME_xxxx" entries. These are pdf_obj *'s that callers can use to mean "A PDF object that means literal name 'xxxx'" The second (source/pdf/pdf-name-impl.h) is a C array of names. We therefore update the code so that rather than passing "xxxx" to functions (such as pdf_dict_gets(...)) we now pass PDF_NAME_xxxx (to pdf_dict_get(...)). This is a fairly natural (if widespread) change. The pdf_dict_getp (and sibling) functions that take a path (e.g. "foo/bar/baz") are therefore supplemented with equivalents that take a list (pdf_dict_getl(... , PDF_NAME_foo, PDF_NAME_bar, PDF_NAME_baz, NULL)). The actual implementation of this relies on the fact that small pointer values are never valid values. For a given pdf_obj *p, if NULL < (intptr_t)p < PDF_NAME__LIMIT then p is a literal entry in the name table. This enables us to do fast pointer compares and to skip expensive strcmps. Also, bring "null", "true" and "false" into the same style as PDF names. Rather than using full pdf_obj structures for null/true/false, use special pointer values just above the PDF_NAME_ table. This saves memory and makes comparisons easier.
2015-02-17Add ctx parameter and remove embedded contexts for API regularity.Tor Andersson
Purge several embedded contexts: Remove embedded context in fz_output. Remove embedded context in fz_stream. Remove embedded context in fz_device. Remove fz_rebind_stream (since it is no longer necessary). Remove embedded context in svg_device. Remove embedded context in XML parser. Add ctx argument to fz_document functions. Remove embedded context in fz_document. Remove embedded context in pdf_document. Remove embedded context in pdf_obj. Make fz_page independent of fz_document in the interface. We shouldn't need to pass the document to all functions handling a page. If a page is tied to the source document, it's redundant; otherwise it's just pointless. Fix reference counting oddity in fz_new_image_from_pixmap.
2015-02-17Rename fz_close_* and fz_free_* to fz_drop_*.Tor Andersson
Rename fz_close to fz_drop_stream. Rename fz_close_archive to fz_drop_archive. Rename fz_close_output to fz_drop_output. Rename fz_free_* to fz_drop_*. Rename pdf_free_* to pdf_drop_*. Rename xps_free_* to xps_drop_*.
2014-02-17Add const to colorspace source arguments and dependencies.Tor Andersson
2014-01-13tolerate overlong colorspace lookup stringsSimon Bünzli
At http://code.google.com/p/sumatrapdf/issues/detail?id=2477 , there's a document which has an indexed colorspace whose lookup string contains a trailing character. That character can be safely ignored without rejecting everything depending on such a colorspace.
2014-01-10Bug 694889: Fix valgrind issues due to empty indexed spaces.Robin Watts
If indexed spaces are empty (or truncated) we use garbage values when they are read. Spot this and pad with 0s to at least be consistent. Fixes: 013b2dcbd0207501e922910ac335eb59_asan_heap-oob_a59696_5952_500.pdf 5440f8bc8af12e5f7050e59b7ee008cd_asan_heap-oob_a59dd9_5952_500.pdf fa8c712b03a7b02d6a12856ce042a44e_signal_sigsegv_a59b06_5847_493.pdf Thanks to Mateusz Jurczyk and Gynvael Coldwind of the Google Security Team for providing the fuzzing files.
2014-01-06fix various MSVC warningsSimon Bünzli
Some warnings we'd like to enable for MuPDF and still be able to compile it with warnings as errors using MSVC (2008 to 2013): * C4115: 'timeval' : named type definition in parentheses * C4204: nonstandard extension used : non-constant aggregate initializer * C4295: 'hex' : array is too small to include a terminating null character * C4389: '==' : signed/unsigned mismatch * C4702: unreachable code * C4706: assignment within conditional expression Also, globally disable C4701 which is frequently caused by MSVC not being able to correctly figure out fz_try/fz_catch code flow. And don't define isnan for VS2013 and later where that's no longer needed.
2013-09-27fix bug 694618Simon Bünzli
For Separation and DeviceN colorspaces, the initial color value is 1.0 for all components instead of 0.0 as for most other colorspaces. The current initialization in pdf_set_colorspace initializes for CMYK which happens to work for all non-tint colorspaces.
2013-09-13Fix various compile warnings spotted by the cluster.Robin Watts
2013-09-10support /Alternate colorspace for ICC basedSimon Bünzli
This progresses among others Bug689803.pdf and Alternate_colorspace_for_ICCBased_not_supported.pdf
2013-06-27Move to using a flags bit rather than "Dirty" dict entries.Robin Watts
Correct the naming scheme for pdf_obj_xxx functions.
2013-06-25Rid the world of "pdf_document *xref".Robin Watts
For historical reasons lots of the code uses "xref" when talking about a pdf document. Now pdf_xref is a separate type this has become confusing, so replace 'xref' with 'doc' for clarity.
2013-06-20Rearrange source files.Tor Andersson