summaryrefslogtreecommitdiff
path: root/xps/ghostxps.h
AgeCommit message (Collapse)AuthorFilesLines
2012-03-15Fix for bug 692865. Make XPS interpreter use ICC color spaces for defaultMichael Vrhel1-0/+1
The XPS interpreter was still using Device color spaces for its default color spaces. This fix has it use ICC color spaces by default which is required by the spec. This revealed an issue with the color space handling of the opacity masks. These were getting drawn in sRGB color space but the transparency group is linear gray. Since we are drawing the opacity mask as a luminosity mask that is gray we ended up mapping through a nonlinearity.
2012-03-15XPS Whitespace handling fixRobin Watts1-1/+1
Update the xps point reading code to use strtod rather than atof; this returns us an updated string pointer, rather than relying on us second-guessing where it may end up. Change xps_get_point to return this updated pointer, and change some calls of this to avoid having to skip whitespace (and potentially getting it wrong) after the call. Spotted as part of the commit to take the latest XPS changes into MuPDF.
2012-03-15Fix for Bug 692510 white space XPS interpreter fixMichael Vrhel1-0/+2
XPS interpreter was not very robust in its handling of white space in many locations. I created a general function to handle this in place of the many uses of sscanf in the interpreter.
2012-03-15Remove gserror.h, its contents have been moved to gserrors.h so weHenry Stiles1-1/+0
only need have one include file to use for error reporting.
2011-01-24Add rudimentary JPEG-XR support to GhostXPS using the JPEG-XR reference ↵Tor Andersson1-2/+2
software. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@12056 a1074d23-0009-0410-80fe-cf8c14f379e6
2010-07-01Return error code separately from NULL so we can handle empty resource ↵Tor Andersson1-2/+1
dictionaries. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@11478 a1074d23-0009-0410-80fe-cf8c14f379e6
2010-06-30Use gx_effective_clip_path to get the current visible area instead of ↵Tor Andersson1-10/+2
manually maintaining the bounds while parsing. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@11466 a1074d23-0009-0410-80fe-cf8c14f379e6
2010-06-25Move ICC wrapper colorspace out of the xps context.Tor Andersson1-20/+12
Create individual colorspace objects for each profile, and cache them in the colorspace hashtable in the context. Remove the colorspace type enum for images and use a gs_color_space object instead. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@11428 a1074d23-0009-0410-80fe-cf8c14f379e6
2010-06-22Add error propagation where it is missing, and remove error returns where ↵Tor Andersson1-133/+139
they are not used. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@11417 a1074d23-0009-0410-80fe-cf8c14f379e6
2010-06-21Enhancement to XPS interpreter - add high level pattern supportKen Sharp1-0/+1
High level devices (pdfwrite basically) prefer to receive patterns as high level, rather than pattern tiles as this is more compact. This patch checks the device capabilities and if it can support high level patterns we emit those rather than tiles. This is done by returning gs_error_Remap_Color from the 'remap' procedure and then controlling the device's pattern accumulator. Many files work better (converting to PDF) with this approach, though there are still some problems. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@11409 a1074d23-0009-0410-80fe-cf8c14f379e6
2010-06-15Addition of code to use new icc color architecture in xps rendering. Tor to ↵Michael Vrhel1-5/+16
provide minor fixes to this, primarily to remove the ctx->icc object. There will be xps differences with this commit since icc profiles were previously ignored. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@11379 a1074d23-0009-0410-80fe-cf8c14f379e6
2010-06-04Change so that we avoid double decoding of images in xps code. Previously ↵Michael Vrhel1-0/+3
we were doing a full decode into buffers to see if an alpha channel was present in the image data. Now we just check the header. Patch checked by Tor. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@11354 a1074d23-0009-0410-80fe-cf8c14f379e6
2010-06-01Rename of gsicccache.c/h to gsicc_cache.c/h and gsiccmanage.c/h to ↵Michael Vrhel1-1/+1
gsicc_manage.c/h to fall in line with the name space of the other files that came from the icc branch. Currently working on the documentation and it is clear that this is needed (and I wish I had done it earlier). git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@11346 a1074d23-0009-0410-80fe-cf8c14f379e6
2010-04-26Add support for parsing unzipped XPS files.Tor Andersson1-3/+1
If the path is given as /path/_rels/.rels then it will parse the entire document. If the path points to a FixedPage file (/path/Documents/1/Pages/1.fpage), only that single page will be parsed. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@11132 a1074d23-0009-0410-80fe-cf8c14f379e6
2010-04-26Simplify ZIP parsing.Tor Andersson1-125/+74
The special mode of the XPS interpreter that parses the ZIP file incrementally as a stream has proven to be useless. None of the files we see in the wild make use of the features that are required for a streaming XPS parser to behave well. As a result, this mode was always buffering up data and using lots of memory. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@11130 a1074d23-0009-0410-80fe-cf8c14f379e6
2010-04-22Run "git stripspace" over the GhostXPS source to remove trailingTor Andersson1-2/+0
whitespace and duplicate blank lines. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@11104 a1074d23-0009-0410-80fe-cf8c14f379e6
2010-04-20Use safe length checked string functions instead of strcpy and strcat.Tor Andersson1-2/+2
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@11092 a1074d23-0009-0410-80fe-cf8c14f379e6
2010-04-20Update GhostXPS copyright blobs for year 2010.Tor Andersson1-1/+1
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@11091 a1074d23-0009-0410-80fe-cf8c14f379e6
2010-04-20Reformat GhostXPS source to use 4 spaces for indentation rather than a mix ↵Tor Andersson1-2/+2
of tabs and spaces. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@11090 a1074d23-0009-0410-80fe-cf8c14f379e6
2010-02-24Remove some unused icclib code and fix xpstop and the makefiles so that we ↵Tor Andersson1-0/+2
can compile against the icc_work branch. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@10801 a1074d23-0009-0410-80fe-cf8c14f379e6
2010-02-16Use a tighter bounding box when creating transparencyTor Andersson1-3/+4
groups used to draw paths with opacity or opacity masks. There are some minor single-pixel color differences in the rendering of some gradients. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@10753 a1074d23-0009-0410-80fe-cf8c14f379e6
2009-11-19Only cache the font and colorspace resources that need to persist so that we ↵Tor Andersson1-2/+2
don't consume as much memory for each page. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@10356 a1074d23-0009-0410-80fe-cf8c14f379e6
2009-10-29Implement a random file access mode for the XPS parser that uses less memory.Tor Andersson1-28/+65
To enable this mode, set the XPS_ZIP_SEEK environment variable which will cause the interpreter to spool the data to a temp file and then run the parser in the new mode. This is going to change in a later patch to plmain that will enable the interpreters to directly access the job files. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@10243 a1074d23-0009-0410-80fe-cf8c14f379e6
2009-10-23Correct remaining prototype warnings in the ghostxps code.Ralph Giles1-0/+5
xps_debug_item, xps_debug_path, and xps_debug_resource_dictionary are added to ghostxps.h as public functions. xps_parse_content_relations, xps_process_compatibility and xps_debug_item_imp are made static since they are intended to be used from inside the same file. xps_debug_item_imp gets a prototype even though it is static because it calls itself recursively, and this triggers the gcc -Wmissing-prototypes warning. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@10218 a1074d23-0009-0410-80fe-cf8c14f379e6
2009-10-23Add prototypes for xpsdoc debug functions called from xpstop.Ralph Giles1-0/+4
Fixes several warnings. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@10213 a1074d23-0009-0410-80fe-cf8c14f379e6
2009-10-15Don't disable dprintf() and friends in non-debug builds.Ralph Giles1-8/+0
This reverts a patch from Ray (r2812 in the old ghostpcl repository) which was a quick hack to silence the extensive tracing output ghostxps produced at the time. Now most of those calls have been moved to xps_debug_foo() functions which aren't called in normal builds and a few warnings which shouldn't particularly be silenced. The patch worked by just defining the dpf macro to the empty string, but that creates 'operand of comma operator has no effect' warnings on gcc 4.4 when the remaining arguments tuple is interpreted as a discarded expression. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@10170 a1074d23-0009-0410-80fe-cf8c14f379e6
2009-10-01Thread base_uri argument to fixed page parsing functions so that resources ↵Tor Andersson1-23/+25
specified with relative paths can be resolved in the right context. Also fixed a few warnings. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@10107 a1074d23-0009-0410-80fe-cf8c14f379e6
2009-09-23Cache parsed XML parts (only external resource dictionaries) in the part ↵Tor Andersson1-1/+1
struct, and free the parsed XML along with images and other resources at the end of a page. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@10085 a1074d23-0009-0410-80fe-cf8c14f379e6
2009-06-15Look for transparency in image brushes and gradient brushes when analysing ↵Tor Andersson1-0/+1
the page in XPS. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@9794 a1074d23-0009-0410-80fe-cf8c14f379e6
2009-01-19Fix bugs in hash table implementation.Tor Andersson1-5/+22
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@9376 a1074d23-0009-0410-80fe-cf8c14f379e6
2009-01-17Use hash tables for XPS type maps and part list.Tor Andersson1-19/+15
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@9371 a1074d23-0009-0410-80fe-cf8c14f379e6
2008-11-27Remove some debug print outs in the XPS interpreter. Make zip-file debug ↵Tor Andersson1-1/+1
tracing depend on a variable. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@9249 a1074d23-0009-0410-80fe-cf8c14f379e6
2008-11-26Pre-parse XPS pages looking for transparency to avoid creating pdf 14 ↵Tor Andersson1-0/+4
compositor device when transparency is not used. Add header file changes. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@9244 a1074d23-0009-0410-80fe-cf8c14f379e6
2008-08-25Use __func__ in xps/svg memory macros.Tor Andersson1-9/+4
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@9023 a1074d23-0009-0410-80fe-cf8c14f379e6
2008-08-21Add copyright and description banners to the xps and svg code.Ralph Giles1-0/+15
Bug 690008. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@9011 a1074d23-0009-0410-80fe-cf8c14f379e6
2008-05-27Correct typo in xps_strcasecmp that caused the wrong parts to be returned ↵Tor Andersson1-0/+1
from xps_find_part, resulting in overwritted font data and other mishaps. git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@3072 06663e23-700e-0410-b217-a244a6096597
2008-04-02Redesign of IsStroked logic to not rely on global context state. Also ↵Tor Andersson1-7/+1
properly uses gs_closepath when possible. git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@3057 06663e23-700e-0410-b217-a244a6096597
2008-04-01Support IsStroked and IsFilled attributes when drawing paths.Tor Andersson1-0/+6
git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@3055 06663e23-700e-0410-b217-a244a6096597
2008-03-14Rearrange XPS parser init/deinit code to allow multiple jobs to run in ↵Tor Andersson1-7/+5
sequence. Fixes bug #689744. git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@3044 06663e23-700e-0410-b217-a244a6096597
2007-12-04Use compiler defines to decide whether a substitute preprocessorRalph Giles1-1/+2
definition of __FUNCTION__ should be used. The commit in r2972 incorrectly assumed this was a magic preprocessor macro, but it is instead a magic global variable. The symbol is supported by gcc back at least to version 2.95.3, and MSVC versions 7 and later. git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@2986 06663e23-700e-0410-b217-a244a6096597
2007-11-21Define __FUNCTION__ before using it if the C preprocessor does not.Ralph Giles1-0/+3
git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@2972 06663e23-700e-0410-b217-a244a6096597
2007-11-13Include system headers after gs portability magic. Required to build onRalph Giles1-2/+3
Ubuntu 7.10 x86_64. git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@2946 06663e23-700e-0410-b217-a244a6096597
2007-11-13Constant vigilance! Never trust a default.Tor Andersson1-0/+1
git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@2945 06663e23-700e-0410-b217-a244a6096597
2007-10-03HD-Photo codec stub.Tor Andersson1-0/+1
git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@2927 06663e23-700e-0410-b217-a244a6096597
2007-10-03Remove a lot of debugging/progress/printf noise.Tor Andersson1-0/+3
git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@2926 06663e23-700e-0410-b217-a244a6096597
2007-09-24Parse ICC profiles (not working). Find dependencies on ICC profile resources ↵Tor Andersson1-3/+6
when parsing relations from content. Periodically free cached resources. git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@2919 06663e23-700e-0410-b217-a244a6096597
2007-09-06Save decoded image data in the parts so images drawn multiple times do not ↵Tor Andersson1-0/+5
need to be decoded each time. Use XPS_DISABLE_TRANSPARENCY environment variable to disable transparency device for debugging. git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@2912 06663e23-700e-0410-b217-a244a6096597
2007-09-05Use colorspaces in all color code. Colorspace loading is stubbed to use ↵Tor Andersson1-3/+10
device colorspaces only. Fix font crash when using the pdfwrite device. git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@2911 06663e23-700e-0410-b217-a244a6096597
2007-09-03Fix workaround for pdf 1.4 device resetting. Remove some debug messages.Tor Andersson1-1/+4
git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@2910 06663e23-700e-0410-b217-a244a6096597
2007-08-07Keep track of the current clip region bounding box. Use the proper bounding ↵Tor Andersson1-1/+20
box when creating transparency groups. git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@2879 06663e23-700e-0410-b217-a244a6096597