summaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2021-03-30 10:59:39 +0200
committerThomas Deutschmann <whissi@gentoo.org>2021-04-01 00:04:14 +0200
commit5ff1d6955496b3cf9a35042c9ac35db43bc336b1 (patch)
tree6d470f7eb448f59f53e8df1010aec9dad8ce1f72 /base
parentImport Ghostscript 9.53.1 (diff)
downloadghostscript-gpl-patches-5ff1d6955496b3cf9a35042c9ac35db43bc336b1.tar.gz
ghostscript-gpl-patches-5ff1d6955496b3cf9a35042c9ac35db43bc336b1.tar.bz2
ghostscript-gpl-patches-5ff1d6955496b3cf9a35042c9ac35db43bc336b1.zip
Import Ghostscript 9.54ghostscript-9.54
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'base')
-rw-r--r--base/all-arch.mak6
-rw-r--r--base/assert_.h2
-rw-r--r--base/bench.c2
-rw-r--r--base/bobbin.c4
-rw-r--r--base/bobbin.h2
-rw-r--r--base/cal.mak4
-rw-r--r--base/claptrap-impl.h2
-rw-r--r--base/claptrap-init.c2
-rw-r--r--base/claptrap-planar.c2
-rw-r--r--base/claptrap.c2
-rw-r--r--base/claptrap.h2
-rw-r--r--base/ctype_.h2
-rw-r--r--base/dirent_.h2
-rw-r--r--base/dos_.h2
-rw-r--r--base/echogs.c2
-rw-r--r--base/errno_.h2
-rw-r--r--base/ets.c6
-rw-r--r--base/ets.h4
-rw-r--r--base/ets_tm.h2
-rw-r--r--base/expat.mak6
-rw-r--r--base/fapi_bs.mak6
-rw-r--r--base/fapi_ft.c55
-rw-r--r--base/fapibstm.c4
-rw-r--r--base/fapiufst.c16
-rw-r--r--base/fcntl_.h2
-rw-r--r--base/freetype.mak10
-rw-r--r--base/gconf.c2
-rw-r--r--base/gconf.h2
-rw-r--r--base/gdbflags.h2
-rw-r--r--base/gdebug.h2
-rw-r--r--base/gdevabuf.c2
-rw-r--r--base/gdevbbox.c10
-rw-r--r--base/gdevbbox.h2
-rw-r--r--base/gdevdbit.c52
-rw-r--r--base/gdevdcrd.c2
-rw-r--r--base/gdevdcrd.h2
-rw-r--r--base/gdevddrw.c2
-rw-r--r--base/gdevddrw.h2
-rw-r--r--base/gdevdevn.c2
-rw-r--r--base/gdevdevn.h2
-rw-r--r--base/gdevdevnprn.h2
-rw-r--r--base/gdevdflt.c12
-rw-r--r--base/gdevdgbr.c2
-rw-r--r--base/gdevdrop.c2
-rw-r--r--base/gdevdsha.c12
-rw-r--r--base/gdevemap.c2
-rw-r--r--base/gdevepo.c68
-rw-r--r--base/gdevepo.h2
-rw-r--r--base/gdevflp.c19
-rw-r--r--base/gdevflp.h2
-rw-r--r--base/gdevhit.c2
-rw-r--r--base/gdevkrnlsclass.c45
-rw-r--r--base/gdevkrnlsclass.h5
-rw-r--r--base/gdevm1.c2
-rw-r--r--base/gdevm16.c2
-rw-r--r--base/gdevm2.c2
-rw-r--r--base/gdevm24.c2
-rw-r--r--base/gdevm32.c2
-rw-r--r--base/gdevm4.c2
-rw-r--r--base/gdevm40.c2
-rw-r--r--base/gdevm48.c2
-rw-r--r--base/gdevm56.c2
-rw-r--r--base/gdevm64.c2
-rw-r--r--base/gdevm8.c2
-rw-r--r--base/gdevmem.c16
-rw-r--r--base/gdevmem.h2
-rw-r--r--base/gdevmpla.c2
-rw-r--r--base/gdevmpla.h2
-rw-r--r--base/gdevmplt.c2
-rw-r--r--base/gdevmplt.h2
-rw-r--r--base/gdevmr1.c4
-rw-r--r--base/gdevmr2n.c2
-rw-r--r--base/gdevmr8n.c3
-rw-r--r--base/gdevmrop.h2
-rw-r--r--base/gdevmrun.c19
-rw-r--r--base/gdevmrun.h2
-rw-r--r--base/gdevmx.c2
-rw-r--r--base/gdevnfwd.c13
-rw-r--r--base/gdevnup.c593
-rw-r--r--base/gdevnup.h48
-rw-r--r--base/gdevoflt.c2
-rw-r--r--base/gdevoflt.h2
-rw-r--r--base/gdevp14.c1616
-rw-r--r--base/gdevp14.h10
-rw-r--r--base/gdevpccm.c2
-rw-r--r--base/gdevpccm.h2
-rw-r--r--base/gdevpipe.c2
-rw-r--r--base/gdevplnx.c2
-rw-r--r--base/gdevplnx.h2
-rw-r--r--base/gdevppla.c3
-rw-r--r--base/gdevppla.h2
-rw-r--r--base/gdevprn.c266
-rw-r--r--base/gdevprn.h6
-rw-r--r--base/gdevpxat.h2
-rw-r--r--base/gdevpxen.h2
-rw-r--r--base/gdevpxop.h2
-rw-r--r--base/gdevrops.c2
-rw-r--r--base/gdevsclass.c370
-rw-r--r--base/gdevsclass.h2
-rw-r--r--base/gdevvec.c2
-rw-r--r--base/gdevvec.h2
-rw-r--r--base/gen_ordered.c297
-rw-r--r--base/gen_ordered.h14
-rw-r--r--base/genarch.c2
-rw-r--r--base/genconf.c2
-rw-r--r--base/gendev.c2
-rw-r--r--base/genht.c2
-rw-r--r--base/gp.h2
-rw-r--r--base/gp_dosfe.c2
-rw-r--r--base/gp_dosfs.c2
-rw-r--r--base/gp_dvx.c2
-rw-r--r--base/gp_getnv.c2
-rw-r--r--base/gp_mktmp.c2
-rw-r--r--base/gp_msdll.c2
-rw-r--r--base/gp_msdos.c2
-rw-r--r--base/gp_mshdl.c2
-rw-r--r--base/gp_mslib.c2
-rw-r--r--base/gp_mspol.c2
-rw-r--r--base/gp_msprn.c2
-rw-r--r--base/gp_mswin.c2
-rw-r--r--base/gp_mswin.h2
-rw-r--r--base/gp_nsync.c2
-rw-r--r--base/gp_ntfs.c3
-rw-r--r--base/gp_nxpsprn.c2
-rw-r--r--base/gp_os2.c2
-rw-r--r--base/gp_os2.h2
-rw-r--r--base/gp_os2fs.c2
-rw-r--r--base/gp_os2pr.c2
-rw-r--r--base/gp_os9.c2
-rw-r--r--base/gp_paper.c2
-rw-r--r--base/gp_psync.c4
-rw-r--r--base/gp_stdia.c2
-rw-r--r--base/gp_stdin.c2
-rw-r--r--base/gp_strdl.c4
-rw-r--r--base/gp_unifn.c2
-rw-r--r--base/gp_unifs.c4
-rw-r--r--base/gp_unix.c2
-rw-r--r--base/gp_upapr.c2
-rw-r--r--base/gp_vms.c2
-rw-r--r--base/gp_wgetv.c2
-rw-r--r--base/gp_win32.c24
-rw-r--r--base/gp_winfs.c2
-rw-r--r--base/gp_winfs2.c2
-rw-r--r--base/gp_wpapr.c2
-rw-r--r--base/gp_wsync.c2
-rw-r--r--base/gp_wutf8.c2
-rw-r--r--base/gp_wxpsprn.cpp2
-rw-r--r--base/gpcheck.h2
-rw-r--r--base/gpgetenv.h2
-rw-r--r--base/gpmisc.c10
-rw-r--r--base/gpmisc.h2
-rw-r--r--base/gpsync.h2
-rw-r--r--base/gs.mak2
-rw-r--r--base/gs_dll_call.h2
-rw-r--r--base/gs_mgl_e.h2
-rw-r--r--base/gs_mro_e.h2
-rw-r--r--base/gsalloc.c8
-rw-r--r--base/gsalloc.h2
-rw-r--r--base/gsargs.c2
-rw-r--r--base/gsargs.h2
-rw-r--r--base/gsbitcom.c2
-rw-r--r--base/gsbitmap.h2
-rw-r--r--base/gsbitops.c2
-rw-r--r--base/gsbitops.h2
-rw-r--r--base/gsbittab.c2
-rw-r--r--base/gsbittab.h2
-rw-r--r--base/gsccode.h6
-rw-r--r--base/gsccolor.h4
-rw-r--r--base/gscdef.c2
-rw-r--r--base/gscdefs.h4
-rw-r--r--base/gscdevn.c2
-rw-r--r--base/gscdevn.h2
-rw-r--r--base/gscedata.c3888
-rw-r--r--base/gscedata.h2
-rw-r--r--base/gscencs.c2
-rw-r--r--base/gscencs.h2
-rw-r--r--base/gschar.c4
-rw-r--r--base/gschar.h2
-rw-r--r--base/gschar0.c2
-rw-r--r--base/gscicach.c30
-rw-r--r--base/gscicach.h2
-rw-r--r--base/gscie.c2
-rw-r--r--base/gscie.h2
-rw-r--r--base/gsciemap.c2
-rw-r--r--base/gscindex.h2
-rw-r--r--base/gsclipsr.c2
-rw-r--r--base/gsclipsr.h2
-rw-r--r--base/gscms.h20
-rw-r--r--base/gscolor.c2
-rw-r--r--base/gscolor.h2
-rw-r--r--base/gscolor1.c2
-rw-r--r--base/gscolor1.h2
-rw-r--r--base/gscolor2.c4
-rw-r--r--base/gscolor2.h2
-rw-r--r--base/gscolor3.c2
-rw-r--r--base/gscolor3.h2
-rw-r--r--base/gscompt.h2
-rw-r--r--base/gscoord.c2
-rw-r--r--base/gscoord.h2
-rw-r--r--base/gscparam.c2
-rw-r--r--base/gscpixel.c2
-rw-r--r--base/gscpixel.h2
-rw-r--r--base/gscpm.h2
-rw-r--r--base/gscrd.c2
-rw-r--r--base/gscrd.h2
-rw-r--r--base/gscrdp.c2
-rw-r--r--base/gscrdp.h2
-rw-r--r--base/gscrypt1.c2
-rw-r--r--base/gscrypt1.h2
-rw-r--r--base/gscscie.c2
-rw-r--r--base/gscsel.h2
-rw-r--r--base/gscsepr.c2
-rw-r--r--base/gscsepr.h2
-rw-r--r--base/gscspace.c32
-rw-r--r--base/gscspace.h6
-rw-r--r--base/gscssub.c2
-rw-r--r--base/gscssub.h2
-rw-r--r--base/gsdcolor.h2
-rw-r--r--base/gsdevice.c45
-rw-r--r--base/gsdevice.h2
-rw-r--r--base/gsdevmem.c2
-rw-r--r--base/gsdll.h2
-rw-r--r--base/gsdllwin.h2
-rw-r--r--base/gsdparam.c238
-rw-r--r--base/gsdps1.c11
-rw-r--r--base/gsdsrc.c2
-rw-r--r--base/gsdsrc.h2
-rw-r--r--base/gsequivc.c21
-rw-r--r--base/gsequivc.h4
-rw-r--r--base/gserrors.h2
-rw-r--r--base/gsexit.h2
-rw-r--r--base/gsfcid.c6
-rw-r--r--base/gsfcid2.c2
-rw-r--r--base/gsfcmap.c15
-rw-r--r--base/gsfcmap.h4
-rw-r--r--base/gsfcmap1.c2
-rw-r--r--base/gsflip.c2
-rw-r--r--base/gsflip.h2
-rw-r--r--base/gsfname.c2
-rw-r--r--base/gsfname.h2
-rw-r--r--base/gsfont.c2
-rw-r--r--base/gsfont.h2
-rw-r--r--base/gsfont0.c2
-rw-r--r--base/gsfont0c.c2
-rw-r--r--base/gsform1.h2
-rw-r--r--base/gsftopts.h2
-rw-r--r--base/gsfunc.c2
-rw-r--r--base/gsfunc.h2
-rw-r--r--base/gsfunc0.c2
-rw-r--r--base/gsfunc0.h2
-rw-r--r--base/gsfunc3.c2
-rw-r--r--base/gsfunc3.h2
-rw-r--r--base/gsfunc4.c26
-rw-r--r--base/gsfunc4.h2
-rw-r--r--base/gsgc.h2
-rw-r--r--base/gsgcache.c2
-rw-r--r--base/gsgcache.h2
-rw-r--r--base/gsgdata.c2
-rw-r--r--base/gsgdata.h2
-rw-r--r--base/gsgstate.c12
-rw-r--r--base/gsgstate.h2
-rw-r--r--base/gshsb.c2
-rw-r--r--base/gshsb.h2
-rw-r--r--base/gsht.c56
-rw-r--r--base/gsht.h2
-rw-r--r--base/gsht1.c13
-rw-r--r--base/gsht1.h2
-rw-r--r--base/gshtscr.c2
-rw-r--r--base/gshtx.c2
-rw-r--r--base/gshtx.h2
-rw-r--r--base/gsicc.c2
-rw-r--r--base/gsicc.h2
-rw-r--r--base/gsicc_blacktext.c108
-rw-r--r--base/gsicc_blacktext.h34
-rw-r--r--base/gsicc_cache.c43
-rw-r--r--base/gsicc_cache.h7
-rw-r--r--base/gsicc_cms.h2
-rw-r--r--base/gsicc_create.c59
-rw-r--r--base/gsicc_create.h4
-rw-r--r--base/gsicc_lcms2.c21
-rw-r--r--base/gsicc_lcms2mt.c35
-rw-r--r--base/gsicc_manage.c10
-rw-r--r--base/gsicc_manage.h4
-rw-r--r--base/gsicc_monitorcm.c2
-rw-r--r--base/gsicc_nocm.c2
-rw-r--r--base/gsicc_profilecache.c2
-rw-r--r--base/gsicc_profilecache.h2
-rw-r--r--base/gsicc_replacecm.c2
-rw-r--r--base/gsimage.c13
-rw-r--r--base/gsimage.h2
-rw-r--r--base/gsimpath.c2
-rw-r--r--base/gsinit.c2
-rw-r--r--base/gsio.h2
-rw-r--r--base/gsiodev.c2
-rw-r--r--base/gsiodevs.c2
-rw-r--r--base/gsiodisk.c8
-rw-r--r--base/gsioram.c2
-rw-r--r--base/gsiorom.c2
-rw-r--r--base/gsiorom.h2
-rw-r--r--base/gsipar3x.h2
-rw-r--r--base/gsiparam.h2
-rw-r--r--base/gsiparm3.h2
-rw-r--r--base/gsiparm4.h2
-rw-r--r--base/gsjconf.h2
-rw-r--r--base/gsjmorec.h2
-rw-r--r--base/gslib.c2
-rw-r--r--base/gslib.h2
-rw-r--r--base/gslibctx.c45
-rw-r--r--base/gslibctx.h2
-rw-r--r--base/gsline.c2
-rw-r--r--base/gsline.h2
-rw-r--r--base/gslparam.h2
-rw-r--r--base/gsmalloc.c12
-rw-r--r--base/gsmalloc.h2
-rw-r--r--base/gsmatrix.c2
-rw-r--r--base/gsmatrix.h4
-rw-r--r--base/gsmchunk.c28
-rw-r--r--base/gsmchunk.h2
-rw-r--r--base/gsmd5.c2
-rw-r--r--base/gsmd5.h2
-rw-r--r--base/gsmdebug.h2
-rw-r--r--base/gsmemory.c6
-rw-r--r--base/gsmemory.h2
-rw-r--r--base/gsmemraw.h2
-rw-r--r--base/gsmemret.c2
-rw-r--r--base/gsmemret.h2
-rw-r--r--base/gsmisc.c8
-rw-r--r--base/gsnamecl.c2
-rw-r--r--base/gsnamecl.h2
-rw-r--r--base/gsncdummy.c2
-rw-r--r--base/gsncdummy.h2
-rw-r--r--base/gsnogc.c2
-rw-r--r--base/gsnogc.h2
-rw-r--r--base/gsnotify.c2
-rw-r--r--base/gsnotify.h2
-rw-r--r--base/gsovrc.c21
-rw-r--r--base/gsovrc.h2
-rw-r--r--base/gspaint.c12
-rw-r--r--base/gspaint.h2
-rw-r--r--base/gsparam.c18
-rw-r--r--base/gsparam.h6
-rw-r--r--base/gsparam2.c2
-rw-r--r--base/gsparaml.c30
-rw-r--r--base/gsparams.c2
-rw-r--r--base/gsparams.h2
-rw-r--r--base/gsparamx.c2
-rw-r--r--base/gsparamx.h2
-rw-r--r--base/gspath.c4
-rw-r--r--base/gspath.h2
-rw-r--r--base/gspath1.c2
-rw-r--r--base/gspath2.h2
-rw-r--r--base/gspcolor.c2
-rw-r--r--base/gspcolor.h2
-rw-r--r--base/gspenum.h2
-rw-r--r--base/gspmdrv.c2
-rw-r--r--base/gspmdrv.h2
-rw-r--r--base/gspmdrv.rc4
-rw-r--r--base/gsptype1.c393
-rw-r--r--base/gsptype1.h2
-rw-r--r--base/gsptype2.c2
-rw-r--r--base/gsptype2.h2
-rw-r--r--base/gsrect.h2
-rw-r--r--base/gsrefct.h2
-rw-r--r--base/gsromfs0.c2
-rw-r--r--base/gsrop.c2
-rw-r--r--base/gsrop.h2
-rw-r--r--base/gsroprun.c2
-rw-r--r--base/gsroprun1.h2
-rw-r--r--base/gsroprun24.h2
-rw-r--r--base/gsroprun8.h2
-rw-r--r--base/gsropt.h2
-rw-r--r--base/gsroptab.c2
-rw-r--r--base/gsserial.c2
-rw-r--r--base/gsserial.h2
-rw-r--r--base/gsshade.c2
-rw-r--r--base/gsshade.h2
-rw-r--r--base/gssprintf.c16
-rw-r--r--base/gssprintf.h2
-rw-r--r--base/gsstate.c182
-rw-r--r--base/gsstate.h4
-rw-r--r--base/gsstrl.h2
-rw-r--r--base/gsstrtok.h2
-rw-r--r--base/gsstruct.h2
-rw-r--r--base/gsstype.h2
-rw-r--r--base/gstext.c81
-rw-r--r--base/gstext.h6
-rw-r--r--base/gstiffio.c17
-rw-r--r--base/gstiffio.h2
-rw-r--r--base/gstparam.h2
-rw-r--r--base/gstrans.c27
-rw-r--r--base/gstrans.h16
-rw-r--r--base/gstrap.c2
-rw-r--r--base/gstrap.h2
-rw-r--r--base/gstype1.c224
-rw-r--r--base/gstype1.h2
-rw-r--r--base/gstype2.c172
-rw-r--r--base/gstype42.c9
-rw-r--r--base/gstypes.h2
-rw-r--r--base/gsuid.h2
-rw-r--r--base/gsutil.c10
-rw-r--r--base/gsutil.h2
-rw-r--r--base/gswin.rc2
-rw-r--r--base/gsxfont.h2
-rw-r--r--base/gx.h2
-rw-r--r--base/gxacpath.c2
-rw-r--r--base/gxalloc.h2
-rw-r--r--base/gxalpha.h2
-rw-r--r--base/gxarith.h2
-rw-r--r--base/gxband.h2
-rw-r--r--base/gxbcache.c7
-rw-r--r--base/gxbcache.h2
-rw-r--r--base/gxbitfmt.h2
-rw-r--r--base/gxbitmap.h2
-rw-r--r--base/gxbitops.h2
-rw-r--r--base/gxblend.c36
-rw-r--r--base/gxblend.h6
-rw-r--r--base/gxblend1.c19
-rw-r--r--base/gxccache.c2
-rw-r--r--base/gxccman.c9
-rw-r--r--base/gxcdevn.h2
-rw-r--r--base/gxchar.c2
-rw-r--r--base/gxchar.h2
-rw-r--r--base/gxchrout.c2
-rw-r--r--base/gxchrout.h2
-rw-r--r--base/gxcht.c8
-rw-r--r--base/gxcid.h2
-rw-r--r--base/gxcie.h2
-rw-r--r--base/gxcindex.h2
-rw-r--r--base/gxclbits.c29
-rw-r--r--base/gxcldev.h16
-rw-r--r--base/gxclfile.c2
-rw-r--r--base/gxclimag.c52
-rw-r--r--base/gxclio.h2
-rw-r--r--base/gxclip.c10
-rw-r--r--base/gxclip.h2
-rw-r--r--base/gxclip2.c8
-rw-r--r--base/gxclip2.h2
-rw-r--r--base/gxclipm.c8
-rw-r--r--base/gxclipm.h2
-rw-r--r--base/gxclipsr.h2
-rw-r--r--base/gxclist.c154
-rw-r--r--base/gxclist.h21
-rw-r--r--base/gxcllzw.c2
-rw-r--r--base/gxclmem.c2
-rw-r--r--base/gxclmem.h2
-rw-r--r--base/gxclpage.c2
-rw-r--r--base/gxclpage.h2
-rw-r--r--base/gxclpath.c2
-rw-r--r--base/gxclpath.h2
-rw-r--r--base/gxclrast.c22
-rw-r--r--base/gxclread.c22
-rw-r--r--base/gxclrect.c15
-rw-r--r--base/gxclthrd.c4
-rw-r--r--base/gxclthrd.h2
-rw-r--r--base/gxclutil.c10
-rw-r--r--base/gxclzlib.c2
-rw-r--r--base/gxcmap.c6
-rw-r--r--base/gxcmap.h11
-rw-r--r--base/gxcolor2.h2
-rw-r--r--base/gxcomp.h6
-rw-r--r--base/gxcoord.h2
-rw-r--r--base/gxcpath.c2
-rw-r--r--base/gxcpath.h2
-rw-r--r--base/gxcspace.h18
-rw-r--r--base/gxctable.c2
-rw-r--r--base/gxctable.h2
-rw-r--r--base/gxcvalue.h2
-rw-r--r--base/gxdcconv.c2
-rw-r--r--base/gxdcconv.h2
-rw-r--r--base/gxdcolor.c34
-rw-r--r--base/gxdcolor.h6
-rw-r--r--base/gxdda.h2
-rw-r--r--base/gxdevbuf.h2
-rw-r--r--base/gxdevcli.h22
-rw-r--r--base/gxdevice.h10
-rw-r--r--base/gxdevmem.h2
-rw-r--r--base/gxdevndi.c2
-rw-r--r--base/gxdevrop.h2
-rw-r--r--base/gxdevsop.h41
-rw-r--r--base/gxdht.h9
-rw-r--r--base/gxdhtres.h2
-rw-r--r--base/gxdhtserial.c2
-rw-r--r--base/gxdhtserial.h2
-rw-r--r--base/gxdither.h2
-rw-r--r--base/gxdownscale.c2
-rw-r--r--base/gxdownscale.h2
-rw-r--r--base/gxdtfill.h2
-rw-r--r--base/gxfapi.c22
-rw-r--r--base/gxfapi.h12
-rw-r--r--base/gxfapiu.c2
-rw-r--r--base/gxfapiu.h2
-rw-r--r--base/gxfarith.h2
-rw-r--r--base/gxfcache.h4
-rw-r--r--base/gxfcid.h2
-rw-r--r--base/gxfcmap.h2
-rw-r--r--base/gxfcmap1.h2
-rw-r--r--base/gxfill.c2
-rw-r--r--base/gxfill.h2
-rw-r--r--base/gxfillsl.h2
-rw-r--r--base/gxfilltr.h2
-rw-r--r--base/gxfillts.h2
-rw-r--r--base/gxfixed.h2
-rw-r--r--base/gxfmap.h2
-rw-r--r--base/gxfont.h2
-rw-r--r--base/gxfont0.h2
-rw-r--r--base/gxfont0c.h2
-rw-r--r--base/gxfont1.h2
-rw-r--r--base/gxfont42.h2
-rw-r--r--base/gxfrac.h2
-rw-r--r--base/gxftype.h2
-rw-r--r--base/gxfunc.h2
-rw-r--r--base/gxgetbit.h2
-rw-r--r--base/gxgstate.h18
-rw-r--r--base/gxhintn.c2
-rw-r--r--base/gxhintn.h2
-rw-r--r--base/gxhintn1.c2
-rw-r--r--base/gxhldevc.c2
-rw-r--r--base/gxhldevc.h2
-rw-r--r--base/gxht.c2
-rw-r--r--base/gxht.h2
-rw-r--r--base/gxht_thresh.c2
-rw-r--r--base/gxht_thresh.h2
-rw-r--r--base/gxhtbit.c173
-rw-r--r--base/gxhttile.h2
-rw-r--r--base/gxhttype.h2
-rw-r--r--base/gxi12bit.c10
-rw-r--r--base/gxi16bit.c2
-rw-r--r--base/gxiclass.h2
-rw-r--r--base/gxicolor.c18
-rw-r--r--base/gxidata.c9
-rw-r--r--base/gxifast.c6
-rw-r--r--base/gximag3x.c15
-rw-r--r--base/gximag3x.h2
-rw-r--r--base/gximage.c2
-rw-r--r--base/gximage.h4
-rw-r--r--base/gximage1.c2
-rw-r--r--base/gximage3.c7
-rw-r--r--base/gximage3.h2
-rw-r--r--base/gximage4.c2
-rw-r--r--base/gximask.c2
-rw-r--r--base/gximask.h2
-rw-r--r--base/gximdecode.c4
-rw-r--r--base/gximdecode.h2
-rw-r--r--base/gximono.c3
-rw-r--r--base/gxiodev.h2
-rw-r--r--base/gxiparam.h2
-rw-r--r--base/gxipixel.c26
-rw-r--r--base/gxiscale.c147
-rw-r--r--base/gxline.h2
-rw-r--r--base/gxlum.h2
-rw-r--r--base/gxmatrix.h2
-rw-r--r--base/gxmclip.c2
-rw-r--r--base/gxmclip.h2
-rw-r--r--base/gxobj.h2
-rw-r--r--base/gxoprect.c2
-rw-r--r--base/gxoprect.h2
-rw-r--r--base/gxp1fill.c2
-rw-r--r--base/gxp1impl.h2
-rw-r--r--base/gxpaint.c22
-rw-r--r--base/gxpaint.h2
-rw-r--r--base/gxpath.c2
-rw-r--r--base/gxpath.h12
-rw-r--r--base/gxpath2.c2
-rw-r--r--base/gxpcache.h2
-rw-r--r--base/gxpcmap.c4
-rw-r--r--base/gxpcolor.h2
-rw-r--r--base/gxpcopy.c6
-rw-r--r--base/gxpdash.c2
-rw-r--r--base/gxpflat.c2
-rw-r--r--base/gxrplane.h2
-rw-r--r--base/gxsample.c2
-rw-r--r--base/gxsample.h2
-rw-r--r--base/gxsamplp.h2
-rw-r--r--base/gxscanc.c18
-rw-r--r--base/gxscanc.h2
-rw-r--r--base/gxshade.c2
-rw-r--r--base/gxshade.h2
-rw-r--r--base/gxshade1.c6
-rw-r--r--base/gxshade4.c2
-rw-r--r--base/gxshade4.h2
-rw-r--r--base/gxshade6.c15
-rw-r--r--base/gxstate.h2
-rw-r--r--base/gxstdio.h2
-rw-r--r--base/gxstroke.c2
-rw-r--r--base/gxsync.c2
-rw-r--r--base/gxsync.h2
-rw-r--r--base/gxtext.h5
-rw-r--r--base/gxtmap.h2
-rw-r--r--base/gxttf.h2
-rw-r--r--base/gxttfb.c2
-rw-r--r--base/gxttfb.h2
-rw-r--r--base/gxtype1.c2
-rw-r--r--base/gxtype1.h2
-rw-r--r--base/gxxfont.h2
-rw-r--r--base/gzacpath.h2
-rw-r--r--base/gzcpath.h2
-rw-r--r--base/gzht.h2
-rw-r--r--base/gzline.h2
-rw-r--r--base/gzpath.h2
-rw-r--r--base/gzspotan.c2
-rw-r--r--base/gzspotan.h2
-rw-r--r--base/gzstate.h2
-rw-r--r--base/icc34.h192
-rw-r--r--base/ijs.mak6
-rwxr-xr-xbase/instcopy2
-rw-r--r--base/jbig2.mak8
-rw-r--r--base/jerror_.h2
-rw-r--r--base/jmemcust.c2
-rw-r--r--base/jmemcust.h2
-rw-r--r--base/jpeg.mak6
-rw-r--r--base/jpegxr.mak4
-rw-r--r--base/lcms2.mak2
-rw-r--r--base/lcms2mt.mak2
-rw-r--r--base/lcups.mak12
-rw-r--r--base/lcupsi.mak36
-rw-r--r--base/ldf_jb2.mak497
-rw-r--r--base/leptonica.mak4
-rw-r--r--base/lib.mak161
-rw-r--r--base/locale_.h2
-rw-r--r--base/lwf_jp2.mak397
-rw-r--r--base/malloc_.h2
-rw-r--r--base/math_.h2
-rw-r--r--base/memento.c497
-rw-r--r--base/memento.h38
-rw-r--r--base/memory_.h2
-rw-r--r--base/mkromfs.c51
-rw-r--r--base/msvccmd.mak12
-rw-r--r--base/msvclib.mak125
-rw-r--r--base/msvctail.mak2
-rw-r--r--base/ocr.mak4
-rw-r--r--base/openjpeg.mak8
-rw-r--r--base/openvms.mak2
-rw-r--r--base/openvms.mmk2
-rw-r--r--base/pack_ps.c4
-rw-r--r--base/pcwin.mak2
-rw-r--r--base/pipe_.h2
-rw-r--r--base/png.mak4
-rw-r--r--base/png_.h2
-rw-r--r--base/ramfs.c2
-rw-r--r--base/ramfs.h2
-rw-r--r--base/sa85d.c8
-rw-r--r--base/sa85d.h2
-rw-r--r--base/sa85x.h2
-rw-r--r--base/saes.c2
-rw-r--r--base/saes.h2
-rw-r--r--base/sarc4.c2
-rw-r--r--base/sarc4.h2
-rw-r--r--base/sbcp.c2
-rw-r--r--base/sbcp.h2
-rw-r--r--base/sbtx.h2
-rw-r--r--base/scanchar.h2
-rw-r--r--base/scantab.c2
-rw-r--r--base/scf.h2
-rw-r--r--base/scfd.c615
-rw-r--r--base/scfdgen.c2
-rw-r--r--base/scfdtab.c2
-rw-r--r--base/scfe.c2
-rw-r--r--base/scfetab.c2
-rw-r--r--base/scfparam.c2
-rw-r--r--base/scfx.h2
-rw-r--r--base/scommon.h39
-rw-r--r--base/sdcparam.c2
-rw-r--r--base/sdcparam.h2
-rw-r--r--base/sdct.h2
-rw-r--r--base/sdctc.c6
-rw-r--r--base/sdctd.c48
-rw-r--r--base/sdcte.c10
-rw-r--r--base/sddparam.c2
-rw-r--r--base/sdeparam.c2
-rw-r--r--base/seexec.c2
-rw-r--r--base/setjmp_.h2
-rw-r--r--base/sfilter.h2
-rw-r--r--base/sfilter1.c2
-rw-r--r--base/sfilter2.c167
-rw-r--r--base/sfxboth.c2
-rw-r--r--base/sfxcommon.c2
-rw-r--r--base/sfxfd.c2
-rw-r--r--base/sfxstdio.c2
-rw-r--r--base/shc.c2
-rw-r--r--base/shc.h2
-rw-r--r--base/sidscale.c12
-rw-r--r--base/sidscale.h2
-rw-r--r--base/siinterp.c2
-rw-r--r--base/siinterp.h2
-rw-r--r--base/simscale.c2
-rw-r--r--base/simscale.h2
-rw-r--r--base/simscale_foo.c4
-rw-r--r--base/simscale_foo.h2
-rw-r--r--base/siscale.c8
-rw-r--r--base/siscale.h2
-rw-r--r--base/siscale_cal.c2
-rw-r--r--base/sisparam.h2
-rw-r--r--base/sjbig2.c2
-rw-r--r--base/sjbig2.h2
-rw-r--r--base/sjbig2_luratech.c627
-rw-r--r--base/sjbig2_luratech.h87
-rw-r--r--base/sjpeg.h2
-rw-r--r--base/sjpegc.c6
-rw-r--r--base/sjpegd.c4
-rw-r--r--base/sjpege.c2
-rw-r--r--base/sjpx_luratech.c1096
-rw-r--r--base/sjpx_luratech.h103
-rw-r--r--base/sjpx_none.c2
-rw-r--r--base/sjpx_openjpeg.c58
-rw-r--r--base/sjpx_openjpeg.h4
-rw-r--r--base/slzwc.c2
-rw-r--r--base/slzwd.c392
-rw-r--r--base/slzwe.c2
-rw-r--r--base/slzwx.h2
-rw-r--r--base/smd5.c2
-rw-r--r--base/smd5.h2
-rw-r--r--base/smtf.h2
-rw-r--r--base/spdiff.c2
-rw-r--r--base/spdiffx.h2
-rw-r--r--base/spngp.c2
-rw-r--r--base/spngpx.h2
-rw-r--r--base/spprint.c2
-rw-r--r--base/spprint.h2
-rw-r--r--base/spsdf.c10
-rw-r--r--base/spsdf.h2
-rw-r--r--base/spwgd.c2
-rw-r--r--base/spwgx.h2
-rw-r--r--base/srdline.h2
-rw-r--r--base/srld.c2
-rw-r--r--base/srle.c2
-rw-r--r--base/srlx.h2
-rw-r--r--base/ssha2.c2
-rw-r--r--base/ssha2.h2
-rw-r--r--base/sstring.c145
-rw-r--r--base/sstring.h2
-rw-r--r--base/stat_.h2
-rw-r--r--base/std.h2
-rw-r--r--base/stdint_.h2
-rw-r--r--base/stdio_.h2
-rw-r--r--base/stdpre.h2
-rw-r--r--base/stream.c11
-rw-r--r--base/stream.h2
-rw-r--r--base/strimpl.h2
-rw-r--r--base/string_.h2
-rw-r--r--base/strmio.c2
-rw-r--r--base/strmio.h2
-rw-r--r--base/stub.mak2
-rw-r--r--base/szlibc.c2
-rw-r--r--base/szlibd.c2
-rw-r--r--base/szlibe.c2
-rw-r--r--base/szlibx.h2
-rw-r--r--base/szlibxx.h2
-rw-r--r--base/tesseract.mak28
-rw-r--r--base/tessocr.cpp394
-rw-r--r--base/tessocr.h70
-rw-r--r--base/tiff.mak8
-rw-r--r--base/time_.h2
-rw-r--r--base/ttcalc.c2
-rw-r--r--base/ttcalc.h2
-rw-r--r--base/ttcommon.h2
-rw-r--r--base/ttconf.h2
-rw-r--r--base/ttconfig.h2
-rw-r--r--base/ttfinp.c2
-rw-r--r--base/ttfinp.h2
-rw-r--r--base/ttfmain.c2
-rw-r--r--base/ttfmemd.c2
-rw-r--r--base/ttfmemd.h2
-rw-r--r--base/ttfoutl.h2
-rw-r--r--base/ttfsfnt.h2
-rw-r--r--base/ttinterp.c2
-rw-r--r--base/ttinterp.h2
-rw-r--r--base/ttload.c2
-rw-r--r--base/ttload.h2
-rw-r--r--base/ttmisc.h2
-rw-r--r--base/ttobjs.c2
-rw-r--r--base/ttobjs.h2
-rw-r--r--base/tttables.h2
-rw-r--r--base/tttype.h2
-rw-r--r--base/tttypes.h2
-rw-r--r--base/ugcclib.mak2
-rw-r--r--base/unistd_.h2
-rw-r--r--base/unix-aux.mak2
-rw-r--r--base/unix-dll.mak72
-rw-r--r--base/unix-end.mak2
-rw-r--r--base/unix-gcc.mak21
-rw-r--r--base/unixansi.mak2
-rw-r--r--base/unixhead.mak2
-rw-r--r--base/unixinst.mak6
-rw-r--r--base/unixlink.mak2
-rw-r--r--base/valgrind.h2
-rw-r--r--base/version.mak8
-rw-r--r--base/vms_x_fix.h2
-rw-r--r--base/vmsmath.h2
-rw-r--r--base/windows_.h2
-rw-r--r--base/winlib.mak11
-rw-r--r--base/winplat.mak4
-rw-r--r--base/winrtsup.cpp2
-rw-r--r--base/winrtsup.h2
-rw-r--r--base/wrfont.c2
-rw-r--r--base/wrfont.h2
-rw-r--r--base/write_t1.c2
-rw-r--r--base/write_t1.h2
-rw-r--r--base/write_t2.c20
-rw-r--r--base/write_t2.h2
-rw-r--r--base/x_.h2
-rw-r--r--base/zlib.mak7
801 files changed, 9737 insertions, 8638 deletions
diff --git a/base/all-arch.mak b/base/all-arch.mak
index cb9b56b5..14f36a16 100644
--- a/base/all-arch.mak
+++ b/base/all-arch.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -44,7 +44,7 @@
# Usage:
# make <arch-name> TARGETS='...'
#
-# or, for convenience at Utah,
+# or, for convenience at Utah,
#
# make `hostname`
#
@@ -665,7 +665,7 @@ sgi-mips-irix6.1: init
XINCLUDE=-I/usr/include/X11 \
XLIBDIRS='-L/usr/local/lib -L/usr/lib/X11'
-#
+#
sgi-mips-irix6.3: init
$(MAKE) $(ARGS) \
CC='cc $(SGIARCHFLAGS) -D_POSIX_4SOURCE ' \
diff --git a/base/assert_.h b/base/assert_.h
index 6be404ed..878c55b1 100644
--- a/base/assert_.h
+++ b/base/assert_.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/bench.c b/base/bench.c
index 6ff8aca9..4ea338c2 100644
--- a/base/bench.c
+++ b/base/bench.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/bobbin.c b/base/bobbin.c
index 63720f3e..8ab76a23 100644
--- a/base/bobbin.c
+++ b/base/bobbin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2016-2020 Artifex Software, Inc.
+/* Copyright (C) 2016-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -298,7 +298,7 @@ static int Bobbin_thread(void *thread)
int i;
for (i = 0; i < bobbins.num_threads; i++)
- if (BOBBIN_THREAD_EQUAL(bobbins.thread[i].thread, thread) &&
+ if (BOBBIN_THREAD_EQUAL(bobbins.thread[i].thread, thread) &&
(bobbins.thread[i].flags & BOBBIN_THREAD_FINISHED) == 0)
break;
if (i == bobbins.num_threads)
diff --git a/base/bobbin.h b/base/bobbin.h
index 04c6d9aa..f34578fd 100644
--- a/base/bobbin.h
+++ b/base/bobbin.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2016-2020 Artifex Software, Inc.
+/* Copyright (C) 2016-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/cal.mak b/base/cal.mak
index 8a718a29..606c2f2b 100644
--- a/base/cal.mak
+++ b/base/cal.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2019 Artifex Software, Inc.
+# Copyright (C) 2019-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -82,7 +82,7 @@ $(GLOBJ)cal.dev : $(ECHOGS_XE) $(cal_OBJS) \
$(SETMOD) $(GLOBJ)cal $(cal_OBJS)
# define our specific compiler
-CAL_CC=$(CC) $(CFLAGS) $(CAL_CFLAGS) $(I_)$(CAL_GEN)$(_I) $(I_)$(CAL_SRC)$(_I)
+CAL_CC=$(CC) $(CCFLAGS) $(CAL_CFLAGS) $(I_)$(CAL_GEN)$(_I) $(I_)$(CAL_SRC)$(_I)
CAL_O=$(O_)$(CAL_OBJ)$(CAL_PREFIX)
CAL_DEP=$(AK) $(CAL_MAK) $(MAKEDIRS)
diff --git a/base/claptrap-impl.h b/base/claptrap-impl.h
index f758d5e0..3ebff10a 100644
--- a/base/claptrap-impl.h
+++ b/base/claptrap-impl.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/claptrap-init.c b/base/claptrap-init.c
index 3e20d3ed..85b88a23 100644
--- a/base/claptrap-init.c
+++ b/base/claptrap-init.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2018 Artifex Software, Inc.
+/* Copyright (C) 2015-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/claptrap-planar.c b/base/claptrap-planar.c
index e77233ae..9c6358b4 100644
--- a/base/claptrap-planar.c
+++ b/base/claptrap-planar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2018 Artifex Software, Inc.
+/* Copyright (C) 2015-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/claptrap.c b/base/claptrap.c
index 5829f09e..23a76ea6 100644
--- a/base/claptrap.c
+++ b/base/claptrap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2020 Artifex Software, Inc.
+/* Copyright (C) 2015-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/claptrap.h b/base/claptrap.h
index 2b28c04f..c9ddf9d8 100644
--- a/base/claptrap.h
+++ b/base/claptrap.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2020 Artifex Software, Inc.
+/* Copyright (C) 2015-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ctype_.h b/base/ctype_.h
index 32e8f9a6..416c0e8b 100644
--- a/base/ctype_.h
+++ b/base/ctype_.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/dirent_.h b/base/dirent_.h
index 6eae53d2..618e8455 100644
--- a/base/dirent_.h
+++ b/base/dirent_.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/dos_.h b/base/dos_.h
index 29f92aa5..dff1bdb5 100644
--- a/base/dos_.h
+++ b/base/dos_.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/echogs.c b/base/echogs.c
index b8e93d9f..2b58e754 100644
--- a/base/echogs.c
+++ b/base/echogs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/errno_.h b/base/errno_.h
index 5f05c616..c1b22dcb 100644
--- a/base/errno_.h
+++ b/base/errno_.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ets.c b/base/ets.c
index 2b6a073f..f24d118f 100644
--- a/base/ets.c
+++ b/base/ets.c
@@ -10,7 +10,7 @@
* agreement between artofcode LLC and the licensee. Please see
* http://www.artofcode.com/eventone/ for information on licensing.
*
- * Subsequent Changes: Copyright (C) 2013-2020 Artifex Software, Inc.
+ * Subsequent Changes: Copyright (C) 2013-2021 Artifex Software, Inc.
*
* All Rights Reserved.
*
@@ -844,7 +844,7 @@ ets_plane_new(void *malloc_arg, const ETS_Params *params, ETS_Ctx *etc, int plan
{
result->line[i].a = 1;
result->line[i].b = 1;
- /* Initialize error with a non zero random value to ensure dots don't
+ /* Initialize error with a non zero random value to ensure dots don't
land on dots when we have same planes with same gray level and
the plane interaction option is turned off. Ideally the level
of this error should be based upon the values of the first line
@@ -877,7 +877,7 @@ ets_destroy(void *malloc_arg, ETS_Ctx *ctx)
{
int i;
int n_planes;
-
+
if (ctx == NULL)
return;
diff --git a/base/ets.h b/base/ets.h
index a57bef52..29530442 100644
--- a/base/ets.h
+++ b/base/ets.h
@@ -10,7 +10,7 @@
* agreement between artofcode LLC and the licensee. Please see
* http://www.artofcode.com/eventone/ for information on licensing.
*
- * Subsequent Changes: Copyright (C) 2013-2020 Artifex Software, Inc.
+ * Subsequent Changes: Copyright (C) 2013-2021 Artifex Software, Inc.
*
* All Rights Reserved.
*
@@ -57,7 +57,7 @@ extern "C" {
#define ETS_SRC_MAX 65535
#endif
-/* Photoshop (and possibly other image formats define white in a CMYK image with a
+/* Photoshop (and possibly other image formats define white in a CMYK image with a
value of 255 (65535). This is opposite of the PAM files that Robin has created.
The ETS code expects white to be at 0. Adjustments to the values in gray level
will be baked into the LUT if needed */
diff --git a/base/ets_tm.h b/base/ets_tm.h
index 5decb9c3..61318977 100644
--- a/base/ets_tm.h
+++ b/base/ets_tm.h
@@ -10,7 +10,7 @@
* agreement between artofcode LLC and the licensee. Please see
* http://www.artofcode.com/eventone/ for information on licensing.
*
- * Subsequent Changes: Copyright (C) 2013-2020 Artifex Software, Inc.
+ * Subsequent Changes: Copyright (C) 2013-2021 Artifex Software, Inc.
*
* All Rights Reserved.
*
diff --git a/base/expat.mak b/base/expat.mak
index 08db2a1d..43da830f 100644
--- a/base/expat.mak
+++ b/base/expat.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -31,8 +31,8 @@ EXPATGEN=$(EXPATGENDIR)$(D)
EXPATOBJ=$(EXPATOBJDIR)$(D)
EXPATO_=$(O_)$(EXPATOBJ)
-EXPATCC=$(CC) $(CFLAGS) $(I_)$(EXPATSRC)lib$(_I) \
-$(D_)XML_POOR_ENTROPY$(_D) $(EXPAT_CFLAGS)
+EXPATCC=$(CC) $(I_)$(EXPATSRC)lib$(_I) \
+$(D_)XML_POOR_ENTROPY$(_D) $(EXPAT_CFLAGS) $(CCFLAGS)
expat.clean : expat.config-clean expat.clean-not-config-clean
diff --git a/base/fapi_bs.mak b/base/fapi_bs.mak
index 894bcb82..7487ad38 100644
--- a/base/fapi_bs.mak
+++ b/base/fapi_bs.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -37,11 +37,11 @@ $(GLD)fapib1.dev : $(FAPI_BS_MAK) $(ECHOGS_XE) \
$(GLOBJ)glyph.$(OBJ) $(GLOBJ)t1.$(OBJ) $(GLOBJ)t2kstrm.$(OBJ) $(GLOBJ)truetype.$(OBJ)\
$(GLOBJ)util.$(OBJ) $(GLOBJ)fnt.$(OBJ) $(GLOBJ)pclread.$(OBJ) $(GLOBJ)t2ksc.$(OBJ)\
$(GLOBJ)write_t1.$(OBJ) $(GLOBJ)write_t2.$(OBJ) $(GLOBJ)wrfont.$(OBJ) $(MAKEDIRS)
- $(SETMOD) $(GLD)fapib1 $(GLOBJ)fapibstm.$(OBJ)
+ $(SETMOD) $(GLD)fapib1 $(GLOBJ)fapibstm.$(OBJ)
$(ADDMOD) $(GLD)fapib1 $(GLOBJ)t2k.$(OBJ) $(GLOBJ)t2kextra.$(OBJ) $(GLOBJ)fnt.$(OBJ)
$(ADDMOD) $(GLD)fapib1 $(GLOBJ)tsimem.$(OBJ) $(GLOBJ)t2ktt.$(OBJ) $(GLOBJ)util.$(OBJ)
$(ADDMOD) $(GLD)fapib1 $(GLOBJ)t2kstrm.$(OBJ) $(GLOBJ)truetype.$(OBJ) $(GLOBJ)cstream.$(OBJ)
- $(ADDMOD) $(GLD)fapib1 $(GLOBJ)fft1hint.$(OBJ) $(GLOBJ)ghints.$(OBJ) $(GLOBJ)glyph.$(OBJ)
+ $(ADDMOD) $(GLD)fapib1 $(GLOBJ)fft1hint.$(OBJ) $(GLOBJ)ghints.$(OBJ) $(GLOBJ)glyph.$(OBJ)
$(ADDMOD) $(GLD)fapib1 $(GLOBJ)t1.$(OBJ) $(GLOBJ)pclread.$(OBJ) $(GLOBJ)t2ksc.$(OBJ)
$(ADDMOD) $(GLD)fapib1 $(GLOBJ)write_t1.$(OBJ) $(GLOBJ)write_t2.$(OBJ) $(GLOBJ)wrfont.$(OBJ)
$(ADDMOD) $(GLD)fapib1 -plugin fapibstm
diff --git a/base/fapi_ft.c b/base/fapi_ft.c
index 46f865ef..e4d935d9 100644
--- a/base/fapi_ft.c
+++ b/base/fapi_ft.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -125,7 +125,7 @@ static void
delete_inc_int_info(gs_fapi_server * a_server,
FT_IncrementalRec * a_inc_int_info);
-FT_CALLBACK_DEF(void *)
+static void *
FF_alloc(FT_Memory memory, long size)
{
gs_memory_t *mem = (gs_memory_t *) memory->user;
@@ -133,7 +133,7 @@ FF_alloc(FT_Memory memory, long size)
return (gs_malloc(mem, size, 1, "FF_alloc"));
}
-FT_CALLBACK_DEF(void *)
+static void *
FF_realloc(FT_Memory memory, long cur_size, long new_size, void *block)
{
gs_memory_t *mem = (gs_memory_t *) memory->user;
@@ -153,7 +153,7 @@ FT_CALLBACK_DEF(void *)
return (tmp);
}
-FT_CALLBACK_DEF(void)
+static void
FF_free(FT_Memory memory, void *block)
{
gs_memory_t *mem = (gs_memory_t *) memory->user;
@@ -621,23 +621,34 @@ load_glyph(gs_fapi_server * a_server, gs_fapi_font * a_fapi_font,
face->ft_inc_int->object->fapi_font = a_fapi_font;
/* Store the overriding metrics if they have been supplied. */
- if (face->ft_inc_int
- && a_char_ref->metrics_type != gs_fapi_metrics_notdef) {
+ if (face->ft_inc_int && a_char_ref->metrics_type != gs_fapi_metrics_notdef) {
+
+ FT_Incremental_MetricsRec *m = &face->ft_inc_int->object->glyph_metrics;
- FT_Incremental_MetricsRec *m =
- &face->ft_inc_int->object->glyph_metrics;
m->bearing_x = a_char_ref->sb_x >> 16;
m->bearing_y = a_char_ref->sb_y >> 16;
m->advance = a_char_ref->aw_x >> 16;
+
face->ft_inc_int->object->glyph_metrics_index = index;
- face->ft_inc_int->object->metrics_type = a_char_ref->metrics_type;
- /* we only want this for fonts with TT outlines */
- if (!a_fapi_font->is_type1) {
- delta.y = 0;
- delta.x = FT_MulFix(a_char_ref->sb_x, ft_face->size->metrics.x_scale);
- FT_Vector_Transform( &delta, &face->ft_transform);
- }
+ /* For most font types, the original metrics come directly from the font, and
+ what we have here are customized (such as a Matrics dict in Postscript). We
+ only want to use the width, in that case, because other metrics can mess up
+ the hinting in Freetype. We'll apply custom lsb outselves, using the "delta"
+ stuff below.
+ The exception here is PCL/XL embedded TTF fonts, where the h/vmtx tables can
+ be missing, and we *have* to use the explicit metrics from the PCL/XL glyph
+ data. (NOTE: if those do not match the original font's metrics, again, the hinting
+ can be distorted)
+ */
+ if (a_char_ref->metrics_type == gs_fapi_metrics_replace && !a_fapi_font->is_mtx_skipped)
+ face->ft_inc_int->object->metrics_type = gs_fapi_metrics_replace_width;
+ else
+ face->ft_inc_int->object->metrics_type = a_char_ref->metrics_type;
+
+ delta.x = FT_MulFix(a_char_ref->sb_x >> 16, ft_face->size->metrics.x_scale);
+ delta.y = FT_MulFix(a_char_ref->sb_y >> 16, ft_face->size->metrics.y_scale);
+ FT_Vector_Transform( &delta, &face->ft_transform);
}
else if (face->ft_inc_int)
/* Make sure we don't leave this set to the last value, as we may then use inappropriate metrics values */
@@ -699,10 +710,10 @@ load_glyph(gs_fapi_server * a_server, gs_fapi_font * a_fapi_font,
/* If FT gives us an error, try to fall back to the notdef - if that doesn't work, we'll throw an error over to Ghostscript */
if (ft_error) {
gs_string notdef_str;
-
+
notdef_str.data = (byte *)".notdef";
notdef_str.size = 7;
-
+
a_fapi_font->char_data = (void *)(&notdef_str);
a_fapi_font->char_data_len = 0;
@@ -719,7 +730,7 @@ load_glyph(gs_fapi_server * a_server, gs_fapi_font * a_fapi_font,
}
if ((!ft_error || !ft_error_fb) && (delta.x != 0 || delta.y != 0)) {
- FT_Outline_Translate( &ft_face->glyph->outline, delta.x >> 16, delta.y >> 16 );
+ FT_Outline_Translate( &ft_face->glyph->outline, delta.x, delta.y);
}
/* Previously we interpreted the glyph unscaled, and derived the metrics from that. Now we only interpret it
@@ -735,10 +746,10 @@ load_glyph(gs_fapi_server * a_server, gs_fapi_font * a_fapi_font,
*/
hx = (FT_Long) (((double)ft_face->glyph->metrics.horiBearingX *
ft_face->units_per_EM * 72.0) /
- ((double)face->width * face->horz_res));
+ ((double)face->width * face->horz_res)) + (a_fapi_font->is_mtx_skipped == 1 ? 0 : a_char_ref->sb_x >> 16);
hy = (FT_Long) (((double)ft_face->glyph->metrics.horiBearingY *
ft_face->units_per_EM * 72.0) /
- ((double)face->height * face->vert_res));
+ ((double)face->height * face->vert_res)) + (a_fapi_font->is_mtx_skipped == 1 ? 0 : a_char_ref->sb_y >> 16);
w = (FT_Long) (((double)ft_face->glyph->metrics.width *
ft_face->units_per_EM * 72.0) / ((double)face->width *
@@ -1365,7 +1376,7 @@ gs_fapi_ft_get_scaled_font(gs_fapi_server * a_server, gs_fapi_font * a_font,
*/
FT_Set_Transform(face->ft_face, &face->ft_transform, NULL);
-
+
if (!a_font->is_type1) {
for (i = 0; i < GS_FAPI_NUM_TTF_CMAP_REQ && !cmap; i++) {
if (a_font->ttf_cmap_req[i].platform_id > 0) {
@@ -1817,7 +1828,7 @@ gs_fapi_ft_set_mm_weight_vector(gs_fapi_server *server, gs_fapi_font *ff, float
setit = true;
}
}
-
+
if (setit == true) {
ft_error = FT_Set_MM_WeightVector(face->ft_face, length, nwv);
if (ft_error != 0) return_error(gs_error_invalidaccess);
diff --git a/base/fapibstm.c b/base/fapibstm.c
index 0eb120c2..978dd754 100644
--- a/base/fapibstm.c
+++ b/base/fapibstm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -326,7 +326,7 @@ gs_fapi_bstm_set_mm_weight_vector(gs_fapi_server *server, gs_fapi_font *ff, floa
(void)ff;
(void)wvector;
(void)length;
-
+
return gs_error_invalidaccess;
}
diff --git a/base/fapiufst.c b/base/fapiufst.c
index 4089e905..628d54c0 100644
--- a/base/fapiufst.c
+++ b/base/fapiufst.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -1805,7 +1805,7 @@ get_char(gs_fapi_server *server, gs_fapi_font *ff, gs_fapi_char_ref *c,
*/
code = CGIFFwidth2(FSA &glyph_width_code, 1, sizeof(glyph_width), glyph_width);
}
-
+
if (code >= 0) {
code = CGIFchar_handle(FSA cc, &result, (SW16) 0);
}
@@ -1816,7 +1816,7 @@ get_char(gs_fapi_server *server, gs_fapi_font *ff, gs_fapi_char_ref *c,
if (code == ERR_TT_UNDEFINED_INSTRUCTION
#if UFST_VERSION_MAJOR >= 6
|| (code >= ERR_TT_NULL_FUNCDEF && code <= ERR_TT_STACK_OUT_OF_RANGE)
-#endif
+#endif
) {
int savehint = FC_DONTHINTTT(fc);
@@ -1861,7 +1861,7 @@ get_char(gs_fapi_server *server, gs_fapi_font *ff, gs_fapi_char_ref *c,
code2 = CGIFchar_handle(FSA c1, &result, (SW16) 0);
if (code2 && code2 != ERR_fixed_space && code2 != ERR_bm_buff
&& code2 != ERR_bm_too_big) {
-
+
notdef_str.data = (byte *)space;
notdef_str.size = strlen(space);
ff->char_data = (void *)&notdef_str;
@@ -1911,7 +1911,7 @@ get_char(gs_fapi_server *server, gs_fapi_font *ff, gs_fapi_char_ref *c,
design_bbox[1] = pbm->top_indent;
design_bbox[2] = pbm->black_width;
design_bbox[3] = pbm->black_depth;
-
+
if (ff->is_vertical) {
/* FIXME: this probably isn't need - we can probably just use glyph_width */
if (pIFS->glyphMetricsDU.aw.x == 0 && pIFS->glyphMetricsDU.aw.y == 0) {
@@ -1958,13 +1958,13 @@ get_char(gs_fapi_server *server, gs_fapi_font *ff, gs_fapi_char_ref *c,
design_bbox[1] = pol->bottom;
design_bbox[2] = pol->right;
design_bbox[3] = pol->top;
-
+
r->char_data = (IFOUTLINE *) result;
}
else {
design_escapement[0] = glyph_width[0];
design_escapement[1] = glyph_width[1];
-
+
design_bbox[0] = design_bbox[1] = design_bbox[2] = design_bbox[3] = 0;
}
#if 1 /* UFST 5.0 */
@@ -2224,7 +2224,7 @@ gs_fapi_ufst_set_mm_weight_vector(gs_fapi_server *server, gs_fapi_font *ff, floa
(void)ff;
(void)wvector;
(void)length;
-
+
return gs_error_invalidaccess;
}
diff --git a/base/fcntl_.h b/base/fcntl_.h
index fc2cdb46..aa2ed334 100644
--- a/base/fcntl_.h
+++ b/base/fcntl_.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/freetype.mak b/base/freetype.mak
index ec85b5ce..41a6a949 100644
--- a/base/freetype.mak
+++ b/base/freetype.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -22,6 +22,7 @@
# FT_CFLAGS - The include options for the freetype library
# SHARE_FT - 0 to compile in freetype, 1 to link a shared library
# FT_LIBS - if SHARE_FT=1, the link options for the shared library
+# FT_LIB_PATH - if SHARE_FT=1, the path(s) for the shared library
# (Rename directories.)
FTSRC=$(FTSRCDIR)$(D)src$(D)
@@ -33,7 +34,9 @@ FTO_=$(O_)$(FTOBJ)
# we must define FT2_BUILD_LIBRARY to get internal declarations
# If GS is using the system zlib, freetype should also do so,
# FT_CONFIG_SYSTEM_ZLIB is set by the top makefile.
-FTCC=$(CC_) $(I_)$(FTGEN)$(_I) $(I_)$(FTSRCDIR)$(D)include$(_I) $(D_)FT_CONFIG_OPTIONS_H=\"$(FTCONFH)\"$(_D) $(D_)FT2_BUILD_LIBRARY$(_D) $(D_)DARWIN_NO_CARBON$(_D) $(FT_CONFIG_SYSTEM_ZLIB)
+FTCC=$(CC) $(I_)$(FTGEN)$(_I) $(I_)$(FTSRCDIR)$(D)include$(_I) \
+ $(D_)FT_CONFIG_OPTIONS_H=\"$(FTCONFH)\"$(_D) $(D_)FT2_BUILD_LIBRARY$(_D) \
+ $(D_)DARWIN_NO_CARBON$(_D) $(FT_CONFIG_SYSTEM_ZLIB) $(CCFLAGS)
# Define the name of this makefile.
FT_MAK=$(GLSRC)freetype.mak $(TOP_MAKEFILES)
@@ -213,7 +216,8 @@ $(FTGEN)freetype.dev : $(FTGEN)freetype_$(SHARE_FT).dev $(FT_MAK) $(GENFTCONFH)
# Define the shared version.
$(FTGEN)freetype_1.dev : $(TOP_MAKEFILES) $(FT_MAK) $(ECHOGS_XE) $(FT_MAK) $(GENFTCONFH) $(MAKEDIRS)
- $(SETMOD) $(FTGEN)freetype_1 -link $(FT_LIBS)
+ $(SETMOD) $(FTGEN)freetype_1 -lib $(FT_LIBS)
+ $(ADDMOD) $(FTGEN)freetype_1 -libpath $(FT_LIB_PATH)
# Define the non-shared version.
$(FTGEN)freetype_0.dev : $(FT_MAK) $(ECHOGS_XE) \
diff --git a/base/gconf.c b/base/gconf.c
index 68aecb75..38e0f258 100644
--- a/base/gconf.c
+++ b/base/gconf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gconf.h b/base/gconf.h
index 1dcfa6c2..cc42ba3a 100644
--- a/base/gconf.h
+++ b/base/gconf.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdbflags.h b/base/gdbflags.h
index c7d3fe91..073ca73f 100644
--- a/base/gdbflags.h
+++ b/base/gdbflags.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdebug.h b/base/gdebug.h
index 8fa4cca0..8d663331 100644
--- a/base/gdebug.h
+++ b/base/gdebug.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevabuf.c b/base/gdevabuf.c
index e937299d..1f7c3902 100644
--- a/base/gdevabuf.c
+++ b/base/gdevabuf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevbbox.c b/base/gdevbbox.c
index 20f80d3a..542124a9 100644
--- a/base/gdevbbox.c
+++ b/base/gdevbbox.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -497,7 +497,7 @@ bbox_strip_tile_rectangle(gx_device * dev, const gx_strip_bitmap * tiles,
static int
bbox_strip_tile_rect_devn(gx_device * dev, const gx_strip_bitmap * tiles,
- int x, int y, int w, int h, const gx_drawing_color *pdcolor0,
+ int x, int y, int w, int h, const gx_drawing_color *pdcolor0,
const gx_drawing_color *pdcolor1, int px, int py)
{
gx_device_bbox *const bdev = (gx_device_bbox *) dev;
@@ -1245,7 +1245,7 @@ bbox_create_compositor(gx_device * dev,
(target, &temp_cdev, pcte, pgs, memory, cindev);
/* If the target did not create a new compositor then we are done. */
- if (code < 0 || target == temp_cdev) {
+ if (code <= 0) {
*pcdev = dev;
return code;
}
@@ -1261,7 +1261,9 @@ bbox_create_compositor(gx_device * dev,
bbcdev->box_procs = box_procs_forward;
bbcdev->box_proc_data = bdev;
*pcdev = (gx_device *) bbcdev;
- return 0;
+ /* We return 1 to indicate that a new compositor was created
+ * that wrapped dev. */
+ return 1;
}
}
diff --git a/base/gdevbbox.h b/base/gdevbbox.h
index 1abf2cf4..8cf89959 100644
--- a/base/gdevbbox.h
+++ b/base/gdevbbox.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevdbit.c b/base/gdevdbit.c
index fb9ff800..aba17446 100644
--- a/base/gdevdbit.c
+++ b/base/gdevdbit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -169,16 +169,16 @@ gx_no_copy_alpha(gx_device * dev, const byte * data, int data_x,
/* Currently we really should only be here if the target device is planar
AND it supports devn colors AND is 8 or 16 bit. For example tiffsep
- and psdcmyk may make use of this if AA is enabled. It is basically
- designed for devices that need more than 64 bits for color support
+ and psdcmyk may make use of this if AA is enabled. It is basically
+ designed for devices that need more than 64 bits for color support
- So that I can follow things and make it readable for future generations,
+ So that I can follow things and make it readable for future generations,
I am not using the macro nightmare that default_copy_alpha uses. */
int
gx_default_copy_alpha_hl_color(gx_device * dev, const byte * data, int data_x,
int raster, gx_bitmap_id id, int x, int y, int width, int height,
const gx_drawing_color *pdcolor, int depth)
-{
+{
const byte *row_alpha;
gs_memory_t *mem = dev->memory;
int bpp = dev->color_info.depth;
@@ -223,7 +223,7 @@ gx_default_copy_alpha_hl_color(gx_device * dev, const byte * data, int data_x,
| GB_ALIGN_STANDARD
| GB_OFFSET_0
| GB_RASTER_STANDARD
- | GB_SELECT_PLANES;
+ | GB_SELECT_PLANES;
gb_rect.p.x = x;
gb_rect.q.x = x + width;
for (ry = y; ry < y + height; row_alpha += raster, ++ry) {
@@ -234,13 +234,13 @@ gx_default_copy_alpha_hl_color(gx_device * dev, const byte * data, int data_x,
for (k = 0; k < ncomps; k++) {
/* First set the params to zero for all planes except the one we want */
/* I am not sure why get_bits_rectangle for the planar device can
- not hand back the data in a proper planar form. To get the
+ not hand back the data in a proper planar form. To get the
individual planes seems that I need to jump through some hoops
here */
- for (j = 0; j < ncomps; j++)
+ for (j = 0; j < ncomps; j++)
gb_params.data[j] = 0;
gb_params.data[k] = gb_buff + k * out_raster;
- code = dev_proc(dev, get_bits_rectangle) (dev, &gb_rect,
+ code = dev_proc(dev, get_bits_rectangle) (dev, &gb_rect,
&gb_params, 0);
src_planes[k] = gb_params.data[k];
if (code < 0) {
@@ -248,7 +248,7 @@ gx_default_copy_alpha_hl_color(gx_device * dev, const byte * data, int data_x,
return code;
}
}
- /* At this point we have to carry around some additional variables
+ /* At this point we have to carry around some additional variables
so that we can handle any buffer flushes due to alpha == 0 values.
See below why this is needed */
x_curr = x;
@@ -276,14 +276,14 @@ gx_default_copy_alpha_hl_color(gx_device * dev, const byte * data, int data_x,
if (alpha == 0) {
/* With alpha 0 we want to avoid writing out this value.
- * While it is true that writting it out leaves the color
- * unchanged, any device that's watching what pixels are
- * written (such as the pattern tile devices) may have problems.
- * As in gx_default_copy_alpha the right thing to do is to write
- * out what we have so far and then continue to collect when we
+ * While it is true that writting it out leaves the color
+ * unchanged, any device that's watching what pixels are
+ * written (such as the pattern tile devices) may have problems.
+ * As in gx_default_copy_alpha the right thing to do is to write
+ * out what we have so far and then continue to collect when we
* get back to non zero alpha. */
- code = dev_proc(dev, copy_planes)(dev, &(gb_buff[gb_buff_start]),
- 0, out_raster, gs_no_bitmap_id,
+ code = dev_proc(dev, copy_planes)(dev, &(gb_buff[gb_buff_start]),
+ 0, out_raster, gs_no_bitmap_id,
x_curr, ry, w_curr-1, 1, 1);
if (code < 0) {
gs_free_object(mem, gb_buff, "copy_alpha_hl_color");
@@ -303,7 +303,7 @@ gx_default_copy_alpha_hl_color(gx_device * dev, const byte * data, int data_x,
/* First get the old color */
for (k = 0; k < ncomps; k++) {
/* We only have 8 and 16 bit depth to worry about.
- However, this stuff should really be done with
+ However, this stuff should really be done with
the device encode/decode procedure. */
byte *ptr = ((src_planes[k]) + (sx - data_x) * word_width);
curr_cv[k] = 0;
@@ -316,13 +316,13 @@ gx_default_copy_alpha_hl_color(gx_device * dev, const byte * data, int data_x,
curr_cv[k] += *ptr;
curr_cv[k] += curr_cv[k] << 8;
}
- /* Now compute the new color which is a blend of
+ /* Now compute the new color which is a blend of
the old and the new */
blend_cv[k] = ((curr_cv[k]<<8) +
(((long) src_cv[k] - (long) curr_cv[k]) * alpha))>>8;
composite = &(blend_cv[0]);
}
- }
+ }
/* Update our plane data buffers. Just reuse the current one */
for (k = 0; k < ncomps; k++) {
byte *ptr = ((src_planes[k]) + (sx - data_x) * word_width);
@@ -335,10 +335,10 @@ gx_default_copy_alpha_hl_color(gx_device * dev, const byte * data, int data_x,
}
} /* else on alpha != 0 */
} /* loop on x */
- /* Flush what ever we have left. We may only have a partial due to
+ /* Flush what ever we have left. We may only have a partial due to
the presence of alpha = 0 values */
- code = dev_proc(dev, copy_planes)(dev, &(gb_buff[gb_buff_start]),
- 0, out_raster, gs_no_bitmap_id,
+ code = dev_proc(dev, copy_planes)(dev, &(gb_buff[gb_buff_start]),
+ 0, out_raster, gs_no_bitmap_id,
x_curr, ry, w_curr, 1, 1);
} /* loop on y */
gs_free_object(mem, gb_buff, "copy_alpha_hl_color");
@@ -596,15 +596,15 @@ gx_default_fill_mask(gx_device * orig_dev,
}
/* Default implementation of strip_tile_rect_devn. With the current design
- only devices that support devn color will be making use of this
+ only devices that support devn color will be making use of this
procedure and those are planar devices. So we have an implemenation
for planar devices and not a default implemenetation at this time. */
int
gx_default_strip_tile_rect_devn(gx_device * dev, const gx_strip_bitmap * tiles,
- int x, int y, int w, int h, const gx_drawing_color * pdcolor0,
+ int x, int y, int w, int h, const gx_drawing_color * pdcolor0,
const gx_drawing_color * pdcolor1, int px, int py)
{
- return_error(gs_error_unregistered);
+ return_error(gs_error_unregistered);
}
/* Default implementation of strip_tile_rectangle */
diff --git a/base/gdevdcrd.c b/base/gdevdcrd.c
index 299afc52..6086459f 100644
--- a/base/gdevdcrd.c
+++ b/base/gdevdcrd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevdcrd.h b/base/gdevdcrd.h
index 7ef729a2..fe387d72 100644
--- a/base/gdevdcrd.h
+++ b/base/gdevdcrd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevddrw.c b/base/gdevddrw.c
index 19089b88..4f91a02d 100644
--- a/base/gdevddrw.c
+++ b/base/gdevddrw.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevddrw.h b/base/gdevddrw.h
index dcf4468a..dc49513f 100644
--- a/base/gdevddrw.h
+++ b/base/gdevddrw.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevdevn.c b/base/gdevdevn.c
index 4cbf11b5..692edf76 100644
--- a/base/gdevdevn.c
+++ b/base/gdevdevn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevdevn.h b/base/gdevdevn.h
index fea7c3d7..fb34e1c0 100644
--- a/base/gdevdevn.h
+++ b/base/gdevdevn.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevdevnprn.h b/base/gdevdevnprn.h
index 6c3020e6..4d556b60 100644
--- a/base/gdevdevnprn.h
+++ b/base/gdevdevnprn.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevdflt.c b/base/gdevdflt.c
index 1d949080..4f92c7a2 100644
--- a/base/gdevdflt.c
+++ b/base/gdevdflt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -843,7 +843,7 @@ gx_upright_get_initial_matrix(gx_device * dev, register gs_matrix * pmat)
}
int
-gx_default_sync_output(gx_device * dev)
+gx_default_sync_output(gx_device * dev) /* lgtm [cpp/useless-expression] */
{
return 0;
}
@@ -1431,6 +1431,8 @@ int gx_device_subclass(gx_device *dev_to_subclass, gx_device *new_prototype, uns
rc_increment(dev_to_subclass->icc_struct);
if (dev_to_subclass->PageList)
rc_increment(dev_to_subclass->PageList);
+ if (dev_to_subclass->NupControl)
+ rc_increment(dev_to_subclass->NupControl);
/* In case the new device we're creating has already been initialised, copy
* its additional data.
@@ -1561,6 +1563,8 @@ int gx_device_unsubclass(gx_device *dev)
rc_decrement(child->icc_struct, "gx_unsubclass_device, icc_struct");
if (child->PageList)
rc_decrement(child->PageList, "gx_unsubclass_device, PageList");
+ if (child->NupControl)
+ rc_decrement(child->NupControl, "gx_unsubclass_device, NupControl");
/* we cannot afford to free the child device if its stype is not dynamic because
* we can't 'null' the finalise routine, and we cannot permit the device to be finalised
* because we have copied it up one level, not discarded it.
@@ -1692,6 +1696,10 @@ int gx_subclass_create_compositor(gx_device *dev, gx_device **pcdev, const gs_co
p14dev->target = subclass_device;
+ /* We return 0, rather than 1, as we have not created
+ * a new compositor that wraps dev. */
+ if (code == 1)
+ code = 0;
return code;
}
break;
diff --git a/base/gdevdgbr.c b/base/gdevdgbr.c
index 164124d7..d7b34b77 100644
--- a/base/gdevdgbr.c
+++ b/base/gdevdgbr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevdrop.c b/base/gdevdrop.c
index b22823a9..9186eea1 100644
--- a/base/gdevdrop.c
+++ b/base/gdevdrop.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevdsha.c b/base/gdevdsha.c
index 2111974d..646fd9bd 100644
--- a/base/gdevdsha.c
+++ b/base/gdevdsha.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -111,6 +111,11 @@ gx_hl_fill_linear_color_scanline(gx_device *dev, const gs_fill_attributes *fa,
for (k = 0; k < n; k++) {
devc.colors.devn.values[k] = frac312cv(curr[k]);
}
+ if (device_encodes_tags(dev)) {
+ devc.tag = (dev->graphics_type_tag & ~GS_DEVICE_ENCODES_TAGS);
+ } else {
+ devc.tag = 0;
+ }
code = dev_proc(dev, fill_rectangle_hl_color) (dev, &rect, NULL, &devc, NULL);
if (code < 0)
return code;
@@ -174,6 +179,11 @@ gx_hl_fill_linear_color_scanline(gx_device *dev, const gs_fill_attributes *fa,
for (k = 0; k < n; k++) {
devc.colors.devn.values[k] = frac312cv(curr[k]);
}
+ if (device_encodes_tags(dev)) {
+ devc.tag = (dev->graphics_type_tag & ~GS_DEVICE_ENCODES_TAGS);
+ } else {
+ devc.tag = 0;
+ }
return dev_proc(dev, fill_rectangle_hl_color) (dev, &rect, NULL, &devc, NULL);
}
return 0;
diff --git a/base/gdevemap.c b/base/gdevemap.c
index b307fb78..db2636ee 100644
--- a/base/gdevemap.c
+++ b/base/gdevemap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevepo.c b/base/gdevepo.c
index e3454273..7c9eb0b7 100644
--- a/base/gdevepo.c
+++ b/base/gdevepo.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -193,16 +193,23 @@ gx_device_epo gs_epo_device =
#undef MAX_COORD
#undef MAX_RESOLUTION
-static bool
-is_device_installed(gx_device *dev, const char *name)
+/* Starting at the top of the device chain (top parent) find */
+/* and return the epo device, or NULL if not found. */
+static gx_device *
+find_installed_epo_device(gx_device *dev)
{
- while (dev) {
- if (!strcmp(dev->dname, name)) {
- return true;
+ gx_device *next_dev = dev;
+
+ while (next_dev->parent != NULL)
+ next_dev = next_dev->parent;
+
+ while (next_dev) {
+ if (next_dev->procs.fillpage == epo_fillpage) {
+ return next_dev;
}
- dev = dev->child;
+ next_dev = next_dev->child;
}
- return false;
+ return NULL;
}
/* See if this is a device we can optimize
@@ -212,7 +219,12 @@ is_device_installed(gx_device *dev, const char *name)
static bool
device_wants_optimization(gx_device *dev)
{
- return (!gs_is_null_device(dev) && dev_proc(dev, fillpage) == gx_default_fillpage);
+ gx_device *terminal = dev;
+
+ while(terminal->child != NULL)
+ terminal = terminal->child;
+
+ return (!gs_is_null_device(terminal) && dev_proc(terminal, fillpage) == gx_default_fillpage);
}
/* Use this when debugging to enable/disable epo
@@ -228,33 +240,31 @@ int
epo_check_and_install(gx_device *dev)
{
int code = 0;
- bool is_installed;
+ gx_device *installed_epo_device = NULL;
bool can_optimize = false;
-
+
/* Debugging mode to totally disable this */
if (gs_debug_c(gs_debug_flag_epo_disable)) {
return code;
}
-
+
DPRINTF1(dev->memory, "current device is %s\n", dev->dname);
- is_installed = is_device_installed(dev, EPO_DEVICENAME);
-
- if (is_installed) {
+ installed_epo_device = find_installed_epo_device(dev);
+
+ if (installed_epo_device != NULL) {
DPRINTF1(dev->memory, "device %s already installed\n", EPO_DEVICENAME);
/* This is looking for the case where the device
* changed into something we can't optimize, after it was already installed
* (could be clist or some other weird thing)
*/
- if (dev->child) {
- can_optimize = device_wants_optimization(dev->child);
+ if (installed_epo_device->child) {
+ can_optimize = device_wants_optimization(installed_epo_device->child);
}
if (!can_optimize) {
- DPRINTF1(dev->memory, "child %s can't be optimized, uninstalling\n", dev->child->dname);
- /* Not doing any pending fillpages because we are about to do
- * a fillpage anyway
- */
- gx_device_unsubclass(dev);
+ DPRINTF1(dev->memory, "child %s can't be optimized, uninstalling\n", installed_epo_device->child->dname);
+ /* Not doing any pending fillpages because we are about to do a fillpage anyway */
+ gx_device_unsubclass(installed_epo_device);
return code;
}
} else {
@@ -262,7 +272,7 @@ epo_check_and_install(gx_device *dev)
}
/* Already installed, nothing to do */
- if (is_installed) {
+ if (installed_epo_device != NULL) {
return code;
}
@@ -278,7 +288,7 @@ epo_check_and_install(gx_device *dev)
DPRINTF1(dev->memory, "ERROR installing device %s\n", EPO_DEVICENAME);
return code;
}
-
+
DPRINTF1(dev->memory, "SUCCESS installed device %s\n", dev->dname);
return code;
}
@@ -288,7 +298,7 @@ epo_handle_erase_page(gx_device *dev)
{
erasepage_subclass_data *data = (erasepage_subclass_data *)dev->subclass_data;
int code = 0;
-
+
if (gs_debug_c(gs_debug_flag_epo_install_only)) {
gx_device_unsubclass(dev);
DPRINTF1(dev->memory, "Uninstall erasepage, device=%s\n", dev->dname);
@@ -314,7 +324,7 @@ epo_handle_erase_page(gx_device *dev)
int epo_fillpage(gx_device *dev, gs_gstate * pgs, gx_device_color *pdevc)
{
erasepage_subclass_data *data = (erasepage_subclass_data *)dev->subclass_data;
-
+
if (gs_debug_c(gs_debug_flag_epo_install_only)) {
return default_subclass_fillpage(dev, pgs, pdevc);
}
@@ -322,13 +332,13 @@ int epo_fillpage(gx_device *dev, gs_gstate * pgs, gx_device_color *pdevc)
/* If color is not pure, don't defer this, uninstall and do it now */
if (!color_is_pure(pdevc)) {
DPRINTF(dev->memory, "epo_fillpage(), color is not pure, uninstalling\n");
- gx_device_unsubclass(dev);
+ gx_device_unsubclass(dev);
return dev_proc(dev, fillpage)(dev, pgs, pdevc);
}
-
+
/* Save the color being requested, and swallow the fillpage */
data->last_color = pdevc->colors.pure;
-
+
DPRINTF(dev->memory, "Swallowing fillpage\n");
return 0;
}
diff --git a/base/gdevepo.h b/base/gdevepo.h
index 68f47686..029a54ad 100644
--- a/base/gdevepo.h
+++ b/base/gdevepo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevflp.c b/base/gdevflp.c
index 7b02bc35..20757bbe 100644
--- a/base/gdevflp.c
+++ b/base/gdevflp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -221,7 +221,7 @@ gx_device_flp gs_flp_device =
static int ParsePageList(gx_device *dev, first_last_subclass_data *psubclass_data, char *PageList)
{
char *str, *oldstr, *workstr, c, *ArgCopy;
- int LastPage, Page, byte, bit, i;
+ int LastPage, Page, byte, bit, i, prev_page = -1;
psubclass_data->ProcessedPageList = true;
if (strcmp(PageList, "even") == 0) {
@@ -309,6 +309,13 @@ static int ParsePageList(gx_device *dev, first_last_subclass_data *psubclass_dat
if (LastPage < 0)
LastPage = 0;
+ if (LastPage < Page || Page <= prev_page) {
+ /* Strictly monotonic increasing required */
+ emprintf(dev->memory, "\n**** Error : rangecheck processing PageList\n");
+ return_error(gs_error_rangecheck);
+ }
+ prev_page = LastPage;
+
for (i=Page; i<= LastPage;i++) {
if (i > psubclass_data->LastListPage - 1) {
emprintf(dev->memory, "\n**** Error : rangecheck processing PageList\n");
@@ -323,10 +330,13 @@ static int ParsePageList(gx_device *dev, first_last_subclass_data *psubclass_dat
Page = atoi(oldstr) - 1;
if (Page < 0)
Page = 0;
- if (Page > psubclass_data->LastListPage - 1) {
+ if (Page <= prev_page || Page > psubclass_data->LastListPage - 1) {
+ /* Strictly monotonic increasing required */
emprintf(dev->memory, "\n**** Error : rangecheck processing PageList\n");
return_error(gs_error_rangecheck);
}
+ prev_page = Page;
+
byte = (int)(Page / 8);
bit = Page % 8;
c = 0x01 << bit;
@@ -519,7 +529,7 @@ int
flp_put_params(gx_device * dev, gs_param_list * plist)
{
bool temp_bool = false;
- int code, ecode;
+ int code, ecode = 0;
gs_param_string pagelist;
code = param_read_int(plist, "FirstPage", &dev->FirstPage);
@@ -875,6 +885,7 @@ flp_image_plane_data(gx_image_enum_common_t * info,
static int
flp_image_end_image(gx_image_enum_common_t * info, bool draw_last)
{
+ gs_free_object(info->memory, info, "flp_end_image");
return 0;
}
diff --git a/base/gdevflp.h b/base/gdevflp.h
index ba38f1c1..453f401a 100644
--- a/base/gdevflp.h
+++ b/base/gdevflp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevhit.c b/base/gdevhit.c
index 769e8d3a..0a804b4c 100644
--- a/base/gdevhit.c
+++ b/base/gdevhit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevkrnlsclass.c b/base/gdevkrnlsclass.c
index 8625df4c..d615a100 100644
--- a/base/gdevkrnlsclass.c
+++ b/base/gdevkrnlsclass.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -15,11 +15,12 @@
#include "gx.h"
#include "gxdcolor.h"
-#include "gdevkrnlsclass.h" /* 'standard' built in subclasses, currently First/Last Page and object filter */
+#include "gdevkrnlsclass.h" /* 'standard' built in subclasses, currently Page, Object, and Nup filter */
/* If set to '1' ths forces all devices to be loaded, even if they won't do anything.
* This is useful for cluster testing that the very presence of a device doesn't
- * break anything.
+ * break anything. This requires that all of these devices pass through if the params
+ * they use are 0/NULL.
*/
#define FORCE_TESTING_SUBCLASSING 0
@@ -28,6 +29,44 @@ int install_internal_subclass_devices(gx_device **ppdev, int *devices_loaded)
int code = 0;
gx_device *dev = (gx_device *)*ppdev, *saved;
+ /*
+ * NOTE: the Nup device should precede the PageHandler so the FirstPage, LastPage
+ * and PageList will filter pages out BEFORE they are seen by the nesting.
+ */
+
+#if FORCE_TESTING_SUBCLASSING
+ if (!dev->NupHandlerPushed) {
+#else
+ if (!dev->NupHandlerPushed && dev->NupControl != 0) {
+#endif
+ code = gx_device_subclass(dev, (gx_device *)&gs_nup_device, sizeof(Nup_device_subclass_data));
+ if (code < 0)
+ return code;
+
+ saved = dev = dev->child;
+
+ /* Open all devices *after* the new current device */
+ do {
+ dev->is_open = true;
+ dev = dev->child;
+ }while(dev);
+
+ dev = saved;
+
+ /* Rewind to top device in chain */
+ while(dev->parent)
+ dev = dev->parent;
+
+ /* Note in all devices in chain that we have loaded the NupHandler */
+ do {
+ dev->NupHandlerPushed = true;
+ dev = dev->child;
+ }while(dev);
+
+ dev = saved;
+ if (devices_loaded)
+ *devices_loaded = true;
+ }
#if FORCE_TESTING_SUBCLASSING
if (!dev->PageHandlerPushed) {
#else
diff --git a/base/gdevkrnlsclass.h b/base/gdevkrnlsclass.h
index b73ce3c2..e9f0a0b4 100644
--- a/base/gdevkrnlsclass.h
+++ b/base/gdevkrnlsclass.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -19,6 +19,7 @@
#ifndef gdev_subclass_dev_INCLUDED
# define gdev_subclass_dev_INCLUDED
+#include "gdevnup.h"
#include "gdevflp.h"
#include "gdevoflt.h"
@@ -26,6 +27,8 @@ extern gx_device_obj_filter gs_obj_filter_device;
extern gx_device_flp gs_flp_device;
+extern gx_device_nup gs_nup_device;
+
int install_internal_subclass_devices(gx_device **ppdev, int *devices_loaded);
#endif /* gdev_subclass_dev_INCLUDED */
diff --git a/base/gdevm1.c b/base/gdevm1.c
index 299cf65d..7801c3a6 100644
--- a/base/gdevm1.c
+++ b/base/gdevm1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevm16.c b/base/gdevm16.c
index f20b4461..f4d662eb 100644
--- a/base/gdevm16.c
+++ b/base/gdevm16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevm2.c b/base/gdevm2.c
index 3443ac2a..863811b8 100644
--- a/base/gdevm2.c
+++ b/base/gdevm2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevm24.c b/base/gdevm24.c
index 5cea72f8..332279b6 100644
--- a/base/gdevm24.c
+++ b/base/gdevm24.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevm32.c b/base/gdevm32.c
index 0e5e7f15..414831c1 100644
--- a/base/gdevm32.c
+++ b/base/gdevm32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevm4.c b/base/gdevm4.c
index dadb4755..51940a5b 100644
--- a/base/gdevm4.c
+++ b/base/gdevm4.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevm40.c b/base/gdevm40.c
index e2e9ef7d..0946a033 100644
--- a/base/gdevm40.c
+++ b/base/gdevm40.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevm48.c b/base/gdevm48.c
index 987a6390..d951ccfa 100644
--- a/base/gdevm48.c
+++ b/base/gdevm48.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevm56.c b/base/gdevm56.c
index 2efbaf9b..72774fb9 100644
--- a/base/gdevm56.c
+++ b/base/gdevm56.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevm64.c b/base/gdevm64.c
index 8c3be0d1..899713ef 100644
--- a/base/gdevm64.c
+++ b/base/gdevm64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevm8.c b/base/gdevm8.c
index 55f956b3..65013507 100644
--- a/base/gdevm8.c
+++ b/base/gdevm8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevmem.c b/base/gdevmem.c
index 95da5d6c..68e7e857 100644
--- a/base/gdevmem.c
+++ b/base/gdevmem.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -338,14 +338,18 @@ gdev_mem_mono_set_inverted(gx_device_memory * dev, bool black_is_1)
int
gdev_mem_bits_size(const gx_device_memory * dev, int width, int height, ulong *psize)
{
- int num_planes = dev->is_planar ? dev->color_info.num_components : 0;
+ int num_planes;
gx_render_plane_t plane1;
const gx_render_plane_t *planes;
ulong size;
int pi;
- if (num_planes)
+ if (dev->is_planar)
+ {
+ int has_tags = device_encodes_tags((const gx_device *)dev);
+ num_planes = dev->color_info.num_components + has_tags;
planes = dev->planes;
+ }
else
planes = &plane1, plane1.depth = dev->color_info.depth, num_planes = 1;
for (size = 0, pi = 0; pi < num_planes; ++pi)
@@ -362,7 +366,11 @@ gdev_mem_bits_size(const gx_device_memory * dev, int width, int height, ulong *p
ulong
gdev_mem_line_ptrs_size(const gx_device_memory * dev, int width, int height)
{
- return (ulong)height * sizeof(byte *) * (dev->is_planar ? dev->color_info.num_components : 1);
+ int has_tags = device_encodes_tags((const gx_device *)dev);
+ int num_planes = 1;
+ if (dev->is_planar)
+ num_planes = dev->color_info.num_components + has_tags;
+ return (ulong)height * sizeof(byte *) * num_planes;
}
int
gdev_mem_data_size(const gx_device_memory * dev, int width, int height, ulong *psize)
diff --git a/base/gdevmem.h b/base/gdevmem.h
index 15759322..71db0797 100644
--- a/base/gdevmem.h
+++ b/base/gdevmem.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevmpla.c b/base/gdevmpla.c
index d889efcf..d233a132 100644
--- a/base/gdevmpla.c
+++ b/base/gdevmpla.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevmpla.h b/base/gdevmpla.h
index 1b424098..1d0f5f98 100644
--- a/base/gdevmpla.h
+++ b/base/gdevmpla.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevmplt.c b/base/gdevmplt.c
index 520b22cf..89720535 100644
--- a/base/gdevmplt.c
+++ b/base/gdevmplt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevmplt.h b/base/gdevmplt.h
index 4b1b44cd..669efdc7 100644
--- a/base/gdevmplt.h
+++ b/base/gdevmplt.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevmr1.c b/base/gdevmr1.c
index 2911f4f3..ed2faab9 100644
--- a/base/gdevmr1.c
+++ b/base/gdevmr1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -78,7 +78,7 @@ mem_mono_strip_copy_rop(gx_device * dev, const byte * sdata,
*/
if (invert)
- rop = byte_reverse_bits[rop] ^ 0xff;
+ rop = byte_reverse_bits[rop & 0xff] ^ 0xff;
return mem_mono_strip_copy_rop_dev(dev, sdata, sourcex, sraster, id,
scolors, textures, tcolors, x, y,
diff --git a/base/gdevmr2n.c b/base/gdevmr2n.c
index 228f29dd..a19b9f69 100644
--- a/base/gdevmr2n.c
+++ b/base/gdevmr2n.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevmr8n.c b/base/gdevmr8n.c
index 055e79cc..e90bb151 100644
--- a/base/gdevmr8n.c
+++ b/base/gdevmr8n.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -352,6 +352,7 @@ df: return mem_default_strip_copy_rop(dev,
int ty = y + phase_y;
rop_set_s_constant(&ropper, const_source);
+ rop_set_t_colors(&ropper, tcolors);
if (rop_get_run_op(&ropper, lop, depth, rop_s_constant | rop_t_1bit)) {
for (; line_count-- > 0; drow += draster, ++ty) { /* Loop over copies of the tile. */
int dx = x, w = width, nw;
diff --git a/base/gdevmrop.h b/base/gdevmrop.h
index 6caebdf6..87e4e557 100644
--- a/base/gdevmrop.h
+++ b/base/gdevmrop.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevmrun.c b/base/gdevmrun.c
index df1667e2..fa16ffbc 100644
--- a/base/gdevmrun.c
+++ b/base/gdevmrun.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -117,14 +117,12 @@ rp_delete_next(run_ptr *prpc, run *data, run_line *line)
RP_PREV(rpn) = 0;
line->free = rpn.index;
}
-static int
-rp_insert_next(run_ptr *prpc, run *data, run_line *line, run_ptr *prpn)
+static void
+rp_insert_next_cant_fail(run_ptr *prpc, run *data, run_line *line, run_ptr *prpn)
{
run_index new = line->free;
run *prnew = data + new;
- if (new == 0)
- return -1;
RP_TO_NEXT(*prpc, data, *prpn);
RP_NEXT(*prpc) = new;
RP_PREV(*prpn) = new;
@@ -133,6 +131,13 @@ rp_insert_next(run_ptr *prpc, run *data, run_line *line, run_ptr *prpn)
prnew->next = prpn->index;
prpn->index = new;
prpn->ptr = prnew;
+}
+static int
+rp_insert_next(run_ptr *prpc, run *data, run_line *line, run_ptr *prpn)
+{
+ if (line->free == 0)
+ return -1;
+ rp_insert_next_cant_fail(prpc, data, line, prpn);
return 0;
}
static int
@@ -524,6 +529,7 @@ run_fill_interval(run_line *line, int xo, int xe, run_value new)
)
RP_LENGTH(rp0) += left;
else {
+ run_ptr rpn = {0};
/*
* If we need more than one run, we divide up the length to
* create more runs with length less than MAX_RUN_LENGTH in
@@ -542,14 +548,13 @@ run_fill_interval(run_line *line, int xo, int xe, run_value new)
len = (left + pieces - 1) / pieces;
}
do {
- run_ptr rpn;
/*
* The allocation in rp_insert_next can't fail, because
* we just deleted at least as many runs as we're going
* to insert.
*/
- rp_insert_next(&rp0, data, line, &rpn);
+ rp_insert_next_cant_fail(&rp0, data, line, &rpn);
RP_LENGTH(rpn) = min(left, len);
RP_VALUE(rpn) = new;
}
diff --git a/base/gdevmrun.h b/base/gdevmrun.h
index b9cf0e54..15ee2f79 100644
--- a/base/gdevmrun.h
+++ b/base/gdevmrun.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevmx.c b/base/gdevmx.c
index ee8c6396..fa2287cc 100644
--- a/base/gdevmx.c
+++ b/base/gdevmx.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevnfwd.c b/base/gdevnfwd.c
index b81ff0e1..a6c69e44 100644
--- a/base/gdevnfwd.c
+++ b/base/gdevnfwd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -865,6 +865,11 @@ gx_forward_dev_spec_op(gx_device * dev, int dev_spec_op, void *data, int size)
d->target = fdev->target;
return 1;
}
+ } else if (dev_spec_op == gxdso_device_insert_child) {
+ fdev->target = (gx_device *)data;
+ rc_increment(fdev->target);
+ rc_decrement_only(tdev, "gx_forward_device");
+ return 0;
}
return dev_proc(tdev, dev_spec_op)(tdev, dev_spec_op, data, size);
}
@@ -1009,6 +1014,12 @@ gx_forward_create_compositor(gx_device * dev, gx_device ** pcdev,
code = dev_proc(tdev, create_compositor)(tdev, pcdev, pcte, pgs, memory, cdev);
/* the compositor may have changed color_info. Pick up the new value */
dev->color_info = tdev->color_info;
+ if (code == 1) {
+ /* If a new compositor was made that wrapped tdev, then that
+ * compositor should be our target now. */
+ gx_device_set_target((gx_device_forward *)dev, *pcdev);
+ code = 0; /* We have not made a new compositor that wrapped dev. */
+ }
return code;
}
diff --git a/base/gdevnup.c b/base/gdevnup.c
new file mode 100644
index 00000000..e1d79d1c
--- /dev/null
+++ b/base/gdevnup.c
@@ -0,0 +1,593 @@
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
+ All Rights Reserved.
+
+ This software is provided AS-IS with no warranty, either express or
+ implied.
+
+ This software is distributed under license and may not be copied,
+ modified or distributed except as expressly authorized under the terms
+ of the license contained in the file LICENSE in this distribution.
+
+ Refer to licensing information at http://www.artifex.com or contact
+ Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
+ CA 94945, U.S.A., +1(415)492-9861, for further information.
+*/
+
+/* Device to implement N-up printing */
+#include "math_.h"
+#include "memory_.h"
+#include "gx.h"
+#include "gserrors.h"
+#include "gpmisc.h"
+#include "gsparam.h"
+#include "gxdevice.h"
+#include "gsdevice.h" /* requires gsmatrix.h */
+#include "gxiparam.h" /* for image source size */
+#include "gxgstate.h"
+#include "gxpaint.h"
+#include "gxpath.h"
+#include "gxcpath.h"
+#include "gsstype.h"
+#include "gdevprn.h"
+#include "gdevp14.h" /* Needed to patch up the procs after compositor creation */
+#include "gdevsclass.h"
+#include "gxdevsop.h"
+#include "gdevnup.h"
+
+/* GC descriptor */
+#define public_st_nup_device() /* in gsdevice.c */\
+ gs_public_st_complex_only(st_nup_device, gx_device, "Nup Device",\
+ 0, nup_device_enum_ptrs, nup_device_reloc_ptrs, default_subclass_finalize)
+
+static
+ENUM_PTRS_WITH(nup_device_enum_ptrs, gx_device *dev);
+return 0; /* default case */
+case 0:ENUM_RETURN(gx_device_enum_ptr(dev->parent));
+case 1:ENUM_RETURN(gx_device_enum_ptr(dev->child));
+ENUM_PTRS_END
+static RELOC_PTRS_WITH(nup_device_reloc_ptrs, gx_device *dev)
+{
+ dev->parent = gx_device_reloc_ptr(dev->parent, gcst);
+ dev->child = gx_device_reloc_ptr(dev->child, gcst);
+}
+RELOC_PTRS_END
+
+public_st_nup_device();
+
+
+/**************************************************************************************/
+/* Externals not in headers */
+/* Imported from gsdparam.c */
+extern void rc_free_NupControl(gs_memory_t * mem, void *ptr_in, client_name_t cname);
+/**************************************************************************************/
+
+/* This device is one of the 'subclassing' devices, part of a chain or pipeline
+ * of devices, each of which can process some aspect of the graphics methods
+ * before passing them on to the next device in the chain.
+ *
+ * This operates by hooking the device procs:
+ * get_initial_matrix To modify the scale and origin of the sub-page
+ * fillpage To prevent erasing previously imaged sub-pages
+ * output_page To ignore all output_page calls until all sub-pages
+ * have been imaged
+ * close_device To output the final (partial) collection of sub-pages
+ */
+
+/* Device procedures */
+static dev_proc_get_initial_matrix(nup_get_initial_matrix);
+static dev_proc_close_device(nup_close_device);
+static dev_proc_put_params(nup_put_params);
+static dev_proc_output_page(nup_output_page);
+static dev_proc_fillpage(nup_fillpage);
+static dev_proc_dev_spec_op(nup_dev_spec_op);
+
+/* The device prototype */
+
+#define MAX_COORD (max_int_in_fixed - 1000)
+#define MAX_RESOLUTION 4000
+
+const
+gx_device_nup gs_nup_device =
+{
+ /*
+ * Define the device as 8-bit gray scale to avoid computing halftones.
+ */
+ std_device_dci_type_body(gx_device_nup, 0, "N-up", &st_nup_device,
+ MAX_COORD, MAX_COORD,
+ MAX_RESOLUTION, MAX_RESOLUTION,
+ 1, 8, 255, 0, 256, 1),
+ {default_subclass_open_device,
+ nup_get_initial_matrix,
+ default_subclass_sync_output, /* sync_output */
+ nup_output_page,
+ nup_close_device,
+ default_subclass_map_rgb_color,
+ default_subclass_map_color_rgb,
+ default_subclass_fill_rectangle,
+ default_subclass_tile_rectangle, /* tile_rectangle */
+ default_subclass_copy_mono,
+ default_subclass_copy_color,
+ default_subclass_draw_line, /* draw_line */
+ default_subclass_get_bits, /* get_bits */
+ default_subclass_get_params,
+ nup_put_params, /* to catch PageSize changes */
+ default_subclass_map_cmyk_color,
+ default_subclass_get_xfont_procs, /* get_xfont_procs */
+ default_subclass_get_xfont_device, /* get_xfont_device */
+ default_subclass_map_rgb_alpha_color,
+ default_subclass_get_page_device,
+ default_subclass_get_alpha_bits, /* get_alpha_bits */
+ default_subclass_copy_alpha,
+ default_subclass_get_band, /* get_band */
+ default_subclass_copy_rop, /* copy_rop */
+ default_subclass_fill_path,
+ default_subclass_stroke_path,
+ default_subclass_fill_mask,
+ default_subclass_fill_trapezoid,
+ default_subclass_fill_parallelogram,
+ default_subclass_fill_triangle,
+ default_subclass_draw_thin_line,
+ default_subclass_begin_image,
+ default_subclass_image_data, /* image_data */
+ default_subclass_end_image, /* end_image */
+ default_subclass_strip_tile_rectangle,
+ default_subclass_strip_copy_rop,
+ default_subclass_get_clipping_box, /* get_clipping_box */
+ default_subclass_begin_typed_image,
+ default_subclass_get_bits_rectangle, /* get_bits_rectangle */
+ default_subclass_map_color_rgb_alpha,
+ default_subclass_create_compositor,
+ default_subclass_get_hardware_params, /* get_hardware_params */
+ default_subclass_text_begin,
+ default_subclass_finish_copydevice, /* finish_copydevice */
+ default_subclass_begin_transparency_group, /* begin_transparency_group */
+ default_subclass_end_transparency_group, /* end_transparency_group */
+ default_subclass_begin_transparency_mask, /* begin_transparency_mask */
+ default_subclass_end_transparency_mask, /* end_transparency_mask */
+ default_subclass_discard_transparency_layer, /* discard_transparency_layer */
+ default_subclass_get_color_mapping_procs, /* get_color_mapping_procs */
+ default_subclass_get_color_comp_index, /* get_color_comp_index */
+ default_subclass_encode_color, /* encode_color */
+ default_subclass_decode_color, /* decode_color */
+ default_subclass_pattern_manage, /* pattern_manage */
+ default_subclass_fill_rectangle_hl_color, /* fill_rectangle_hl_color */
+ default_subclass_include_color_space, /* include_color_space */
+ default_subclass_fill_linear_color_scanline, /* fill_linear_color_scanline */
+ default_subclass_fill_linear_color_trapezoid, /* fill_linear_color_trapezoid */
+ default_subclass_fill_linear_color_triangle, /* fill_linear_color_triangle */
+ default_subclass_update_spot_equivalent_colors, /* update_spot_equivalent_colors */
+ default_subclass_ret_devn_params, /* ret_devn_params */
+ nup_fillpage, /* fillpage */
+ default_subclass_push_transparency_state, /* push_transparency_state */
+ default_subclass_pop_transparency_state, /* pop_transparency_state */
+ default_subclass_put_image, /* put_image */
+ nup_dev_spec_op, /* for GetParam of PdfmarkCapable */
+ default_subclass_copy_planes, /* copy_planes */
+ default_subclass_get_profile, /* get_profile */
+ default_subclass_set_graphics_type_tag, /* set_graphics_type_tag */
+ default_subclass_strip_copy_rop2,
+ default_subclass_strip_tile_rect_devn,
+ default_subclass_copy_alpha_hl_color,
+ default_subclass_process_page,
+ default_subclass_transform_pixel_region,
+ default_subclass_fill_stroke_path,
+ }
+};
+
+#undef MAX_COORD
+#undef MAX_RESOLUTION
+
+static void
+nup_disable_nesting(Nup_device_subclass_data *pNup_data)
+{
+ /* set safe non-nesting defaults if we don't know the size of the Nested Page */
+ pNup_data->PagesPerNest = 1;
+ pNup_data->NupH = 1;
+ pNup_data->NupV = 1;
+ pNup_data->Scale = 1.0;
+ pNup_data->PageCount = 0;
+}
+
+static int
+ParseNupControl(gx_device *dev, Nup_device_subclass_data *pNup_data)
+{
+ int code = 0;
+ float HScale, VScale;
+
+ /* Make sure PageW and PageH are set -- from dev->width, dev->height */
+ pNup_data->PageW = dev->width * 72.0 / dev->HWResolution[0];
+ pNup_data->PageH = dev->height * 72.0 / dev->HWResolution[1];
+
+ /* pNup_data->NestedPage[WH] size is set by nup_put_params by PageSize or .MediaSize */
+ if (dev->NupControl== NULL) {
+ nup_disable_nesting(pNup_data);
+ return 0;
+ }
+ /* First parse the NupControl string for our parameters */
+ if (sscanf(dev->NupControl->nupcontrol_str, "%dx%d", &(pNup_data->NupH), &(pNup_data->NupV)) != 2) {
+ emprintf1(dev->memory, "*** Invalid NupControl format '%s'\n", dev->NupControl->nupcontrol_str);
+ nup_disable_nesting(pNup_data);
+ return_error(gs_error_unknownerror);
+ }
+ pNup_data->PagesPerNest = pNup_data->NupH * pNup_data->NupV;
+
+ /* -dNupControl=1x1 effectively turns off nesting */
+ if (pNup_data->PagesPerNest == 1) {
+ nup_disable_nesting(pNup_data);
+ return 0;
+ }
+ if (pNup_data->NestedPageW == 0.0 || pNup_data->NestedPageH == 0.0) {
+ pNup_data->NestedPageW = pNup_data->PageW;
+ pNup_data->NestedPageH = pNup_data->PageH;
+ }
+ /* Calculate based on the PageW and PageH and NestedPage size */
+ /* Set HSize, VSize, Scale, HMargin, and VMargin */
+
+ HScale = pNup_data->PageW / (pNup_data->NestedPageW * pNup_data->NupH);
+ VScale = pNup_data->PageH / (pNup_data->NestedPageH * pNup_data->NupV);
+ if (HScale < VScale) {
+ pNup_data->Scale = HScale;
+ pNup_data->HMargin = 0.0;
+ pNup_data->VMargin = (pNup_data->PageH - (HScale * pNup_data->NestedPageH * pNup_data->NupV))/2.0;
+ } else {
+ pNup_data->Scale = VScale;
+ pNup_data->VMargin = 0.0;
+ pNup_data->HMargin = (pNup_data->PageW - (VScale * pNup_data->NestedPageW * pNup_data->NupH))/2.0;
+ }
+ pNup_data->HSize = pNup_data->NestedPageW * pNup_data->Scale;
+ pNup_data->VSize = pNup_data->NestedPageH * pNup_data->Scale;
+
+ return code;
+}
+
+static void
+nup_get_initial_matrix(gx_device *dev, gs_matrix *pmat)
+{
+ int code = 0, Hindex, Vindex;
+ Nup_device_subclass_data *pNup_data = dev->subclass_data;
+
+ if (pNup_data->PagesPerNest == 0) /* not yet initialized */
+ code = ParseNupControl(dev, pNup_data);
+
+ default_subclass_get_initial_matrix(dev, pmat); /* get the matrix from the device */
+ if (code < 0)
+ return;
+
+ if (pNup_data->PagesPerNest == 1)
+ return; /* nesting disabled */
+
+ /* Modify the matrix according to N-up nesting paramters */
+ pmat->tx += pNup_data->HMargin * pmat->xx;
+ pmat->ty += pNup_data->VMargin * pmat->yy; /* ty is the bottom */
+
+ Hindex = imod(pNup_data->PageCount, pNup_data->NupH);
+ Vindex = pNup_data->PageCount/pNup_data->NupH;
+ Vindex = pNup_data->NupV - (imod(Vindex, pNup_data->NupV) + 1); /* rows from top down */
+
+ pmat->tx += pNup_data->HSize * Hindex * pmat->xx;
+ pmat->tx += pNup_data->VSize * Vindex * pmat->xy;
+
+ pmat->ty += pNup_data->HSize * Hindex * pmat->yx;
+ pmat->ty += pNup_data->VSize * Vindex * pmat->yy;
+
+ pmat->xx *= pNup_data->Scale;
+ pmat->xy *= pNup_data->Scale;
+ pmat->yx *= pNup_data->Scale;
+ pmat->yy *= pNup_data->Scale;
+
+ return;
+}
+
+/* Used to set/resest child device's MediaSize which is needed around output_page */
+static void
+nup_set_children_MediaSize(gx_device *dev, float PageW, float PageH)
+{
+ do {
+ dev = dev->child;
+ dev->MediaSize[0] = PageW;
+ dev->MediaSize[1] = PageH;
+ } while (dev->child != NULL);
+ return;
+}
+
+static int
+nup_flush_nest_to_output(gx_device *dev, Nup_device_subclass_data *pNup_data, bool flush)
+{
+ int code = 0;
+
+ nup_set_children_MediaSize(dev, pNup_data->PageW, pNup_data->PageH);
+ code = default_subclass_output_page(dev, 1, true);
+ nup_set_children_MediaSize(dev, pNup_data->NestedPageW, pNup_data->NestedPageH);
+
+ pNup_data->PageCount = 0;
+ return code;
+}
+
+static int
+nup_close_device(gx_device *dev)
+{
+ int code = 0, acode = 0;
+ Nup_device_subclass_data *pNup_data = dev->subclass_data;
+
+ if (pNup_data->PagesPerNest == 0)
+ code = ParseNupControl(dev, pNup_data);
+ if (code < 0)
+ return code;
+
+ if (pNup_data->PageCount > 0)
+ acode = nup_flush_nest_to_output(dev, pNup_data, true);
+
+ /* Reset the Nup control data */
+ /* NB: the data will be freed from non_gc_memory by the finalize function */
+ memset(pNup_data, 0, sizeof(Nup_device_subclass_data));
+
+ /* close children devices, even if there was an error from flush (acode < 0) */
+ code = default_subclass_close_device(dev);
+
+ return min(code, acode);
+}
+
+ /*
+ * Template:
+ * BEGIN_ARRAY_PARAM(param_read_xxx_array, "pname", pxxa, size, pxxe) {
+ * ... check value if desired ...
+ * if (success)
+ * break;
+ * ... set ecode ...
+ * } END_ARRAY_PARAM(pxxa, pxxe);
+ */
+
+#define BEGIN_ARRAY_PARAM(pread, pname, pa, psize, e)\
+ BEGIN\
+ switch (code = pread(plist, (param_name = pname), &(pa))) {\
+ case 0:\
+ if ((pa).size != psize) {\
+ ecode = gs_note_error(gs_error_rangecheck);\
+ (pa).data = 0; /* mark as not filled */\
+ } else
+#define END_ARRAY_PARAM(pa, e)\
+ goto e;\
+ default:\
+ ecode = code;\
+e: param_signal_error(plist, param_name, ecode);\
+ case 1:\
+ (pa).data = 0; /* mark as not filled */\
+ }\
+ END
+
+/* Read .MediaSize or, if supported as a synonym, PageSize. */
+static int
+param_MediaSize(gs_param_list * plist, gs_param_name pname,
+ const float *res, gs_param_float_array * pa)
+{
+ gs_param_name param_name;
+ int ecode = 0;
+ int code;
+
+ BEGIN_ARRAY_PARAM(param_read_float_array, pname, *pa, 2, mse) {
+ float width_new = pa->data[0] * res[0] / 72;
+ float height_new = pa->data[1] * res[1] / 72;
+
+ if (width_new < 0 || height_new < 0)
+ ecode = gs_note_error(gs_error_rangecheck);
+#define max_coord (max_fixed / fixed_1)
+#if max_coord < max_int
+ else if (width_new > (long)max_coord || height_new > (long)max_coord)
+ ecode = gs_note_error(gs_error_limitcheck);
+#endif
+#undef max_coord
+ else
+ break;
+ } END_ARRAY_PARAM(*pa, mse);
+ return ecode;
+}
+
+static int
+nup_put_params(gx_device *dev, gs_param_list * plist)
+{
+ int code, ecode = 0;
+ gs_param_float_array msa;
+ const float *data;
+ const float *res = dev->HWResolution;
+ gs_param_string nuplist;
+ Nup_device_subclass_data* pNup_data = dev->subclass_data;
+ gx_device *next_dev;
+
+#if 0000
+gs_param_list_dump(plist);
+#endif
+
+ code = param_read_string(plist, "NupControl", &nuplist);
+ if (code < 0)
+ ecode = code;
+
+ if (code == 0) {
+ if (dev->NupControl && (nuplist.size == 0 ||
+ (strncmp(dev->NupControl->nupcontrol_str, (const char *)nuplist.data, nuplist.size) != 0))) {
+ /* If we have accumulated a nest when the NupControl changes, flush the nest */
+ if (pNup_data->PagesPerNest > 1 && pNup_data->PageCount > 0)
+ code = nup_flush_nest_to_output(dev, pNup_data, true);
+ if (code < 0)
+ ecode = code;
+ /* There was a NupControl, but this one is different -- no longer use the old one */
+ rc_decrement(dev->NupControl, "default put_params NupControl");
+ dev->NupControl = 0;
+ }
+ if (dev->NupControl == NULL && nuplist.size > 0) {
+ dev->NupControl = (gdev_nupcontrol *)gs_alloc_bytes(dev->memory->non_gc_memory,
+ sizeof(gdev_nupcontrol), "structure to hold nupcontrol_str");
+ if (dev->NupControl == NULL)
+ return gs_note_error(gs_error_VMerror);
+ dev->NupControl->nupcontrol_str = (void *)gs_alloc_bytes(dev->memory->non_gc_memory,
+ nuplist.size + 1, "nupcontrol string");
+ if (dev->NupControl->nupcontrol_str == NULL){
+ gs_free(dev->memory->non_gc_memory, dev->NupControl, 1, sizeof(gdev_nupcontrol),
+ "free structure to hold nupcontrol string");
+ dev->NupControl = 0;
+ return gs_note_error(gs_error_VMerror);
+ }
+ memset(dev->NupControl->nupcontrol_str, 0x00, nuplist.size + 1);
+ memcpy(dev->NupControl->nupcontrol_str, nuplist.data, nuplist.size);
+ rc_init_free(dev->NupControl, dev->memory->non_gc_memory, 1, rc_free_NupControl);
+ }
+ /* Propagate the new NupControl struct to children so get_params has a valid param */
+ next_dev = dev->child;
+ while (next_dev != NULL) {
+ rc_decrement(next_dev->NupControl, "nup_put_params");
+ next_dev->NupControl = dev->NupControl;
+ rc_increment(next_dev->NupControl);
+ next_dev = next_dev->child;
+ }
+ /* Propagate the new NupControl struct to parents so get_params has a valid param */
+ next_dev = dev->parent;
+ while (next_dev != NULL) {
+ rc_decrement(next_dev->NupControl, "nup_put_params");
+ next_dev->NupControl = dev->NupControl;
+ rc_increment(next_dev->NupControl);
+ next_dev = next_dev->parent;
+ }
+ if (ecode < 0)
+ return ecode;
+ }
+
+ code = ParseNupControl(dev, pNup_data); /* update the nesting params */
+ if (code < 0)
+ return code;
+
+ /* If nesting is now off, just pass params on to children devices */
+ if (pNup_data->PagesPerNest == 1)
+ return default_subclass_put_params(dev, plist);
+
+ /* .MediaSize takes precedence over PageSize, so we read PageSize first. */
+ code = param_MediaSize(plist, "PageSize", res, &msa);
+ if (code < 0)
+ ecode = code;
+ /* Prevent data from being set to 0 if PageSize is specified */
+ /* but .MediaSize is not. */
+ data = msa.data;
+ code = param_MediaSize(plist, ".MediaSize", res, &msa);
+ if (code < 0)
+ ecode = code;
+ else if (msa.data == 0)
+ msa.data = data;
+ if (ecode < 0)
+ return ecode;
+
+ /* If there was PageSize or .MediaSize, update the NestedPage size */
+ if (msa.data != 0) {
+ Nup_device_subclass_data *pNup_data = dev->subclass_data;
+
+ /* FIXME: Handle changing size (if previous value was non-zero) */
+ if (msa.data[0] != pNup_data->NestedPageW || msa.data[1] != pNup_data->NestedPageH) {
+ /* If needed, flush previous nest before changing */
+ if (pNup_data->PageCount > 0 && pNup_data->PagesPerNest > 1) {
+ code = nup_flush_nest_to_output(dev, pNup_data, true);
+ if (code < 0)
+ return code;
+ }
+ pNup_data->NestedPageW = msa.data[0];
+ pNup_data->NestedPageH = msa.data[1];
+ /* And update the Nup parameters based on the updated PageSize */
+ code = ParseNupControl(dev, pNup_data);
+ if (code < 0)
+ return code;
+ }
+ }
+
+ /* now that we've intercepted PageSize and/or MediaSize, pass the rest along */
+ code = default_subclass_put_params(dev, plist);
+ return code;
+}
+
+static int
+nup_output_page(gx_device *dev, int num_copies, int flush)
+{
+ int code = 0;
+ Nup_device_subclass_data *pNup_data = dev->subclass_data;
+
+ if (pNup_data->PagesPerNest == 0)
+ code = ParseNupControl(dev, pNup_data); /* ensure reasonable values */
+ if (code < 0)
+ return code;
+
+ /* If nesting is off, pass output_page to children */
+ if (pNup_data->PagesPerNest == 1) {
+ code = default_subclass_output_page(dev, num_copies, flush);
+ dev->PageCount = dev->child->PageCount;
+ dev->ShowpageCount = dev->child->ShowpageCount;
+ return code;
+ }
+
+ /* FIXME: Handle num_copies > 1 */
+ pNup_data->PageCount++;
+ dev->PageCount++;
+ dev->ShowpageCount = dev->child->ShowpageCount;
+ if (pNup_data->PageCount >= pNup_data->PagesPerNest)
+ code = nup_flush_nest_to_output(dev, pNup_data, flush);
+
+ return code;
+}
+
+static int
+nup_fillpage(gx_device *dev, gs_gstate * pgs, gx_device_color *pdevc)
+{
+ int code = 0;
+ Nup_device_subclass_data *pNup_data = dev->subclass_data;
+
+ if (pNup_data->PagesPerNest == 0)
+ code = ParseNupControl(dev, pNup_data);
+ if (code < 0)
+ return code;
+
+ /* Only fill the first page of a nest */
+ if (pNup_data->PageCount == 0)
+ code = default_subclass_fillpage(dev, pgs, pdevc);
+
+ return code;
+}
+
+static int
+nup_dev_spec_op(gx_device *dev, int dev_spec_op, void *data, int size)
+{
+ Nup_device_subclass_data *pNup_data = dev->subclass_data;
+ int code = 0;
+
+ if (pNup_data->PagesPerNest == 0) /* not yet initialized */
+ code = ParseNupControl(dev, pNup_data);
+ if (code < 0)
+ return code;
+
+ /* If nesting is now off, just pass spec_op on to children devices */
+ if (pNup_data->PagesPerNest == 1)
+ return default_subclass_dev_spec_op(dev, dev_spec_op, data, size);
+
+ switch (dev_spec_op) {
+ case gxdso_set_HWSize:
+ /* Call ParseNupControl since that will set the PageW and PageH from the */
+ /* dev->width, dev->height as the size for the page on which we are placing */
+ /* the nested pages. If we get here we know PagesPerNest > 0, so don't set */
+ /* the dev->width and dev->height */
+ code = ParseNupControl(dev, pNup_data);
+ if (code < 0)
+ return code;
+ return 1;
+ break;
+ case gxdso_get_dev_param:
+ {
+ dev_param_req_t *request = (dev_param_req_t *)data;
+ int code = false;
+
+ /* We need to disable pdfmark writing, primarily for CropBox, but also */
+ /* they are probably not relevant for multiple input files to a single */
+ /* output "page" (nest of several pages). */
+ /* Write a 'false' (0) into the param list provided by the caller. */
+ if (strcmp(request->Param, "PdfmarkCapable") == 0) {
+ return(param_write_bool(request->list, "PdfmarkCapable", &code));
+ }
+ }
+ /* Fall through */
+ default:
+ break;
+ }
+ return default_subclass_dev_spec_op(dev, dev_spec_op, data, size);
+}
diff --git a/base/gdevnup.h b/base/gdevnup.h
new file mode 100644
index 00000000..a8b34c4b
--- /dev/null
+++ b/base/gdevnup.h
@@ -0,0 +1,48 @@
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
+ All Rights Reserved.
+
+ This software is provided AS-IS with no warranty, either express or
+ implied.
+
+ This software is distributed under license and may not be copied,
+ modified or distributed except as expressly authorized under the terms
+ of the license contained in the file LICENSE in this distribution.
+
+ Refer to licensing information at http://www.artifex.com or contact
+ Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
+ CA 94945, U.S.A., +1(415)492-9861, for further information.
+*/
+
+
+/* Common definitions for N-up device */
+
+#ifndef gdevnup_INCLUDED
+# define gdevnup_INCLUDED
+
+#include "gxdevice.h"
+
+typedef struct gx_device_s gx_device_nup;
+
+/* Initialize device. */
+void gx_device_nup_device_init(gx_device_nup * dev);
+
+typedef struct {
+ subclass_common;
+ int PageCount;
+ int PagesPerNest;
+ int NupH;
+ int NupV;
+ float PageW; /* points width of carrier page */
+ float PageH; /* points height of carrier page */
+ float NestedPageW; /* points -- from MediaSize */
+ float NestedPageH; /* points -- from MediaSize */
+ float Scale; /* 1:1 aspect ratio */
+ float HMargin;
+ float VMargin;
+ float HSize;
+ float VSize;
+} Nup_device_subclass_data;
+
+extern_st(st_device_nup);
+
+#endif /* gdevnup_INCLUDED */
diff --git a/base/gdevoflt.c b/base/gdevoflt.c
index a481e0b6..e7fc3809 100644
--- a/base/gdevoflt.c
+++ b/base/gdevoflt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevoflt.h b/base/gdevoflt.h
index d1a9581d..8afca579 100644
--- a/base/gdevoflt.h
+++ b/base/gdevoflt.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevp14.c b/base/gdevp14.c
index 0ac027f2..8819ad90 100644
--- a/base/gdevp14.c
+++ b/base/gdevp14.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -64,7 +64,11 @@
#include "gsicc.h"
#ifdef WITH_CAL
#include "cal.h"
+#define CAL_SLOP 16
+#else
+#define CAL_SLOP 0
#endif
+#include "assert_.h"
#if RAW_DUMP
unsigned int global_index = 0;
@@ -200,10 +204,12 @@ static dev_proc_dev_spec_op(pdf14_dev_spec_op);
static dev_proc_push_transparency_state(pdf14_push_transparency_state);
static dev_proc_pop_transparency_state(pdf14_pop_transparency_state);
static dev_proc_ret_devn_params(pdf14_ret_devn_params);
+static dev_proc_update_spot_equivalent_colors(pdf14_update_spot_equivalent_colors);
static dev_proc_copy_alpha(pdf14_copy_alpha);
static dev_proc_copy_planes(pdf14_copy_planes);
static dev_proc_copy_alpha_hl_color(pdf14_copy_alpha_hl_color);
static dev_proc_discard_transparency_layer(pdf14_discard_trans_layer);
+static dev_proc_strip_tile_rect_devn(pdf14_strip_tile_rect_devn);
static const gx_color_map_procs *
pdf14_get_cmap_procs(const gs_gstate *, const gx_device *);
@@ -284,7 +290,7 @@ static const gx_color_map_procs *
NULL, /* */\
gx_forward_set_graphics_type_tag, /* set_graphics_type_tag */\
NULL, /* strip_copy_rop2 */\
- NULL, /* strip_tile_rect_devn */\
+ pdf14_strip_tile_rect_devn, /* strip_tile_rect_devn */\
pdf14_copy_alpha_hl_color, /* copy_alpha_hl_color */\
NULL, /* process_page */\
NULL, /* transform_pixel_region */\
@@ -328,7 +334,7 @@ static const gx_device_procs pdf14_custom_procs =
gx_forward_encode_color,
gx_forward_decode_color);
-struct_proc_finalize(pdf14_device_finalize);
+static struct_proc_finalize(pdf14_device_finalize);
gs_private_st_composite_use_final(st_pdf14_device, pdf14_device, "pdf14_device",
pdf14_device_enum_ptrs, pdf14_device_reloc_ptrs,
@@ -607,6 +613,23 @@ struct gx_device_pdf14_accum_s {
};
typedef struct gx_device_pdf14_accum_s gx_device_pdf14_accum;
+int
+pdf14_accum_dev_spec_op(gx_device *pdev, int dev_spec_op, void *data, int size)
+{
+ gx_device_pdf14_accum *adev = (gx_device_pdf14_accum *)pdev;
+
+ if (dev_spec_op == gxdso_device_child) {
+ gxdso_device_child_request *req = (gxdso_device_child_request *)data;
+ if (size < sizeof(*req))
+ return gs_error_unknownerror;
+ req->target = adev->save_p14dev;
+ req->n = 0;
+ return 0;
+ }
+
+ return gdev_prn_dev_spec_op(pdev, dev_spec_op, data, size);
+}
+
gs_private_st_suffix_add1_final(st_gx_devn_accum_device, gx_device_pdf14_accum,
"gx_device_pdf14_accum", pdf14_accum_device_enum_ptrs, pdf14_accum_device_reloc_ptrs,
gx_devn_prn_device_finalize, st_gx_devn_prn_device, save_p14dev);
@@ -887,13 +910,14 @@ resolve_matte(pdf14_buf *maskbuf, byte *src_data, int src_planestride, int src_r
need to do the offset to our data in the buffer. Bug 700686: If we are in
a softmask that includes a matte entry, then we need to undo the matte
entry here at this time in the image's native color space not the parent
- color space. The big_endian term here is only set to true if the data
- has been baked as such during the put_image blending operation. */
+ color space. The endian_swap term here is only set to true if the data
+ has been baked as BE during the put_image blending operation and we are
+ on a LE machine. */
static forceinline pdf14_buf*
template_transform_color_buffer(gs_gstate *pgs, pdf14_ctx *ctx, gx_device *dev,
pdf14_buf *src_buf, byte *src_data, cmm_profile_t *src_profile,
cmm_profile_t *des_profile, int x0, int y0, int width, int height, bool *did_alloc,
- bool has_matte, bool deep, bool big_endian)
+ bool has_matte, bool deep, bool endian_swap)
{
gsicc_rendering_param_t rendering_params;
gsicc_link_t *icc_link;
@@ -913,6 +937,8 @@ template_transform_color_buffer(gs_gstate *pgs, pdf14_ctx *ctx, gx_device *dev,
pdf14_buf *output = src_buf;
pdf14_mask_t *mask_stack;
pdf14_buf *maskbuf;
+ int code;
+
*did_alloc = false;
/* Same profile */
@@ -943,7 +969,7 @@ template_transform_color_buffer(gs_gstate *pgs, pdf14_ctx *ctx, gx_device *dev,
des_n_planes = src_n_planes + diff;
des_n_chan = src_n_chan + diff;
des_data = gs_alloc_bytes(ctx->memory,
- (size_t)des_planestride * des_n_planes,
+ (size_t)des_planestride * des_n_planes + CAL_SLOP,
"pdf14_transform_color_buffer");
if (des_data == NULL)
return NULL;
@@ -970,10 +996,8 @@ template_transform_color_buffer(gs_gstate *pgs, pdf14_ctx *ctx, gx_device *dev,
gsicc_init_buffer(&des_buff_desc, des_profile->num_comps, 1<<deep, false,
false, true, des_planestride, des_rowstride, height, width);
- if (big_endian) {
- src_buff_desc.little_endian = false;
- des_buff_desc.little_endian = false;
- }
+ src_buff_desc.endian_swap = endian_swap;
+ des_buff_desc.endian_swap = endian_swap;
/* If we have a matte entry, undo the pre-blending now. Also set pdf14
context to ensure that this is not done again during the group
@@ -989,9 +1013,11 @@ template_transform_color_buffer(gs_gstate *pgs, pdf14_ctx *ctx, gx_device *dev,
/* Transform the data. Since the pdf14 device should be using RGB, CMYK or
Gray buffers, this transform does not need to worry about the cmap procs
of the target device. */
- (icc_link->procs.map_buffer)(dev, icc_link, &src_buff_desc, &des_buff_desc,
+ code = (icc_link->procs.map_buffer)(dev, icc_link, &src_buff_desc, &des_buff_desc,
src_data, des_data);
gsicc_release_link(icc_link);
+ if (code < 0)
+ return NULL;
output->planestride = des_planestride;
output->rowstride = des_rowstride;
@@ -1045,28 +1071,28 @@ static pdf14_buf*
pdf14_transform_color_buffer_no_matte(gs_gstate *pgs, pdf14_ctx *ctx, gx_device *dev,
pdf14_buf *src_buf, byte *src_data, cmm_profile_t *src_profile,
cmm_profile_t *des_profile, int x0, int y0, int width, int height, bool *did_alloc,
- bool deep, bool big_endian)
+ bool deep, bool endian_swap)
{
if (deep)
return template_transform_color_buffer(pgs, ctx, dev, src_buf, src_data, src_profile,
- des_profile, x0, y0, width, height, did_alloc, false, true, big_endian);
+ des_profile, x0, y0, width, height, did_alloc, false, true, endian_swap);
else
return template_transform_color_buffer(pgs, ctx, dev, src_buf, src_data, src_profile,
- des_profile, x0, y0, width, height, did_alloc, false, false, big_endian);
+ des_profile, x0, y0, width, height, did_alloc, false, false, endian_swap);
}
static pdf14_buf*
pdf14_transform_color_buffer_with_matte(gs_gstate *pgs, pdf14_ctx *ctx, gx_device *dev,
pdf14_buf *src_buf, byte *src_data, cmm_profile_t *src_profile,
cmm_profile_t *des_profile, int x0, int y0, int width, int height, bool *did_alloc,
- bool deep, bool big_endian)
+ bool deep, bool endian_swap)
{
if (deep)
return template_transform_color_buffer(pgs, ctx, dev, src_buf, src_data, src_profile,
- des_profile, x0, y0, width, height, did_alloc, true, true, big_endian);
+ des_profile, x0, y0, width, height, did_alloc, true, true, endian_swap);
else
return template_transform_color_buffer(pgs, ctx, dev, src_buf, src_data, src_profile,
- des_profile, x0, y0, width, height, did_alloc, true, false, big_endian);
+ des_profile, x0, y0, width, height, did_alloc, true, false, endian_swap);
}
/**
@@ -1135,7 +1161,7 @@ pdf14_buf_new(gs_int_rect *rect, bool has_tags, bool has_alpha_g,
planestride = rowstride * height;
result->planestride = planestride;
result->data = gs_alloc_bytes(memory,
- (size_t)planestride * n_planes,
+ (size_t)planestride * n_planes + CAL_SLOP,
"pdf14_buf_new");
if (result->data == NULL) {
gs_free_object(memory, result, "pdf14_buf_new");
@@ -1222,7 +1248,7 @@ pdf14_ctx_new(gx_device *dev, bool deep)
{
pdf14_ctx *result;
gs_memory_t *memory = dev->memory->stable_memory;
-
+
result = gs_alloc_struct(memory, pdf14_ctx, &st_pdf14_ctx, "pdf14_ctx_new");
if (result == NULL)
return result;
@@ -1332,7 +1358,7 @@ pdf14_make_base_group_color(gx_device* dev)
memcpy(&(group_color->comp_shift), &(pdev->color_info.comp_shift),
GX_DEVICE_COLOR_MAX_COMPONENTS);
group_color->get_cmap_procs = pdf14_get_cmap_procs;
- group_color->icc_profile =
+ group_color->icc_profile =
pdev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE];
gsicc_adjust_profile_rc(group_color->icc_profile, 1, "pdf14_make_base_group_color");
@@ -1420,7 +1446,7 @@ pdf14_initialize_ctx(gx_device* dev, int n_chan, bool additive, const gs_gstate*
memcpy(&(buf->group_color_info->comp_shift), &(pdev->color_info.comp_shift),
GX_DEVICE_COLOR_MAX_COMPONENTS);
buf->group_color_info->previous = NULL; /* used during clist writing */
- buf->group_color_info->icc_profile =
+ buf->group_color_info->icc_profile =
pdev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE];
if (buf->group_color_info->icc_profile != NULL)
gsicc_adjust_profile_rc(buf->group_color_info->icc_profile, 1, "pdf14_initialize_ctx");
@@ -1536,7 +1562,7 @@ pdf14_push_transparency_group(pdf14_ctx *ctx, gs_int_rect *rect, bool isolated,
an isolated knockout group. */
if (buf->knockout && pdf14_backdrop != NULL) {
buf->backdrop = gs_alloc_bytes(ctx->memory,
- (size_t)buf->planestride * buf->n_planes,
+ (size_t)buf->planestride * buf->n_planes + CAL_SLOP,
"pdf14_push_transparency_group");
if (buf->backdrop == NULL) {
return gs_throw(gs_error_VMerror, "Knockout backdrop allocation failed");
@@ -1597,7 +1623,7 @@ pdf14_pop_transparency_group(gs_gstate *pgs, pdf14_ctx *ctx,
if (maskbuf != NULL && maskbuf->matte != NULL)
has_matte = true;
- /* Check if this is our last buffer, if yes, there is nothing to
+ /* Check if this is our last buffer, if yes, there is nothing to
compose to. Keep this buffer until we have the put image.
If we have another group push, this group must be destroyed.
This only occurs sometimes when at clist creation time
@@ -1693,8 +1719,7 @@ pdf14_pop_transparency_group(gs_gstate *pgs, pdf14_ctx *ctx,
look at pdf14_begin_transparency_group and pdf14_end_transparency group which
is where all the ICC information is handled. We will return to look at that later */
if (nos->group_color_info->icc_profile != NULL) {
- no_icc_match = (nos->group_color_info->icc_profile->hashcode !=
- curr_icc_profile->hashcode);
+ no_icc_match = !gsicc_profiles_equal(nos->group_color_info->icc_profile, curr_icc_profile);
} else {
/* Let the other tests make the decision if we need to transform */
no_icc_match = false;
@@ -1785,7 +1810,7 @@ pdf14_push_transparency_mask(pdf14_ctx *ctx, gs_int_rect *rect, uint16_t bg_alph
if (ctx->stack == NULL) {
return_error(gs_error_VMerror);
- }
+ }
/* An optimization to consider is that if the SubType is Alpha
then we really should only be allocating the alpha band and
@@ -1810,7 +1835,7 @@ pdf14_push_transparency_mask(pdf14_ctx *ctx, gs_int_rect *rect, uint16_t bg_alph
buf->group_color_info = group_color;
if (Matte_components) {
- buf->matte = (uint16_t *)gs_alloc_bytes(ctx->memory, Matte_components * sizeof(uint16_t),
+ buf->matte = (uint16_t *)gs_alloc_bytes(ctx->memory, Matte_components * sizeof(uint16_t) + CAL_SLOP,
"pdf14_push_transparency_mask");
if (buf->matte == NULL)
return_error(gs_error_VMerror);
@@ -1908,6 +1933,7 @@ pdf14_pop_transparency_mask(pdf14_ctx *ctx, gs_gstate *pgs, gx_device *dev)
gsicc_link_t *icc_link;
gsicc_rendering_param_t render_cond;
cmm_dev_profile_t *dev_profile;
+ int code = 0;
dev_proc(dev, get_profile)(dev, &dev_profile);
gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &src_profile,
@@ -1917,7 +1943,7 @@ pdf14_pop_transparency_mask(pdf14_ctx *ctx, gs_gstate *pgs, gx_device *dev)
icc_match == 0 means use icc code
icc_match == 1 mean no conversion needed */
if (des_profile != NULL && src_profile != NULL ) {
- icc_match = (des_profile->hashcode == src_profile->hashcode);
+ icc_match = gsicc_profiles_equal(des_profile, src_profile);
} else {
icc_match = -1;
}
@@ -1971,7 +1997,7 @@ pdf14_pop_transparency_mask(pdf14_ctx *ctx, gs_gstate *pgs, gx_device *dev)
/* This will reduce our memory. We won't reuse the existing one, due */
/* Due to the fact that on certain systems we may have issues recovering */
/* the data after a resize */
- new_data_buf = gs_alloc_bytes(ctx->memory, tos->planestride,
+ new_data_buf = gs_alloc_bytes(ctx->memory, tos->planestride + CAL_SLOP,
"pdf14_pop_transparency_mask");
if (new_data_buf == NULL)
return_error(gs_error_VMerror);
@@ -2058,7 +2084,7 @@ pdf14_pop_transparency_mask(pdf14_ctx *ctx, gs_gstate *pgs, gx_device *dev)
rendering_params.cmm = gsCMM_DEFAULT;
icc_link = gsicc_get_link_profile(pgs, dev, des_profile,
src_profile, &rendering_params, pgs->memory, false);
- smask_icc(dev, tos->rect.q.y - tos->rect.p.y,
+ code = smask_icc(dev, tos->rect.q.y - tos->rect.p.y,
tos->rect.q.x - tos->rect.p.x, tos->n_chan,
tos->rowstride, tos->planestride,
tos->data, new_data_buf, icc_link, tos->deep);
@@ -2089,7 +2115,7 @@ pdf14_pop_transparency_mask(pdf14_ctx *ctx, gs_gstate *pgs, gx_device *dev)
return gs_note_error(gs_error_VMerror);
ctx->mask_stack->rc_mask->mask_buf = tos;
}
- return 0;
+ return code;
}
static pdf14_mask_t *
@@ -2301,7 +2327,7 @@ pdf14_get_buffer_information(const gx_device * dev,
gs_alloc_bytes(mem,
(size_t)planestride *
(buf->n_chan +
- buf->has_tags ? 1 : 0),
+ buf->has_tags ? 1 : 0) + CAL_SLOP,
"pdf14_get_buffer_information");
if (transbuff->transbytes == NULL)
return gs_error_VMerror;
@@ -2407,7 +2433,7 @@ pdf14_put_image_color_convert(const pdf14_device* dev, gs_gstate* pgs, cmm_profi
cmm_profile_t* des_profile;
gsicc_rendering_param_t render_cond;
bool did_alloc;
- bool big_endian;
+ bool endian_swap;
gsicc_extract_profile(GS_UNKNOWN_TAG, dev_target_profile, &des_profile,
&render_cond);
@@ -2419,17 +2445,26 @@ pdf14_put_image_color_convert(const pdf14_device* dev, gs_gstate* pgs, cmm_profi
global_index++;
#endif
- /* If we are doing a 16 bit buffer it will be big endian if we have already done the
- blend, otherwise it will be native endian */
+ /* If we are doing a 16 bit buffer it will be big endian if we have already done the
+ blend, otherwise it will be native endian. GS expects its 16bit buffers to be BE
+ but for sanity pdf14 device maintains 16bit buffers in native format. The CMM
+ will need to know if it is dealing with native or BE data. */
if (was_blended && (*buf)->deep) {
- big_endian = true;
+ /* Data is in BE. If we are in a LE machine, CMM will need to swap for
+ color conversion */
+#if ARCH_IS_BIG_ENDIAN
+ endian_swap = false;
+#else
+ endian_swap = true;
+#endif
} else {
- big_endian = false;
+ /* Data is in native format. No swap needed for CMM */
+ endian_swap = false;
}
cm_result = pdf14_transform_color_buffer_no_matte(pgs, dev->ctx, (gx_device*) dev, *buf,
*buf_ptr, src_profile, des_profile, x, y, width,
- height, &did_alloc, (*buf)->deep, big_endian);
+ height, &did_alloc, (*buf)->deep, endian_swap);
if (cm_result == NULL)
return_error(gs_error_VMerror);
@@ -2542,23 +2577,8 @@ pdf14_put_image(gx_device * dev, gs_gstate * pgs, gx_device * target)
}
/* Check if we have a color conversion issue */
- if (!(src_profile->hash_is_valid)) {
- gsicc_get_icc_buff_hash(src_profile->buffer,
- &(src_profile->hashcode),
- src_profile->buffer_size);
- src_profile->hash_is_valid = true;
- }
-
des_profile = dev_target_profile->device_profile[GS_DEFAULT_DEVICE_PROFILE];
- if (!(des_profile->hash_is_valid)) {
- gsicc_get_icc_buff_hash(des_profile->buffer,
- &(des_profile->hashcode),
- des_profile->buffer_size);
- des_profile->hash_is_valid = true;
- }
-
- if (pdev->using_blend_cs ||
- des_profile->hashcode != src_profile->hashcode)
+ if (pdev->using_blend_cs || !gsicc_profiles_equal(des_profile, src_profile))
color_mismatch = true;
/* Check if target supports alpha */
@@ -2588,7 +2608,7 @@ pdf14_put_image(gx_device * dev, gs_gstate * pgs, gx_device * target)
} else {
/* In this case, just color convert and maintain alpha. This is a case
where we either either blend in the right color space and have no
- alpha for the output device or hand back the wrong color space with
+ alpha for the output device or hand back the wrong color space with
alpha data. We choose the later. */
code = pdf14_put_image_color_convert(pdev, pgs, src_profile,
dev_target_profile, &buf, &buf_ptr, false, rect.p.x, rect.p.y,
@@ -2615,7 +2635,7 @@ pdf14_put_image(gx_device * dev, gs_gstate * pgs, gx_device * target)
/* We are going out to a device that supports tags */
if (deep) {
gx_blend_image_buffer16(buf_ptr, width, height, rowstride,
- buf->planestride, num_comp, bg);
+ buf->planestride, num_comp, bg, false);
} else {
gx_blend_image_buffer(buf_ptr, width, height, rowstride,
buf->planestride, num_comp, bg >> 8);
@@ -2660,7 +2680,7 @@ pdf14_put_image(gx_device * dev, gs_gstate * pgs, gx_device * target)
rect.p.x, rect.p.y, width, height, rowstride, alpha_offset,
tag_offset);
/* Right now code has number of rows written */
-
+
}
/* If code > 0 then put image worked. Let it finish and then exit */
@@ -2774,10 +2794,235 @@ pdf14_put_image(gx_device * dev, gs_gstate * pgs, gx_device * target)
return code;
}
+/* Overprint simulation with spots. Collapse to CMYK */
+static void
+template_spots_to_cmyk(byte *buf_ptr, int width, int height, int rowstride,
+ int planestride, int num_comp, int spot_start, int tag_offset,
+ cmyk_composite_map *map, bool keep_alpha)
+{
+ int comp_num;
+ uint cyan, magenta, yellow, black;
+ cmyk_composite_map *cmyk_map_entry;
+ int x, y;
+ int position;
+ byte comp, a;
+
+ for (y = 0; y < height; y++) {
+ position = y * rowstride;
+ for (x = 0; x < width; x++) {
+ a = buf_ptr[position + planestride * num_comp];
+ if (a != 0) {
+ cyan = buf_ptr[position] * frac_1;
+ magenta = buf_ptr[position + planestride] * frac_1;
+ yellow = buf_ptr[position + planestride * 2] * frac_1;
+ black = buf_ptr[position + planestride * 3] * frac_1;
+ cmyk_map_entry = &(map[4]);
+ for (comp_num = spot_start; comp_num < num_comp; comp_num++) {
+ comp = buf_ptr[position + planestride * comp_num];
+ cyan += cmyk_map_entry->c * comp;
+ magenta += cmyk_map_entry->m * comp;
+ yellow += cmyk_map_entry->y * comp;
+ black += cmyk_map_entry->k * comp;
+ cmyk_map_entry++;
+ }
+ cyan /= frac_1;
+ magenta /= frac_1;
+ yellow /= frac_1;
+ black /= frac_1;
+
+ if (cyan > 255)
+ cyan = 255;
+ if (magenta > 255)
+ magenta = 255;
+ if (yellow > 255)
+ yellow = 255;
+ if (black > 255)
+ black = 255;
+
+ buf_ptr[position] = cyan;
+ buf_ptr[position + planestride] = magenta;
+ buf_ptr[position + planestride * 2] = yellow;
+ buf_ptr[position + planestride * 3] = black;
+ }
+ if (keep_alpha) {
+ /* Move the alpha and tag data */
+ buf_ptr[position + planestride * 4] = a;
+ if (tag_offset > 0) {
+ buf_ptr[position + planestride * 5] =
+ buf_ptr[position + planestride * tag_offset];
+ }
+ } else {
+ /* Remove alpha but keep tags */
+ if (tag_offset > 0) {
+ buf_ptr[position + planestride * 4] =
+ buf_ptr[position + planestride * tag_offset];
+ }
+
+ }
+ position += 1;
+ }
+ }
+}
+
+static void
+template_spots_to_cmyk_16(byte *buf_ptr_, int width, int height, int rowstride,
+ int planestride, int num_comp, int spot_start, int tag_offset,
+ cmyk_composite_map *map, bool keep_alpha)
+{
+ int comp_num;
+ ulong cyan, magenta, yellow, black;
+ cmyk_composite_map *cmyk_map_entry;
+ int x, y;
+ int position;
+ ulong comp, a;
+ uint16_t *buf_ptr = (uint16_t *)(void *)buf_ptr_;
+
+ /* planestride and rowstride are in bytes, and we want them in shorts */
+ planestride >>= 1;
+ rowstride >>= 1;
+
+ for (y = 0; y < height; y++) {
+ position = y * rowstride;
+ for (x = 0; x < width; x++) {
+ a = buf_ptr[position + planestride * num_comp];
+ if (a != 0) {
+ cyan = (ulong)buf_ptr[position] * frac_1_long;
+ magenta = (ulong)buf_ptr[position + planestride] * frac_1_long;
+ yellow = (ulong)buf_ptr[position + planestride * 2] * frac_1_long;
+ black = (ulong)buf_ptr[position + planestride * 3] * frac_1_long;
+ cmyk_map_entry = &(map[4]);
+ for (comp_num = spot_start; comp_num < num_comp; comp_num++) {
+ comp = buf_ptr[position + planestride * comp_num];
+ cyan += (ulong)cmyk_map_entry->c * comp;
+ magenta += (ulong)cmyk_map_entry->m * comp;
+ yellow += (ulong)cmyk_map_entry->y * comp;
+ black += (ulong)cmyk_map_entry->k * comp;
+ cmyk_map_entry++;
+ }
+ cyan /= frac_1_long;
+ magenta /= frac_1_long;
+ yellow /= frac_1_long;
+ black /= frac_1_long;
+
+ if (cyan > 65535)
+ cyan = 65535;
+ if (magenta > 65535)
+ magenta = 65535;
+ if (yellow > 65535)
+ yellow = 65535;
+ if (black > 65535)
+ black = 65535;
+
+#if ARCH_IS_BIG_ENDIAN
+ buf_ptr[position] = cyan;
+ buf_ptr[position + planestride] = magenta;
+ buf_ptr[position + planestride * 2] = yellow;
+ buf_ptr[position + planestride * 3] = black;
+#else
+ ((byte *)&buf_ptr[position])[0] = cyan >> 8;
+ ((byte *)&buf_ptr[position])[1] = cyan;
+ ((byte *)&buf_ptr[position + planestride])[0] = magenta >> 8;
+ ((byte *)&buf_ptr[position + planestride])[1] = magenta;
+ ((byte *)&buf_ptr[position + planestride * 2])[0] = yellow >> 8;
+ ((byte *)&buf_ptr[position + planestride * 2])[1] = yellow;
+ ((byte *)&buf_ptr[position + planestride * 3])[0] = black >> 8;
+ ((byte *)&buf_ptr[position + planestride * 3])[1] = black;
+#endif
+ }
+ /* Move the alpha and tag data */
+#if ARCH_IS_BIG_ENDIAN
+ if (keep_alpha) {
+ buf_ptr[position + planestride * 4] = a;
+ if (tag_offset > 0) {
+ buf_ptr[position + planestride * 5] =
+ buf_ptr[position + planestride * tag_offset];
+ }
+ } else {
+ if (tag_offset > 0) {
+ buf_ptr[position + planestride * 4] =
+ buf_ptr[position + planestride * tag_offset];
+ }
+ }
+#else
+ if (keep_alpha) {
+ ((byte *)&buf_ptr[position + planestride * 4])[0] = a >> 8;
+ ((byte *)&buf_ptr[position + planestride * 4])[1] = a;
+ if (tag_offset > 0) {
+ ((byte *)&buf_ptr[position + planestride * 5])[0] =
+ buf_ptr[position + planestride * tag_offset] >> 8;
+ ((byte *)&buf_ptr[position + planestride * 5])[1] =
+ buf_ptr[position + planestride * tag_offset];
+ }
+ } else {
+ if (tag_offset > 0) {
+ ((byte *)&buf_ptr[position + planestride * 4])[0] =
+ buf_ptr[position + planestride * tag_offset] >> 8;
+ ((byte *)&buf_ptr[position + planestride * 4])[1] =
+ buf_ptr[position + planestride * tag_offset];
+ }
+ }
+#endif
+ position += 1;
+ }
+ }
+}
+
+static void
+pdf14_spots_to_cmyk(byte *buf_ptr, int width, int height, int rowstride,
+ int planestride, int num_comp, int spot_start, int tag_offset,
+ cmyk_composite_map *map, bool keep_alpha, bool deep)
+{
+ if (deep) {
+ if (keep_alpha) {
+ if (tag_offset > 0) {
+ template_spots_to_cmyk_16(buf_ptr, width, height, rowstride,
+ planestride, num_comp, spot_start, tag_offset,
+ map, true);
+ } else {
+ template_spots_to_cmyk_16(buf_ptr, width, height, rowstride,
+ planestride, num_comp, spot_start, 0,
+ map, true);
+ }
+ } else {
+ if (tag_offset > 0) {
+ template_spots_to_cmyk_16(buf_ptr, width, height, rowstride,
+ planestride, num_comp, spot_start, tag_offset,
+ map, false);
+ } else {
+ template_spots_to_cmyk_16(buf_ptr, width, height, rowstride,
+ planestride, num_comp, spot_start, 0,
+ map, false);
+ }
+ }
+ } else {
+ if (keep_alpha) {
+ if (tag_offset > 0) {
+ template_spots_to_cmyk(buf_ptr, width, height, rowstride,
+ planestride, num_comp, spot_start, tag_offset,
+ map, true);
+ } else {
+ template_spots_to_cmyk(buf_ptr, width, height, rowstride,
+ planestride, num_comp, spot_start, 0,
+ map, true);
+ }
+ } else {
+ if (tag_offset > 0) {
+ template_spots_to_cmyk(buf_ptr, width, height, rowstride,
+ planestride, num_comp, spot_start, tag_offset,
+ map, false);
+ } else {
+ template_spots_to_cmyk(buf_ptr, width, height, rowstride,
+ planestride, num_comp, spot_start, 0,
+ map, false);
+ }
+ }
+ }
+}
+
/* This is for the case where we have mixture of spots and additive color.
For example, RGB + spots or Gray + spots */
static void
-gx_blend_image_mixed_buffer(byte* buf_ptr, int width, int height, int rowstride,
+pdf14_blend_image_mixed_buffer(byte* buf_ptr, int width, int height, int rowstride,
int planestride, int num_comp, int spot_start)
{
int x, y;
@@ -2817,7 +3062,7 @@ gx_blend_image_mixed_buffer(byte* buf_ptr, int width, int height, int rowstride,
}
static void
-gx_blend_image_mixed_buffer16(byte* buf_ptr_, int width, int height, int rowstride,
+pdf14_blend_image_mixed_buffer16(byte* buf_ptr_, int width, int height, int rowstride,
int planestride, int num_comp, int spot_start)
{
uint16_t* buf_ptr = (uint16_t*)(void*)buf_ptr_;
@@ -2886,22 +3131,12 @@ pdf14_put_blended_image_cmykspot(gx_device* dev, gx_device* target,
int num_comp, uint16_t bg, bool has_tags, gs_int_rect rect_in,
gs_separations* pseparations, bool deep)
{
- const pdf14_device* pdev = (pdf14_device*)dev;
+ pdf14_device* pdev = (pdf14_device*)dev;
int code = 0;
- int x, y, tmp, comp_num, output_comp_num;
- gx_color_index color;
- gx_color_value cv[GX_DEVICE_COLOR_MAX_COMPONENTS];
- gx_color_value comp;
- int input_map[GX_DEVICE_COLOR_MAX_COMPONENTS];
- int output_map[GX_DEVICE_COLOR_MAX_COMPONENTS];
- int num_known_comp = 0;
- int output_num_comp = target->color_info.num_components;
- int num_sep = pseparations->num_separations++;
+ int y;
int num_rows_left;
int i;
- gx_drawing_color pdcolor;
gs_int_rect rect = rect_in;
- gs_fixed_rect rect_fixed;
int planestride = planestride_in;
int rowstride = rowstride_in;
byte* buf_ptr = NULL;
@@ -2914,38 +3149,13 @@ pdf14_put_blended_image_cmykspot(gx_device* dev, gx_device* target,
const byte* buf_ptrs[GS_CLIENT_COLOR_MAX_COMPONENTS];
int alpha_offset = num_comp;
int tag_offset = has_tags ? num_comp + 1 : 0;
-
- /*
- * The process color model for the PDF 1.4 compositor device is CMYK plus
- * spot colors. The target device may have only some of these colorants due
- * to the SeparationOrder device parameter. Thus we need to determine the
- * mapping between the PDF 1.4 compositor and the target device. Note:
- * There should not be a spot colorant in the PDF 1.4 device that is not
- * present in the target device.
- */
- /* Check if target processes CMYK colorants. */
- for (comp_num = 0; comp_num < 4; comp_num++) {
- const char* pcomp_name = (const char*)DeviceCMYKComponents[comp_num];
-
- output_comp_num = dev_proc(target, get_color_comp_index)
- (target, pcomp_name, strlen(pcomp_name), NO_COMP_NAME_TYPE);
- if (output_comp_num >= 0 &&
- output_comp_num < GX_DEVICE_COLOR_MAX_COMPONENTS) {
- output_map[num_known_comp] = output_comp_num;
- input_map[num_known_comp++] = comp_num;
- }
- }
- /* Check if target processes our spot colorants. */
- for (comp_num = 0; comp_num < num_sep; comp_num++) {
- output_comp_num = dev_proc(target, get_color_comp_index)
- (target, (const char*)(pseparations->names[comp_num].data),
- pseparations->names[comp_num].size, NO_COMP_NAME_TYPE);
- if (output_comp_num >= 0 &&
- output_comp_num < GX_DEVICE_COLOR_MAX_COMPONENTS) {
- output_map[num_known_comp] = output_comp_num;
- input_map[num_known_comp++] = comp_num + 4;
- }
- }
+ bool keep_native = pdev->overprint_sim && pdev->devn_params.page_spot_colors > 0;
+ gs_color_space *pcs;
+ gs_image1_t image;
+ gx_image_enum_common_t *info;
+ gx_image_plane_t planes[GS_IMAGE_MAX_COMPONENTS];
+ pdf14_buf *cm_result = NULL;
+ bool did_alloc;
/* Check if group color space is CMYK based */
code = dev_proc(target, get_profile)(target, &dev_target_profile);
@@ -2962,24 +3172,41 @@ pdf14_put_blended_image_cmykspot(gx_device* dev, gx_device* target,
src_profile = pdf14dev_profile->device_profile[GS_DEFAULT_DEVICE_PROFILE];
}
- /* Check if we have a color conversion issue */
- if (!(src_profile->hash_is_valid)) {
- gsicc_get_icc_buff_hash(src_profile->buffer,
- &(src_profile->hashcode),
- src_profile->buffer_size);
- src_profile->hash_is_valid = true;
+ /* If we have spot colors and are doing overprint simulation and the source
+ space is not CMYK due to a blending color space being used, then convert
+ base colors to CMYK so that we can properly blend the spot colors */
+ if (keep_native && src_profile->data_cs != gsCMYK) {
+
+ cm_result = pdf14_transform_color_buffer_no_matte(pgs, pdev->ctx, (gx_device *)dev, buf,
+ buf->data, src_profile, pgs->icc_manager->default_cmyk, 0, 0, buf->rect.q.x,
+ buf->rect.q.y, &did_alloc, buf->deep, false);
+ if (cm_result == NULL)
+ return_error(gs_error_VMerror);
+
+ /* Update */
+ buf = cm_result;
+ src_profile = pgs->icc_manager->default_cmyk;
+ num_comp = buf->n_chan - 1;
+ bg = 0;
+ tag_offset = has_tags ? num_comp + 1 : 0;
+ alpha_offset = num_comp;
+
+#if RAW_DUMP
+ buf_ptr = buf->data + (rect.p.y - buf->rect.p.y) * buf->rowstride + ((rect.p.x - buf->rect.p.x) << deep);
+ dump_raw_buffer(target->memory, height, width, buf->n_planes, planestride, rowstride,
+ "post_to_cmyk_for_spot_blend", buf_ptr, deep);
+ global_index++;
+#endif
}
- des_profile = dev_target_profile->device_profile[GS_DEFAULT_DEVICE_PROFILE];
- if (!(des_profile->hash_is_valid)) {
- gsicc_get_icc_buff_hash(des_profile->buffer,
- &(des_profile->hashcode),
- des_profile->buffer_size);
- des_profile->hash_is_valid = true;
+ /* Fix order map if needed */
+ for (i = 0; i < num_comp; i++) {
+ pdev->devn_params.separation_order_map[i] = i;
}
- if (pdev->using_blend_cs ||
- des_profile->hashcode != src_profile->hashcode)
+ /* Check if we have a color conversion issue */
+ des_profile = dev_target_profile->device_profile[GS_DEFAULT_DEVICE_PROFILE];
+ if (pdev->using_blend_cs || !gsicc_profiles_equal(des_profile, src_profile))
color_mismatch = true;
/* Check if target supports alpha */
@@ -2991,6 +3218,35 @@ pdf14_put_blended_image_cmykspot(gx_device* dev, gx_device* target,
/* Note. The logic below will need a little rework if we ever
have a device that has tags and alpha support */
if (supports_alpha) {
+
+ /* If doing simulated overprint, Bring the spot color channels into
+ CMYK. Data is planar and 16 bit data in native format. */
+ if (pdev->overprint_sim && pdev->devn_params.page_spot_colors > 0) {
+ cmyk_composite_map cmyk_map[GX_DEVICE_MAX_SEPARATIONS]; /* Fracs */
+
+ /* In the clist case, we need to get equiv spots out of the pseudo-band. */
+ if (pdev->pclist_device != NULL) {
+ gx_device_clist_reader *pcrdev = (gx_device_clist_reader *)(pdev->pclist_device);
+
+ code = clist_read_op_equiv_cmyk_colors(pcrdev, &(pdev->op_pequiv_cmyk_colors));
+ if (code < 0)
+ return code;
+ }
+ build_cmyk_map(dev, num_comp, &(pdev->op_pequiv_cmyk_colors), cmyk_map);
+
+ /* Now we go to big endian */
+ pdf14_spots_to_cmyk(buf_ptr, width, height, rowstride,
+ planestride, num_comp, src_profile->num_comps,
+ tag_offset, cmyk_map, true, deep);
+
+ /* Reset buffer information. We have CMYK+alpha and maybe tags */
+ buf->n_chan = buf->n_chan - buf->num_spots;
+ buf->n_planes = buf->n_planes - buf->num_spots;
+ buf->num_spots = 0;
+ num_comp = buf->n_chan - 1;
+ tag_offset = has_tags ? buf->n_planes - 1 : 0; /* Tags at end */
+ }
+
if (!color_mismatch) {
for (i = 0; i < buf->n_planes; i++)
buf_ptrs[i] = buf_ptr + i * planestride;
@@ -3023,37 +3279,81 @@ pdf14_put_blended_image_cmykspot(gx_device* dev, gx_device* target,
code = dev_proc(target, put_image) (target, target, buf_ptrs, num_comp,
rect.p.x, rect.p.y, width, height, rowstride, alpha_offset,
tag_offset);
- /* Right now code has number of rows written */
+ /* Right now code has number of rows written. Writing continues below */
}
} else {
/* Device could not handle the alpha data (we actually don't have
a device that does spot colorants and has an alpha channel so
- the above code is untested. Go ahead and
- preblend now and then color convert if needed */
+ the above code is untested. Go ahead and preblend now and then
+ color convert if needed */
#if RAW_DUMP
/* Dump before and after the blend to make sure we are doing that ok */
- dump_raw_buffer(target->memory, height, width, num_comp + 1, planestride, rowstride,
- "pre_final_blend", buf_ptr, deep);
+ dump_raw_buffer(target->memory, height, width, buf->n_planes, planestride, rowstride,
+ "pre_put_image_blend_image", buf_ptr, deep);
global_index++;
#endif
+
+ /* Delay the baking to big endian if we have to do spots to CMYK still. We will take
+ care of the conversion at that point */
if (color_mismatch && (src_profile->data_cs == gsRGB || src_profile->data_cs == gsGRAY)) {
if (deep) {
- gx_blend_image_mixed_buffer16(buf_ptr, width, height, rowstride,
+ pdf14_blend_image_mixed_buffer16(buf_ptr, width, height, rowstride,
planestride, num_comp, src_profile->num_comps);
} else {
- gx_blend_image_mixed_buffer(buf_ptr, width, height, rowstride,
+ pdf14_blend_image_mixed_buffer(buf_ptr, width, height, rowstride,
planestride, num_comp, src_profile->num_comps);
}
} else {
if (deep) {
gx_blend_image_buffer16(buf_ptr, width, height, rowstride,
- planestride, num_comp, bg);
+ planestride, num_comp, bg, keep_native);
} else {
gx_blend_image_buffer(buf_ptr, width, height, rowstride,
planestride, num_comp, bg >> 8);
}
}
+#if RAW_DUMP
+ dump_raw_buffer_be(target->memory, height, width, buf->n_planes, planestride, rowstride,
+ "post_put_image_blend_image", buf_ptr, deep);
+ global_index++;
+#endif
+
+ /* If doing simulated overprint, Bring the spot color channels into
+ CMYK. Data is planar and 16 bit data is still in native format. */
+ if (pdev->overprint_sim && pdev->devn_params.page_spot_colors > 0) {
+ cmyk_composite_map cmyk_map[GX_DEVICE_MAX_SEPARATIONS]; /* Fracs */
+
+ /* In the clist case, we need to get equiv spots out of the
+ pseudo-band. */
+ if (pdev->pclist_device != NULL) {
+ gx_device_clist_reader *pcrdev = (gx_device_clist_reader *)(pdev->pclist_device);
+ code = clist_read_op_equiv_cmyk_colors(pcrdev, &(pdev->op_pequiv_cmyk_colors));
+ if (code < 0)
+ return code;
+ }
+
+ build_cmyk_map(dev, num_comp, &(pdev->op_pequiv_cmyk_colors), cmyk_map);
+ pdf14_spots_to_cmyk(buf_ptr, width, height, rowstride,
+ planestride, num_comp, src_profile->num_comps,
+ tag_offset, cmyk_map, false, deep);
+
+ /* Reset buffer information. We have CMYK and maybe tags */
+ num_comp = 4;
+ alpha_offset = 0;
+ buf->n_chan = buf->n_chan - buf->num_spots - 1; /* No spots or alpha */
+ buf->n_planes = buf->n_planes - buf->num_spots - 1; /* No spots or alpha */
+ tag_offset = has_tags ? buf->n_chan : 0; /* Tags at end */
+ buf->num_spots = 0;
+
+#if RAW_DUMP
+ dump_raw_buffer(target->memory, height, width, buf->n_planes, planestride, rowstride,
+ "post_put_image_spot_to_cmyk", buf_ptr, deep);
+ global_index++;
+#endif
+ }
+
+ /* Map to the destination color space */
if (color_mismatch) {
code = pdf14_put_image_color_convert(pdev, pgs, src_profile, dev_target_profile,
&buf, &buf_ptr, true, rect.p.x, rect.p.y, width, height);
@@ -3063,19 +3363,20 @@ pdf14_put_blended_image_cmykspot(gx_device* dev, gx_device* target,
/* reset */
rowstride = buf->rowstride;
planestride = buf->planestride;
- num_comp = buf->n_chan - 1;
+ num_comp = buf->n_chan;
tag_offset = buf->has_tags ? buf->n_chan : 0;
}
-
#if RAW_DUMP
- /* Dump before and after the blend to make sure we are doing that ok */
- dump_raw_buffer_be(target->memory, height, width, num_comp, planestride, rowstride,
- "post_final_blend", buf_ptr, deep);
+ /* Dump after the CS transform */
+ dump_raw_buffer_be(target->memory, height, width, buf->n_planes, planestride, rowstride,
+ "post_put_image_color_convert", buf_ptr, deep);
global_index++;
/* clist_band_count++; */
#endif
- /* Try put_image again now */
+
+ /* Try put_image again. This can occur if the
+ target, like psdcmyk and tiffsep, support put_image */
alpha_offset = 0;
for (i = 0; i < buf->n_planes; i++)
buf_ptrs[i] = buf_ptr + i * planestride;
@@ -3083,13 +3384,14 @@ pdf14_put_blended_image_cmykspot(gx_device* dev, gx_device* target,
rect.p.x, rect.p.y, width, height,
rowstride, alpha_offset, tag_offset);
}
+
+ /* Put image was succesful. We processed some or all of the rows.
+ Continue until we are done */
if (code > 0) {
- /* We processed some or all of the rows. Continue until we are done */
num_rows_left = height - code;
while (num_rows_left > 0) {
code = dev_proc(target, put_image) (target, target, buf_ptrs, num_comp,
- rect.p.x, rect.p.y + code, width,
- num_rows_left, rowstride,
+ rect.p.x, rect.p.y + code, width, num_rows_left, rowstride,
alpha_offset, tag_offset);
if (code < 0) {
return code;
@@ -3099,123 +3401,78 @@ pdf14_put_blended_image_cmykspot(gx_device* dev, gx_device* target,
return 0;
}
- /* No put_image working at all. Resort to fill_rect */
-
- planestride = planestride_in;
- rowstride = rowstride_in;
-
- /* Clear all output colorants first */
- for (comp_num = 0; comp_num < output_num_comp; comp_num++)
- cv[comp_num] = 0;
-
- /* Send pixel data to the target device. */
- if (deep) {
- /* NOTE: buf_ptr points to big endian data */
- for (y = 0; y < height; y++) {
- for (x = 0; x < width; x++) {
-
- /* composite CMYKA, etc. pixel with over solid background */
-#define GET16_BE2NATIVE(v) \
-((((byte *)&(v))[0]<<8) | (((byte *)&(v))[1]))
- uint16_t a = GET16_BE2NATIVE(buf_ptr[x + planestride * num_comp]);
+ /* Sep devices all support put_image (tiffsep and psdcmyk)
+ as well as those devices that support alpha (pngalpha)
+ If we are here, then we are doing an overprint simulation
+ on some other device. Image data is aleady blended and in
+ device color space. */
+ code = gs_cspace_build_ICC(&pcs, NULL, pgs->memory);
+ if (code < 0)
+ return code;
- if (a == 0) {
- for (comp_num = 0; comp_num < num_known_comp; comp_num++) {
- cv[output_map[comp_num]] = bg;
- }
- } else if (a == 0xffff) {
- for (comp_num = 0; comp_num < num_known_comp; comp_num++) {
- comp = GET16_BE2NATIVE(buf_ptr[x + planestride * input_map[comp_num]]);
- cv[output_map[comp_num]] = comp;
- }
- } else {
- /* a ^= 0xff; */ /* No inversion here! Bug 689895 */
- for (comp_num = 0; comp_num < num_known_comp; comp_num++) {
- comp = GET16_BE2NATIVE(buf_ptr[x + planestride * input_map[comp_num]]);
- tmp = ((comp - bg) * a) + 0x8000;
- comp += (tmp + (tmp >> 16)) >> 16;
- cv[output_map[comp_num]] = comp;
- }
- }
+ /* Already in destination CS */
+ pcs->cmm_icc_profile_data = des_profile;
- /* If we have spot colors we need to encode and fill as a high level
- color if the device supports it which should always be the case
- if we are in this procedure */
- if (dev_proc(target, dev_spec_op)(target, gxdso_supports_devn, NULL, 0)) {
- for (i = 0; i < output_num_comp; i++) {
- pdcolor.colors.devn.values[i] = cv[i];
- }
- pdcolor.type = gx_dc_type_devn;
- rect_fixed.p.x = int2fixed(x + x0);
- rect_fixed.p.y = int2fixed(y + y0);
- rect_fixed.q.x = int2fixed(x + x0 + 1);
- rect_fixed.q.y = int2fixed(y + y0 + 1);
- code = dev_proc(target, fill_rectangle_hl_color)(target, &rect_fixed,
- NULL, &pdcolor, NULL);
- } else {
- /* encode as a color index */
- color = dev_proc(target, encode_color)(target, cv);
- code = dev_proc(target, fill_rectangle)(target, x + x0, y + y0, 1, 1, color);
- }
- if (code < 0)
- return code;
- }
+ /* pcs takes a reference to the profile data it just retrieved. */
+ gsicc_adjust_profile_rc(pcs->cmm_icc_profile_data, 1, "pdf14_put_blended_image_cmykspot");
+ gsicc_set_icc_range(&(pcs->cmm_icc_profile_data));
+ gs_image_t_init_adjust(&image, pcs, false);
+ image.ImageMatrix.xx = (float)width;
+ image.ImageMatrix.yy = (float)height;
+ image.Width = width;
+ image.Height = height;
+ image.BitsPerComponent = deep ? 16 : 8;
+ image.ColorSpace = pcs;
+ image.format = gs_image_format_component_planar;
- buf_ptr += rowstride;
- }
- } else {
- bg >>= 8;
- for (y = 0; y < height; y++) {
- for (x = 0; x < width; x++) {
+ ctm_only_writable(pgs).xx = (float)width;
+ ctm_only_writable(pgs).xy = 0;
+ ctm_only_writable(pgs).yx = 0;
+ ctm_only_writable(pgs).yy = (float)height;
+ ctm_only_writable(pgs).tx = (float)rect.p.x;
+ ctm_only_writable(pgs).ty = (float)rect.p.y;
+ code = dev_proc(target, begin_typed_image) (target,
+ pgs, NULL, (gs_image_common_t *)&image,
+ NULL, NULL, NULL, pgs->memory, &info);
+ if (code < 0) {
+ rc_decrement_only_cs(pcs, "pdf14_put_blended_image_cmykspot");
+ return code;
+ }
+#if RAW_DUMP
+ /* Dump the current buffer to see what we have. */
+ dump_raw_buffer(pdev->ctx->memory,
+ pdev->ctx->stack->rect.q.y - pdev->ctx->stack->rect.p.y,
+ pdev->ctx->stack->rect.q.x - pdev->ctx->stack->rect.p.x,
+ pdev->ctx->stack->n_planes,
+ pdev->ctx->stack->planestride, pdev->ctx->stack->rowstride,
+ "put_image_final_big", pdev->ctx->stack->data, deep);
+ dump_raw_buffer(pdev->ctx->memory,
+ height, width, buf->n_planes,
+ pdev->ctx->stack->planestride, pdev->ctx->stack->rowstride,
+ "put_image_final_small", buf_ptr, deep);
+ global_index++;
+ clist_band_count++;
+#endif
- /* composite CMYKA, etc. pixel with over solid background */
- byte a = buf_ptr[x + planestride * num_comp];
+ for (i = 0; i < num_comp; i++) {
+ planes[i].data = buf_ptr + i * planestride;
+ planes[i].data_x = 0;
+ planes[i].raster = buf->rowstride;
+ }
- if ((a + 1) & 0xfe) {
- /* a ^= 0xff; */ /* No inversion here! Bug 689895 */
- for (comp_num = 0; comp_num < num_known_comp; comp_num++) {
- comp = buf_ptr[x + planestride * input_map[comp_num]];
- tmp = ((comp - bg) * a) + 0x80;
- comp += tmp + (tmp >> 8);
- cv[output_map[comp_num]] = comp;
- }
- } else if (a == 0) {
- for (comp_num = 0; comp_num < num_known_comp; comp_num++) {
- cv[output_map[comp_num]] = bg;
- }
- } else {
- for (comp_num = 0; comp_num < num_known_comp; comp_num++) {
- comp = buf_ptr[x + planestride * input_map[comp_num]];
- cv[output_map[comp_num]] = (comp << 8) + comp;
- }
- }
+ for (y = 0; y < height; y++) {
+ int rows_used;
- /* If we have spot colors we need to encode and fill as a high level
- color if the device supports it which should always be the case
- if we are in this procedure */
- if (dev_proc(target, dev_spec_op)(target, gxdso_supports_devn, NULL, 0)) {
- for (i = 0; i < output_num_comp; i++) {
- pdcolor.colors.devn.values[i] = cv[i];
- }
- pdcolor.type = gx_dc_type_devn;
- rect_fixed.p.x = int2fixed(x + x0);
- rect_fixed.p.y = int2fixed(y + y0);
- rect_fixed.q.x = int2fixed(x + x0 + 1);
- rect_fixed.q.y = int2fixed(y + y0 + 1);
- code = dev_proc(target, fill_rectangle_hl_color)(target, &rect_fixed,
- NULL, &pdcolor, NULL);
- } else {
- /* encode as a color index */
- color = dev_proc(target, encode_color)(target, cv);
- code = dev_proc(target, fill_rectangle)(target, x + x0, y + y0, 1, 1, color);
- }
- if (code < 0)
- return code;
- }
+ info->procs->plane_data(info, (const gx_image_plane_t*) &planes, 1, &rows_used);
- buf_ptr += rowstride;
+ for (i = 0; i < num_comp; i++) {
+ planes[i].data += buf->rowstride;
}
}
+ info->procs->end_image(info, true);
+
+ /* This will also decrement the profile */
+ rc_decrement_only_cs(pcs, "pdf14_put_blended_image_cmykspot");
return code;
}
@@ -3372,7 +3629,7 @@ static void pdf14_cleanup_group_color_profiles (pdf14_device *pdev)
gsicc_adjust_profile_rc(pdev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE],
-1, "pdf14_end_transparency_group");
- pdev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE] =
+ pdev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE] =
group_color_info->icc_profile;
group_color_info->icc_profile = NULL;
}
@@ -3505,7 +3762,7 @@ gs_pdf14_device_copy_params(gx_device *dev, const gx_device *target)
in the PDF14 device without messing up the target device profile.
Also if the device is using a blend color space it will grab that too */
if (dev->icc_struct == NULL) {
- dev->icc_struct = gsicc_new_device_profile_array(dev->memory);
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
profile_dev14 = dev->icc_struct;
dev_proc((gx_device *) target, get_profile)((gx_device *) target,
&(profile_targ));
@@ -3526,6 +3783,7 @@ gs_pdf14_device_copy_params(gx_device *dev, const gx_device *target)
dev->icc_struct->pageneutralcolor = profile_targ->pageneutralcolor;
dev->icc_struct->supports_devn = profile_targ->supports_devn;
dev->icc_struct->usefastcolor = profile_targ->usefastcolor;
+ dev->icc_struct->blacktext = profile_targ->blacktext;
if (pdev->using_blend_cs) {
/* Swap the device profile and the blend profile. */
@@ -3538,7 +3796,7 @@ gs_pdf14_device_copy_params(gx_device *dev, const gx_device *target)
profile_dev14->blend_profile = profile_targ->device_profile[GS_DEFAULT_DEVICE_PROFILE];
profile_dev14->device_profile[GS_DEFAULT_DEVICE_PROFILE] = profile_targ->blend_profile;
}
- profile_dev14->sim_overprint = profile_targ->sim_overprint;
+ profile_dev14->overprint_control = profile_targ->overprint_control;
}
#undef COPY_ARRAY_PARAM
#undef COPY_PARAM
@@ -3628,7 +3886,7 @@ pdf14_set_marking_params(gx_device *dev, const gs_gstate *pgs)
}
pdev->alpha = pdev->opacity * pdev->shape;
pdev->blend_mode = pgs->blend_mode;
- if (pdev->icc_struct->sim_overprint) {
+ if (pdev->icc_struct->overprint_control != gs_overprint_control_disable) {
pdev->overprint = pgs->overprint;
pdev->stroke_overprint = pgs->stroke_overprint;
} else {
@@ -3666,8 +3924,12 @@ update_lop_for_pdf14(gs_gstate *pgs, const gx_drawing_color *pdcolor)
hastrans = true;
}
}
- /* The only idempotent blend modes are Normal, Darken and Lighten */
- if ((pgs->blend_mode != BLEND_MODE_Normal && pgs->blend_mode != BLEND_MODE_Darken && pgs->blend_mode != BLEND_MODE_Lighten) ||
+ /* The only idempotent blend modes are Normal, Darken and Lighten.
+ This appears to be the only place where this test is done so
+ not adding a is_idempotent method */
+ if ((pgs->blend_mode != BLEND_MODE_Normal &&
+ pgs->blend_mode != BLEND_MODE_Darken &&
+ pgs->blend_mode != BLEND_MODE_Lighten) ||
(pgs->fillconstantalpha != 1.0) ||
(pgs->strokeconstantalpha != 1.0) ||
(hastrans))
@@ -3810,7 +4072,8 @@ pdf14_fill_path(gx_device *dev, const gs_gstate *pgs,
return code;
}
}
- if (gx_dc_is_pattern2_color(pdcolor)) {
+ if (gx_dc_is_pattern2_color(pdcolor) ||
+ pdcolor->type == &gx_dc_devn_masked) {
/* Non-idempotent blends require a transparency
* group to be pushed because shadings might
* paint several pixels twice. */
@@ -4086,11 +4349,11 @@ pdf14_fill_stroke_path(gx_device *dev, const gs_gstate *cpgs, gx_path *ppath,
/* If we are in an overprint situation, set the blend mode to compatible
overprint */
- if (p14dev->icc_struct->sim_overprint && pgs->overprint &&
+ if ((p14dev->icc_struct->overprint_control != gs_overprint_control_disable) && pgs->overprint &&
dev->color_info.polarity == GX_CINFO_POLARITY_SUBTRACTIVE)
(void)gs_setblendmode(pgs, BLEND_MODE_CompatibleOverprint); /* Can never fail */
code = pdf14_fill_path(dev, pgs, ppath, fill_params, pdcolor_fill, pcpath);
- if (p14dev->icc_struct->sim_overprint && pgs->overprint &&
+ if ((p14dev->icc_struct->overprint_control != gs_overprint_control_disable) && pgs->overprint &&
dev->color_info.polarity == GX_CINFO_POLARITY_SUBTRACTIVE)
(void)gs_setblendmode(pgs, blend_mode); /* Can never fail */
if (code < 0)
@@ -4101,7 +4364,7 @@ pdf14_fill_stroke_path(gx_device *dev, const gs_gstate *cpgs, gx_path *ppath,
gs_swapcolors_quick(pgs);
p14dev->op_state = PDF14_OP_STATE_STROKE;
- if (p14dev->icc_struct->sim_overprint && pgs->stroke_overprint &&
+ if ((p14dev->icc_struct->overprint_control != gs_overprint_control_disable) && pgs->stroke_overprint &&
dev->color_info.polarity == GX_CINFO_POLARITY_SUBTRACTIVE)
(void)gs_setblendmode(pgs, BLEND_MODE_CompatibleOverprint); /* Can never fail */
code = pdf14_stroke_path(dev, pgs, ppath, stroke_params, pdcolor_stroke, pcpath);
@@ -4109,6 +4372,14 @@ pdf14_fill_stroke_path(gx_device *dev, const gs_gstate *cpgs, gx_path *ppath,
gs_swapcolors_quick(pgs);
if (code < 0)
goto cleanup;
+ /* Bug 703324 we need to reset the fill constant alpha in the graphics
+ * state to the correct saved value. We also need to reset the 'opacity' member of the
+ * device, because some device methods (eg fill_masked_image) don't take a graphics
+ * state pointer as a parameter and so are unable to set the opacity value themselves.
+ * We therefore need to make sure it is set according to the current fill state.
+ */
+ (void)gs_setfillconstantalpha(pgs, fill_alpha);
+ pdf14_set_marking_params(dev, pgs);
}
cleanup:
@@ -5148,7 +5419,15 @@ pdf14_forward_open_device(gx_device * dev)
static void
pdf14_forward_device_procs(gx_device * dev)
{
- gx_device_forward * pdev = (gx_device_forward *)dev;
+ gx_device_forward *pdev = (gx_device_forward *)dev;
+ pdf14_device *p14dev = (pdf14_device*)dev;
+
+ /* If doing simulated overprint with spot colors
+ then makes sure to reset devn setting */
+ if (p14dev->overprint_sim &&
+ p14dev->color_info.num_components > 4)
+ p14dev->icc_struct->supports_devn =
+ p14dev->target_support_devn;
/*
* We are using gx_device_forward_fill_in_procs to set the various procs.
@@ -5270,7 +5549,7 @@ pdf14_determine_default_blend_cs(gx_device * pdev, bool use_pdf14_accum,
const char * pcomp_name = (const char *)DeviceCMYKComponents[i];
output_comp_num = dev_proc(pdev, get_color_comp_index)
- (pdev, pcomp_name, strlen(pcomp_name), NO_COMP_NAME_TYPE);
+ (pdev, pcomp_name, strlen(pcomp_name), NO_COMP_NAME_TYPE_OP);
if (output_comp_num >= 0) {
num_cmyk++;
if (output_comp_num != GX_DEVICE_COLOR_MAX_COMPONENTS)
@@ -5330,6 +5609,17 @@ get_pdf14_device_proto(gx_device * dev, pdf14_device ** pdevproto,
pdf14_determine_default_blend_cs(dev, use_pdf14_accum,
&using_blend_cs);
bool deep = device_is_deep(dev);
+ int num_spots = pdf14pct->params.num_spot_colors;
+
+ /* overprint overide */
+ if (pdf14pct->params.overprint_sim_push) {
+ using_blend_cs = false;
+ if (pdf14pct->params.num_spot_colors_int > 0) {
+ dev_cs = PDF14_DeviceCMYKspot;
+ num_spots = pdf14pct->params.num_spot_colors_int;
+ } else
+ dev_cs = PDF14_DeviceCMYK;
+ }
switch (dev_cs) {
case PDF14_DeviceGray:
@@ -5372,13 +5662,11 @@ get_pdf14_device_proto(gx_device * dev, pdf14_device ** pdevproto,
* of the process components and the number of spot colors
* for the page.
*/
- if (pdf14pct->params.num_spot_colors >= 0) {
+ if (num_spots >= 0) {
*ptempdevproto = **pdevproto;
- ptempdevproto->devn_params.page_spot_colors =
- pdf14pct->params.num_spot_colors;
+ ptempdevproto->devn_params.page_spot_colors = num_spots;
ptempdevproto->color_info.num_components =
- ptempdevproto->devn_params.num_std_colorant_names +
- pdf14pct->params.num_spot_colors;
+ ptempdevproto->devn_params.num_std_colorant_names + num_spots;
if (ptempdevproto->color_info.num_components >
GS_CLIENT_COLOR_MAX_COMPONENTS)
ptempdevproto->color_info.num_components =
@@ -5411,6 +5699,7 @@ get_pdf14_device_proto(gx_device * dev, pdf14_device ** pdevproto,
return_error(gs_error_rangecheck);
}
ptempdevproto->using_blend_cs = using_blend_cs;
+ ptempdevproto->overprint_sim = pdf14pct->params.overprint_sim_push;
return 0;
}
@@ -5503,7 +5792,12 @@ pdf14_recreate_device(gs_memory_t *mem, gs_gstate * pgs,
pdev->color_info = dev_proto->color_info;
pdev->pad = target->pad;
pdev->log2_align_mod = target->log2_align_mod;
- pdev->is_planar = target->is_planar;
+
+ if (pdf14pct->params.overprint_sim_push && pdf14pct->params.num_spot_colors_int > 0 && !target->is_planar)
+ pdev->is_planar = true;
+ else
+ pdev->is_planar = target->is_planar;
+
pdev->procs = dev_proto->procs;
if (deep) {
set_dev_proc(pdev, encode_color, pdf14_encode_color16);
@@ -5516,7 +5810,11 @@ pdf14_recreate_device(gs_memory_t *mem, gs_gstate * pgs,
}
dev->static_procs = dev_proto->static_procs;
gx_device_set_procs(dev);
- gx_device_fill_in_procs(dev);
+ pdev->color_info.separable_and_linear = GX_CINFO_SEP_LIN_STANDARD;
+ gx_device_fill_in_procs((gx_device *)pdev);
+ pdev->save_get_cmap_procs = pgs->get_cmap_procs;
+ pgs->get_cmap_procs = pdf14_get_cmap_procs;
+ gx_set_cmap_procs(pgs, (gx_device *)pdev);
check_device_separable(dev);
return dev_proc(pdev, open_device)(dev);
}
@@ -5655,7 +5953,6 @@ pdf14_forward_create_compositor(gx_device * dev, gx_device * * pcdev,
{
pdf14_device *pdev = (pdf14_device *)dev;
gx_device * tdev = pdev->target;
- gx_device * ndev;
int code;
*pcdev = dev;
@@ -5666,11 +5963,14 @@ pdf14_forward_create_compositor(gx_device * dev, gx_device * * pcdev,
return gx_update_pdf14_compositor(dev, pgs, pdf14pct, mem);
return 0;
}
- code = dev_proc(tdev, create_compositor)(tdev, &ndev, pct, pgs, mem, cdev);
- if (code < 0)
- return code;
- gx_device_set_target((gx_device_forward *)pdev, ndev);
- return 0;
+ code = dev_proc(tdev, create_compositor)(tdev, pcdev, pct, pgs, mem, cdev);
+ if (code == 1) {
+ /* We have created a new compositor that wrapped tdev. This means
+ * that our target should be updated to point to that. */
+ gx_device_set_target((gx_device_forward *)pdev, *pcdev);
+ code = 0; /* We have not created a new compositor that wrapped dev. */
+ }
+ return code;
}
/*
@@ -5871,7 +6171,7 @@ pdf14_copy_mono(gx_device * dev,
sbit = sourcex & 7;
first_bit = 7 - sbit;
- /* Loop through the height of the specfied area. */
+ /* Loop through the height of the specified area. */
while (h-- > 0) {
/* Set up for the start of each line of the area. */
sptr = line;
@@ -5926,9 +6226,300 @@ pdf14_copy_mono(gx_device * dev,
return 0;
}
+/* Added to avoid having to go back and forth between fixed and int
+ in some of the internal methods used for dealing with tiling
+ and devn colors */
+static int
+pdf14_fill_rectangle_devn(gx_device *dev, int x, int y, int w, int h,
+ const gx_drawing_color *pdcolor)
+{
+ pdf14_device *pdev = (pdf14_device *)dev;
+ pdf14_buf *buf;
+ int code;
+
+ fit_fill_xywh(dev, x, y, w, h);
+ if (w <= 0 || h <= 0)
+ return 0;
+
+ code = pdf14_initialize_ctx(dev, dev->color_info.num_components,
+ dev->color_info.polarity != GX_CINFO_POLARITY_SUBTRACTIVE, NULL);
+ if (code < 0)
+ return code;
+ buf = pdev->ctx->stack;
+
+ if (buf->knockout)
+ return pdf14_mark_fill_rectangle_ko_simple(dev, x, y, w, h, 0, pdcolor,
+ true);
+ else
+ return pdf14_mark_fill_rectangle(dev, x, y, w, h, 0, pdcolor, true);
+}
+
+/* Step through and do rect fills with the devn colors as
+ we hit each transition in the bitmap. It is possible
+ that one of the colors is not devn, but is pure and
+ is set to gx_no_color_index. This type of mix happens
+ for example from tile_clip_fill_rectangle_hl_color */
+static int
+pdf14_copy_mono_devn(gx_device *dev,
+ const byte *base, int sourcex, int sraster,
+ int x, int y, int w, int h, const gx_drawing_color *pdcolor0,
+ const gx_drawing_color *pdcolor1)
+{
+ const byte *sptr;
+ const byte *line;
+ int sbit, first_bit;
+ int code, sbyte, bit, count;
+ int run_length, startx, current_bit, bit_value;
+ const gx_drawing_color *current_color;
+
+ if ((x | y) < 0) {
+ if (x < 0) {
+ w += x;
+ sourcex -= x;
+ x = 0;
+ }
+ if (y < 0) {
+ h += y;
+ base -= (int)(y * sraster);
+ y = 0;
+ }
+ }
+ if (w > (dev)->width - x)
+ w = (dev)->width - x;
+ if (h > (dev)->height - y)
+ h = (dev)->height - y;
+ if (w <= 0 || h <= 0)
+ return 0;
+
+ line = base + (sourcex >> 3);
+ sbit = sourcex & 7;
+ first_bit = 7 - sbit;
+
+ /* Loop through the height of the specified area. */
+ while (h-- > 0) {
+ /* Set up for the start of each line of the area. */
+ sptr = line;
+ sbyte = *sptr++;
+ bit = first_bit;
+ count = w;
+ run_length = 0;
+ startx = x;
+ current_bit = 0;
+ current_color = pdcolor0;
+
+ /* Loop across each pixel of a line. */
+ do {
+ bit_value = (sbyte >> bit) & 1;
+ if (bit_value == current_bit) {
+ /* The value did not change, simply increment our run length */
+ run_length++;
+ } else {
+ /* The value changed, fill the current rectangle. */
+ if (run_length != 0) {
+ if (current_color->type != gx_dc_type_pure &&
+ current_color->colors.pure != gx_no_color_index) {
+ code = pdf14_fill_rectangle_devn(dev, startx, y,
+ run_length, 1, current_color);
+ if (code < 0)
+ return code;
+ }
+ startx += run_length;
+ }
+ run_length = 1;
+ current_color = bit_value ? pdcolor1 : pdcolor0;
+ current_bit = bit_value;
+ }
+
+ /* Move to the next input bit. */
+ if (bit == 0) {
+ bit = 7;
+ sbyte = *sptr++;
+ } else
+ bit--;
+ } while (--count > 0);
+
+ /* Fill the last rectangle in the line. */
+ if (run_length != 0 && current_color->type != gx_dc_type_pure &&
+ current_color->colors.pure != gx_no_color_index) {
+ code = pdf14_fill_rectangle_devn(dev, startx, y,
+ run_length, 1, current_color);
+ if (code < 0)
+ return code;
+ }
+ /* Move to the next line */
+ line += sraster;
+ y++;
+ }
+ return 0;
+}
+
+/* Step through the tiles doing essentially copy_mono but with devn colors */
+static int
+pdf14_impl_strip_tile_rectangle_devn(gx_device *dev, const gx_strip_bitmap *tiles,
+ int x, int y, int w, int h, const gx_drawing_color *pdcolor0,
+ const gx_drawing_color *pdcolor1, int px, int py)
+{ /* Fill the rectangle in chunks. */
+ int width = tiles->size.x;
+ int height = tiles->size.y;
+ int raster = tiles->raster;
+ int rwidth = tiles->rep_width;
+ int rheight = tiles->rep_height;
+ int shift = tiles->shift;
+
+ if (rwidth == 0 || rheight == 0)
+ return_error(gs_error_unregistered);
+ fit_fill_xy(dev, x, y, w, h);
+
+ {
+ int xoff = (shift == 0 ? px :
+ px + (y + py) / rheight * tiles->rep_shift);
+ int irx = ((rwidth & (rwidth - 1)) == 0 ? /* power of 2 */
+ (x + xoff) & (rwidth - 1) :
+ (x + xoff) % rwidth);
+ int ry = ((rheight & (rheight - 1)) == 0 ? /* power of 2 */
+ (y + py) & (rheight - 1) :
+ (y + py) % rheight);
+ int icw = width - irx;
+ int ch = height - ry;
+ byte *row = tiles->data + ry * raster;
+ int code = 0;
+
+ if (ch >= h) { /* Shallow operation */
+ if (icw >= w) { /* Just one (partial) tile to transfer. */
+ code = pdf14_copy_mono_devn(dev, row, irx, raster, x, y,
+ w, h, pdcolor0, pdcolor1);
+ if (code < 0)
+ return_error(code);
+ } else {
+ int ex = x + w;
+ int fex = ex - width;
+ int cx = x + icw;
+
+ code = pdf14_copy_mono_devn(dev, row, irx, raster,
+ x, y, icw, h, pdcolor0, pdcolor1);
+ if (code < 0)
+ return_error(code);
+
+ while (cx <= fex) {
+ code = pdf14_copy_mono_devn(dev, row, 0, raster, cx, y,
+ width, h, pdcolor0, pdcolor1);
+ if (code < 0)
+ return_error(code);
+ cx += width;
+ }
+ if (cx < ex) {
+ code = pdf14_copy_mono_devn(dev, row, 0, raster, cx, y,
+ ex - cx, h, pdcolor0, pdcolor1);
+ if (code < 0)
+ return_error(code);
+ }
+ }
+ } else if (icw >= w && shift == 0) {
+ /* Narrow operation, no shift */
+ int ey = y + h;
+ int fey = ey - height;
+ int cy = y + ch;
+
+ code = pdf14_copy_mono_devn(dev, row, irx, raster,
+ x, y, w, ch, pdcolor0, pdcolor1);
+ if (code < 0)
+ return_error(code);
+ row = tiles->data;
+ do {
+ ch = (cy > fey ? ey - cy : height);
+ code = pdf14_copy_mono_devn(dev, row, irx, raster,
+ x, cy, w, ch, pdcolor0, pdcolor1);
+ if (code < 0)
+ return_error(code);
+ } while ((cy += ch) < ey);
+ } else {
+ /* Full operation. If shift != 0, some scan lines */
+ /* may be narrow. We could test shift == 0 in advance */
+ /* and use a slightly faster loop, but right now */
+ /* we don't bother. */
+ int ex = x + w, ey = y + h;
+ int fex = ex - width, fey = ey - height;
+ int cx, cy;
+
+ for (cy = y;;) {
+ if (icw >= w) {
+ code = pdf14_copy_mono_devn(dev, row, irx, raster,
+ x, cy, w, ch, pdcolor0, pdcolor1);
+ if (code < 0)
+ return_error(code);
+ } else {
+ code = pdf14_copy_mono_devn(dev, row, irx, raster,
+ x, cy, icw, ch, pdcolor0, pdcolor1);
+ if (code < 0)
+ return_error(code);
+ cx = x + icw;
+ while (cx <= fex) {
+ code = pdf14_copy_mono_devn(dev, row, 0, raster,
+ cx, cy, width, ch, pdcolor0, pdcolor1);
+ if (code < 0)
+ return_error(code);
+ cx += width;
+ }
+ if (cx < ex) {
+ code = pdf14_copy_mono_devn(dev, row, 0, raster,
+ cx, cy, ex - cx, ch, pdcolor0, pdcolor1);
+ if (code < 0)
+ return_error(code);
+ }
+ }
+ if ((cy += ch) >= ey)
+ break;
+ ch = (cy > fey ? ey - cy : height);
+ if ((irx += shift) >= rwidth)
+ irx -= rwidth;
+ icw = width - irx;
+ row = tiles->data;
+ }
+ }
+ }
+ return 0;
+}
+
+/* pdf14 device supports devn */
+static int
+pdf14_strip_tile_rect_devn(gx_device *dev, const gx_strip_bitmap *tiles,
+ int x, int y, int w, int h,
+ const gx_drawing_color *pdcolor0,
+ const gx_drawing_color *pdcolor1, int px, int py)
+{
+ pdf14_device *pdev = (pdf14_device *)dev;
+ pdf14_buf *buf = pdev->ctx->stack;
+ int num_comp = buf->n_chan - 1;
+ int k;
+ bool same = false;
+ int code = 0;
+
+ /* if color0 is identical to color1, do rect fill */
+ if (pdcolor0->type == gx_dc_type_devn && pdcolor1->type == gx_dc_type_devn) {
+ same = true;
+ for (k = 0; k < num_comp; k++) {
+ if (pdcolor0->colors.devn.values[k] != pdcolor1->colors.devn.values[k]) {
+ same = false;
+ break;
+ }
+ }
+ }
+
+ if (same) {
+ code = pdf14_fill_rectangle_devn(dev, x, y, w, h, pdcolor0);
+ } else {
+ /* Go through the tile stepping using code stolen from
+ gx_default_strip_tile_rectangle and call the rect fills
+ using code stolen from pdf14_copy_mono but using devn
+ colors */
+ code = pdf14_impl_strip_tile_rectangle_devn(dev, tiles,
+ x, y, w, h, pdcolor0, pdcolor1, px, py);
+ }
+ return code;
+}
+
/* Used in a few odd cases where the target device is planar and we have
a planar tile (pattern) and we are copying it into place here */
-
static int
pdf14_copy_planes(gx_device * dev, const byte * data, int data_x, int raster,
gx_bitmap_id id, int x, int y, int w, int h, int plane_height)
@@ -6000,15 +6591,16 @@ pdf14_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect,
int w = fixed2int(rect->q.x) - x;
int h = fixed2int(rect->q.y) - y;
+ fit_fill_xywh(dev, x, y, w, h);
+ if (w <= 0 || h <= 0)
+ return 0;
+
code = pdf14_initialize_ctx(dev, dev->color_info.num_components,
dev->color_info.polarity != GX_CINFO_POLARITY_SUBTRACTIVE, pgs);
if (code < 0)
return code;
buf = pdev->ctx->stack;
- fit_fill_xywh(dev, x, y, w, h);
- if (w <= 0 || h <= 0)
- return 0;
if (buf->knockout)
return pdf14_mark_fill_rectangle_ko_simple(dev, x, y, w, h, 0, pdcolor,
true);
@@ -6024,6 +6616,10 @@ pdf14_fill_rectangle(gx_device * dev,
pdf14_buf *buf;
int code;
+ fit_fill_xywh(dev, x, y, w, h);
+ if (w <= 0 || h <= 0)
+ return 0;
+
code = pdf14_initialize_ctx(dev, dev->color_info.num_components,
dev->color_info.polarity != GX_CINFO_POLARITY_SUBTRACTIVE, NULL);
if (code < 0)
@@ -6031,9 +6627,6 @@ pdf14_fill_rectangle(gx_device * dev,
buf = pdev->ctx->stack;
- fit_fill_xywh(dev, x, y, w, h);
- if (w <= 0 || h <= 0)
- return 0;
if (buf->knockout)
return pdf14_mark_fill_rectangle_ko_simple(dev, x, y, w, h, color, NULL,
false);
@@ -6139,13 +6732,7 @@ pdf14_begin_transparency_group(gx_device* dev,
if (group_profile != NULL) {
/* If we have a non-isolated group and the color space is different,
we will need to CM the backdrop. */
- if (!(group_profile->hash_is_valid)) {
- gsicc_get_icc_buff_hash(group_profile->buffer,
- &(group_profile->hashcode),
- group_profile->buffer_size);
- group_profile->hash_is_valid = true;
- }
- if (group_profile->hashcode != tos_profile->hashcode) {
+ if (!gsicc_profiles_equal(group_profile, tos_profile)) {
cm_back_drop = true;
}
}
@@ -6216,6 +6803,9 @@ pdf14_pop_color_model(gx_device* dev, pdf14_group_color_t* group_color)
-1, "pdf14_pop_color_model");
pdev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE] =
group_color->icc_profile;
+
+ gsicc_adjust_profile_rc(pdev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE],
+ 1, "pdf14_pop_color_model");
}
}
}
@@ -6404,7 +6994,7 @@ pdf14_push_color_model(gx_device *dev, gs_transparency_color_t group_color_type,
break;
}
- if (group_color_type == ICC && iccprofile != NULL) {
+ if (group_color_type == ICC && iccprofile != NULL) {
group_color->icc_profile = iccprofile;
gsicc_adjust_profile_rc(iccprofile, 1, "pdf14_push_color_model");
}
@@ -6465,6 +7055,7 @@ pdf14_push_color_model(gx_device *dev, gs_transparency_color_t group_color_type,
/* iccprofile was incremented above if we had not just created it.
When we do the pop we will decrement and if we just created it, it
will be destroyed */
+ gsicc_adjust_profile_rc(dev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE], -1, "pdf14_push_color_model");
dev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE] = iccprofile;
}
return group_color;
@@ -6609,7 +7200,7 @@ pdf14_clist_push_color_model(gx_device *dev, gx_device* cdev, gs_gstate *pgs,
break;
case ICC:
/* Check if the profile is different. */
- if (old_profile->hashcode != new_profile->hashcode) {
+ if (!gsicc_profiles_equal(old_profile, new_profile)) {
update_color_info = true;
new_num_comps = new_profile->num_comps;
new_depth = new_profile->num_comps * (8 << deep);
@@ -6975,6 +7566,8 @@ pdf14_end_transparency_mask(gx_device *dev, gs_gstate *pgs)
gsicc_adjust_profile_rc(dev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE],
-1, "pdf14_end_transparency_mask");
dev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE] = group_color->icc_profile;
+ gsicc_adjust_profile_rc(dev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE],
+ 1, "pdf14_end_transparency_mask");
}
}
}
@@ -7115,8 +7708,25 @@ do_mark_fill_rectangle_ko_simple(gx_device *dev, int x, int y, int w, int h,
}
/* Complement the results for subtractive color spaces */
if (additive) {
- for (k = 0; k < num_chan; ++k)
- dst_ptr[k * planestride] = dst[k];
+ if (!overprint) {
+ for (k = 0; k < num_chan; ++k)
+ dst_ptr[k * planestride] = dst[k];
+ } else {
+ /* Hybrid additive with subtractive spots */
+ /* We may have to do the compatible overprint blending */
+ if (!buf->isolated && drawn_comps != (((size_t)1 << (size_t)dev->color_info.num_components) - (size_t)1)) {
+ art_pdf_composite_knockout_8(dst2, src, num_comp,
+ blend_mode, pdev->blend_procs, pdev);
+ }
+ for (k = 0, comps = drawn_comps; k < num_comp; ++k, comps >>= 1) {
+ if ((comps & 0x1) != 0) {
+ dst_ptr[k * planestride] = dst[k];
+ } else {
+ /* Compatible overprint blend result. */
+ dst_ptr[k * planestride] = dst2[k];
+ }
+ }
+ }
} else {
if (overprint) {
/* We may have to do the compatible overprint blending */
@@ -7314,8 +7924,25 @@ do_mark_fill_rectangle_ko_simple16(gx_device *dev, int x, int y, int w, int h,
}
/* Complement the results for subtractive color spaces */
if (additive) {
- for (k = 0; k < num_chan; ++k)
- dst_ptr[k * planestride] = dst[k];
+ if (!overprint) {
+ for (k = 0; k < num_chan; ++k)
+ dst_ptr[k * planestride] = dst[k];
+ } else {
+ /* Hybrid additive with subtractive spots */
+ /* We may have to do the compatible overprint blending */
+ if (!buf->isolated && drawn_comps != (((size_t)1 << (size_t)dev->color_info.num_components) - (size_t)1)) {
+ art_pdf_composite_knockout_16(dst2, src, num_comp,
+ blend_mode, pdev->blend_procs, pdev);
+ }
+ for (k = 0, comps = drawn_comps; k < num_comp; ++k, comps >>= 1) {
+ if ((comps & 0x1) != 0) {
+ dst_ptr[k * planestride] = dst[k];
+ } else {
+ /* Compatible overprint blend result. */
+ dst_ptr[k * planestride] = dst2[k];
+ }
+ }
+ }
} else {
if (overprint) {
/* We may have to do the compatible overprint blending */
@@ -7435,6 +8062,21 @@ map_components_to_colorants(const frac * pcc,
}
}
+/* See Section 7.6.4 of PDF 1.7 spec */
+static inline bool
+pdf14_state_opaque(gx_device *pdev, const gs_gstate *pgs)
+{
+ if (pgs->fillconstantalpha != 1.0 ||
+ pgs->strokeconstantalpha != 1.0 ||
+ !(pgs->blend_mode == BLEND_MODE_Normal ||
+ pgs->blend_mode == BLEND_MODE_CompatibleOverprint))
+ return 0;
+
+ /* We can only be opaque if we're not in an SMask. */
+ return dev_proc(pdev, dev_spec_op)(pdev,
+ gxdso_in_smask,
+ NULL, 0) != 1;
+}
static void
pdf14_cmap_gray_direct(frac gray, gx_device_color * pdc, const gs_gstate * pgs,
@@ -7453,20 +8095,16 @@ pdf14_cmap_gray_direct(frac gray, gx_device_color * pdc, const gs_gstate * pgs,
trans_device = dev;
}
ncomps = trans_device->color_info.num_components;
+
/* map to the color model */
dev_proc(trans_device, get_color_mapping_procs)(trans_device)->map_gray(trans_device, gray, cm_comps);
- /* If we are in a Gray blending color space and have spots then we have
- * possibly an issue here with the transfer function */
- if (pgs->trans_device != NULL) {
- cv[0] = frac2cv(gx_map_color_frac(pgs, cm_comps[0], effective_transfer[0]));
- /* FIXME: This looks odd to me... */
- for (i = 1; i < ncomps; i++)
- cv[i] = gx_color_value_from_byte(cm_comps[i]);
- } else {
- /* Not a transparency device. Just use the transfer functions directly */
+ if (pdf14_state_opaque(trans_device, pgs)) {
for (i = 0; i < ncomps; i++)
cv[i] = frac2cv(gx_map_color_frac(pgs, cm_comps[i], effective_transfer[i]));
+ } else {
+ for (i = 0; i < ncomps; i++)
+ cv[i] = frac2cv(cm_comps[i]);
}
/* If output device supports devn, we need to make sure we send it the
@@ -7504,21 +8142,15 @@ pdf14_cmap_rgb_direct(frac r, frac g, frac b, gx_device_color * pdc,
/* map to the color model */
dev_proc(trans_device, get_color_mapping_procs)(trans_device)->map_rgb(trans_device, pgs, r, g, b, cm_comps);
- /* If we are in an RGB blending color space and have spots then we have
- * possibly an issue here with the transfer function */
- if (pgs->trans_device != NULL) {
- for (i = 0; i < 3; i++)
+ if (pdf14_state_opaque(trans_device, pgs)) {
+ for (i = 0; i < ncomps; i++)
cv[i] = frac2cv(gx_map_color_frac(pgs, cm_comps[i], effective_transfer[i]));
- /* FIXME: This looks odd to me... */
- for (i = 3; i < ncomps; i++)
- cv[i] = gx_color_value_from_byte(cm_comps[i]);
} else {
- /* Not a transparency device. Just use the transfer functions directly */
for (i = 0; i < ncomps; i++)
- cv[i] = frac2cv(gx_map_color_frac(pgs, cm_comps[i], effective_transfer[i]));
+ cv[i] = frac2cv(cm_comps[i]);
}
- /* if output device supports devn, we need to make sure we send it the
+ /* If output device supports devn, we need to make sure we send it the
proper color type. We now support RGB + spots as devn colors */
if (dev_proc(trans_device, dev_spec_op)(trans_device, gxdso_supports_devn, NULL, 0)) {
for (i = 0; i < ncomps; i++)
@@ -7538,7 +8170,7 @@ pdf14_cmap_cmyk_direct(frac c, frac m, frac y, frac k, gx_device_color * pdc,
const gs_gstate * pgs, gx_device * dev, gs_color_select_t select,
const gs_color_space *pcs)
{
- int i,ncomps;
+ int i, ncomps;
frac cm_comps[GX_DEVICE_COLOR_MAX_COMPONENTS];
gx_color_value cv[GX_DEVICE_COLOR_MAX_COMPONENTS];
gx_color_index color;
@@ -7551,10 +8183,19 @@ pdf14_cmap_cmyk_direct(frac c, frac m, frac y, frac k, gx_device_color * pdc,
trans_device = dev;
}
ncomps = trans_device->color_info.num_components;
- /* map to the color model */
+
+ /* Map to the color model. Transfer function is only used
+ if we are drawing with an opaque color. */
dev_proc(trans_device, get_color_mapping_procs)(trans_device)->map_cmyk(trans_device, c, m, y, k, cm_comps);
- for (i = 0; i < ncomps; i++)
- cv[i] = frac2cv(gx_map_color_frac(pgs, cm_comps[i], effective_transfer[i]));
+
+ if (pdf14_state_opaque(trans_device, pgs)) {
+ for (i = 0; i < ncomps; i++)
+ cv[i] = frac2cv(gx_map_color_frac(pgs, cm_comps[i], effective_transfer[i]));
+ } else {
+ for (i = 0; i < ncomps; i++)
+ cv[i] = frac2cv(cm_comps[i]);
+ }
+
/* if output device supports devn, we need to make sure we send it the
proper color type */
if (dev_proc(trans_device, dev_spec_op)(trans_device, gxdso_supports_devn, NULL, 0)) {
@@ -7818,8 +8459,17 @@ pdf14_dev_spec_op(gx_device *pdev, int dev_spec_op,
return p14dev->overprint || p14dev->stroke_overprint;
}
}
+ if (dev_spec_op == gxdso_in_smask_construction)
+ return p14dev->in_smask_construction > 0;
if (dev_spec_op == gxdso_in_smask)
return p14dev->in_smask_construction > 0 || p14dev->depth_within_smask;
+ if (dev_spec_op == gxdso_device_insert_child) {
+ gx_device *tdev = p14dev->target;
+ p14dev->target = (gx_device *)data;
+ rc_increment(p14dev->target);
+ rc_decrement_only(tdev, "pdf14_dev_spec_op");
+ return 0;
+ }
return dev_proc(p14dev->target, dev_spec_op)(p14dev->target, dev_spec_op, data, size);
}
@@ -7838,7 +8488,7 @@ gs_pdf14_device_color_mon_set(gx_device *pdev, bool monitoring)
return code;
}
-int
+static int
gs_pdf14_device_push(gs_memory_t *mem, gs_gstate * pgs,
gx_device ** pdev, gx_device * target, const gs_pdf14trans_t * pdf14pct)
{
@@ -7898,11 +8548,15 @@ gs_pdf14_device_push(gs_memory_t *mem, gs_gstate * pgs,
(const gx_device *) dev_proto, mem);
if (code < 0)
return code;
+
gs_pdf14_device_copy_params((gx_device *)p14dev, target);
gx_device_set_target((gx_device_forward *)p14dev, target);
p14dev->pad = target->pad;
p14dev->log2_align_mod = target->log2_align_mod;
- p14dev->is_planar = target->is_planar;
+ if (pdf14pct->params.overprint_sim_push && pdf14pct->params.num_spot_colors_int > 0 && !target->is_planar)
+ p14dev->is_planar = true;
+ else
+ p14dev->is_planar = target->is_planar;
p14dev->alpha = 1.0;
p14dev->shape = 1.0;
@@ -7910,21 +8564,38 @@ gs_pdf14_device_push(gs_memory_t *mem, gs_gstate * pgs,
p14dev->fillconstantalpha = 1.0;
p14dev->strokeconstantalpha = 1.0;
- /* If the target profile was CIELAB (and we are not using a blend CS),
- then overide with default RGB for
- proper blending. During put_image we will convert from RGB to
- CIELAB. Need to check that we have a default profile, which
- will not be the case if we are coming from the clist reader */
- if ((icc_profile->data_cs == gsCIELAB || icc_profile->islab)
- && pgs->icc_manager->default_rgb != NULL && !p14dev->using_blend_cs) {
- gsicc_adjust_profile_rc(pgs->icc_manager->default_rgb, 1, "gs_pdf14_device_push");
+ /* Simulated overprint case. We have to use CMYK-based profile */
+ if (p14dev->overprint_sim && icc_profile->data_cs != gsCMYK) {
+ gsicc_adjust_profile_rc(pgs->icc_manager->default_cmyk, 1, "gs_pdf14_device_push");
gsicc_adjust_profile_rc(p14dev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE],
- -1, "gs_pdf14_device_push");
- p14dev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE] = pgs->icc_manager->default_rgb;
+ -1, "gs_pdf14_device_push");
+ p14dev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE] = pgs->icc_manager->default_cmyk;
+ } else {
+ /* If the target profile was CIELAB (and we are not using a blend CS),
+ then overide with default RGB for proper blending. During put_image
+ we will convert from RGB to CIELAB. Need to check that we have a
+ default profile, which will not be the case if we are coming from the clist reader */
+ if ((icc_profile->data_cs == gsCIELAB || icc_profile->islab)
+ && pgs->icc_manager->default_rgb != NULL && !p14dev->using_blend_cs) {
+ gsicc_adjust_profile_rc(pgs->icc_manager->default_rgb, 1, "gs_pdf14_device_push");
+ gsicc_adjust_profile_rc(p14dev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE],
+ -1, "gs_pdf14_device_push");
+ p14dev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE] = pgs->icc_manager->default_rgb;
+ }
}
+
+ if (pdf14pct->params.overprint_sim_push &&
+ pdf14pct->params.num_spot_colors_int > 0) {
+ p14dev->procs.update_spot_equivalent_colors = pdf14_update_spot_equivalent_colors;
+ p14dev->procs.ret_devn_params = pdf14_ret_devn_params;
+ p14dev->op_pequiv_cmyk_colors.all_color_info_valid = false;
+ p14dev->target_support_devn = p14dev->icc_struct->supports_devn;
+ p14dev->icc_struct->supports_devn = true; /* Reset when pdf14 device is disabled */
+ }
+
/* The number of color planes should not exceed that of the target.
Unless we are using a blend CS */
- if (!p14dev->using_blend_cs) {
+ if (!(p14dev->using_blend_cs || p14dev->overprint_sim)) {
if (p14dev->color_info.num_components > target->color_info.num_components)
p14dev->color_info.num_components = target->color_info.num_components;
if (p14dev->color_info.max_components > target->color_info.max_components)
@@ -8166,7 +8837,10 @@ c_pdf14trans_write(const gs_composite_t * pct, byte * data, uint * psize,
cdev->pdf14_smask_level = 0;
cdev->page_pdf14_needed = false;
put_value(pbuf, pparams->num_spot_colors);
+ put_value(pbuf, pparams->num_spot_colors_int);
+ put_value(pbuf, pparams->overprint_sim_push);
put_value(pbuf, pparams->is_pattern);
+
/* If we happen to be going to a color space like CIELAB then
we are going to do our blending in default RGB and convert
to CIELAB at the end. To do this, we need to store the
@@ -8175,12 +8849,12 @@ c_pdf14trans_write(const gs_composite_t * pct, byte * data, uint * psize,
if (icc_profile->data_cs == gsCIELAB || icc_profile->islab) {
/* Get the default RGB profile. Set the device hash code
so that we can extract it during the put_image operation. */
- cdev->trans_dev_icc_hash = pparams->iccprofile->hashcode;
+ cdev->trans_dev_icc_hash = gsicc_get_hash(pparams->iccprofile);
found_icc =
- clist_icc_searchtable(cdev, pparams->iccprofile->hashcode);
+ clist_icc_searchtable(cdev, gsicc_get_hash(pparams->iccprofile));
if (!found_icc) {
/* Add it to the table */
- clist_icc_addentry(cdev, pparams->iccprofile->hashcode,
+ clist_icc_addentry(cdev, gsicc_get_hash(pparams->iccprofile),
pparams->iccprofile);
}
}
@@ -8221,7 +8895,7 @@ c_pdf14trans_write(const gs_composite_t * pct, byte * data, uint * psize,
profile or the ID if it is cached already */
if (pparams->group_color_type == ICC) {
/* Check if it is already in the ICC clist table */
- hashcode = pparams->iccprofile->hashcode;
+ hashcode = gsicc_get_hash(pparams->iccprofile);
found_icc = clist_icc_searchtable(cdev, hashcode);
if (!found_icc) {
/* Add it to the table */
@@ -8274,7 +8948,7 @@ c_pdf14trans_write(const gs_composite_t * pct, byte * data, uint * psize,
profile or the ID if it is cached already */
if (pparams->group_color_type == ICC) {
/* Check if it is already in the ICC clist table */
- hashcode = pparams->iccprofile->hashcode;
+ hashcode = gsicc_get_hash(pparams->iccprofile);
found_icc = clist_icc_searchtable(cdev, hashcode);
if (!found_icc) {
/* Add it to the table */
@@ -8401,6 +9075,8 @@ c_pdf14trans_read(gs_composite_t * * ppct, const byte * data,
break;
case PDF14_PUSH_DEVICE:
read_value(data, params.num_spot_colors);
+ read_value(data, params.num_spot_colors_int);
+ read_value(data, params.overprint_sim_push);
read_value(data, params.is_pattern);
break;
case PDF14_ABORT_DEVICE:
@@ -8568,7 +9244,6 @@ c_pdf14trans_create_default_compositor(const gs_composite_t * pct,
gs_memory_t * mem)
{
const gs_pdf14trans_t * pdf14pct = (const gs_pdf14trans_t *) pct;
- gx_device * p14dev = NULL;
int code = 0;
/*
@@ -8578,8 +9253,11 @@ c_pdf14trans_create_default_compositor(const gs_composite_t * pct,
*/
switch (pdf14pct->params.pdf14_op) {
case PDF14_PUSH_DEVICE:
- code = gs_pdf14_device_push(mem, pgs, &p14dev, tdev, pdf14pct);
- *pp14dev = p14dev;
+ code = gs_pdf14_device_push(mem, pgs, pp14dev, tdev, pdf14pct);
+ /* Change (non-error) code to 1 to indicate that we created
+ * a device. */
+ if (code >= 0)
+ code = 1;
break;
default:
/* No other compositor actions are allowed if this isn't a pdf14 compositor */
@@ -8775,7 +9453,7 @@ const gs_composite_type_t gs_composite_pdf14trans_type = {
c_pdf14trans_is_friendly, /* procs.is_friendly */
/* Create a PDF 1.4 clist write device */
c_pdf14trans_clist_write_update, /* procs.composite_clist_write_update */
- c_pdf14trans_clist_read_update, /* procs.composite_clist_reade_update */
+ c_pdf14trans_clist_read_update, /* procs.composite_clist_read_update */
c_pdf14trans_get_cropping /* procs.composite_get_cropping */
} /* procs */
};
@@ -8792,7 +9470,7 @@ const gs_composite_type_t gs_composite_pdf14trans_no_clist_writer_type = {
c_pdf14trans_is_friendly, /* procs.is_friendly */
/* The PDF 1.4 clist writer already exists, Do not create it. */
gx_default_composite_clist_write_update, /* procs.composite_clist_write_update */
- c_pdf14trans_clist_read_update, /* procs.composite_clist_reade_update */
+ c_pdf14trans_clist_read_update, /* procs.composite_clist_read_update */
c_pdf14trans_get_cropping /* procs.composite_get_cropping */
} /* procs */
};
@@ -9095,6 +9773,17 @@ get_pdf14_clist_device_proto(gx_device * dev, pdf14_clist_device ** pdevproto,
&using_blend_cs);
bool has_tags = device_encodes_tags(dev);
bool deep = device_is_deep(dev);
+ int num_spots = pdf14pct->params.num_spot_colors;
+
+ /* overprint overide */
+ if (pdf14pct->params.overprint_sim_push) {
+ using_blend_cs = false;
+ if (pdf14pct->params.num_spot_colors_int > 0) {
+ dev_cs = PDF14_DeviceCMYKspot;
+ num_spots = pdf14pct->params.num_spot_colors_int;
+ } else
+ dev_cs = PDF14_DeviceCMYK;
+ }
switch (dev_cs) {
case PDF14_DeviceGray:
@@ -9155,12 +9844,10 @@ get_pdf14_clist_device_proto(gx_device * dev, pdf14_clist_device ** pdevproto,
* of the process components and the number of spot colors
* for the page.
*/
- if (pdf14pct->params.num_spot_colors >= 0) {
- ptempdevproto->devn_params.page_spot_colors =
- pdf14pct->params.num_spot_colors;
+ if (num_spots >= 0) {
+ ptempdevproto->devn_params.page_spot_colors = num_spots;
ptempdevproto->color_info.num_components =
- ptempdevproto->devn_params.num_std_colorant_names +
- pdf14pct->params.num_spot_colors;
+ ptempdevproto->devn_params.num_std_colorant_names + num_spots;
if (ptempdevproto->color_info.num_components >
ptempdevproto->color_info.max_components)
ptempdevproto->color_info.num_components =
@@ -9195,6 +9882,7 @@ get_pdf14_clist_device_proto(gx_device * dev, pdf14_clist_device ** pdevproto,
default: /* Should not occur */
return_error(gs_error_rangecheck);
}
+ ptempdevproto->overprint_sim = pdf14pct->params.overprint_sim_push;
ptempdevproto->using_blend_cs = using_blend_cs;
return 0;
}
@@ -9213,6 +9901,8 @@ pdf14_create_clist_device(gs_memory_t *mem, gs_gstate * pgs,
cmm_dev_profile_t *dev_profile;
uchar k;
bool deep = device_is_deep(target);
+ cmm_profile_t *icc_profile;
+
code = dev_proc(target, get_profile)(target, &dev_profile);
if (code < 0)
@@ -9231,7 +9921,7 @@ pdf14_create_clist_device(gs_memory_t *mem, gs_gstate * pgs,
/* If we are not using a blending color space, the number of color planes
should not exceed that of the target */
- if (!pdev->using_blend_cs) {
+ if (!(pdev->using_blend_cs || pdev->overprint_sim)) {
if (pdev->color_info.num_components > target->color_info.num_components)
pdev->color_info.num_components = target->color_info.num_components;
if (pdev->color_info.max_components > target->color_info.max_components)
@@ -9240,7 +9930,12 @@ pdf14_create_clist_device(gs_memory_t *mem, gs_gstate * pgs,
pdev->color_info.depth = pdev->color_info.num_components * (8<<deep);
pdev->pad = target->pad;
pdev->log2_align_mod = target->log2_align_mod;
- pdev->is_planar = target->is_planar;
+
+ if (pdf14pct->params.overprint_sim_push && pdf14pct->params.num_spot_colors_int > 0 && !target->is_planar)
+ pdev->is_planar = true;
+ else
+ pdev->is_planar = target->is_planar;
+
pdev->op_state = pgs->is_fill_color;
if (deep) {
@@ -9270,14 +9965,40 @@ pdf14_create_clist_device(gs_memory_t *mem, gs_gstate * pgs,
}
code = dev_proc((gx_device *) pdev, open_device) ((gx_device *) pdev);
pdev->pclist_device = target;
- /* If the target profile was CIELAB, then overide with default RGB for
- proper blending. During put_image we will convert from RGB to
- CIELAB */
- if ((target_profile->data_cs == gsCIELAB || target_profile->islab) &&
- !pdev->using_blend_cs) {
- rc_assign(pdev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE],
- pgs->icc_manager->default_rgb, "pdf14_create_clist_device");
+
+ code = dev_proc(target, get_profile)(target, &dev_profile);
+ if (code < 0)
+ return code;
+ gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &icc_profile,
+ &render_cond);
+ if_debug0m('v', mem, "[v]pdf14_create_clist_device\n");
+
+ /* Simulated overprint case. We have to use CMYK-based profile */
+ if (pdev->overprint_sim && icc_profile->data_cs != gsCMYK) {
+ gsicc_adjust_profile_rc(pgs->icc_manager->default_cmyk, 1, "pdf14_create_clist_device");
+ gsicc_adjust_profile_rc(pdev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE],
+ -1, "pdf14_create_clist_device");
+ pdev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE] = pgs->icc_manager->default_cmyk;
+ } else {
+ /* If the target profile was CIELAB, then overide with default RGB for
+ proper blending. During put_image we will convert from RGB to
+ CIELAB */
+ if ((target_profile->data_cs == gsCIELAB || target_profile->islab) &&
+ !pdev->using_blend_cs) {
+ rc_assign(pdev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE],
+ pgs->icc_manager->default_rgb, "pdf14_create_clist_device");
+ }
+ }
+
+ if (pdf14pct->params.overprint_sim_push &&
+ pdf14pct->params.num_spot_colors_int > 0) {
+ pdev->procs.update_spot_equivalent_colors = pdf14_update_spot_equivalent_colors;
+ pdev->procs.ret_devn_params = pdf14_ret_devn_params;
+ pdev->op_pequiv_cmyk_colors.all_color_info_valid = false;
+ pdev->target_support_devn = pdev->icc_struct->supports_devn;
+ pdev->icc_struct->supports_devn = true; /* Reset when pdf14 device is disabled */
}
+
pdev->my_encode_color = dev_proc(pdev, encode_color);
pdev->my_decode_color = dev_proc(pdev, decode_color);
pdev->my_get_color_mapping_procs = dev_proc(pdev, get_color_mapping_procs);
@@ -9345,8 +10066,17 @@ pdf14_recreate_clist_device(gs_memory_t *mem, gs_gstate * pgs,
pdev->static_procs = dev_proto->static_procs;
pdev->pad = target->pad;
pdev->log2_align_mod = target->log2_align_mod;
- pdev->is_planar = target->is_planar;
- gx_device_fill_in_procs(dev);
+
+ if (pdf14pct->params.overprint_sim_push && pdf14pct->params.num_spot_colors_int > 0 && !target->is_planar)
+ pdev->is_planar = true;
+ else
+ pdev->is_planar = target->is_planar;
+
+ pdev->color_info.separable_and_linear = GX_CINFO_SEP_LIN_STANDARD;
+ gx_device_fill_in_procs((gx_device *)pdev);
+ pdev->save_get_cmap_procs = pgs->get_cmap_procs;
+ pgs->get_cmap_procs = pdf14_get_cmap_procs;
+ gx_set_cmap_procs(pgs, (gx_device *)pdev);
check_device_separable((gx_device *)pdev);
return code;
}
@@ -9452,6 +10182,25 @@ pdf14_accum_update_spot_equivalent_colors(gx_device * dev, const gs_gstate * pgs
return code;
}
+/* Used when doing overprint simulation and have spot colors */
+static int
+pdf14_update_spot_equivalent_colors(gx_device *dev, const gs_gstate *pgs)
+{
+ pdf14_device *pdev = (pdf14_device *)dev;
+ const gs_color_space *pcs;
+ int code;
+
+ /* Make sure we are not All or None */
+ pcs = gs_currentcolorspace_inline(pgs);
+ if (pcs != NULL && pcs->type->index == gs_color_space_index_Separation &&
+ pcs->params.separation.sep_type != SEP_OTHER)
+ return 0;
+
+ code = update_spot_equivalent_cmyk_colors(dev, pgs, &pdev->devn_params,
+ &pdev->op_pequiv_cmyk_colors);
+ return code;
+}
+
/*
* Retrieve a list of spot color names for the PDF14 device.
*/
@@ -9576,34 +10325,64 @@ pdf14_clist_create_compositor(gx_device * dev, gx_device ** pcdev,
pctemp.type = &gs_composite_pdf14trans_no_clist_writer_type;
code = dev_proc(pdev->target, create_compositor)
(pdev->target, pcdev, (gs_composite_t *)&pctemp, pgs, mem, cdev);
- *pcdev = dev;
+ /* We should never have created a new device here. */
+ assert(code != 1);
return code;
}
case PDF14_POP_DEVICE:
+ {
+ gx_device *clistdev = pdev->target;
+
+ /* Find the clist device */
+ while (1) {
+ gxdso_device_child_request req;
+ /* Ignore any errors here, that's expected as non-clist
+ * devices don't implement it. */
+ code = dev_proc(clistdev, dev_spec_op)(clistdev, gxdso_is_clist_device, NULL, 0);
+ if (code == 1)
+ break;
+ req.n = 0;
+ req.target = clistdev;
+ code = dev_proc(clistdev, dev_spec_op)(clistdev, gxdso_device_child, &req, sizeof(req));
+ if (code < 0)
+ return code;
+ clistdev = req.target;
+ }
+
+ /* If we have overprint simulation spot color information, store
+ it in a pseudo-band of the clist */
+ if (pdev->overprint_sim &&
+ pdev->devn_params.page_spot_colors > 0) {
+ code = clist_write_op_equiv_cmyk_colors((gx_device_clist_writer *)clistdev,
+ &pdev->op_pequiv_cmyk_colors);
+ if (code < 0)
+ return code;
+ }
+
/* If we hit an error during an SMask, we need to undo the color
* swapping before continuing. pdf14_decrement_smask_color() checks
* for itself if it needs to take action.
*/
pdf14_decrement_smask_color(pgs, dev);
/* Restore the color_info for the clist device */
- pdev->target->color_info = pdev->saved_target_color_info;
- set_dev_proc(pdev->target, encode_color, pdev->saved_target_encode_color);
- set_dev_proc(pdev->target, decode_color, pdev->saved_target_decode_color);
- set_dev_proc(pdev->target, get_color_mapping_procs, pdev->saved_target_get_color_mapping_procs);
- set_dev_proc(pdev->target, get_color_comp_index, pdev->saved_target_get_color_comp_index);
+ clistdev->color_info = pdev->saved_target_color_info;
+ set_dev_proc(clistdev, encode_color, pdev->saved_target_encode_color);
+ set_dev_proc(clistdev, decode_color, pdev->saved_target_decode_color);
+ set_dev_proc(clistdev, get_color_mapping_procs, pdev->saved_target_get_color_mapping_procs);
+ set_dev_proc(clistdev, get_color_comp_index, pdev->saved_target_get_color_comp_index);
pgs->get_cmap_procs = pdev->save_get_cmap_procs;
- gx_set_cmap_procs(pgs, pdev->target);
- gx_device_decache_colors(pdev->target);
+ gx_set_cmap_procs(pgs, clistdev);
+ gx_device_decache_colors(clistdev);
/* Disable the PDF 1.4 compositor */
pdf14_disable_clist_device(mem, pgs, dev);
/*
* Make sure that the transfer funtions, etc. are current.
*/
- code = cmd_put_color_mapping(
- (gx_device_clist_writer *)(pdev->target), pgs);
+ code = cmd_put_color_mapping((gx_device_clist_writer *)clistdev, pgs);
if (code < 0)
return code;
break;
+ }
case PDF14_BEGIN_TRANS_PAGE_GROUP:
case PDF14_BEGIN_TRANS_GROUP:
if (pdev->smask_constructed || pdev->depth_within_smask)
@@ -9707,6 +10486,14 @@ pdf14_clist_create_compositor(gx_device * dev, gx_device ** pcdev,
return code;
break;
case PDF14_ABORT_DEVICE:
+ code = gx_abort_trans_device(pgs, dev);
+ if (pdev->free_devicen) {
+ devn_free_params(dev);
+ }
+ pdf14_disable_device(dev);
+ pdf14_close(dev);
+ *pcdev = dev;
+ return code;
break;
default:
break; /* Pass remaining ops to target */
@@ -9849,8 +10636,11 @@ put_accum_error:
}
return code; /* DON'T perform set_target */
}
- if (*pcdev != pdev->target)
+ if (code == 1) {
+ /* We just wrapped pdev->target, so we need to update that.*/
gx_device_set_target((gx_device_forward *)pdev, *pcdev);
+ code = 0; /* We did not wrap dev. */
+ }
*pcdev = dev;
return code;
}
@@ -9882,10 +10672,12 @@ pdf14_clist_forward_create_compositor(gx_device * dev, gx_device * * pcdev,
return 0;
}
code = dev_proc(tdev, create_compositor)(tdev, &ndev, pct, pgs, mem, cdev);
- if (code < 0)
- return code;
- gx_device_set_target((gx_device_forward *)pdev, ndev);
- return 0;
+ if (code == 1) {
+ /* We just wrapped tdev, so update our target. */
+ gx_device_set_target((gx_device_forward *)pdev, ndev);
+ code = 0; /* We did not wrap dev. */
+ }
+ return code;
}
/*
@@ -9948,7 +10740,7 @@ pdf14_clist_update_params(pdf14_clist_device * pdev, const gs_gstate * pgs,
}
params.changed = changed;
/* Avoid recursion when we have a PDF14_SET_BLEND_PARAMS forced and apply
- now to the target. Otherwise we send of te compositor action
+ now to the target. Otherwise we send the compositor action
to the pdf14 device at this time. This is due to the fact that we
need to often perform this operation when we are already starting to
do a compositor action */
@@ -10243,7 +11035,8 @@ pdf14_clist_fill_stroke_path_pattern_setup(gx_device* dev, const gs_gstate* cpgs
/* See if overprint is enabled for both stroke and fill AND if ca == CA */
if (pgs->fillconstantalpha == pgs->strokeconstantalpha &&
- pgs->overprint && pgs->stroke_overprint && dev->icc_struct->sim_overprint &&
+ pgs->overprint && pgs->stroke_overprint &&
+ (dev->icc_struct->overprint_control != gs_overprint_control_disable) &&
dev->color_info.polarity == GX_CINFO_POLARITY_SUBTRACTIVE) {
params.Isolated = false;
@@ -10294,7 +11087,8 @@ pdf14_clist_fill_stroke_path_pattern_setup(gx_device* dev, const gs_gstate* cpgs
/* If we are in an overprint situation, set the blend mode to compatible
overprint */
- if (dev->icc_struct->sim_overprint && pgs->overprint &&
+ if ((dev->icc_struct->overprint_control != gs_overprint_control_disable) &&
+ pgs->overprint &&
dev->color_info.polarity == GX_CINFO_POLARITY_SUBTRACTIVE)
(void)gs_setblendmode(pgs, BLEND_MODE_CompatibleOverprint); /* Can never fail */
@@ -10302,7 +11096,8 @@ pdf14_clist_fill_stroke_path_pattern_setup(gx_device* dev, const gs_gstate* cpgs
if (code < 0)
goto cleanup;
- if (dev->icc_struct->sim_overprint && pgs->overprint &&
+ if ((dev->icc_struct->overprint_control != gs_overprint_control_disable) &&
+ pgs->overprint &&
dev->color_info.polarity == GX_CINFO_POLARITY_SUBTRACTIVE)
(void)gs_setblendmode(pgs, blend_mode); /* Can never fail */
}
@@ -10319,7 +11114,8 @@ pdf14_clist_fill_stroke_path_pattern_setup(gx_device* dev, const gs_gstate* cpgs
if (code < 0)
goto cleanup;
- if (dev->icc_struct->sim_overprint && pgs->overprint &&
+ if ((dev->icc_struct->overprint_control != gs_overprint_control_disable) &&
+ pgs->overprint &&
dev->color_info.polarity == GX_CINFO_POLARITY_SUBTRACTIVE)
(void)gs_setblendmode(pgs, blend_mode); /* Can never fail */
}
@@ -10638,6 +11434,8 @@ gs_pdf14_clist_device_push(gs_memory_t *mem, gs_gstate *pgs, gx_device **pcdev,
gx_device_clist_writer * const cdev = &((gx_device_clist *)dev)->writer;
code = pdf14_create_clist_device(mem, pgs, pcdev, dev, pdf14pct);
+ if (code < 0)
+ return code;
/*
* Set the color_info of the clist device to match the compositing
* device. We will restore it when the compositor is popped.
@@ -10699,7 +11497,12 @@ c_pdf14trans_clist_write_update(const gs_composite_t * pcte, gx_device * dev,
/* We only handle the push/pop operations */
switch (pdf14pct->params.pdf14_op) {
case PDF14_PUSH_DEVICE:
- return gs_pdf14_clist_device_push(mem, pgs, pcdev, dev, pdf14pct);
+ code = gs_pdf14_clist_device_push(mem, pgs, pcdev, dev, pdf14pct);
+ /* Change (non-error) code to 1 to indicate that we created
+ * a device. */
+ if (code >= 0)
+ code = 1;
+ return code;
case PDF14_POP_DEVICE:
# if 0 /* Disabled because pdf14_clist_create_compositor does so. */
@@ -10828,10 +11631,13 @@ c_pdf14trans_clist_read_update(gs_composite_t * pcte, gx_device * cdev,
*/
switch (pdf14pct->params.pdf14_op) {
case PDF14_PUSH_DEVICE:
- gsicc_adjust_profile_rc(cl_icc_profile, 1, "c_pdf14trans_clist_read_update");
- gsicc_adjust_profile_rc(p14dev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE],
- -1, "c_pdf14trans_clist_read_update");
- p14dev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE] = cl_icc_profile;
+ /* Overprint simulation sets the profile at prototype creation. */
+ if (!p14dev->overprint_sim) {
+ gsicc_adjust_profile_rc(cl_icc_profile, 1, "c_pdf14trans_clist_read_update");
+ gsicc_adjust_profile_rc(p14dev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE],
+ -1, "c_pdf14trans_clist_read_update");
+ p14dev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE] = cl_icc_profile;
+ }
/*
* If we are blending using spot colors (i.e. the output device
* supports spot colors) then we need to transfer
@@ -11048,16 +11854,25 @@ pdf14_spot_get_color_comp_index(gx_device *dev, const char *pname,
target_get_color_comp_index = dev_proc(tdev, get_color_comp_index);
/* The pdf14_clist_create_compositor may have set the color procs.
- We need the real target procs */
- if (target_get_color_comp_index == pdf14_cmykspot_get_color_comp_index)
+ We need the real target procs, but not if we are doing simulated
+ overprint */
+ if (target_get_color_comp_index == pdf14_cmykspot_get_color_comp_index &&
+ !pdev->overprint_sim)
target_get_color_comp_index =
((pdf14_clist_device *)pdev)->saved_target_get_color_comp_index;
/*
* If this is not a separation name then simply forward it to the target
- * device.
+ * device or return -1 if we are doing overprint simulation.
+ * The halftone setup expects this.
*/
- if (component_type == NO_COMP_NAME_TYPE)
+ if (!pdev->overprint_sim && (component_type == NO_COMP_NAME_TYPE_HT ||
+ component_type == NO_COMP_NAME_TYPE_OP)) {
return (*target_get_color_comp_index)(tdev, pname, name_size, component_type);
+ }
+ if (pdev->overprint_sim && component_type == NO_COMP_NAME_TYPE_HT) {
+ return -1;
+ }
+
/*
* Check if the component is in either the process color model list
* or in the SeparationNames list.
@@ -11070,19 +11885,23 @@ pdf14_spot_get_color_comp_index(gx_device *dev, const char *pname,
*/
if (comp_index >= 0)
return comp_index - offset;
- /*
- * If we do not know this color, check if the output (target) device does.
- * Note that if the target device has ENABLE_AUTO_SPOT_COLORS this will add
- * the colorant so we will only get < 0 returned when we hit the max. for
- * the target device.
- */
- comp_index = (*target_get_color_comp_index)(tdev, pname, name_size, component_type);
- /*
- * Ignore color if unknown to the output device or if color is not being
- * imaged due to the SeparationOrder device parameter.
- */
- if (comp_index < 0 || comp_index == GX_DEVICE_COLOR_MAX_COMPONENTS)
- return comp_index - offset;
+
+ /* Only worry about the target if we are not doing an overprint simulation */
+ if (!pdev->overprint_sim) {
+ /*
+ * If we do not know this color, check if the output (target) device does.
+ * Note that if the target device has ENABLE_AUTO_SPOT_COLORS this will add
+ * the colorant so we will only get < 0 returned when we hit the max. for
+ * the target device.
+ */
+ comp_index = (*target_get_color_comp_index)(tdev, pname, name_size, component_type);
+ /*
+ * Ignore color if unknown to the output device or if color is not being
+ * imaged due to the SeparationOrder device parameter.
+ */
+ if (comp_index < 0 || comp_index == GX_DEVICE_COLOR_MAX_COMPONENTS)
+ return comp_index - offset;
+ }
/*
* This is a new colorant. Add it to our list of colorants.
@@ -11109,6 +11928,11 @@ pdf14_spot_get_color_comp_index(gx_device *dev, const char *pname,
else
pdevn_params->separation_order_map[color_component_number] =
color_component_number;
+
+ /* Indicate that we need to find equivalent CMYK color. */
+ pdev->op_pequiv_cmyk_colors.color[sep_num].color_info_valid = false;
+ pdev->op_pequiv_cmyk_colors.all_color_info_valid = false;
+
return color_component_number;
}
@@ -11174,11 +11998,11 @@ pdf14_increment_smask_color(gs_gstate * pgs, gx_device * dev)
result = gs_alloc_struct(pdev->memory->stable_memory, pdf14_smaskcolor_t,
&st_pdf14_smaskcolor,
"pdf14_increment_smask_color");
- if (result == NULL)
+ if (result == NULL)
return gs_error_VMerror;
result->profiles = gsicc_new_iccsmask(pdev->memory->stable_memory);
- if (result->profiles == NULL)
+ if (result->profiles == NULL)
return gs_error_VMerror;
pdev->smaskcolor = result;
@@ -11336,7 +12160,7 @@ pdf14_free_smask_color(pdf14_device * pdev)
}
}
-void
+static void
pdf14_device_finalize(const gs_memory_t *cmem, void *vptr)
{
gx_device * const dev = (gx_device *)vptr;
diff --git a/base/gdevp14.h b/base/gdevp14.h
index 635ab111..44f0b8a5 100644
--- a/base/gdevp14.h
+++ b/base/gdevp14.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -100,7 +100,7 @@ struct pdf14_mask_s {
/* A structure to hold information about the group color related
* procs and other information. These may change depending upon
* if the blending space is different than the base space.
- * The structure is a list that is updated upo every transparency
+ * The structure is a list that is updated upo every transparency
* group push and pop */
typedef struct pdf14_group_color_s pdf14_group_color_t;
@@ -208,6 +208,7 @@ typedef struct pdf14_device_s {
const pdf14_procs_t * pdf14_procs; /* Must follow devn_params. */
const pdf14_nonseparable_blending_procs_t * blend_procs; /* Must follow pdf14_procs */
int num_std_colorants;
+ equivalent_cmyk_color_params op_pequiv_cmyk_colors;
pdf14_ctx *ctx;
pdf14_smaskcolor_t *smaskcolor;
@@ -232,6 +233,8 @@ typedef struct pdf14_device_s {
bool free_devicen; /* Used to avoid freeing a deviceN parameter from target clist device */
bool sep_device;
bool using_blend_cs;
+ bool overprint_sim;
+ bool target_support_devn;
/* We now have some variables to help us determine whether
* we are in an SMask or not. Firstly, we have in_smask_construction,
@@ -320,6 +323,7 @@ int gs_pdf14_device_color_mon_set(gx_device *pdev, bool monitoring);
/* depth are critical since these must match when reading back colors. */
bool pdf14_ok_to_optimize(gx_device *bdev);
-
+int
+pdf14_accum_dev_spec_op(gx_device *pdev, int dev_spec_op, void *data, int size);
#endif /* gdevp14_INCLUDED */
diff --git a/base/gdevpccm.c b/base/gdevpccm.c
index fbbbf97c..fbbffc18 100644
--- a/base/gdevpccm.c
+++ b/base/gdevpccm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevpccm.h b/base/gdevpccm.h
index ae3de6dc..ccae7917 100644
--- a/base/gdevpccm.h
+++ b/base/gdevpccm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevpipe.c b/base/gdevpipe.c
index b4f2acb1..96d71f5d 100644
--- a/base/gdevpipe.c
+++ b/base/gdevpipe.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevplnx.c b/base/gdevplnx.c
index 3a85b6d0..e60b7565 100644
--- a/base/gdevplnx.c
+++ b/base/gdevplnx.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevplnx.h b/base/gdevplnx.h
index 63226cbc..3104cb08 100644
--- a/base/gdevplnx.h
+++ b/base/gdevplnx.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevppla.c b/base/gdevppla.c
index a4df7798..93c6d564 100644
--- a/base/gdevppla.c
+++ b/base/gdevppla.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -132,6 +132,7 @@ gdev_prn_size_buf_planar(gx_device_buf_space_t *space, gx_device *target,
mdev.pad = target->pad;
mdev.log2_align_mod = target->log2_align_mod;
mdev.is_planar = target->is_planar;
+ mdev.graphics_type_tag = target->graphics_type_tag;
code = gdev_prn_set_planar(&mdev, target);
if (code < 0)
return code;
diff --git a/base/gdevppla.h b/base/gdevppla.h
index d3092f0b..466527d1 100644
--- a/base/gdevppla.h
+++ b/base/gdevppla.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevprn.c b/base/gdevprn.c
index 9bcc5e50..cb3fdf45 100644
--- a/base/gdevprn.c
+++ b/base/gdevprn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -100,8 +100,12 @@ gdev_prn_open(gx_device * pdev)
gx_copy_device_procs(pdev->parent, pdev, &gs_obj_filter_device);
pdev = pdev->parent;
}
- if (pdev->PageHandlerPushed)
+ if (pdev->PageHandlerPushed) {
gx_copy_device_procs(pdev->parent, pdev, &gs_flp_device);
+ pdev = pdev->parent;
+ }
+ if (pdev->NupHandlerPushed)
+ gx_copy_device_procs(pdev->parent, pdev, &gs_nup_device);
}
if (code < 0)
return code;
@@ -118,10 +122,11 @@ prn_finish_bg_print(gx_device_printer *ppdev)
/* if we have a a bg printing device that was created, then wait for its */
/* semaphore (it may already have been signalled, but that's OK.) then */
/* close and unlink the files and free the device and its private allocator */
- if (ppdev->bg_print.device != NULL) {
+ if (ppdev->bg_print && (ppdev->bg_print->device != NULL)) {
int closecode;
- gx_device_printer *bgppdev = (gx_device_printer *)ppdev->bg_print.device;
- gx_semaphore_wait(ppdev->bg_print.sema);
+ gx_device_printer *bgppdev = (gx_device_printer *)ppdev->bg_print->device;
+
+ gx_semaphore_wait(ppdev->bg_print->sema);
/* If numcopies > 1, then the bg_print->device will have closed and reopened
* the output file, so the pointer in the original device is now stale,
* so copy it back.
@@ -129,29 +134,29 @@ prn_finish_bg_print(gx_device_printer *ppdev)
*/
ppdev->file = bgppdev->file;
closecode = gdev_prn_close_printer((gx_device *)ppdev);
- if (ppdev->bg_print.return_code == 0)
- ppdev->bg_print.return_code = closecode; /* return code here iff there wasn't another error */
- teardown_device_and_mem_for_thread(ppdev->bg_print.device,
- ppdev->bg_print.thread_id, true);
- ppdev->bg_print.device = NULL;
- if (ppdev->bg_print.ocfile) {
- closecode = ppdev->bg_print.oio_procs->fclose(ppdev->bg_print.ocfile, ppdev->bg_print.ocfname, true);
- if (ppdev->bg_print.return_code == 0)
- ppdev->bg_print.return_code = closecode;
+ if (ppdev->bg_print->return_code == 0)
+ ppdev->bg_print->return_code = closecode; /* return code here iff there wasn't another error */
+ teardown_device_and_mem_for_thread(ppdev->bg_print->device,
+ ppdev->bg_print->thread_id, true);
+ ppdev->bg_print->device = NULL;
+ if (ppdev->bg_print->ocfile) {
+ closecode = ppdev->bg_print->oio_procs->fclose(ppdev->bg_print->ocfile, ppdev->bg_print->ocfname, true);
+ if (ppdev->bg_print->return_code == 0)
+ ppdev->bg_print->return_code = closecode;
}
- if (ppdev->bg_print.ocfname) {
- gs_free_object(ppdev->memory->non_gc_memory, ppdev->bg_print.ocfname, "prn_finish_bg_print(ocfname)");
+ if (ppdev->bg_print->ocfname) {
+ gs_free_object(ppdev->memory->non_gc_memory, ppdev->bg_print->ocfname, "prn_finish_bg_print(ocfname)");
}
- if (ppdev->bg_print.obfile) {
- closecode = ppdev->bg_print.oio_procs->fclose(ppdev->bg_print.obfile, ppdev->bg_print.obfname, true);
- if (ppdev->bg_print.return_code == 0)
- ppdev->bg_print.return_code = closecode;
+ if (ppdev->bg_print->obfile) {
+ closecode = ppdev->bg_print->oio_procs->fclose(ppdev->bg_print->obfile, ppdev->bg_print->obfname, true);
+ if (ppdev->bg_print->return_code == 0)
+ ppdev->bg_print->return_code = closecode;
}
- if (ppdev->bg_print.obfname) {
- gs_free_object(ppdev->memory->non_gc_memory, ppdev->bg_print.obfname, "prn_finish_bg_print(obfname)");
+ if (ppdev->bg_print->obfname) {
+ gs_free_object(ppdev->memory->non_gc_memory, ppdev->bg_print->obfname, "prn_finish_bg_print(obfname)");
}
- ppdev->bg_print.ocfile = ppdev->bg_print.obfile =
- ppdev->bg_print.ocfname = ppdev->bg_print.obfname = NULL;
+ ppdev->bg_print->ocfile = ppdev->bg_print->obfile =
+ ppdev->bg_print->ocfname = ppdev->bg_print->obfname = NULL;
}
}
/* Generic closing for the printer device. */
@@ -163,9 +168,9 @@ gdev_prn_close(gx_device * pdev)
int code = 0;
prn_finish_bg_print(ppdev);
- if (ppdev->bg_print.sema != NULL) {
- gx_semaphore_free(ppdev->bg_print.sema);
- ppdev->bg_print.sema = NULL; /* prevent double free */
+ if (ppdev->bg_print != NULL && ppdev->bg_print->sema != NULL) {
+ gx_semaphore_free(ppdev->bg_print->sema);
+ ppdev->bg_print->sema = NULL; /* prevent double free */
}
gdev_prn_free_memory(pdev);
if (ppdev->file != NULL) {
@@ -213,106 +218,6 @@ gdev_prn_dev_spec_op(gx_device *pdev, int dev_spec_op, void *data, int size)
return gx_default_dev_spec_op(pdev, dev_spec_op, data, size);
}
-static int /* returns 0 ok, else -ve error cde */
-gdev_prn_setup_as_command_list(gx_device *pdev, gs_memory_t *buffer_memory,
- byte **the_memory,
- const gdev_space_params *space_params,
- bool bufferSpace_is_exact)
-{
- gx_device_printer * const ppdev = (gx_device_printer *)pdev;
- gx_device *target = pdev;
- uint space;
- int code;
- gx_device_clist *const pclist_dev = (gx_device_clist *)pdev;
- gx_device_clist_common * const pcldev = &pclist_dev->common;
- bool reallocate = *the_memory != 0;
- byte *base;
- bool save_is_open = pdev->is_open; /* Save around temporary failure in open_c loop */
-
- while (target->parent != NULL) {
- target = target->parent;
- gx_update_from_subclass(target);
- }
-
- /* Try to allocate based simply on param-requested buffer size */
-#ifdef DEBUGGING_HACKS
-#define BACKTRACE(first_arg)\
- BEGIN\
- ulong *fp_ = (ulong *)&first_arg - 2;\
- for (; fp_ && (fp_[1] & 0xff000000) == 0x08000000; fp_ = (ulong *)*fp_)\
- dmprintf2(buffer_memory, " fp="PRI_INTPTR" ip=0x%lx\n", (intptr_t)fp_, fp_[1]);\
- END
-dmputs(buffer_memory, "alloc buffer:\n");
-BACKTRACE(pdev);
-#endif /*DEBUGGING_HACKS*/
- for ( space = space_params->BufferSpace; ; ) {
- base = (reallocate ?
- (byte *)gs_resize_object(buffer_memory, *the_memory, space,
- "cmd list buffer") :
- gs_alloc_bytes(buffer_memory, space,
- "cmd list buffer"));
- if (base != 0)
- break;
- if (bufferSpace_is_exact || (space >>= 1) < PRN_MIN_BUFFER_SPACE)
- break;
- }
- if (base == 0)
- return_error(gs_error_VMerror);
- *the_memory = base;
-
- /* Try opening the command list, to see if we allocated */
- /* enough buffer space. */
-open_c:
- ppdev->buf = base;
- ppdev->buffer_space = space;
- pclist_dev->common.orig_spec_op = dev_proc(ppdev, dev_spec_op);
- clist_init_io_procs(pclist_dev, ppdev->BLS_force_memory);
- clist_init_params(pclist_dev, base, space, target,
- ppdev->printer_procs.buf_procs,
- space_params->band,
- false, /* do_not_open_or_close_bandfiles */
- (ppdev->bandlist_memory == 0 ? pdev->memory->non_gc_memory:
- ppdev->bandlist_memory),
- ppdev->clist_disable_mask,
- ppdev->page_uses_transparency);
- code = (*gs_clist_device_procs.open_device)( (gx_device *)pcldev );
- if (code < 0) {
- /* If there wasn't enough room, and we haven't */
- /* already shrunk the buffer, try enlarging it. */
- if ( code == gs_error_rangecheck &&
- space >= space_params->BufferSpace &&
- !bufferSpace_is_exact
- ) {
- space += space / 8;
- if (reallocate) {
- base = gs_resize_object(buffer_memory,
- *the_memory, space,
- "cmd list buf(retry open)");
- if (base != 0)
- *the_memory = base;
- } else {
- gs_free_object(buffer_memory, base,
- "cmd list buf(retry open)");
- *the_memory = base =
- gs_alloc_bytes(buffer_memory, space,
- "cmd list buf(retry open)");
- }
- ppdev->buf = *the_memory;
- if (base != 0) {
- pdev->is_open = save_is_open; /* allow for success when we loop */
- goto open_c;
- }
- }
- /* Failure. */
- if (!reallocate) {
- gs_free_object(buffer_memory, base, "cmd list buf");
- ppdev->buffer_space = 0;
- *the_memory = 0;
- }
- }
- return code;
-}
-
static bool /* ret true if device was cmd list, else false */
gdev_prn_tear_down(gx_device *pdev, byte **the_memory)
{
@@ -387,6 +292,16 @@ gdev_prn_allocate(gx_device *pdev, gdev_space_params *new_space_params,
if (reallocate)
save_is_command_list = gdev_prn_tear_down(pdev, &the_memory);
+
+ /* bg_print allocation is not fatal, we just continue (as far as possible) without BGPrint */
+ if (ppdev->bg_print == NULL)
+ ppdev->bg_print = (bg_print_t *)gs_alloc_bytes(pdev->memory->non_gc_memory, sizeof(bg_print_t), "prn bg_print");
+ if (ppdev->bg_print == NULL) {
+ emprintf(pdev->memory, "Failed to allocate memory for BGPrint, attempting to continue without BGPrint\n");
+ } else {
+ memset(ppdev->bg_print, 0, sizeof(bg_print_t));
+ }
+
/* Re/allocate memory */
ppdev->orig_procs = pdev->procs;
for ( pass = 1; pass <= (reallocate ? 2 : 1); ++pass ) {
@@ -505,24 +420,23 @@ gdev_prn_allocate(gx_device *pdev, gdev_space_params *new_space_params,
ecode = gs_note_error(gs_error_VMerror);
continue;
}
- ppdev->bg_print.ocfname = ppdev->bg_print.obfname =
- ppdev->bg_print.obfile = ppdev->bg_print.ocfile = NULL;
+ if (ppdev->bg_print) {
+ ppdev->bg_print->ocfname = ppdev->bg_print->obfname =
+ ppdev->bg_print->obfile = ppdev->bg_print->ocfile = NULL;
+ }
- code = gdev_prn_setup_as_command_list(pdev, buffer_memory,
- &the_memory, &space_params,
- !bufferSpace_is_default);
+ code = clist_mutate_to_clist((gx_device_clist_mutatable *)pdev,
+ buffer_memory,
+ &the_memory, &space_params,
+ !bufferSpace_is_default,
+ &ppdev->printer_procs.buf_procs,
+ gdev_prn_forwarding_dev_spec_op,
+ PRN_MIN_BUFFER_SPACE);
if (ecode == 0)
ecode = code;
if (code >= 0 || (reallocate && pass > 1))
ppdev->procs = gs_clist_device_procs;
- if (code > 0) {
- /*
- * Now the device is a clist device, we enable multi-threaded rendering.
- * It will remain enabled, but that doesn't really cause any problems.
- */
- clist_enable_multi_thread_render(pdev);
- }
} else {
/* Render entirely in memory. */
gx_device *bdev = (gx_device *)pmemdev;
@@ -620,6 +534,8 @@ gdev_prn_free_memory(gx_device *pdev)
ppdev->buffer_memory);
gdev_prn_tear_down(pdev, &the_memory);
+ gs_free_object(pdev->memory->non_gc_memory, ppdev->bg_print, "gdev_prn_free_memory");
+ ppdev->bg_print = NULL;
gs_free_object(buffer_memory, the_memory, "gdev_prn_free_memory");
return 0;
}
@@ -941,6 +857,7 @@ gdev_prn_put_params(gx_device * pdev, gs_param_list * plist)
ppdev->OpenOutputFile = oof;
ppdev->ReopenPerPage = rpp;
+ /* If BGPrint was previously true and it is being turned off, wait for the BG thread */
if (ppdev->bg_print_requested && !bg_print_requested) {
prn_finish_bg_print(ppdev);
}
@@ -1035,7 +952,7 @@ gdev_prn_output_page_aux(gx_device * pdev, int num_copies, int flush, bool seeka
int threads_enabled = 0;
int print_foreground = 1; /* default to foreground printing */
- if (bg_print_ok && PRINTER_IS_CLIST(ppdev) &&
+ if (bg_print_ok && PRINTER_IS_CLIST(ppdev) && ppdev->bg_print &&
(ppdev->bg_print_requested || ppdev->num_render_threads_requested > 0)) {
threads_enabled = clist_enable_multi_thread_render(pdev);
}
@@ -1043,12 +960,12 @@ gdev_prn_output_page_aux(gx_device * pdev, int num_copies, int flush, bool seeka
/* If there was an error, abort on this page -- no good way to handle this */
/* but it means that the error will be reported AFTER another page was */
/* interpreted and written to clist files. FIXME: ??? */
- if (ppdev->bg_print.return_code < 0) {
- outcode = ppdev->bg_print.return_code;
+ if (ppdev->bg_print && (ppdev->bg_print->return_code < 0)) {
+ outcode = ppdev->bg_print->return_code;
threads_enabled = 0; /* and allow current page to try foreground */
}
/* Use 'while' instead of 'if' to avoid nesting */
- while (ppdev->bg_print_requested && threads_enabled) {
+ while (ppdev->bg_print_requested && ppdev->bg_print && threads_enabled) {
gx_device *ndev;
gx_device_printer *npdev;
gx_device_clist_reader *crdev = (gx_device_clist_reader *)ppdev;
@@ -1060,27 +977,27 @@ gdev_prn_output_page_aux(gx_device * pdev, int num_copies, int flush, bool seeka
/* We need to hang onto references to these files, so we can ensure the main file data
* gets freed with the correct allocator.
*/
- ppdev->bg_print.ocfname =
+ ppdev->bg_print->ocfname =
(char *)gs_alloc_bytes(ppdev->memory->non_gc_memory,
strnlen(crdev->page_info.cfname, gp_file_name_sizeof - 1) + 1, "gdev_prn_output_page_aux(ocfname)");
- ppdev->bg_print.obfname =
+ ppdev->bg_print->obfname =
(char *)gs_alloc_bytes(ppdev->memory->non_gc_memory,
strnlen(crdev->page_info.bfname, gp_file_name_sizeof - 1) + 1,"gdev_prn_output_page_aux(ocfname)");
- if (!ppdev->bg_print.ocfname || !ppdev->bg_print.obfname)
+ if (!ppdev->bg_print->ocfname || !ppdev->bg_print->obfname)
break;
- strncpy(ppdev->bg_print.ocfname, crdev->page_info.cfname, strnlen(crdev->page_info.cfname, gp_file_name_sizeof - 1) + 1);
- strncpy(ppdev->bg_print.obfname, crdev->page_info.bfname, strnlen(crdev->page_info.bfname, gp_file_name_sizeof - 1) + 1);
- ppdev->bg_print.obfile = crdev->page_info.bfile;
- ppdev->bg_print.ocfile = crdev->page_info.cfile;
- ppdev->bg_print.oio_procs = crdev->page_info.io_procs;
+ strncpy(ppdev->bg_print->ocfname, crdev->page_info.cfname, strnlen(crdev->page_info.cfname, gp_file_name_sizeof - 1) + 1);
+ strncpy(ppdev->bg_print->obfname, crdev->page_info.bfname, strnlen(crdev->page_info.bfname, gp_file_name_sizeof - 1) + 1);
+ ppdev->bg_print->obfile = crdev->page_info.bfile;
+ ppdev->bg_print->ocfile = crdev->page_info.cfile;
+ ppdev->bg_print->oio_procs = crdev->page_info.io_procs;
crdev->page_info.cfile = crdev->page_info.bfile = NULL;
- if (ppdev->bg_print.sema == NULL)
+ if (ppdev->bg_print->sema == NULL)
{
- ppdev->bg_print.sema = gx_semaphore_label(gx_semaphore_alloc(ppdev->memory->non_gc_memory), "BGPrint");
- if (ppdev->bg_print.sema == NULL)
+ ppdev->bg_print->sema = gx_semaphore_label(gx_semaphore_alloc(ppdev->memory->non_gc_memory), "BGPrint");
+ if (ppdev->bg_print->sema == NULL)
break; /* couldn't create the semaphore */
}
@@ -1088,20 +1005,26 @@ gdev_prn_output_page_aux(gx_device * pdev, int num_copies, int flush, bool seeka
if (ndev == NULL) {
break;
}
- ppdev->bg_print.device = ndev;
- ppdev->bg_print.num_copies = num_copies;
+ ppdev->bg_print->device = ndev;
+ ppdev->bg_print->num_copies = num_copies;
npdev = (gx_device_printer *)ndev;
npdev->bg_print_requested = 0;
npdev->num_render_threads_requested = ppdev->num_render_threads_requested;
+ /* The bgprint's device was created with normal procs, so multi-threaded */
+ /* rendering was turned off. Re-enable it now if it is needed. */
+ if (npdev->num_render_threads_requested > 0) {
+ /* ignore return code - even if it fails, we'll output the page */
+ (void)clist_enable_multi_thread_render(ndev);
+ }
/* Now start the thread to print the page */
if ((code = gp_thread_start(prn_print_page_in_background,
- (void *)&(ppdev->bg_print),
- &(ppdev->bg_print.thread_id))) < 0) {
+ (void *)(ppdev->bg_print),
+ &(ppdev->bg_print->thread_id))) < 0) {
/* Did not start cleanly - clean up is in print_foreground block below */
break;
}
- gp_thread_label(ppdev->bg_print.thread_id, "BG print thread");
+ gp_thread_label(ppdev->bg_print->thread_id, "BG print thread");
/* Page was succesfully started in bg_print mode */
print_foreground = 0;
/* Now we need to set up the next page so it will use new clist files */
@@ -1111,18 +1034,19 @@ gdev_prn_output_page_aux(gx_device * pdev, int num_copies, int flush, bool seeka
break; /* exit the while loop */
}
if (print_foreground) {
-
- gs_free_object(ppdev->memory->non_gc_memory, ppdev->bg_print.ocfname, "gdev_prn_output_page_aux(ocfname)");
- gs_free_object(ppdev->memory->non_gc_memory, ppdev->bg_print.obfname, "gdev_prn_output_page_aux(obfname)");
- ppdev->bg_print.ocfname = ppdev->bg_print.obfname = NULL;
-
- /* either bg_print was not requested or was not able to start */
- if (ppdev->bg_print.sema != NULL && ppdev->bg_print.device != NULL) {
- /* There was a problem. Teardown the device and its allocator, but */
- /* leave the semaphore for possible later use. */
- teardown_device_and_mem_for_thread(ppdev->bg_print.device,
- ppdev->bg_print.thread_id, true);
- ppdev->bg_print.device = NULL;
+ if (ppdev->bg_print) {
+ gs_free_object(ppdev->memory->non_gc_memory, ppdev->bg_print->ocfname, "gdev_prn_output_page_aux(ocfname)");
+ gs_free_object(ppdev->memory->non_gc_memory, ppdev->bg_print->obfname, "gdev_prn_output_page_aux(obfname)");
+ ppdev->bg_print->ocfname = ppdev->bg_print->obfname = NULL;
+
+ /* either bg_print was not requested or was not able to start */
+ if (ppdev->bg_print->sema != NULL && ppdev->bg_print->device != NULL) {
+ /* There was a problem. Teardown the device and its allocator, but */
+ /* leave the semaphore for possible later use. */
+ teardown_device_and_mem_for_thread(ppdev->bg_print->device,
+ ppdev->bg_print->thread_id, true);
+ ppdev->bg_print->device = NULL;
+ }
}
/* Here's where we actually let the device's print_page_copies work */
/* Print the accumulated page description. */
diff --git a/base/gdevprn.h b/base/gdevprn.h
index 5b2690b6..fbc7cb0c 100644
--- a/base/gdevprn.h
+++ b/base/gdevprn.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -141,7 +141,7 @@ typedef struct bg_print_s {
bool file_is_new; /* true iff file just opened */\
gp_file *file; /* output file */\
bool bg_print_requested; /* request background printing of page from clist */\
- bg_print_t bg_print; /* background printing data shared with thread */\
+ bg_print_t *bg_print; /* background printing data shared with thread */\
int num_render_threads_requested; /* for multiple band rendering threads */\
gx_saved_pages_list *saved_pages_list; /* list when we are saving pages instead of printing */\
gx_device_procs save_procs_while_delaying_erasepage /* save device procs while delaying erasepage. */
@@ -309,7 +309,7 @@ extern const gx_device_procs prn_bg_procs;
0/*false*/, /* file_is_new */\
0, /* *file */\
0/*false*/, /* bg_print_requested */\
- { 0/*sema*/, 0/*device*/, 0/*thread_id*/, 0/*num_copies*/, 0/*return_code*/ }, /* bg_print */\
+ 0, /* *bg_print */\
0, /* num_render_threads_requested */\
0, /* saved_pages_list */\
{ 0 } /* save_procs_while_delaying_erasepage */
diff --git a/base/gdevpxat.h b/base/gdevpxat.h
index 1b70c569..651fc468 100644
--- a/base/gdevpxat.h
+++ b/base/gdevpxat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevpxen.h b/base/gdevpxen.h
index e4c6b76f..fabdb451 100644
--- a/base/gdevpxen.h
+++ b/base/gdevpxen.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevpxop.h b/base/gdevpxop.h
index f63e30ac..6bc17649 100644
--- a/base/gdevpxop.h
+++ b/base/gdevpxop.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevrops.c b/base/gdevrops.c
index 544593d9..13582008 100644
--- a/base/gdevrops.c
+++ b/base/gdevrops.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevsclass.c b/base/gdevsclass.c
index dfa721f7..9ce98148 100644
--- a/base/gdevsclass.c
+++ b/base/gdevsclass.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -32,6 +32,7 @@
#include "gdevprn.h"
#include "gdevp14.h" /* Needed to patch up the procs after compositor creation */
#include "gdevsclass.h"
+#include "gxdevsop.h"
/*
* It would be nice if we could rewrite the clist handling to use this kind of device class chain
@@ -123,16 +124,20 @@ int default_subclass_sync_output(gx_device *dev)
{
if (dev->child)
return dev_proc(dev->child, sync_output)(dev->child);
- else
- gx_default_sync_output(dev);
-
- return 0;
+ /* else */
+ return gx_default_sync_output(dev);
}
int default_subclass_output_page(gx_device *dev, int num_copies, int flush)
{
- if (dev->child)
- return dev_proc(dev->child, output_page)(dev->child, num_copies, flush);
+ int code = 0;
+
+ if (dev->child) {
+ code = dev_proc(dev->child, output_page)(dev->child, num_copies, flush);
+ dev->PageCount = dev->child->PageCount;
+ return code;
+ }
+ dev->PageCount += num_copies; /* a minor lie */
return 0;
}
@@ -162,10 +167,8 @@ int default_subclass_map_color_rgb(gx_device *dev, gx_color_index color, gx_colo
{
if (dev->child)
return dev_proc(dev->child, map_color_rgb)(dev->child, color, rgb);
- else
- gx_default_map_color_rgb(dev, color, rgb);
-
- return 0;
+ /* else */
+ return gx_default_map_color_rgb(dev, color, rgb);
}
int default_subclass_fill_rectangle(gx_device *dev, int x, int y, int width, int height, gx_color_index color)
@@ -212,19 +215,16 @@ int default_subclass_get_bits(gx_device *dev, int y, byte *data, byte **actual_d
{
if (dev->child)
return dev_proc(dev->child, get_bits)(dev->child, y, data, actual_data);
- else
- return gx_default_get_bits(dev, y, data, actual_data);
- return 0;
+ /* else */
+ return gx_default_get_bits(dev, y, data, actual_data);
}
int default_subclass_get_params(gx_device *dev, gs_param_list *plist)
{
if (dev->child)
return dev_proc(dev->child, get_params)(dev->child, plist);
- else
- return gx_default_get_params(dev, plist);
-
- return 0;
+ /* else */
+ return gx_default_get_params(dev, plist);
}
int default_subclass_put_params(gx_device *dev, gs_param_list *plist)
@@ -238,61 +238,49 @@ int default_subclass_put_params(gx_device *dev, gs_param_list *plist)
gx_update_from_subclass(dev);
return code;
}
- else
- return gx_default_put_params(dev, plist);
-
- return 0;
+ /* else */
+ return gx_default_put_params(dev, plist);
}
gx_color_index default_subclass_map_cmyk_color(gx_device *dev, const gx_color_value cv[])
{
if (dev->child)
return dev_proc(dev->child, map_cmyk_color)(dev->child, cv);
- else
- return gx_default_map_cmyk_color(dev, cv);
-
- return 0;
+ /* else */
+ return gx_default_map_cmyk_color(dev, cv);
}
const gx_xfont_procs *default_subclass_get_xfont_procs(gx_device *dev)
{
if (dev->child)
return dev_proc(dev->child, get_xfont_procs)(dev->child);
- else
- return gx_default_get_xfont_procs(dev);
-
- return 0;
+ /* else */
+ return gx_default_get_xfont_procs(dev);
}
gx_device *default_subclass_get_xfont_device(gx_device *dev)
{
if (dev->child)
return dev_proc(dev->child, get_xfont_device)(dev->child);
- else
- return gx_default_get_xfont_device(dev);
-
- return 0;
+ /* else */
+ return gx_default_get_xfont_device(dev);
}
gx_color_index default_subclass_map_rgb_alpha_color(gx_device *dev, gx_color_value red, gx_color_value green, gx_color_value blue,
gx_color_value alpha)
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, map_rgb_alpha_color)(dev->child, red, green, blue, alpha);
- } else
- return gx_default_map_rgb_alpha_color(dev, red, green, blue, alpha);
-
- return 0;
+ /* else */
+ return gx_default_map_rgb_alpha_color(dev, red, green, blue, alpha);
}
gx_device *default_subclass_get_page_device(gx_device *dev)
{
if (dev->child)
return dev_proc(dev->child, get_page_device)(dev->child);
- else
- return gx_default_get_page_device(dev);
-
- return 0;
+ /* else */
+ return gx_default_get_page_device(dev);
}
int default_subclass_get_alpha_bits(gx_device *dev, graphics_object_type type)
@@ -315,9 +303,8 @@ int default_subclass_get_band(gx_device *dev, int y, int *band_start)
{
if (dev->child)
return dev_proc(dev->child, get_band)(dev->child, y, band_start);
- else
- return gx_default_get_band(dev, y, band_start);
- return 0;
+ /* else */
+ return gx_default_get_band(dev, y, band_start);
}
int default_subclass_copy_rop(gx_device *dev, const byte *sdata, int sourcex, uint sraster, gx_bitmap_id id,
@@ -326,34 +313,30 @@ int default_subclass_copy_rop(gx_device *dev, const byte *sdata, int sourcex, ui
int x, int y, int width, int height,
int phase_x, int phase_y, gs_logical_operation_t lop)
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, copy_rop)(dev->child, sdata, sourcex, sraster, id, scolors, texture, tcolors, x, y, width, height, phase_x, phase_y, lop);
- } else
- return gx_default_copy_rop(dev, sdata, sourcex, sraster, id, scolors, texture, tcolors, x, y, width, height, phase_x, phase_y, lop);
- return 0;
+ /* else */
+ return gx_default_copy_rop(dev, sdata, sourcex, sraster, id, scolors, texture, tcolors, x, y, width, height, phase_x, phase_y, lop);
}
int default_subclass_fill_path(gx_device *dev, const gs_gstate *pgs, gx_path *ppath,
const gx_fill_params *params,
const gx_drawing_color *pdcolor, const gx_clip_path *pcpath)
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, fill_path)(dev->child, pgs, ppath, params, pdcolor, pcpath);
- } else
- return gx_default_fill_path(dev, pgs, ppath, params, pdcolor, pcpath);
-
- return 0;
+ /* else */
+ return gx_default_fill_path(dev, pgs, ppath, params, pdcolor, pcpath);
}
int default_subclass_stroke_path(gx_device *dev, const gs_gstate *pgs, gx_path *ppath,
const gx_stroke_params *params,
const gx_drawing_color *pdcolor, const gx_clip_path *pcpath)
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, stroke_path)(dev->child, pgs, ppath, params, pdcolor, pcpath);
- } else
- return gx_default_stroke_path(dev, pgs, ppath, params, pdcolor, pcpath);
- return 0;
+ /* else */
+ return gx_default_stroke_path(dev, pgs, ppath, params, pdcolor, pcpath);
}
int default_subclass_fill_mask(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id,
@@ -361,53 +344,48 @@ int default_subclass_fill_mask(gx_device *dev, const byte *data, int data_x, int
const gx_drawing_color *pdcolor, int depth,
gs_logical_operation_t lop, const gx_clip_path *pcpath)
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, fill_mask)(dev->child, data, data_x, raster, id, x, y, width, height, pdcolor, depth, lop, pcpath);
- } else
- return gx_default_fill_mask(dev, data, data_x, raster, id, x, y, width, height, pdcolor, depth, lop, pcpath);
- return 0;
+ /* else */
+ return gx_default_fill_mask(dev, data, data_x, raster, id, x, y, width, height, pdcolor, depth, lop, pcpath);
}
int default_subclass_fill_trapezoid(gx_device *dev, const gs_fixed_edge *left, const gs_fixed_edge *right,
fixed ybot, fixed ytop, bool swap_axes,
const gx_drawing_color *pdcolor, gs_logical_operation_t lop)
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, fill_trapezoid)(dev->child, left, right, ybot, ytop, swap_axes, pdcolor, lop);
- } else
- return gx_default_fill_trapezoid(dev, left, right, ybot, ytop, swap_axes, pdcolor, lop);
- return 0;
+ /* else */
+ return gx_default_fill_trapezoid(dev, left, right, ybot, ytop, swap_axes, pdcolor, lop);
}
int default_subclass_fill_parallelogram(gx_device *dev, fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by,
const gx_drawing_color *pdcolor, gs_logical_operation_t lop)
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, fill_parallelogram)(dev->child, px, py, ax, ay, bx, by, pdcolor, lop);
- } else
- return gx_default_fill_parallelogram(dev, px, py, ax, ay, bx, by, pdcolor, lop);
- return 0;
+ /* else */
+ return gx_default_fill_parallelogram(dev, px, py, ax, ay, bx, by, pdcolor, lop);
}
int default_subclass_fill_triangle(gx_device *dev, fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by,
const gx_drawing_color *pdcolor, gs_logical_operation_t lop)
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, fill_triangle)(dev->child, px, py, ax, ay, bx, by, pdcolor, lop);
- } else
- return gx_default_fill_triangle(dev, px, py, ax, ay, bx, by, pdcolor, lop);
- return 0;
+ /* else */
+ return gx_default_fill_triangle(dev, px, py, ax, ay, bx, by, pdcolor, lop);
}
int default_subclass_draw_thin_line(gx_device *dev, fixed fx0, fixed fy0, fixed fx1, fixed fy1,
const gx_drawing_color *pdcolor, gs_logical_operation_t lop,
fixed adjustx, fixed adjusty)
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, draw_thin_line)(dev->child, fx0, fy0, fx1, fy1, pdcolor, lop, adjustx, adjusty);
- } else
- return gx_default_draw_thin_line(dev, fx0, fy0, fx1, fy1, pdcolor, lop, adjustx, adjusty);
- return 0;
+ /* else */
+ return gx_default_draw_thin_line(dev, fx0, fy0, fx1, fy1, pdcolor, lop, adjustx, adjusty);
}
int default_subclass_begin_image(gx_device *dev, const gs_gstate *pgs, const gs_image_t *pim,
@@ -415,12 +393,10 @@ int default_subclass_begin_image(gx_device *dev, const gs_gstate *pgs, const gs_
const gx_drawing_color *pdcolor, const gx_clip_path *pcpath,
gs_memory_t *memory, gx_image_enum_common_t **pinfo)
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, begin_image)(dev->child, pgs, pim, format, prect, pdcolor, pcpath, memory, pinfo);
- } else
- return gx_default_begin_image(dev, pgs, pim, format, prect, pdcolor, pcpath, memory, pinfo);
-
- return 0;
+ /* else */
+ return gx_default_begin_image(dev, pgs, pim, format, prect, pdcolor, pcpath, memory, pinfo);
}
int default_subclass_image_data(gx_device *dev, gx_image_enum_common_t *info, const byte **planes, int data_x,
@@ -442,11 +418,10 @@ int default_subclass_strip_tile_rectangle(gx_device *dev, const gx_strip_bitmap
gx_color_index color0, gx_color_index color1,
int phase_x, int phase_y)
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, strip_tile_rectangle)(dev->child, tiles, x, y, width, height, color0, color1, phase_x, phase_y);
- } else
- return gx_default_strip_tile_rectangle(dev, tiles, x, y, width, height, color0, color1, phase_x, phase_y);
- return 0;
+ /* else */
+ return gx_default_strip_tile_rectangle(dev, tiles, x, y, width, height, color0, color1, phase_x, phase_y);
}
int default_subclass_strip_copy_rop(gx_device *dev, const byte *sdata, int sourcex, uint sraster, gx_bitmap_id id,
@@ -455,11 +430,10 @@ int default_subclass_strip_copy_rop(gx_device *dev, const byte *sdata, int sourc
int x, int y, int width, int height,
int phase_x, int phase_y, gs_logical_operation_t lop)
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, strip_copy_rop)(dev->child, sdata, sourcex, sraster, id, scolors, textures, tcolors, x, y, width, height, phase_x, phase_y, lop);
- } else
- return gx_default_strip_copy_rop(dev, sdata, sourcex, sraster, id, scolors, textures, tcolors, x, y, width, height, phase_x, phase_y, lop);
- return 0;
+ /* else */
+ return gx_default_strip_copy_rop(dev, sdata, sourcex, sraster, id, scolors, textures, tcolors, x, y, width, height, phase_x, phase_y, lop);
}
void default_subclass_get_clipping_box(gx_device *dev, gs_fixed_rect *pbox)
@@ -477,38 +451,32 @@ int default_subclass_begin_typed_image(gx_device *dev, const gs_gstate *pgs, con
const gx_drawing_color *pdcolor, const gx_clip_path *pcpath,
gs_memory_t *memory, gx_image_enum_common_t **pinfo)
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, begin_typed_image)(dev->child, pgs, pmat, pic, prect, pdcolor, pcpath, memory, pinfo);
- } else
- return gx_default_begin_typed_image(dev, pgs, pmat, pic, prect, pdcolor, pcpath, memory, pinfo);
- return 0;
+ /* else */
+ return gx_default_begin_typed_image(dev, pgs, pmat, pic, prect, pdcolor, pcpath, memory, pinfo);
}
int default_subclass_get_bits_rectangle(gx_device *dev, const gs_int_rect *prect,
gs_get_bits_params_t *params, gs_int_rect **unread)
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, get_bits_rectangle)(dev->child, prect, params, unread);
- } else
- return gx_default_get_bits_rectangle(dev, prect, params, unread);
-
- return 0;
+ /* else */
+ return gx_default_get_bits_rectangle(dev, prect, params, unread);
}
int default_subclass_map_color_rgb_alpha(gx_device *dev, gx_color_index color, gx_color_value rgba[4])
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, map_color_rgb_alpha)(dev->child, color, rgba);
- } else
- return gx_default_map_color_rgb_alpha(dev, color, rgba);
-
- return 0;
+ /* else */
+ return gx_default_map_color_rgb_alpha(dev, color, rgba);
}
int default_subclass_create_compositor(gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte,
gs_gstate *pgs, gs_memory_t *memory, gx_device *cdev)
{
- default_subclass_subclass_data *psubclass_data = dev->subclass_data;
int code;
if (dev->child) {
@@ -520,35 +488,68 @@ int default_subclass_create_compositor(gx_device *dev, gx_device **pcdev, const
if (code < 0)
return code;
- if (*pcdev != 0L && *pcdev != dev->child){
- /* If the child created a new compositor, which it wants to be the new 'device' in the
- * graphics state, it sets it in the returned pcdev variable. When we return from this
- * method, if pcdev is not the same as the device in the graphics state then the interpreter
- * sets pcdev as the new device in the graphics state. But because we passed in the child device
- * to the child method, if it did create a compositor it will be a forwarding device, and it will
- * be forwarding to our child, we need it to point to us instead. So if pcdev is not the same as the
- * child device, we fixup the target in the child device to point to us.
+ /* *pcdev is always returned containing a device capable of doing
+ * compositing. This may mean it is a new device. If this wants
+ * to be the new 'device' in the graphics state, then code will
+ * return as 1. */
+ if (code == 1) {
+ /* The device chain on entry to this function was:
+ * dev(the subclassing device) -> child.
+ * But now we also have:
+ * *pcdev -> child.
+ * Or in some cases:
+ * *pcdev (-> other device)* -> child
+ * Most callers would be happy to make dev->child = *pcdev,
+ * thus giving us:
+ * dev -> *pcdev (-> other device)* ->child
+ * Unfortunately, we are not happy with that. We need to
+ * remain tightly bound to the child. i.e. we are aiming for:
+ * *pcdev (-> other device)* -> dev -> child
+ * Accordingly, we need to move ourselves within the device
+ * chain.
*/
- gx_device_forward *fdev = (gx_device_forward *)*pcdev;
-
- if (fdev->target == dev->child) {
- if (gs_is_pdf14trans_compositor(pcte) != 0 && strncmp(fdev->dname, "pdf14clist", 10) == 0) {
- pdf14_clist_device *p14dev;
+ gx_device *penult = *pcdev;
- p14dev = (pdf14_clist_device *)*pcdev;
-
- dev->color_info = dev->child->color_info;
+ if (penult == NULL) {
+ /* This should never happen. */
+ return gs_error_unknownerror;
+ }
- psubclass_data->saved_compositor_method = p14dev->procs.create_compositor;
- psubclass_data->forwarding_dev = fdev;
- p14dev->procs.create_compositor = gx_subclass_create_compositor;
+ /* Find the penultimate device. */
+ while (1) {
+ gxdso_device_child_request req;
+ req.target = penult;
+ req.n = 0;
+ code = dev_proc(penult, dev_spec_op)(penult, gxdso_device_child, &req, sizeof(req));
+ if (code < 0)
+ return code;
+ if (req.target == NULL) {
+ /* Wooah! Where was dev->child? */
+ return gs_error_unknownerror;
}
+ if (req.target == dev->child)
+ break; /* penult is the parent. */
+ penult = req.target;
+ }
- fdev->target = dev;
- rc_decrement_only(dev->child, "first-last page compositor code");
- rc_increment(dev);
+ if (penult == NULL) {
+ /* This should never happen. We know that we've just
+ * had a compositor inserted before dev->child, so there
+ * really ought to be one! */
+ return gs_error_unknownerror;
}
- return_error(gs_error_handled);
+
+ /* We already point to dev->child, and hence own a reference
+ * to it. */
+
+ /* Now insert ourselves as the child of the penultimate one. */
+ code = dev_proc(penult, dev_spec_op)(penult, gxdso_device_insert_child, dev, 0);
+ if (code < 0)
+ return code;
+
+ /* Now we want our caller to update itself to recognise that
+ * *pcdev should be its child, not dev. So we return 1. */
+ return 1;
}
else {
/* See the 2 comments above. Now, if the child did not create a new compositor (eg its a clist)
@@ -567,24 +568,20 @@ int default_subclass_create_compositor(gx_device *dev, gx_device **pcdev, const
int default_subclass_get_hardware_params(gx_device *dev, gs_param_list *plist)
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, get_hardware_params)(dev->child, plist);
- } else
- return gx_default_get_hardware_params(dev, plist);
-
- return 0;
+ /* else */
+ return gx_default_get_hardware_params(dev, plist);
}
int default_subclass_text_begin(gx_device *dev, gs_gstate *pgs, const gs_text_params_t *text,
gs_font *font, gx_path *path, const gx_device_color *pdcolor, const gx_clip_path *pcpath,
gs_memory_t *memory, gs_text_enum_t **ppte)
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, text_begin)(dev->child, pgs, text, font, path, pdcolor, pcpath, memory, ppte);
- } else
- return gx_default_text_begin(dev, pgs, text, font, path, pdcolor, pcpath, memory, ppte);
-
- return 0;
+ /* else */
+ return gx_default_text_begin(dev, pgs, text, font, path, pdcolor, pcpath, memory, ppte);
}
/* This method seems (despite the name) to be intended to allow for
@@ -626,6 +623,7 @@ int default_subclass_end_transparency_mask(gx_device *dev, gs_gstate *pgs)
{
if (dev->child)
return dev_proc(dev->child, end_transparency_mask)(dev->child, pgs);
+
return 0;
}
@@ -639,32 +637,26 @@ int default_subclass_discard_transparency_layer(gx_device *dev, gs_gstate *pgs)
const gx_cm_color_map_procs *default_subclass_get_color_mapping_procs(const gx_device *dev)
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, get_color_mapping_procs)(dev->child);
- } else
- return gx_default_DevGray_get_color_mapping_procs(dev);
-
- return 0;
+ /* else */
+ return gx_default_DevGray_get_color_mapping_procs(dev);
}
int default_subclass_get_color_comp_index(gx_device *dev, const char * pname, int name_size, int component_type)
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, get_color_comp_index)(dev->child, pname, name_size, component_type);
- } else
- return gx_error_get_color_comp_index(dev, pname, name_size, component_type);
-
- return 0;
+ /* else */
+ return gx_error_get_color_comp_index(dev, pname, name_size, component_type);
}
gx_color_index default_subclass_encode_color(gx_device *dev, const gx_color_value colors[])
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, encode_color)(dev->child, colors);
- } else
- return gx_error_encode_color(dev, colors);
-
- return 0;
+ /* else */
+ return gx_error_encode_color(dev, colors);
}
int default_subclass_decode_color(gx_device *dev, gx_color_index cindex, gx_color_value colors[])
@@ -692,10 +684,8 @@ int default_subclass_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect
{
if (dev->child)
return dev_proc(dev->child, fill_rectangle_hl_color)(dev->child, rect, pgs, pdcolor, pcpath);
- else
- return_error(gs_error_rangecheck);
-
- return 0;
+ /* else */
+ return_error(gs_error_rangecheck);
}
int default_subclass_include_color_space(gx_device *dev, gs_color_space *cspace, const byte *res_name, int name_length)
@@ -710,12 +700,10 @@ int default_subclass_fill_linear_color_scanline(gx_device *dev, const gs_fill_at
int i, int j, int w, const frac31 *c0, const int32_t *c0_f, const int32_t *cg_num,
int32_t cg_den)
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, fill_linear_color_scanline)(dev->child, fa, i, j, w, c0, c0_f, cg_num, cg_den);
- } else
- return gx_default_fill_linear_color_scanline(dev, fa, i, j, w, c0, c0_f, cg_num, cg_den);
-
- return 0;
+ /* else */
+ return gx_default_fill_linear_color_scanline(dev, fa, i, j, w, c0, c0_f, cg_num, cg_den);
}
int default_subclass_fill_linear_color_trapezoid(gx_device *dev, const gs_fill_attributes *fa,
@@ -724,24 +712,20 @@ int default_subclass_fill_linear_color_trapezoid(gx_device *dev, const gs_fill_a
const frac31 *c0, const frac31 *c1,
const frac31 *c2, const frac31 *c3)
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, fill_linear_color_trapezoid)(dev->child, fa, p0, p1, p2, p3, c0, c1, c2, c3);
- } else
- return gx_default_fill_linear_color_trapezoid(dev, fa, p0, p1, p2, p3, c0, c1, c2, c3);
-
- return 0;
+ /* else */
+ return gx_default_fill_linear_color_trapezoid(dev, fa, p0, p1, p2, p3, c0, c1, c2, c3);
}
int default_subclass_fill_linear_color_triangle(gx_device *dev, const gs_fill_attributes *fa,
const gs_fixed_point *p0, const gs_fixed_point *p1,
const gs_fixed_point *p2, const frac31 *c0, const frac31 *c1, const frac31 *c2)
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, fill_linear_color_triangle)(dev->child, fa, p0, p1, p2, c0, c1, c2);
- } else
- return gx_default_fill_linear_color_triangle(dev, fa, p0, p1, p2, c0, c1, c2);
-
- return 0;
+ /* else */
+ return gx_default_fill_linear_color_triangle(dev, fa, p0, p1, p2, c0, c1, c2);
}
int default_subclass_update_spot_equivalent_colors(gx_device *dev, const gs_gstate * pgs)
@@ -762,12 +746,10 @@ gs_devn_params *default_subclass_ret_devn_params(gx_device *dev)
int default_subclass_fillpage(gx_device *dev, gs_gstate * pgs, gx_device_color *pdevc)
{
- if (dev->child) {
+ if (dev->child)
return dev_proc(dev->child, fillpage)(dev->child, pgs, pdevc);
- } else
- return gx_default_fillpage(dev, pgs, pdevc);
-
- return 0;
+ /* else */
+ return gx_default_fillpage(dev, pgs, pdevc);
}
int default_subclass_push_transparency_state(gx_device *dev, gs_gstate *pgs)
@@ -803,6 +785,15 @@ int default_subclass_put_image(gx_device *dev, gx_device *mdev, const byte **buf
int default_subclass_dev_spec_op(gx_device *dev, int op, void *data, int datasize)
{
+ if (op == gxdso_is_clist_device)
+ return 0;
+ if (op == gxdso_device_child) {
+ gxdso_device_child_request *d = (gxdso_device_child_request *)data;
+ if (d->target == dev) {
+ d->target = dev->child;
+ return 1;
+ }
+ }
if (dev->child)
return dev_proc(dev->child, dev_spec_op)(dev->child, op, data, datasize);
@@ -823,11 +814,8 @@ int default_subclass_get_profile(gx_device *dev, cmm_dev_profile_t **dev_profile
if (dev->child) {
return dev_proc(dev->child, get_profile)(dev->child, dev_profile);
}
- else {
- return gx_default_get_profile(dev, dev_profile);
- }
-
- return 0;
+ /* else */
+ return gx_default_get_profile(dev, dev_profile);
}
/* In a delightful asymmetry, we have a set_graphics_type_tag, but no get_graphics_type_tag. Instead
@@ -868,10 +856,8 @@ int default_subclass_strip_tile_rect_devn(gx_device *dev, const gx_strip_bitmap
{
if (dev->child)
return dev_proc(dev->child, strip_tile_rect_devn)(dev->child, tiles, x, y, width, height, pdcolor0, pdcolor1, phase_x, phase_y);
- else
- return gx_default_strip_tile_rect_devn(dev->child, tiles, x, y, width, height, pdcolor0, pdcolor1, phase_x, phase_y);
-
- return 0;
+ /* else */
+ return gx_default_strip_tile_rect_devn(dev->child, tiles, x, y, width, height, pdcolor0, pdcolor1, phase_x, phase_y);
}
int default_subclass_copy_alpha_hl_color(gx_device *dev, const byte *data, int data_x,
@@ -880,10 +866,8 @@ int default_subclass_copy_alpha_hl_color(gx_device *dev, const byte *data, int d
{
if (dev->child)
return dev_proc(dev->child, copy_alpha_hl_color)(dev->child, data, data_x, raster, id, x, y, width, height, pdcolor, depth);
- else
- return_error(gs_error_rangecheck);
-
- return 0;
+ /* else */
+ return_error(gs_error_rangecheck);
}
int default_subclass_process_page(gx_device *dev, gx_process_page_options_t *options)
@@ -942,4 +926,6 @@ void default_subclass_finalize(const gs_memory_t *cmem, void *vptr)
rc_decrement(dev->icc_struct, "finalize subclass device");
if (dev->PageList)
rc_decrement(dev->PageList, "finalize subclass device");
+ if (dev->NupControl)
+ rc_decrement(dev->NupControl, "finalize subclass device");
}
diff --git a/base/gdevsclass.h b/base/gdevsclass.h
index e020e2c4..aface183 100644
--- a/base/gdevsclass.h
+++ b/base/gdevsclass.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevvec.c b/base/gdevvec.c
index 3204720f..d2694207 100644
--- a/base/gdevvec.c
+++ b/base/gdevvec.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gdevvec.h b/base/gdevvec.h
index 3ce08b2c..b7476229 100644
--- a/base/gdevvec.h
+++ b/base/gdevvec.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gen_ordered.c b/base/gen_ordered.c
index e34e6202..e1cccb4e 100644
--- a/base/gen_ordered.c
+++ b/base/gen_ordered.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -23,6 +23,7 @@
#include "string_.h"
#include "gsmemory.h"
#include "math_.h"
+#include "gp.h"
# define ALLOC(mem, size) (gs_alloc_bytes((gs_memory_t *)mem, size, "gen_ordered"))
# define FREE(mem, ptr) gs_free_object((gs_memory_t *)mem, ptr, "gen_ordered")
@@ -34,6 +35,15 @@
# define EPRINTF(mem, str) errprintf((gs_memory_t *)mem, str)
# define EPRINTF1(mem, str, v1) errprintf((gs_memory_t *)mem, str, v1)
# define EPRINTF3(mem, str, v1, v2, v3) errprintf((gs_memory_t *)mem, str, v1, v2, v3)
+# define _FILE gp_file
+# define FOPEN(mem, v1, v2) gp_fopen(mem, v1, v2)
+# define FCLOSE(fid) gp_fclose(fid)
+# define FPRINTF(fid, str) gp_fprintf(fid, str)
+# define FPRINTF1(fid, str, v1) gp_fprintf(fid, str, v1)
+# define FPRINTF2(fid, str, v1, v2) gp_fprintf(fid, str, v1, v2)
+# define FPRINTF6(fid, str, v1, v2, v3, v4, v5, v6) gp_fprintf(fid, str, v1, v2, v3, v4, v5, v6)
+# define FWRITE(v1, v2, v3, fid) gp_fwrite(v1, v2, v3, fid)
+
#endif /* defined GS_LIB_BUILD */
@@ -64,6 +74,14 @@ typedef unsigned char byte;
# define EPRINTF(mem, str) fprintf(stderr, str)
# define EPRINTF1(mem, str, v1) fprintf(stderr, str, v1)
# define EPRINTF3(mem, str, v1, v2, v3) fprintf(stderr, str, v1, v2, v3)
+# define _FILE FILE
+# define FOPEN(mem, v1, v2) fopen(v1, v2)
+# define FCLOSE(fid) fclose(fid)
+# define FPRINTF(fid, str) fprintf(fid, str)
+# define FPRINTF1(fid, str, v1) fprintf(fid, str, v1)
+# define FPRINTF2(fid, str, v1, v2) fprintf(fid, str, v1, v2)
+# define FPRINTF6(fid, str, v1, v2, v3, v4, v5, v6) fprintf(fid, str, v1, v2, v3, v4, v5, v6)
+# define FWRITE(v1, v2, v3, fid) fwrite(v1, v2, v3, fid)
#endif /* ndef LIB_BUILD */
@@ -124,15 +142,16 @@ static int htsc_allocate_supercell(htsc_dig_grid_t *super_cell, int x, int y, in
htsc_dig_grid_t dot_grid, int N, int *S, int *H, int *L);
static void htsc_tile_supercell(htsc_dig_grid_t *super_cell, htsc_dig_grid_t *dot_grid,
int x, int y, int u, int v, int N);
-void create_2d_gauss_filter(double *filter, int x_size, int y_size,
- double stdvalx, double stdvaly);
+int create_2d_gauss_filter(double *filter, int x_size, int y_size,
+ double stdvalx, double stdvaly, gs_memory_t *mem);
static int htsc_create_holladay_mask(htsc_dig_grid_t super_cell, int H, int L,
double gamma, htsc_dig_grid_t *final_mask);
static int htsc_create_dither_mask(htsc_dig_grid_t super_cell,
htsc_dig_grid_t *final_mask, int verbose,
int num_levels, int y, int x, double vert_dpi,
double horiz_dpi, int N, double gamma,
- htsc_dig_grid_t dot_grid, htsc_point_t one_index);
+ htsc_dig_grid_t dot_grid, htsc_point_t one_index,
+ gs_memory_t *mem);
static int htsc_create_nondithered_mask(htsc_dig_grid_t super_cell, int H, int L,
double gamma, htsc_dig_grid_t *final_mask);
static int htsc_gcd(int a, int b);
@@ -142,11 +161,11 @@ static void htsc_matrix_vector_mult(htsc_matrix_t matrix_in, htsc_vector_t vecto
htsc_vector_t *vector_out);
static int htsc_mask_to_tos(htsc_dig_grid_t *final_mask);
#if RAW_SCREEN_DUMP
-static void htsc_dump_screen(htsc_dig_grid_t *dig_grid, char filename[]);
-static void htsc_dump_float_image(double *image, int height, int width, double max_val,
- char filename[]);
-static void htsc_dump_byte_image(byte *image, int height, int width, double max_val,
- char filename[]);
+static int htsc_dump_screen(htsc_dig_grid_t *dig_grid, char filename[], gs_memory_t *mem);
+static int htsc_dump_float_image(double *image, int height, int width, double max_val,
+ char filename[], gs_memory_t *mem);
+static int htsc_dump_byte_image(byte *image, int height, int width, double max_val,
+ char filename[], gs_memory_t *mem);
#endif
/* Initialize default values */
@@ -169,7 +188,7 @@ void htsc_set_default_params(htsc_param_t *params)
}
int
-htsc_gen_ordered(htsc_param_t params, int *S, htsc_dig_grid_t *final_mask)
+htsc_gen_ordered(htsc_param_t params, int *S, htsc_dig_grid_t *final_mask, gs_memory_t *mem)
{
int num_levels;
int x=0, y=0, v=0, u=0, N=0;
@@ -231,10 +250,12 @@ htsc_gen_ordered(htsc_param_t params, int *S, htsc_dig_grid_t *final_mask)
on sequence or dot profile */
code = htsc_create_dot_mask(&dot_grid, x, y, u, v, params.scr_ang, vertices);
if (code < 0) {
- return -1;
+ return code;
}
#if RAW_SCREEN_DUMP
- htsc_dump_screen(&dot_grid, "mask");
+ code = htsc_dump_screen(&dot_grid, "mask", mem);
+ if (code < 0)
+ return code;
#endif
/* A sanity check */
if (htsc_sumsum(dot_grid) != -N) {
@@ -255,7 +276,9 @@ htsc_gen_ordered(htsc_param_t params, int *S, htsc_dig_grid_t *final_mask)
params.spot_type, trans_matrix_inv);
#if RAW_SCREEN_DUMP
- htsc_dump_screen(&dot_grid, "dot_profile");
+ code = htsc_dump_screen(&dot_grid, "dot_profile", mem);
+ if (code < 0)
+ return code;
#endif
/* Allocate super cell */
code = htsc_allocate_supercell(&super_cell, x, y, u, v, params.targ_size,
@@ -279,7 +302,9 @@ htsc_gen_ordered(htsc_param_t params, int *S, htsc_dig_grid_t *final_mask)
/* Go ahead and fill up the super cell grid with our growth dot values */
htsc_tile_supercell(&super_cell, &dot_grid, x, y, u, v, N);
#if RAW_SCREEN_DUMP
- htsc_dump_screen(&super_cell, "super_cell_tiled");
+ code = htsc_dump_screen(&super_cell, "super_cell_tiled", mem);
+ if (code < 0)
+ return code;
#endif
/* If we are using the Holladay grid (non dithered) then we are done. */
if (params.holladay) {
@@ -302,7 +327,7 @@ htsc_gen_ordered(htsc_param_t params, int *S, htsc_dig_grid_t *final_mask)
}
code = htsc_create_dither_mask(super_cell, final_mask, params.verbose, num_levels,
y, x, params.vert_dpi, params.horiz_dpi, N,
- params.gamma, dot_grid, one_index);
+ params.gamma, dot_grid, one_index, mem);
}
}
final_mask->bin_center = bin_center;
@@ -1136,9 +1161,9 @@ htsc_tile_supercell(htsc_dig_grid_t *super_cell, htsc_dig_grid_t *dot_grid,
/* Create 2d gaussian filter that varies with respect to coordinate
spatial resolution */
-void
+int
create_2d_gauss_filter(double *filter, int x_size, int y_size,
- double stdvalx, double stdvaly)
+ double stdvalx, double stdvaly, gs_memory_t *mem)
{
int x_half_size = (x_size-1)/2;
int y_half_size = (y_size-1)/2;
@@ -1148,6 +1173,7 @@ create_2d_gauss_filter(double *filter, int x_size, int y_size,
double max_val = 0;
int total_size = x_size * y_size;
int index_x, index_y;
+ int code = 0;
for (j = -y_half_size; j < y_half_size+1; j++) {
index_y = j + y_half_size;
@@ -1165,8 +1191,9 @@ create_2d_gauss_filter(double *filter, int x_size, int y_size,
filter[j]/=sum;
}
#if RAW_SCREEN_DUMP
- htsc_dump_float_image(filter, y_size, x_size, max_val/sum, "guass_filt");
+ code = htsc_dump_float_image(filter, y_size, x_size, max_val/sum, "guass_filt", mem);
#endif
+ return code;
}
/* 2-D convolution (or correlation) with periodic boundary condition */
@@ -1256,6 +1283,7 @@ htsc_add_dots(byte *screen_matrix, int num_cols, int num_rows,
int k,j;
int dist, curr_dist;
htsc_dither_pos_t curr_position;
+ int code;
sizefiltx = ROUND(sigma_x * 4);
sizefilty = ROUND(sigma_y * 4);
@@ -1268,7 +1296,10 @@ htsc_add_dots(byte *screen_matrix, int num_cols, int num_rows,
filter = (double*) ALLOC(mem, sizeof(double) * sizefilty * sizefiltx);
if (filter == NULL)
return -1;
- create_2d_gauss_filter(filter, sizefiltx, sizefilty, (double)sizefiltx, (double)sizefilty);
+ code = create_2d_gauss_filter(filter, sizefiltx, sizefilty, (double)sizefiltx, (double)sizefilty, mem);
+ if (code < 0)
+ return code;
+
screen_blur = (double*)ALLOC(mem, sizeof(double) * num_cols * num_rows);
if (screen_blur == NULL) {
FREE(mem, filter);
@@ -1327,6 +1358,7 @@ htsc_init_dot_position(byte *screen_matrix, int num_cols, int num_rows,
int k;
int dist, curr_dist;
bool found_it;
+ int code = 0;
sizefiltx = ROUND(sigma_x * 4);
sizefilty = ROUND(sigma_y * 4);
@@ -1339,7 +1371,10 @@ htsc_init_dot_position(byte *screen_matrix, int num_cols, int num_rows,
filter = (double*) ALLOC(mem, sizeof(double) * sizefilty * sizefiltx);
if (filter == NULL)
return -1;
- create_2d_gauss_filter(filter, sizefiltx, sizefilty, (double)sizefiltx, (double)sizefilty);
+ code = create_2d_gauss_filter(filter, sizefiltx, sizefilty, (double)sizefiltx, (double)sizefilty, mem);
+ if (code < 0)
+ return code;
+
screen_blur = (double*) ALLOC(mem, sizeof(double) * num_cols * num_rows);
if (screen_blur == NULL) {
FREE(mem, filter);
@@ -1351,7 +1386,9 @@ htsc_init_dot_position(byte *screen_matrix, int num_cols, int num_rows,
htsc_apply_filter(screen_matrix, num_cols, num_rows, filter, sizefiltx,
sizefilty, screen_blur, &max_val, &max_pos, &min_val, &min_pos);
#if RAW_SCREEN_DUMP
- htsc_dump_float_image(screen_blur, num_cols, num_rows, max_val, "blur_one");
+ code = htsc_dump_float_image(screen_blur, num_cols, num_rows, max_val, "blur_one", mem);
+ if (code < 0)
+ return code;
#endif
/* Find the closest on dot to the max position */
black_pos = 0;
@@ -1425,7 +1462,8 @@ static int
htsc_create_dither_mask(htsc_dig_grid_t super_cell, htsc_dig_grid_t *final_mask,
int verbose, int num_levels, int y, int x, double vert_dpi,
double horiz_dpi, int N, double gamma,
- htsc_dig_grid_t dot_grid, htsc_point_t dot_grid_one_index)
+ htsc_dig_grid_t dot_grid, htsc_point_t dot_grid_one_index,
+ gs_memory_t *mem)
{
int *dot_levels = NULL;
int *locate = NULL;
@@ -1562,8 +1600,10 @@ htsc_create_dither_mask(htsc_dig_grid_t super_cell, htsc_dig_grid_t *final_mask,
}
}
#if RAW_SCREEN_DUMP
- htsc_dump_byte_image(screen_matrix, width_supercell, height_supercell,
- 1, "screen0_init");
+ code = htsc_dump_byte_image(screen_matrix, width_supercell, height_supercell,
+ 1, "screen0_init", mem);
+ if (code < 0)
+ goto out;
#endif
/* Rearrange these dots into a pleasing pattern, but only if there is
* more than 1. Otherwise there are none to move */
@@ -1574,8 +1614,10 @@ htsc_create_dither_mask(htsc_dig_grid_t super_cell, htsc_dig_grid_t *final_mask,
if (code < 0)
goto out;
#if RAW_SCREEN_DUMP
- htsc_dump_byte_image(screen_matrix, width_supercell, height_supercell,
- 1, "screen0_arrange");
+ code = htsc_dump_byte_image(screen_matrix, width_supercell, height_supercell,
+ 1, "screen0_arrange", mem);
+ if (code < 0)
+ goto out;
#endif
/* Now we want to introduce more dots at each level */
for (k = 1; k < num_levels; k++) {
@@ -1589,8 +1631,10 @@ htsc_create_dither_mask(htsc_dig_grid_t super_cell, htsc_dig_grid_t *final_mask,
{
char str_name[30];
snprintf(str_name, 30, "screen%d_arrange",k);
- htsc_dump_byte_image(screen_matrix, width_supercell, height_supercell,
- 1, str_name);
+ code = htsc_dump_byte_image(screen_matrix, width_supercell, height_supercell,
+ 1, str_name, mem);
+ if (code < 0)
+ goto out;
}
#endif
}
@@ -1926,13 +1970,161 @@ htsc_spot_value(spottype_t spot_type, double x, double y)
}
}
+#if FINAL_SCREEN_DUMP
+
+/* Save turn on order list, Assume that htsc_gen_ordered has already converted to TOS */
+static int
+htsc_save_tos(htsc_dig_grid_t *final_mask, gs_memory_t *mem)
+{
+ int width = final_mask->width;
+ int height = final_mask->height;
+ int *buff_ptr;
+ _FILE *fid;
+ int k = 0;
+ int count = height * width;
+
+ fid = FOPEN(mem, "turn_on_seq.out", "w");
+ if (fid == NULL)
+ return -1;
+
+ FPRINTF2(fid, "# W=%d H=%d\n", width, height);
+
+ /* Write out */
+ buff_ptr = final_mask->data;
+ for (k = 0; k < count; k++) {
+ FPRINTF2(fid, "%d\t%d\n", *buff_ptr++, *buff_ptr++);
+ }
+ FCLOSE(fid);
+ return 0;
+}
+
+int
+htsc_save_screen(htsc_dig_grid_t *final_mask, bool use_holladay_grid, int S,
+ htsc_param_t params, gs_memory_t *mem)
+{
+ char full_file_name[FULL_FILE_NAME_LENGTH];
+ _FILE *fid;
+ int x, y, code = 0;
+ int *buff_ptr = final_mask->data;
+ int width = final_mask->width;
+ int height = final_mask->height;
+ byte data;
+ unsigned short data_short;
+ output_format_type output_format = params.output_format;
+ char *output_extension = (output_format == OUTPUT_PS) ? "ps" :
+ ((output_format == OUTPUT_PPM) ? "ppm" :
+ ((output_format == OUTPUT_RAW16 ? "16.raw" : "raw")));
+
+ if (output_format == OUTPUT_TOS) {
+ /* We need to figure out the turn-on sequence from the threshold
+ array */
+ code = htsc_save_tos(final_mask, mem);
+ } else {
+ if (use_holladay_grid) {
+ snprintf(full_file_name, FULL_FILE_NAME_LENGTH, "Screen_Holladay_Shift%d_%dx%d.%s", S, width,
+ height, output_extension);
+ } else {
+ snprintf(full_file_name, FULL_FILE_NAME_LENGTH, "Screen_Dithered_%dx%d.%s", width, height,
+ output_extension);
+ }
+ fid = FOPEN(mem, full_file_name, "wb");
+ if (fid == NULL)
+ return -1;
+
+ if (output_format == OUTPUT_PPM)
+ FPRINTF6(fid, "P5\n"
+ "# Halftone threshold array, %s, [%d, %d], S=%d\n"
+ "%d %d\n"
+ "255\n",
+ use_holladay_grid ? "Holladay_Shift" : "Dithered", width, height,
+ S, width, height);
+ if (output_format != OUTPUT_PS) {
+ /* Both BIN and PPM format write the same binary data */
+ if (output_format == OUTPUT_RAW || output_format == OUTPUT_PPM) {
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++) {
+ data_short = (unsigned short)(*buff_ptr & 0xffff);
+ data_short = ROUND((double)data_short * 255.0 / MAXVAL);
+ if (data_short > 255) data_short = 255;
+ data = (byte)(data_short & 0xff);
+ FWRITE(&data, sizeof(byte), 1, fid);
+ buff_ptr++;
+ }
+ }
+ } else { /* raw16 data */
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++) {
+ data_short = (unsigned short)(*buff_ptr & 0xffff);
+ FWRITE(&data_short, sizeof(short), 1, fid);
+ buff_ptr++;
+ }
+ }
+ }
+ } else { /* ps output format */
+ if (params.targ_quant <= 256) {
+ /* Output PS HalftoneType 3 dictionary */
+ FPRINTF2(fid, "%%!PS\n"
+ "<< /HalftoneType 3\n"
+ " /Width %d\n"
+ " /Height %d\n"
+ " /Thresholds <\n",
+ width, height);
+
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++) {
+ data_short = (unsigned short)(*buff_ptr & 0xffff);
+ data_short = ROUND((double)data_short * 255.0 / MAXVAL);
+ if (data_short > 255) data_short = 255;
+ data = (byte)(data_short & 0xff);
+ FPRINTF1(fid, "%02x", data);
+ buff_ptr++;
+ if ((x & 0x1f) == 0x1f && (x != (width - 1)))
+ FPRINTF(fid, "\n");
+ }
+ FPRINTF(fid, "\n");
+ }
+ FPRINTF(fid, " >\n"
+ ">>\n"
+ );
+ } else {
+ /* Output PS HalftoneType 16 dictionary. Single array. */
+ FPRINTF(fid, "%%!PS\n"
+ "%% Create a 'filter' from local hex data\n"
+ "{ currentfile /ASCIIHexDecode filter /ReusableStreamDecode filter } exec\n");
+ /* hex data follows, 'file' object will be left on stack */
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++) {
+ data_short = (unsigned short)(*buff_ptr & 0xffff);
+ FPRINTF1(fid, "%04x", data_short);
+ buff_ptr++;
+ if ((x & 0x1f) == 0x1f && (x != (width - 1)))
+ FPRINTF(fid, "\n");
+ }
+ FPRINTF(fid, "\n"); /* end of one row */
+ }
+ FPRINTF(fid, ">\n"); /* ASCIIHexDecode EOF */
+ FPRINTF2(fid,
+ "<< /Thresholds 2 index %% file object for the 16-bit data\n"
+ " /HalftoneType 16\n"
+ " /Width %d\n"
+ " /Height %d\n"
+ ">>\n"
+ "exch pop %% discard ResuableStreamDecode file leaving the Halftone dict.\n",
+ width, height);
+ }
+ }
+ FCLOSE(fid);
+ }
+ return code;
+}
+#endif
+
#if RAW_SCREEN_DUMP
-void
-static
-htsc_dump_screen(htsc_dig_grid_t *dig_grid, char filename[])
+static int
+htsc_dump_screen(htsc_dig_grid_t *dig_grid, char filename[], gs_memory_t *mem)
{
char full_file_name[FULL_FILE_NAME_LENGTH];
- FILE *fid;
+ _FILE *fid;
int x,y;
int *buff_ptr = dig_grid->data;
int width = dig_grid->width;
@@ -1940,7 +2132,9 @@ htsc_dump_screen(htsc_dig_grid_t *dig_grid, char filename[])
byte data[3];
snprintf(full_file_name, FULL_FILE_NAME_LENGTH, "Screen_%s_%dx%dx3.raw",filename,width,height);
- fid = fopen(full_file_name,"wb");
+ fid = FOPEN(mem, full_file_name,"wb");
+ if (fid == NULL)
+ return -1;
for (y = 0; y < height; y++) {
for ( x = 0; x < width; x++ ) {
@@ -1957,58 +2151,67 @@ htsc_dump_screen(htsc_dig_grid_t *dig_grid, char filename[])
data[1] = *buff_ptr;
data[2] = *buff_ptr;
}
- fwrite(data,sizeof(unsigned char),3,fid);
+ FWRITE(data,sizeof(unsigned char),3,fid);
buff_ptr++;
}
}
- fclose(fid);
+ FCLOSE(fid);
+ return 0;
}
-static void
+static int
htsc_dump_float_image(double *image, int height, int width, double max_val,
- char filename[])
+ char filename[], gs_memory_t *mem)
{
char full_file_name[FULL_FILE_NAME_LENGTH];
- FILE *fid;
+ _FILE *fid;
int x,y;
int data;
byte data_byte;
snprintf(full_file_name, FULL_FILE_NAME_LENGTH, "Float_%s_%dx%d.raw",filename,width,height);
- fid = fopen(full_file_name,"wb");
+ fid = FOPEN(mem, full_file_name,"wb");
+ if (fid == NULL)
+ return -1;
+
for (y = 0; y < height; y++) {
for ( x = 0; x < width; x++ ) {
data = (255.0 * image[x + y * width] / max_val);
if (data > 255) data = 255;
if (data < 0) data = 0;
data_byte = data;
- fwrite(&data_byte,sizeof(byte),1,fid);
+ FWRITE(&data_byte,sizeof(byte),1,fid);
}
}
- fclose(fid);
+ FCLOSE(fid);
+ return 0;
}
-static void
+static int
htsc_dump_byte_image(byte *image, int height, int width, double max_val,
- char filename[])
+ char filename[], gs_memory_t *mem)
{
char full_file_name[FULL_FILE_NAME_LENGTH];
- FILE *fid;
+ _FILE *fid;
int x,y;
int data;
byte data_byte;
snprintf(full_file_name, FULL_FILE_NAME_LENGTH, "ByteScaled_%s_%dx%d.raw",filename,width,height);
- fid = fopen(full_file_name,"wb");
+ fid = FOPEN(mem, full_file_name,"wb");
+ if (fid == NULL)
+ return -1;
+
for (y = 0; y < height; y++) {
for ( x = 0; x < width; x++ ) {
data = (255.0 * image[x + y * width] / max_val);
if (data > 255) data = 255;
if (data < 0) data = 0;
data_byte = data;
- fwrite(&data_byte,sizeof(byte),1,fid);
+ FWRITE(&data_byte,sizeof(byte),1,fid);
}
}
- fclose(fid);
+ FCLOSE(fid);
+ return 0;
}
#endif
diff --git a/base/gen_ordered.h b/base/gen_ordered.h
index 30024773..e602c367 100644
--- a/base/gen_ordered.h
+++ b/base/gen_ordered.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -23,7 +23,10 @@
#ifndef RAW_SCREEN_DUMP
# define RAW_SCREEN_DUMP 0 /* Noisy output for .raw files for detailed debugging */
#endif
-#if RAW_SCREEN_DUMP || !defined(LIB_BUILD)
+#ifndef FINAL_SCREEN_DUMP
+# define FINAL_SCREEN_DUMP 0 /* Dump of the final PS result */
+#endif
+#if RAW_SCREEN_DUMP || FINAL_SCREEN_DUMP || !defined(LIB_BUILD)
# define FULL_FILE_NAME_LENGTH 50
#endif
@@ -100,6 +103,11 @@ void htsc_set_default_params(htsc_param_t *params);
Note that final_mask.memory must be set as needed for the allocator and
it is the callers responsibilty to free the final_mask.data that is returned.
*/
-int htsc_gen_ordered(htsc_param_t params, int *S, htsc_dig_grid_t *final_mask);
+int htsc_gen_ordered(htsc_param_t params, int *S, htsc_dig_grid_t *final_mask, gs_memory_t *mem);
+
+#if FINAL_SCREEN_DUMP
+int htsc_save_screen(htsc_dig_grid_t *final_mask, bool use_holladay_grid, int S,
+ htsc_param_t params, gs_memory_t *mem);
+#endif
#endif
diff --git a/base/genarch.c b/base/genarch.c
index 6953c190..554ee322 100644
--- a/base/genarch.c
+++ b/base/genarch.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/genconf.c b/base/genconf.c
index 58b271c0..09384bdd 100644
--- a/base/genconf.c
+++ b/base/genconf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gendev.c b/base/gendev.c
index 8001e26a..97dac7f6 100644
--- a/base/gendev.c
+++ b/base/gendev.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/genht.c b/base/genht.c
index 7b46a051..cccfdd60 100644
--- a/base/genht.c
+++ b/base/genht.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp.h b/base/gp.h
index 3321c4e6..b58206b5 100644
--- a/base/gp.h
+++ b/base/gp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_dosfe.c b/base/gp_dosfe.c
index abea97c8..9093ed51 100644
--- a/base/gp_dosfe.c
+++ b/base/gp_dosfe.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_dosfs.c b/base/gp_dosfs.c
index 76779ad5..4c663e56 100644
--- a/base/gp_dosfs.c
+++ b/base/gp_dosfs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_dvx.c b/base/gp_dvx.c
index 52918cee..21e7f03c 100644
--- a/base/gp_dvx.c
+++ b/base/gp_dvx.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_getnv.c b/base/gp_getnv.c
index 5eab3e34..06ca6aa1 100644
--- a/base/gp_getnv.c
+++ b/base/gp_getnv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_mktmp.c b/base/gp_mktmp.c
index 5ecef5d7..bfadccbb 100644
--- a/base/gp_mktmp.c
+++ b/base/gp_mktmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_msdll.c b/base/gp_msdll.c
index 040dd69f..f15d04e6 100644
--- a/base/gp_msdll.c
+++ b/base/gp_msdll.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_msdos.c b/base/gp_msdos.c
index 16b6e1fe..13beecc5 100644
--- a/base/gp_msdos.c
+++ b/base/gp_msdos.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_mshdl.c b/base/gp_mshdl.c
index 8bc04a1c..2b964ed7 100644
--- a/base/gp_mshdl.c
+++ b/base/gp_mshdl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_mslib.c b/base/gp_mslib.c
index 3f62985c..84f693f0 100644
--- a/base/gp_mslib.c
+++ b/base/gp_mslib.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_mspol.c b/base/gp_mspol.c
index 7dc80602..560fb3fe 100644
--- a/base/gp_mspol.c
+++ b/base/gp_mspol.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_msprn.c b/base/gp_msprn.c
index 758b8a55..ed482796 100644
--- a/base/gp_msprn.c
+++ b/base/gp_msprn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_mswin.c b/base/gp_mswin.c
index 1415cc82..a44edf99 100644
--- a/base/gp_mswin.c
+++ b/base/gp_mswin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_mswin.h b/base/gp_mswin.h
index bf187903..9e2d6578 100644
--- a/base/gp_mswin.h
+++ b/base/gp_mswin.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_nsync.c b/base/gp_nsync.c
index 32bb772d..cb16fa30 100644
--- a/base/gp_nsync.c
+++ b/base/gp_nsync.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_ntfs.c b/base/gp_ntfs.c
index 4bcbc341..fc6fe6a9 100644
--- a/base/gp_ntfs.c
+++ b/base/gp_ntfs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -22,6 +22,7 @@
#include <fcntl.h>
#include <io.h>
#include <stdio.h>
+#include "malloc_.h"
#include "memory_.h"
#include "string_.h"
#include "gstypes.h"
diff --git a/base/gp_nxpsprn.c b/base/gp_nxpsprn.c
index e74d64a3..84aacb06 100644
--- a/base/gp_nxpsprn.c
+++ b/base/gp_nxpsprn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_os2.c b/base/gp_os2.c
index 26a1165b..52f82565 100644
--- a/base/gp_os2.c
+++ b/base/gp_os2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_os2.h b/base/gp_os2.h
index a0b72c03..7def052e 100644
--- a/base/gp_os2.h
+++ b/base/gp_os2.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_os2fs.c b/base/gp_os2fs.c
index 943d9458..a7dad917 100644
--- a/base/gp_os2fs.c
+++ b/base/gp_os2fs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_os2pr.c b/base/gp_os2pr.c
index ebbc50b3..f852c71f 100644
--- a/base/gp_os2pr.c
+++ b/base/gp_os2pr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_os9.c b/base/gp_os9.c
index 190b1277..37b4cfb8 100644
--- a/base/gp_os9.c
+++ b/base/gp_os9.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_paper.c b/base/gp_paper.c
index f4677338..16ca8441 100644
--- a/base/gp_paper.c
+++ b/base/gp_paper.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_psync.c b/base/gp_psync.c
index 6d2c583e..7fc177fa 100644
--- a/base/gp_psync.c
+++ b/base/gp_psync.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -215,7 +215,7 @@ gp_monitor_open(gp_monitor * mona)
if (scode < 0) {
goto done;
}
-#else
+#else
((gp_pthread_recursive_t *)mona)->self_id = 0; /* Not valid unless mutex is locked */
((gp_pthread_recursive_t *)mona)->lcount = 0;
#endif
diff --git a/base/gp_stdia.c b/base/gp_stdia.c
index 07da07e7..2b3ede79 100644
--- a/base/gp_stdia.c
+++ b/base/gp_stdia.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_stdin.c b/base/gp_stdin.c
index 68230cdd..bb8ea16c 100644
--- a/base/gp_stdin.c
+++ b/base/gp_stdin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_strdl.c b/base/gp_strdl.c
index b6b345c0..d8a2f516 100644
--- a/base/gp_strdl.c
+++ b/base/gp_strdl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -21,7 +21,7 @@
#include "gp.h"
int
-gp_readline_init(void **preadline_data, gs_memory_t * mem)
+gp_readline_init(void **preadline_data, gs_memory_t * mem) /* lgtm [cpp/useless-expression] */
{
return 0;
}
diff --git a/base/gp_unifn.c b/base/gp_unifn.c
index bbba02a4..c5a3795d 100644
--- a/base/gp_unifn.c
+++ b/base/gp_unifn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_unifs.c b/base/gp_unifs.c
index dea5c6da..a007ddce 100644
--- a/base/gp_unifs.c
+++ b/base/gp_unifs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -247,7 +247,7 @@ int gp_pwrite_impl(const char *buf, size_t count, gs_offset_t offset, FILE *f)
/* Set a file into binary or text mode. */
int
-gp_setmode_binary_impl(FILE * pfile, bool mode)
+gp_setmode_binary_impl(FILE * pfile, bool mode) /* lgtm [cpp/useless-expression] */
{
return 0; /* Noop under Unix */
}
diff --git a/base/gp_unix.c b/base/gp_unix.c
index e4599508..420f7526 100644
--- a/base/gp_unix.c
+++ b/base/gp_unix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_upapr.c b/base/gp_upapr.c
index a3f56c00..8732c4f8 100644
--- a/base/gp_upapr.c
+++ b/base/gp_upapr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_vms.c b/base/gp_vms.c
index 1d31815b..55dd93bc 100644
--- a/base/gp_vms.c
+++ b/base/gp_vms.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_wgetv.c b/base/gp_wgetv.c
index 0f634214..f919e1f8 100644
--- a/base/gp_wgetv.c
+++ b/base/gp_wgetv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_win32.c b/base/gp_win32.c
index ed6516b2..e04a7e45 100644
--- a/base/gp_win32.c
+++ b/base/gp_win32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -70,24 +70,16 @@ gp_get_realtime(long *pdt)
void
gp_get_usertime(long *pdt)
{
+ FILETIME CreationTime, ExitTime, KernelTime, UserTime;
- LARGE_INTEGER freq;
- LARGE_INTEGER count;
- LARGE_INTEGER seconds;
-
- if (!QueryPerformanceFrequency(&freq)) {
+ if (!GetProcessTimes(GetCurrentProcess(), &CreationTime, &ExitTime, &KernelTime, &UserTime))
gp_get_realtime(pdt); /* use previous method if high-res perf counter not available */
- return;
+ else {
+ ULONGLONG t = (ULONGLONG)UserTime.dwLowDateTime + (ULONGLONG)KernelTime.dwLowDateTime
+ + (((ULONGLONG)UserTime.dwHighDateTime + (ULONGLONG)KernelTime.dwHighDateTime) << 32);
+ pdt[0] = (long)(t / 10000000);
+ pdt[1] = (long)(t % 10000000)*100;
}
- /* Get the high resolution time as seconds and nanoseconds */
- QueryPerformanceCounter(&count);
-
- seconds.QuadPart = (count.QuadPart / freq.QuadPart);
- pdt[0] = seconds.LowPart;
- count.QuadPart -= freq.QuadPart * seconds.QuadPart;
- count.QuadPart *= 1000000000; /* we want nanoseconds */
- count.QuadPart /= freq.QuadPart;
- pdt[1] = count.LowPart;
}
/* ------ Console management ------ */
diff --git a/base/gp_winfs.c b/base/gp_winfs.c
index 6c01ddc9..39795a19 100644
--- a/base/gp_winfs.c
+++ b/base/gp_winfs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_winfs2.c b/base/gp_winfs2.c
index 423b63fa..94ce9a68 100644
--- a/base/gp_winfs2.c
+++ b/base/gp_winfs2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_wpapr.c b/base/gp_wpapr.c
index 07efc617..92deaa6c 100644
--- a/base/gp_wpapr.c
+++ b/base/gp_wpapr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_wsync.c b/base/gp_wsync.c
index 8fca9006..36ec0439 100644
--- a/base/gp_wsync.c
+++ b/base/gp_wsync.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_wutf8.c b/base/gp_wutf8.c
index 0d816f99..b7b1d075 100644
--- a/base/gp_wutf8.c
+++ b/base/gp_wutf8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gp_wxpsprn.cpp b/base/gp_wxpsprn.cpp
index a629b095..d326e1b2 100644
--- a/base/gp_wxpsprn.cpp
+++ b/base/gp_wxpsprn.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gpcheck.h b/base/gpcheck.h
index 4292c438..a01c6a07 100644
--- a/base/gpcheck.h
+++ b/base/gpcheck.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gpgetenv.h b/base/gpgetenv.h
index 1f1a4bca..0ab31a93 100644
--- a/base/gpgetenv.h
+++ b/base/gpgetenv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gpmisc.c b/base/gpmisc.c
index bae297d8..3d878acc 100644
--- a/base/gpmisc.c
+++ b/base/gpmisc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -435,7 +435,7 @@ generic_pwrite(gp_file *f, size_t count, gs_offset_t offset, const void *buf)
gp_file *gp_file_alloc(const gs_memory_t *mem, const gp_file_ops_t *prototype, size_t size, const char *cname)
{
- gp_file *file = (gp_file *)gs_alloc_bytes(mem->non_gc_memory, size, cname ? cname : "gp_file");
+ gp_file *file = (gp_file *)gs_alloc_bytes(mem->thread_safe_memory, size, cname ? cname : "gp_file");
if (file == NULL)
return NULL;
@@ -449,7 +449,7 @@ gp_file *gp_file_alloc(const gs_memory_t *mem, const gp_file_ops_t *prototype, s
memset(((char *)file)+sizeof(*prototype),
0,
size - sizeof(*prototype));
- file->memory = mem->non_gc_memory;
+ file->memory = mem->thread_safe_memory;
return file;
}
@@ -1077,7 +1077,7 @@ gp_validate_path_len(const gs_memory_t *mem,
prefix_len = 0;
}
rlen = len+1;
- bufferfull = (char *)gs_alloc_bytes(mem->non_gc_memory, rlen + prefix_len, "gp_validate_path");
+ bufferfull = (char *)gs_alloc_bytes(mem->thread_safe_memory, rlen + prefix_len, "gp_validate_path");
if (bufferfull == NULL)
return gs_error_VMerror;
@@ -1139,7 +1139,7 @@ gp_validate_path_len(const gs_memory_t *mem,
gs_path_control_flag_is_scratch_file);
}
- gs_free_object(mem->non_gc_memory, bufferfull, "gp_validate_path");
+ gs_free_object(mem->thread_safe_memory, bufferfull, "gp_validate_path");
#ifdef EACCES
if (code == gs_error_invalidfileaccess)
errno = EACCES;
diff --git a/base/gpmisc.h b/base/gpmisc.h
index 9b3a0654..602285c8 100644
--- a/base/gpmisc.h
+++ b/base/gpmisc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gpsync.h b/base/gpsync.h
index a2d9b229..3f8715cb 100644
--- a/base/gpsync.h
+++ b/base/gpsync.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gs.mak b/base/gs.mak
index c4fbb91b..f67a2446 100644
--- a/base/gs.mak
+++ b/base/gs.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
diff --git a/base/gs_dll_call.h b/base/gs_dll_call.h
index 3a5efc63..c9db6937 100644
--- a/base/gs_dll_call.h
+++ b/base/gs_dll_call.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gs_mgl_e.h b/base/gs_mgl_e.h
index ef2d21e6..4d67c64b 100644
--- a/base/gs_mgl_e.h
+++ b/base/gs_mgl_e.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gs_mro_e.h b/base/gs_mro_e.h
index 32f74114..c2d74970 100644
--- a/base/gs_mro_e.h
+++ b/base/gs_mro_e.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsalloc.c b/base/gsalloc.c
index b8fb7b67..57a77c7d 100644
--- a/base/gsalloc.c
+++ b/base/gsalloc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -2830,7 +2830,7 @@ debug_print_object(const gs_memory_t *mem, const void *obj, const dump_control_t
;
}
if (options & dump_do_marks) {
- dmprintf2(mem, " smark/back=%u ("PRI_INTPTR")", pre->o_smark, pre->o_smark);
+ dmprintf2(mem, " smark/back=%u (0x%x)", pre->o_smark, pre->o_smark);
}
dmputc(mem, '\n');
if (type == &st_free)
@@ -2987,8 +2987,8 @@ static void ddct(const gs_memory_t *mem, clump_t *cp, clump_t *parent, int depth
dmlprintf7(mem, "Clump "PRI_INTPTR":"PRI_INTPTR" parent="PRI_INTPTR" left="PRI_INTPTR":"PRI_INTPTR" right="PRI_INTPTR":"PRI_INTPTR"\n",
(intptr_t)cp, (intptr_t)cp->cbase, (intptr_t)cp->parent,
- (intptr_t)cp->left, (intptr_t)cp->left ? cp->left->cbase : NULL,
- (intptr_t)cp->right, (intptr_t)cp->right ? cp->right->cbase : NULL);
+ (intptr_t)cp->left, (intptr_t)(cp->left ? cp->left->cbase : NULL),
+ (intptr_t)cp->right, (intptr_t)(cp->right ? cp->right->cbase : NULL));
if (cp->parent != parent)
dmlprintf(mem, "Parent pointer mismatch!\n");
ddct(mem, cp->left, cp, depth+1);
diff --git a/base/gsalloc.h b/base/gsalloc.h
index 4c9113fe..da8c8161 100644
--- a/base/gsalloc.h
+++ b/base/gsalloc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsargs.c b/base/gsargs.c
index 5ea73698..7fa399cb 100644
--- a/base/gsargs.c
+++ b/base/gsargs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsargs.h b/base/gsargs.h
index 2f277001..4767c85a 100644
--- a/base/gsargs.h
+++ b/base/gsargs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsbitcom.c b/base/gsbitcom.c
index 0d5856d0..77afae23 100644
--- a/base/gsbitcom.c
+++ b/base/gsbitcom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsbitmap.h b/base/gsbitmap.h
index 7e8f87cd..ce761d94 100644
--- a/base/gsbitmap.h
+++ b/base/gsbitmap.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsbitops.c b/base/gsbitops.c
index b3a59c27..479ebcd6 100644
--- a/base/gsbitops.c
+++ b/base/gsbitops.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsbitops.h b/base/gsbitops.h
index 6e1826a4..4087f19b 100644
--- a/base/gsbitops.h
+++ b/base/gsbitops.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsbittab.c b/base/gsbittab.c
index 3e171d3d..b9a42d92 100644
--- a/base/gsbittab.c
+++ b/base/gsbittab.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsbittab.h b/base/gsbittab.h
index 45b652c5..652ed00f 100644
--- a/base/gsbittab.h
+++ b/base/gsbittab.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsccode.h b/base/gsccode.h
index 9ed3aa78..10b88d6e 100644
--- a/base/gsccode.h
+++ b/base/gsccode.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -79,9 +79,9 @@ typedef uint64_t gs_glyph;
#define GS_NO_GLYPH ((gs_glyph)0x7fffffff)
-# define GS_MIN_CID_GLYPH ((gs_glyph)0x80000000L)
+#define GS_MIN_CID_GLYPH ((gs_glyph)0x80000000)
-#define GS_MIN_GLYPH_INDEX (GS_MIN_CID_GLYPH | (GS_MIN_CID_GLYPH >> 1))
+#define GS_MIN_GLYPH_INDEX (gs_glyph)(GS_MIN_CID_GLYPH | (GS_MIN_CID_GLYPH >> 1))
#define GS_GLYPH_TAG (gs_glyph)(GS_MIN_CID_GLYPH | GS_MIN_GLYPH_INDEX)
#define GS_MAX_GLYPH max_ulong
diff --git a/base/gsccolor.h b/base/gsccolor.h
index 1bdef311..86d948bc 100644
--- a/base/gsccolor.h
+++ b/base/gsccolor.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -36,7 +36,7 @@ typedef struct gs_pattern_instance_s gs_pattern_instance_t;
# define GS_CLIENT_COLOR_MAX_COMPONENTS (64)
#endif
-#ifndef MAX_COMPONENTS_IN_DEVN
+#ifndef MAX_COMPONENTS_IN_DEVN
# define MAX_COMPONENTS_IN_DEVN (64)
#endif
diff --git a/base/gscdef.c b/base/gscdef.c
index 2dcd6537..67ace135 100644
--- a/base/gscdef.c
+++ b/base/gscdef.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscdefs.h b/base/gscdefs.h
index 0ef78c02..e5e6123e 100644
--- a/base/gscdefs.h
+++ b/base/gscdefs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -27,7 +27,7 @@
#ifndef GS_COPYRIGHT
# define GS_COPYRIGHT\
- "Copyright (C) 2020 Artifex Software, Inc. All rights reserved."
+ "Copyright (C) 2021 Artifex Software, Inc. All rights reserved."
#endif
#ifndef GS_PRODUCTFAMILY
diff --git a/base/gscdevn.c b/base/gscdevn.c
index 07b20f4d..94ffc562 100644
--- a/base/gscdevn.c
+++ b/base/gscdevn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscdevn.h b/base/gscdevn.h
index 1a5603f5..f35e9b0e 100644
--- a/base/gscdevn.h
+++ b/base/gscdevn.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscedata.c b/base/gscedata.c
index e8deca00..2898533d 100644
--- a/base/gscedata.c
+++ b/base/gscedata.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -209,164 +209,169 @@ const char gs_c_known_encoding_chars[] = {
't','w','o', /*N(3,294)*/
'y','e','n', /*N(3,297)*/
'B','e','t','a', /*N(4,0)*/
-'E','u','r','o', /*N(4,4)*/
-'I','o','t','a', /*N(4,8)*/
-'Z','e','t','a', /*N(4,12)*/
-'a','1','0','0', /*N(4,16)*/
-'a','1','0','1', /*N(4,20)*/
-'a','1','0','2', /*N(4,24)*/
-'a','1','0','3', /*N(4,28)*/
-'a','1','0','4', /*N(4,32)*/
-'a','1','0','5', /*N(4,36)*/
-'a','1','0','6', /*N(4,40)*/
-'a','1','0','7', /*N(4,44)*/
-'a','1','0','8', /*N(4,48)*/
-'a','1','0','9', /*N(4,52)*/
-'a','1','1','0', /*N(4,56)*/
-'a','1','1','1', /*N(4,60)*/
-'a','1','1','2', /*N(4,64)*/
-'a','1','1','7', /*N(4,68)*/
-'a','1','1','8', /*N(4,72)*/
-'a','1','1','9', /*N(4,76)*/
-'a','1','2','0', /*N(4,80)*/
-'a','1','2','1', /*N(4,84)*/
-'a','1','2','2', /*N(4,88)*/
-'a','1','2','3', /*N(4,92)*/
-'a','1','2','4', /*N(4,96)*/
-'a','1','2','5', /*N(4,100)*/
-'a','1','2','6', /*N(4,104)*/
-'a','1','2','7', /*N(4,108)*/
-'a','1','2','8', /*N(4,112)*/
-'a','1','2','9', /*N(4,116)*/
-'a','1','3','0', /*N(4,120)*/
-'a','1','3','1', /*N(4,124)*/
-'a','1','3','2', /*N(4,128)*/
-'a','1','3','3', /*N(4,132)*/
-'a','1','3','4', /*N(4,136)*/
-'a','1','3','5', /*N(4,140)*/
-'a','1','3','6', /*N(4,144)*/
-'a','1','3','7', /*N(4,148)*/
-'a','1','3','8', /*N(4,152)*/
-'a','1','3','9', /*N(4,156)*/
-'a','1','4','0', /*N(4,160)*/
-'a','1','4','1', /*N(4,164)*/
-'a','1','4','2', /*N(4,168)*/
-'a','1','4','3', /*N(4,172)*/
-'a','1','4','4', /*N(4,176)*/
-'a','1','4','5', /*N(4,180)*/
-'a','1','4','6', /*N(4,184)*/
-'a','1','4','7', /*N(4,188)*/
-'a','1','4','8', /*N(4,192)*/
-'a','1','4','9', /*N(4,196)*/
-'a','1','5','0', /*N(4,200)*/
-'a','1','5','1', /*N(4,204)*/
-'a','1','5','2', /*N(4,208)*/
-'a','1','5','3', /*N(4,212)*/
-'a','1','5','4', /*N(4,216)*/
-'a','1','5','5', /*N(4,220)*/
-'a','1','5','6', /*N(4,224)*/
-'a','1','5','7', /*N(4,228)*/
-'a','1','5','8', /*N(4,232)*/
-'a','1','5','9', /*N(4,236)*/
-'a','1','6','0', /*N(4,240)*/
-'a','1','6','1', /*N(4,244)*/
-'a','1','6','2', /*N(4,248)*/
-'a','1','6','3', /*N(4,252)*/
-'a','1','6','4', /*N(4,256)*/
-'a','1','6','5', /*N(4,260)*/
-'a','1','6','6', /*N(4,264)*/
-'a','1','6','7', /*N(4,268)*/
-'a','1','6','8', /*N(4,272)*/
-'a','1','6','9', /*N(4,276)*/
-'a','1','7','0', /*N(4,280)*/
-'a','1','7','1', /*N(4,284)*/
-'a','1','7','2', /*N(4,288)*/
-'a','1','7','3', /*N(4,292)*/
-'a','1','7','4', /*N(4,296)*/
-'a','1','7','5', /*N(4,300)*/
-'a','1','7','6', /*N(4,304)*/
-'a','1','7','7', /*N(4,308)*/
-'a','1','7','8', /*N(4,312)*/
-'a','1','7','9', /*N(4,316)*/
-'a','1','8','0', /*N(4,320)*/
-'a','1','8','1', /*N(4,324)*/
-'a','1','8','2', /*N(4,328)*/
-'a','1','8','3', /*N(4,332)*/
-'a','1','8','4', /*N(4,336)*/
-'a','1','8','5', /*N(4,340)*/
-'a','1','8','6', /*N(4,344)*/
-'a','1','8','7', /*N(4,348)*/
-'a','1','8','8', /*N(4,352)*/
-'a','1','8','9', /*N(4,356)*/
-'a','1','9','0', /*N(4,360)*/
-'a','1','9','1', /*N(4,364)*/
-'a','1','9','2', /*N(4,368)*/
-'a','1','9','3', /*N(4,372)*/
-'a','1','9','4', /*N(4,376)*/
-'a','1','9','5', /*N(4,380)*/
-'a','1','9','6', /*N(4,384)*/
-'a','1','9','7', /*N(4,388)*/
-'a','1','9','8', /*N(4,392)*/
-'a','1','9','9', /*N(4,396)*/
-'a','2','0','0', /*N(4,400)*/
-'a','2','0','1', /*N(4,404)*/
-'a','2','0','2', /*N(4,408)*/
-'a','2','0','3', /*N(4,412)*/
-'a','2','0','4', /*N(4,416)*/
-'b','e','t','a', /*N(4,420)*/
-'c','e','n','t', /*N(4,424)*/
-'c','l','u','b', /*N(4,428)*/
-'f','i','v','e', /*N(4,432)*/
-'f','o','u','r', /*N(4,436)*/
-'i','o','t','a', /*N(4,440)*/
-'l','e','s','s', /*N(4,444)*/
-'n','i','n','e', /*N(4,448)*/
-'p','h','i','1', /*N(4,452)*/
-'p','l','u','s', /*N(4,456)*/
-'r','i','n','g', /*N(4,460)*/
-'z','e','r','o', /*N(4,464)*/
-'z','e','t','a', /*N(4,468)*/
+'B','o','l','d', /*N(4,4)*/
+'B','o','o','k', /*N(4,8)*/
+'E','u','r','o', /*N(4,12)*/
+'I','o','t','a', /*N(4,16)*/
+'Z','e','t','a', /*N(4,20)*/
+'a','1','0','0', /*N(4,24)*/
+'a','1','0','1', /*N(4,28)*/
+'a','1','0','2', /*N(4,32)*/
+'a','1','0','3', /*N(4,36)*/
+'a','1','0','4', /*N(4,40)*/
+'a','1','0','5', /*N(4,44)*/
+'a','1','0','6', /*N(4,48)*/
+'a','1','0','7', /*N(4,52)*/
+'a','1','0','8', /*N(4,56)*/
+'a','1','0','9', /*N(4,60)*/
+'a','1','1','0', /*N(4,64)*/
+'a','1','1','1', /*N(4,68)*/
+'a','1','1','2', /*N(4,72)*/
+'a','1','1','7', /*N(4,76)*/
+'a','1','1','8', /*N(4,80)*/
+'a','1','1','9', /*N(4,84)*/
+'a','1','2','0', /*N(4,88)*/
+'a','1','2','1', /*N(4,92)*/
+'a','1','2','2', /*N(4,96)*/
+'a','1','2','3', /*N(4,100)*/
+'a','1','2','4', /*N(4,104)*/
+'a','1','2','5', /*N(4,108)*/
+'a','1','2','6', /*N(4,112)*/
+'a','1','2','7', /*N(4,116)*/
+'a','1','2','8', /*N(4,120)*/
+'a','1','2','9', /*N(4,124)*/
+'a','1','3','0', /*N(4,128)*/
+'a','1','3','1', /*N(4,132)*/
+'a','1','3','2', /*N(4,136)*/
+'a','1','3','3', /*N(4,140)*/
+'a','1','3','4', /*N(4,144)*/
+'a','1','3','5', /*N(4,148)*/
+'a','1','3','6', /*N(4,152)*/
+'a','1','3','7', /*N(4,156)*/
+'a','1','3','8', /*N(4,160)*/
+'a','1','3','9', /*N(4,164)*/
+'a','1','4','0', /*N(4,168)*/
+'a','1','4','1', /*N(4,172)*/
+'a','1','4','2', /*N(4,176)*/
+'a','1','4','3', /*N(4,180)*/
+'a','1','4','4', /*N(4,184)*/
+'a','1','4','5', /*N(4,188)*/
+'a','1','4','6', /*N(4,192)*/
+'a','1','4','7', /*N(4,196)*/
+'a','1','4','8', /*N(4,200)*/
+'a','1','4','9', /*N(4,204)*/
+'a','1','5','0', /*N(4,208)*/
+'a','1','5','1', /*N(4,212)*/
+'a','1','5','2', /*N(4,216)*/
+'a','1','5','3', /*N(4,220)*/
+'a','1','5','4', /*N(4,224)*/
+'a','1','5','5', /*N(4,228)*/
+'a','1','5','6', /*N(4,232)*/
+'a','1','5','7', /*N(4,236)*/
+'a','1','5','8', /*N(4,240)*/
+'a','1','5','9', /*N(4,244)*/
+'a','1','6','0', /*N(4,248)*/
+'a','1','6','1', /*N(4,252)*/
+'a','1','6','2', /*N(4,256)*/
+'a','1','6','3', /*N(4,260)*/
+'a','1','6','4', /*N(4,264)*/
+'a','1','6','5', /*N(4,268)*/
+'a','1','6','6', /*N(4,272)*/
+'a','1','6','7', /*N(4,276)*/
+'a','1','6','8', /*N(4,280)*/
+'a','1','6','9', /*N(4,284)*/
+'a','1','7','0', /*N(4,288)*/
+'a','1','7','1', /*N(4,292)*/
+'a','1','7','2', /*N(4,296)*/
+'a','1','7','3', /*N(4,300)*/
+'a','1','7','4', /*N(4,304)*/
+'a','1','7','5', /*N(4,308)*/
+'a','1','7','6', /*N(4,312)*/
+'a','1','7','7', /*N(4,316)*/
+'a','1','7','8', /*N(4,320)*/
+'a','1','7','9', /*N(4,324)*/
+'a','1','8','0', /*N(4,328)*/
+'a','1','8','1', /*N(4,332)*/
+'a','1','8','2', /*N(4,336)*/
+'a','1','8','3', /*N(4,340)*/
+'a','1','8','4', /*N(4,344)*/
+'a','1','8','5', /*N(4,348)*/
+'a','1','8','6', /*N(4,352)*/
+'a','1','8','7', /*N(4,356)*/
+'a','1','8','8', /*N(4,360)*/
+'a','1','8','9', /*N(4,364)*/
+'a','1','9','0', /*N(4,368)*/
+'a','1','9','1', /*N(4,372)*/
+'a','1','9','2', /*N(4,376)*/
+'a','1','9','3', /*N(4,380)*/
+'a','1','9','4', /*N(4,384)*/
+'a','1','9','5', /*N(4,388)*/
+'a','1','9','6', /*N(4,392)*/
+'a','1','9','7', /*N(4,396)*/
+'a','1','9','8', /*N(4,400)*/
+'a','1','9','9', /*N(4,404)*/
+'a','2','0','0', /*N(4,408)*/
+'a','2','0','1', /*N(4,412)*/
+'a','2','0','2', /*N(4,416)*/
+'a','2','0','3', /*N(4,420)*/
+'a','2','0','4', /*N(4,424)*/
+'b','e','t','a', /*N(4,428)*/
+'c','e','n','t', /*N(4,432)*/
+'c','l','u','b', /*N(4,436)*/
+'f','i','v','e', /*N(4,440)*/
+'f','o','u','r', /*N(4,444)*/
+'i','o','t','a', /*N(4,448)*/
+'l','e','s','s', /*N(4,452)*/
+'n','i','n','e', /*N(4,456)*/
+'p','h','i','1', /*N(4,460)*/
+'p','l','u','s', /*N(4,464)*/
+'r','i','n','g', /*N(4,468)*/
+'z','e','r','o', /*N(4,472)*/
+'z','e','t','a', /*N(4,476)*/
'.','n','u','l','l', /*N(5,0)*/
'A','l','p','h','a', /*N(5,5)*/
'A','r','i','n','g', /*N(5,10)*/
-'D','e','l','t','a', /*N(5,15)*/
-'G','a','m','m','a', /*N(5,20)*/
-'K','a','p','p','a', /*N(5,25)*/
-'O','m','e','g','a', /*N(5,30)*/
-'S','i','g','m','a', /*N(5,35)*/
-'T','h','e','t','a', /*N(5,40)*/
-'T','h','o','r','n', /*N(5,45)*/
-'U','r','i','n','g', /*N(5,50)*/
-'a','c','u','t','e', /*N(5,55)*/
-'a','l','e','p','h', /*N(5,60)*/
-'a','l','p','h','a', /*N(5,65)*/
-'a','n','g','l','e', /*N(5,70)*/
-'a','r','i','n','g', /*N(5,75)*/
-'b','r','e','v','e', /*N(5,80)*/
-'c','a','r','o','n', /*N(5,85)*/
-'c','o','l','o','n', /*N(5,90)*/
-'c','o','m','m','a', /*N(5,95)*/
-'d','e','l','t','a', /*N(5,100)*/
-'e','i','g','h','t', /*N(5,105)*/
-'e','q','u','a','l', /*N(5,110)*/
-'f','r','a','n','c', /*N(5,115)*/
-'g','a','m','m','a', /*N(5,120)*/
-'g','r','a','v','e', /*N(5,125)*/
-'h','e','a','r','t', /*N(5,130)*/
-'k','a','p','p','a', /*N(5,135)*/
-'m','i','n','u','s', /*N(5,140)*/
-'o','m','e','g','a', /*N(5,145)*/
-'s','e','v','e','n', /*N(5,150)*/
-'s','i','g','m','a', /*N(5,155)*/
-'s','l','a','s','h', /*N(5,160)*/
-'s','p','a','c','e', /*N(5,165)*/
-'s','p','a','d','e', /*N(5,170)*/
-'t','h','e','t','a', /*N(5,175)*/
-'t','h','o','r','n', /*N(5,180)*/
-'t','h','r','e','e', /*N(5,185)*/
-'t','i','l','d','e', /*N(5,190)*/
-'u','n','i','o','n', /*N(5,195)*/
-'u','r','i','n','g', /*N(5,200)*/
+'B','l','a','c','k', /*N(5,15)*/
+'D','e','l','t','a', /*N(5,20)*/
+'G','a','m','m','a', /*N(5,25)*/
+'K','a','p','p','a', /*N(5,30)*/
+'L','i','g','h','t', /*N(5,35)*/
+'O','m','e','g','a', /*N(5,40)*/
+'R','o','m','a','n', /*N(5,45)*/
+'S','i','g','m','a', /*N(5,50)*/
+'T','h','e','t','a', /*N(5,55)*/
+'T','h','o','r','n', /*N(5,60)*/
+'U','r','i','n','g', /*N(5,65)*/
+'a','c','u','t','e', /*N(5,70)*/
+'a','l','e','p','h', /*N(5,75)*/
+'a','l','p','h','a', /*N(5,80)*/
+'a','n','g','l','e', /*N(5,85)*/
+'a','r','i','n','g', /*N(5,90)*/
+'b','r','e','v','e', /*N(5,95)*/
+'c','a','r','o','n', /*N(5,100)*/
+'c','o','l','o','n', /*N(5,105)*/
+'c','o','m','m','a', /*N(5,110)*/
+'d','e','l','t','a', /*N(5,115)*/
+'e','i','g','h','t', /*N(5,120)*/
+'e','q','u','a','l', /*N(5,125)*/
+'f','r','a','n','c', /*N(5,130)*/
+'g','a','m','m','a', /*N(5,135)*/
+'g','r','a','v','e', /*N(5,140)*/
+'h','e','a','r','t', /*N(5,145)*/
+'k','a','p','p','a', /*N(5,150)*/
+'m','i','n','u','s', /*N(5,155)*/
+'o','m','e','g','a', /*N(5,160)*/
+'s','e','v','e','n', /*N(5,165)*/
+'s','i','g','m','a', /*N(5,170)*/
+'s','l','a','s','h', /*N(5,175)*/
+'s','p','a','c','e', /*N(5,180)*/
+'s','p','a','d','e', /*N(5,185)*/
+'t','h','e','t','a', /*N(5,190)*/
+'t','h','o','r','n', /*N(5,195)*/
+'t','h','r','e','e', /*N(5,200)*/
+'t','i','l','d','e', /*N(5,205)*/
+'u','n','i','o','n', /*N(5,210)*/
+'u','r','i','n','g', /*N(5,215)*/
'A','a','c','u','t','e', /*N(6,0)*/
'A','b','r','e','v','e', /*N(6,6)*/
'A','g','r','a','v','e', /*N(6,12)*/
@@ -397,159 +402,166 @@ const char gs_c_known_encoding_chars[] = {
'L','c','a','r','o','n', /*N(6,162)*/
'L','s','l','a','s','h', /*N(6,168)*/
'L','s','m','a','l','l', /*N(6,174)*/
-'M','s','m','a','l','l', /*N(6,180)*/
-'N','a','c','u','t','e', /*N(6,186)*/
-'N','c','a','r','o','n', /*N(6,192)*/
-'N','s','m','a','l','l', /*N(6,198)*/
-'N','t','i','l','d','e', /*N(6,204)*/
-'O','a','c','u','t','e', /*N(6,210)*/
-'O','g','r','a','v','e', /*N(6,216)*/
-'O','s','l','a','s','h', /*N(6,222)*/
-'O','s','m','a','l','l', /*N(6,228)*/
-'O','t','i','l','d','e', /*N(6,234)*/
-'P','s','m','a','l','l', /*N(6,240)*/
-'Q','s','m','a','l','l', /*N(6,246)*/
-'R','a','c','u','t','e', /*N(6,252)*/
-'R','c','a','r','o','n', /*N(6,258)*/
-'R','s','m','a','l','l', /*N(6,264)*/
-'S','a','c','u','t','e', /*N(6,270)*/
-'S','c','a','r','o','n', /*N(6,276)*/
-'S','s','m','a','l','l', /*N(6,282)*/
-'T','c','a','r','o','n', /*N(6,288)*/
-'T','s','m','a','l','l', /*N(6,294)*/
-'U','a','c','u','t','e', /*N(6,300)*/
-'U','g','r','a','v','e', /*N(6,306)*/
-'U','s','m','a','l','l', /*N(6,312)*/
-'V','s','m','a','l','l', /*N(6,318)*/
-'W','s','m','a','l','l', /*N(6,324)*/
-'X','s','m','a','l','l', /*N(6,330)*/
-'Y','a','c','u','t','e', /*N(6,336)*/
-'Y','s','m','a','l','l', /*N(6,342)*/
-'Z','a','c','u','t','e', /*N(6,348)*/
-'Z','c','a','r','o','n', /*N(6,354)*/
-'Z','s','m','a','l','l', /*N(6,360)*/
-'a','a','c','u','t','e', /*N(6,366)*/
-'a','b','r','e','v','e', /*N(6,372)*/
-'a','g','r','a','v','e', /*N(6,378)*/
-'a','t','i','l','d','e', /*N(6,384)*/
-'b','u','l','l','e','t', /*N(6,390)*/
-'c','a','c','u','t','e', /*N(6,396)*/
-'c','c','a','r','o','n', /*N(6,402)*/
-'d','a','g','g','e','r', /*N(6,408)*/
-'d','c','a','r','o','n', /*N(6,414)*/
-'d','c','r','o','a','t', /*N(6,420)*/
-'d','e','g','r','e','e', /*N(6,426)*/
-'d','i','v','i','d','e', /*N(6,432)*/
-'d','o','l','l','a','r', /*N(6,438)*/
-'e','a','c','u','t','e', /*N(6,444)*/
-'e','c','a','r','o','n', /*N(6,450)*/
-'e','g','r','a','v','e', /*N(6,456)*/
-'e','m','d','a','s','h', /*N(6,462)*/
-'e','n','d','a','s','h', /*N(6,468)*/
-'e','x','c','l','a','m', /*N(6,474)*/
-'f','l','o','r','i','n', /*N(6,480)*/
-'g','b','r','e','v','e', /*N(6,486)*/
-'h','y','p','h','e','n', /*N(6,492)*/
-'i','a','c','u','t','e', /*N(6,498)*/
-'i','g','r','a','v','e', /*N(6,504)*/
-'l','a','c','u','t','e', /*N(6,510)*/
-'l','a','m','b','d','a', /*N(6,516)*/
-'l','c','a','r','o','n', /*N(6,522)*/
-'l','s','l','a','s','h', /*N(6,528)*/
-'m','a','c','r','o','n', /*N(6,534)*/
-'m','i','n','u','t','e', /*N(6,540)*/
-'n','a','c','u','t','e', /*N(6,546)*/
-'n','c','a','r','o','n', /*N(6,552)*/
-'n','t','i','l','d','e', /*N(6,558)*/
-'o','a','c','u','t','e', /*N(6,564)*/
-'o','g','o','n','e','k', /*N(6,570)*/
-'o','g','r','a','v','e', /*N(6,576)*/
-'o','m','e','g','a','1', /*N(6,582)*/
-'o','s','l','a','s','h', /*N(6,588)*/
-'o','t','i','l','d','e', /*N(6,594)*/
-'p','e','r','i','o','d', /*N(6,600)*/
-'r','a','c','u','t','e', /*N(6,606)*/
-'r','c','a','r','o','n', /*N(6,612)*/
-'r','u','p','i','a','h', /*N(6,618)*/
-'s','a','c','u','t','e', /*N(6,624)*/
-'s','c','a','r','o','n', /*N(6,630)*/
-'s','e','c','o','n','d', /*N(6,636)*/
-'s','i','g','m','a','1', /*N(6,642)*/
-'t','c','a','r','o','n', /*N(6,648)*/
-'t','h','e','t','a','1', /*N(6,654)*/
-'u','a','c','u','t','e', /*N(6,660)*/
-'u','g','r','a','v','e', /*N(6,666)*/
-'y','a','c','u','t','e', /*N(6,672)*/
-'z','a','c','u','t','e', /*N(6,678)*/
-'z','c','a','r','o','n', /*N(6,684)*/
+'M','e','d','i','u','m', /*N(6,180)*/
+'M','s','m','a','l','l', /*N(6,186)*/
+'N','a','c','u','t','e', /*N(6,192)*/
+'N','c','a','r','o','n', /*N(6,198)*/
+'N','s','m','a','l','l', /*N(6,204)*/
+'N','t','i','l','d','e', /*N(6,210)*/
+'O','a','c','u','t','e', /*N(6,216)*/
+'O','g','r','a','v','e', /*N(6,222)*/
+'O','s','l','a','s','h', /*N(6,228)*/
+'O','s','m','a','l','l', /*N(6,234)*/
+'O','t','i','l','d','e', /*N(6,240)*/
+'P','s','m','a','l','l', /*N(6,246)*/
+'Q','s','m','a','l','l', /*N(6,252)*/
+'R','a','c','u','t','e', /*N(6,258)*/
+'R','c','a','r','o','n', /*N(6,264)*/
+'R','s','m','a','l','l', /*N(6,270)*/
+'S','a','c','u','t','e', /*N(6,276)*/
+'S','c','a','r','o','n', /*N(6,282)*/
+'S','s','m','a','l','l', /*N(6,288)*/
+'T','c','a','r','o','n', /*N(6,294)*/
+'T','s','m','a','l','l', /*N(6,300)*/
+'U','a','c','u','t','e', /*N(6,306)*/
+'U','g','r','a','v','e', /*N(6,312)*/
+'U','s','m','a','l','l', /*N(6,318)*/
+'V','s','m','a','l','l', /*N(6,324)*/
+'W','s','m','a','l','l', /*N(6,330)*/
+'X','s','m','a','l','l', /*N(6,336)*/
+'Y','a','c','u','t','e', /*N(6,342)*/
+'Y','s','m','a','l','l', /*N(6,348)*/
+'Z','a','c','u','t','e', /*N(6,354)*/
+'Z','c','a','r','o','n', /*N(6,360)*/
+'Z','s','m','a','l','l', /*N(6,366)*/
+'a','a','c','u','t','e', /*N(6,372)*/
+'a','b','r','e','v','e', /*N(6,378)*/
+'a','g','r','a','v','e', /*N(6,384)*/
+'a','t','i','l','d','e', /*N(6,390)*/
+'b','u','l','l','e','t', /*N(6,396)*/
+'c','a','c','u','t','e', /*N(6,402)*/
+'c','c','a','r','o','n', /*N(6,408)*/
+'d','a','g','g','e','r', /*N(6,414)*/
+'d','c','a','r','o','n', /*N(6,420)*/
+'d','c','r','o','a','t', /*N(6,426)*/
+'d','e','g','r','e','e', /*N(6,432)*/
+'d','i','v','i','d','e', /*N(6,438)*/
+'d','o','l','l','a','r', /*N(6,444)*/
+'e','a','c','u','t','e', /*N(6,450)*/
+'e','c','a','r','o','n', /*N(6,456)*/
+'e','g','r','a','v','e', /*N(6,462)*/
+'e','m','d','a','s','h', /*N(6,468)*/
+'e','n','d','a','s','h', /*N(6,474)*/
+'e','x','c','l','a','m', /*N(6,480)*/
+'f','l','o','r','i','n', /*N(6,486)*/
+'g','b','r','e','v','e', /*N(6,492)*/
+'h','y','p','h','e','n', /*N(6,498)*/
+'i','a','c','u','t','e', /*N(6,504)*/
+'i','g','r','a','v','e', /*N(6,510)*/
+'l','a','c','u','t','e', /*N(6,516)*/
+'l','a','m','b','d','a', /*N(6,522)*/
+'l','c','a','r','o','n', /*N(6,528)*/
+'l','s','l','a','s','h', /*N(6,534)*/
+'m','a','c','r','o','n', /*N(6,540)*/
+'m','i','n','u','t','e', /*N(6,546)*/
+'n','a','c','u','t','e', /*N(6,552)*/
+'n','c','a','r','o','n', /*N(6,558)*/
+'n','t','i','l','d','e', /*N(6,564)*/
+'o','a','c','u','t','e', /*N(6,570)*/
+'o','g','o','n','e','k', /*N(6,576)*/
+'o','g','r','a','v','e', /*N(6,582)*/
+'o','m','e','g','a','1', /*N(6,588)*/
+'o','s','l','a','s','h', /*N(6,594)*/
+'o','t','i','l','d','e', /*N(6,600)*/
+'p','e','r','i','o','d', /*N(6,606)*/
+'r','a','c','u','t','e', /*N(6,612)*/
+'r','c','a','r','o','n', /*N(6,618)*/
+'r','u','p','i','a','h', /*N(6,624)*/
+'s','a','c','u','t','e', /*N(6,630)*/
+'s','c','a','r','o','n', /*N(6,636)*/
+'s','e','c','o','n','d', /*N(6,642)*/
+'s','i','g','m','a','1', /*N(6,648)*/
+'t','c','a','r','o','n', /*N(6,654)*/
+'t','h','e','t','a','1', /*N(6,660)*/
+'u','a','c','u','t','e', /*N(6,666)*/
+'u','g','r','a','v','e', /*N(6,672)*/
+'y','a','c','u','t','e', /*N(6,678)*/
+'z','a','c','u','t','e', /*N(6,684)*/
+'z','c','a','r','o','n', /*N(6,690)*/
'.','n','o','t','d','e','f', /*N(7,0)*/
-'A','E','s','m','a','l','l', /*N(7,7)*/
-'A','m','a','c','r','o','n', /*N(7,14)*/
-'A','o','g','o','n','e','k', /*N(7,21)*/
-'E','m','a','c','r','o','n', /*N(7,28)*/
-'E','o','g','o','n','e','k', /*N(7,35)*/
-'E','p','s','i','l','o','n', /*N(7,42)*/
-'I','m','a','c','r','o','n', /*N(7,49)*/
-'I','o','g','o','n','e','k', /*N(7,56)*/
-'O','E','s','m','a','l','l', /*N(7,63)*/
-'O','m','a','c','r','o','n', /*N(7,70)*/
-'O','m','i','c','r','o','n', /*N(7,77)*/
-'U','m','a','c','r','o','n', /*N(7,84)*/
-'U','o','g','o','n','e','k', /*N(7,91)*/
-'U','p','s','i','l','o','n', /*N(7,98)*/
-'a','m','a','c','r','o','n', /*N(7,105)*/
-'a','o','g','o','n','e','k', /*N(7,112)*/
-'a','r','r','o','w','u','p', /*N(7,119)*/
-'b','r','a','c','e','e','x', /*N(7,126)*/
-'c','e','d','i','l','l','a', /*N(7,133)*/
-'d','i','a','m','o','n','d', /*N(7,140)*/
-'d','m','a','c','r','o','n', /*N(7,147)*/
-'d','o','t','m','a','t','h', /*N(7,154)*/
-'e','l','e','m','e','n','t', /*N(7,161)*/
-'e','m','a','c','r','o','n', /*N(7,168)*/
-'e','o','g','o','n','e','k', /*N(7,175)*/
-'e','p','s','i','l','o','n', /*N(7,182)*/
-'g','r','e','a','t','e','r', /*N(7,189)*/
-'i','m','a','c','r','o','n', /*N(7,196)*/
-'i','o','g','o','n','e','k', /*N(7,203)*/
-'l','o','z','e','n','g','e', /*N(7,210)*/
-'n','b','s','p','a','c','e', /*N(7,217)*/
-'o','m','a','c','r','o','n', /*N(7,224)*/
-'o','m','i','c','r','o','n', /*N(7,231)*/
-'o','n','e','h','a','l','f', /*N(7,238)*/
-'p','e','r','c','e','n','t', /*N(7,245)*/
-'p','r','o','d','u','c','t', /*N(7,252)*/
-'r','a','d','i','c','a','l', /*N(7,259)*/
-'s','e','c','t','i','o','n', /*N(7,266)*/
-'s','i','m','i','l','a','r', /*N(7,273)*/
-'u','m','a','c','r','o','n', /*N(7,280)*/
-'u','o','g','o','n','e','k', /*N(7,287)*/
-'u','p','s','i','l','o','n', /*N(7,294)*/
+'0','0','1','.','0','0','0', /*N(7,7)*/
+'0','0','1','.','0','0','1', /*N(7,14)*/
+'0','0','1','.','0','0','2', /*N(7,21)*/
+'0','0','1','.','0','0','3', /*N(7,28)*/
+'A','E','s','m','a','l','l', /*N(7,35)*/
+'A','m','a','c','r','o','n', /*N(7,42)*/
+'A','o','g','o','n','e','k', /*N(7,49)*/
+'E','m','a','c','r','o','n', /*N(7,56)*/
+'E','o','g','o','n','e','k', /*N(7,63)*/
+'E','p','s','i','l','o','n', /*N(7,70)*/
+'I','m','a','c','r','o','n', /*N(7,77)*/
+'I','o','g','o','n','e','k', /*N(7,84)*/
+'O','E','s','m','a','l','l', /*N(7,91)*/
+'O','m','a','c','r','o','n', /*N(7,98)*/
+'O','m','i','c','r','o','n', /*N(7,105)*/
+'R','e','g','u','l','a','r', /*N(7,112)*/
+'U','m','a','c','r','o','n', /*N(7,119)*/
+'U','o','g','o','n','e','k', /*N(7,126)*/
+'U','p','s','i','l','o','n', /*N(7,133)*/
+'a','m','a','c','r','o','n', /*N(7,140)*/
+'a','o','g','o','n','e','k', /*N(7,147)*/
+'a','r','r','o','w','u','p', /*N(7,154)*/
+'b','r','a','c','e','e','x', /*N(7,161)*/
+'c','e','d','i','l','l','a', /*N(7,168)*/
+'d','i','a','m','o','n','d', /*N(7,175)*/
+'d','m','a','c','r','o','n', /*N(7,182)*/
+'d','o','t','m','a','t','h', /*N(7,189)*/
+'e','l','e','m','e','n','t', /*N(7,196)*/
+'e','m','a','c','r','o','n', /*N(7,203)*/
+'e','o','g','o','n','e','k', /*N(7,210)*/
+'e','p','s','i','l','o','n', /*N(7,217)*/
+'g','r','e','a','t','e','r', /*N(7,224)*/
+'i','m','a','c','r','o','n', /*N(7,231)*/
+'i','o','g','o','n','e','k', /*N(7,238)*/
+'l','o','z','e','n','g','e', /*N(7,245)*/
+'n','b','s','p','a','c','e', /*N(7,252)*/
+'o','m','a','c','r','o','n', /*N(7,259)*/
+'o','m','i','c','r','o','n', /*N(7,266)*/
+'o','n','e','h','a','l','f', /*N(7,273)*/
+'p','e','r','c','e','n','t', /*N(7,280)*/
+'p','r','o','d','u','c','t', /*N(7,287)*/
+'r','a','d','i','c','a','l', /*N(7,294)*/
+'s','e','c','t','i','o','n', /*N(7,301)*/
+'s','i','m','i','l','a','r', /*N(7,308)*/
+'u','m','a','c','r','o','n', /*N(7,315)*/
+'u','o','g','o','n','e','k', /*N(7,322)*/
+'u','p','s','i','l','o','n', /*N(7,329)*/
'C','c','e','d','i','l','l','a', /*N(8,0)*/
'E','t','h','s','m','a','l','l', /*N(8,8)*/
'I','f','r','a','k','t','u','r', /*N(8,16)*/
'R','f','r','a','k','t','u','r', /*N(8,24)*/
'S','c','e','d','i','l','l','a', /*N(8,32)*/
-'U','p','s','i','l','o','n','1', /*N(8,40)*/
-'a','s','t','e','r','i','s','k', /*N(8,48)*/
-'c','c','e','d','i','l','l','a', /*N(8,56)*/
-'c','u','r','r','e','n','c','y', /*N(8,64)*/
-'d','i','e','r','e','s','i','s', /*N(8,72)*/
-'d','o','t','l','e','s','s','i', /*N(8,80)*/
-'e','l','l','i','p','s','i','s', /*N(8,88)*/
-'e','m','p','t','y','s','e','t', /*N(8,96)*/
-'f','r','a','c','t','i','o','n', /*N(8,104)*/
-'g','r','a','d','i','e','n','t', /*N(8,112)*/
-'i','n','f','i','n','i','t','y', /*N(8,120)*/
-'i','n','t','e','g','r','a','l', /*N(8,128)*/
-'m','u','l','t','i','p','l','y', /*N(8,136)*/
-'n','o','t','e','q','u','a','l', /*N(8,144)*/
-'o','n','e','t','h','i','r','d', /*N(8,152)*/
-'q','u','e','s','t','i','o','n', /*N(8,160)*/
-'q','u','o','t','e','d','b','l', /*N(8,168)*/
-'s','c','e','d','i','l','l','a', /*N(8,176)*/
-'s','t','e','r','l','i','n','g', /*N(8,184)*/
-'s','u','c','h','t','h','a','t', /*N(8,192)*/
+'S','e','m','i','b','o','l','d', /*N(8,40)*/
+'U','p','s','i','l','o','n','1', /*N(8,48)*/
+'a','s','t','e','r','i','s','k', /*N(8,56)*/
+'c','c','e','d','i','l','l','a', /*N(8,64)*/
+'c','u','r','r','e','n','c','y', /*N(8,72)*/
+'d','i','e','r','e','s','i','s', /*N(8,80)*/
+'d','o','t','l','e','s','s','i', /*N(8,88)*/
+'e','l','l','i','p','s','i','s', /*N(8,96)*/
+'e','m','p','t','y','s','e','t', /*N(8,104)*/
+'f','r','a','c','t','i','o','n', /*N(8,112)*/
+'g','r','a','d','i','e','n','t', /*N(8,120)*/
+'i','n','f','i','n','i','t','y', /*N(8,128)*/
+'i','n','t','e','g','r','a','l', /*N(8,136)*/
+'m','u','l','t','i','p','l','y', /*N(8,144)*/
+'n','o','t','e','q','u','a','l', /*N(8,152)*/
+'o','n','e','t','h','i','r','d', /*N(8,160)*/
+'q','u','e','s','t','i','o','n', /*N(8,168)*/
+'q','u','o','t','e','d','b','l', /*N(8,176)*/
+'s','c','e','d','i','l','l','a', /*N(8,184)*/
+'s','t','e','r','l','i','n','g', /*N(8,192)*/
+'s','u','c','h','t','h','a','t', /*N(8,200)*/
'A','d','i','e','r','e','s','i','s', /*N(9,0)*/
'E','d','i','e','r','e','s','i','s', /*N(9,9)*/
'I','d','i','e','r','e','s','i','s', /*N(9,18)*/
@@ -831,12 +843,12 @@ const char gs_c_known_encoding_chars[] = {
't','h','r','e','e','q','u','a','r','t','e','r','s','e','m','d','a','s','h', /*N(19,0)*/
0};
-const int gs_c_known_encoding_total_chars = 5483;
+const int gs_c_known_encoding_total_chars = 5555;
const int gs_c_known_encoding_max_length = 19;
const ushort gs_c_known_encoding_offsets[] = {
-0,0,52,104,404,876,1081,1771,2072,2272,2776,3116,3754,4414,4830,5250,5280,5360,5428,5464,5483};
+0,0,52,104,404,884,1104,1800,2136,2344,2848,3188,3826,4486,4902,5322,5352,5432,5500,5536,5555};
const int gs_c_known_encoding_count = 11;
@@ -874,38 +886,38 @@ N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
-N(5,165), /*space*/
-N(6,474), /*exclam*/
-N(8,168), /*quotedbl*/
+N(5,180), /*space*/
+N(6,480), /*exclam*/
+N(8,176), /*quotedbl*/
N(10,270), /*numbersign*/
-N(6,438), /*dollar*/
-N(7,245), /*percent*/
+N(6,444), /*dollar*/
+N(7,280), /*percent*/
N(9,72), /*ampersand*/
N(10,300), /*quoteright*/
N(9,369), /*parenleft*/
N(10,290), /*parenright*/
-N(8,48), /*asterisk*/
-N(4,456), /*plus*/
-N(5,95), /*comma*/
-N(6,492), /*hyphen*/
-N(6,600), /*period*/
-N(5,160), /*slash*/
-N(4,464), /*zero*/
+N(8,56), /*asterisk*/
+N(4,464), /*plus*/
+N(5,110), /*comma*/
+N(6,498), /*hyphen*/
+N(6,606), /*period*/
+N(5,175), /*slash*/
+N(4,472), /*zero*/
N(3,276), /*one*/
N(3,294), /*two*/
-N(5,185), /*three*/
-N(4,436), /*four*/
-N(4,432), /*five*/
+N(5,200), /*three*/
+N(4,444), /*four*/
+N(4,440), /*five*/
N(3,288), /*six*/
-N(5,150), /*seven*/
-N(5,105), /*eight*/
-N(4,448), /*nine*/
-N(5,90), /*colon*/
+N(5,165), /*seven*/
+N(5,120), /*eight*/
+N(4,456), /*nine*/
+N(5,105), /*colon*/
N(9,414), /*semicolon*/
-N(4,444), /*less*/
-N(5,110), /*equal*/
-N(7,189), /*greater*/
-N(8,160), /*question*/
+N(4,452), /*less*/
+N(5,125), /*equal*/
+N(7,224), /*greater*/
+N(8,168), /*question*/
N(2,34), /*at*/
N(1,0), /*A*/
N(1,1), /*B*/
@@ -1004,13 +1016,13 @@ N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(10,180), /*exclamdown*/
-N(4,424), /*cent*/
-N(8,184), /*sterling*/
-N(8,104), /*fraction*/
+N(4,432), /*cent*/
+N(8,192), /*sterling*/
+N(8,112), /*fraction*/
N(3,297), /*yen*/
-N(6,480), /*florin*/
-N(7,266), /*section*/
-N(8,64), /*currency*/
+N(6,486), /*florin*/
+N(7,301), /*section*/
+N(8,72), /*currency*/
N(11,539), /*quotesingle*/
N(12,528), /*quotedblleft*/
N(13,208), /*guillemotleft*/
@@ -1019,38 +1031,38 @@ N(14,252), /*guilsinglright*/
N(2,38), /*fi*/
N(2,40), /*fl*/
N(7,0), /*.notdef*/
-N(6,468), /*endash*/
-N(6,408), /*dagger*/
+N(6,474), /*endash*/
+N(6,414), /*dagger*/
N(9,189), /*daggerdbl*/
N(14,308), /*periodcentered*/
N(7,0), /*.notdef*/
N(9,360), /*paragraph*/
-N(6,390), /*bullet*/
+N(6,396), /*bullet*/
N(14,364), /*quotesinglbase*/
N(12,516), /*quotedblbase*/
N(13,273), /*quotedblright*/
N(14,238), /*guillemotright*/
-N(8,88), /*ellipsis*/
+N(8,96), /*ellipsis*/
N(11,528), /*perthousand*/
N(7,0), /*.notdef*/
N(12,504), /*questiondown*/
N(7,0), /*.notdef*/
-N(5,125), /*grave*/
-N(5,55), /*acute*/
+N(5,140), /*grave*/
+N(5,70), /*acute*/
N(10,160), /*circumflex*/
-N(5,190), /*tilde*/
-N(6,534), /*macron*/
-N(5,80), /*breve*/
+N(5,205), /*tilde*/
+N(6,540), /*macron*/
+N(5,95), /*breve*/
N(9,198), /*dotaccent*/
-N(8,72), /*dieresis*/
+N(8,80), /*dieresis*/
N(7,0), /*.notdef*/
-N(4,460), /*ring*/
-N(7,133), /*cedilla*/
+N(4,468), /*ring*/
+N(7,168), /*cedilla*/
N(7,0), /*.notdef*/
N(12,336), /*hungarumlaut*/
-N(6,570), /*ogonek*/
-N(5,85), /*caron*/
-N(6,462), /*emdash*/
+N(6,576), /*ogonek*/
+N(5,100), /*caron*/
+N(6,468), /*emdash*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
@@ -1075,7 +1087,7 @@ N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(6,168), /*Lslash*/
-N(6,222), /*Oslash*/
+N(6,228), /*Oslash*/
N(2,8), /*OE*/
N(12,432), /*ordmasculine*/
N(7,0), /*.notdef*/
@@ -1087,11 +1099,11 @@ N(2,32), /*ae*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
-N(8,80), /*dotlessi*/
+N(8,88), /*dotlessi*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
-N(6,528), /*lslash*/
-N(6,588), /*oslash*/
+N(6,534), /*lslash*/
+N(6,594), /*oslash*/
N(2,46), /*oe*/
N(10,200), /*germandbls*/
N(7,0), /*.notdef*/
@@ -1156,61 +1168,61 @@ static const ushort gs_c_known_encoding_reverse_0[] = {
250, /* N(2,46): oe*/
118, /* N(1,47): v*/
119, /* N(1,48): w*/
-42, /* N(8,48): asterisk*/
120, /* N(1,49): x*/
121, /* N(1,50): y*/
122, /* N(1,51): z*/
-194, /* N(5,55): acute*/
-168, /* N(8,64): currency*/
-200, /* N(8,72): dieresis*/
+42, /* N(8,56): asterisk*/
+194, /* N(5,70): acute*/
+168, /* N(8,72): currency*/
38, /* N(9,72): ampersand*/
-198, /* N(5,80): breve*/
-245, /* N(8,80): dotlessi*/
-207, /* N(5,85): caron*/
-188, /* N(8,88): ellipsis*/
-58, /* N(5,90): colon*/
-44, /* N(5,95): comma*/
-164, /* N(8,104): fraction*/
-56, /* N(5,105): eight*/
-61, /* N(5,110): equal*/
-193, /* N(5,125): grave*/
+200, /* N(8,80): dieresis*/
+245, /* N(8,88): dotlessi*/
+198, /* N(5,95): breve*/
+188, /* N(8,96): ellipsis*/
+207, /* N(5,100): caron*/
+58, /* N(5,105): colon*/
+44, /* N(5,110): comma*/
+164, /* N(8,112): fraction*/
+56, /* N(5,120): eight*/
+61, /* N(5,125): equal*/
126, /* N(10,130): asciitilde*/
-203, /* N(7,133): cedilla*/
92, /* N(9,135): backslash*/
+193, /* N(5,140): grave*/
125, /* N(10,140): braceright*/
123, /* N(9,144): braceleft*/
-55, /* N(5,150): seven*/
-47, /* N(5,160): slash*/
-63, /* N(8,160): question*/
195, /* N(10,160): circumflex*/
-32, /* N(5,165): space*/
+55, /* N(5,165): seven*/
232, /* N(6,168): Lslash*/
-34, /* N(8,168): quotedbl*/
+203, /* N(7,168): cedilla*/
+63, /* N(8,168): question*/
+47, /* N(5,175): slash*/
+34, /* N(8,176): quotedbl*/
+32, /* N(5,180): space*/
161, /* N(10,180): exclamdown*/
-163, /* N(8,184): sterling*/
-51, /* N(5,185): three*/
-62, /* N(7,189): greater*/
179, /* N(9,189): daggerdbl*/
-196, /* N(5,190): tilde*/
+163, /* N(8,192): sterling*/
93, /* N(12,192): bracketright*/
199, /* N(9,198): dotaccent*/
+51, /* N(5,200): three*/
251, /* N(10,200): germandbls*/
+196, /* N(5,205): tilde*/
171, /* N(13,208): guillemotleft*/
172, /* N(13,221): guilsinglleft*/
-233, /* N(6,222): Oslash*/
+62, /* N(7,224): greater*/
+233, /* N(6,228): Oslash*/
187, /* N(14,238): guillemotright*/
-37, /* N(7,245): percent*/
173, /* N(14,252): guilsinglright*/
124, /* N(3,255): bar*/
-167, /* N(7,266): section*/
35, /* N(10,270): numbersign*/
186, /* N(13,273): quotedblright*/
49, /* N(3,276): one*/
+37, /* N(7,280): percent*/
54, /* N(3,288): six*/
41, /* N(10,290): parenright*/
50, /* N(3,294): two*/
165, /* N(3,297): yen*/
39, /* N(10,300): quoteright*/
+167, /* N(7,301): section*/
94, /* N(11,308): asciicircum*/
180, /* N(14,308): periodcentered*/
95, /* N(10,320): underscore*/
@@ -1220,35 +1232,35 @@ static const ushort gs_c_known_encoding_reverse_0[] = {
184, /* N(14,364): quotesinglbase*/
40, /* N(9,369): parenleft*/
96, /* N(9,387): quoteleft*/
-183, /* N(6,390): bullet*/
-178, /* N(6,408): dagger*/
+183, /* N(6,396): bullet*/
+178, /* N(6,414): dagger*/
59, /* N(9,414): semicolon*/
-162, /* N(4,424): cent*/
-53, /* N(4,432): five*/
+162, /* N(4,432): cent*/
235, /* N(12,432): ordmasculine*/
-52, /* N(4,436): four*/
-36, /* N(6,438): dollar*/
-60, /* N(4,444): less*/
-57, /* N(4,448): nine*/
-43, /* N(4,456): plus*/
-202, /* N(4,460): ring*/
-208, /* N(6,462): emdash*/
-48, /* N(4,464): zero*/
-177, /* N(6,468): endash*/
+53, /* N(4,440): five*/
+52, /* N(4,444): four*/
+36, /* N(6,444): dollar*/
+60, /* N(4,452): less*/
+57, /* N(4,456): nine*/
+43, /* N(4,464): plus*/
+202, /* N(4,468): ring*/
+208, /* N(6,468): emdash*/
+48, /* N(4,472): zero*/
227, /* N(11,473): ordfeminine*/
-33, /* N(6,474): exclam*/
-166, /* N(6,480): florin*/
-45, /* N(6,492): hyphen*/
+177, /* N(6,474): endash*/
+33, /* N(6,480): exclam*/
+166, /* N(6,486): florin*/
+45, /* N(6,498): hyphen*/
191, /* N(12,504): questiondown*/
185, /* N(12,516): quotedblbase*/
-248, /* N(6,528): lslash*/
189, /* N(11,528): perthousand*/
170, /* N(12,528): quotedblleft*/
-197, /* N(6,534): macron*/
+248, /* N(6,534): lslash*/
169, /* N(11,539): quotesingle*/
-206, /* N(6,570): ogonek*/
-249, /* N(6,588): oslash*/
-46, /* N(6,600): period*/
+197, /* N(6,540): macron*/
+206, /* N(6,576): ogonek*/
+249, /* N(6,594): oslash*/
+46, /* N(6,606): period*/
0};
/* ISOLatin1Encoding */
@@ -1285,38 +1297,38 @@ N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
-N(5,165), /*space*/
-N(6,474), /*exclam*/
-N(8,168), /*quotedbl*/
+N(5,180), /*space*/
+N(6,480), /*exclam*/
+N(8,176), /*quotedbl*/
N(10,270), /*numbersign*/
-N(6,438), /*dollar*/
-N(7,245), /*percent*/
+N(6,444), /*dollar*/
+N(7,280), /*percent*/
N(9,72), /*ampersand*/
N(10,300), /*quoteright*/
N(9,369), /*parenleft*/
N(10,290), /*parenright*/
-N(8,48), /*asterisk*/
-N(4,456), /*plus*/
-N(5,95), /*comma*/
-N(5,140), /*minus*/
-N(6,600), /*period*/
-N(5,160), /*slash*/
-N(4,464), /*zero*/
+N(8,56), /*asterisk*/
+N(4,464), /*plus*/
+N(5,110), /*comma*/
+N(5,155), /*minus*/
+N(6,606), /*period*/
+N(5,175), /*slash*/
+N(4,472), /*zero*/
N(3,276), /*one*/
N(3,294), /*two*/
-N(5,185), /*three*/
-N(4,436), /*four*/
-N(4,432), /*five*/
+N(5,200), /*three*/
+N(4,444), /*four*/
+N(4,440), /*five*/
N(3,288), /*six*/
-N(5,150), /*seven*/
-N(5,105), /*eight*/
-N(4,448), /*nine*/
-N(5,90), /*colon*/
+N(5,165), /*seven*/
+N(5,120), /*eight*/
+N(4,456), /*nine*/
+N(5,105), /*colon*/
N(9,414), /*semicolon*/
-N(4,444), /*less*/
-N(5,110), /*equal*/
-N(7,189), /*greater*/
-N(8,160), /*question*/
+N(4,452), /*less*/
+N(5,125), /*equal*/
+N(7,224), /*greater*/
+N(8,168), /*question*/
N(2,34), /*at*/
N(1,0), /*A*/
N(1,1), /*B*/
@@ -1397,52 +1409,52 @@ N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
-N(8,80), /*dotlessi*/
-N(5,125), /*grave*/
-N(5,55), /*acute*/
+N(8,88), /*dotlessi*/
+N(5,140), /*grave*/
+N(5,70), /*acute*/
N(10,160), /*circumflex*/
-N(5,190), /*tilde*/
-N(6,534), /*macron*/
-N(5,80), /*breve*/
+N(5,205), /*tilde*/
+N(6,540), /*macron*/
+N(5,95), /*breve*/
N(9,198), /*dotaccent*/
-N(8,72), /*dieresis*/
+N(8,80), /*dieresis*/
N(7,0), /*.notdef*/
-N(4,460), /*ring*/
-N(7,133), /*cedilla*/
+N(4,468), /*ring*/
+N(7,168), /*cedilla*/
N(7,0), /*.notdef*/
N(12,336), /*hungarumlaut*/
-N(6,570), /*ogonek*/
-N(5,85), /*caron*/
-N(5,165), /*space*/
+N(6,576), /*ogonek*/
+N(5,100), /*caron*/
+N(5,180), /*space*/
N(10,180), /*exclamdown*/
-N(4,424), /*cent*/
-N(8,184), /*sterling*/
-N(8,64), /*currency*/
+N(4,432), /*cent*/
+N(8,192), /*sterling*/
+N(8,72), /*currency*/
N(3,297), /*yen*/
N(9,153), /*brokenbar*/
-N(7,266), /*section*/
-N(8,72), /*dieresis*/
+N(7,301), /*section*/
+N(8,80), /*dieresis*/
N(9,180), /*copyright*/
N(11,473), /*ordfeminine*/
N(13,208), /*guillemotleft*/
N(10,250), /*logicalnot*/
-N(6,492), /*hyphen*/
+N(6,498), /*hyphen*/
N(10,310), /*registered*/
-N(6,534), /*macron*/
-N(6,426), /*degree*/
+N(6,540), /*macron*/
+N(6,432), /*degree*/
N(9,378), /*plusminus*/
N(11,605), /*twosuperior*/
N(13,377), /*threesuperior*/
-N(5,55), /*acute*/
+N(5,70), /*acute*/
N(2,42), /*mu*/
N(9,360), /*paragraph*/
N(14,308), /*periodcentered*/
-N(7,133), /*cedilla*/
+N(7,168), /*cedilla*/
N(11,462), /*onesuperior*/
N(12,432), /*ordmasculine*/
N(14,238), /*guillemotright*/
N(10,280), /*onequarter*/
-N(7,238), /*onehalf*/
+N(7,273), /*onehalf*/
N(13,364), /*threequarters*/
N(12,504), /*questiondown*/
N(6,12), /*Agrave*/
@@ -1462,52 +1474,52 @@ N(6,120), /*Iacute*/
N(11,88), /*Icircumflex*/
N(9,18), /*Idieresis*/
N(3,6), /*Eth*/
-N(6,204), /*Ntilde*/
-N(6,216), /*Ograve*/
-N(6,210), /*Oacute*/
+N(6,210), /*Ntilde*/
+N(6,222), /*Ograve*/
+N(6,216), /*Oacute*/
N(11,154), /*Ocircumflex*/
-N(6,234), /*Otilde*/
+N(6,240), /*Otilde*/
N(9,27), /*Odieresis*/
-N(8,136), /*multiply*/
-N(6,222), /*Oslash*/
-N(6,306), /*Ugrave*/
-N(6,300), /*Uacute*/
+N(8,144), /*multiply*/
+N(6,228), /*Oslash*/
+N(6,312), /*Ugrave*/
+N(6,306), /*Uacute*/
N(11,231), /*Ucircumflex*/
N(9,45), /*Udieresis*/
-N(6,336), /*Yacute*/
-N(5,45), /*Thorn*/
+N(6,342), /*Yacute*/
+N(5,60), /*Thorn*/
N(10,200), /*germandbls*/
-N(6,378), /*agrave*/
-N(6,366), /*aacute*/
+N(6,384), /*agrave*/
+N(6,372), /*aacute*/
N(11,275), /*acircumflex*/
-N(6,384), /*atilde*/
+N(6,390), /*atilde*/
N(9,63), /*adieresis*/
-N(5,75), /*aring*/
+N(5,90), /*aring*/
N(2,32), /*ae*/
-N(8,56), /*ccedilla*/
-N(6,456), /*egrave*/
-N(6,444), /*eacute*/
+N(8,64), /*ccedilla*/
+N(6,462), /*egrave*/
+N(6,450), /*eacute*/
N(11,363), /*ecircumflex*/
N(9,216), /*edieresis*/
-N(6,504), /*igrave*/
-N(6,498), /*iacute*/
+N(6,510), /*igrave*/
+N(6,504), /*iacute*/
N(11,418), /*icircumflex*/
N(9,234), /*idieresis*/
N(3,264), /*eth*/
-N(6,558), /*ntilde*/
-N(6,576), /*ograve*/
-N(6,564), /*oacute*/
+N(6,564), /*ntilde*/
+N(6,582), /*ograve*/
+N(6,570), /*oacute*/
N(11,429), /*ocircumflex*/
-N(6,594), /*otilde*/
+N(6,600), /*otilde*/
N(9,315), /*odieresis*/
-N(6,432), /*divide*/
-N(6,588), /*oslash*/
-N(6,666), /*ugrave*/
-N(6,660), /*uacute*/
+N(6,438), /*divide*/
+N(6,594), /*oslash*/
+N(6,672), /*ugrave*/
+N(6,666), /*uacute*/
N(11,616), /*ucircumflex*/
N(9,477), /*udieresis*/
-N(6,672), /*yacute*/
-N(5,180), /*thorn*/
+N(6,678), /*yacute*/
+N(5,195), /*thorn*/
N(9,495), /*ydieresis*/
0};
static const ushort gs_c_known_encoding_reverse_1[] = {
@@ -1572,150 +1584,150 @@ static const ushort gs_c_known_encoding_reverse_1[] = {
114, /* N(1,43): r*/
115, /* N(1,44): s*/
116, /* N(1,45): t*/
-222, /* N(5,45): Thorn*/
220, /* N(9,45): Udieresis*/
117, /* N(1,46): u*/
118, /* N(1,47): v*/
119, /* N(1,48): w*/
-42, /* N(8,48): asterisk*/
120, /* N(1,49): x*/
121, /* N(1,50): y*/
122, /* N(1,51): z*/
-146, /* N(5,55): acute*/
-180, /* N(5,55): acute*/
202, /* N(11,55): Ecircumflex*/
-231, /* N(8,56): ccedilla*/
+42, /* N(8,56): asterisk*/
+222, /* N(5,60): Thorn*/
228, /* N(9,63): adieresis*/
-164, /* N(8,64): currency*/
+231, /* N(8,64): ccedilla*/
+146, /* N(5,70): acute*/
+180, /* N(5,70): acute*/
201, /* N(6,72): Eacute*/
-168, /* N(8,72): dieresis*/
-152, /* N(8,72): dieresis*/
+164, /* N(8,72): currency*/
38, /* N(9,72): ampersand*/
-229, /* N(5,75): aring*/
-150, /* N(5,80): breve*/
-144, /* N(8,80): dotlessi*/
+168, /* N(8,80): dieresis*/
+152, /* N(8,80): dieresis*/
200, /* N(6,84): Egrave*/
-159, /* N(5,85): caron*/
+144, /* N(8,88): dotlessi*/
206, /* N(11,88): Icircumflex*/
-58, /* N(5,90): colon*/
-44, /* N(5,95): comma*/
-56, /* N(5,105): eight*/
-61, /* N(5,110): equal*/
+229, /* N(5,90): aring*/
+150, /* N(5,95): breve*/
+159, /* N(5,100): caron*/
+58, /* N(5,105): colon*/
+44, /* N(5,110): comma*/
+56, /* N(5,120): eight*/
205, /* N(6,120): Iacute*/
-145, /* N(5,125): grave*/
+61, /* N(5,125): equal*/
204, /* N(6,126): Igrave*/
126, /* N(10,130): asciitilde*/
-184, /* N(7,133): cedilla*/
-155, /* N(7,133): cedilla*/
92, /* N(9,135): backslash*/
-215, /* N(8,136): multiply*/
-45, /* N(5,140): minus*/
+145, /* N(5,140): grave*/
125, /* N(10,140): braceright*/
+215, /* N(8,144): multiply*/
123, /* N(9,144): braceleft*/
-55, /* N(5,150): seven*/
166, /* N(9,153): brokenbar*/
212, /* N(11,154): Ocircumflex*/
-47, /* N(5,160): slash*/
-63, /* N(8,160): question*/
+45, /* N(5,155): minus*/
147, /* N(10,160): circumflex*/
-160, /* N(5,165): space*/
-32, /* N(5,165): space*/
-34, /* N(8,168): quotedbl*/
-254, /* N(5,180): thorn*/
+55, /* N(5,165): seven*/
+155, /* N(7,168): cedilla*/
+184, /* N(7,168): cedilla*/
+63, /* N(8,168): question*/
+47, /* N(5,175): slash*/
+34, /* N(8,176): quotedbl*/
+160, /* N(5,180): space*/
+32, /* N(5,180): space*/
169, /* N(9,180): copyright*/
161, /* N(10,180): exclamdown*/
-163, /* N(8,184): sterling*/
-51, /* N(5,185): three*/
-62, /* N(7,189): greater*/
-148, /* N(5,190): tilde*/
+163, /* N(8,192): sterling*/
93, /* N(12,192): bracketright*/
+254, /* N(5,195): thorn*/
151, /* N(9,198): dotaccent*/
+51, /* N(5,200): three*/
223, /* N(10,200): germandbls*/
-209, /* N(6,204): Ntilde*/
+148, /* N(5,205): tilde*/
171, /* N(13,208): guillemotleft*/
-211, /* N(6,210): Oacute*/
-210, /* N(6,216): Ograve*/
+209, /* N(6,210): Ntilde*/
+211, /* N(6,216): Oacute*/
235, /* N(9,216): edieresis*/
-216, /* N(6,222): Oslash*/
+210, /* N(6,222): Ograve*/
+62, /* N(7,224): greater*/
+216, /* N(6,228): Oslash*/
219, /* N(11,231): Ucircumflex*/
-213, /* N(6,234): Otilde*/
239, /* N(9,234): idieresis*/
-189, /* N(7,238): onehalf*/
187, /* N(14,238): guillemotright*/
-37, /* N(7,245): percent*/
+213, /* N(6,240): Otilde*/
172, /* N(10,250): logicalnot*/
124, /* N(3,255): bar*/
240, /* N(3,264): eth*/
-167, /* N(7,266): section*/
35, /* N(10,270): numbersign*/
+189, /* N(7,273): onehalf*/
226, /* N(11,275): acircumflex*/
49, /* N(3,276): one*/
+37, /* N(7,280): percent*/
188, /* N(10,280): onequarter*/
54, /* N(3,288): six*/
41, /* N(10,290): parenright*/
50, /* N(3,294): two*/
165, /* N(3,297): yen*/
-218, /* N(6,300): Uacute*/
39, /* N(10,300): quoteright*/
-217, /* N(6,306): Ugrave*/
+167, /* N(7,301): section*/
+218, /* N(6,306): Uacute*/
94, /* N(11,308): asciicircum*/
183, /* N(14,308): periodcentered*/
174, /* N(10,310): registered*/
+217, /* N(6,312): Ugrave*/
246, /* N(9,315): odieresis*/
95, /* N(10,320): underscore*/
-221, /* N(6,336): Yacute*/
157, /* N(12,336): hungarumlaut*/
91, /* N(11,341): bracketleft*/
+221, /* N(6,342): Yacute*/
182, /* N(9,360): paragraph*/
234, /* N(11,363): ecircumflex*/
190, /* N(13,364): threequarters*/
-225, /* N(6,366): aacute*/
40, /* N(9,369): parenleft*/
+225, /* N(6,372): aacute*/
179, /* N(13,377): threesuperior*/
-224, /* N(6,378): agrave*/
177, /* N(9,378): plusminus*/
-227, /* N(6,384): atilde*/
+224, /* N(6,384): agrave*/
96, /* N(9,387): quoteleft*/
+227, /* N(6,390): atilde*/
59, /* N(9,414): semicolon*/
238, /* N(11,418): icircumflex*/
-162, /* N(4,424): cent*/
-176, /* N(6,426): degree*/
244, /* N(11,429): ocircumflex*/
-53, /* N(4,432): five*/
-247, /* N(6,432): divide*/
+162, /* N(4,432): cent*/
+176, /* N(6,432): degree*/
186, /* N(12,432): ordmasculine*/
-52, /* N(4,436): four*/
-36, /* N(6,438): dollar*/
-60, /* N(4,444): less*/
-233, /* N(6,444): eacute*/
-57, /* N(4,448): nine*/
-43, /* N(4,456): plus*/
-232, /* N(6,456): egrave*/
-154, /* N(4,460): ring*/
+247, /* N(6,438): divide*/
+53, /* N(4,440): five*/
+52, /* N(4,444): four*/
+36, /* N(6,444): dollar*/
+233, /* N(6,450): eacute*/
+60, /* N(4,452): less*/
+57, /* N(4,456): nine*/
+232, /* N(6,462): egrave*/
185, /* N(11,462): onesuperior*/
-48, /* N(4,464): zero*/
+43, /* N(4,464): plus*/
+154, /* N(4,468): ring*/
+48, /* N(4,472): zero*/
170, /* N(11,473): ordfeminine*/
-33, /* N(6,474): exclam*/
252, /* N(9,477): udieresis*/
-173, /* N(6,492): hyphen*/
+33, /* N(6,480): exclam*/
255, /* N(9,495): ydieresis*/
-237, /* N(6,498): iacute*/
-236, /* N(6,504): igrave*/
+173, /* N(6,498): hyphen*/
+237, /* N(6,504): iacute*/
191, /* N(12,504): questiondown*/
-175, /* N(6,534): macron*/
-149, /* N(6,534): macron*/
-241, /* N(6,558): ntilde*/
-243, /* N(6,564): oacute*/
-158, /* N(6,570): ogonek*/
-242, /* N(6,576): ograve*/
-248, /* N(6,588): oslash*/
-245, /* N(6,594): otilde*/
-46, /* N(6,600): period*/
+236, /* N(6,510): igrave*/
+175, /* N(6,540): macron*/
+149, /* N(6,540): macron*/
+241, /* N(6,564): ntilde*/
+243, /* N(6,570): oacute*/
+158, /* N(6,576): ogonek*/
+242, /* N(6,582): ograve*/
+248, /* N(6,594): oslash*/
+245, /* N(6,600): otilde*/
178, /* N(11,605): twosuperior*/
+46, /* N(6,606): period*/
251, /* N(11,616): ucircumflex*/
-250, /* N(6,660): uacute*/
-249, /* N(6,666): ugrave*/
-253, /* N(6,672): yacute*/
+250, /* N(6,666): uacute*/
+249, /* N(6,672): ugrave*/
+253, /* N(6,678): yacute*/
0};
/* SymbolEncoding */
@@ -1752,101 +1764,101 @@ N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
-N(5,165), /*space*/
-N(6,474), /*exclam*/
+N(5,180), /*space*/
+N(6,480), /*exclam*/
N(9,486), /*universal*/
N(10,270), /*numbersign*/
N(11,396), /*existential*/
-N(7,245), /*percent*/
+N(7,280), /*percent*/
N(9,72), /*ampersand*/
-N(8,192), /*suchthat*/
+N(8,200), /*suchthat*/
N(9,369), /*parenleft*/
N(10,290), /*parenright*/
N(12,144), /*asteriskmath*/
-N(4,456), /*plus*/
-N(5,95), /*comma*/
-N(5,140), /*minus*/
-N(6,600), /*period*/
-N(5,160), /*slash*/
-N(4,464), /*zero*/
+N(4,464), /*plus*/
+N(5,110), /*comma*/
+N(5,155), /*minus*/
+N(6,606), /*period*/
+N(5,175), /*slash*/
+N(4,472), /*zero*/
N(3,276), /*one*/
N(3,294), /*two*/
-N(5,185), /*three*/
-N(4,436), /*four*/
-N(4,432), /*five*/
+N(5,200), /*three*/
+N(4,444), /*four*/
+N(4,440), /*five*/
N(3,288), /*six*/
-N(5,150), /*seven*/
-N(5,105), /*eight*/
-N(4,448), /*nine*/
-N(5,90), /*colon*/
+N(5,165), /*seven*/
+N(5,120), /*eight*/
+N(4,456), /*nine*/
+N(5,105), /*colon*/
N(9,414), /*semicolon*/
-N(4,444), /*less*/
-N(5,110), /*equal*/
-N(7,189), /*greater*/
-N(8,160), /*question*/
+N(4,452), /*less*/
+N(5,125), /*equal*/
+N(7,224), /*greater*/
+N(8,168), /*question*/
N(9,171), /*congruent*/
N(5,5), /*Alpha*/
N(4,0), /*Beta*/
N(3,0), /*Chi*/
-N(5,15), /*Delta*/
-N(7,42), /*Epsilon*/
+N(5,20), /*Delta*/
+N(7,70), /*Epsilon*/
N(3,12), /*Phi*/
-N(5,20), /*Gamma*/
+N(5,25), /*Gamma*/
N(3,3), /*Eta*/
-N(4,8), /*Iota*/
-N(6,654), /*theta1*/
-N(5,25), /*Kappa*/
+N(4,16), /*Iota*/
+N(6,660), /*theta1*/
+N(5,30), /*Kappa*/
N(6,156), /*Lambda*/
N(2,4), /*Mu*/
N(2,6), /*Nu*/
-N(7,77), /*Omicron*/
+N(7,105), /*Omicron*/
N(2,10), /*Pi*/
-N(5,40), /*Theta*/
+N(5,55), /*Theta*/
N(3,18), /*Rho*/
-N(5,35), /*Sigma*/
+N(5,50), /*Sigma*/
N(3,21), /*Tau*/
-N(7,98), /*Upsilon*/
-N(6,642), /*sigma1*/
-N(5,30), /*Omega*/
+N(7,133), /*Upsilon*/
+N(6,648), /*sigma1*/
+N(5,40), /*Omega*/
N(2,12), /*Xi*/
N(3,15), /*Psi*/
-N(4,12), /*Zeta*/
+N(4,20), /*Zeta*/
N(11,341), /*bracketleft*/
N(9,441), /*therefore*/
N(12,192), /*bracketright*/
N(13,247), /*perpendicular*/
N(10,320), /*underscore*/
N(9,396), /*radicalex*/
-N(5,65), /*alpha*/
-N(4,420), /*beta*/
+N(5,80), /*alpha*/
+N(4,428), /*beta*/
N(3,258), /*chi*/
-N(5,100), /*delta*/
-N(7,182), /*epsilon*/
+N(5,115), /*delta*/
+N(7,217), /*epsilon*/
N(3,279), /*phi*/
-N(5,120), /*gamma*/
+N(5,135), /*gamma*/
N(3,261), /*eta*/
-N(4,440), /*iota*/
-N(4,452), /*phi1*/
-N(5,135), /*kappa*/
-N(6,516), /*lambda*/
+N(4,448), /*iota*/
+N(4,460), /*phi1*/
+N(5,150), /*kappa*/
+N(6,522), /*lambda*/
N(2,42), /*mu*/
N(2,44), /*nu*/
-N(7,231), /*omicron*/
+N(7,266), /*omicron*/
N(2,48), /*pi*/
-N(5,175), /*theta*/
+N(5,190), /*theta*/
N(3,285), /*rho*/
-N(5,155), /*sigma*/
+N(5,170), /*sigma*/
N(3,291), /*tau*/
-N(7,294), /*upsilon*/
-N(6,582), /*omega1*/
-N(5,145), /*omega*/
+N(7,329), /*upsilon*/
+N(6,588), /*omega1*/
+N(5,160), /*omega*/
N(2,50), /*xi*/
N(3,282), /*psi*/
-N(4,468), /*zeta*/
+N(4,476), /*zeta*/
N(9,144), /*braceleft*/
N(3,255), /*bar*/
N(10,140), /*braceright*/
-N(7,273), /*similar*/
+N(7,308), /*similar*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
@@ -1880,62 +1892,62 @@ N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
-N(4,4), /*Euro*/
-N(8,40), /*Upsilon1*/
-N(6,540), /*minute*/
+N(4,12), /*Euro*/
+N(8,48), /*Upsilon1*/
+N(6,546), /*minute*/
N(9,261), /*lessequal*/
-N(8,104), /*fraction*/
-N(8,120), /*infinity*/
-N(6,480), /*florin*/
-N(4,428), /*club*/
-N(7,140), /*diamond*/
-N(5,130), /*heart*/
-N(5,170), /*spade*/
+N(8,112), /*fraction*/
+N(8,128), /*infinity*/
+N(6,486), /*florin*/
+N(4,436), /*club*/
+N(7,175), /*diamond*/
+N(5,145), /*heart*/
+N(5,185), /*spade*/
N(9,99), /*arrowboth*/
N(9,117), /*arrowleft*/
-N(7,119), /*arrowup*/
+N(7,154), /*arrowup*/
N(10,120), /*arrowright*/
N(9,108), /*arrowdown*/
-N(6,426), /*degree*/
+N(6,432), /*degree*/
N(9,378), /*plusminus*/
-N(6,636), /*second*/
+N(6,642), /*second*/
N(12,324), /*greaterequal*/
-N(8,136), /*multiply*/
+N(8,144), /*multiply*/
N(12,492), /*proportional*/
N(11,517), /*partialdiff*/
-N(6,390), /*bullet*/
-N(6,432), /*divide*/
-N(8,144), /*notequal*/
+N(6,396), /*bullet*/
+N(6,438), /*divide*/
+N(8,152), /*notequal*/
N(11,374), /*equivalence*/
N(11,286), /*approxequal*/
-N(8,88), /*ellipsis*/
+N(8,96), /*ellipsis*/
N(11,297), /*arrowvertex*/
N(12,132), /*arrowhorizex*/
N(14,154), /*carriagereturn*/
-N(5,60), /*aleph*/
+N(5,75), /*aleph*/
N(8,16), /*Ifraktur*/
N(8,24), /*Rfraktur*/
N(11,627), /*weierstrass*/
N(14,168), /*circlemultiply*/
N(10,150), /*circleplus*/
-N(8,96), /*emptyset*/
+N(8,104), /*emptyset*/
N(12,348), /*intersection*/
-N(5,195), /*union*/
+N(5,210), /*union*/
N(14,350), /*propersuperset*/
N(14,378), /*reflexsuperset*/
N(9,297), /*notsubset*/
N(12,480), /*propersubset*/
N(12,552), /*reflexsubset*/
-N(7,161), /*element*/
+N(7,196), /*element*/
N(10,260), /*notelement*/
-N(5,70), /*angle*/
-N(8,112), /*gradient*/
+N(5,85), /*angle*/
+N(8,120), /*gradient*/
N(13,286), /*registerserif*/
N(14,182), /*copyrightserif*/
N(14,392), /*trademarkserif*/
-N(7,252), /*product*/
-N(7,259), /*radical*/
-N(7,154), /*dotmath*/
+N(7,287), /*product*/
+N(7,294), /*radical*/
+N(7,189), /*dotmath*/
N(10,250), /*logicalnot*/
N(10,240), /*logicaland*/
N(9,270), /*logicalor*/
@@ -1944,7 +1956,7 @@ N(12,120), /*arrowdblleft*/
N(10,110), /*arrowdblup*/
N(13,52), /*arrowdblright*/
N(12,108), /*arrowdbldown*/
-N(7,210), /*lozenge*/
+N(7,245), /*lozenge*/
N(9,81), /*angleleft*/
N(12,564), /*registersans*/
N(13,156), /*copyrightsans*/
@@ -1959,10 +1971,10 @@ N(13,78), /*bracketleftbt*/
N(11,330), /*bracelefttp*/
N(12,156), /*braceleftmid*/
N(11,319), /*braceleftbt*/
-N(7,126), /*braceex*/
+N(7,161), /*braceex*/
N(7,0), /*.notdef*/
N(10,100), /*angleright*/
-N(8,128), /*integral*/
+N(8,136), /*integral*/
N(10,230), /*integraltp*/
N(10,220), /*integralex*/
N(10,210), /*integralbt*/
@@ -1982,140 +1994,140 @@ static const ushort gs_c_known_encoding_reverse_2[] = {
66, /* N(4,0): Beta*/
72, /* N(3,3): Eta*/
77, /* N(2,4): Mu*/
-160, /* N(4,4): Euro*/
65, /* N(5,5): Alpha*/
78, /* N(2,6): Nu*/
-73, /* N(4,8): Iota*/
80, /* N(2,10): Pi*/
88, /* N(2,12): Xi*/
70, /* N(3,12): Phi*/
-90, /* N(4,12): Zeta*/
+160, /* N(4,12): Euro*/
89, /* N(3,15): Psi*/
-68, /* N(5,15): Delta*/
+73, /* N(4,16): Iota*/
193, /* N(8,16): Ifraktur*/
82, /* N(3,18): Rho*/
-71, /* N(5,20): Gamma*/
+90, /* N(4,20): Zeta*/
+68, /* N(5,20): Delta*/
84, /* N(3,21): Tau*/
194, /* N(8,24): Rfraktur*/
-75, /* N(5,25): Kappa*/
-87, /* N(5,30): Omega*/
-83, /* N(5,35): Sigma*/
-81, /* N(5,40): Theta*/
-161, /* N(8,40): Upsilon1*/
+71, /* N(5,25): Gamma*/
+75, /* N(5,30): Kappa*/
+87, /* N(5,40): Omega*/
109, /* N(2,42): mu*/
-69, /* N(7,42): Epsilon*/
110, /* N(2,44): nu*/
112, /* N(2,48): pi*/
+161, /* N(8,48): Upsilon1*/
120, /* N(2,50): xi*/
+83, /* N(5,50): Sigma*/
222, /* N(13,52): arrowdblright*/
-192, /* N(5,60): aleph*/
-97, /* N(5,65): alpha*/
+81, /* N(5,55): Theta*/
253, /* N(13,65): bracerightmid*/
-208, /* N(5,70): angle*/
+69, /* N(7,70): Epsilon*/
38, /* N(9,72): ampersand*/
-79, /* N(7,77): Omicron*/
+192, /* N(5,75): aleph*/
235, /* N(13,78): bracketleftbt*/
+97, /* N(5,80): alpha*/
225, /* N(9,81): angleleft*/
-188, /* N(8,88): ellipsis*/
-58, /* N(5,90): colon*/
+208, /* N(5,85): angle*/
234, /* N(13,91): bracketleftex*/
-44, /* N(5,95): comma*/
-198, /* N(8,96): emptyset*/
+188, /* N(8,96): ellipsis*/
219, /* N(12,96): arrowdblboth*/
-85, /* N(7,98): Upsilon*/
171, /* N(9,99): arrowboth*/
-100, /* N(5,100): delta*/
241, /* N(10,100): angleright*/
-164, /* N(8,104): fraction*/
+198, /* N(8,104): emptyset*/
233, /* N(13,104): bracketlefttp*/
-56, /* N(5,105): eight*/
+58, /* N(5,105): colon*/
+79, /* N(7,105): Omicron*/
175, /* N(9,108): arrowdown*/
223, /* N(12,108): arrowdbldown*/
-61, /* N(5,110): equal*/
+44, /* N(5,110): comma*/
221, /* N(10,110): arrowdblup*/
-209, /* N(8,112): gradient*/
+164, /* N(8,112): fraction*/
251, /* N(14,112): bracketrightbt*/
+100, /* N(5,115): delta*/
172, /* N(9,117): arrowleft*/
-173, /* N(7,119): arrowup*/
-103, /* N(5,120): gamma*/
-165, /* N(8,120): infinity*/
+56, /* N(5,120): eight*/
+209, /* N(8,120): gradient*/
174, /* N(10,120): arrowright*/
220, /* N(12,120): arrowdblleft*/
-239, /* N(7,126): braceex*/
+61, /* N(5,125): equal*/
250, /* N(14,126): bracketrightex*/
-242, /* N(8,128): integral*/
-169, /* N(5,130): heart*/
+165, /* N(8,128): infinity*/
190, /* N(12,132): arrowhorizex*/
-107, /* N(5,135): kappa*/
-180, /* N(8,136): multiply*/
-45, /* N(5,140): minus*/
-168, /* N(7,140): diamond*/
+85, /* N(7,133): Upsilon*/
+103, /* N(5,135): gamma*/
+242, /* N(8,136): integral*/
125, /* N(10,140): braceright*/
249, /* N(14,140): bracketrighttp*/
-185, /* N(8,144): notequal*/
+180, /* N(8,144): multiply*/
123, /* N(9,144): braceleft*/
42, /* N(12,144): asteriskmath*/
-119, /* N(5,145): omega*/
-55, /* N(5,150): seven*/
+169, /* N(5,145): heart*/
+107, /* N(5,150): kappa*/
197, /* N(10,150): circleplus*/
-215, /* N(7,154): dotmath*/
+185, /* N(8,152): notequal*/
+173, /* N(7,154): arrowup*/
191, /* N(14,154): carriagereturn*/
-115, /* N(5,155): sigma*/
+45, /* N(5,155): minus*/
76, /* N(6,156): Lambda*/
237, /* N(12,156): braceleftmid*/
227, /* N(13,156): copyrightsans*/
-47, /* N(5,160): slash*/
-63, /* N(8,160): question*/
-206, /* N(7,161): element*/
-32, /* N(5,165): space*/
+119, /* N(5,160): omega*/
+239, /* N(7,161): braceex*/
+55, /* N(5,165): seven*/
+63, /* N(8,168): question*/
254, /* N(12,168): bracerightbt*/
196, /* N(14,168): circlemultiply*/
-170, /* N(5,170): spade*/
+115, /* N(5,170): sigma*/
64, /* N(9,171): congruent*/
-113, /* N(5,175): theta*/
+47, /* N(5,175): slash*/
+168, /* N(7,175): diamond*/
+32, /* N(5,180): space*/
252, /* N(12,180): bracerighttp*/
-101, /* N(7,182): epsilon*/
211, /* N(14,182): copyrightserif*/
-51, /* N(5,185): three*/
-62, /* N(7,189): greater*/
-39, /* N(8,192): suchthat*/
+170, /* N(5,185): spade*/
+215, /* N(7,189): dotmath*/
+113, /* N(5,190): theta*/
93, /* N(12,192): bracketright*/
-200, /* N(5,195): union*/
-224, /* N(7,210): lozenge*/
+206, /* N(7,196): element*/
+51, /* N(5,200): three*/
+39, /* N(8,200): suchthat*/
+200, /* N(5,210): union*/
245, /* N(10,210): integralbt*/
+101, /* N(7,217): epsilon*/
244, /* N(10,220): integralex*/
+62, /* N(7,224): greater*/
243, /* N(10,230): integraltp*/
-111, /* N(7,231): omicron*/
217, /* N(10,240): logicaland*/
-37, /* N(7,245): percent*/
+224, /* N(7,245): lozenge*/
94, /* N(13,247): perpendicular*/
216, /* N(10,250): logicalnot*/
-213, /* N(7,252): product*/
124, /* N(3,255): bar*/
99, /* N(3,258): chi*/
-214, /* N(7,259): radical*/
207, /* N(10,260): notelement*/
104, /* N(3,261): eta*/
163, /* N(9,261): lessequal*/
+111, /* N(7,266): omicron*/
218, /* N(9,270): logicalor*/
35, /* N(10,270): numbersign*/
-126, /* N(7,273): similar*/
49, /* N(3,276): one*/
102, /* N(3,279): phi*/
+37, /* N(7,280): percent*/
121, /* N(3,282): psi*/
114, /* N(3,285): rho*/
187, /* N(11,286): approxequal*/
210, /* N(13,286): registerserif*/
+213, /* N(7,287): product*/
54, /* N(3,288): six*/
41, /* N(10,290): parenright*/
116, /* N(3,291): tau*/
50, /* N(3,294): two*/
-117, /* N(7,294): upsilon*/
+214, /* N(7,294): radical*/
203, /* N(9,297): notsubset*/
189, /* N(11,297): arrowvertex*/
+126, /* N(7,308): similar*/
238, /* N(11,319): braceleftbt*/
95, /* N(10,320): underscore*/
179, /* N(12,324): greaterequal*/
+117, /* N(7,329): upsilon*/
236, /* N(11,330): bracelefttp*/
91, /* N(11,341): bracketleft*/
199, /* N(12,348): intersection*/
@@ -2124,49 +2136,49 @@ static const ushort gs_c_known_encoding_reverse_2[] = {
186, /* N(11,374): equivalence*/
177, /* N(9,378): plusminus*/
202, /* N(14,378): reflexsuperset*/
-183, /* N(6,390): bullet*/
228, /* N(13,390): trademarksans*/
212, /* N(14,392): trademarkserif*/
+183, /* N(6,396): bullet*/
96, /* N(9,396): radicalex*/
36, /* N(11,396): existential*/
59, /* N(9,414): semicolon*/
-98, /* N(4,420): beta*/
-176, /* N(6,426): degree*/
-167, /* N(4,428): club*/
-53, /* N(4,432): five*/
-184, /* N(6,432): divide*/
+98, /* N(4,428): beta*/
+176, /* N(6,432): degree*/
229, /* N(9,432): summation*/
-52, /* N(4,436): four*/
-105, /* N(4,440): iota*/
+167, /* N(4,436): club*/
+184, /* N(6,438): divide*/
+53, /* N(4,440): five*/
92, /* N(9,441): therefore*/
-60, /* N(4,444): less*/
+52, /* N(4,444): four*/
248, /* N(12,444): parenrightbt*/
-57, /* N(4,448): nine*/
-106, /* N(4,452): phi1*/
-43, /* N(4,456): plus*/
+105, /* N(4,448): iota*/
+60, /* N(4,452): less*/
+57, /* N(4,456): nine*/
247, /* N(12,456): parenrightex*/
-48, /* N(4,464): zero*/
-122, /* N(4,468): zeta*/
+106, /* N(4,460): phi1*/
+43, /* N(4,464): plus*/
246, /* N(12,468): parenrighttp*/
-33, /* N(6,474): exclam*/
-166, /* N(6,480): florin*/
+48, /* N(4,472): zero*/
+122, /* N(4,476): zeta*/
+33, /* N(6,480): exclam*/
204, /* N(12,480): propersubset*/
232, /* N(11,484): parenleftbt*/
+166, /* N(6,486): florin*/
34, /* N(9,486): universal*/
181, /* N(12,492): proportional*/
231, /* N(11,495): parenleftex*/
230, /* N(11,506): parenlefttp*/
-108, /* N(6,516): lambda*/
182, /* N(11,517): partialdiff*/
-162, /* N(6,540): minute*/
+108, /* N(6,522): lambda*/
+162, /* N(6,546): minute*/
205, /* N(12,552): reflexsubset*/
226, /* N(12,564): registersans*/
-118, /* N(6,582): omega1*/
-46, /* N(6,600): period*/
+118, /* N(6,588): omega1*/
+46, /* N(6,606): period*/
195, /* N(11,627): weierstrass*/
-178, /* N(6,636): second*/
-86, /* N(6,642): sigma1*/
-74, /* N(6,654): theta1*/
+178, /* N(6,642): second*/
+86, /* N(6,648): sigma1*/
+74, /* N(6,660): theta1*/
0};
/* DingbatsEncoding */
@@ -2203,23 +2215,23 @@ N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
-N(5,165), /*space*/
+N(5,180), /*space*/
N(2,14), /*a1*/
N(2,16), /*a2*/
-N(4,408), /*a202*/
+N(4,416), /*a202*/
N(2,18), /*a3*/
N(2,20), /*a4*/
N(2,22), /*a5*/
-N(4,76), /*a119*/
-N(4,72), /*a118*/
-N(4,68), /*a117*/
+N(4,84), /*a119*/
+N(4,80), /*a118*/
+N(4,76), /*a117*/
N(3,27), /*a11*/
N(3,30), /*a12*/
N(3,33), /*a13*/
N(3,36), /*a14*/
N(3,39), /*a15*/
N(3,42), /*a16*/
-N(4,36), /*a105*/
+N(4,44), /*a105*/
N(3,45), /*a17*/
N(3,48), /*a18*/
N(3,51), /*a19*/
@@ -2283,9 +2295,9 @@ N(3,207), /*a71*/
N(3,210), /*a72*/
N(3,213), /*a73*/
N(3,216), /*a74*/
-N(4,412), /*a203*/
+N(4,420), /*a203*/
N(3,219), /*a75*/
-N(4,416), /*a204*/
+N(4,424), /*a204*/
N(3,222), /*a76*/
N(3,225), /*a77*/
N(3,228), /*a78*/
@@ -2297,7 +2309,7 @@ N(3,243), /*a84*/
N(3,246), /*a97*/
N(3,249), /*a98*/
N(3,252), /*a99*/
-N(4,16), /*a100*/
+N(4,24), /*a100*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
@@ -2332,291 +2344,291 @@ N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
-N(4,20), /*a101*/
-N(4,24), /*a102*/
-N(4,28), /*a103*/
-N(4,32), /*a104*/
-N(4,40), /*a106*/
-N(4,44), /*a107*/
-N(4,48), /*a108*/
-N(4,64), /*a112*/
-N(4,60), /*a111*/
-N(4,56), /*a110*/
-N(4,52), /*a109*/
-N(4,80), /*a120*/
-N(4,84), /*a121*/
-N(4,88), /*a122*/
-N(4,92), /*a123*/
-N(4,96), /*a124*/
-N(4,100), /*a125*/
-N(4,104), /*a126*/
-N(4,108), /*a127*/
-N(4,112), /*a128*/
-N(4,116), /*a129*/
-N(4,120), /*a130*/
-N(4,124), /*a131*/
-N(4,128), /*a132*/
-N(4,132), /*a133*/
-N(4,136), /*a134*/
-N(4,140), /*a135*/
-N(4,144), /*a136*/
-N(4,148), /*a137*/
-N(4,152), /*a138*/
-N(4,156), /*a139*/
-N(4,160), /*a140*/
-N(4,164), /*a141*/
-N(4,168), /*a142*/
-N(4,172), /*a143*/
-N(4,176), /*a144*/
-N(4,180), /*a145*/
-N(4,184), /*a146*/
-N(4,188), /*a147*/
-N(4,192), /*a148*/
-N(4,196), /*a149*/
-N(4,200), /*a150*/
-N(4,204), /*a151*/
-N(4,208), /*a152*/
-N(4,212), /*a153*/
-N(4,216), /*a154*/
-N(4,220), /*a155*/
-N(4,224), /*a156*/
-N(4,228), /*a157*/
-N(4,232), /*a158*/
-N(4,236), /*a159*/
-N(4,240), /*a160*/
-N(4,244), /*a161*/
-N(4,252), /*a163*/
-N(4,256), /*a164*/
-N(4,384), /*a196*/
-N(4,260), /*a165*/
-N(4,368), /*a192*/
-N(4,264), /*a166*/
-N(4,268), /*a167*/
-N(4,272), /*a168*/
-N(4,276), /*a169*/
-N(4,280), /*a170*/
-N(4,284), /*a171*/
-N(4,288), /*a172*/
-N(4,292), /*a173*/
-N(4,248), /*a162*/
-N(4,296), /*a174*/
-N(4,300), /*a175*/
-N(4,304), /*a176*/
-N(4,308), /*a177*/
-N(4,312), /*a178*/
-N(4,316), /*a179*/
-N(4,372), /*a193*/
-N(4,320), /*a180*/
-N(4,396), /*a199*/
-N(4,324), /*a181*/
-N(4,400), /*a200*/
-N(4,328), /*a182*/
-N(7,0), /*.notdef*/
-N(4,404), /*a201*/
-N(4,332), /*a183*/
-N(4,336), /*a184*/
-N(4,388), /*a197*/
-N(4,340), /*a185*/
-N(4,376), /*a194*/
-N(4,392), /*a198*/
-N(4,344), /*a186*/
-N(4,380), /*a195*/
-N(4,348), /*a187*/
-N(4,352), /*a188*/
-N(4,356), /*a189*/
-N(4,360), /*a190*/
-N(4,364), /*a191*/
+N(4,28), /*a101*/
+N(4,32), /*a102*/
+N(4,36), /*a103*/
+N(4,40), /*a104*/
+N(4,48), /*a106*/
+N(4,52), /*a107*/
+N(4,56), /*a108*/
+N(4,72), /*a112*/
+N(4,68), /*a111*/
+N(4,64), /*a110*/
+N(4,60), /*a109*/
+N(4,88), /*a120*/
+N(4,92), /*a121*/
+N(4,96), /*a122*/
+N(4,100), /*a123*/
+N(4,104), /*a124*/
+N(4,108), /*a125*/
+N(4,112), /*a126*/
+N(4,116), /*a127*/
+N(4,120), /*a128*/
+N(4,124), /*a129*/
+N(4,128), /*a130*/
+N(4,132), /*a131*/
+N(4,136), /*a132*/
+N(4,140), /*a133*/
+N(4,144), /*a134*/
+N(4,148), /*a135*/
+N(4,152), /*a136*/
+N(4,156), /*a137*/
+N(4,160), /*a138*/
+N(4,164), /*a139*/
+N(4,168), /*a140*/
+N(4,172), /*a141*/
+N(4,176), /*a142*/
+N(4,180), /*a143*/
+N(4,184), /*a144*/
+N(4,188), /*a145*/
+N(4,192), /*a146*/
+N(4,196), /*a147*/
+N(4,200), /*a148*/
+N(4,204), /*a149*/
+N(4,208), /*a150*/
+N(4,212), /*a151*/
+N(4,216), /*a152*/
+N(4,220), /*a153*/
+N(4,224), /*a154*/
+N(4,228), /*a155*/
+N(4,232), /*a156*/
+N(4,236), /*a157*/
+N(4,240), /*a158*/
+N(4,244), /*a159*/
+N(4,248), /*a160*/
+N(4,252), /*a161*/
+N(4,260), /*a163*/
+N(4,264), /*a164*/
+N(4,392), /*a196*/
+N(4,268), /*a165*/
+N(4,376), /*a192*/
+N(4,272), /*a166*/
+N(4,276), /*a167*/
+N(4,280), /*a168*/
+N(4,284), /*a169*/
+N(4,288), /*a170*/
+N(4,292), /*a171*/
+N(4,296), /*a172*/
+N(4,300), /*a173*/
+N(4,256), /*a162*/
+N(4,304), /*a174*/
+N(4,308), /*a175*/
+N(4,312), /*a176*/
+N(4,316), /*a177*/
+N(4,320), /*a178*/
+N(4,324), /*a179*/
+N(4,380), /*a193*/
+N(4,328), /*a180*/
+N(4,404), /*a199*/
+N(4,332), /*a181*/
+N(4,408), /*a200*/
+N(4,336), /*a182*/
+N(7,0), /*.notdef*/
+N(4,412), /*a201*/
+N(4,340), /*a183*/
+N(4,344), /*a184*/
+N(4,396), /*a197*/
+N(4,348), /*a185*/
+N(4,384), /*a194*/
+N(4,400), /*a198*/
+N(4,352), /*a186*/
+N(4,388), /*a195*/
+N(4,356), /*a187*/
+N(4,360), /*a188*/
+N(4,364), /*a189*/
+N(4,368), /*a190*/
+N(4,372), /*a191*/
N(7,0), /*.notdef*/
0};
static const ushort gs_c_known_encoding_reverse_3[] = {
33, /* N(2,14): a1*/
34, /* N(2,16): a2*/
-126, /* N(4,16): a100*/
36, /* N(2,18): a3*/
37, /* N(2,20): a4*/
-161, /* N(4,20): a101*/
38, /* N(2,22): a5*/
61, /* N(2,24): a6*/
65, /* N(3,24): a10*/
-162, /* N(4,24): a102*/
+126, /* N(4,24): a100*/
62, /* N(2,26): a7*/
42, /* N(3,27): a11*/
63, /* N(2,28): a8*/
-163, /* N(4,28): a103*/
+161, /* N(4,28): a101*/
64, /* N(2,30): a9*/
43, /* N(3,30): a12*/
-164, /* N(4,32): a104*/
+162, /* N(4,32): a102*/
44, /* N(3,33): a13*/
45, /* N(3,36): a14*/
-48, /* N(4,36): a105*/
+163, /* N(4,36): a103*/
46, /* N(3,39): a15*/
-165, /* N(4,40): a106*/
+164, /* N(4,40): a104*/
47, /* N(3,42): a16*/
-166, /* N(4,44): a107*/
+48, /* N(4,44): a105*/
49, /* N(3,45): a17*/
50, /* N(3,48): a18*/
-167, /* N(4,48): a108*/
+165, /* N(4,48): a106*/
51, /* N(3,51): a19*/
-171, /* N(4,52): a109*/
+166, /* N(4,52): a107*/
52, /* N(3,54): a20*/
-170, /* N(4,56): a110*/
+167, /* N(4,56): a108*/
53, /* N(3,57): a21*/
54, /* N(3,60): a22*/
-169, /* N(4,60): a111*/
+171, /* N(4,60): a109*/
55, /* N(3,63): a23*/
-168, /* N(4,64): a112*/
+170, /* N(4,64): a110*/
56, /* N(3,66): a24*/
-41, /* N(4,68): a117*/
+169, /* N(4,68): a111*/
57, /* N(3,69): a25*/
58, /* N(3,72): a26*/
-40, /* N(4,72): a118*/
+168, /* N(4,72): a112*/
59, /* N(3,75): a27*/
-39, /* N(4,76): a119*/
+41, /* N(4,76): a117*/
60, /* N(3,78): a28*/
-172, /* N(4,80): a120*/
+40, /* N(4,80): a118*/
66, /* N(3,81): a29*/
67, /* N(3,84): a30*/
-173, /* N(4,84): a121*/
+39, /* N(4,84): a119*/
68, /* N(3,87): a31*/
-174, /* N(4,88): a122*/
+172, /* N(4,88): a120*/
69, /* N(3,90): a32*/
-175, /* N(4,92): a123*/
+173, /* N(4,92): a121*/
70, /* N(3,93): a33*/
71, /* N(3,96): a34*/
-176, /* N(4,96): a124*/
+174, /* N(4,96): a122*/
72, /* N(3,99): a35*/
-177, /* N(4,100): a125*/
+175, /* N(4,100): a123*/
73, /* N(3,102): a36*/
-178, /* N(4,104): a126*/
+176, /* N(4,104): a124*/
74, /* N(3,105): a37*/
75, /* N(3,108): a38*/
-179, /* N(4,108): a127*/
+177, /* N(4,108): a125*/
76, /* N(3,111): a39*/
-180, /* N(4,112): a128*/
+178, /* N(4,112): a126*/
77, /* N(3,114): a40*/
-181, /* N(4,116): a129*/
+179, /* N(4,116): a127*/
78, /* N(3,117): a41*/
79, /* N(3,120): a42*/
-182, /* N(4,120): a130*/
+180, /* N(4,120): a128*/
80, /* N(3,123): a43*/
-183, /* N(4,124): a131*/
+181, /* N(4,124): a129*/
81, /* N(3,126): a44*/
-184, /* N(4,128): a132*/
+182, /* N(4,128): a130*/
82, /* N(3,129): a45*/
83, /* N(3,132): a46*/
-185, /* N(4,132): a133*/
+183, /* N(4,132): a131*/
84, /* N(3,135): a47*/
-186, /* N(4,136): a134*/
+184, /* N(4,136): a132*/
85, /* N(3,138): a48*/
-187, /* N(4,140): a135*/
+185, /* N(4,140): a133*/
86, /* N(3,141): a49*/
87, /* N(3,144): a50*/
-188, /* N(4,144): a136*/
+186, /* N(4,144): a134*/
88, /* N(3,147): a51*/
-189, /* N(4,148): a137*/
+187, /* N(4,148): a135*/
89, /* N(3,150): a52*/
-190, /* N(4,152): a138*/
+188, /* N(4,152): a136*/
90, /* N(3,153): a53*/
91, /* N(3,156): a54*/
-191, /* N(4,156): a139*/
+189, /* N(4,156): a137*/
92, /* N(3,159): a55*/
-192, /* N(4,160): a140*/
+190, /* N(4,160): a138*/
93, /* N(3,162): a56*/
-193, /* N(4,164): a141*/
+191, /* N(4,164): a139*/
94, /* N(3,165): a57*/
-32, /* N(5,165): space*/
95, /* N(3,168): a58*/
-194, /* N(4,168): a142*/
+192, /* N(4,168): a140*/
96, /* N(3,171): a59*/
-195, /* N(4,172): a143*/
+193, /* N(4,172): a141*/
97, /* N(3,174): a60*/
-196, /* N(4,176): a144*/
+194, /* N(4,176): a142*/
98, /* N(3,177): a61*/
99, /* N(3,180): a62*/
-197, /* N(4,180): a145*/
+195, /* N(4,180): a143*/
+32, /* N(5,180): space*/
100, /* N(3,183): a63*/
-198, /* N(4,184): a146*/
+196, /* N(4,184): a144*/
101, /* N(3,186): a64*/
-199, /* N(4,188): a147*/
+197, /* N(4,188): a145*/
102, /* N(3,189): a65*/
103, /* N(3,192): a66*/
-200, /* N(4,192): a148*/
+198, /* N(4,192): a146*/
104, /* N(3,195): a67*/
-201, /* N(4,196): a149*/
+199, /* N(4,196): a147*/
105, /* N(3,198): a68*/
-202, /* N(4,200): a150*/
+200, /* N(4,200): a148*/
106, /* N(3,201): a69*/
107, /* N(3,204): a70*/
-203, /* N(4,204): a151*/
+201, /* N(4,204): a149*/
108, /* N(3,207): a71*/
-204, /* N(4,208): a152*/
+202, /* N(4,208): a150*/
109, /* N(3,210): a72*/
-205, /* N(4,212): a153*/
+203, /* N(4,212): a151*/
110, /* N(3,213): a73*/
111, /* N(3,216): a74*/
-206, /* N(4,216): a154*/
+204, /* N(4,216): a152*/
113, /* N(3,219): a75*/
-207, /* N(4,220): a155*/
+205, /* N(4,220): a153*/
115, /* N(3,222): a76*/
-208, /* N(4,224): a156*/
+206, /* N(4,224): a154*/
116, /* N(3,225): a77*/
117, /* N(3,228): a78*/
-209, /* N(4,228): a157*/
+207, /* N(4,228): a155*/
118, /* N(3,231): a79*/
-210, /* N(4,232): a158*/
+208, /* N(4,232): a156*/
119, /* N(3,234): a81*/
-211, /* N(4,236): a159*/
+209, /* N(4,236): a157*/
120, /* N(3,237): a82*/
121, /* N(3,240): a83*/
-212, /* N(4,240): a160*/
+210, /* N(4,240): a158*/
122, /* N(3,243): a84*/
-213, /* N(4,244): a161*/
+211, /* N(4,244): a159*/
123, /* N(3,246): a97*/
-227, /* N(4,248): a162*/
+212, /* N(4,248): a160*/
124, /* N(3,249): a98*/
125, /* N(3,252): a99*/
-214, /* N(4,252): a163*/
-215, /* N(4,256): a164*/
-217, /* N(4,260): a165*/
-219, /* N(4,264): a166*/
-220, /* N(4,268): a167*/
-221, /* N(4,272): a168*/
-222, /* N(4,276): a169*/
-223, /* N(4,280): a170*/
-224, /* N(4,284): a171*/
-225, /* N(4,288): a172*/
-226, /* N(4,292): a173*/
-228, /* N(4,296): a174*/
-229, /* N(4,300): a175*/
-230, /* N(4,304): a176*/
-231, /* N(4,308): a177*/
-232, /* N(4,312): a178*/
-233, /* N(4,316): a179*/
-235, /* N(4,320): a180*/
-237, /* N(4,324): a181*/
-239, /* N(4,328): a182*/
-242, /* N(4,332): a183*/
-243, /* N(4,336): a184*/
-245, /* N(4,340): a185*/
-248, /* N(4,344): a186*/
-250, /* N(4,348): a187*/
-251, /* N(4,352): a188*/
-252, /* N(4,356): a189*/
-253, /* N(4,360): a190*/
-254, /* N(4,364): a191*/
-218, /* N(4,368): a192*/
-234, /* N(4,372): a193*/
-246, /* N(4,376): a194*/
-249, /* N(4,380): a195*/
-216, /* N(4,384): a196*/
-244, /* N(4,388): a197*/
-247, /* N(4,392): a198*/
-236, /* N(4,396): a199*/
-238, /* N(4,400): a200*/
-241, /* N(4,404): a201*/
-35, /* N(4,408): a202*/
-112, /* N(4,412): a203*/
-114, /* N(4,416): a204*/
+213, /* N(4,252): a161*/
+227, /* N(4,256): a162*/
+214, /* N(4,260): a163*/
+215, /* N(4,264): a164*/
+217, /* N(4,268): a165*/
+219, /* N(4,272): a166*/
+220, /* N(4,276): a167*/
+221, /* N(4,280): a168*/
+222, /* N(4,284): a169*/
+223, /* N(4,288): a170*/
+224, /* N(4,292): a171*/
+225, /* N(4,296): a172*/
+226, /* N(4,300): a173*/
+228, /* N(4,304): a174*/
+229, /* N(4,308): a175*/
+230, /* N(4,312): a176*/
+231, /* N(4,316): a177*/
+232, /* N(4,320): a178*/
+233, /* N(4,324): a179*/
+235, /* N(4,328): a180*/
+237, /* N(4,332): a181*/
+239, /* N(4,336): a182*/
+242, /* N(4,340): a183*/
+243, /* N(4,344): a184*/
+245, /* N(4,348): a185*/
+248, /* N(4,352): a186*/
+250, /* N(4,356): a187*/
+251, /* N(4,360): a188*/
+252, /* N(4,364): a189*/
+253, /* N(4,368): a190*/
+254, /* N(4,372): a191*/
+218, /* N(4,376): a192*/
+234, /* N(4,380): a193*/
+246, /* N(4,384): a194*/
+249, /* N(4,388): a195*/
+216, /* N(4,392): a196*/
+244, /* N(4,396): a197*/
+247, /* N(4,400): a198*/
+236, /* N(4,404): a199*/
+238, /* N(4,408): a200*/
+241, /* N(4,412): a201*/
+35, /* N(4,416): a202*/
+112, /* N(4,420): a203*/
+114, /* N(4,424): a204*/
0};
/* WinAnsiEncoding */
@@ -2653,38 +2665,38 @@ N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
-N(5,165), /*space*/
-N(6,474), /*exclam*/
-N(8,168), /*quotedbl*/
+N(5,180), /*space*/
+N(6,480), /*exclam*/
+N(8,176), /*quotedbl*/
N(10,270), /*numbersign*/
-N(6,438), /*dollar*/
-N(7,245), /*percent*/
+N(6,444), /*dollar*/
+N(7,280), /*percent*/
N(9,72), /*ampersand*/
N(11,539), /*quotesingle*/
N(9,369), /*parenleft*/
N(10,290), /*parenright*/
-N(8,48), /*asterisk*/
-N(4,456), /*plus*/
-N(5,95), /*comma*/
-N(6,492), /*hyphen*/
-N(6,600), /*period*/
-N(5,160), /*slash*/
-N(4,464), /*zero*/
+N(8,56), /*asterisk*/
+N(4,464), /*plus*/
+N(5,110), /*comma*/
+N(6,498), /*hyphen*/
+N(6,606), /*period*/
+N(5,175), /*slash*/
+N(4,472), /*zero*/
N(3,276), /*one*/
N(3,294), /*two*/
-N(5,185), /*three*/
-N(4,436), /*four*/
-N(4,432), /*five*/
+N(5,200), /*three*/
+N(4,444), /*four*/
+N(4,440), /*five*/
N(3,288), /*six*/
-N(5,150), /*seven*/
-N(5,105), /*eight*/
-N(4,448), /*nine*/
-N(5,90), /*colon*/
+N(5,165), /*seven*/
+N(5,120), /*eight*/
+N(4,456), /*nine*/
+N(5,105), /*colon*/
N(9,414), /*semicolon*/
-N(4,444), /*less*/
-N(5,110), /*equal*/
-N(7,189), /*greater*/
-N(8,160), /*question*/
+N(4,452), /*less*/
+N(5,125), /*equal*/
+N(7,224), /*greater*/
+N(8,168), /*question*/
N(2,34), /*at*/
N(1,0), /*A*/
N(1,1), /*B*/
@@ -2717,7 +2729,7 @@ N(9,135), /*backslash*/
N(12,192), /*bracketright*/
N(11,308), /*asciicircum*/
N(10,320), /*underscore*/
-N(5,125), /*grave*/
+N(5,140), /*grave*/
N(1,26), /*a*/
N(1,27), /*b*/
N(1,28), /*c*/
@@ -2748,69 +2760,69 @@ N(9,144), /*braceleft*/
N(3,255), /*bar*/
N(10,140), /*braceright*/
N(10,130), /*asciitilde*/
-N(6,390), /*bullet*/
-N(4,4), /*Euro*/
-N(6,390), /*bullet*/
+N(6,396), /*bullet*/
+N(4,12), /*Euro*/
+N(6,396), /*bullet*/
N(14,364), /*quotesinglbase*/
-N(6,480), /*florin*/
+N(6,486), /*florin*/
N(12,516), /*quotedblbase*/
-N(8,88), /*ellipsis*/
-N(6,408), /*dagger*/
+N(8,96), /*ellipsis*/
+N(6,414), /*dagger*/
N(9,189), /*daggerdbl*/
N(10,160), /*circumflex*/
N(11,528), /*perthousand*/
-N(6,276), /*Scaron*/
+N(6,282), /*Scaron*/
N(13,221), /*guilsinglleft*/
N(2,8), /*OE*/
-N(6,390), /*bullet*/
-N(6,354), /*Zcaron*/
-N(6,390), /*bullet*/
-N(6,390), /*bullet*/
+N(6,396), /*bullet*/
+N(6,360), /*Zcaron*/
+N(6,396), /*bullet*/
+N(6,396), /*bullet*/
N(9,387), /*quoteleft*/
N(10,300), /*quoteright*/
N(12,528), /*quotedblleft*/
N(13,273), /*quotedblright*/
-N(6,390), /*bullet*/
-N(6,468), /*endash*/
-N(6,462), /*emdash*/
-N(5,190), /*tilde*/
+N(6,396), /*bullet*/
+N(6,474), /*endash*/
+N(6,468), /*emdash*/
+N(5,205), /*tilde*/
N(9,450), /*trademark*/
-N(6,630), /*scaron*/
+N(6,636), /*scaron*/
N(14,252), /*guilsinglright*/
N(2,46), /*oe*/
-N(6,390), /*bullet*/
-N(6,684), /*zcaron*/
+N(6,396), /*bullet*/
+N(6,690), /*zcaron*/
N(9,54), /*Ydieresis*/
-N(5,165), /*space*/
+N(5,180), /*space*/
N(10,180), /*exclamdown*/
-N(4,424), /*cent*/
-N(8,184), /*sterling*/
-N(8,64), /*currency*/
+N(4,432), /*cent*/
+N(8,192), /*sterling*/
+N(8,72), /*currency*/
N(3,297), /*yen*/
N(9,153), /*brokenbar*/
-N(7,266), /*section*/
-N(8,72), /*dieresis*/
+N(7,301), /*section*/
+N(8,80), /*dieresis*/
N(9,180), /*copyright*/
N(11,473), /*ordfeminine*/
N(13,208), /*guillemotleft*/
N(10,250), /*logicalnot*/
-N(6,492), /*hyphen*/
+N(6,498), /*hyphen*/
N(10,310), /*registered*/
-N(6,534), /*macron*/
-N(6,426), /*degree*/
+N(6,540), /*macron*/
+N(6,432), /*degree*/
N(9,378), /*plusminus*/
N(11,605), /*twosuperior*/
N(13,377), /*threesuperior*/
-N(5,55), /*acute*/
+N(5,70), /*acute*/
N(2,42), /*mu*/
N(9,360), /*paragraph*/
N(14,308), /*periodcentered*/
-N(7,133), /*cedilla*/
+N(7,168), /*cedilla*/
N(11,462), /*onesuperior*/
N(12,432), /*ordmasculine*/
N(14,238), /*guillemotright*/
N(10,280), /*onequarter*/
-N(7,238), /*onehalf*/
+N(7,273), /*onehalf*/
N(13,364), /*threequarters*/
N(12,504), /*questiondown*/
N(6,12), /*Agrave*/
@@ -2830,52 +2842,52 @@ N(6,120), /*Iacute*/
N(11,88), /*Icircumflex*/
N(9,18), /*Idieresis*/
N(3,6), /*Eth*/
-N(6,204), /*Ntilde*/
-N(6,216), /*Ograve*/
-N(6,210), /*Oacute*/
+N(6,210), /*Ntilde*/
+N(6,222), /*Ograve*/
+N(6,216), /*Oacute*/
N(11,154), /*Ocircumflex*/
-N(6,234), /*Otilde*/
+N(6,240), /*Otilde*/
N(9,27), /*Odieresis*/
-N(8,136), /*multiply*/
-N(6,222), /*Oslash*/
-N(6,306), /*Ugrave*/
-N(6,300), /*Uacute*/
+N(8,144), /*multiply*/
+N(6,228), /*Oslash*/
+N(6,312), /*Ugrave*/
+N(6,306), /*Uacute*/
N(11,231), /*Ucircumflex*/
N(9,45), /*Udieresis*/
-N(6,336), /*Yacute*/
-N(5,45), /*Thorn*/
+N(6,342), /*Yacute*/
+N(5,60), /*Thorn*/
N(10,200), /*germandbls*/
-N(6,378), /*agrave*/
-N(6,366), /*aacute*/
+N(6,384), /*agrave*/
+N(6,372), /*aacute*/
N(11,275), /*acircumflex*/
-N(6,384), /*atilde*/
+N(6,390), /*atilde*/
N(9,63), /*adieresis*/
-N(5,75), /*aring*/
+N(5,90), /*aring*/
N(2,32), /*ae*/
-N(8,56), /*ccedilla*/
-N(6,456), /*egrave*/
-N(6,444), /*eacute*/
+N(8,64), /*ccedilla*/
+N(6,462), /*egrave*/
+N(6,450), /*eacute*/
N(11,363), /*ecircumflex*/
N(9,216), /*edieresis*/
-N(6,504), /*igrave*/
-N(6,498), /*iacute*/
+N(6,510), /*igrave*/
+N(6,504), /*iacute*/
N(11,418), /*icircumflex*/
N(9,234), /*idieresis*/
N(3,264), /*eth*/
-N(6,558), /*ntilde*/
-N(6,576), /*ograve*/
-N(6,564), /*oacute*/
+N(6,564), /*ntilde*/
+N(6,582), /*ograve*/
+N(6,570), /*oacute*/
N(11,429), /*ocircumflex*/
-N(6,594), /*otilde*/
+N(6,600), /*otilde*/
N(9,315), /*odieresis*/
-N(6,432), /*divide*/
-N(6,588), /*oslash*/
-N(6,666), /*ugrave*/
-N(6,660), /*uacute*/
+N(6,438), /*divide*/
+N(6,594), /*oslash*/
+N(6,672), /*ugrave*/
+N(6,666), /*uacute*/
N(11,616), /*ucircumflex*/
N(9,477), /*udieresis*/
-N(6,672), /*yacute*/
-N(5,180), /*thorn*/
+N(6,678), /*yacute*/
+N(5,195), /*thorn*/
N(9,495), /*ydieresis*/
0};
static const ushort gs_c_known_encoding_reverse_4[] = {
@@ -2888,7 +2900,6 @@ static const ushort gs_c_known_encoding_reverse_4[] = {
67, /* N(1,2): C*/
68, /* N(1,3): D*/
69, /* N(1,4): E*/
-128, /* N(4,4): Euro*/
70, /* N(1,5): F*/
71, /* N(1,6): G*/
208, /* N(3,6): Eth*/
@@ -2902,6 +2913,7 @@ static const ushort gs_c_known_encoding_reverse_4[] = {
76, /* N(1,11): L*/
194, /* N(11,11): Acircumflex*/
77, /* N(1,12): M*/
+128, /* N(4,12): Euro*/
192, /* N(6,12): Agrave*/
78, /* N(1,13): N*/
79, /* N(1,14): O*/
@@ -2942,167 +2954,167 @@ static const ushort gs_c_known_encoding_reverse_4[] = {
114, /* N(1,43): r*/
115, /* N(1,44): s*/
116, /* N(1,45): t*/
-222, /* N(5,45): Thorn*/
220, /* N(9,45): Udieresis*/
117, /* N(1,46): u*/
156, /* N(2,46): oe*/
118, /* N(1,47): v*/
119, /* N(1,48): w*/
-42, /* N(8,48): asterisk*/
120, /* N(1,49): x*/
121, /* N(1,50): y*/
122, /* N(1,51): z*/
159, /* N(9,54): Ydieresis*/
-180, /* N(5,55): acute*/
202, /* N(11,55): Ecircumflex*/
-231, /* N(8,56): ccedilla*/
+42, /* N(8,56): asterisk*/
+222, /* N(5,60): Thorn*/
228, /* N(9,63): adieresis*/
-164, /* N(8,64): currency*/
+231, /* N(8,64): ccedilla*/
+180, /* N(5,70): acute*/
201, /* N(6,72): Eacute*/
-168, /* N(8,72): dieresis*/
+164, /* N(8,72): currency*/
38, /* N(9,72): ampersand*/
-229, /* N(5,75): aring*/
+168, /* N(8,80): dieresis*/
200, /* N(6,84): Egrave*/
-133, /* N(8,88): ellipsis*/
206, /* N(11,88): Icircumflex*/
-58, /* N(5,90): colon*/
-44, /* N(5,95): comma*/
-56, /* N(5,105): eight*/
-61, /* N(5,110): equal*/
+229, /* N(5,90): aring*/
+133, /* N(8,96): ellipsis*/
+58, /* N(5,105): colon*/
+44, /* N(5,110): comma*/
+56, /* N(5,120): eight*/
205, /* N(6,120): Iacute*/
-96, /* N(5,125): grave*/
+61, /* N(5,125): equal*/
204, /* N(6,126): Igrave*/
126, /* N(10,130): asciitilde*/
-184, /* N(7,133): cedilla*/
92, /* N(9,135): backslash*/
-215, /* N(8,136): multiply*/
+96, /* N(5,140): grave*/
125, /* N(10,140): braceright*/
+215, /* N(8,144): multiply*/
123, /* N(9,144): braceleft*/
-55, /* N(5,150): seven*/
166, /* N(9,153): brokenbar*/
212, /* N(11,154): Ocircumflex*/
-47, /* N(5,160): slash*/
-63, /* N(8,160): question*/
136, /* N(10,160): circumflex*/
-160, /* N(5,165): space*/
-32, /* N(5,165): space*/
-34, /* N(8,168): quotedbl*/
-254, /* N(5,180): thorn*/
+55, /* N(5,165): seven*/
+184, /* N(7,168): cedilla*/
+63, /* N(8,168): question*/
+47, /* N(5,175): slash*/
+34, /* N(8,176): quotedbl*/
+32, /* N(5,180): space*/
+160, /* N(5,180): space*/
169, /* N(9,180): copyright*/
161, /* N(10,180): exclamdown*/
-163, /* N(8,184): sterling*/
-51, /* N(5,185): three*/
-62, /* N(7,189): greater*/
135, /* N(9,189): daggerdbl*/
-152, /* N(5,190): tilde*/
+163, /* N(8,192): sterling*/
93, /* N(12,192): bracketright*/
+254, /* N(5,195): thorn*/
+51, /* N(5,200): three*/
223, /* N(10,200): germandbls*/
-209, /* N(6,204): Ntilde*/
+152, /* N(5,205): tilde*/
171, /* N(13,208): guillemotleft*/
-211, /* N(6,210): Oacute*/
-210, /* N(6,216): Ograve*/
+209, /* N(6,210): Ntilde*/
+211, /* N(6,216): Oacute*/
235, /* N(9,216): edieresis*/
139, /* N(13,221): guilsinglleft*/
-216, /* N(6,222): Oslash*/
+210, /* N(6,222): Ograve*/
+62, /* N(7,224): greater*/
+216, /* N(6,228): Oslash*/
219, /* N(11,231): Ucircumflex*/
-213, /* N(6,234): Otilde*/
239, /* N(9,234): idieresis*/
-189, /* N(7,238): onehalf*/
187, /* N(14,238): guillemotright*/
-37, /* N(7,245): percent*/
+213, /* N(6,240): Otilde*/
172, /* N(10,250): logicalnot*/
155, /* N(14,252): guilsinglright*/
124, /* N(3,255): bar*/
240, /* N(3,264): eth*/
-167, /* N(7,266): section*/
35, /* N(10,270): numbersign*/
+189, /* N(7,273): onehalf*/
148, /* N(13,273): quotedblright*/
226, /* N(11,275): acircumflex*/
49, /* N(3,276): one*/
-138, /* N(6,276): Scaron*/
+37, /* N(7,280): percent*/
188, /* N(10,280): onequarter*/
+138, /* N(6,282): Scaron*/
54, /* N(3,288): six*/
41, /* N(10,290): parenright*/
50, /* N(3,294): two*/
165, /* N(3,297): yen*/
-218, /* N(6,300): Uacute*/
146, /* N(10,300): quoteright*/
-217, /* N(6,306): Ugrave*/
+167, /* N(7,301): section*/
+218, /* N(6,306): Uacute*/
94, /* N(11,308): asciicircum*/
183, /* N(14,308): periodcentered*/
174, /* N(10,310): registered*/
+217, /* N(6,312): Ugrave*/
246, /* N(9,315): odieresis*/
95, /* N(10,320): underscore*/
-221, /* N(6,336): Yacute*/
91, /* N(11,341): bracketleft*/
-142, /* N(6,354): Zcaron*/
+221, /* N(6,342): Yacute*/
+142, /* N(6,360): Zcaron*/
182, /* N(9,360): paragraph*/
234, /* N(11,363): ecircumflex*/
190, /* N(13,364): threequarters*/
130, /* N(14,364): quotesinglbase*/
-225, /* N(6,366): aacute*/
40, /* N(9,369): parenleft*/
+225, /* N(6,372): aacute*/
179, /* N(13,377): threesuperior*/
-224, /* N(6,378): agrave*/
177, /* N(9,378): plusminus*/
-227, /* N(6,384): atilde*/
+224, /* N(6,384): agrave*/
145, /* N(9,387): quoteleft*/
-157, /* N(6,390): bullet*/
-149, /* N(6,390): bullet*/
-144, /* N(6,390): bullet*/
-143, /* N(6,390): bullet*/
-141, /* N(6,390): bullet*/
-129, /* N(6,390): bullet*/
-127, /* N(6,390): bullet*/
-134, /* N(6,408): dagger*/
+227, /* N(6,390): atilde*/
+157, /* N(6,396): bullet*/
+149, /* N(6,396): bullet*/
+144, /* N(6,396): bullet*/
+143, /* N(6,396): bullet*/
+141, /* N(6,396): bullet*/
+129, /* N(6,396): bullet*/
+127, /* N(6,396): bullet*/
+134, /* N(6,414): dagger*/
59, /* N(9,414): semicolon*/
238, /* N(11,418): icircumflex*/
-162, /* N(4,424): cent*/
-176, /* N(6,426): degree*/
244, /* N(11,429): ocircumflex*/
-53, /* N(4,432): five*/
-247, /* N(6,432): divide*/
+162, /* N(4,432): cent*/
+176, /* N(6,432): degree*/
186, /* N(12,432): ordmasculine*/
-52, /* N(4,436): four*/
-36, /* N(6,438): dollar*/
-60, /* N(4,444): less*/
-233, /* N(6,444): eacute*/
-57, /* N(4,448): nine*/
+247, /* N(6,438): divide*/
+53, /* N(4,440): five*/
+52, /* N(4,444): four*/
+36, /* N(6,444): dollar*/
+233, /* N(6,450): eacute*/
153, /* N(9,450): trademark*/
-43, /* N(4,456): plus*/
-232, /* N(6,456): egrave*/
-151, /* N(6,462): emdash*/
+60, /* N(4,452): less*/
+57, /* N(4,456): nine*/
+232, /* N(6,462): egrave*/
185, /* N(11,462): onesuperior*/
-48, /* N(4,464): zero*/
-150, /* N(6,468): endash*/
+43, /* N(4,464): plus*/
+151, /* N(6,468): emdash*/
+48, /* N(4,472): zero*/
170, /* N(11,473): ordfeminine*/
-33, /* N(6,474): exclam*/
+150, /* N(6,474): endash*/
252, /* N(9,477): udieresis*/
-131, /* N(6,480): florin*/
-173, /* N(6,492): hyphen*/
-45, /* N(6,492): hyphen*/
+33, /* N(6,480): exclam*/
+131, /* N(6,486): florin*/
255, /* N(9,495): ydieresis*/
-237, /* N(6,498): iacute*/
-236, /* N(6,504): igrave*/
+45, /* N(6,498): hyphen*/
+173, /* N(6,498): hyphen*/
+237, /* N(6,504): iacute*/
191, /* N(12,504): questiondown*/
+236, /* N(6,510): igrave*/
132, /* N(12,516): quotedblbase*/
137, /* N(11,528): perthousand*/
147, /* N(12,528): quotedblleft*/
-175, /* N(6,534): macron*/
39, /* N(11,539): quotesingle*/
-241, /* N(6,558): ntilde*/
-243, /* N(6,564): oacute*/
-242, /* N(6,576): ograve*/
-248, /* N(6,588): oslash*/
-245, /* N(6,594): otilde*/
-46, /* N(6,600): period*/
+175, /* N(6,540): macron*/
+241, /* N(6,564): ntilde*/
+243, /* N(6,570): oacute*/
+242, /* N(6,582): ograve*/
+248, /* N(6,594): oslash*/
+245, /* N(6,600): otilde*/
178, /* N(11,605): twosuperior*/
+46, /* N(6,606): period*/
251, /* N(11,616): ucircumflex*/
-154, /* N(6,630): scaron*/
-250, /* N(6,660): uacute*/
-249, /* N(6,666): ugrave*/
-253, /* N(6,672): yacute*/
-158, /* N(6,684): zcaron*/
+154, /* N(6,636): scaron*/
+250, /* N(6,666): uacute*/
+249, /* N(6,672): ugrave*/
+253, /* N(6,678): yacute*/
+158, /* N(6,690): zcaron*/
0};
/* MacRomanEncoding */
@@ -3139,38 +3151,38 @@ N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
-N(5,165), /*space*/
-N(6,474), /*exclam*/
-N(8,168), /*quotedbl*/
+N(5,180), /*space*/
+N(6,480), /*exclam*/
+N(8,176), /*quotedbl*/
N(10,270), /*numbersign*/
-N(6,438), /*dollar*/
-N(7,245), /*percent*/
+N(6,444), /*dollar*/
+N(7,280), /*percent*/
N(9,72), /*ampersand*/
N(11,539), /*quotesingle*/
N(9,369), /*parenleft*/
N(10,290), /*parenright*/
-N(8,48), /*asterisk*/
-N(4,456), /*plus*/
-N(5,95), /*comma*/
-N(6,492), /*hyphen*/
-N(6,600), /*period*/
-N(5,160), /*slash*/
-N(4,464), /*zero*/
+N(8,56), /*asterisk*/
+N(4,464), /*plus*/
+N(5,110), /*comma*/
+N(6,498), /*hyphen*/
+N(6,606), /*period*/
+N(5,175), /*slash*/
+N(4,472), /*zero*/
N(3,276), /*one*/
N(3,294), /*two*/
-N(5,185), /*three*/
-N(4,436), /*four*/
-N(4,432), /*five*/
+N(5,200), /*three*/
+N(4,444), /*four*/
+N(4,440), /*five*/
N(3,288), /*six*/
-N(5,150), /*seven*/
-N(5,105), /*eight*/
-N(4,448), /*nine*/
-N(5,90), /*colon*/
+N(5,165), /*seven*/
+N(5,120), /*eight*/
+N(4,456), /*nine*/
+N(5,105), /*colon*/
N(9,414), /*semicolon*/
-N(4,444), /*less*/
-N(5,110), /*equal*/
-N(7,189), /*greater*/
-N(8,160), /*question*/
+N(4,452), /*less*/
+N(5,125), /*equal*/
+N(7,224), /*greater*/
+N(8,168), /*question*/
N(2,34), /*at*/
N(1,0), /*A*/
N(1,1), /*B*/
@@ -3203,7 +3215,7 @@ N(9,135), /*backslash*/
N(12,192), /*bracketright*/
N(11,308), /*asciicircum*/
N(10,320), /*underscore*/
-N(5,125), /*grave*/
+N(5,140), /*grave*/
N(1,26), /*a*/
N(1,27), /*b*/
N(1,28), /*c*/
@@ -3239,50 +3251,50 @@ N(9,0), /*Adieresis*/
N(5,10), /*Aring*/
N(8,0), /*Ccedilla*/
N(6,72), /*Eacute*/
-N(6,204), /*Ntilde*/
+N(6,210), /*Ntilde*/
N(9,27), /*Odieresis*/
N(9,45), /*Udieresis*/
-N(6,366), /*aacute*/
-N(6,378), /*agrave*/
+N(6,372), /*aacute*/
+N(6,384), /*agrave*/
N(11,275), /*acircumflex*/
N(9,63), /*adieresis*/
-N(6,384), /*atilde*/
-N(5,75), /*aring*/
-N(8,56), /*ccedilla*/
-N(6,444), /*eacute*/
-N(6,456), /*egrave*/
+N(6,390), /*atilde*/
+N(5,90), /*aring*/
+N(8,64), /*ccedilla*/
+N(6,450), /*eacute*/
+N(6,462), /*egrave*/
N(11,363), /*ecircumflex*/
N(9,216), /*edieresis*/
-N(6,498), /*iacute*/
-N(6,504), /*igrave*/
+N(6,504), /*iacute*/
+N(6,510), /*igrave*/
N(11,418), /*icircumflex*/
N(9,234), /*idieresis*/
-N(6,558), /*ntilde*/
-N(6,564), /*oacute*/
-N(6,576), /*ograve*/
+N(6,564), /*ntilde*/
+N(6,570), /*oacute*/
+N(6,582), /*ograve*/
N(11,429), /*ocircumflex*/
N(9,315), /*odieresis*/
-N(6,594), /*otilde*/
-N(6,660), /*uacute*/
-N(6,666), /*ugrave*/
+N(6,600), /*otilde*/
+N(6,666), /*uacute*/
+N(6,672), /*ugrave*/
N(11,616), /*ucircumflex*/
N(9,477), /*udieresis*/
-N(6,408), /*dagger*/
-N(6,426), /*degree*/
-N(4,424), /*cent*/
-N(8,184), /*sterling*/
-N(7,266), /*section*/
-N(6,390), /*bullet*/
+N(6,414), /*dagger*/
+N(6,432), /*degree*/
+N(4,432), /*cent*/
+N(8,192), /*sterling*/
+N(7,301), /*section*/
+N(6,396), /*bullet*/
N(9,360), /*paragraph*/
N(10,200), /*germandbls*/
N(10,310), /*registered*/
N(9,180), /*copyright*/
N(9,450), /*trademark*/
-N(5,55), /*acute*/
-N(8,72), /*dieresis*/
+N(5,70), /*acute*/
+N(8,80), /*dieresis*/
N(7,0), /*.notdef*/
N(2,0), /*AE*/
-N(6,222), /*Oslash*/
+N(6,228), /*Oslash*/
N(7,0), /*.notdef*/
N(9,378), /*plusminus*/
N(7,0), /*.notdef*/
@@ -3298,35 +3310,35 @@ N(11,473), /*ordfeminine*/
N(12,432), /*ordmasculine*/
N(7,0), /*.notdef*/
N(2,32), /*ae*/
-N(6,588), /*oslash*/
+N(6,594), /*oslash*/
N(12,504), /*questiondown*/
N(10,180), /*exclamdown*/
N(10,250), /*logicalnot*/
N(7,0), /*.notdef*/
-N(6,480), /*florin*/
+N(6,486), /*florin*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(13,208), /*guillemotleft*/
N(14,238), /*guillemotright*/
-N(8,88), /*ellipsis*/
-N(5,165), /*space*/
+N(8,96), /*ellipsis*/
+N(5,180), /*space*/
N(6,12), /*Agrave*/
N(6,24), /*Atilde*/
-N(6,234), /*Otilde*/
+N(6,240), /*Otilde*/
N(2,8), /*OE*/
N(2,46), /*oe*/
-N(6,468), /*endash*/
-N(6,462), /*emdash*/
+N(6,474), /*endash*/
+N(6,468), /*emdash*/
N(12,528), /*quotedblleft*/
N(13,273), /*quotedblright*/
N(9,387), /*quoteleft*/
N(10,300), /*quoteright*/
-N(6,432), /*divide*/
+N(6,438), /*divide*/
N(7,0), /*.notdef*/
N(9,495), /*ydieresis*/
N(9,54), /*Ydieresis*/
-N(8,104), /*fraction*/
-N(8,64), /*currency*/
+N(8,112), /*fraction*/
+N(8,72), /*currency*/
N(13,221), /*guilsinglleft*/
N(14,252), /*guilsinglright*/
N(2,38), /*fi*/
@@ -3345,24 +3357,24 @@ N(6,120), /*Iacute*/
N(11,88), /*Icircumflex*/
N(9,18), /*Idieresis*/
N(6,126), /*Igrave*/
-N(6,210), /*Oacute*/
+N(6,216), /*Oacute*/
N(11,154), /*Ocircumflex*/
N(7,0), /*.notdef*/
-N(6,216), /*Ograve*/
-N(6,300), /*Uacute*/
+N(6,222), /*Ograve*/
+N(6,306), /*Uacute*/
N(11,231), /*Ucircumflex*/
-N(6,306), /*Ugrave*/
-N(8,80), /*dotlessi*/
+N(6,312), /*Ugrave*/
+N(8,88), /*dotlessi*/
N(10,160), /*circumflex*/
-N(5,190), /*tilde*/
-N(6,534), /*macron*/
-N(5,80), /*breve*/
+N(5,205), /*tilde*/
+N(6,540), /*macron*/
+N(5,95), /*breve*/
N(9,198), /*dotaccent*/
-N(4,460), /*ring*/
-N(7,133), /*cedilla*/
+N(4,468), /*ring*/
+N(7,168), /*cedilla*/
N(12,336), /*hungarumlaut*/
-N(6,570), /*ogonek*/
-N(5,85), /*caron*/
+N(6,576), /*ogonek*/
+N(5,100), /*caron*/
0};
static const ushort gs_c_known_encoding_reverse_5[] = {
65, /* N(1,0): A*/
@@ -3433,87 +3445,87 @@ static const ushort gs_c_known_encoding_reverse_5[] = {
207, /* N(2,46): oe*/
118, /* N(1,47): v*/
119, /* N(1,48): w*/
-42, /* N(8,48): asterisk*/
120, /* N(1,49): x*/
121, /* N(1,50): y*/
122, /* N(1,51): z*/
217, /* N(9,54): Ydieresis*/
-171, /* N(5,55): acute*/
230, /* N(11,55): Ecircumflex*/
-141, /* N(8,56): ccedilla*/
+42, /* N(8,56): asterisk*/
138, /* N(9,63): adieresis*/
-219, /* N(8,64): currency*/
+141, /* N(8,64): ccedilla*/
+171, /* N(5,70): acute*/
131, /* N(6,72): Eacute*/
-172, /* N(8,72): dieresis*/
+219, /* N(8,72): currency*/
38, /* N(9,72): ampersand*/
-140, /* N(5,75): aring*/
-249, /* N(5,80): breve*/
-245, /* N(8,80): dotlessi*/
+172, /* N(8,80): dieresis*/
233, /* N(6,84): Egrave*/
-255, /* N(5,85): caron*/
-201, /* N(8,88): ellipsis*/
+245, /* N(8,88): dotlessi*/
235, /* N(11,88): Icircumflex*/
-58, /* N(5,90): colon*/
-44, /* N(5,95): comma*/
-218, /* N(8,104): fraction*/
-56, /* N(5,105): eight*/
-61, /* N(5,110): equal*/
+140, /* N(5,90): aring*/
+249, /* N(5,95): breve*/
+201, /* N(8,96): ellipsis*/
+255, /* N(5,100): caron*/
+58, /* N(5,105): colon*/
+44, /* N(5,110): comma*/
+218, /* N(8,112): fraction*/
+56, /* N(5,120): eight*/
234, /* N(6,120): Iacute*/
-96, /* N(5,125): grave*/
+61, /* N(5,125): equal*/
237, /* N(6,126): Igrave*/
126, /* N(10,130): asciitilde*/
-252, /* N(7,133): cedilla*/
92, /* N(9,135): backslash*/
+96, /* N(5,140): grave*/
125, /* N(10,140): braceright*/
123, /* N(9,144): braceleft*/
-55, /* N(5,150): seven*/
239, /* N(11,154): Ocircumflex*/
-47, /* N(5,160): slash*/
-63, /* N(8,160): question*/
246, /* N(10,160): circumflex*/
-202, /* N(5,165): space*/
-32, /* N(5,165): space*/
-34, /* N(8,168): quotedbl*/
+55, /* N(5,165): seven*/
+252, /* N(7,168): cedilla*/
+63, /* N(8,168): question*/
+47, /* N(5,175): slash*/
+34, /* N(8,176): quotedbl*/
+32, /* N(5,180): space*/
+202, /* N(5,180): space*/
169, /* N(9,180): copyright*/
193, /* N(10,180): exclamdown*/
-163, /* N(8,184): sterling*/
-51, /* N(5,185): three*/
-62, /* N(7,189): greater*/
224, /* N(9,189): daggerdbl*/
-247, /* N(5,190): tilde*/
+163, /* N(8,192): sterling*/
93, /* N(12,192): bracketright*/
250, /* N(9,198): dotaccent*/
+51, /* N(5,200): three*/
167, /* N(10,200): germandbls*/
-132, /* N(6,204): Ntilde*/
+247, /* N(5,205): tilde*/
199, /* N(13,208): guillemotleft*/
-238, /* N(6,210): Oacute*/
-241, /* N(6,216): Ograve*/
+132, /* N(6,210): Ntilde*/
+238, /* N(6,216): Oacute*/
145, /* N(9,216): edieresis*/
220, /* N(13,221): guilsinglleft*/
-175, /* N(6,222): Oslash*/
+241, /* N(6,222): Ograve*/
+62, /* N(7,224): greater*/
+175, /* N(6,228): Oslash*/
243, /* N(11,231): Ucircumflex*/
-205, /* N(6,234): Otilde*/
149, /* N(9,234): idieresis*/
200, /* N(14,238): guillemotright*/
-37, /* N(7,245): percent*/
+205, /* N(6,240): Otilde*/
194, /* N(10,250): logicalnot*/
221, /* N(14,252): guilsinglright*/
124, /* N(3,255): bar*/
-164, /* N(7,266): section*/
35, /* N(10,270): numbersign*/
211, /* N(13,273): quotedblright*/
137, /* N(11,275): acircumflex*/
49, /* N(3,276): one*/
+37, /* N(7,280): percent*/
54, /* N(3,288): six*/
41, /* N(10,290): parenright*/
50, /* N(3,294): two*/
180, /* N(3,297): yen*/
-242, /* N(6,300): Uacute*/
213, /* N(10,300): quoteright*/
-244, /* N(6,306): Ugrave*/
+164, /* N(7,301): section*/
+242, /* N(6,306): Uacute*/
94, /* N(11,308): asciicircum*/
225, /* N(14,308): periodcentered*/
168, /* N(10,310): registered*/
+244, /* N(6,312): Ugrave*/
154, /* N(9,315): odieresis*/
95, /* N(10,320): underscore*/
253, /* N(12,336): hungarumlaut*/
@@ -3521,58 +3533,58 @@ static const ushort gs_c_known_encoding_reverse_5[] = {
166, /* N(9,360): paragraph*/
144, /* N(11,363): ecircumflex*/
226, /* N(14,364): quotesinglbase*/
-135, /* N(6,366): aacute*/
40, /* N(9,369): parenleft*/
-136, /* N(6,378): agrave*/
+135, /* N(6,372): aacute*/
177, /* N(9,378): plusminus*/
-139, /* N(6,384): atilde*/
+136, /* N(6,384): agrave*/
212, /* N(9,387): quoteleft*/
-165, /* N(6,390): bullet*/
-160, /* N(6,408): dagger*/
+139, /* N(6,390): atilde*/
+165, /* N(6,396): bullet*/
+160, /* N(6,414): dagger*/
59, /* N(9,414): semicolon*/
148, /* N(11,418): icircumflex*/
-162, /* N(4,424): cent*/
-161, /* N(6,426): degree*/
153, /* N(11,429): ocircumflex*/
-53, /* N(4,432): five*/
-214, /* N(6,432): divide*/
+162, /* N(4,432): cent*/
+161, /* N(6,432): degree*/
188, /* N(12,432): ordmasculine*/
-52, /* N(4,436): four*/
-36, /* N(6,438): dollar*/
-60, /* N(4,444): less*/
-142, /* N(6,444): eacute*/
-57, /* N(4,448): nine*/
+214, /* N(6,438): divide*/
+53, /* N(4,440): five*/
+52, /* N(4,444): four*/
+36, /* N(6,444): dollar*/
+142, /* N(6,450): eacute*/
170, /* N(9,450): trademark*/
-43, /* N(4,456): plus*/
-143, /* N(6,456): egrave*/
-251, /* N(4,460): ring*/
-209, /* N(6,462): emdash*/
-48, /* N(4,464): zero*/
-208, /* N(6,468): endash*/
+60, /* N(4,452): less*/
+57, /* N(4,456): nine*/
+143, /* N(6,462): egrave*/
+43, /* N(4,464): plus*/
+251, /* N(4,468): ring*/
+209, /* N(6,468): emdash*/
+48, /* N(4,472): zero*/
187, /* N(11,473): ordfeminine*/
-33, /* N(6,474): exclam*/
+208, /* N(6,474): endash*/
159, /* N(9,477): udieresis*/
-196, /* N(6,480): florin*/
-45, /* N(6,492): hyphen*/
+33, /* N(6,480): exclam*/
+196, /* N(6,486): florin*/
216, /* N(9,495): ydieresis*/
-146, /* N(6,498): iacute*/
-147, /* N(6,504): igrave*/
+45, /* N(6,498): hyphen*/
+146, /* N(6,504): iacute*/
192, /* N(12,504): questiondown*/
+147, /* N(6,510): igrave*/
227, /* N(12,516): quotedblbase*/
228, /* N(11,528): perthousand*/
210, /* N(12,528): quotedblleft*/
-248, /* N(6,534): macron*/
39, /* N(11,539): quotesingle*/
-150, /* N(6,558): ntilde*/
-151, /* N(6,564): oacute*/
-254, /* N(6,570): ogonek*/
-152, /* N(6,576): ograve*/
-191, /* N(6,588): oslash*/
-155, /* N(6,594): otilde*/
-46, /* N(6,600): period*/
+248, /* N(6,540): macron*/
+150, /* N(6,564): ntilde*/
+151, /* N(6,570): oacute*/
+254, /* N(6,576): ogonek*/
+152, /* N(6,582): ograve*/
+191, /* N(6,594): oslash*/
+155, /* N(6,600): otilde*/
+46, /* N(6,606): period*/
158, /* N(11,616): ucircumflex*/
-156, /* N(6,660): uacute*/
-157, /* N(6,666): ugrave*/
+156, /* N(6,666): uacute*/
+157, /* N(6,672): ugrave*/
0};
/* MacExpertEncoding */
@@ -3609,7 +3621,7 @@ N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
-N(5,165), /*space*/
+N(5,180), /*space*/
N(11,385), /*exclamsmall*/
N(17,0), /*Hungarumlautsmall*/
N(12,216), /*centoldstyle*/
@@ -3621,10 +3633,10 @@ N(17,34), /*parenleftsuperior*/
N(18,18), /*parenrightsuperior*/
N(14,406), /*twodotenleader*/
N(14,294), /*onedotenleader*/
-N(5,95), /*comma*/
-N(6,492), /*hyphen*/
-N(6,600), /*period*/
-N(8,104), /*fraction*/
+N(5,110), /*comma*/
+N(6,498), /*hyphen*/
+N(6,606), /*period*/
+N(8,112), /*fraction*/
N(12,636), /*zerooldstyle*/
N(11,451), /*oneoldstyle*/
N(11,594), /*twooldstyle*/
@@ -3635,7 +3647,7 @@ N(11,561), /*sixoldstyle*/
N(13,312), /*sevenoldstyle*/
N(13,182), /*eightoldstyle*/
N(12,408), /*nineoldstyle*/
-N(5,90), /*colon*/
+N(5,105), /*colon*/
N(9,414), /*semicolon*/
N(7,0), /*.notdef*/
N(19,0), /*threequartersemdash*/
@@ -3649,13 +3661,13 @@ N(8,8), /*Ethsmall*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(10,280), /*onequarter*/
-N(7,238), /*onehalf*/
+N(7,273), /*onehalf*/
N(13,364), /*threequarters*/
N(9,324), /*oneeighth*/
N(12,612), /*threeeighths*/
N(11,407), /*fiveeighths*/
N(12,588), /*seveneighths*/
-N(8,152), /*onethird*/
+N(8,160), /*onethird*/
N(9,468), /*twothirds*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
@@ -3686,23 +3698,23 @@ N(6,132), /*Ismall*/
N(6,138), /*Jsmall*/
N(6,144), /*Ksmall*/
N(6,174), /*Lsmall*/
-N(6,180), /*Msmall*/
-N(6,198), /*Nsmall*/
-N(6,228), /*Osmall*/
-N(6,240), /*Psmall*/
-N(6,246), /*Qsmall*/
-N(6,264), /*Rsmall*/
-N(6,282), /*Ssmall*/
-N(6,294), /*Tsmall*/
-N(6,312), /*Usmall*/
-N(6,318), /*Vsmall*/
-N(6,324), /*Wsmall*/
-N(6,330), /*Xsmall*/
-N(6,342), /*Ysmall*/
-N(6,360), /*Zsmall*/
+N(6,186), /*Msmall*/
+N(6,204), /*Nsmall*/
+N(6,234), /*Osmall*/
+N(6,246), /*Psmall*/
+N(6,252), /*Qsmall*/
+N(6,270), /*Rsmall*/
+N(6,288), /*Ssmall*/
+N(6,300), /*Tsmall*/
+N(6,318), /*Usmall*/
+N(6,324), /*Vsmall*/
+N(6,330), /*Wsmall*/
+N(6,336), /*Xsmall*/
+N(6,348), /*Ysmall*/
+N(6,366), /*Zsmall*/
N(13,117), /*colonmonetary*/
N(9,333), /*onefitted*/
-N(6,618), /*rupiah*/
+N(6,624), /*rupiah*/
N(10,80), /*Tildesmall*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
@@ -3767,7 +3779,7 @@ N(7,0), /*.notdef*/
N(12,396), /*nineinferior*/
N(12,624), /*zeroinferior*/
N(11,264), /*Zcaronsmall*/
-N(7,7), /*AEsmall*/
+N(7,35), /*AEsmall*/
N(11,187), /*Oslashsmall*/
N(17,51), /*questiondownsmall*/
N(11,440), /*oneinferior*/
@@ -3784,7 +3796,7 @@ N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
N(7,0), /*.notdef*/
-N(7,63), /*OEsmall*/
+N(7,91), /*OEsmall*/
N(10,190), /*figuredash*/
N(14,280), /*hyphensuperior*/
N(7,0), /*.notdef*/
@@ -3845,7 +3857,6 @@ static const ushort gs_c_known_encoding_reverse_6[] = {
34, /* N(17,0): Hungarumlautsmall*/
93, /* N(18,0): parenrightinferior*/
61, /* N(19,0): threequartersemdash*/
-190, /* N(7,7): AEsmall*/
68, /* N(8,8): Ethsmall*/
140, /* N(10,10): Aringsmall*/
172, /* N(13,13): Dieresissmall*/
@@ -3863,6 +3874,7 @@ static const ushort gs_c_known_encoding_reverse_6[] = {
148, /* N(16,32): Icircumflexsmall*/
139, /* N(11,33): Atildesmall*/
40, /* N(17,34): parenleftsuperior*/
+190, /* N(7,35): AEsmall*/
86, /* N(2,36): ff*/
251, /* N(9,36): Ringsmall*/
87, /* N(2,38): fi*/
@@ -3874,7 +3886,6 @@ static const ushort gs_c_known_encoding_reverse_6[] = {
96, /* N(10,50): Gravesmall*/
192, /* N(17,51): questiondownsmall*/
154, /* N(14,56): Odieresissmall*/
-207, /* N(7,63): OEsmall*/
158, /* N(16,64): Ucircumflexsmall*/
100, /* N(6,66): Dsmall*/
143, /* N(11,66): Egravesmall*/
@@ -3883,15 +3894,16 @@ static const ushort gs_c_known_encoding_reverse_6[] = {
146, /* N(11,77): Iacutesmall*/
126, /* N(10,80): Tildesmall*/
216, /* N(14,84): Ydieresissmall*/
-58, /* N(5,90): colon*/
101, /* N(6,90): Esmall*/
-44, /* N(5,95): comma*/
+207, /* N(7,91): OEsmall*/
102, /* N(6,96): Fsmall*/
38, /* N(14,98): ampersandsmall*/
147, /* N(11,99): Igravesmall*/
-47, /* N(8,104): fraction*/
+58, /* N(5,105): colon*/
103, /* N(6,108): Gsmall*/
+44, /* N(5,110): comma*/
194, /* N(11,110): Lslashsmall*/
+47, /* N(8,112): fraction*/
104, /* N(6,114): Hsmall*/
123, /* N(13,117): colonmonetary*/
244, /* N(11,121): Macronsmall*/
@@ -3903,21 +3915,21 @@ static const ushort gs_c_known_encoding_reverse_6[] = {
151, /* N(11,143): Oacutesmall*/
248, /* N(13,143): commasuperior*/
107, /* N(6,144): Ksmall*/
-78, /* N(8,152): onethird*/
+78, /* N(8,160): onethird*/
245, /* N(9,162): bsuperior*/
-32, /* N(5,165): space*/
242, /* N(11,165): Ogoneksmall*/
165, /* N(13,169): eightinferior*/
108, /* N(6,174): Lsmall*/
152, /* N(11,176): Ogravesmall*/
-109, /* N(6,180): Msmall*/
+32, /* N(5,180): space*/
56, /* N(13,182): eightoldstyle*/
+109, /* N(6,186): Msmall*/
191, /* N(11,187): Oslashsmall*/
208, /* N(10,190): figuredash*/
161, /* N(13,195): eightsuperior*/
182, /* N(14,196): dollarinferior*/
-110, /* N(6,198): Nsmall*/
155, /* N(11,198): Otildesmall*/
+110, /* N(6,204): Nsmall*/
169, /* N(12,204): centinferior*/
235, /* N(9,207): dsuperior*/
167, /* N(11,209): Scaronsmall*/
@@ -3926,51 +3938,51 @@ static const ushort gs_c_known_encoding_reverse_6[] = {
156, /* N(11,220): Uacutesmall*/
37, /* N(14,224): dollarsuperior*/
228, /* N(9,225): esuperior*/
-111, /* N(6,228): Osmall*/
130, /* N(12,228): centsuperior*/
-72, /* N(7,238): onehalf*/
-112, /* N(6,240): Psmall*/
+111, /* N(6,234): Osmall*/
176, /* N(12,240): fiveinferior*/
157, /* N(11,242): Ugravesmall*/
-113, /* N(6,246): Qsmall*/
+112, /* N(6,246): Psmall*/
+113, /* N(6,252): Qsmall*/
233, /* N(9,252): isuperior*/
53, /* N(12,252): fiveoldstyle*/
180, /* N(11,253): Yacutesmall*/
63, /* N(13,260): questionsmall*/
-114, /* N(6,264): Rsmall*/
189, /* N(11,264): Zcaronsmall*/
222, /* N(12,264): fivesuperior*/
95, /* N(14,266): hypheninferior*/
89, /* N(3,267): ffi*/
90, /* N(3,270): ffl*/
+114, /* N(6,270): Rsmall*/
+72, /* N(7,273): onehalf*/
162, /* N(12,276): fourinferior*/
241, /* N(9,279): lsuperior*/
71, /* N(10,280): onequarter*/
209, /* N(14,280): hyphensuperior*/
-115, /* N(6,282): Ssmall*/
+115, /* N(6,288): Ssmall*/
247, /* N(9,288): msuperior*/
52, /* N(12,288): fouroldstyle*/
-116, /* N(6,294): Tsmall*/
43, /* N(14,294): onedotenleader*/
166, /* N(13,299): seveninferior*/
+116, /* N(6,300): Tsmall*/
221, /* N(12,300): foursuperior*/
246, /* N(9,306): nsuperior*/
-117, /* N(6,312): Usmall*/
55, /* N(13,312): sevenoldstyle*/
-118, /* N(6,318): Vsmall*/
+117, /* N(6,318): Usmall*/
179, /* N(14,322): periodinferior*/
-119, /* N(6,324): Wsmall*/
+118, /* N(6,324): Vsmall*/
74, /* N(9,324): oneeighth*/
224, /* N(13,325): sevensuperior*/
-120, /* N(6,330): Xsmall*/
+119, /* N(6,330): Wsmall*/
124, /* N(9,333): onefitted*/
+120, /* N(6,336): Xsmall*/
249, /* N(14,336): periodsuperior*/
163, /* N(13,338): threeinferior*/
-121, /* N(6,342): Ysmall*/
175, /* N(9,342): osuperior*/
+121, /* N(6,348): Ysmall*/
51, /* N(13,351): threeoldstyle*/
-122, /* N(6,360): Zsmall*/
73, /* N(13,364): threequarters*/
+122, /* N(6,366): Zsmall*/
220, /* N(13,377): threesuperior*/
33, /* N(11,385): exclamsmall*/
187, /* N(12,396): nineinferior*/
@@ -3986,17 +3998,17 @@ static const ushort gs_c_known_encoding_reverse_6[] = {
230, /* N(9,459): tsuperior*/
218, /* N(11,462): onesuperior*/
79, /* N(9,468): twothirds*/
-45, /* N(6,492): hyphen*/
+45, /* N(6,498): hyphen*/
164, /* N(11,550): sixinferior*/
54, /* N(11,561): sixoldstyle*/
223, /* N(11,572): sixsuperior*/
170, /* N(11,583): twoinferior*/
77, /* N(12,588): seveneighths*/
50, /* N(11,594): twooldstyle*/
-46, /* N(6,600): period*/
219, /* N(11,605): twosuperior*/
+46, /* N(6,606): period*/
75, /* N(12,612): threeeighths*/
-125, /* N(6,618): rupiah*/
+125, /* N(6,624): rupiah*/
188, /* N(12,624): zeroinferior*/
48, /* N(12,636): zerooldstyle*/
226, /* N(12,648): zerosuperior*/
@@ -4007,38 +4019,38 @@ static const ushort gs_c_known_encoding_7[] = {
N(7,0), /*.notdef*/
N(5,0), /*.null*/
N(2,2), /*CR*/
-N(5,165), /*space*/
-N(6,474), /*exclam*/
-N(8,168), /*quotedbl*/
+N(5,180), /*space*/
+N(6,480), /*exclam*/
+N(8,176), /*quotedbl*/
N(10,270), /*numbersign*/
-N(6,438), /*dollar*/
-N(7,245), /*percent*/
+N(6,444), /*dollar*/
+N(7,280), /*percent*/
N(9,72), /*ampersand*/
N(11,539), /*quotesingle*/
N(9,369), /*parenleft*/
N(10,290), /*parenright*/
-N(8,48), /*asterisk*/
-N(4,456), /*plus*/
-N(5,95), /*comma*/
-N(6,492), /*hyphen*/
-N(6,600), /*period*/
-N(5,160), /*slash*/
-N(4,464), /*zero*/
+N(8,56), /*asterisk*/
+N(4,464), /*plus*/
+N(5,110), /*comma*/
+N(6,498), /*hyphen*/
+N(6,606), /*period*/
+N(5,175), /*slash*/
+N(4,472), /*zero*/
N(3,276), /*one*/
N(3,294), /*two*/
-N(5,185), /*three*/
-N(4,436), /*four*/
-N(4,432), /*five*/
+N(5,200), /*three*/
+N(4,444), /*four*/
+N(4,440), /*five*/
N(3,288), /*six*/
-N(5,150), /*seven*/
-N(5,105), /*eight*/
-N(4,448), /*nine*/
-N(5,90), /*colon*/
+N(5,165), /*seven*/
+N(5,120), /*eight*/
+N(4,456), /*nine*/
+N(5,105), /*colon*/
N(9,414), /*semicolon*/
-N(4,444), /*less*/
-N(5,110), /*equal*/
-N(7,189), /*greater*/
-N(8,160), /*question*/
+N(4,452), /*less*/
+N(5,125), /*equal*/
+N(7,224), /*greater*/
+N(8,168), /*question*/
N(2,34), /*at*/
N(1,0), /*A*/
N(1,1), /*B*/
@@ -4071,7 +4083,7 @@ N(9,135), /*backslash*/
N(12,192), /*bracketright*/
N(11,308), /*asciicircum*/
N(10,320), /*underscore*/
-N(5,125), /*grave*/
+N(5,140), /*grave*/
N(1,26), /*a*/
N(1,27), /*b*/
N(1,28), /*c*/
@@ -4106,51 +4118,51 @@ N(9,0), /*Adieresis*/
N(5,10), /*Aring*/
N(8,0), /*Ccedilla*/
N(6,72), /*Eacute*/
-N(6,204), /*Ntilde*/
+N(6,210), /*Ntilde*/
N(9,27), /*Odieresis*/
N(9,45), /*Udieresis*/
-N(6,366), /*aacute*/
-N(6,378), /*agrave*/
+N(6,372), /*aacute*/
+N(6,384), /*agrave*/
N(11,275), /*acircumflex*/
N(9,63), /*adieresis*/
-N(6,384), /*atilde*/
-N(5,75), /*aring*/
-N(8,56), /*ccedilla*/
-N(6,444), /*eacute*/
-N(6,456), /*egrave*/
+N(6,390), /*atilde*/
+N(5,90), /*aring*/
+N(8,64), /*ccedilla*/
+N(6,450), /*eacute*/
+N(6,462), /*egrave*/
N(11,363), /*ecircumflex*/
N(9,216), /*edieresis*/
-N(6,498), /*iacute*/
-N(6,504), /*igrave*/
+N(6,504), /*iacute*/
+N(6,510), /*igrave*/
N(11,418), /*icircumflex*/
N(9,234), /*idieresis*/
-N(6,558), /*ntilde*/
-N(6,564), /*oacute*/
-N(6,576), /*ograve*/
+N(6,564), /*ntilde*/
+N(6,570), /*oacute*/
+N(6,582), /*ograve*/
N(11,429), /*ocircumflex*/
N(9,315), /*odieresis*/
-N(6,594), /*otilde*/
-N(6,660), /*uacute*/
-N(6,666), /*ugrave*/
+N(6,600), /*otilde*/
+N(6,666), /*uacute*/
+N(6,672), /*ugrave*/
N(11,616), /*ucircumflex*/
N(9,477), /*udieresis*/
-N(6,408), /*dagger*/
-N(6,426), /*degree*/
-N(4,424), /*cent*/
-N(8,184), /*sterling*/
-N(7,266), /*section*/
-N(6,390), /*bullet*/
+N(6,414), /*dagger*/
+N(6,432), /*degree*/
+N(4,432), /*cent*/
+N(8,192), /*sterling*/
+N(7,301), /*section*/
+N(6,396), /*bullet*/
N(9,360), /*paragraph*/
N(10,200), /*germandbls*/
N(10,310), /*registered*/
N(9,180), /*copyright*/
N(9,450), /*trademark*/
-N(5,55), /*acute*/
-N(8,72), /*dieresis*/
-N(8,144), /*notequal*/
+N(5,70), /*acute*/
+N(8,80), /*dieresis*/
+N(8,152), /*notequal*/
N(2,0), /*AE*/
-N(6,222), /*Oslash*/
-N(8,120), /*infinity*/
+N(6,228), /*Oslash*/
+N(8,128), /*infinity*/
N(9,378), /*plusminus*/
N(9,261), /*lessequal*/
N(12,324), /*greaterequal*/
@@ -4158,42 +4170,42 @@ N(3,297), /*yen*/
N(3,273), /*mu1*/
N(11,517), /*partialdiff*/
N(9,432), /*summation*/
-N(7,252), /*product*/
+N(7,287), /*product*/
N(2,48), /*pi*/
-N(8,128), /*integral*/
+N(8,136), /*integral*/
N(11,473), /*ordfeminine*/
N(12,432), /*ordmasculine*/
N(3,9), /*Ohm*/
N(2,32), /*ae*/
-N(6,588), /*oslash*/
+N(6,594), /*oslash*/
N(12,504), /*questiondown*/
N(10,180), /*exclamdown*/
N(10,250), /*logicalnot*/
-N(7,259), /*radical*/
-N(6,480), /*florin*/
+N(7,294), /*radical*/
+N(6,486), /*florin*/
N(11,286), /*approxequal*/
N(9,243), /*increment*/
N(13,208), /*guillemotleft*/
N(14,238), /*guillemotright*/
-N(8,88), /*ellipsis*/
-N(7,217), /*nbspace*/
+N(8,96), /*ellipsis*/
+N(7,252), /*nbspace*/
N(6,12), /*Agrave*/
N(6,24), /*Atilde*/
-N(6,234), /*Otilde*/
+N(6,240), /*Otilde*/
N(2,8), /*OE*/
N(2,46), /*oe*/
-N(6,468), /*endash*/
-N(6,462), /*emdash*/
+N(6,474), /*endash*/
+N(6,468), /*emdash*/
N(12,528), /*quotedblleft*/
N(13,273), /*quotedblright*/
N(9,387), /*quoteleft*/
N(10,300), /*quoteright*/
-N(6,432), /*divide*/
-N(7,210), /*lozenge*/
+N(6,438), /*divide*/
+N(7,245), /*lozenge*/
N(9,495), /*ydieresis*/
N(9,54), /*Ydieresis*/
-N(8,104), /*fraction*/
-N(8,64), /*currency*/
+N(8,112), /*fraction*/
+N(8,72), /*currency*/
N(13,221), /*guilsinglleft*/
N(14,252), /*guilsinglright*/
N(2,38), /*fi*/
@@ -4212,56 +4224,56 @@ N(6,120), /*Iacute*/
N(11,88), /*Icircumflex*/
N(9,18), /*Idieresis*/
N(6,126), /*Igrave*/
-N(6,210), /*Oacute*/
+N(6,216), /*Oacute*/
N(11,154), /*Ocircumflex*/
N(9,90), /*applelogo*/
-N(6,216), /*Ograve*/
-N(6,300), /*Uacute*/
+N(6,222), /*Ograve*/
+N(6,306), /*Uacute*/
N(11,231), /*Ucircumflex*/
-N(6,306), /*Ugrave*/
-N(8,80), /*dotlessi*/
+N(6,312), /*Ugrave*/
+N(8,88), /*dotlessi*/
N(10,160), /*circumflex*/
-N(5,190), /*tilde*/
+N(5,205), /*tilde*/
N(9,351), /*overscore*/
-N(5,80), /*breve*/
+N(5,95), /*breve*/
N(9,198), /*dotaccent*/
-N(4,460), /*ring*/
-N(7,133), /*cedilla*/
+N(4,468), /*ring*/
+N(7,168), /*cedilla*/
N(12,336), /*hungarumlaut*/
-N(6,570), /*ogonek*/
-N(5,85), /*caron*/
+N(6,576), /*ogonek*/
+N(5,100), /*caron*/
N(6,168), /*Lslash*/
-N(6,528), /*lslash*/
-N(6,276), /*Scaron*/
-N(6,630), /*scaron*/
-N(6,354), /*Zcaron*/
-N(6,684), /*zcaron*/
+N(6,534), /*lslash*/
+N(6,282), /*Scaron*/
+N(6,636), /*scaron*/
+N(6,360), /*Zcaron*/
+N(6,690), /*zcaron*/
N(9,153), /*brokenbar*/
N(3,6), /*Eth*/
N(3,264), /*eth*/
-N(6,336), /*Yacute*/
-N(6,672), /*yacute*/
-N(5,45), /*Thorn*/
-N(5,180), /*thorn*/
-N(5,140), /*minus*/
-N(8,136), /*multiply*/
+N(6,342), /*Yacute*/
+N(6,678), /*yacute*/
+N(5,60), /*Thorn*/
+N(5,195), /*thorn*/
+N(5,155), /*minus*/
+N(8,144), /*multiply*/
N(11,462), /*onesuperior*/
N(11,605), /*twosuperior*/
N(13,377), /*threesuperior*/
-N(7,238), /*onehalf*/
+N(7,273), /*onehalf*/
N(10,280), /*onequarter*/
N(13,364), /*threequarters*/
-N(5,115), /*franc*/
+N(5,130), /*franc*/
N(6,102), /*Gbreve*/
-N(6,486), /*gbreve*/
+N(6,492), /*gbreve*/
N(10,60), /*Idotaccent*/
N(8,32), /*Scedilla*/
-N(8,176), /*scedilla*/
+N(8,184), /*scedilla*/
N(6,36), /*Cacute*/
-N(6,396), /*cacute*/
+N(6,402), /*cacute*/
N(6,42), /*Ccaron*/
-N(6,402), /*ccaron*/
-N(7,147), /*dmacron*/
+N(6,408), /*ccaron*/
+N(7,182), /*dmacron*/
0};
static const ushort gs_c_known_encoding_reverse_7[] = {
36, /* N(1,0): A*/
@@ -4333,194 +4345,194 @@ static const ushort gs_c_known_encoding_reverse_7[] = {
85, /* N(1,43): r*/
86, /* N(1,44): s*/
87, /* N(1,45): t*/
-237, /* N(5,45): Thorn*/
104, /* N(9,45): Udieresis*/
88, /* N(1,46): u*/
177, /* N(2,46): oe*/
89, /* N(1,47): v*/
90, /* N(1,48): w*/
155, /* N(2,48): pi*/
-13, /* N(8,48): asterisk*/
91, /* N(1,49): x*/
92, /* N(1,50): y*/
93, /* N(1,51): z*/
187, /* N(9,54): Ydieresis*/
-141, /* N(5,55): acute*/
200, /* N(11,55): Ecircumflex*/
-111, /* N(8,56): ccedilla*/
+13, /* N(8,56): asterisk*/
+237, /* N(5,60): Thorn*/
250, /* N(10,60): Idotaccent*/
108, /* N(9,63): adieresis*/
-189, /* N(8,64): currency*/
+111, /* N(8,64): ccedilla*/
+141, /* N(5,70): acute*/
101, /* N(6,72): Eacute*/
-142, /* N(8,72): dieresis*/
+189, /* N(8,72): currency*/
9, /* N(9,72): ampersand*/
-110, /* N(5,75): aring*/
-219, /* N(5,80): breve*/
-215, /* N(8,80): dotlessi*/
+142, /* N(8,80): dieresis*/
203, /* N(6,84): Egrave*/
-225, /* N(5,85): caron*/
-171, /* N(8,88): ellipsis*/
+215, /* N(8,88): dotlessi*/
205, /* N(11,88): Icircumflex*/
-29, /* N(5,90): colon*/
+110, /* N(5,90): aring*/
210, /* N(9,90): applelogo*/
-15, /* N(5,95): comma*/
+219, /* N(5,95): breve*/
+171, /* N(8,96): ellipsis*/
+225, /* N(5,100): caron*/
248, /* N(6,102): Gbreve*/
-188, /* N(8,104): fraction*/
-27, /* N(5,105): eight*/
-32, /* N(5,110): equal*/
-247, /* N(5,115): franc*/
+29, /* N(5,105): colon*/
+15, /* N(5,110): comma*/
+188, /* N(8,112): fraction*/
+27, /* N(5,120): eight*/
204, /* N(6,120): Iacute*/
-146, /* N(8,120): infinity*/
-67, /* N(5,125): grave*/
+32, /* N(5,125): equal*/
207, /* N(6,126): Igrave*/
-156, /* N(8,128): integral*/
+146, /* N(8,128): infinity*/
+247, /* N(5,130): franc*/
97, /* N(10,130): asciitilde*/
-222, /* N(7,133): cedilla*/
63, /* N(9,135): backslash*/
-240, /* N(8,136): multiply*/
-239, /* N(5,140): minus*/
+156, /* N(8,136): integral*/
+67, /* N(5,140): grave*/
96, /* N(10,140): braceright*/
-143, /* N(8,144): notequal*/
+240, /* N(8,144): multiply*/
94, /* N(9,144): braceleft*/
-257, /* N(7,147): dmacron*/
-26, /* N(5,150): seven*/
+143, /* N(8,152): notequal*/
232, /* N(9,153): brokenbar*/
209, /* N(11,154): Ocircumflex*/
-18, /* N(5,160): slash*/
-34, /* N(8,160): question*/
+239, /* N(5,155): minus*/
216, /* N(10,160): circumflex*/
-3, /* N(5,165): space*/
+26, /* N(5,165): seven*/
226, /* N(6,168): Lslash*/
-5, /* N(8,168): quotedbl*/
-252, /* N(8,176): scedilla*/
-238, /* N(5,180): thorn*/
+222, /* N(7,168): cedilla*/
+34, /* N(8,168): question*/
+18, /* N(5,175): slash*/
+5, /* N(8,176): quotedbl*/
+3, /* N(5,180): space*/
139, /* N(9,180): copyright*/
163, /* N(10,180): exclamdown*/
-133, /* N(8,184): sterling*/
-22, /* N(5,185): three*/
-33, /* N(7,189): greater*/
+257, /* N(7,182): dmacron*/
+252, /* N(8,184): scedilla*/
194, /* N(9,189): daggerdbl*/
-217, /* N(5,190): tilde*/
+133, /* N(8,192): sterling*/
64, /* N(12,192): bracketright*/
+238, /* N(5,195): thorn*/
220, /* N(9,198): dotaccent*/
+22, /* N(5,200): three*/
137, /* N(10,200): germandbls*/
-102, /* N(6,204): Ntilde*/
+217, /* N(5,205): tilde*/
169, /* N(13,208): guillemotleft*/
-208, /* N(6,210): Oacute*/
-185, /* N(7,210): lozenge*/
-211, /* N(6,216): Ograve*/
+102, /* N(6,210): Ntilde*/
+208, /* N(6,216): Oacute*/
115, /* N(9,216): edieresis*/
-172, /* N(7,217): nbspace*/
190, /* N(13,221): guilsinglleft*/
-145, /* N(6,222): Oslash*/
+211, /* N(6,222): Ograve*/
+33, /* N(7,224): greater*/
+145, /* N(6,228): Oslash*/
213, /* N(11,231): Ucircumflex*/
-175, /* N(6,234): Otilde*/
119, /* N(9,234): idieresis*/
-244, /* N(7,238): onehalf*/
170, /* N(14,238): guillemotright*/
+175, /* N(6,240): Otilde*/
168, /* N(9,243): increment*/
-8, /* N(7,245): percent*/
+185, /* N(7,245): lozenge*/
164, /* N(10,250): logicalnot*/
-154, /* N(7,252): product*/
+172, /* N(7,252): nbspace*/
191, /* N(14,252): guilsinglright*/
95, /* N(3,255): bar*/
-165, /* N(7,259): radical*/
148, /* N(9,261): lessequal*/
234, /* N(3,264): eth*/
-134, /* N(7,266): section*/
6, /* N(10,270): numbersign*/
151, /* N(3,273): mu1*/
+244, /* N(7,273): onehalf*/
181, /* N(13,273): quotedblright*/
107, /* N(11,275): acircumflex*/
20, /* N(3,276): one*/
-228, /* N(6,276): Scaron*/
+8, /* N(7,280): percent*/
245, /* N(10,280): onequarter*/
+228, /* N(6,282): Scaron*/
167, /* N(11,286): approxequal*/
+154, /* N(7,287): product*/
25, /* N(3,288): six*/
12, /* N(10,290): parenright*/
21, /* N(3,294): two*/
+165, /* N(7,294): radical*/
150, /* N(3,297): yen*/
-212, /* N(6,300): Uacute*/
183, /* N(10,300): quoteright*/
-214, /* N(6,306): Ugrave*/
+134, /* N(7,301): section*/
+212, /* N(6,306): Uacute*/
65, /* N(11,308): asciicircum*/
195, /* N(14,308): periodcentered*/
138, /* N(10,310): registered*/
+214, /* N(6,312): Ugrave*/
124, /* N(9,315): odieresis*/
66, /* N(10,320): underscore*/
149, /* N(12,324): greaterequal*/
-235, /* N(6,336): Yacute*/
223, /* N(12,336): hungarumlaut*/
62, /* N(11,341): bracketleft*/
+235, /* N(6,342): Yacute*/
218, /* N(9,351): overscore*/
-230, /* N(6,354): Zcaron*/
+230, /* N(6,360): Zcaron*/
136, /* N(9,360): paragraph*/
114, /* N(11,363): ecircumflex*/
246, /* N(13,364): threequarters*/
196, /* N(14,364): quotesinglbase*/
-105, /* N(6,366): aacute*/
11, /* N(9,369): parenleft*/
+105, /* N(6,372): aacute*/
243, /* N(13,377): threesuperior*/
-106, /* N(6,378): agrave*/
147, /* N(9,378): plusminus*/
-109, /* N(6,384): atilde*/
+106, /* N(6,384): agrave*/
182, /* N(9,387): quoteleft*/
-135, /* N(6,390): bullet*/
-254, /* N(6,396): cacute*/
-256, /* N(6,402): ccaron*/
-130, /* N(6,408): dagger*/
+109, /* N(6,390): atilde*/
+135, /* N(6,396): bullet*/
+254, /* N(6,402): cacute*/
+256, /* N(6,408): ccaron*/
+130, /* N(6,414): dagger*/
30, /* N(9,414): semicolon*/
118, /* N(11,418): icircumflex*/
-132, /* N(4,424): cent*/
-131, /* N(6,426): degree*/
123, /* N(11,429): ocircumflex*/
-24, /* N(4,432): five*/
-184, /* N(6,432): divide*/
+132, /* N(4,432): cent*/
+131, /* N(6,432): degree*/
153, /* N(9,432): summation*/
158, /* N(12,432): ordmasculine*/
-23, /* N(4,436): four*/
-7, /* N(6,438): dollar*/
-31, /* N(4,444): less*/
-112, /* N(6,444): eacute*/
-28, /* N(4,448): nine*/
+184, /* N(6,438): divide*/
+24, /* N(4,440): five*/
+23, /* N(4,444): four*/
+7, /* N(6,444): dollar*/
+112, /* N(6,450): eacute*/
140, /* N(9,450): trademark*/
-14, /* N(4,456): plus*/
-113, /* N(6,456): egrave*/
-221, /* N(4,460): ring*/
-179, /* N(6,462): emdash*/
+31, /* N(4,452): less*/
+28, /* N(4,456): nine*/
+113, /* N(6,462): egrave*/
241, /* N(11,462): onesuperior*/
-19, /* N(4,464): zero*/
-178, /* N(6,468): endash*/
+14, /* N(4,464): plus*/
+221, /* N(4,468): ring*/
+179, /* N(6,468): emdash*/
+19, /* N(4,472): zero*/
157, /* N(11,473): ordfeminine*/
-4, /* N(6,474): exclam*/
+178, /* N(6,474): endash*/
129, /* N(9,477): udieresis*/
-166, /* N(6,480): florin*/
-249, /* N(6,486): gbreve*/
-16, /* N(6,492): hyphen*/
+4, /* N(6,480): exclam*/
+166, /* N(6,486): florin*/
+249, /* N(6,492): gbreve*/
186, /* N(9,495): ydieresis*/
-116, /* N(6,498): iacute*/
-117, /* N(6,504): igrave*/
+16, /* N(6,498): hyphen*/
+116, /* N(6,504): iacute*/
162, /* N(12,504): questiondown*/
+117, /* N(6,510): igrave*/
197, /* N(12,516): quotedblbase*/
152, /* N(11,517): partialdiff*/
-227, /* N(6,528): lslash*/
198, /* N(11,528): perthousand*/
180, /* N(12,528): quotedblleft*/
+227, /* N(6,534): lslash*/
10, /* N(11,539): quotesingle*/
-120, /* N(6,558): ntilde*/
-121, /* N(6,564): oacute*/
-224, /* N(6,570): ogonek*/
-122, /* N(6,576): ograve*/
-161, /* N(6,588): oslash*/
-125, /* N(6,594): otilde*/
-17, /* N(6,600): period*/
+120, /* N(6,564): ntilde*/
+121, /* N(6,570): oacute*/
+224, /* N(6,576): ogonek*/
+122, /* N(6,582): ograve*/
+161, /* N(6,594): oslash*/
+125, /* N(6,600): otilde*/
242, /* N(11,605): twosuperior*/
+17, /* N(6,606): period*/
128, /* N(11,616): ucircumflex*/
-229, /* N(6,630): scaron*/
-126, /* N(6,660): uacute*/
-127, /* N(6,666): ugrave*/
-236, /* N(6,672): yacute*/
-231, /* N(6,684): zcaron*/
+229, /* N(6,636): scaron*/
+126, /* N(6,666): uacute*/
+127, /* N(6,672): ugrave*/
+236, /* N(6,678): yacute*/
+231, /* N(6,690): zcaron*/
0};
/* AdobeLatinOriginalGlyphEncoding */
@@ -4558,49 +4570,49 @@ N(1,11), /*L*/
N(6,168), /*Lslash*/
N(1,12), /*M*/
N(1,13), /*N*/
-N(6,204), /*Ntilde*/
+N(6,210), /*Ntilde*/
N(1,14), /*O*/
N(2,8), /*OE*/
-N(6,210), /*Oacute*/
+N(6,216), /*Oacute*/
N(11,154), /*Ocircumflex*/
N(9,27), /*Odieresis*/
-N(6,216), /*Ograve*/
-N(6,222), /*Oslash*/
-N(6,234), /*Otilde*/
+N(6,222), /*Ograve*/
+N(6,228), /*Oslash*/
+N(6,240), /*Otilde*/
N(1,15), /*P*/
N(1,16), /*Q*/
N(1,17), /*R*/
N(1,18), /*S*/
-N(6,276), /*Scaron*/
+N(6,282), /*Scaron*/
N(1,19), /*T*/
-N(5,45), /*Thorn*/
+N(5,60), /*Thorn*/
N(1,20), /*U*/
-N(6,300), /*Uacute*/
+N(6,306), /*Uacute*/
N(11,231), /*Ucircumflex*/
N(9,45), /*Udieresis*/
-N(6,306), /*Ugrave*/
+N(6,312), /*Ugrave*/
N(1,21), /*V*/
N(1,22), /*W*/
N(1,23), /*X*/
N(1,24), /*Y*/
-N(6,336), /*Yacute*/
+N(6,342), /*Yacute*/
N(9,54), /*Ydieresis*/
N(1,25), /*Z*/
-N(6,354), /*Zcaron*/
+N(6,360), /*Zcaron*/
N(1,26), /*a*/
-N(6,366), /*aacute*/
+N(6,372), /*aacute*/
N(11,275), /*acircumflex*/
-N(5,55), /*acute*/
+N(5,70), /*acute*/
N(9,63), /*adieresis*/
N(2,32), /*ae*/
-N(6,378), /*agrave*/
+N(6,384), /*agrave*/
N(9,72), /*ampersand*/
-N(5,75), /*aring*/
+N(5,90), /*aring*/
N(11,308), /*asciicircum*/
N(10,130), /*asciitilde*/
-N(8,48), /*asterisk*/
+N(8,56), /*asterisk*/
N(2,34), /*at*/
-N(6,384), /*atilde*/
+N(6,390), /*atilde*/
N(1,27), /*b*/
N(9,135), /*backslash*/
N(3,255), /*bar*/
@@ -4608,108 +4620,108 @@ N(9,144), /*braceleft*/
N(10,140), /*braceright*/
N(11,341), /*bracketleft*/
N(12,192), /*bracketright*/
-N(5,80), /*breve*/
+N(5,95), /*breve*/
N(9,153), /*brokenbar*/
-N(6,390), /*bullet*/
+N(6,396), /*bullet*/
N(1,28), /*c*/
-N(5,85), /*caron*/
-N(8,56), /*ccedilla*/
-N(7,133), /*cedilla*/
-N(4,424), /*cent*/
+N(5,100), /*caron*/
+N(8,64), /*ccedilla*/
+N(7,168), /*cedilla*/
+N(4,432), /*cent*/
N(10,160), /*circumflex*/
-N(5,90), /*colon*/
-N(5,95), /*comma*/
+N(5,105), /*colon*/
+N(5,110), /*comma*/
N(9,180), /*copyright*/
-N(8,64), /*currency*/
+N(8,72), /*currency*/
N(1,29), /*d*/
-N(6,408), /*dagger*/
+N(6,414), /*dagger*/
N(9,189), /*daggerdbl*/
-N(6,426), /*degree*/
-N(8,72), /*dieresis*/
-N(6,432), /*divide*/
-N(6,438), /*dollar*/
+N(6,432), /*degree*/
+N(8,80), /*dieresis*/
+N(6,438), /*divide*/
+N(6,444), /*dollar*/
N(9,198), /*dotaccent*/
-N(8,80), /*dotlessi*/
+N(8,88), /*dotlessi*/
N(1,30), /*e*/
-N(6,444), /*eacute*/
+N(6,450), /*eacute*/
N(11,363), /*ecircumflex*/
N(9,216), /*edieresis*/
-N(6,456), /*egrave*/
-N(5,105), /*eight*/
-N(8,88), /*ellipsis*/
-N(6,462), /*emdash*/
-N(6,468), /*endash*/
-N(5,110), /*equal*/
+N(6,462), /*egrave*/
+N(5,120), /*eight*/
+N(8,96), /*ellipsis*/
+N(6,468), /*emdash*/
+N(6,474), /*endash*/
+N(5,125), /*equal*/
N(3,264), /*eth*/
-N(6,474), /*exclam*/
+N(6,480), /*exclam*/
N(10,180), /*exclamdown*/
N(1,31), /*f*/
N(2,38), /*fi*/
-N(4,432), /*five*/
+N(4,440), /*five*/
N(2,40), /*fl*/
-N(6,480), /*florin*/
-N(4,436), /*four*/
-N(8,104), /*fraction*/
+N(6,486), /*florin*/
+N(4,444), /*four*/
+N(8,112), /*fraction*/
N(1,32), /*g*/
N(10,200), /*germandbls*/
-N(5,125), /*grave*/
-N(7,189), /*greater*/
+N(5,140), /*grave*/
+N(7,224), /*greater*/
N(13,208), /*guillemotleft*/
N(14,238), /*guillemotright*/
N(13,221), /*guilsinglleft*/
N(14,252), /*guilsinglright*/
N(1,33), /*h*/
N(12,336), /*hungarumlaut*/
-N(6,492), /*hyphen*/
+N(6,498), /*hyphen*/
N(1,34), /*i*/
-N(6,498), /*iacute*/
+N(6,504), /*iacute*/
N(11,418), /*icircumflex*/
N(9,234), /*idieresis*/
-N(6,504), /*igrave*/
+N(6,510), /*igrave*/
N(1,35), /*j*/
N(1,36), /*k*/
N(1,37), /*l*/
-N(4,444), /*less*/
+N(4,452), /*less*/
N(10,250), /*logicalnot*/
-N(6,528), /*lslash*/
+N(6,534), /*lslash*/
N(1,38), /*m*/
-N(6,534), /*macron*/
-N(5,140), /*minus*/
+N(6,540), /*macron*/
+N(5,155), /*minus*/
N(2,42), /*mu*/
-N(8,136), /*multiply*/
+N(8,144), /*multiply*/
N(1,39), /*n*/
-N(4,448), /*nine*/
-N(6,558), /*ntilde*/
+N(4,456), /*nine*/
+N(6,564), /*ntilde*/
N(10,270), /*numbersign*/
N(1,40), /*o*/
-N(6,564), /*oacute*/
+N(6,570), /*oacute*/
N(11,429), /*ocircumflex*/
N(9,315), /*odieresis*/
N(2,46), /*oe*/
-N(6,570), /*ogonek*/
-N(6,576), /*ograve*/
+N(6,576), /*ogonek*/
+N(6,582), /*ograve*/
N(3,276), /*one*/
-N(7,238), /*onehalf*/
+N(7,273), /*onehalf*/
N(10,280), /*onequarter*/
N(11,462), /*onesuperior*/
N(11,473), /*ordfeminine*/
N(12,432), /*ordmasculine*/
-N(6,588), /*oslash*/
-N(6,594), /*otilde*/
+N(6,594), /*oslash*/
+N(6,600), /*otilde*/
N(1,41), /*p*/
N(9,360), /*paragraph*/
N(9,369), /*parenleft*/
N(10,290), /*parenright*/
-N(7,245), /*percent*/
-N(6,600), /*period*/
+N(7,280), /*percent*/
+N(6,606), /*period*/
N(14,308), /*periodcentered*/
N(11,528), /*perthousand*/
-N(4,456), /*plus*/
+N(4,464), /*plus*/
N(9,378), /*plusminus*/
N(1,42), /*q*/
-N(8,160), /*question*/
+N(8,168), /*question*/
N(12,504), /*questiondown*/
-N(8,168), /*quotedbl*/
+N(8,176), /*quotedbl*/
N(12,516), /*quotedblbase*/
N(12,528), /*quotedblleft*/
N(13,273), /*quotedblright*/
@@ -4719,41 +4731,41 @@ N(14,364), /*quotesinglbase*/
N(11,539), /*quotesingle*/
N(1,43), /*r*/
N(10,310), /*registered*/
-N(4,460), /*ring*/
+N(4,468), /*ring*/
N(1,44), /*s*/
-N(6,630), /*scaron*/
-N(7,266), /*section*/
+N(6,636), /*scaron*/
+N(7,301), /*section*/
N(9,414), /*semicolon*/
-N(5,150), /*seven*/
+N(5,165), /*seven*/
N(3,288), /*six*/
-N(5,160), /*slash*/
-N(5,165), /*space*/
-N(8,184), /*sterling*/
+N(5,175), /*slash*/
+N(5,180), /*space*/
+N(8,192), /*sterling*/
N(1,45), /*t*/
-N(5,180), /*thorn*/
-N(5,185), /*three*/
+N(5,195), /*thorn*/
+N(5,200), /*three*/
N(13,364), /*threequarters*/
N(13,377), /*threesuperior*/
-N(5,190), /*tilde*/
+N(5,205), /*tilde*/
N(9,450), /*trademark*/
N(3,294), /*two*/
N(11,605), /*twosuperior*/
N(1,46), /*u*/
-N(6,660), /*uacute*/
+N(6,666), /*uacute*/
N(11,616), /*ucircumflex*/
N(9,477), /*udieresis*/
-N(6,666), /*ugrave*/
+N(6,672), /*ugrave*/
N(10,320), /*underscore*/
N(1,47), /*v*/
N(1,48), /*w*/
N(1,49), /*x*/
N(1,50), /*y*/
-N(6,672), /*yacute*/
+N(6,678), /*yacute*/
N(9,495), /*ydieresis*/
N(3,297), /*yen*/
N(1,51), /*z*/
-N(6,684), /*zcaron*/
-N(4,464), /*zero*/
+N(6,690), /*zcaron*/
+N(4,472), /*zero*/
0};
static const ushort gs_c_known_encoding_reverse_8[] = {
1, /* N(1,0): A*/
@@ -4820,385 +4832,385 @@ static const ushort gs_c_known_encoding_reverse_8[] = {
192, /* N(1,43): r*/
195, /* N(1,44): s*/
204, /* N(1,45): t*/
-48, /* N(5,45): Thorn*/
52, /* N(9,45): Udieresis*/
213, /* N(1,46): u*/
160, /* N(2,46): oe*/
219, /* N(1,47): v*/
220, /* N(1,48): w*/
-73, /* N(8,48): asterisk*/
221, /* N(1,49): x*/
222, /* N(1,50): y*/
226, /* N(1,51): z*/
59, /* N(9,54): Ydieresis*/
-65, /* N(5,55): acute*/
15, /* N(11,55): Ecircumflex*/
-88, /* N(8,56): ccedilla*/
+73, /* N(8,56): asterisk*/
+48, /* N(5,60): Thorn*/
66, /* N(9,63): adieresis*/
-95, /* N(8,64): currency*/
+88, /* N(8,64): ccedilla*/
+65, /* N(5,70): acute*/
14, /* N(6,72): Eacute*/
-100, /* N(8,72): dieresis*/
+95, /* N(8,72): currency*/
69, /* N(9,72): ampersand*/
-70, /* N(5,75): aring*/
-83, /* N(5,80): breve*/
-104, /* N(8,80): dotlessi*/
+100, /* N(8,80): dieresis*/
17, /* N(6,84): Egrave*/
-87, /* N(5,85): caron*/
-111, /* N(8,88): ellipsis*/
+104, /* N(8,88): dotlessi*/
24, /* N(11,88): Icircumflex*/
-92, /* N(5,90): colon*/
-93, /* N(5,95): comma*/
-124, /* N(8,104): fraction*/
-110, /* N(5,105): eight*/
-114, /* N(5,110): equal*/
+70, /* N(5,90): aring*/
+83, /* N(5,95): breve*/
+111, /* N(8,96): ellipsis*/
+87, /* N(5,100): caron*/
+92, /* N(5,105): colon*/
+93, /* N(5,110): comma*/
+124, /* N(8,112): fraction*/
+110, /* N(5,120): eight*/
23, /* N(6,120): Iacute*/
-127, /* N(5,125): grave*/
+114, /* N(5,125): equal*/
26, /* N(6,126): Igrave*/
72, /* N(10,130): asciitilde*/
-89, /* N(7,133): cedilla*/
77, /* N(9,135): backslash*/
-151, /* N(8,136): multiply*/
-149, /* N(5,140): minus*/
+127, /* N(5,140): grave*/
80, /* N(10,140): braceright*/
+151, /* N(8,144): multiply*/
79, /* N(9,144): braceleft*/
-199, /* N(5,150): seven*/
84, /* N(9,153): brokenbar*/
37, /* N(11,154): Ocircumflex*/
-201, /* N(5,160): slash*/
-182, /* N(8,160): question*/
+149, /* N(5,155): minus*/
91, /* N(10,160): circumflex*/
-202, /* N(5,165): space*/
+199, /* N(5,165): seven*/
30, /* N(6,168): Lslash*/
-184, /* N(8,168): quotedbl*/
-205, /* N(5,180): thorn*/
+89, /* N(7,168): cedilla*/
+182, /* N(8,168): question*/
+201, /* N(5,175): slash*/
+184, /* N(8,176): quotedbl*/
+202, /* N(5,180): space*/
94, /* N(9,180): copyright*/
117, /* N(10,180): exclamdown*/
-203, /* N(8,184): sterling*/
-206, /* N(5,185): three*/
-128, /* N(7,189): greater*/
98, /* N(9,189): daggerdbl*/
-209, /* N(5,190): tilde*/
+203, /* N(8,192): sterling*/
82, /* N(12,192): bracketright*/
+205, /* N(5,195): thorn*/
103, /* N(9,198): dotaccent*/
+206, /* N(5,200): three*/
126, /* N(10,200): germandbls*/
-33, /* N(6,204): Ntilde*/
+209, /* N(5,205): tilde*/
129, /* N(13,208): guillemotleft*/
-36, /* N(6,210): Oacute*/
-39, /* N(6,216): Ograve*/
+33, /* N(6,210): Ntilde*/
+36, /* N(6,216): Oacute*/
108, /* N(9,216): edieresis*/
131, /* N(13,221): guilsinglleft*/
-40, /* N(6,222): Oslash*/
+39, /* N(6,222): Ograve*/
+128, /* N(7,224): greater*/
+40, /* N(6,228): Oslash*/
51, /* N(11,231): Ucircumflex*/
-41, /* N(6,234): Otilde*/
139, /* N(9,234): idieresis*/
-164, /* N(7,238): onehalf*/
130, /* N(14,238): guillemotright*/
-175, /* N(7,245): percent*/
+41, /* N(6,240): Otilde*/
145, /* N(10,250): logicalnot*/
132, /* N(14,252): guilsinglright*/
78, /* N(3,255): bar*/
115, /* N(3,264): eth*/
-197, /* N(7,266): section*/
155, /* N(10,270): numbersign*/
+164, /* N(7,273): onehalf*/
187, /* N(13,273): quotedblright*/
64, /* N(11,275): acircumflex*/
163, /* N(3,276): one*/
-46, /* N(6,276): Scaron*/
+175, /* N(7,280): percent*/
165, /* N(10,280): onequarter*/
+46, /* N(6,282): Scaron*/
200, /* N(3,288): six*/
174, /* N(10,290): parenright*/
211, /* N(3,294): two*/
225, /* N(3,297): yen*/
-50, /* N(6,300): Uacute*/
189, /* N(10,300): quoteright*/
-53, /* N(6,306): Ugrave*/
+197, /* N(7,301): section*/
+50, /* N(6,306): Uacute*/
71, /* N(11,308): asciicircum*/
177, /* N(14,308): periodcentered*/
193, /* N(10,310): registered*/
+53, /* N(6,312): Ugrave*/
159, /* N(9,315): odieresis*/
218, /* N(10,320): underscore*/
-58, /* N(6,336): Yacute*/
134, /* N(12,336): hungarumlaut*/
81, /* N(11,341): bracketleft*/
-61, /* N(6,354): Zcaron*/
+58, /* N(6,342): Yacute*/
+61, /* N(6,360): Zcaron*/
172, /* N(9,360): paragraph*/
107, /* N(11,363): ecircumflex*/
207, /* N(13,364): threequarters*/
190, /* N(14,364): quotesinglbase*/
-63, /* N(6,366): aacute*/
173, /* N(9,369): parenleft*/
+63, /* N(6,372): aacute*/
208, /* N(13,377): threesuperior*/
-68, /* N(6,378): agrave*/
180, /* N(9,378): plusminus*/
-75, /* N(6,384): atilde*/
+68, /* N(6,384): agrave*/
188, /* N(9,387): quoteleft*/
-85, /* N(6,390): bullet*/
-97, /* N(6,408): dagger*/
+75, /* N(6,390): atilde*/
+85, /* N(6,396): bullet*/
+97, /* N(6,414): dagger*/
198, /* N(9,414): semicolon*/
138, /* N(11,418): icircumflex*/
-90, /* N(4,424): cent*/
-99, /* N(6,426): degree*/
158, /* N(11,429): ocircumflex*/
-120, /* N(4,432): five*/
-101, /* N(6,432): divide*/
+90, /* N(4,432): cent*/
+99, /* N(6,432): degree*/
168, /* N(12,432): ordmasculine*/
-123, /* N(4,436): four*/
-102, /* N(6,438): dollar*/
-144, /* N(4,444): less*/
-106, /* N(6,444): eacute*/
-153, /* N(4,448): nine*/
+101, /* N(6,438): divide*/
+120, /* N(4,440): five*/
+123, /* N(4,444): four*/
+102, /* N(6,444): dollar*/
+106, /* N(6,450): eacute*/
210, /* N(9,450): trademark*/
-179, /* N(4,456): plus*/
-109, /* N(6,456): egrave*/
-194, /* N(4,460): ring*/
-112, /* N(6,462): emdash*/
+144, /* N(4,452): less*/
+153, /* N(4,456): nine*/
+109, /* N(6,462): egrave*/
166, /* N(11,462): onesuperior*/
-228, /* N(4,464): zero*/
-113, /* N(6,468): endash*/
+179, /* N(4,464): plus*/
+194, /* N(4,468): ring*/
+112, /* N(6,468): emdash*/
+228, /* N(4,472): zero*/
167, /* N(11,473): ordfeminine*/
-116, /* N(6,474): exclam*/
+113, /* N(6,474): endash*/
216, /* N(9,477): udieresis*/
-122, /* N(6,480): florin*/
-135, /* N(6,492): hyphen*/
+116, /* N(6,480): exclam*/
+122, /* N(6,486): florin*/
224, /* N(9,495): ydieresis*/
-137, /* N(6,498): iacute*/
-140, /* N(6,504): igrave*/
+135, /* N(6,498): hyphen*/
+137, /* N(6,504): iacute*/
183, /* N(12,504): questiondown*/
+140, /* N(6,510): igrave*/
185, /* N(12,516): quotedblbase*/
-146, /* N(6,528): lslash*/
178, /* N(11,528): perthousand*/
186, /* N(12,528): quotedblleft*/
-148, /* N(6,534): macron*/
+146, /* N(6,534): lslash*/
191, /* N(11,539): quotesingle*/
-154, /* N(6,558): ntilde*/
-157, /* N(6,564): oacute*/
-161, /* N(6,570): ogonek*/
-162, /* N(6,576): ograve*/
-169, /* N(6,588): oslash*/
-170, /* N(6,594): otilde*/
-176, /* N(6,600): period*/
+148, /* N(6,540): macron*/
+154, /* N(6,564): ntilde*/
+157, /* N(6,570): oacute*/
+161, /* N(6,576): ogonek*/
+162, /* N(6,582): ograve*/
+169, /* N(6,594): oslash*/
+170, /* N(6,600): otilde*/
212, /* N(11,605): twosuperior*/
+176, /* N(6,606): period*/
215, /* N(11,616): ucircumflex*/
-196, /* N(6,630): scaron*/
-214, /* N(6,660): uacute*/
-217, /* N(6,666): ugrave*/
-223, /* N(6,672): yacute*/
-227, /* N(6,684): zcaron*/
+196, /* N(6,636): scaron*/
+214, /* N(6,666): uacute*/
+217, /* N(6,672): ugrave*/
+223, /* N(6,678): yacute*/
+227, /* N(6,690): zcaron*/
0};
/* AdobeLatinExtensionGlyphEncoding */
static const ushort gs_c_known_encoding_9[] = {
N(6,6), /*Abreve*/
-N(7,14), /*Amacron*/
-N(7,21), /*Aogonek*/
+N(7,42), /*Amacron*/
+N(7,49), /*Aogonek*/
N(6,36), /*Cacute*/
N(6,42), /*Ccaron*/
N(6,54), /*Dcaron*/
N(6,60), /*Dcroat*/
-N(5,15), /*Delta*/
+N(5,20), /*Delta*/
N(6,78), /*Ecaron*/
N(10,40), /*Edotaccent*/
-N(7,28), /*Emacron*/
-N(7,35), /*Eogonek*/
+N(7,56), /*Emacron*/
+N(7,63), /*Eogonek*/
N(6,102), /*Gbreve*/
N(12,12), /*Gcommaaccent*/
N(10,60), /*Idotaccent*/
-N(7,49), /*Imacron*/
-N(7,56), /*Iogonek*/
+N(7,77), /*Imacron*/
+N(7,84), /*Iogonek*/
N(12,24), /*Kcommaaccent*/
N(6,150), /*Lacute*/
N(6,162), /*Lcaron*/
N(12,36), /*Lcommaaccent*/
-N(6,186), /*Nacute*/
-N(6,192), /*Ncaron*/
+N(6,192), /*Nacute*/
+N(6,198), /*Ncaron*/
N(12,48), /*Ncommaaccent*/
N(13,26), /*Ohungarumlaut*/
-N(7,70), /*Omacron*/
-N(6,252), /*Racute*/
-N(6,258), /*Rcaron*/
+N(7,98), /*Omacron*/
+N(6,258), /*Racute*/
+N(6,264), /*Rcaron*/
N(12,60), /*Rcommaaccent*/
-N(6,270), /*Sacute*/
+N(6,276), /*Sacute*/
N(8,32), /*Scedilla*/
N(12,72), /*Scommaaccent*/
-N(6,288), /*Tcaron*/
+N(6,294), /*Tcaron*/
N(12,84), /*Tcommaaccent*/
N(13,39), /*Uhungarumlaut*/
-N(7,84), /*Umacron*/
-N(7,91), /*Uogonek*/
-N(5,50), /*Uring*/
-N(6,348), /*Zacute*/
+N(7,119), /*Umacron*/
+N(7,126), /*Uogonek*/
+N(5,65), /*Uring*/
+N(6,354), /*Zacute*/
N(10,90), /*Zdotaccent*/
-N(6,372), /*abreve*/
-N(7,105), /*amacron*/
-N(7,112), /*aogonek*/
-N(6,396), /*cacute*/
-N(6,402), /*ccaron*/
+N(6,378), /*abreve*/
+N(7,140), /*amacron*/
+N(7,147), /*aogonek*/
+N(6,402), /*cacute*/
+N(6,408), /*ccaron*/
N(11,352), /*commaaccent*/
-N(6,414), /*dcaron*/
-N(6,420), /*dcroat*/
-N(6,450), /*ecaron*/
+N(6,420), /*dcaron*/
+N(6,426), /*dcroat*/
+N(6,456), /*ecaron*/
N(10,170), /*edotaccent*/
-N(7,168), /*emacron*/
-N(7,175), /*eogonek*/
-N(6,486), /*gbreve*/
+N(7,203), /*emacron*/
+N(7,210), /*eogonek*/
+N(6,492), /*gbreve*/
N(12,312), /*gcommaaccent*/
N(12,324), /*greaterequal*/
-N(7,196), /*imacron*/
-N(7,203), /*iogonek*/
+N(7,231), /*imacron*/
+N(7,238), /*iogonek*/
N(12,360), /*kcommaaccent*/
-N(6,510), /*lacute*/
-N(6,522), /*lcaron*/
+N(6,516), /*lacute*/
+N(6,528), /*lcaron*/
N(12,372), /*lcommaaccent*/
N(9,261), /*lessequal*/
-N(7,210), /*lozenge*/
-N(6,546), /*nacute*/
-N(6,552), /*ncaron*/
+N(7,245), /*lozenge*/
+N(6,552), /*nacute*/
+N(6,558), /*ncaron*/
N(12,384), /*ncommaaccent*/
-N(8,144), /*notequal*/
+N(8,152), /*notequal*/
N(13,234), /*ohungarumlaut*/
-N(7,224), /*omacron*/
+N(7,259), /*omacron*/
N(11,517), /*partialdiff*/
-N(6,606), /*racute*/
-N(7,259), /*radical*/
-N(6,612), /*rcaron*/
+N(6,612), /*racute*/
+N(7,294), /*radical*/
+N(6,618), /*rcaron*/
N(12,540), /*rcommaaccent*/
-N(6,624), /*sacute*/
-N(8,176), /*scedilla*/
+N(6,630), /*sacute*/
+N(8,184), /*scedilla*/
N(12,576), /*scommaaccent*/
N(9,432), /*summation*/
-N(6,648), /*tcaron*/
+N(6,654), /*tcaron*/
N(12,600), /*tcommaaccent*/
N(13,403), /*uhungarumlaut*/
-N(7,280), /*umacron*/
-N(7,287), /*uogonek*/
-N(5,200), /*uring*/
-N(6,678), /*zacute*/
+N(7,315), /*umacron*/
+N(7,322), /*uogonek*/
+N(5,215), /*uring*/
+N(6,684), /*zacute*/
N(10,330), /*zdotaccent*/
0};
static const ushort gs_c_known_encoding_reverse_9[] = {
0, /* N(6,6): Abreve*/
13, /* N(12,12): Gcommaaccent*/
-1, /* N(7,14): Amacron*/
-7, /* N(5,15): Delta*/
-2, /* N(7,21): Aogonek*/
+7, /* N(5,20): Delta*/
17, /* N(12,24): Kcommaaccent*/
24, /* N(13,26): Ohungarumlaut*/
-10, /* N(7,28): Emacron*/
30, /* N(8,32): Scedilla*/
-11, /* N(7,35): Eogonek*/
3, /* N(6,36): Cacute*/
20, /* N(12,36): Lcommaaccent*/
34, /* N(13,39): Uhungarumlaut*/
9, /* N(10,40): Edotaccent*/
4, /* N(6,42): Ccaron*/
+1, /* N(7,42): Amacron*/
23, /* N(12,48): Ncommaaccent*/
-15, /* N(7,49): Imacron*/
-37, /* N(5,50): Uring*/
+2, /* N(7,49): Aogonek*/
5, /* N(6,54): Dcaron*/
-16, /* N(7,56): Iogonek*/
+10, /* N(7,56): Emacron*/
6, /* N(6,60): Dcroat*/
14, /* N(10,60): Idotaccent*/
28, /* N(12,60): Rcommaaccent*/
-25, /* N(7,70): Omacron*/
+11, /* N(7,63): Eogonek*/
+37, /* N(5,65): Uring*/
31, /* N(12,72): Scommaaccent*/
+15, /* N(7,77): Imacron*/
8, /* N(6,78): Ecaron*/
-35, /* N(7,84): Umacron*/
+16, /* N(7,84): Iogonek*/
33, /* N(12,84): Tcommaaccent*/
39, /* N(10,90): Zdotaccent*/
-36, /* N(7,91): Uogonek*/
+25, /* N(7,98): Omacron*/
12, /* N(6,102): Gbreve*/
-41, /* N(7,105): amacron*/
-42, /* N(7,112): aogonek*/
-66, /* N(8,144): notequal*/
+35, /* N(7,119): Umacron*/
+36, /* N(7,126): Uogonek*/
+41, /* N(7,140): amacron*/
+42, /* N(7,147): aogonek*/
18, /* N(6,150): Lacute*/
+66, /* N(8,152): notequal*/
19, /* N(6,162): Lcaron*/
-50, /* N(7,168): emacron*/
49, /* N(10,170): edotaccent*/
-51, /* N(7,175): eogonek*/
-75, /* N(8,176): scedilla*/
-21, /* N(6,186): Nacute*/
-22, /* N(6,192): Ncaron*/
-55, /* N(7,196): imacron*/
-83, /* N(5,200): uring*/
-56, /* N(7,203): iogonek*/
-62, /* N(7,210): lozenge*/
-68, /* N(7,224): omacron*/
+75, /* N(8,184): scedilla*/
+21, /* N(6,192): Nacute*/
+22, /* N(6,198): Ncaron*/
+50, /* N(7,203): emacron*/
+51, /* N(7,210): eogonek*/
+83, /* N(5,215): uring*/
+55, /* N(7,231): imacron*/
67, /* N(13,234): ohungarumlaut*/
-26, /* N(6,252): Racute*/
-27, /* N(6,258): Rcaron*/
-71, /* N(7,259): radical*/
+56, /* N(7,238): iogonek*/
+62, /* N(7,245): lozenge*/
+26, /* N(6,258): Racute*/
+68, /* N(7,259): omacron*/
61, /* N(9,261): lessequal*/
-29, /* N(6,270): Sacute*/
-81, /* N(7,280): umacron*/
-82, /* N(7,287): uogonek*/
-32, /* N(6,288): Tcaron*/
+27, /* N(6,264): Rcaron*/
+29, /* N(6,276): Sacute*/
+32, /* N(6,294): Tcaron*/
+71, /* N(7,294): radical*/
53, /* N(12,312): gcommaaccent*/
+81, /* N(7,315): umacron*/
+82, /* N(7,322): uogonek*/
54, /* N(12,324): greaterequal*/
85, /* N(10,330): zdotaccent*/
-38, /* N(6,348): Zacute*/
45, /* N(11,352): commaaccent*/
+38, /* N(6,354): Zacute*/
57, /* N(12,360): kcommaaccent*/
-40, /* N(6,372): abreve*/
60, /* N(12,372): lcommaaccent*/
+40, /* N(6,378): abreve*/
65, /* N(12,384): ncommaaccent*/
-43, /* N(6,396): cacute*/
-44, /* N(6,402): ccaron*/
+43, /* N(6,402): cacute*/
80, /* N(13,403): uhungarumlaut*/
-46, /* N(6,414): dcaron*/
-47, /* N(6,420): dcroat*/
+44, /* N(6,408): ccaron*/
+46, /* N(6,420): dcaron*/
+47, /* N(6,426): dcroat*/
77, /* N(9,432): summation*/
-48, /* N(6,450): ecaron*/
-52, /* N(6,486): gbreve*/
-58, /* N(6,510): lacute*/
+48, /* N(6,456): ecaron*/
+52, /* N(6,492): gbreve*/
+58, /* N(6,516): lacute*/
69, /* N(11,517): partialdiff*/
-59, /* N(6,522): lcaron*/
+59, /* N(6,528): lcaron*/
73, /* N(12,540): rcommaaccent*/
-63, /* N(6,546): nacute*/
-64, /* N(6,552): ncaron*/
+63, /* N(6,552): nacute*/
+64, /* N(6,558): ncaron*/
76, /* N(12,576): scommaaccent*/
79, /* N(12,600): tcommaaccent*/
-70, /* N(6,606): racute*/
-72, /* N(6,612): rcaron*/
-74, /* N(6,624): sacute*/
-78, /* N(6,648): tcaron*/
-84, /* N(6,678): zacute*/
+70, /* N(6,612): racute*/
+72, /* N(6,618): rcaron*/
+74, /* N(6,630): sacute*/
+78, /* N(6,654): tcaron*/
+84, /* N(6,684): zacute*/
0};
/* CFFStandardStrings */
static const ushort gs_c_known_encoding_10[] = {
N(7,0), /*.notdef*/
-N(5,165), /*space*/
-N(6,474), /*exclam*/
-N(8,168), /*quotedbl*/
+N(5,180), /*space*/
+N(6,480), /*exclam*/
+N(8,176), /*quotedbl*/
N(10,270), /*numbersign*/
-N(6,438), /*dollar*/
-N(7,245), /*percent*/
+N(6,444), /*dollar*/
+N(7,280), /*percent*/
N(9,72), /*ampersand*/
N(10,300), /*quoteright*/
N(9,369), /*parenleft*/
N(10,290), /*parenright*/
-N(8,48), /*asterisk*/
-N(4,456), /*plus*/
-N(5,95), /*comma*/
-N(6,492), /*hyphen*/
-N(6,600), /*period*/
-N(5,160), /*slash*/
-N(4,464), /*zero*/
+N(8,56), /*asterisk*/
+N(4,464), /*plus*/
+N(5,110), /*comma*/
+N(6,498), /*hyphen*/
+N(6,606), /*period*/
+N(5,175), /*slash*/
+N(4,472), /*zero*/
N(3,276), /*one*/
N(3,294), /*two*/
-N(5,185), /*three*/
-N(4,436), /*four*/
-N(4,432), /*five*/
+N(5,200), /*three*/
+N(4,444), /*four*/
+N(4,440), /*five*/
N(3,288), /*six*/
-N(5,150), /*seven*/
-N(5,105), /*eight*/
-N(4,448), /*nine*/
-N(5,90), /*colon*/
+N(5,165), /*seven*/
+N(5,120), /*eight*/
+N(4,456), /*nine*/
+N(5,105), /*colon*/
N(9,414), /*semicolon*/
-N(4,444), /*less*/
-N(5,110), /*equal*/
-N(7,189), /*greater*/
-N(8,160), /*question*/
+N(4,452), /*less*/
+N(5,125), /*equal*/
+N(7,224), /*greater*/
+N(8,168), /*question*/
N(2,34), /*at*/
N(1,0), /*A*/
N(1,1), /*B*/
@@ -5263,13 +5275,13 @@ N(3,255), /*bar*/
N(10,140), /*braceright*/
N(10,130), /*asciitilde*/
N(10,180), /*exclamdown*/
-N(4,424), /*cent*/
-N(8,184), /*sterling*/
-N(8,104), /*fraction*/
+N(4,432), /*cent*/
+N(8,192), /*sterling*/
+N(8,112), /*fraction*/
N(3,297), /*yen*/
-N(6,480), /*florin*/
-N(7,266), /*section*/
-N(8,64), /*currency*/
+N(6,486), /*florin*/
+N(7,301), /*section*/
+N(8,72), /*currency*/
N(11,539), /*quotesingle*/
N(12,528), /*quotedblleft*/
N(13,208), /*guillemotleft*/
@@ -5277,43 +5289,43 @@ N(13,221), /*guilsinglleft*/
N(14,252), /*guilsinglright*/
N(2,38), /*fi*/
N(2,40), /*fl*/
-N(6,468), /*endash*/
-N(6,408), /*dagger*/
+N(6,474), /*endash*/
+N(6,414), /*dagger*/
N(9,189), /*daggerdbl*/
N(14,308), /*periodcentered*/
N(9,360), /*paragraph*/
-N(6,390), /*bullet*/
+N(6,396), /*bullet*/
N(14,364), /*quotesinglbase*/
N(12,516), /*quotedblbase*/
N(13,273), /*quotedblright*/
N(14,238), /*guillemotright*/
-N(8,88), /*ellipsis*/
+N(8,96), /*ellipsis*/
N(11,528), /*perthousand*/
N(12,504), /*questiondown*/
-N(5,125), /*grave*/
-N(5,55), /*acute*/
+N(5,140), /*grave*/
+N(5,70), /*acute*/
N(10,160), /*circumflex*/
-N(5,190), /*tilde*/
-N(6,534), /*macron*/
-N(5,80), /*breve*/
+N(5,205), /*tilde*/
+N(6,540), /*macron*/
+N(5,95), /*breve*/
N(9,198), /*dotaccent*/
-N(8,72), /*dieresis*/
-N(4,460), /*ring*/
-N(7,133), /*cedilla*/
+N(8,80), /*dieresis*/
+N(4,468), /*ring*/
+N(7,168), /*cedilla*/
N(12,336), /*hungarumlaut*/
-N(6,570), /*ogonek*/
-N(5,85), /*caron*/
-N(6,462), /*emdash*/
+N(6,576), /*ogonek*/
+N(5,100), /*caron*/
+N(6,468), /*emdash*/
N(2,0), /*AE*/
N(11,473), /*ordfeminine*/
N(6,168), /*Lslash*/
-N(6,222), /*Oslash*/
+N(6,228), /*Oslash*/
N(2,8), /*OE*/
N(12,432), /*ordmasculine*/
N(2,32), /*ae*/
-N(8,80), /*dotlessi*/
-N(6,528), /*lslash*/
-N(6,588), /*oslash*/
+N(8,88), /*dotlessi*/
+N(6,534), /*lslash*/
+N(6,594), /*oslash*/
N(2,46), /*oe*/
N(10,200), /*germandbls*/
N(11,462), /*onesuperior*/
@@ -5321,20 +5333,20 @@ N(10,250), /*logicalnot*/
N(2,42), /*mu*/
N(9,450), /*trademark*/
N(3,6), /*Eth*/
-N(7,238), /*onehalf*/
+N(7,273), /*onehalf*/
N(9,378), /*plusminus*/
-N(5,45), /*Thorn*/
+N(5,60), /*Thorn*/
N(10,280), /*onequarter*/
-N(6,432), /*divide*/
+N(6,438), /*divide*/
N(9,153), /*brokenbar*/
-N(6,426), /*degree*/
-N(5,180), /*thorn*/
+N(6,432), /*degree*/
+N(5,195), /*thorn*/
N(13,364), /*threequarters*/
N(11,605), /*twosuperior*/
N(10,310), /*registered*/
-N(5,140), /*minus*/
+N(5,155), /*minus*/
N(3,264), /*eth*/
-N(8,136), /*multiply*/
+N(8,144), /*multiply*/
N(13,377), /*threesuperior*/
N(9,180), /*copyright*/
N(6,0), /*Aacute*/
@@ -5352,49 +5364,49 @@ N(6,120), /*Iacute*/
N(11,88), /*Icircumflex*/
N(9,18), /*Idieresis*/
N(6,126), /*Igrave*/
-N(6,204), /*Ntilde*/
-N(6,210), /*Oacute*/
+N(6,210), /*Ntilde*/
+N(6,216), /*Oacute*/
N(11,154), /*Ocircumflex*/
N(9,27), /*Odieresis*/
-N(6,216), /*Ograve*/
-N(6,234), /*Otilde*/
-N(6,276), /*Scaron*/
-N(6,300), /*Uacute*/
+N(6,222), /*Ograve*/
+N(6,240), /*Otilde*/
+N(6,282), /*Scaron*/
+N(6,306), /*Uacute*/
N(11,231), /*Ucircumflex*/
N(9,45), /*Udieresis*/
-N(6,306), /*Ugrave*/
-N(6,336), /*Yacute*/
+N(6,312), /*Ugrave*/
+N(6,342), /*Yacute*/
N(9,54), /*Ydieresis*/
-N(6,354), /*Zcaron*/
-N(6,366), /*aacute*/
+N(6,360), /*Zcaron*/
+N(6,372), /*aacute*/
N(11,275), /*acircumflex*/
N(9,63), /*adieresis*/
-N(6,378), /*agrave*/
-N(5,75), /*aring*/
-N(6,384), /*atilde*/
-N(8,56), /*ccedilla*/
-N(6,444), /*eacute*/
+N(6,384), /*agrave*/
+N(5,90), /*aring*/
+N(6,390), /*atilde*/
+N(8,64), /*ccedilla*/
+N(6,450), /*eacute*/
N(11,363), /*ecircumflex*/
N(9,216), /*edieresis*/
-N(6,456), /*egrave*/
-N(6,498), /*iacute*/
+N(6,462), /*egrave*/
+N(6,504), /*iacute*/
N(11,418), /*icircumflex*/
N(9,234), /*idieresis*/
-N(6,504), /*igrave*/
-N(6,558), /*ntilde*/
-N(6,564), /*oacute*/
+N(6,510), /*igrave*/
+N(6,564), /*ntilde*/
+N(6,570), /*oacute*/
N(11,429), /*ocircumflex*/
N(9,315), /*odieresis*/
-N(6,576), /*ograve*/
-N(6,594), /*otilde*/
-N(6,630), /*scaron*/
-N(6,660), /*uacute*/
+N(6,582), /*ograve*/
+N(6,600), /*otilde*/
+N(6,636), /*scaron*/
+N(6,666), /*uacute*/
N(11,616), /*ucircumflex*/
N(9,477), /*udieresis*/
-N(6,666), /*ugrave*/
-N(6,672), /*yacute*/
+N(6,672), /*ugrave*/
+N(6,678), /*yacute*/
N(9,495), /*ydieresis*/
-N(6,684), /*zcaron*/
+N(6,690), /*zcaron*/
N(11,385), /*exclamsmall*/
N(17,0), /*Hungarumlautsmall*/
N(14,210), /*dollaroldstyle*/
@@ -5452,23 +5464,23 @@ N(6,132), /*Ismall*/
N(6,138), /*Jsmall*/
N(6,144), /*Ksmall*/
N(6,174), /*Lsmall*/
-N(6,180), /*Msmall*/
-N(6,198), /*Nsmall*/
-N(6,228), /*Osmall*/
-N(6,240), /*Psmall*/
-N(6,246), /*Qsmall*/
-N(6,264), /*Rsmall*/
-N(6,282), /*Ssmall*/
-N(6,294), /*Tsmall*/
-N(6,312), /*Usmall*/
-N(6,318), /*Vsmall*/
-N(6,324), /*Wsmall*/
-N(6,330), /*Xsmall*/
-N(6,342), /*Ysmall*/
-N(6,360), /*Zsmall*/
+N(6,186), /*Msmall*/
+N(6,204), /*Nsmall*/
+N(6,234), /*Osmall*/
+N(6,246), /*Psmall*/
+N(6,252), /*Qsmall*/
+N(6,270), /*Rsmall*/
+N(6,288), /*Ssmall*/
+N(6,300), /*Tsmall*/
+N(6,318), /*Usmall*/
+N(6,324), /*Vsmall*/
+N(6,330), /*Wsmall*/
+N(6,336), /*Xsmall*/
+N(6,348), /*Ysmall*/
+N(6,366), /*Zsmall*/
N(13,117), /*colonmonetary*/
N(9,333), /*onefitted*/
-N(6,618), /*rupiah*/
+N(6,624), /*rupiah*/
N(10,80), /*Tildesmall*/
N(15,15), /*exclamdownsmall*/
N(12,216), /*centoldstyle*/
@@ -5490,7 +5502,7 @@ N(9,324), /*oneeighth*/
N(12,612), /*threeeighths*/
N(11,407), /*fiveeighths*/
N(12,588), /*seveneighths*/
-N(8,152), /*onethird*/
+N(8,160), /*onethird*/
N(9,468), /*twothirds*/
N(12,648), /*zerosuperior*/
N(12,300), /*foursuperior*/
@@ -5519,7 +5531,7 @@ N(16,0), /*Acircumflexsmall*/
N(11,33), /*Atildesmall*/
N(14,0), /*Adieresissmall*/
N(10,10), /*Aringsmall*/
-N(7,7), /*AEsmall*/
+N(7,35), /*AEsmall*/
N(13,0), /*Ccedillasmall*/
N(11,66), /*Egravesmall*/
N(11,44), /*Eacutesmall*/
@@ -5536,7 +5548,7 @@ N(11,143), /*Oacutesmall*/
N(16,48), /*Ocircumflexsmall*/
N(11,198), /*Otildesmall*/
N(14,56), /*Odieresissmall*/
-N(7,63), /*OEsmall*/
+N(7,91), /*OEsmall*/
N(11,187), /*Oslashsmall*/
N(11,242), /*Ugravesmall*/
N(11,220), /*Uacutesmall*/
@@ -5545,6 +5557,18 @@ N(14,70), /*Udieresissmall*/
N(11,253), /*Yacutesmall*/
N(10,70), /*Thornsmall*/
N(14,84), /*Ydieresissmall*/
+N(7,7), /*001.000*/
+N(7,14), /*001.001*/
+N(7,21), /*001.002*/
+N(7,28), /*001.003*/
+N(5,15), /*Black*/
+N(4,4), /*Bold*/
+N(4,8), /*Book*/
+N(5,35), /*Light*/
+N(6,180), /*Medium*/
+N(7,112), /*Regular*/
+N(5,45), /*Roman*/
+N(8,40), /*Semibold*/
0};
static const ushort gs_c_known_encoding_reverse_10[] = {
34, /* N(1,0): A*/
@@ -5566,13 +5590,15 @@ static const ushort gs_c_known_encoding_reverse_10[] = {
36, /* N(1,2): C*/
37, /* N(1,3): D*/
38, /* N(1,4): E*/
+384, /* N(4,4): Bold*/
39, /* N(1,5): F*/
40, /* N(1,6): G*/
154, /* N(3,6): Eth*/
41, /* N(1,7): H*/
-353, /* N(7,7): AEsmall*/
+379, /* N(7,7): 001.000*/
42, /* N(1,8): I*/
142, /* N(2,8): OE*/
+385, /* N(4,8): Book*/
363, /* N(8,8): Ethsmall*/
43, /* N(1,9): J*/
180, /* N(9,9): Edieresis*/
@@ -5586,8 +5612,10 @@ static const ushort gs_c_known_encoding_reverse_10[] = {
47, /* N(1,13): N*/
309, /* N(13,13): Dieresissmall*/
48, /* N(1,14): O*/
+380, /* N(7,14): 001.001*/
312, /* N(14,14): Dotaccentsmall*/
49, /* N(1,15): P*/
+383, /* N(5,15): Black*/
304, /* N(15,15): exclamdownsmall*/
50, /* N(1,16): Q*/
357, /* N(16,16): Ecircumflexsmall*/
@@ -5601,6 +5629,7 @@ static const ushort gs_c_known_encoding_reverse_10[] = {
54, /* N(1,20): U*/
310, /* N(10,20): Brevesmall*/
55, /* N(1,21): V*/
+381, /* N(7,21): 001.002*/
56, /* N(1,22): W*/
347, /* N(11,22): Agravesmall*/
57, /* N(1,23): X*/
@@ -5611,6 +5640,7 @@ static const ushort gs_c_known_encoding_reverse_10[] = {
67, /* N(1,27): b*/
189, /* N(9,27): Odieresis*/
68, /* N(1,28): c*/
+382, /* N(7,28): 001.003*/
358, /* N(14,28): Edieresissmall*/
69, /* N(1,29): d*/
70, /* N(1,30): e*/
@@ -5626,6 +5656,8 @@ static const ushort gs_c_known_encoding_reverse_10[] = {
33, /* N(2,34): at*/
235, /* N(17,34): parenleftsuperior*/
75, /* N(1,35): j*/
+386, /* N(5,35): Light*/
+353, /* N(7,35): AEsmall*/
76, /* N(1,36): k*/
266, /* N(2,36): ff*/
317, /* N(9,36): Ringsmall*/
@@ -5635,6 +5667,7 @@ static const ushort gs_c_known_encoding_reverse_10[] = {
79, /* N(1,39): n*/
80, /* N(1,40): o*/
110, /* N(2,40): fl*/
+390, /* N(8,40): Semibold*/
81, /* N(1,41): p*/
82, /* N(1,42): q*/
152, /* N(2,42): mu*/
@@ -5643,14 +5676,13 @@ static const ushort gs_c_known_encoding_reverse_10[] = {
84, /* N(1,44): s*/
356, /* N(11,44): Eacutesmall*/
85, /* N(1,45): t*/
-157, /* N(5,45): Thorn*/
+389, /* N(5,45): Roman*/
195, /* N(9,45): Udieresis*/
86, /* N(1,46): u*/
148, /* N(2,46): oe*/
87, /* N(1,47): v*/
88, /* N(1,48): w*/
276, /* N(6,48): Csmall*/
-11, /* N(8,48): asterisk*/
367, /* N(16,48): Ocircumflexsmall*/
89, /* N(1,49): x*/
90, /* N(1,50): y*/
@@ -5658,125 +5690,127 @@ static const ushort gs_c_known_encoding_reverse_10[] = {
91, /* N(1,51): z*/
319, /* N(17,51): questiondownsmall*/
198, /* N(9,54): Ydieresis*/
-125, /* N(5,55): acute*/
179, /* N(11,55): Ecircumflex*/
-206, /* N(8,56): ccedilla*/
+11, /* N(8,56): asterisk*/
369, /* N(14,56): Odieresissmall*/
-370, /* N(7,63): OEsmall*/
+157, /* N(5,60): Thorn*/
202, /* N(9,63): adieresis*/
-103, /* N(8,64): currency*/
+206, /* N(8,64): ccedilla*/
374, /* N(16,64): Ucircumflexsmall*/
277, /* N(6,66): Dsmall*/
355, /* N(11,66): Egravesmall*/
+125, /* N(5,70): acute*/
377, /* N(10,70): Thornsmall*/
375, /* N(14,70): Udieresissmall*/
178, /* N(6,72): Eacute*/
-131, /* N(8,72): dieresis*/
+103, /* N(8,72): currency*/
7, /* N(9,72): ampersand*/
-204, /* N(5,75): aring*/
360, /* N(11,77): Iacutesmall*/
-129, /* N(5,80): breve*/
-145, /* N(8,80): dotlessi*/
+131, /* N(8,80): dieresis*/
303, /* N(10,80): Tildesmall*/
181, /* N(6,84): Egrave*/
378, /* N(14,84): Ydieresissmall*/
-136, /* N(5,85): caron*/
-121, /* N(8,88): ellipsis*/
+145, /* N(8,88): dotlessi*/
183, /* N(11,88): Icircumflex*/
-27, /* N(5,90): colon*/
+204, /* N(5,90): aring*/
278, /* N(6,90): Esmall*/
-13, /* N(5,95): comma*/
+370, /* N(7,91): OEsmall*/
+129, /* N(5,95): breve*/
279, /* N(6,96): Fsmall*/
+121, /* N(8,96): ellipsis*/
233, /* N(14,98): ampersandsmall*/
359, /* N(11,99): Igravesmall*/
-99, /* N(8,104): fraction*/
-25, /* N(5,105): eight*/
+136, /* N(5,100): caron*/
+27, /* N(5,105): colon*/
280, /* N(6,108): Gsmall*/
-30, /* N(5,110): equal*/
+13, /* N(5,110): comma*/
306, /* N(11,110): Lslashsmall*/
+388, /* N(7,112): Regular*/
+99, /* N(8,112): fraction*/
281, /* N(6,114): Hsmall*/
300, /* N(13,117): colonmonetary*/
+25, /* N(5,120): eight*/
182, /* N(6,120): Iacute*/
313, /* N(11,121): Macronsmall*/
-124, /* N(5,125): grave*/
+30, /* N(5,125): equal*/
185, /* N(6,126): Igrave*/
253, /* N(9,126): asuperior*/
95, /* N(10,130): asciitilde*/
346, /* N(13,130): commainferior*/
282, /* N(6,132): Ismall*/
364, /* N(11,132): Ntildesmall*/
-133, /* N(7,133): cedilla*/
61, /* N(9,135): backslash*/
-168, /* N(8,136): multiply*/
283, /* N(6,138): Jsmall*/
-166, /* N(5,140): minus*/
+124, /* N(5,140): grave*/
94, /* N(10,140): braceright*/
366, /* N(11,143): Oacutesmall*/
249, /* N(13,143): commasuperior*/
284, /* N(6,144): Ksmall*/
+168, /* N(8,144): multiply*/
92, /* N(9,144): braceleft*/
-24, /* N(5,150): seven*/
-324, /* N(8,152): onethird*/
160, /* N(9,153): brokenbar*/
188, /* N(11,154): Ocircumflex*/
-16, /* N(5,160): slash*/
-32, /* N(8,160): question*/
+166, /* N(5,155): minus*/
+324, /* N(8,160): onethird*/
126, /* N(10,160): circumflex*/
254, /* N(9,162): bsuperior*/
-1, /* N(5,165): space*/
+24, /* N(5,165): seven*/
316, /* N(11,165): Ogoneksmall*/
140, /* N(6,168): Lslash*/
-3, /* N(8,168): quotedbl*/
+133, /* N(7,168): cedilla*/
+32, /* N(8,168): question*/
341, /* N(13,169): eightinferior*/
285, /* N(6,174): Lsmall*/
+16, /* N(5,175): slash*/
+3, /* N(8,176): quotedbl*/
365, /* N(11,176): Ogravesmall*/
-162, /* N(5,180): thorn*/
-286, /* N(6,180): Msmall*/
+1, /* N(5,180): space*/
+387, /* N(6,180): Medium*/
170, /* N(9,180): copyright*/
96, /* N(10,180): exclamdown*/
247, /* N(13,182): eightoldstyle*/
-98, /* N(8,184): sterling*/
-20, /* N(5,185): three*/
+286, /* N(6,186): Msmall*/
371, /* N(11,187): Oslashsmall*/
-31, /* N(7,189): greater*/
113, /* N(9,189): daggerdbl*/
-127, /* N(5,190): tilde*/
314, /* N(10,190): figuredash*/
+98, /* N(8,192): sterling*/
62, /* N(12,192): bracketright*/
+162, /* N(5,195): thorn*/
331, /* N(13,195): eightsuperior*/
344, /* N(14,196): dollarinferior*/
-287, /* N(6,198): Nsmall*/
130, /* N(9,198): dotaccent*/
368, /* N(11,198): Otildesmall*/
+20, /* N(5,200): three*/
149, /* N(10,200): germandbls*/
-186, /* N(6,204): Ntilde*/
+287, /* N(6,204): Nsmall*/
343, /* N(12,204): centinferior*/
+127, /* N(5,205): tilde*/
256, /* N(9,207): dsuperior*/
106, /* N(13,208): guillemotleft*/
307, /* N(11,209): Scaronsmall*/
-187, /* N(6,210): Oacute*/
+186, /* N(6,210): Ntilde*/
231, /* N(14,210): dollaroldstyle*/
-190, /* N(6,216): Ograve*/
+187, /* N(6,216): Oacute*/
209, /* N(9,216): edieresis*/
305, /* N(12,216): centoldstyle*/
373, /* N(11,220): Uacutesmall*/
107, /* N(13,221): guilsinglleft*/
-141, /* N(6,222): Oslash*/
+190, /* N(6,222): Ograve*/
+31, /* N(7,224): greater*/
232, /* N(14,224): dollarsuperior*/
257, /* N(9,225): esuperior*/
-288, /* N(6,228): Osmall*/
+141, /* N(6,228): Oslash*/
255, /* N(12,228): centsuperior*/
194, /* N(11,231): Ucircumflex*/
-191, /* N(6,234): Otilde*/
+288, /* N(6,234): Osmall*/
213, /* N(9,234): idieresis*/
-155, /* N(7,238): onehalf*/
120, /* N(14,238): guillemotright*/
-289, /* N(6,240): Psmall*/
+191, /* N(6,240): Otilde*/
338, /* N(12,240): fiveinferior*/
372, /* N(11,242): Ugravesmall*/
-6, /* N(7,245): percent*/
-290, /* N(6,246): Qsmall*/
+289, /* N(6,246): Psmall*/
151, /* N(10,250): logicalnot*/
+290, /* N(6,252): Qsmall*/
258, /* N(9,252): isuperior*/
244, /* N(12,252): fiveoldstyle*/
108, /* N(14,252): guilsinglright*/
@@ -5784,147 +5818,149 @@ static const ushort gs_c_known_encoding_reverse_10[] = {
93, /* N(3,255): bar*/
252, /* N(13,260): questionsmall*/
167, /* N(3,264): eth*/
-291, /* N(6,264): Rsmall*/
308, /* N(11,264): Zcaronsmall*/
328, /* N(12,264): fivesuperior*/
-102, /* N(7,266): section*/
315, /* N(14,266): hypheninferior*/
267, /* N(3,267): ffi*/
268, /* N(3,270): ffl*/
+291, /* N(6,270): Rsmall*/
4, /* N(10,270): numbersign*/
+155, /* N(7,273): onehalf*/
119, /* N(13,273): quotedblright*/
201, /* N(11,275): acircumflex*/
18, /* N(3,276): one*/
-192, /* N(6,276): Scaron*/
337, /* N(12,276): fourinferior*/
259, /* N(9,279): lsuperior*/
+6, /* N(7,280): percent*/
158, /* N(10,280): onequarter*/
272, /* N(14,280): hyphensuperior*/
-292, /* N(6,282): Ssmall*/
+192, /* N(6,282): Scaron*/
23, /* N(3,288): six*/
+292, /* N(6,288): Ssmall*/
260, /* N(9,288): msuperior*/
243, /* N(12,288): fouroldstyle*/
10, /* N(10,290): parenright*/
19, /* N(3,294): two*/
-293, /* N(6,294): Tsmall*/
238, /* N(14,294): onedotenleader*/
100, /* N(3,297): yen*/
340, /* N(13,299): seveninferior*/
-193, /* N(6,300): Uacute*/
+293, /* N(6,300): Tsmall*/
8, /* N(10,300): quoteright*/
327, /* N(12,300): foursuperior*/
-196, /* N(6,306): Ugrave*/
+102, /* N(7,301): section*/
+193, /* N(6,306): Uacute*/
261, /* N(9,306): nsuperior*/
63, /* N(11,308): asciicircum*/
114, /* N(14,308): periodcentered*/
165, /* N(10,310): registered*/
-294, /* N(6,312): Usmall*/
+196, /* N(6,312): Ugrave*/
246, /* N(13,312): sevenoldstyle*/
218, /* N(9,315): odieresis*/
-295, /* N(6,318): Vsmall*/
+294, /* N(6,318): Usmall*/
64, /* N(10,320): underscore*/
345, /* N(14,322): periodinferior*/
-296, /* N(6,324): Wsmall*/
+295, /* N(6,324): Vsmall*/
320, /* N(9,324): oneeighth*/
330, /* N(13,325): sevensuperior*/
-297, /* N(6,330): Xsmall*/
+296, /* N(6,330): Wsmall*/
301, /* N(9,333): onefitted*/
-197, /* N(6,336): Yacute*/
+297, /* N(6,336): Xsmall*/
134, /* N(12,336): hungarumlaut*/
251, /* N(14,336): periodsuperior*/
336, /* N(13,338): threeinferior*/
60, /* N(11,341): bracketleft*/
-298, /* N(6,342): Ysmall*/
+197, /* N(6,342): Yacute*/
262, /* N(9,342): osuperior*/
+298, /* N(6,348): Ysmall*/
242, /* N(13,351): threeoldstyle*/
-199, /* N(6,354): Zcaron*/
-299, /* N(6,360): Zsmall*/
+199, /* N(6,360): Zcaron*/
115, /* N(9,360): paragraph*/
208, /* N(11,363): ecircumflex*/
163, /* N(13,364): threequarters*/
117, /* N(14,364): quotesinglbase*/
-200, /* N(6,366): aacute*/
+299, /* N(6,366): Zsmall*/
9, /* N(9,369): parenleft*/
+200, /* N(6,372): aacute*/
169, /* N(13,377): threesuperior*/
-203, /* N(6,378): agrave*/
156, /* N(9,378): plusminus*/
-205, /* N(6,384): atilde*/
+203, /* N(6,384): agrave*/
229, /* N(11,385): exclamsmall*/
65, /* N(9,387): quoteleft*/
-116, /* N(6,390): bullet*/
+205, /* N(6,390): atilde*/
+116, /* N(6,396): bullet*/
342, /* N(12,396): nineinferior*/
263, /* N(9,405): rsuperior*/
237, /* N(14,406): twodotenleader*/
322, /* N(11,407): fiveeighths*/
-112, /* N(6,408): dagger*/
248, /* N(12,408): nineoldstyle*/
+112, /* N(6,414): dagger*/
28, /* N(9,414): semicolon*/
212, /* N(11,418): icircumflex*/
332, /* N(12,420): ninesuperior*/
264, /* N(9,423): ssuperior*/
-97, /* N(4,424): cent*/
-161, /* N(6,426): degree*/
217, /* N(11,429): ocircumflex*/
-22, /* N(4,432): five*/
-159, /* N(6,432): divide*/
+97, /* N(4,432): cent*/
+161, /* N(6,432): degree*/
143, /* N(12,432): ordmasculine*/
-21, /* N(4,436): four*/
-5, /* N(6,438): dollar*/
+159, /* N(6,438): divide*/
+22, /* N(4,440): five*/
334, /* N(11,440): oneinferior*/
-29, /* N(4,444): less*/
-207, /* N(6,444): eacute*/
-26, /* N(4,448): nine*/
+21, /* N(4,444): four*/
+5, /* N(6,444): dollar*/
+207, /* N(6,450): eacute*/
153, /* N(9,450): trademark*/
240, /* N(11,451): oneoldstyle*/
-12, /* N(4,456): plus*/
-210, /* N(6,456): egrave*/
+29, /* N(4,452): less*/
+26, /* N(4,456): nine*/
265, /* N(9,459): tsuperior*/
-132, /* N(4,460): ring*/
-137, /* N(6,462): emdash*/
+210, /* N(6,462): egrave*/
150, /* N(11,462): onesuperior*/
-17, /* N(4,464): zero*/
-111, /* N(6,468): endash*/
+12, /* N(4,464): plus*/
+132, /* N(4,468): ring*/
+137, /* N(6,468): emdash*/
325, /* N(9,468): twothirds*/
+17, /* N(4,472): zero*/
139, /* N(11,473): ordfeminine*/
-2, /* N(6,474): exclam*/
+111, /* N(6,474): endash*/
224, /* N(9,477): udieresis*/
-101, /* N(6,480): florin*/
-14, /* N(6,492): hyphen*/
+2, /* N(6,480): exclam*/
+101, /* N(6,486): florin*/
227, /* N(9,495): ydieresis*/
-211, /* N(6,498): iacute*/
-214, /* N(6,504): igrave*/
+14, /* N(6,498): hyphen*/
+211, /* N(6,504): iacute*/
123, /* N(12,504): questiondown*/
+214, /* N(6,510): igrave*/
118, /* N(12,516): quotedblbase*/
-146, /* N(6,528): lslash*/
122, /* N(11,528): perthousand*/
105, /* N(12,528): quotedblleft*/
-128, /* N(6,534): macron*/
+146, /* N(6,534): lslash*/
104, /* N(11,539): quotesingle*/
+128, /* N(6,540): macron*/
339, /* N(11,550): sixinferior*/
-215, /* N(6,558): ntilde*/
245, /* N(11,561): sixoldstyle*/
-216, /* N(6,564): oacute*/
-135, /* N(6,570): ogonek*/
+215, /* N(6,564): ntilde*/
+216, /* N(6,570): oacute*/
329, /* N(11,572): sixsuperior*/
-219, /* N(6,576): ograve*/
+135, /* N(6,576): ogonek*/
+219, /* N(6,582): ograve*/
335, /* N(11,583): twoinferior*/
-147, /* N(6,588): oslash*/
323, /* N(12,588): seveneighths*/
-220, /* N(6,594): otilde*/
+147, /* N(6,594): oslash*/
241, /* N(11,594): twooldstyle*/
-15, /* N(6,600): period*/
+220, /* N(6,600): otilde*/
164, /* N(11,605): twosuperior*/
+15, /* N(6,606): period*/
321, /* N(12,612): threeeighths*/
223, /* N(11,616): ucircumflex*/
-302, /* N(6,618): rupiah*/
+302, /* N(6,624): rupiah*/
333, /* N(12,624): zeroinferior*/
-221, /* N(6,630): scaron*/
+221, /* N(6,636): scaron*/
239, /* N(12,636): zerooldstyle*/
326, /* N(12,648): zerosuperior*/
-222, /* N(6,660): uacute*/
-225, /* N(6,666): ugrave*/
-226, /* N(6,672): yacute*/
-228, /* N(6,684): zcaron*/
+222, /* N(6,666): uacute*/
+225, /* N(6,672): ugrave*/
+226, /* N(6,678): yacute*/
+228, /* N(6,690): zcaron*/
0};
const ushort *const gs_c_known_encodings[] = {
@@ -5957,6 +5993,6 @@ const ushort *const gs_c_known_encodings_reverse[] = {
};
const ushort gs_c_known_encoding_lengths[] = {
-256,256,256,256,256,256,256,258,229,86,379,0};
+256,256,256,256,256,256,256,258,229,86,391,0};
const ushort gs_c_known_encoding_reverse_lengths[] = {
-149,205,189,188,224,208,165,257,228,86,378,0};
+149,205,189,188,224,208,165,257,228,86,390,0};
diff --git a/base/gscedata.h b/base/gscedata.h
index 4f67aac1..47c034c0 100644
--- a/base/gscedata.h
+++ b/base/gscedata.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscencs.c b/base/gscencs.c
index 2b05289c..6853a22d 100644
--- a/base/gscencs.c
+++ b/base/gscencs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscencs.h b/base/gscencs.h
index 6c0c4aad..565283da 100644
--- a/base/gscencs.h
+++ b/base/gscencs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gschar.c b/base/gschar.c
index c01019d8..a41b5802 100644
--- a/base/gschar.c
+++ b/base/gschar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -187,7 +187,7 @@ show_n_begin(gs_show_enum *penum, gs_gstate *pgs, int code, gs_text_enum_t *pte)
dev_proc_text_begin((*text_begin)) = dev_proc(dev, text_begin);
text = pte->text;
- gs_text_release(pte, "show_n_begin");
+ gs_text_release(NULL, pte, "show_n_begin");
/* Temporarily reset the text_begin procedure to the default. */
set_dev_proc(dev, text_begin, gx_default_text_begin);
code = gs_text_begin(pgs, &text, mem, &pte);
diff --git a/base/gschar.h b/base/gschar.h
index a856860b..6d60af99 100644
--- a/base/gschar.h
+++ b/base/gschar.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gschar0.c b/base/gschar0.c
index 935d7c53..2a4f30ed 100644
--- a/base/gschar0.c
+++ b/base/gschar0.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscicach.c b/base/gscicach.c
index b524feb1..fb910cf5 100644
--- a/base/gscicach.c
+++ b/base/gscicach.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -31,7 +31,7 @@ typedef struct gs_color_index_cache_elem_s gs_color_index_cache_elem_t;
struct gs_color_index_cache_elem_s {
union _color {
gx_color_index cindex;
- ushort devn[GS_CLIENT_COLOR_MAX_COMPONENTS];
+ ushort devn[GS_CLIENT_COLOR_MAX_COMPONENTS];
} color;
gx_device_color_type color_type;
uint chain;
@@ -189,7 +189,7 @@ include_into_touch_list(gs_color_index_cache_t *self, uint i)
}
static int
-get_color_index_cache_elem(gs_color_index_cache_t *self,
+get_color_index_cache_elem(gs_color_index_cache_t *self,
const float *paint_values, uint *pi)
{
int client_num_components = self->client_num_components;
@@ -199,7 +199,7 @@ get_color_index_cache_elem(gs_color_index_cache_t *self,
if (i != MYNULL) {
uint tries = 16; /* Arbitrary. */
- if (!memcmp(paint_values, self->paint_values + i * client_num_components,
+ if (!memcmp(paint_values, self->paint_values + i * client_num_components,
sizeof(*paint_values) * client_num_components)) {
if (self->recent_touch != i) {
exclude_from_touch_list(self, i);
@@ -209,7 +209,7 @@ get_color_index_cache_elem(gs_color_index_cache_t *self,
return 1;
}
for (j = self->buf[i].next; tries -- && j != i; j = self->buf[j].next) {
- if (!memcmp(paint_values, self->paint_values + j * client_num_components,
+ if (!memcmp(paint_values, self->paint_values + j * client_num_components,
sizeof(*paint_values) * client_num_components)) {
exclude_from_chain(self, j);
include_into_chain(self, j, c);
@@ -251,15 +251,15 @@ compute_frac_values(gs_color_index_cache_t *self, uint i)
for (j = 0; j < device_num_components; j++) {
int shift = cinfo->comp_shift[j];
int bits = cinfo->comp_bits[j];
- self->frac_values[i * device_num_components + j] =
- ((c >> shift) & ((1 << bits) - 1)) <<
+ self->frac_values[i * device_num_components + j] =
+ ((c >> shift) & ((1 << bits) - 1)) <<
(sizeof(frac31) * 8 - 1 - bits);
}
self->buf[i].frac_values_done = true;
} else {
/* Must be devn */
for (j = 0; j < device_num_components; j++) {
- self->frac_values[i * device_num_components + j] =
+ self->frac_values[i * device_num_components + j] =
cv2frac31(self->buf[i].color.devn[j]);
}
self->buf[i].frac_values_done = true;
@@ -267,7 +267,7 @@ compute_frac_values(gs_color_index_cache_t *self, uint i)
}
int
-gs_cached_color_index(gs_color_index_cache_t *self, const float *paint_values,
+gs_cached_color_index(gs_color_index_cache_t *self, const float *paint_values,
gx_device_color *pdevc, frac31 *frac_values)
{
/* Must return 2 if the color is not pure.
@@ -283,7 +283,7 @@ gs_cached_color_index(gs_color_index_cache_t *self, const float *paint_values,
if (self->buf[i].color_type == &gx_dc_type_data_pure) {
pdevc->colors.pure = self->buf[i].color.cindex;
pdevc->type = &gx_dc_type_data_pure;
- memcpy(pdevc->ccolor.paint.values, paint_values,
+ memcpy(pdevc->ccolor.paint.values, paint_values,
sizeof(*paint_values) * client_num_components);
} else {
/* devn case */
@@ -291,7 +291,7 @@ gs_cached_color_index(gs_color_index_cache_t *self, const float *paint_values,
pdevc->colors.devn.values[j] = self->buf[i].color.devn[j];
}
pdevc->type = &gx_dc_type_data_devn;
- memcpy(pdevc->ccolor.paint.values, paint_values,
+ memcpy(pdevc->ccolor.paint.values, paint_values,
sizeof(*paint_values) * client_num_components);
}
pdevc->ccolor_valid = true;
@@ -304,11 +304,11 @@ gs_cached_color_index(gs_color_index_cache_t *self, const float *paint_values,
if (pdevc == NULL)
pdevc = &devc_local;
- memcpy(self->paint_values + i * client_num_components, paint_values,
+ memcpy(self->paint_values + i * client_num_components, paint_values,
sizeof(*paint_values) * client_num_components);
- memcpy(fcc.paint.values, paint_values,
+ memcpy(fcc.paint.values, paint_values,
sizeof(*paint_values) * client_num_components);
- code = pcs->type->remap_color(&fcc, pcs, pdevc, self->pgs,
+ code = pcs->type->remap_color(&fcc, pcs, pdevc, self->pgs,
self->trans_dev, gs_color_select_texture);
if (code < 0)
return code;
@@ -328,7 +328,7 @@ gs_cached_color_index(gs_color_index_cache_t *self, const float *paint_values,
self->buf[i].frac_values_done = false;
}
if (frac_values != NULL)
- memcpy(frac_values, self->frac_values + i * device_num_components,
+ memcpy(frac_values, self->frac_values + i * device_num_components,
sizeof(*frac_values) * device_num_components);
return 0;
}
diff --git a/base/gscicach.h b/base/gscicach.h
index de3f926f..51fb0b09 100644
--- a/base/gscicach.h
+++ b/base/gscicach.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscie.c b/base/gscie.c
index f7a45765..982b6b08 100644
--- a/base/gscie.c
+++ b/base/gscie.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscie.h b/base/gscie.h
index 9c022df2..77d082c9 100644
--- a/base/gscie.h
+++ b/base/gscie.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsciemap.c b/base/gsciemap.c
index 0374ca0e..43c162a8 100644
--- a/base/gsciemap.c
+++ b/base/gsciemap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscindex.h b/base/gscindex.h
index c45e168e..03af293f 100644
--- a/base/gscindex.h
+++ b/base/gscindex.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsclipsr.c b/base/gsclipsr.c
index a5d2e9bb..cb5c7343 100644
--- a/base/gsclipsr.c
+++ b/base/gsclipsr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsclipsr.h b/base/gsclipsr.h
index 88daa189..8d57562d 100644
--- a/base/gsclipsr.h
+++ b/base/gsclipsr.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscms.h b/base/gscms.h
index dfface69..caedcb90 100644
--- a/base/gscms.h
+++ b/base/gscms.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -86,7 +86,7 @@ typedef struct gsicc_bufferdesc_s {
unsigned char bytes_per_chan;
bool has_alpha;
bool alpha_first;
- bool little_endian;
+ bool endian_swap;
bool is_planar;
int plane_stride;
int row_stride;
@@ -264,6 +264,19 @@ struct gsicc_namelist_s {
do our first mapping */
};
+/* Overprint (overprint_control)
+ * /enable is the default
+ * /disable turns off overprint
+ * /simulate performs overprint simulation for all devices
+ */
+typedef enum {
+ gs_overprint_control_enable = 0, /* Overprint for CMYK devices (default) */
+ gs_overprint_control_disable = 1, /* No overprint for any devices */
+ gs_overprint_control_simulate = 2 /* Simulate overprint for RGB and Gray devices */
+} gs_overprint_control_t;
+#define gs_overprint_control_names\
+ "enable", "disable", "simulate"
+
/* Destination profiles for different objects */
struct cmm_dev_profile_s {
cmm_profile_t *device_profile[NUM_DEVICE_PROFILES];
@@ -277,8 +290,9 @@ struct cmm_dev_profile_s {
bool graydetection; /* Device param for monitoring for gray only page */
bool pageneutralcolor; /* Only valid if graydetection true */
bool usefastcolor; /* Used when we want to use no cm */
+ bool blacktext; /* Force text to be pure black */
bool supports_devn; /* If the target handles devn colors */
- bool sim_overprint; /* Indicates we want to do overprint blending */
+ gs_overprint_control_t overprint_control; /* enable is the default */
gsicc_namelist_t *spotnames; /* If our device profiles are devn */
bool prebandthreshold; /* Used to indicate use of HT pre-clist */
gs_memory_t *memory;
diff --git a/base/gscolor.c b/base/gscolor.c
index 477b7648..74b80a48 100644
--- a/base/gscolor.c
+++ b/base/gscolor.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscolor.h b/base/gscolor.h
index a330a8e3..78d233f9 100644
--- a/base/gscolor.h
+++ b/base/gscolor.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscolor1.c b/base/gscolor1.c
index 9ba3da02..3c3cf387 100644
--- a/base/gscolor1.c
+++ b/base/gscolor1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscolor1.h b/base/gscolor1.h
index 573d4c82..08c920dd 100644
--- a/base/gscolor1.h
+++ b/base/gscolor1.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscolor2.c b/base/gscolor2.c
index 08bdfc27..85238bf4 100644
--- a/base/gscolor2.c
+++ b/base/gscolor2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -218,7 +218,7 @@ const gs_color_space_type gs_color_space_type_Indexed = {
};
/* To keep things vectorized and avoid an if test during the remap proc we
- have another set of procedures to use for indexed color spaces when
+ have another set of procedures to use for indexed color spaces when
someone has specified a named color profile and the base space of the
index color space is DeviceN or Separation */
const gs_color_space_type gs_color_space_type_Indexed_Named = {
diff --git a/base/gscolor2.h b/base/gscolor2.h
index 939630e7..8a05fb3a 100644
--- a/base/gscolor2.h
+++ b/base/gscolor2.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscolor3.c b/base/gscolor3.c
index f63161c3..66cadecd 100644
--- a/base/gscolor3.c
+++ b/base/gscolor3.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscolor3.h b/base/gscolor3.h
index 116fe1be..27dc4ce8 100644
--- a/base/gscolor3.h
+++ b/base/gscolor3.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscompt.h b/base/gscompt.h
index 191708f1..861cc0a9 100644
--- a/base/gscompt.h
+++ b/base/gscompt.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscoord.c b/base/gscoord.c
index e5e8cc82..8343a091 100644
--- a/base/gscoord.c
+++ b/base/gscoord.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscoord.h b/base/gscoord.h
index df8b0d3d..0c18f6c6 100644
--- a/base/gscoord.h
+++ b/base/gscoord.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscparam.c b/base/gscparam.c
index 6fc65582..1b4522a8 100644
--- a/base/gscparam.c
+++ b/base/gscparam.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscpixel.c b/base/gscpixel.c
index 345a191a..e1855c61 100644
--- a/base/gscpixel.c
+++ b/base/gscpixel.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscpixel.h b/base/gscpixel.h
index 7edc14ca..7a340c3e 100644
--- a/base/gscpixel.h
+++ b/base/gscpixel.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscpm.h b/base/gscpm.h
index 6e9bff0a..fb0d338a 100644
--- a/base/gscpm.h
+++ b/base/gscpm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscrd.c b/base/gscrd.c
index 5ab156cc..f5dc5289 100644
--- a/base/gscrd.c
+++ b/base/gscrd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscrd.h b/base/gscrd.h
index b8ba96bc..9e645fae 100644
--- a/base/gscrd.h
+++ b/base/gscrd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscrdp.c b/base/gscrdp.c
index 119558f5..c3521a3f 100644
--- a/base/gscrdp.c
+++ b/base/gscrdp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscrdp.h b/base/gscrdp.h
index 549e6f08..c07df47d 100644
--- a/base/gscrdp.h
+++ b/base/gscrdp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscrypt1.c b/base/gscrypt1.c
index 2b464700..03caecbb 100644
--- a/base/gscrypt1.c
+++ b/base/gscrypt1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscrypt1.h b/base/gscrypt1.h
index 6072239e..eb9cfaa0 100644
--- a/base/gscrypt1.h
+++ b/base/gscrypt1.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscscie.c b/base/gscscie.c
index 76824cac..3bc94aed 100644
--- a/base/gscscie.c
+++ b/base/gscscie.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscsel.h b/base/gscsel.h
index 1642ffd7..7f6dd127 100644
--- a/base/gscsel.h
+++ b/base/gscsel.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscsepr.c b/base/gscsepr.c
index 5afa4dea..34118988 100644
--- a/base/gscsepr.c
+++ b/base/gscsepr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscsepr.h b/base/gscsepr.h
index 790443be..e4268c28 100644
--- a/base/gscsepr.h
+++ b/base/gscsepr.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscspace.c b/base/gscspace.c
index e847b383..81baac9a 100644
--- a/base/gscspace.c
+++ b/base/gscspace.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -429,6 +429,15 @@ void cs_adjust_counts_icc(gs_gstate *pgs, int delta)
}
}
+void cs_adjust_swappedcounts_icc(gs_gstate *pgs, int delta)
+{
+ gs_color_space *pcs = gs_swappedcolorspace_inline(pgs);
+
+ if (pcs) {
+ cs_adjust_swappedcounts(pgs, delta);
+ }
+}
+
/* ------ Other implementation procedures ------ */
/* Null color space installation procedure. */
@@ -497,7 +506,7 @@ gx_set_no_overprint(gs_gstate* pgs)
/* Retain all the spot colorants and not the process
colorants. This occurs if we have a process color
- mismatch between the source and the destination but
+ mismatch between the source and the destination but
the output device supports spot colors */
int
gx_set_spot_only_overprint(gs_gstate* pgs)
@@ -597,25 +606,25 @@ check_cmyk_color_model_comps(gx_device * dev)
dev,
"Cyan",
sizeof("Cyan") - 1,
- NO_COMP_NAME_TYPE )) < 0 ||
+ NO_COMP_NAME_TYPE_OP)) < 0 ||
cyan_c == GX_DEVICE_COLOR_MAX_COMPONENTS ||
(magenta_c = dev_proc(dev, get_color_comp_index)(
dev,
"Magenta",
sizeof("Magenta") - 1,
- NO_COMP_NAME_TYPE )) < 0 ||
+ NO_COMP_NAME_TYPE_OP)) < 0 ||
magenta_c == GX_DEVICE_COLOR_MAX_COMPONENTS ||
(yellow_c = dev_proc(dev, get_color_comp_index)(
dev,
"Yellow",
sizeof("Yellow") - 1,
- NO_COMP_NAME_TYPE )) < 0 ||
+ NO_COMP_NAME_TYPE_OP)) < 0 ||
yellow_c == GX_DEVICE_COLOR_MAX_COMPONENTS ||
(black_c = dev_proc(dev, get_color_comp_index)(
dev,
"Black",
sizeof("Black") - 1,
- NO_COMP_NAME_TYPE )) < 0 ||
+ NO_COMP_NAME_TYPE_OP)) < 0 ||
black_c == GX_DEVICE_COLOR_MAX_COMPONENTS )
return 0;
@@ -724,8 +733,7 @@ int gx_set_overprint_cmyk(const gs_color_space * pcs, gs_gstate * pgs)
/* correct for any zero'ed color components. But only if profiles
match AND pgs->overprint_mode is true */
if (pcs->cmm_icc_profile_data != NULL && output_profile != NULL) {
- if (output_profile->hashcode ==
- pcs->cmm_icc_profile_data->hashcode) {
+ if (gsicc_profiles_equal(output_profile, pcs->cmm_icc_profile_data)) {
profile_ok = true;
}
}
@@ -759,13 +767,13 @@ int gx_set_overprint_cmyk(const gs_color_space * pcs, gs_gstate * pgs)
space has to be CMYK. Trick is that we do need to worry about
the colorant order on the target device */
num_colorant[0] = (dev_proc(dev, get_color_comp_index))\
- (dev, "Cyan", strlen("Cyan"), NO_COMP_NAME_TYPE);
+ (dev, "Cyan", strlen("Cyan"), NO_COMP_NAME_TYPE_OP);
num_colorant[1] = (dev_proc(dev, get_color_comp_index))\
- (dev, "Magenta", strlen("Magenta"), NO_COMP_NAME_TYPE);
+ (dev, "Magenta", strlen("Magenta"), NO_COMP_NAME_TYPE_OP);
num_colorant[2] = (dev_proc(dev, get_color_comp_index))\
- (dev, "Yellow", strlen("Yellow"), NO_COMP_NAME_TYPE);
+ (dev, "Yellow", strlen("Yellow"), NO_COMP_NAME_TYPE_OP);
num_colorant[3] = (dev_proc(dev, get_color_comp_index))\
- (dev, "Black", strlen("Black"), NO_COMP_NAME_TYPE);
+ (dev, "Black", strlen("Black"), NO_COMP_NAME_TYPE_OP);
nz_comps = 0;
one = 1;
colorant_ok = true;
diff --git a/base/gscspace.h b/base/gscspace.h
index 0c07ccef..9804efe2 100644
--- a/base/gscspace.h
+++ b/base/gscspace.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -341,7 +341,7 @@ struct gs_color_space_s {
gs_color_space *gs_cspace_new_DeviceGray(gs_memory_t *mem);
gs_color_space *gs_cspace_new_DeviceRGB(gs_memory_t *mem);
gs_color_space *gs_cspace_new_DeviceCMYK(gs_memory_t *mem);
-gs_color_space *gs_cspace_new_ICC(gs_memory_t *pmem, gs_gstate * pgs,
+gs_color_space *gs_cspace_new_ICC(gs_memory_t *pmem, gs_gstate * pgs,
int components);
gs_color_space *gs_cspace_new_scrgb(gs_memory_t *pmem, gs_gstate * pgs);
@@ -397,6 +397,8 @@ void rc_decrement_only_cs(gs_color_space *pcs, const char *cname);
void cs_adjust_counts_icc(gs_gstate *pgs, int delta);
+void cs_adjust_swappedcounts_icc(gs_gstate *pgs, int delta);
+
/* backwards compatibility */
#define gs_color_space_indexed_base_space(pcspace)\
gs_cspace_base_space(pcspace)
diff --git a/base/gscssub.c b/base/gscssub.c
index 7891a4e3..fed15545 100644
--- a/base/gscssub.c
+++ b/base/gscssub.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gscssub.h b/base/gscssub.h
index 0835c00c..95572161 100644
--- a/base/gscssub.h
+++ b/base/gscssub.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsdcolor.h b/base/gsdcolor.h
index 778da76b..367dcd48 100644
--- a/base/gsdcolor.h
+++ b/base/gsdcolor.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsdevice.c b/base/gsdevice.c
index ac78af93..630ed493 100644
--- a/base/gsdevice.c
+++ b/base/gsdevice.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -32,6 +32,7 @@
#include "gxcmap.h"
#include "gxdevice.h"
#include "gxdevmem.h"
+#include "gxdevsop.h"
#include "gxiodev.h"
#include "gxcspace.h"
#include "gsicc_manage.h"
@@ -70,6 +71,10 @@ gx_device_finalize(const gs_memory_t *cmem, void *vptr)
rc_decrement(dev->PageList, "gx_device_finalize(PageList)");
dev->PageList = 0;
}
+ if (dev->NupControl) {
+ rc_decrement(dev->NupControl, "gx_device_finalize(NupControl)");
+ dev->NupControl = 0;
+ }
if (dev->finalize)
dev->finalize(dev);
@@ -201,7 +206,7 @@ gs_output_page(gs_gstate * pgs, int num_copies, int flush)
((code = gs_fill(pgs)) < 0))
{
gs_grestore(pgs);
- return code;
+ return code;
}
code = gs_grestore(pgs);
if (code < 0)
@@ -645,6 +650,7 @@ gs_make_null_device(gx_device_null *dev_null, gx_device *dev,
{
gx_device_init((gx_device *)dev_null, (const gx_device *)&gs_null_device,
mem, true);
+ gx_device_fill_in_procs((gx_device *)dev_null);
gx_device_set_target((gx_device_forward *)dev_null, dev);
if (dev) {
/* The gx_device_copy_color_params() call below should
@@ -786,7 +792,10 @@ gx_device_raster(const gx_device * dev, bool pad)
int l2align;
if (dev->is_planar)
- bits /= dev->color_info.num_components;
+ {
+ int has_tags = device_encodes_tags(dev);
+ bits /= (dev->color_info.num_components + has_tags);
+ }
raster = (uint)((bits + 7) >> 3);
if (!pad)
@@ -869,9 +878,21 @@ gx_device_set_hwsize_from_media(gx_device *dev)
int rot = (dev->LeadingEdge & 1);
double rot_media_x = rot ? dev->MediaSize[1] : dev->MediaSize[0];
double rot_media_y = rot ? dev->MediaSize[0] : dev->MediaSize[1];
+ gx_device *parent = dev;
+ int hwsize[2];
- dev->width = (int)(rot_media_x * dev->HWResolution[0] / 72.0 + 0.5);
- dev->height = (int)(rot_media_y * dev->HWResolution[1] / 72.0 + 0.5);
+ /* Try the spec_op to give the device to control it */
+ hwsize[0] = (int)(rot_media_x * dev->HWResolution[0] / 72.0 + 0.5);
+ hwsize[1] = (int)(rot_media_y * dev->HWResolution[1] / 72.0 + 0.5);
+
+ while (parent->parent != NULL) {
+ parent = parent->parent;
+ }
+ if (dev_proc(parent, dev_spec_op)(parent, gxdso_set_HWSize, &hwsize, sizeof(hwsize)) <= 0) {
+ /* just do the default setting */
+ dev->width = hwsize[0];
+ dev->height = hwsize[1];
+ }
}
static void
@@ -1155,7 +1176,7 @@ int gx_device_delete_output_file(const gx_device * dev, const char *fname)
if (pfname == NULL) {
code = gs_note_error(gs_error_VMerror);
- goto done;
+ goto done;
}
code = gx_parse_output_file_name(&parsed, &fmt, fname, strlen(fname),
@@ -1214,7 +1235,7 @@ gx_device_open_output_file(const gx_device * dev, char *fname,
if (pfname == NULL) {
code = gs_note_error(gs_error_VMerror);
- goto done;
+ goto done;
}
if (strlen(fname) == 0) {
@@ -1230,8 +1251,8 @@ gx_device_open_output_file(const gx_device * dev, char *fname,
if (parsed.iodev && !strcmp(parsed.iodev->dname, "%stdout%")) {
if (parsed.fname) {
code = gs_note_error(gs_error_undefinedfilename);
- goto done;
- }
+ goto done;
+ }
*pfile = gp_file_FILE_alloc(dev->memory);
if (*pfile == NULL) {
code = gs_note_error(gs_error_VMerror);
@@ -1240,7 +1261,7 @@ gx_device_open_output_file(const gx_device * dev, char *fname,
gp_file_FILE_set(*pfile, dev->memory->gs_lib_ctx->core->fstdout, noclose);
/* Force stdout to binary. */
code = gp_setmode_binary_impl(dev->memory->gs_lib_ctx->core->fstdout, true);
- goto done;
+ goto done;
} else if (parsed.iodev && !strcmp(parsed.iodev->dname, "%pipe%")) {
positionable = false;
}
@@ -1267,8 +1288,8 @@ gx_device_open_output_file(const gx_device * dev, char *fname,
if (!parsed.fname) {
code = gs_note_error(gs_error_undefinedfilename);
- goto done;
- }
+ goto done;
+ }
strcpy(fmode, gp_fmode_wb);
if (positionable)
strcat(fmode, "+");
diff --git a/base/gsdevice.h b/base/gsdevice.h
index 35f1e38c..f913c20f 100644
--- a/base/gsdevice.h
+++ b/base/gsdevice.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsdevmem.c b/base/gsdevmem.c
index 78443bfd..fec67ee4 100644
--- a/base/gsdevmem.c
+++ b/base/gsdevmem.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsdll.h b/base/gsdll.h
index 8f0137cb..901845b3 100644
--- a/base/gsdll.h
+++ b/base/gsdll.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsdllwin.h b/base/gsdllwin.h
index f04dad46..d537ff7f 100644
--- a/base/gsdllwin.h
+++ b/base/gsdllwin.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsdparam.c b/base/gsdparam.c
index a07a7c33..b86dcfb4 100644
--- a/base/gsdparam.c
+++ b/base/gsdparam.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -20,14 +20,23 @@
#include "gserrors.h"
#include "gsdevice.h" /* for prototypes */
#include "gsparam.h"
+#include "gsparamx.h" /* for param_put_enum */
#include "gxdevice.h"
+#include "gxdevsop.h"
#include "gxfixed.h"
#include "gsicc_manage.h"
+#include "gdevnup.h" /* to install N-up subclass device */
+extern gx_device_nup gs_nup_device;
/* Define whether we accept PageSize as a synonym for MediaSize. */
/* This is for backward compatibility only. */
#define PAGESIZE_IS_MEDIASIZE
+/* Names corresponding to gs_overprint_control_t enum */
+static const char *const overprint_control_names[] = {
+ gs_overprint_control_names, 0
+};
+
/* ================ Getting parameters ================ */
/* Forward references */
@@ -87,7 +96,9 @@ int gx_default_get_param(gx_device *dev, char *Param, void *list)
bool devicegraytok = true; /* Default if device profile stuct not set */
bool graydetection = false;
bool usefastcolor = false; /* set for unmanaged color */
- bool sim_overprint = true; /* By default simulate overprinting (only valid with cmyk devices) */
+ bool blacktext = false;
+ /* By default overprinting only valid with cmyk devices */
+ gs_overprint_control_t overprint_control = gs_overprint_control_enable;
bool prebandthreshold = true, temp_bool = false;
if(strcmp(Param, "OutputDevice") == 0){
@@ -221,6 +232,9 @@ int gx_default_get_param(gx_device *dev, char *Param, void *list)
if (strcmp(Param, "PageUsesTransparency") == 0) {
return param_write_bool(plist, "PageUsesTransparency", &dev->page_uses_transparency);
}
+ if (strcmp(Param, "PageUsesOverprint") == 0) {
+ return param_write_bool(plist, "PageUsesOverprint", &dev->page_uses_overprint);
+ }
if (strcmp(Param, "MaxBitmap") == 0) {
return param_write_size_t(plist, "MaxBitmap", &(dev->space_params.MaxBitmap));
}
@@ -340,7 +354,8 @@ int gx_default_get_param(gx_device *dev, char *Param, void *list)
devicegraytok = dev_profile->devicegraytok;
graydetection = dev_profile->graydetection;
usefastcolor = dev_profile->usefastcolor;
- sim_overprint = dev_profile->sim_overprint;
+ blacktext = dev_profile->blacktext;
+ overprint_control = dev_profile->overprint_control;
prebandthreshold = dev_profile->prebandthreshold;
/* With respect to Output profiles that have non-standard colorants,
we rely upon the default profile to give us the colorants if they do
@@ -380,8 +395,15 @@ int gx_default_get_param(gx_device *dev, char *Param, void *list)
if (strcmp(Param, "UseFastColor") == 0) {
return param_write_bool(plist, "UseFastColor", &usefastcolor);
}
- if (strcmp(Param, "SimulateOverprint") == 0) {
- return param_write_bool(plist, "SimulateOverprint", &sim_overprint);
+ if (strcmp(Param, "BlackText") == 0) {
+ return param_write_bool(plist, "BlackText", &blacktext);
+ }
+ if (strcmp(Param, "Overprint") == 0) {
+ gs_param_string opc_name;
+ const char *s = overprint_control_names[(int)overprint_control];
+
+ param_string_from_string(opc_name, s);
+ return param_write_name(plist, "Overprint", &opc_name);
}
if (strcmp(Param, "PreBandThreshold") == 0) {
return param_write_bool(plist, "PreBandThreshold", &prebandthreshold);
@@ -462,6 +484,17 @@ int gx_default_get_param(gx_device *dev, char *Param, void *list)
temp_bool = dev->DisablePageHandler;
return param_write_bool(plist, "DisablePageHandler", &temp_bool);
}
+ if (strcmp(Param, "NupControl") == 0){
+ gs_param_string nupcontrol;
+
+ if (dev->NupControl) {
+ gdev_nupcontrol *p = (gdev_nupcontrol *)dev->NupControl;
+ param_string_from_string(nupcontrol, p->nupcontrol_str);
+ }
+ else
+ param_string_from_string(nupcontrol, null_str);
+ return param_write_string(plist, "NupControl", &nupcontrol);
+ }
if (strcmp(Param, "PageList") == 0){
gs_param_string pagelist;
if (dev->PageList) {
@@ -498,7 +531,7 @@ gx_default_get_params(gx_device * dev, gs_param_list * plist)
bool seprs = false;
gs_param_string dns, pcms, profile_array[NUM_DEVICE_PROFILES];
- gs_param_string blend_profile, postren_profile, pagelist;
+ gs_param_string blend_profile, postren_profile, pagelist, nuplist;
gs_param_string proof_profile, link_profile, icc_colorants;
gsicc_rendering_intents_t profile_intents[NUM_DEVICE_PROFILES];
gsicc_blackptcomp_t blackptcomps[NUM_DEVICE_PROFILES];
@@ -506,7 +539,9 @@ gx_default_get_params(gx_device * dev, gs_param_list * plist)
bool devicegraytok = true; /* Default if device profile stuct not set */
bool graydetection = false;
bool usefastcolor = false; /* set for unmanaged color */
- bool sim_overprint = true; /* By default simulate overprinting */
+ bool blacktext = false;
+ /* By default, only overprint if the device supports it */
+ gs_overprint_control_t overprint_control = gs_overprint_control_enable;
bool prebandthreshold = true, temp_bool;
int k;
int color_accuracy = MAX_COLOR_ACCURACY;
@@ -619,7 +654,8 @@ gx_default_get_params(gx_device * dev, gs_param_list * plist)
devicegraytok = dev_profile->devicegraytok;
graydetection = dev_profile->graydetection;
usefastcolor = dev_profile->usefastcolor;
- sim_overprint = dev_profile->sim_overprint;
+ blacktext = dev_profile->blacktext;
+ overprint_control = dev_profile->overprint_control;
prebandthreshold = dev_profile->prebandthreshold;
/* With respect to Output profiles that have non-standard colorants,
we rely upon the default profile to give us the colorants if they do
@@ -679,7 +715,7 @@ gx_default_get_params(gx_device * dev, gs_param_list * plist)
(code = param_write_bool(plist, "DeviceGrayToK", &devicegraytok)) < 0 ||
(code = param_write_bool(plist, "GrayDetection", &graydetection)) < 0 ||
(code = param_write_bool(plist, "UseFastColor", &usefastcolor)) < 0 ||
- (code = param_write_bool(plist, "SimulateOverprint", &sim_overprint)) < 0 ||
+ (code = param_write_bool(plist, "BlackText", &blacktext)) < 0 ||
(code = param_write_bool(plist, "PreBandThreshold", &prebandthreshold)) < 0 ||
(code = param_write_string(plist,"OutputICCProfile", &(profile_array[0]))) < 0 ||
(code = param_write_string(plist,"GraphicICCProfile", &(profile_array[1]))) < 0 ||
@@ -721,6 +757,7 @@ gx_default_get_params(gx_device * dev, gs_param_list * plist)
(code = param_write_bool(plist, ".LockSafetyParams", &dev->LockSafetyParams)) < 0 ||
(code = param_write_size_t(plist, "MaxPatternBitmap", &dev->MaxPatternBitmap)) < 0 ||
(code = param_write_bool(plist, "PageUsesTransparency", &dev->page_uses_transparency)) < 0 ||
+ (code = param_write_bool(plist, "PageUsesOverprint", &dev->page_uses_overprint)) < 0 ||
(code = param_write_size_t(plist, "MaxBitmap", &(dev->space_params.MaxBitmap))) < 0 ||
(code = param_write_size_t(plist, "BandBufferSpace", &dev->space_params.band.BandBufferSpace)) < 0 ||
(code = param_write_int(plist, "BandHeight", &dev->space_params.band.BandHeight)) < 0 ||
@@ -729,7 +766,13 @@ gx_default_get_params(gx_device * dev, gs_param_list * plist)
(code = param_write_int(plist, "InterpolateControl", &dev->interpolate_control)) < 0
)
return code;
+ {
+ gs_param_string opc_name;
+ const char *s = overprint_control_names[(int)overprint_control];
+ param_string_from_string(opc_name, s);
+ param_write_name(plist, "Overprint", &opc_name);
+ }
/* If LeadingEdge was set explicitly, report it here. */
if (dev->LeadingEdge & LEADINGEDGE_SET_MASK) {
int leadingedge = dev->LeadingEdge & LEADINGEDGE_MASK;
@@ -748,12 +791,21 @@ gx_default_get_params(gx_device * dev, gs_param_list * plist)
if ((code = param_write_bool(plist, "DisablePageHandler", &temp_bool)) < 0)
return code;
+ if (dev->NupControl) {
+ gdev_nupcontrol *p = (gdev_nupcontrol *)dev->NupControl;
+ param_string_from_string(nuplist, p->nupcontrol_str);
+ } else {
+ param_string_from_string(nuplist, null_str);
+ }
+ if ((code = param_write_string(plist, "NupControl", &nuplist)) < 0)
+ return code;
+
if (dev->PageList) {
gdev_pagelist *p = (gdev_pagelist *)dev->PageList;
param_string_from_string(pagelist, p->Pages);
- }
- else
+ } else {
param_string_from_string(pagelist, null_str);
+ }
if ((code = param_write_string(plist, "PageList", &pagelist)) < 0)
return code;
@@ -1002,6 +1054,8 @@ gs_putdeviceparams(gx_device * dev, gs_param_list * plist)
bool was_open = dev->is_open;
int code;
+ /* gs_param_list_dump(plist); */
+
gx_device_set_procs(dev);
fill_dev_proc(dev, put_params, gx_default_put_params);
fill_dev_proc(dev, get_alpha_bits, gx_default_get_alpha_bits);
@@ -1028,7 +1082,7 @@ gx_default_put_graydetection(bool graydetection, gx_device * dev)
may not be fully set up at this time. */
if (dev->icc_struct == NULL) {
/* Allocate at this time the structure */
- dev->icc_struct = gsicc_new_device_profile_array(dev->memory);
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
}
dev->icc_struct->graydetection = graydetection;
dev->icc_struct->pageneutralcolor = graydetection;
@@ -1036,7 +1090,7 @@ gx_default_put_graydetection(bool graydetection, gx_device * dev)
code = dev_proc(dev, get_profile)(dev, &profile_struct);
if (profile_struct == NULL) {
/* Create now */
- dev->icc_struct = gsicc_new_device_profile_array(dev->memory);
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
profile_struct = dev->icc_struct;
}
profile_struct->graydetection = graydetection;
@@ -1064,7 +1118,7 @@ gx_default_put_graytok(bool graytok, gx_device * dev)
may not be fully set up at this time. */
if (dev->icc_struct == NULL) {
/* Allocate at this time the structure */
- dev->icc_struct = gsicc_new_device_profile_array(dev->memory);
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
if (dev->icc_struct == NULL)
return_error(gs_error_VMerror);
}
@@ -1073,7 +1127,7 @@ gx_default_put_graytok(bool graytok, gx_device * dev)
code = dev_proc(dev, get_profile)(dev, &profile_struct);
if (profile_struct == NULL) {
/* Create now */
- dev->icc_struct = gsicc_new_device_profile_array(dev->memory);
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
profile_struct = dev->icc_struct;
if (profile_struct == NULL)
return_error(gs_error_VMerror);
@@ -1102,7 +1156,7 @@ gx_default_put_prebandthreshold(bool prebandthreshold, gx_device * dev)
may not be fully set up at this time. */
if (dev->icc_struct == NULL) {
/* Allocate at this time the structure */
- dev->icc_struct = gsicc_new_device_profile_array(dev->memory);
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
if (dev->icc_struct == NULL)
return_error(gs_error_VMerror);
}
@@ -1111,7 +1165,7 @@ gx_default_put_prebandthreshold(bool prebandthreshold, gx_device * dev)
code = dev_proc(dev, get_profile)(dev, &profile_struct);
if (profile_struct == NULL) {
/* Create now */
- dev->icc_struct = gsicc_new_device_profile_array(dev->memory);
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
profile_struct = dev->icc_struct;
if (profile_struct == NULL)
return_error(gs_error_VMerror);
@@ -1140,7 +1194,7 @@ gx_default_put_usefastcolor(bool fastcolor, gx_device * dev)
may not be fully set up at this time. */
if (dev->icc_struct == NULL) {
/* Allocate at this time the structure */
- dev->icc_struct = gsicc_new_device_profile_array(dev->memory);
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
if (dev->icc_struct == NULL)
return_error(gs_error_VMerror);
}
@@ -1149,7 +1203,7 @@ gx_default_put_usefastcolor(bool fastcolor, gx_device * dev)
code = dev_proc(dev, get_profile)(dev, &profile_struct);
if (profile_struct == NULL) {
/* Create now */
- dev->icc_struct = gsicc_new_device_profile_array(dev->memory);
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
profile_struct = dev->icc_struct;
if (profile_struct == NULL)
return_error(gs_error_VMerror);
@@ -1160,7 +1214,34 @@ gx_default_put_usefastcolor(bool fastcolor, gx_device * dev)
}
static int
-gx_default_put_simulateoverprint(bool sim_overprint, gx_device * dev)
+gx_default_put_blacktext(bool blacktext, gx_device* dev)
+{
+ int code = 0;
+ cmm_dev_profile_t* profile_struct;
+
+ if (dev_proc(dev, get_profile) == NULL) {
+ if (dev->icc_struct == NULL) {
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
+ if (dev->icc_struct == NULL)
+ return_error(gs_error_VMerror);
+ }
+ dev->icc_struct->blacktext = blacktext;
+ } else {
+ code = dev_proc(dev, get_profile)(dev, &profile_struct);
+ if (profile_struct == NULL) {
+ /* Create now */
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
+ profile_struct = dev->icc_struct;
+ if (profile_struct == NULL)
+ return_error(gs_error_VMerror);
+ }
+ profile_struct->blacktext = blacktext;
+ }
+ return code;
+}
+
+static int
+gx_default_put_overprint_control(gs_overprint_control_t overprint_control, gx_device * dev)
{
int code = 0;
cmm_dev_profile_t *profile_struct;
@@ -1178,21 +1259,21 @@ gx_default_put_simulateoverprint(bool sim_overprint, gx_device * dev)
may not be fully set up at this time. */
if (dev->icc_struct == NULL) {
/* Allocate at this time the structure */
- dev->icc_struct = gsicc_new_device_profile_array(dev->memory);
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
if (dev->icc_struct == NULL)
return_error(gs_error_VMerror);
}
- dev->icc_struct->sim_overprint = sim_overprint;
+ dev->icc_struct->overprint_control = overprint_control;
} else {
code = dev_proc(dev, get_profile)(dev, &profile_struct);
if (profile_struct == NULL) {
/* Create now */
- dev->icc_struct = gsicc_new_device_profile_array(dev->memory);
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
profile_struct = dev->icc_struct;
if (profile_struct == NULL)
return_error(gs_error_VMerror);
}
- profile_struct->sim_overprint = sim_overprint;
+ profile_struct->overprint_control = overprint_control;
}
return code;
}
@@ -1215,7 +1296,7 @@ gx_default_put_intent(gsicc_rendering_intents_t icc_intent, gx_device * dev,
the target device */
if (dev->icc_struct == NULL) {
/* Intializes the device structure. Not the profile though for index */
- dev->icc_struct = gsicc_new_device_profile_array(dev->memory);
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
if (dev->icc_struct == NULL)
return_error(gs_error_VMerror);
}
@@ -1226,7 +1307,7 @@ gx_default_put_intent(gsicc_rendering_intents_t icc_intent, gx_device * dev,
return code;
if (profile_struct == NULL) {
/* Create now */
- dev->icc_struct = gsicc_new_device_profile_array(dev->memory);
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
if (dev->icc_struct == NULL)
return_error(gs_error_VMerror);
}
@@ -1253,7 +1334,7 @@ gx_default_put_blackpreserve(gsicc_blackpreserve_t blackpreserve, gx_device * de
the target device */
if (dev->icc_struct == NULL) {
/* Intializes the device structure. Not the profile though for index */
- dev->icc_struct = gsicc_new_device_profile_array(dev->memory);
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
if (dev->icc_struct == NULL)
return_error(gs_error_VMerror);
}
@@ -1264,7 +1345,7 @@ gx_default_put_blackpreserve(gsicc_blackpreserve_t blackpreserve, gx_device * de
return code;
if (profile_struct == NULL) {
/* Create now */
- dev->icc_struct = gsicc_new_device_profile_array(dev->memory);
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
if (dev->icc_struct == NULL)
return_error(gs_error_VMerror);
}
@@ -1294,7 +1375,7 @@ gx_default_put_blackptcomp(gsicc_blackptcomp_t blackptcomp, gx_device * dev,
the target device */
if (dev->icc_struct == NULL) {
/* Intializes the device structure. Not the profile though for index */
- dev->icc_struct = gsicc_new_device_profile_array(dev->memory);
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
if (dev->icc_struct == NULL)
return_error(gs_error_VMerror);
}
@@ -1305,7 +1386,7 @@ gx_default_put_blackptcomp(gsicc_blackptcomp_t blackptcomp, gx_device * dev,
return code;
if (profile_struct == NULL) {
/* Create now */
- dev->icc_struct = gsicc_new_device_profile_array(dev->memory);
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
if (dev->icc_struct == NULL)
return_error(gs_error_VMerror);
}
@@ -1363,6 +1444,19 @@ gx_default_put_icc(gs_param_string *icc_pro, gx_device * dev,
return code;
}
+void rc_free_NupControl(gs_memory_t * mem, void *ptr_in, client_name_t cname); /* silence warning */
+/* Exported for use by nup_put_params in gdevnup.c */
+void
+rc_free_NupControl(gs_memory_t * mem, void *ptr_in, client_name_t cname)
+{
+ gdev_nupcontrol *pnupc = (gdev_nupcontrol *)ptr_in;
+
+ if (pnupc->rc.ref_count <= 1) {
+ gs_free(mem->non_gc_memory, pnupc->nupcontrol_str, 1, strlen(pnupc->nupcontrol_str), "free nupcontrol string");
+ gs_free(mem->non_gc_memory, pnupc, 1, sizeof(gdev_nupcontrol), "free structure to hold nupcontrol string");
+ }
+}
+
static void
rc_free_pages_list(gs_memory_t * mem, void *ptr_in, client_name_t cname)
{
@@ -1409,19 +1503,21 @@ gx_default_put_params(gx_device * dev, gs_param_list * plist)
size_t mpbm = dev->MaxPatternBitmap;
int ic = dev->interpolate_control;
bool page_uses_transparency = dev->page_uses_transparency;
+ bool page_uses_overprint = dev->page_uses_overprint;
gdev_space_params sp = dev->space_params;
gdev_space_params save_sp = dev->space_params;
int rend_intent[NUM_DEVICE_PROFILES];
int blackptcomp[NUM_DEVICE_PROFILES];
int blackpreserve[NUM_DEVICE_PROFILES];
- gs_param_string cms, pagelist;
+ gs_param_string cms, pagelist, nuplist;
int leadingedge = dev->LeadingEdge;
int k;
int color_accuracy;
bool devicegraytok = true;
bool graydetection = false;
bool usefastcolor = false;
- bool sim_overprint = true;
+ bool blacktext = false;
+ gs_overprint_control_t overprint_control = gs_overprint_control_enable;
bool prebandthreshold = false;
bool use_antidropout = dev->color_info.use_antidropout_downscaler;
bool temp_bool;
@@ -1440,8 +1536,9 @@ gx_default_put_params(gx_device * dev, gs_param_list * plist)
graydetection = dev->icc_struct->graydetection;
devicegraytok = dev->icc_struct->devicegraytok;
usefastcolor = dev->icc_struct->usefastcolor;
+ blacktext = dev->icc_struct->blacktext;
prebandthreshold = dev->icc_struct->prebandthreshold;
- sim_overprint = dev->icc_struct->sim_overprint;
+ overprint_control = dev->icc_struct->overprint_control;
} else {
for (k = 0; k < NUM_DEVICE_PROFILES; k++) {
rend_intent[k] = gsRINOTSPECIFIED;
@@ -1750,8 +1847,13 @@ nce:
ecode = code;
param_signal_error(plist, param_name, ecode);
}
- if ((code = param_read_bool(plist, (param_name = "SimulateOverprint"),
- &sim_overprint)) < 0) {
+ if ((code = param_read_bool(plist, (param_name = "BlackText"),
+ &blacktext)) < 0) {
+ ecode = code;
+ param_signal_error(plist, param_name, ecode);
+ }
+ if ((code = param_put_enum(plist, "Overprint",
+ (int*)&overprint_control, overprint_control_names, ecode)) < 0) {
ecode = code;
param_signal_error(plist, param_name, ecode);
}
@@ -1779,6 +1881,11 @@ nce:
ecode = code;
param_signal_error(plist, param_name, ecode);
}
+ if ((code = param_read_bool(plist, (param_name = "PageUsesOverprint"),
+ &page_uses_overprint)) < 0) {
+ ecode = code;
+ param_signal_error(plist, param_name, ecode);
+ }
if ((code = param_read_size_t(plist, "MaxBitmap", &sp.MaxBitmap)) < 0)
ecode = code;
@@ -1925,6 +2032,61 @@ label:\
if (code == 0)
dev->DisablePageHandler = temp_bool;
+ /* If we have an NupControl subclass device (N-up) installed, this param will have */
+ /* been handled there, so the check for different will be false, meaning that this */
+ /* code won't end up doing anything. This will catch the first occurence and needs */
+ /* to install the N-up subclass device. */
+ code = param_read_string(plist, "NupControl", &nuplist);
+ if (code < 0)
+ ecode = code;
+ if (code == 0) {
+ if (dev->NupControl && (
+ nuplist.size == 0 ||
+ (strncmp(dev->NupControl->nupcontrol_str, (const char *)nuplist.data, nuplist.size) != 0))) {
+ /* There was a NupControl, but this one is different -- no longer use the old one */
+ rc_decrement(dev->NupControl, "default put_params NupControl");
+ dev->NupControl = NULL;
+ }
+ }
+ if (dev->NupControl == NULL && code == 0 && nuplist.size > 0) {
+ gx_device *next_dev;
+
+ dev->NupControl = (gdev_nupcontrol *)gs_alloc_bytes(dev->memory->non_gc_memory,
+ sizeof(gdev_nupcontrol), "structure to hold nupcontrol_str");
+ if (dev->NupControl == NULL)
+ return gs_note_error(gs_error_VMerror);
+ dev->NupControl->nupcontrol_str = (void *)gs_alloc_bytes(dev->memory->non_gc_memory,
+ nuplist.size + 1, "nupcontrol string");
+ if (dev->NupControl->nupcontrol_str == NULL){
+ gs_free(dev->memory->non_gc_memory, dev->NupControl, 1, sizeof(gdev_nupcontrol),
+ "free structure to hold nupcontrol string");
+ dev->NupControl = 0;
+ return gs_note_error(gs_error_VMerror);
+ }
+ memset(dev->NupControl->nupcontrol_str, 0x00, nuplist.size + 1);
+ memcpy(dev->NupControl->nupcontrol_str, nuplist.data, nuplist.size);
+ rc_init_free(dev->NupControl, dev->memory->non_gc_memory, 1, rc_free_NupControl);
+
+ /* Propagate the new NupControl struct to children */
+ next_dev = dev->child;
+ while (next_dev != NULL) {
+ if (next_dev->NupControl)
+ rc_decrement(next_dev->NupControl, "nup_put_params");
+ next_dev->NupControl = dev->NupControl;
+ rc_increment(dev->NupControl);
+ next_dev = next_dev->child;
+ }
+ /* Propagate the new NupControl struct to parents */
+ next_dev = dev->parent;
+ while (next_dev != NULL) {
+ if (next_dev->NupControl)
+ rc_decrement(next_dev->NupControl, "nup_put_params");
+ next_dev->NupControl = dev->NupControl;
+ rc_increment(dev->NupControl);
+ next_dev = next_dev->parent;
+ }
+ }
+
code = param_read_string(plist, "PageList", &pagelist);
if (code < 0)
ecode = code;
@@ -2079,6 +2241,7 @@ label:\
dev->interpolate_control = ic;
dev->space_params = sp;
dev->page_uses_transparency = page_uses_transparency;
+ dev->page_uses_overprint = page_uses_overprint;
gx_device_decache_colors(dev);
/* Take care of the rendering intents and blackpts. For those that
@@ -2130,7 +2293,10 @@ label:\
code = gx_default_put_usefastcolor(usefastcolor, dev);
if (code < 0)
return code;
- code = gx_default_put_simulateoverprint(sim_overprint, dev);
+ code = gx_default_put_blacktext(blacktext, dev);
+ if (code < 0)
+ return code;
+ code = gx_default_put_overprint_control(overprint_control, dev);
if (code < 0)
return code;
code = gx_default_put_graydetection(graydetection, dev);
diff --git a/base/gsdps1.c b/base/gsdps1.c
index 84980d4b..640853d5 100644
--- a/base/gsdps1.c
+++ b/base/gsdps1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -196,7 +196,7 @@ gs_rectfill(gs_gstate * pgs, const gs_rect * pr, uint count)
const gs_gstate *pgs2 = (const gs_gstate *)pgs;
bool hl_color_available = gx_hld_is_hl_color_available(pgs2, pdc);
bool hl_color = (hl_color_available &&
- dev_proc(pdev, dev_spec_op)(pdev, gxdso_supports_hlcolor,
+ dev_proc(pdev, dev_spec_op)(pdev, gxdso_supports_hlcolor,
NULL, 0));
bool center_of_pixel = (pgs->fill_adjust.x == 0 && pgs->fill_adjust.y == 0);
@@ -206,7 +206,12 @@ gs_rectfill(gs_gstate * pgs, const gs_rect * pr, uint count)
code = gx_set_dev_color(pgs);
if (code != 0)
return code;
- if ((is_fzero2(pgs->ctm.xy, pgs->ctm.yx) ||
+
+ if ( !(pgs->device->page_uses_transparency ||
+ dev_proc(pgs->device, dev_spec_op)(pgs->device,
+ gxdso_is_pdf14_device, &(pgs->device),
+ sizeof(pgs->device))) &&
+ (is_fzero2(pgs->ctm.xy, pgs->ctm.yx) ||
is_fzero2(pgs->ctm.xx, pgs->ctm.yy)) &&
gx_effective_clip_path(pgs, &pcpath) >= 0 &&
clip_list_is_rectangle(gx_cpath_list(pcpath)) &&
diff --git a/base/gsdsrc.c b/base/gsdsrc.c
index fcfb9d58..4b5ddad2 100644
--- a/base/gsdsrc.c
+++ b/base/gsdsrc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsdsrc.h b/base/gsdsrc.h
index a9afae66..8807384d 100644
--- a/base/gsdsrc.h
+++ b/base/gsdsrc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsequivc.c b/base/gsequivc.c
index fabcd331..e89e23ab 100644
--- a/base/gsequivc.c
+++ b/base/gsequivc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -441,7 +441,7 @@ cmap_separation_capture_cmyk_color(frac all, gx_device_color * pdc,
dmprintf(pgs->memory, "cmap_separation_capture_cmyk_color - this routine should not be executed\n");
}
-/* The call to this is actually going to occur if we happen to be using a
+/* The call to this is actually going to occur if we happen to be using a
named color profile and doing a replacement. Since the destination profile
will have been CMYK based during the swap out to find the equivalent color, we can
go ahead and just grab the cmyk portion */
@@ -478,8 +478,8 @@ capture_spot_equivalent_cmyk_colors(gx_device * pdev, const gs_gstate * pgs,
0 /* blend_profile */, 0 /* postren_profile */,
{ {0} } /* rendercond[] */, 0 /* devicegraytok */,
0 /* graydection */, 0 /* pageneutralcolor */,
- 0 /* usefastcolor */, 0 /* supports_devn */,
- 0 /* sim_overprint */, 0 /* spotnames */,
+ 0 /* usefastcolor */, 0 /* blacktext */, 0 /* supports_devn */,
+ 0 /* overprint_control */, 0 /* spotnames */,
0 /* prebandthreshold */, 0 /* memory */,
{ 0 } /* rc_header */
};
@@ -487,6 +487,14 @@ capture_spot_equivalent_cmyk_colors(gx_device * pdev, const gs_gstate * pgs,
dev_proc(pdev, get_profile)(pdev, &dev_profile);
gsicc_extract_profile(pdev->graphics_type_tag,
dev_profile, &(curr_output_profile), &render_cond);
+
+ /* If the output profile is not CMYK based (which can happen during overprint
+ simulation. In particular when the blending space is RGB or Gray based.
+ Think of the case where the file has transparency and we are in an RGB
+ page group), then just use DefaultCMYK */
+ if (curr_output_profile->data_cs != gsCMYK)
+ curr_output_profile = pgs->icc_manager->default_cmyk;
+
/*
* Create a temp device. The primary purpose of this device is pass the
* separation number and a pointer to the original device's equivalent
@@ -499,6 +507,7 @@ capture_spot_equivalent_cmyk_colors(gx_device * pdev, const gs_gstate * pgs,
temp_device.memory = pgs->memory;
temp_profile.usefastcolor = false; /* This avoids a few headaches */
+ temp_profile.blacktext = false;
temp_profile.prebandthreshold = true;
temp_profile.supports_devn = false;
temp_profile.rendercond[0] = render_cond;
@@ -518,10 +527,10 @@ capture_spot_equivalent_cmyk_colors(gx_device * pdev, const gs_gstate * pgs,
for the CMYK + OG values. */
if (curr_output_profile->data_cs == gsNCHANNEL) {
- temp_profile.device_profile[GS_DEFAULT_DEVICE_PROFILE] =
+ temp_profile.device_profile[GS_DEFAULT_DEVICE_PROFILE] =
temp_state.icc_manager->default_cmyk;
} else {
- temp_profile.device_profile[GS_DEFAULT_DEVICE_PROFILE] =
+ temp_profile.device_profile[GS_DEFAULT_DEVICE_PROFILE] =
curr_output_profile;
}
set_dev_proc(&temp_device, get_profile, gx_default_get_profile);
diff --git a/base/gsequivc.h b/base/gsequivc.h
index 7fddce58..0ea3ead4 100644
--- a/base/gsequivc.h
+++ b/base/gsequivc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -45,7 +45,7 @@ typedef struct cmyk_color_s {
} cmyk_color;
/* if you make any additions/changes to the equivalent_cmyk_color_params or the
- cmyk_color structrs you need to make the appropriate additions/changes
+ cmyk_color structrs you need to make the appropriate additions/changes
to the compare_equivalent_cmyk_color_params() function in gdevdevn.c */
/*
diff --git a/base/gserrors.h b/base/gserrors.h
index d27b1c56..1bdbb8a0 100644
--- a/base/gserrors.h
+++ b/base/gserrors.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsexit.h b/base/gsexit.h
index 226942d9..f523bdec 100644
--- a/base/gsexit.h
+++ b/base/gsexit.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsfcid.c b/base/gsfcid.c
index 1dfd2a9b..198a3420 100644
--- a/base/gsfcid.c
+++ b/base/gsfcid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -112,9 +112,9 @@ subst_CID_on_WMode_finalize(const gs_memory_t *cmem, void *data)
gs_subst_CID_on_WMode_t *subst = (gs_subst_CID_on_WMode_t *)data;
(void)cmem; /* unused */
- gs_free_object(subst->rc.memory, subst->data + 0, "subst_CID_on_WMode_finalize");
+ gs_free_object(subst->rc.memory, subst->data[0], "subst_CID_on_WMode_finalize");
subst->data[0] = NULL;
- gs_free_object(subst->rc.memory, subst->data + 1, "subst_CID_on_WMode_finalize");
+ gs_free_object(subst->rc.memory, subst->data[1], "subst_CID_on_WMode_finalize");
subst->data[1] = NULL;
}
diff --git a/base/gsfcid2.c b/base/gsfcid2.c
index fe23b070..4e73dd5d 100644
--- a/base/gsfcid2.c
+++ b/base/gsfcid2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsfcmap.c b/base/gsfcmap.c
index 32a32fdf..f378d544 100644
--- a/base/gsfcmap.c
+++ b/base/gsfcmap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -643,6 +643,19 @@ gs_cmap_ToUnicode_realloc(gs_memory_t *mem, int new_value_size, gs_cmap_t **ppcm
return 0;
}
+int gs_cmap_ToUnicode_check_pair(gs_cmap_t *pcmap, int code0)
+{
+ gs_cmap_ToUnicode_t *cmap = (gs_cmap_ToUnicode_t *)pcmap;
+ uchar *map = pcmap->glyph_name_data;
+ const int num_codes = ((gs_cmap_ToUnicode_t *)pcmap)->num_codes;
+
+ if (code0 >= num_codes)
+ return 0;
+ if(map[code0 * (cmap->value_size + 2)] == 0 && map[code0 * (cmap->value_size + 2) + 1] == 0)
+ return 0;
+ return 1;
+}
+
/*
* Write a code pair to ToUnicode CMap.
*/
diff --git a/base/gsfcmap.h b/base/gsfcmap.h
index 73516c3e..161e982c 100644
--- a/base/gsfcmap.h
+++ b/base/gsfcmap.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -66,4 +66,6 @@ int gs_cmap_ToUnicode_realloc(gs_memory_t *mem, int new_value_size, gs_cmap_t **
*/
void gs_cmap_ToUnicode_add_pair(gs_cmap_t *pcmap, int code0, ushort *unicode, unsigned int length);
+int gs_cmap_ToUnicode_check_pair(gs_cmap_t *pcmap, int code0);
+
#endif /* gsfcmap_INCLUDED */
diff --git a/base/gsfcmap1.c b/base/gsfcmap1.c
index 7fc3403e..0add2c74 100644
--- a/base/gsfcmap1.c
+++ b/base/gsfcmap1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsflip.c b/base/gsflip.c
index b86dcf41..83024c6c 100644
--- a/base/gsflip.c
+++ b/base/gsflip.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsflip.h b/base/gsflip.h
index 9bbe8908..cf49674b 100644
--- a/base/gsflip.h
+++ b/base/gsflip.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsfname.c b/base/gsfname.c
index 37acd07c..5ae10046 100644
--- a/base/gsfname.c
+++ b/base/gsfname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsfname.h b/base/gsfname.h
index dcc5f359..2594d289 100644
--- a/base/gsfname.h
+++ b/base/gsfname.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsfont.c b/base/gsfont.c
index ba2e90ef..b8335c1d 100644
--- a/base/gsfont.c
+++ b/base/gsfont.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsfont.h b/base/gsfont.h
index 0c5298e0..f7f4c61a 100644
--- a/base/gsfont.h
+++ b/base/gsfont.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsfont0.c b/base/gsfont0.c
index 875a93a5..544163f4 100644
--- a/base/gsfont0.c
+++ b/base/gsfont0.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsfont0c.c b/base/gsfont0c.c
index 6d1d1585..99c93e93 100644
--- a/base/gsfont0c.c
+++ b/base/gsfont0c.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsform1.h b/base/gsform1.h
index 26f3353c..7d09c94a 100644
--- a/base/gsform1.h
+++ b/base/gsform1.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsftopts.h b/base/gsftopts.h
index bcfcb9da..7fcacac2 100644
--- a/base/gsftopts.h
+++ b/base/gsftopts.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsfunc.c b/base/gsfunc.c
index c45b652e..7a3ace5e 100644
--- a/base/gsfunc.c
+++ b/base/gsfunc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsfunc.h b/base/gsfunc.h
index 59f51464..24f28a5e 100644
--- a/base/gsfunc.h
+++ b/base/gsfunc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsfunc0.c b/base/gsfunc0.c
index 133c097f..897e4aaa 100644
--- a/base/gsfunc0.c
+++ b/base/gsfunc0.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsfunc0.h b/base/gsfunc0.h
index 7b7bb4f8..abf8214b 100644
--- a/base/gsfunc0.h
+++ b/base/gsfunc0.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsfunc3.c b/base/gsfunc3.c
index eee07a95..11968efd 100644
--- a/base/gsfunc3.c
+++ b/base/gsfunc3.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsfunc3.h b/base/gsfunc3.h
index 068de58c..f2fb2834 100644
--- a/base/gsfunc3.h
+++ b/base/gsfunc3.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsfunc4.c b/base/gsfunc4.c
index 7f8da5d1..d5daf9ce 100644
--- a/base/gsfunc4.c
+++ b/base/gsfunc4.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -232,7 +232,6 @@ fn_PtCr_evaluate(const gs_function_t *pfn_common, const float *in, float *out)
for (; ; ) {
int code, n;
- sw:
switch (op_defn_table[*p++].opcode[(vsp[-1].type << 2) + vsp->type]) {
/* Miscellaneous */
@@ -246,20 +245,16 @@ fn_PtCr_evaluate(const gs_function_t *pfn_common, const float *in, float *out)
case PtCr_int_to_float:
store_float(vsp, (double)vsp->value.i);
- --p; goto sw;
+ --p; continue;
case PtCr_int2_to_float:
store_float(vsp, (double)vsp->value.i);
/* fall through */
case PtCr_2nd_int_to_float:
store_float(vsp - 1, (double)vsp[-1].value.i);
- --p; goto sw;
+ --p; continue;
/* Arithmetic operators */
- case PtCr_abs_int:
- if (vsp->value.i < 0)
- goto neg_int;
- continue;
case PtCr_abs:
vsp->value.f = fabs(vsp->value.f);
continue;
@@ -359,8 +354,11 @@ fn_PtCr_evaluate(const gs_function_t *pfn_common, const float *in, float *out)
case PtCr_mul:
vsp[-1].value.f *= vsp->value.f;
--vsp; continue;
+ case PtCr_abs_int:
+ if (vsp->value.i >= 0)
+ continue;
+ /* fallthrough */
case PtCr_neg_int:
- neg_int:
if (vsp->value.i == min_int)
store_float(vsp, (double)vsp->value.i); /* =self negated */
else
@@ -415,11 +413,6 @@ fn_PtCr_evaluate(const gs_function_t *pfn_common, const float *in, float *out)
case PtCr_eq_int:
DO_REL(==, i);
goto rel;
- case PtCr_eq:
- DO_REL(==, f);
- rel:
- vsp[-1].type = CVT_BOOL;
- --vsp; continue;
case PtCr_ge_int:
DO_REL(>=, i);
goto rel;
@@ -450,6 +443,11 @@ fn_PtCr_evaluate(const gs_function_t *pfn_common, const float *in, float *out)
case PtCr_ne:
DO_REL(!=, f);
goto rel;
+ case PtCr_eq:
+ DO_REL(==, f);
+ rel:
+ vsp[-1].type = CVT_BOOL;
+ --vsp; continue;
#undef DO_REL
diff --git a/base/gsfunc4.h b/base/gsfunc4.h
index 2df906a4..ec98deeb 100644
--- a/base/gsfunc4.h
+++ b/base/gsfunc4.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsgc.h b/base/gsgc.h
index 481009ab..a02899cf 100644
--- a/base/gsgc.h
+++ b/base/gsgc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsgcache.c b/base/gsgcache.c
index c7a35dbe..6310adf2 100644
--- a/base/gsgcache.c
+++ b/base/gsgcache.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsgcache.h b/base/gsgcache.h
index aca563d8..b8c2d711 100644
--- a/base/gsgcache.h
+++ b/base/gsgcache.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsgdata.c b/base/gsgdata.c
index 8d254464..28dab849 100644
--- a/base/gsgdata.c
+++ b/base/gsgdata.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsgdata.h b/base/gsgdata.h
index 76617310..27e7c5b7 100644
--- a/base/gsgdata.h
+++ b/base/gsgdata.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsgstate.c b/base/gsgstate.c
index d74a6f09..6eb9b817 100644
--- a/base/gsgstate.c
+++ b/base/gsgstate.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -140,8 +140,15 @@ gs_gstate_initialize(gs_gstate * pgs, gs_memory_t * mem)
if (pgs->devicergb_cs == NULL || pgs->devicecmyk_cs == NULL)
return_error(gs_error_VMerror);
pgs->icc_link_cache = gsicc_cache_new(pgs->memory);
+ if (pgs->icc_link_cache == NULL)
+ return_error(gs_error_VMerror);
pgs->icc_manager = gsicc_manager_new(pgs->memory);
+ if (pgs->icc_manager == NULL)
+ return_error(gs_error_VMerror);
pgs->icc_profile_cache = gsicc_profilecache_new(pgs->memory);
+ if (pgs->icc_profile_cache == NULL)
+ return_error(gs_error_VMerror);
+ pgs->black_text_state = NULL;
#if ENABLE_CUSTOM_COLOR_CALLBACK
pgs->custom_color_callback = INIT_CUSTOM_COLOR_PTR;
#endif
@@ -168,6 +175,7 @@ gs_gstate_copied(gs_gstate * pgs)
rc_increment(pgs->icc_link_cache);
rc_increment(pgs->icc_profile_cache);
rc_increment(pgs->icc_manager);
+ rc_increment(pgs->black_text_state);
}
/* Adjust reference counts before assigning one gs_gstate to another. */
@@ -195,6 +203,7 @@ gs_gstate_pre_assign(gs_gstate *pto, const gs_gstate *pfrom)
RCCOPY(icc_link_cache);
RCCOPY(icc_profile_cache);
RCCOPY(icc_manager);
+ RCCOPY(black_text_state);
#undef RCCOPY
}
@@ -231,5 +240,6 @@ gs_gstate_release(gs_gstate * pgs)
RCDECR(icc_link_cache);
RCDECR(icc_profile_cache);
RCDECR(icc_manager);
+ RCDECR(black_text_state);
#undef RCDECR
}
diff --git a/base/gsgstate.h b/base/gsgstate.h
index 780a561f..ab0c30f1 100644
--- a/base/gsgstate.h
+++ b/base/gsgstate.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gshsb.c b/base/gshsb.c
index 78f623ef..1b92133e 100644
--- a/base/gshsb.c
+++ b/base/gshsb.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gshsb.h b/base/gshsb.h
index 61f251b2..04de52a1 100644
--- a/base/gshsb.h
+++ b/base/gshsb.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsht.c b/base/gsht.c
index 5b27b623..bc72f0e1 100644
--- a/base/gsht.c
+++ b/base/gsht.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -27,6 +27,9 @@
#include "gxdevice.h" /* for gzht.h */
#include "gzht.h"
#include "gxfmap.h" /* For effective transfer usage in threshold */
+#include "gp.h"
+
+#define DUMP_SCREENS 0
/* Forward declarations */
void gx_set_effective_transfer(gs_gstate *);
@@ -384,12 +387,20 @@ gx_ht_alloc_threshold_order(gx_ht_order * porder, uint width, uint height,
uint num_levels, gs_memory_t * mem)
{
gx_ht_order order;
- uint num_bits = width * height;
- const gx_ht_order_procs_t *procs =
- (num_bits > 2000 && num_bits <= max_ushort ?
- &ht_order_procs_short : &ht_order_procs_default);
+
+ unsigned long num_bits = bitmap_raster(width) * 8 * height;
+ const gx_ht_order_procs_t *procs;
int code;
+ if (num_bits <= 2000)
+ procs = &ht_order_procs_default;
+ else if (num_bits <= max_ushort + 1) /* We can index 0 to 65535 so a size of 65536 (max_ushort + 1) is OK */
+ procs = &ht_order_procs_short;
+ else if (num_bits <= max_uint)
+ procs = &ht_order_procs_uint;
+ else
+ return_error(gs_error_VMerror); /* At this point in history, this is way too large of a screen */
+
order = *porder;
gx_compute_cell_values(&order.params);
code = gx_ht_alloc_ht_order(&order, width, height, num_levels,
@@ -636,10 +647,10 @@ gs_color_name_component_number(gx_device * dev, const char * pname,
int num_colorant;
#define check_colorant_name(dev, name) \
- ((*dev_proc(dev, get_color_comp_index)) (dev, name, strlen(name), NO_COMP_NAME_TYPE))
+ ((*dev_proc(dev, get_color_comp_index)) (dev, name, strlen(name), NO_COMP_NAME_TYPE_HT))
#define check_colorant_name_length(dev, name, length) \
- ((*dev_proc(dev, get_color_comp_index)) (dev, name, length, NO_COMP_NAME_TYPE))
+ ((*dev_proc(dev, get_color_comp_index)) (dev, name, length, NO_COMP_NAME_TYPE_HT))
#define check_name(str, pname, length) \
((strlen(str) == length) && (strncmp(pname, str, length) == 0))
@@ -1440,13 +1451,34 @@ gx_ht_construct_threshold( gx_ht_order *d_order, gx_device *dev,
}
#ifdef DEBUG
if ( gs_debug_c('h') ) {
- for( i=0; i<(int)d_order->height; i++ ) {
- dmprintf1(memory, "threshold array row %3d= ", i);
- for( j=0; j<(int)(d_order->width); j++ )
- dmprintf1(memory, "%3d ", *(thresh+j+(i*d_order->width)) );
- dmprintf(memory, "\n");
+ dmprintf3(memory, "threshold array component %d [ %d x %d ]:\n",
+ plane_index, (int)(d_order->full_height), (int)(d_order->width));
+ for( i=0; i<(int)d_order->full_height; i++ ) {
+ dmprintf1(memory, "row %3d= ", i);
+ for( j=0; j<(int)(d_order->width); j++ ) {
+ dmprintf1(memory, "%02x ", *(thresh+j+(i*d_order->width)) );
+ if ((j&31) == 31)
+ dmprintf(memory, "\n ");
+ }
+ if ((j&31) != 0)
+ dmprintf(memory, "\n");
}
}
#endif
+/* Large screens are easier to see as images */
+#if DUMP_SCREENS
+ {
+ char file_name[50];
+ gp_file *fid;
+
+ snprintf(file_name, 50, "Screen_From_Tiles_%dx%d.raw", d_order->width, d_order->full_height);
+ fid = gp_fopen(memory, file_name, "wb");
+ if (fid) {
+ gp_fwrite(thresh, sizeof(unsigned char), d_order->width * d_order->full_height, fid);
+ gp_fclose(fid);
+ }
+ }
+#endif
+
return 0;
}
diff --git a/base/gsht.h b/base/gsht.h
index ae40bdc0..05857f9f 100644
--- a/base/gsht.h
+++ b/base/gsht.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsht1.c b/base/gsht1.c
index 918fb229..05fceb54 100644
--- a/base/gsht1.c
+++ b/base/gsht1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -252,6 +252,17 @@ gs_sethalftone_prepare(gs_gstate * pgs, gs_halftone * pht,
for (i = 0; i < count; i++, phc++) {
gx_ht_order_component *poc;
+ if (gs_debug['h']) {
+ int i;
+ byte* pname;
+ uint name_size;
+
+ pht->params.multiple.get_colorname_string(pgs, phc->cname, &pname, &name_size);
+ dmprintf(mem, "Colorant: ");
+ for (i = 0; i < name_size; i++)
+ dmprintf1(mem, "%c", pname[i]);
+ dmprintf(mem, "\n");
+ }
if (phc->comp_number == GX_DEVICE_COLOR_MAX_COMPONENTS) {
if (have_Default) {
/* Duplicate Default */
diff --git a/base/gsht1.h b/base/gsht1.h
index 90cba95d..9cd6ff08 100644
--- a/base/gsht1.h
+++ b/base/gsht1.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gshtscr.c b/base/gshtscr.c
index ab3f5fba..34ca1240 100644
--- a/base/gshtscr.c
+++ b/base/gshtscr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gshtx.c b/base/gshtx.c
index ea7d2e20..c42f19ba 100644
--- a/base/gshtx.c
+++ b/base/gshtx.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gshtx.h b/base/gshtx.h
index 8a2d94b6..a6e688bc 100644
--- a/base/gshtx.h
+++ b/base/gshtx.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsicc.c b/base/gsicc.c
index e44fa120..f77d7028 100644
--- a/base/gsicc.c
+++ b/base/gsicc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsicc.h b/base/gsicc.h
index 8fa86877..d1ca99bb 100644
--- a/base/gsicc.h
+++ b/base/gsicc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsicc_blacktext.c b/base/gsicc_blacktext.c
new file mode 100644
index 00000000..82699233
--- /dev/null
+++ b/base/gsicc_blacktext.c
@@ -0,0 +1,108 @@
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
+ All Rights Reserved.
+
+ This software is provided AS-IS with no warranty, either express or
+ implied.
+
+ This software is distributed under license and may not be copied,
+ modified or distributed except as expressly authorized under the terms
+ of the license contained in the file LICENSE in this distribution.
+
+ Refer to licensing information at http://www.artifex.com or contact
+ Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
+ CA 94945, U.S.A., +1(415)492-9861, for further information.
+*/
+
+/* Handling of color spaces stored during replacement of all
+ * text with black.
+*/
+
+#include "gsmemory.h"
+#include "gsstruct.h"
+#include "gzstate.h"
+#include "gsicc_blacktext.h"
+
+/* gsicc_blacktext_state_t is going to be storing GCed items
+ (color spaces and client colors) and so will need to be GCed */
+gs_private_st_ptrs4(st_blacktext_state, gsicc_blacktext_state_t,
+ "gsicc_blacktext_state", blacktext_state_enum_ptrs,
+ blacktext_state_reloc_ptrs, pcs[0], pcs[1], pcc[0], pcc[1]);
+
+static void
+rc_gsicc_blacktext_state_free(gs_memory_t *mem, void *ptr_in,
+ client_name_t cname)
+{
+ gsicc_blacktext_state_t *state = (gsicc_blacktext_state_t*)ptr_in;
+
+ rc_decrement_cs(state->pcs[0], "rc_gsicc_blacktext_state_free");
+ rc_decrement_cs(state->pcs[1], "rc_gsicc_blacktext_state_free");
+
+ gs_free_object(mem->stable_memory, state,
+ "rc_gsicc_blacktext_state_free");
+}
+
+gsicc_blacktext_state_t*
+gsicc_blacktext_state_new(gs_memory_t *memory)
+{
+ gsicc_blacktext_state_t *result;
+
+ result = gs_alloc_struct(memory->stable_memory, gsicc_blacktext_state_t,
+ &st_blacktext_state, "gsicc_blacktext_state_new");
+ if (result == NULL)
+ return NULL;
+ rc_init_free(result, memory->stable_memory, 1, rc_gsicc_blacktext_state_free);
+ result->memory = memory;
+ result->pcs[0] = NULL;
+ result->pcs[1] = NULL;
+ result->pcc[0] = NULL;
+ result->pcc[1] = NULL;
+
+ return result;
+}
+
+void
+gsicc_restore_black_text(gs_gstate *pgs)
+{
+ gsicc_blacktext_state_t *state = pgs->black_text_state;
+ int code;
+
+ if (state == NULL)
+ return;
+
+ /* Make sure state and original are same fill_color condition */
+ if (state->rc.ref_count == 1) {
+ if ((state->is_fill && pgs->is_fill_color) ||
+ (!state->is_fill && !pgs->is_fill_color)) {
+
+ if ((code = gs_setcolorspace_only(pgs, pgs->black_text_state->pcs[0])) >= 0) {
+ /* current client color is gray. no need to decrement */
+ pgs->color[0].ccolor = pgs->black_text_state->pcc[0];
+ pgs->color[0].ccolor->paint.values[0] = pgs->black_text_state->value[0];
+ }
+ gs_swapcolors_quick(pgs);
+ if ((code = gs_setcolorspace_only(pgs, pgs->black_text_state->pcs[1])) >= 0) {
+ pgs->color[0].ccolor = pgs->black_text_state->pcc[1];
+ pgs->color[0].ccolor->paint.values[0] = pgs->black_text_state->value[1];
+
+ }
+ gs_swapcolors_quick(pgs);
+
+ } else {
+
+ if ((code = gs_setcolorspace_only(pgs, pgs->black_text_state->pcs[1])) >= 0) {
+ pgs->color[0].ccolor = pgs->black_text_state->pcc[1];
+ pgs->color[0].ccolor->paint.values[0] = pgs->black_text_state->value[1];
+ }
+ gs_swapcolors_quick(pgs);
+ if ((code = gs_setcolorspace_only(pgs, pgs->black_text_state->pcs[0])) >= 0) {
+ pgs->color[0].ccolor = pgs->black_text_state->pcc[0];
+ pgs->color[0].ccolor->paint.values[0] = pgs->black_text_state->value[0];
+ }
+ gs_swapcolors_quick(pgs);
+ }
+ gx_unset_dev_color(pgs);
+ gx_unset_alt_dev_color(pgs);
+ }
+ rc_decrement(state, "gsicc_restore_black_text");
+ pgs->black_text_state = NULL;
+} \ No newline at end of file
diff --git a/base/gsicc_blacktext.h b/base/gsicc_blacktext.h
new file mode 100644
index 00000000..09d541a5
--- /dev/null
+++ b/base/gsicc_blacktext.h
@@ -0,0 +1,34 @@
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
+ All Rights Reserved.
+
+ This software is provided AS-IS with no warranty, either express or
+ implied.
+
+ This software is distributed under license and may not be copied,
+ modified or distributed except as expressly authorized under the terms
+ of the license contained in the file LICENSE in this distribution.
+
+ Refer to licensing information at http://www.artifex.com or contact
+ Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
+ CA 94945, U.S.A., +1(415)492-9861, for further information.
+*/
+
+#ifndef gsicc_blacktext_INCLUDED
+# define gsicc_blacktext_INCLUDED
+
+typedef struct gsicc_blacktext_state_s gsicc_blacktext_state_t;
+
+struct gsicc_blacktext_state_s {
+ gs_memory_t *memory;
+ rc_header rc;
+ bool is_fill; /* Needed for proper color restore */
+ gs_color_space *pcs[2]; /* If doing black text, color spaces to restore */
+ gs_client_color *pcc[2]; /* If doing black text, client colors to restore */
+ float value[2]; /* DeviceGray setting blows away the client color
+ zero value */
+};
+
+gsicc_blacktext_state_t* gsicc_blacktext_state_new(gs_memory_t *memory);
+void gsicc_restore_black_text(gs_gstate *pgs);
+
+#endif
diff --git a/base/gsicc_cache.c b/base/gsicc_cache.c
index df51e88b..fda958aa 100644
--- a/base/gsicc_cache.c
+++ b/base/gsicc_cache.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -373,6 +373,19 @@ gsicc_mash_hash(gsicc_hashlink_t *hash)
(hash->des_hash >> 1) ^ (hash->rend_hash) ^ (hash->src_hash);
}
+static void
+gsicc_set_hash(cmm_profile_t *profile)
+{
+ if (!profile->hash_is_valid) {
+ int64_t hash;
+
+ gsicc_get_icc_buff_hash(profile->buffer, &hash, profile->buffer_size);
+ profile->hashcode = hash;
+ profile->hash_is_valid = true;
+ }
+ return;
+}
+
int64_t
gsicc_get_hash(cmm_profile_t *profile)
{
@@ -386,6 +399,23 @@ gsicc_get_hash(cmm_profile_t *profile)
return profile->hashcode;
}
+bool
+gsicc_profiles_equal(cmm_profile_t *profile1, cmm_profile_t *profile2) {
+
+ if (profile1 == NULL || profile2 == NULL)
+ return false;
+
+ if (!(profile1->hash_is_valid)) {
+ gsicc_set_hash(profile1);
+ }
+
+ if (!(profile1->hash_is_valid)) {
+ gsicc_set_hash(profile2);
+ }
+
+ return profile1->hashcode == profile2->hashcode;
+}
+
void
gsicc_get_icc_buff_hash(unsigned char *buffer, int64_t *hash, unsigned int buff_size)
{
@@ -1048,7 +1078,9 @@ gsicc_get_link_profile(const gs_gstate *pgs, gx_device *dev,
cms_input_profile = gs_input_profile->profile_handle;
/* Check if the source was generated from a PS CIE color space. If yes,
then we need to make sure that the CMM does not do something like
- force a white point mapping like lcms does */
+ force a white point mapping like lcms does. This is also the source
+ of the issue with the flower picture that has the hand made ICC
+ profile that is highly nonlinear at the whitepoint */
if (gsicc_profile_from_ps(gs_input_profile)) {
cms_flags = cms_flags | gscms_avoid_white_fix_flag(memory);
}
@@ -1788,12 +1820,7 @@ gsicc_init_buffer(gsicc_bufferdesc_t *buffer_desc, unsigned char num_chan, unsig
buffer_desc->row_stride = row_stride;
buffer_desc->num_rows = num_rows;
buffer_desc->pixels_per_row = pixels_per_row;
-
-#if ARCH_IS_BIG_ENDIAN
- buffer_desc->little_endian = false;
-#else
- buffer_desc->little_endian = true;
-#endif
+ buffer_desc->endian_swap = false;
}
/* Return the proper component numbers based upon the profiles of the device.
diff --git a/base/gsicc_cache.h b/base/gsicc_cache.h
index c9b9d0ab..7aa87a43 100644
--- a/base/gsicc_cache.h
+++ b/base/gsicc_cache.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -37,7 +37,7 @@ void gsicc_init_buffer(gsicc_bufferdesc_t *buffer_desc, unsigned char num_chan,
unsigned char bytes_per_chan, bool has_alpha, bool alpha_first,
bool is_planar, int plane_stride, int row_stride, int num_rows,
int pixels_per_row);
-bool gsicc_alloc_link_entry(gsicc_link_cache_t *icc_link_cache,
+bool gsicc_alloc_link_entry(gsicc_link_cache_t *icc_link_cache,
gsicc_link_t **ret_link, gsicc_hashlink_t hash,
bool include_softproof, bool include_devlink);
gsicc_link_t* gsicc_get_link(const gs_gstate * pgs, gx_device *dev,
@@ -52,10 +52,11 @@ gsicc_link_t* gsicc_get_link_profile(const gs_gstate *pgs, gx_device *dev,
gs_memory_t *memory, bool devicegraytok);
void gsicc_release_link(gsicc_link_t *icclink);
void gsicc_link_free(gsicc_link_t *icc_link, const gs_memory_t *memory);
+bool gsicc_profiles_equal(cmm_profile_t *profile1, cmm_profile_t *profile2);
void gsicc_get_icc_buff_hash(unsigned char *buffer, int64_t *hash, unsigned int buff_size);
int64_t gsicc_get_hash(cmm_profile_t *profile);
int gsicc_transform_named_color(const float tint_values[],
- gsicc_namedcolor_t color_names[],
+ gsicc_namedcolor_t color_names[],
uint num_names,
gx_color_value device_values[],
const gs_gstate *pgs, gx_device *dev,
diff --git a/base/gsicc_cms.h b/base/gsicc_cms.h
index 9a067093..9d271f19 100644
--- a/base/gsicc_cms.h
+++ b/base/gsicc_cms.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsicc_create.c b/base/gsicc_create.c
index 3fc8492b..8c2283ef 100644
--- a/base/gsicc_create.c
+++ b/base/gsicc_create.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -169,7 +169,7 @@ typedef struct cielab_s {
} cielab_t;
static const char desc_name[] = "Ghostscript Internal Profile";
-static const char copy_right[] = "Copyright Artifex Software 2009";
+static const char copy_right[] = "Copyright Artifex Software 2009-2021";
typedef struct {
icTagSignature sig; /* The tag signature */
@@ -463,8 +463,8 @@ save_profile(const gs_memory_t *mem, unsigned char *buffer, char filename[], int
gs_sprintf(full_file_name,"%d)Profile_%s.icc",icc_debug_index,filename);
fid = gp_fopen(mem, full_file_name,"wb");
- fwrite(buffer,sizeof(unsigned char),buffer_size,fid);
- fclose(fid);
+ gp_fwrite(buffer,sizeof(unsigned char),buffer_size,fid);
+ gp_fclose(fid);
icc_debug_index++;
}
#endif
@@ -2350,8 +2350,9 @@ getsize_lut16Type(int tablesize, int num_inputs, int num_outputs)
{
int clutsize;
- /* Header plus linear curves (2 points each of 2 bytes) */
- int size = 52 + 4 * num_inputs + 4 * num_outputs;
+ /* Header (-8 as we already include the type later)
+ plus linear curves (2 points each of 2 bytes) */
+ int size = 52 - 8 + 4 * num_inputs + 4 * num_outputs;
clutsize = (int) pow(tablesize, num_inputs) * num_outputs * 2;
return size + clutsize;
}
@@ -2361,8 +2362,9 @@ getsize_lut8Type(int tablesize, int num_inputs, int num_outputs)
{
int clutsize;
- /* Header plus linear curves (2 points each of 2 bytes) */
- int size = 48 + 256 * num_inputs + 256 * num_outputs;
+ /* Header (-8 as we already include the type later)
+ plus linear curves (2 points each of 2 bytes) */
+ int size = 48 - 8 + 256 * num_inputs + 256 * num_outputs;
clutsize = (int)pow(tablesize, num_inputs) * num_outputs;
return size + clutsize;
}
@@ -2589,7 +2591,7 @@ create_clut_v2(gsicc_clut *clut, gsicc_link_t *link, int num_in,
/* Here we write out the lut16Type or lut8Type data V2. Curves are always linear,
matrix is the identity. Table data is unique and could be a forward
or inverse table */
-static void
+static byte*
add_lutType(byte *input_ptr, gsicc_clut *lut)
{
byte *curr_ptr;
@@ -2665,12 +2667,13 @@ add_lutType(byte *input_ptr, gsicc_clut *lut)
for (j = 0; j < 256; j++)
*curr_ptr++ = j;
}
+ return curr_ptr;
}
static int
create_write_table_intent(const gs_gstate *pgs, gsicc_rendering_intents_t intent,
cmm_profile_t *src_profile, cmm_profile_t *des_profile, byte *curr_ptr,
- int table_size, int bit_depth)
+ int table_size, int bit_depth, int padding)
{
gsicc_link_t *link;
int code;
@@ -2681,7 +2684,8 @@ create_write_table_intent(const gs_gstate *pgs, gsicc_rendering_intents_t intent
des_profile->num_comps, table_size, pgs->memory, bit_depth);
if (code < 0)
return code;
- add_lutType(curr_ptr, &clut);
+ curr_ptr = add_lutType(curr_ptr, &clut);
+ memset(curr_ptr, 0, padding);
clean_lut(&clut, pgs->memory);
gsicc_release_link(link);
return 0;
@@ -2748,7 +2752,8 @@ gsicc_create_v2input(const gs_gstate *pgs, icHeader *header, cmm_profile_t *src_
}
/* Now write it out */
- add_lutType(curr_ptr, &clut);
+ curr_ptr = add_lutType(curr_ptr, &clut);
+ memset(curr_ptr, 0, tag_list[last_tag].byte_padding); /* padding */
/* Clean up */
gsicc_release_link(link);
@@ -2837,15 +2842,18 @@ gsicc_create_v2output(const gs_gstate *pgs, icHeader *header, cmm_profile_t *src
/* A2B0 */
if (create_write_table_intent(pgs, gsPERCEPTUAL, src_profile, lab_profile,
- curr_ptr, FORWARD_V2_TABLE_SIZE, 2) < 0) {
+ curr_ptr, FORWARD_V2_TABLE_SIZE, 2,
+ tag_list[tag_location].byte_padding) < 0) {
gs_free_object(memory, tag_list, "gsicc_create_v2output");
return;
}
curr_ptr += tag_list[tag_location].size;
tag_location++;
+
/* B2A0 */
if (create_write_table_intent(pgs, gsPERCEPTUAL, lab_profile, src_profile,
- curr_ptr, BACKWARD_V2_TABLE_SIZE, 1) < 0) {
+ curr_ptr, BACKWARD_V2_TABLE_SIZE, 1,
+ tag_list[tag_location].byte_padding) < 0) {
gs_free_object(memory, tag_list, "gsicc_create_v2output");
return;
}
@@ -2854,15 +2862,18 @@ gsicc_create_v2output(const gs_gstate *pgs, icHeader *header, cmm_profile_t *src
/* A2B1 */
if (create_write_table_intent(pgs, gsRELATIVECOLORIMETRIC, src_profile,
- lab_profile, curr_ptr, FORWARD_V2_TABLE_SIZE, 2) < 0) {
+ lab_profile, curr_ptr, FORWARD_V2_TABLE_SIZE, 2,
+ tag_list[tag_location].byte_padding) < 0) {
gs_free_object(memory, tag_list, "gsicc_create_v2output");
return;
}
curr_ptr += tag_list[tag_location].size;
tag_location++;
+
/* B2A1 */
if (create_write_table_intent(pgs, gsRELATIVECOLORIMETRIC, lab_profile,
- src_profile, curr_ptr, BACKWARD_V2_TABLE_SIZE, 1) < 0) {
+ src_profile, curr_ptr, BACKWARD_V2_TABLE_SIZE, 1,
+ tag_list[tag_location].byte_padding) < 0) {
gs_free_object(memory, tag_list, "gsicc_create_v2output");
return;
}
@@ -2871,15 +2882,18 @@ gsicc_create_v2output(const gs_gstate *pgs, icHeader *header, cmm_profile_t *src
/* A2B2 */
if (create_write_table_intent(pgs, gsSATURATION, src_profile, lab_profile,
- curr_ptr, FORWARD_V2_TABLE_SIZE, 2) < 0) {
+ curr_ptr, FORWARD_V2_TABLE_SIZE, 2,
+ tag_list[tag_location].byte_padding) < 0) {
gs_free_object(memory, tag_list, "gsicc_create_v2output");
return;
}
curr_ptr += tag_list[tag_location].size;
tag_location++;
+
/* B2A2 */
if (create_write_table_intent(pgs, gsSATURATION, lab_profile, src_profile,
- curr_ptr, BACKWARD_V2_TABLE_SIZE, 1) < 0) {
+ curr_ptr, BACKWARD_V2_TABLE_SIZE, 1,
+ tag_list[tag_location].byte_padding) < 0) {
gs_free_object(memory, tag_list, "gsicc_create_v2output");
return;
}
@@ -2892,12 +2906,15 @@ gsicc_create_v2output(const gs_gstate *pgs, icHeader *header, cmm_profile_t *src
gs_free_object(memory, tag_list, "gsicc_create_v2output");
return;
}
+
/* Now write it out */
- add_lutType(curr_ptr, &gamutlut);
+ curr_ptr = add_lutType(curr_ptr, &gamutlut);
+ memset(curr_ptr, 0, tag_list[tag_location].byte_padding);
/* Done */
gs_free_object(memory, tag_list, "gsicc_create_v2output");
- clean_lut(&gamutlut, pgs->memory);
+ clean_lut(&gamutlut, pgs->memory);
+
/* Save the v2 data */
src_profile->v2_data = buffer;
src_profile->v2_size = profile_size;
@@ -2984,7 +3001,7 @@ gsicc_create_v2displaygray(const gs_gstate *pgs, icHeader *header, cmm_profile_t
#if SAVEICCPROFILE
/* Dump the buffer to a file for testing if its a valid ICC profile */
- save_profile(buffer, "V2FromGray", profile_size);
+ save_profile(memory, buffer, "V2FromGray", profile_size);
#endif
}
diff --git a/base/gsicc_create.h b/base/gsicc_create.h
index ca84eb3a..a992d09f 100644
--- a/base/gsicc_create.h
+++ b/base/gsicc_create.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -42,6 +42,6 @@ cmm_profile_t* gsicc_create_from_cal(float *white, float *black, float *gamma,
float *matrix, gs_memory_t *memory,
int num_colors);
byte* gsicc_getv2buffer(cmm_profile_t *srcprofile, int *size);
-byte* gsicc_create_getv2buffer(const gs_gstate *pgs,
+byte* gsicc_create_getv2buffer(const gs_gstate *pgs,
cmm_profile_t *srcprofile, int *size);
#endif
diff --git a/base/gsicc_lcms2.c b/base/gsicc_lcms2.c
index 43a7a93a..5e9355e6 100644
--- a/base/gsicc_lcms2.c
+++ b/base/gsicc_lcms2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -308,7 +308,7 @@ gscms_transform_color_buffer(gx_device *dev, gsicc_link_t *icclink,
{
cmsHTRANSFORM hTransform = (cmsHTRANSFORM)icclink->link_handle;
cmsUInt32Number dwInputFormat, dwOutputFormat, num_src_lcms, num_des_lcms;
- int planar,numbytes, big_endian, hasalpha, k;
+ int planar,numbytes, swap_endian, hasalpha, k;
unsigned char *inputpos, *outputpos;
#if DUMP_CMS_BUFFER
gp_file *fid_in, *fid_out;
@@ -340,10 +340,10 @@ gscms_transform_color_buffer(gx_device *dev, gsicc_link_t *icclink,
dwOutputFormat = dwOutputFormat | BYTES_SH(numbytes);
/* endian */
- big_endian = !input_buff_desc->little_endian;
- dwInputFormat = dwInputFormat | ENDIAN16_SH(big_endian);
- big_endian = !output_buff_desc->little_endian;
- dwOutputFormat = dwOutputFormat | ENDIAN16_SH(big_endian);
+ swap_endian = input_buff_desc->endian_swap;
+ dwInputFormat = dwInputFormat | ENDIAN16_SH(swap_endian);
+ swap_endian = output_buff_desc->endian_swap;
+ dwOutputFormat = dwOutputFormat | ENDIAN16_SH(swap_endian);
/* number of channels. This should not really be changing! */
num_src_lcms = T_CHANNELS(cmsGetTransformInputFormat(hTransform));
@@ -524,9 +524,7 @@ gscms_get_link(gcmmhprofile_t lcms_srchandle,
when we use the transformation. */
src_data_type = (COLORSPACE_SH(lcms_src_color_space)|
CHANNELS_SH(src_nChannels)|BYTES_SH(2));
-#if 0
- src_data_type = src_data_type | ENDIAN16_SH(1);
-#endif
+
if (lcms_deshandle != NULL) {
des_color_space = cmsGetColorSpace(lcms_deshandle);
} else {
@@ -538,10 +536,7 @@ gscms_get_link(gcmmhprofile_t lcms_srchandle,
des_nChannels = cmsChannelsOf(des_color_space);
des_data_type = (COLORSPACE_SH(lcms_des_color_space)|
CHANNELS_SH(des_nChannels)|BYTES_SH(2));
- /* endian */
-#if 0
- des_data_type = des_data_type | ENDIAN16_SH(1);
-#endif
+
/* Set up the flags */
flag = cmsFLAGS_HIGHRESPRECALC;
if (rendering_params->black_point_comp == gsBLACKPTCOMP_ON
diff --git a/base/gsicc_lcms2mt.c b/base/gsicc_lcms2mt.c
index dbb9c4b2..eb621b96 100644
--- a/base/gsicc_lcms2mt.c
+++ b/base/gsicc_lcms2mt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -40,10 +40,10 @@
#define LCMS_BYTES_MASK T_BYTES(-1) /* leaves only mask for the BYTES (currently 7) */
#define LCMS_ENDIAN16_MASK T_ENDIAN16(-1) /* similarly, for ENDIAN16 bit */
-#define gsicc_link_flags(hasalpha, planarIN, planarOUT, bigendianIN, bigendianOUT, bytesIN, bytesOUT) \
+#define gsicc_link_flags(hasalpha, planarIN, planarOUT, endianswapIN, endianswapOUT, bytesIN, bytesOUT) \
((hasalpha != 0) << 2 | \
(planarIN != 0) << 5 | (planarOUT != 0) << 4 | \
- (bigendianIN != 0) << 3 | (bigendianOUT != 0) << 2 | \
+ (endianswapIN != 0) << 3 | (endianswapOUT != 0) << 2 | \
(bytesIN == 1) << 1 | (bytesOUT == 1))
typedef struct gsicc_lcms2mt_link_list_s {
@@ -338,7 +338,7 @@ gscms_transform_color_buffer(gx_device *dev, gsicc_link_t *icclink,
gsicc_lcms2mt_link_list_t *link_handle = (gsicc_lcms2mt_link_list_t *)(icclink->link_handle);
cmsHTRANSFORM hTransform = (cmsHTRANSFORM)link_handle->hTransform;
cmsUInt32Number dwInputFormat, dwOutputFormat, num_src_lcms, num_des_lcms;
- int hasalpha, planarIN, planarOUT, numbytesIN, numbytesOUT, big_endianIN, big_endianOUT;
+ int hasalpha, planarIN, planarOUT, numbytesIN, numbytesOUT, swap_endianIN, swap_endianOUT;
int needed_flags = 0;
unsigned char *inputpos, *outputpos;
cmsContext ctx = gs_lib_ctx_get_cms_context(icclink->memory);
@@ -349,7 +349,7 @@ gscms_transform_color_buffer(gx_device *dev, gsicc_link_t *icclink,
/* Although little CMS does make assumptions about data types in its
transformations we can change it after the fact by cloning from any
other transform. We always create [0] which is no_alpha, chunky IN/OUT,
- little_endian IN/OUT, 2-bytes_per_component IN/OUT. */
+ no endian swap IN/OUT, 2-bytes_per_component IN/OUT. */
/* Set us to the proper output type */
/* Note, we could speed this up by passing back the encoded data type
to the caller so that we could avoid having to go through this
@@ -368,8 +368,8 @@ gscms_transform_color_buffer(gx_device *dev, gsicc_link_t *icclink,
return_error(gs_error_rangecheck); /* TODO: we don't support float */
/* endian */
- big_endianIN = !input_buff_desc->little_endian;
- big_endianOUT = !output_buff_desc->little_endian;
+ swap_endianIN = input_buff_desc->endian_swap;
+ swap_endianOUT = output_buff_desc->endian_swap;
/* alpha, which is passed through unmolested */
/* TODO: Right now we always must have alpha last */
@@ -377,7 +377,7 @@ gscms_transform_color_buffer(gx_device *dev, gsicc_link_t *icclink,
hasalpha = input_buff_desc->has_alpha;
needed_flags = gsicc_link_flags(hasalpha, planarIN, planarOUT,
- big_endianIN, big_endianOUT,
+ swap_endianIN, swap_endianOUT,
numbytesIN, numbytesOUT);
while (link_handle->flags != needed_flags) {
if (link_handle->next == NULL) {
@@ -418,8 +418,8 @@ gscms_transform_color_buffer(gx_device *dev, gsicc_link_t *icclink,
dwOutputFormat = dwOutputFormat | EXTRA_SH(hasalpha);
dwInputFormat = dwInputFormat | PLANAR_SH(planarIN);
dwOutputFormat = dwOutputFormat | PLANAR_SH(planarOUT);
- dwInputFormat = dwInputFormat | ENDIAN16_SH(big_endianIN);
- dwOutputFormat = dwOutputFormat | ENDIAN16_SH(big_endianOUT);
+ dwInputFormat = dwInputFormat | ENDIAN16_SH(swap_endianIN);
+ dwOutputFormat = dwOutputFormat | ENDIAN16_SH(swap_endianOUT);
dwInputFormat = dwInputFormat | BYTES_SH(numbytesIN);
dwOutputFormat = dwOutputFormat | BYTES_SH(numbytesOUT);
@@ -608,9 +608,7 @@ gscms_get_link(gcmmhprofile_t lcms_srchandle, gcmmhprofile_t lcms_deshandle,
when we use the transformation. */
src_data_type = (COLORSPACE_SH(lcms_src_color_space)|
CHANNELS_SH(src_nChannels)|BYTES_SH(2));
-#if 0
- src_data_type = src_data_type | ENDIAN16_SH(1);
-#endif
+
if (lcms_deshandle != NULL) {
des_color_space = cmsGetColorSpace(ctx, lcms_deshandle);
} else {
@@ -623,10 +621,7 @@ gscms_get_link(gcmmhprofile_t lcms_srchandle, gcmmhprofile_t lcms_deshandle,
des_nChannels = cmsChannelsOf(ctx, des_color_space);
des_data_type = (COLORSPACE_SH(lcms_des_color_space)|
CHANNELS_SH(des_nChannels)|BYTES_SH(2));
- /* endian */
-#if 0
- des_data_type = des_data_type | ENDIAN16_SH(1);
-#endif
+
/* Set up the flags */
flag = gscms_get_accuracy(memory);
if (rendering_params->black_point_comp == gsBLACKPTCOMP_ON
@@ -679,7 +674,7 @@ gscms_get_link(gcmmhprofile_t lcms_srchandle, gcmmhprofile_t lcms_deshandle,
return NULL;
}
link_handle->next = NULL;
- link_handle->flags = gsicc_link_flags(0, 0, 0, 0, 0, /* no alpha, not planar, little-endian */
+ link_handle->flags = gsicc_link_flags(0, 0, 0, 0, 0, /* no alpha, not planar, no endian swap */
sizeof(gx_color_value), sizeof(gx_color_value));
return link_handle;
/* cmsFLAGS_HIGHRESPRECALC) cmsFLAGS_NOTPRECALC cmsFLAGS_LOWRESPRECALC*/
@@ -714,7 +709,7 @@ gscms_get_link_proof_devlink(gcmmhprofile_t lcms_srchandle,
if (link_handle == NULL)
return NULL;
link_handle->next = NULL;
- link_handle->flags = gsicc_link_flags(0, 0, 0, 0, 0, /* no alpha, not planar, little-endian */
+ link_handle->flags = gsicc_link_flags(0, 0, 0, 0, 0, /* no alpha, not planar, no endian swap */
sizeof(gx_color_value), sizeof(gx_color_value));
/* Check if the rendering intent is something other than relative colorimetric
and if we have a proofing profile. In this case we need to create the
@@ -1028,7 +1023,7 @@ gscms_get_name2device_link(gsicc_link_t *icclink,
cmsDeleteTransform(ctx, hTransformNew);
return; /* bail */
}
- link_handle->flags = gsicc_link_flags(0, 0, 0, 0, 0, /* no alpha, not planar, little-endian */
+ link_handle->flags = gsicc_link_flags(0, 0, 0, 0, 0, /* no alpha, not planar, no endian swap */
sizeof(gx_color_value), sizeof(gx_color_value));
link_handle->hTransform = hTransformNew;
link_handle->next = NULL;
diff --git a/base/gsicc_manage.c b/base/gsicc_manage.c
index 8d28bcf1..4cf82e0c 100644
--- a/base/gsicc_manage.c
+++ b/base/gsicc_manage.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -1421,10 +1421,11 @@ rc_free_profile_array(gs_memory_t * mem, void *ptr_in, client_name_t cname)
/* Allocate device icc structure. The actual profiles are in this structure */
cmm_dev_profile_t*
-gsicc_new_device_profile_array(gs_memory_t *memory)
+gsicc_new_device_profile_array(gx_device *dev)
{
cmm_dev_profile_t *result;
int k;
+ gs_memory_t *memory = dev->memory;
if_debug0m(gs_debug_flag_icc,memory,"[icc] Allocating device profile struct\n");
result = (cmm_dev_profile_t *) gs_alloc_bytes(memory->non_gc_memory,
@@ -1453,9 +1454,10 @@ gsicc_new_device_profile_array(gs_memory_t *memory)
result->graydetection = false;
result->pageneutralcolor = false;
result->usefastcolor = false; /* Default is to not use fast color */
+ result->blacktext = false;
result->prebandthreshold = true;
result->supports_devn = false;
- result->sim_overprint = true; /* Default is to simulate overprint */
+ result->overprint_control = gs_overprint_control_enable; /* Default overprint if the device can */
rc_init_free(result, memory->non_gc_memory, 1, rc_free_profile_array);
return result;
}
@@ -1773,7 +1775,7 @@ gsicc_init_device_profile_struct(gx_device * dev,
} else {
/* We have no profile structure at all. Allocate the structure in
non-GC memory. */
- dev->icc_struct = gsicc_new_device_profile_array(dev->memory);
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
profile_struct = dev->icc_struct;
if (profile_struct == NULL)
return_error(gs_error_VMerror);
diff --git a/base/gsicc_manage.h b/base/gsicc_manage.h
index a4bde945..437db045 100644
--- a/base/gsicc_manage.h
+++ b/base/gsicc_manage.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -120,7 +120,7 @@ void gsicc_adjust_profile_rc(cmm_profile_t *profile_data, int delta, const char
const char* dirname, int dir_namelen, stream **stmp);
/* Device related */
-cmm_dev_profile_t* gsicc_new_device_profile_array(gs_memory_t *memory);
+cmm_dev_profile_t* gsicc_new_device_profile_array(gx_device *);
int gsicc_set_device_profile(gx_device * pdev, gs_memory_t * mem,
char *file_name, gsicc_profile_types_t defaulttype);
char* gsicc_get_dev_icccolorants(cmm_dev_profile_t *dev_profile);
diff --git a/base/gsicc_monitorcm.c b/base/gsicc_monitorcm.c
index 2e305e9d..0451797c 100644
--- a/base/gsicc_monitorcm.c
+++ b/base/gsicc_monitorcm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsicc_nocm.c b/base/gsicc_nocm.c
index 6d23382f..efea6c1c 100644
--- a/base/gsicc_nocm.c
+++ b/base/gsicc_nocm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsicc_profilecache.c b/base/gsicc_profilecache.c
index adb4ad1d..db2e8ae4 100644
--- a/base/gsicc_profilecache.c
+++ b/base/gsicc_profilecache.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsicc_profilecache.h b/base/gsicc_profilecache.h
index 8a344770..4130f101 100644
--- a/base/gsicc_profilecache.h
+++ b/base/gsicc_profilecache.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsicc_replacecm.c b/base/gsicc_replacecm.c
index 906f2ebb..e7cc7706 100644
--- a/base/gsicc_replacecm.c
+++ b/base/gsicc_replacecm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsimage.c b/base/gsimage.c
index d62c76eb..b3aefb93 100644
--- a/base/gsimage.c
+++ b/base/gsimage.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -408,7 +408,12 @@ gs_image_common_init(gs_image_enum * penum, gx_image_enum_common_t * pie,
int i;
if (pim->Width == 0 || pim->Height == 0) {
+ gx_device *cdev = pie->dev;
+
gx_image_end(pie, false);
+ if (dev_proc(cdev, dev_spec_op)(cdev,
+ gxdso_pattern_is_cpath_accum, NULL, 0))
+ gx_device_retain((gx_device *)cdev, false);
return 1;
}
image_enum_init(penum);
@@ -701,7 +706,11 @@ gs_image_cleanup(gs_image_enum * penum, gs_gstate *pgs)
int
gs_image_cleanup_and_free_enum(gs_image_enum * penum, gs_gstate *pgs)
{
- int code = gs_image_cleanup(penum, pgs);
+ int code;
+
+ if (penum == NULL)
+ return 0;
+ code = gs_image_cleanup(penum, pgs);
gs_free_object(penum->memory, penum, "gs_image_cleanup_and_free_enum");
return code;
diff --git a/base/gsimage.h b/base/gsimage.h
index 29cf9f81..0f8a79ac 100644
--- a/base/gsimage.h
+++ b/base/gsimage.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsimpath.c b/base/gsimpath.c
index 073dffe4..8f4b3dbb 100644
--- a/base/gsimpath.c
+++ b/base/gsimpath.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsinit.c b/base/gsinit.c
index e80353d7..20d48b12 100644
--- a/base/gsinit.c
+++ b/base/gsinit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsio.h b/base/gsio.h
index 8857bb09..0ae1ed8a 100644
--- a/base/gsio.h
+++ b/base/gsio.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsiodev.c b/base/gsiodev.c
index 7b405947..ef5e9ce5 100644
--- a/base/gsiodev.c
+++ b/base/gsiodev.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsiodevs.c b/base/gsiodevs.c
index 1e459701..eec1dd62 100644
--- a/base/gsiodevs.c
+++ b/base/gsiodevs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsiodisk.c b/base/gsiodisk.c
index 5a127e1b..24c50ada 100644
--- a/base/gsiodisk.c
+++ b/base/gsiodisk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -239,7 +239,7 @@ iodev_diskn_fopen(gx_io_device * iodev, const char *fname, const char *access,
}
code = iodev_os_gp_fopen(iodev_default(pstate->memory), realname, access, pfile, rfname, rnamelen);
-
+
done:
if (realname != NULL)
gs_free_object(pstate->memory, realname, "iodev_diskn_fopen(realname)");
@@ -359,7 +359,7 @@ diskn_enumerate_files(gs_memory_t * mem, gx_io_device * iodev, const char *pat,
uint patlen)
{
diskn_state * pstate = (diskn_state *)iodev->state;
-
+
return (file_enum *)map_file_enum_init(mem, (char *)pstate->root, pat, patlen);
}
@@ -630,7 +630,7 @@ MapFileRename(gs_memory_t *mem, const char * rootpath, const char * newfilename,
oldfullname = (char *)gs_alloc_bytes(mem, ototlen, "MapFileRename(oldfullname)");
newfullname = (char *)gs_alloc_bytes(mem, ntotlen, "MapFileRename(newfullname)");
- if (oldfullname && newfullname) {
+ if (oldfullname && newfullname) {
gs_sprintf(oldfullname, "%s%s", rootpath, oldfilename);
gs_sprintf(newfullname, "%s%s", rootpath, newfilename);
rename(oldfullname, newfullname);
diff --git a/base/gsioram.c b/base/gsioram.c
index 40cdb91e..b5f04ee1 100644
--- a/base/gsioram.c
+++ b/base/gsioram.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsiorom.c b/base/gsiorom.c
index 767a35cf..fb06ac78 100644
--- a/base/gsiorom.c
+++ b/base/gsiorom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsiorom.h b/base/gsiorom.h
index 90f9ef02..a4ad8331 100644
--- a/base/gsiorom.h
+++ b/base/gsiorom.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsipar3x.h b/base/gsipar3x.h
index 2cf6e3d9..e0538f0a 100644
--- a/base/gsipar3x.h
+++ b/base/gsipar3x.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsiparam.h b/base/gsiparam.h
index 8fc9172c..365c625a 100644
--- a/base/gsiparam.h
+++ b/base/gsiparam.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsiparm3.h b/base/gsiparm3.h
index 14a249ec..760cfbf8 100644
--- a/base/gsiparm3.h
+++ b/base/gsiparm3.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsiparm4.h b/base/gsiparm4.h
index c9f0e704..2b3ad801 100644
--- a/base/gsiparm4.h
+++ b/base/gsiparm4.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsjconf.h b/base/gsjconf.h
index 18de9026..e4376432 100644
--- a/base/gsjconf.h
+++ b/base/gsjconf.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsjmorec.h b/base/gsjmorec.h
index 2d2cb051..3a90347d 100644
--- a/base/gsjmorec.h
+++ b/base/gsjmorec.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gslib.c b/base/gslib.c
index ee21b5d8..ef426b45 100644
--- a/base/gslib.c
+++ b/base/gslib.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gslib.h b/base/gslib.h
index 2291fbca..881403bf 100644
--- a/base/gslib.h
+++ b/base/gslib.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gslibctx.c b/base/gslibctx.c
index 63dfbe2e..6dfed6cd 100644
--- a/base/gslibctx.c
+++ b/base/gslibctx.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -629,7 +629,18 @@ rewrite_percent_specifiers(char *s)
*s == 'X') {
/* Success! */
memset(match_start, '*', s - match_start + 1);
- return;
+ }
+ /* If we have escaped percents ("%%") so the percent
+ will survive a call to sprintf and co, then we need
+ to drop the extra one here, because the validation
+ code will see the string *after* it's been sprintf'ed.
+ */
+ else if (*s == '%') {
+ char *s0 = s;
+ while (*s0) {
+ *s0 = *(s0 + 1);
+ s0++;
+ }
}
}
}
@@ -825,13 +836,13 @@ gs_add_control_path_len_flags(const gs_memory_t *mem, gs_path_control_t type, co
int
gs_add_control_path(const gs_memory_t *mem, gs_path_control_t type, const char *path)
{
- return gs_add_control_path_len_flags(mem, type, path, strlen(path), 0);
+ return gs_add_control_path_len_flags(mem, type, path, path ? strlen(path) : 0, 0);
}
int
gs_add_control_path_flags(const gs_memory_t *mem, gs_path_control_t type, const char *path, int flags)
{
- return gs_add_control_path_len_flags(mem, type, path, strlen(path), flags);
+ return gs_add_control_path_len_flags(mem, type, path, path ? strlen(path) : 0, flags);
}
int
@@ -1104,13 +1115,35 @@ gs_lib_ctx_stash_sanitized_arg(gs_lib_ctx_t *ctx, const char *arg)
switch (arg[1])
{
case 0: /* We can let - through unchanged */
+ case '-': /* Need to check for permitted file lists */
+ /* By default, we want to keep the key, but lose the value */
+ p = arg+2;
+ while (*p && *p != '=')
+ p++;
+ if (*p == '=')
+ p++;
+ if (*p == 0)
+ break; /* No value to elide */
+ /* Check for our blocked values here */
+#define ARG_MATCHES(STR, ARG, LEN) \
+ (strlen(STR) == LEN && !memcmp(STR, ARG, LEN))
+ if (ARG_MATCHES("permit-file-read", arg+2, p-arg-3))
+ elide=1;
+ if (ARG_MATCHES("permit-file-write", arg+2, p-arg-3))
+ elide=1;
+ if (ARG_MATCHES("permit-file-control", arg+2, p-arg-3))
+ elide=1;
+ if (ARG_MATCHES("permit-file-all", arg+2, p-arg-3))
+ elide=1;
+#undef ARG_MATCHES
+ /* Didn't match a blocked value, so allow it. */
+ break;
case 'd': /* We can let -dFoo=<whatever> through unchanged */
case 'D': /* We can let -DFoo=<whatever> through unchanged */
case 'r': /* We can let -r through unchanged */
case 'Z': /* We can let -Z through unchanged */
case 'g': /* We can let -g through unchanged */
case 'P': /* We can let -P through unchanged */
- case '-': /* We can let -- through unchanged */
case '+': /* We can let -+ through unchanged */
case '_': /* We can let -_ through unchanged */
case 'u': /* We can let -u through unchanged */
@@ -1148,6 +1181,8 @@ gs_lib_ctx_stash_sanitized_arg(gs_lib_ctx_t *ctx, const char *arg)
break;
if (ARG_MATCHES("ColorConversionStrategy", arg+2, p-arg-3))
break;
+ if (ARG_MATCHES("NupControl", arg+2, p-arg-3))
+ break;
if (ARG_MATCHES("PageList", arg+2, p-arg-3))
break;
if (ARG_MATCHES("ProcessColorModel", arg+2, p-arg-3))
diff --git a/base/gslibctx.h b/base/gslibctx.h
index 9f814b5c..0acb520c 100644
--- a/base/gslibctx.h
+++ b/base/gslibctx.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsline.c b/base/gsline.c
index 5107e5db..3e8362fa 100644
--- a/base/gsline.c
+++ b/base/gsline.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsline.h b/base/gsline.h
index b2fa402b..ebf0854b 100644
--- a/base/gsline.h
+++ b/base/gsline.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gslparam.h b/base/gslparam.h
index c4245bf2..ce42aabc 100644
--- a/base/gslparam.h
+++ b/base/gslparam.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsmalloc.c b/base/gsmalloc.c
index 58047c9b..e5eae62e 100644
--- a/base/gsmalloc.c
+++ b/base/gsmalloc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -450,17 +450,23 @@ gs_heap_stable(gs_memory_t *mem)
/*
* NB: In a multi-threaded application, this is only a 'snapshot'
* since other threads may change the heap_status. The heap_available()
- * probe is just an approximation anyway.
+ * probe is just an approximation anyway. To pacify helgrind, we lock
+ * around the modificatons to the gs_memory_status that is returned.
*/
static void
gs_heap_status(gs_memory_t * mem, gs_memory_status_t * pstat)
{
gs_malloc_memory_t *mmem = (gs_malloc_memory_t *) mem;
+ long avail_snapshot = heap_available();
- pstat->allocated = mmem->used + heap_available();
+ if (mmem->monitor)
+ gx_monitor_enter(mmem->monitor);
+ pstat->allocated = mmem->used + avail_snapshot;
pstat->used = mmem->used;
pstat->max_used = mmem->max_used;
pstat->is_thread_safe = true; /* this allocator has a mutex (monitor) and IS thread safe */
+ if (mmem->monitor)
+ gx_monitor_leave(mmem->monitor); /* Done with exclusive access */
}
static void
gs_heap_enable_free(gs_memory_t * mem, bool enable)
diff --git a/base/gsmalloc.h b/base/gsmalloc.h
index 44374c03..a4b10f00 100644
--- a/base/gsmalloc.h
+++ b/base/gsmalloc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsmatrix.c b/base/gsmatrix.c
index 6e70fa6e..b7780207 100644
--- a/base/gsmatrix.c
+++ b/base/gsmatrix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsmatrix.h b/base/gsmatrix.h
index ba365da1..4c94a61d 100644
--- a/base/gsmatrix.h
+++ b/base/gsmatrix.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -26,7 +26,7 @@
/* transformation matrices. */
/* if you make any additions/changes to the gs_matrix_s structure or the
- _matrix_body macro you need to make the appropriate additions/changes
+ _matrix_body macro you need to make the appropriate additions/changes
to the gs_matrix_compare() function in gsmatrix.c */
/* Structure for a transformation matrix. */
#define _matrix_body\
diff --git a/base/gsmchunk.c b/base/gsmchunk.c
index 33c45cd4..1fec7acd 100644
--- a/base/gsmchunk.c
+++ b/base/gsmchunk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -141,8 +141,8 @@ typedef struct chunk_obj_node_s {
unsigned int sequence;
#endif
struct chunk_obj_node_s *defer_next;
- uint size; /* Actual size of block */
- uint padding; /* Actual size - requested size */
+ size_t size; /* Actual size of block */
+ size_t padding; /* Actual size - requested size */
} chunk_obj_node_t;
typedef struct chunk_free_node_s {
@@ -150,7 +150,7 @@ typedef struct chunk_free_node_s {
struct chunk_free_node_s *right_loc;
struct chunk_free_node_s *left_size;
struct chunk_free_node_s *right_size;
- uint size; /* size of entire freelist block */
+ size_t size; /* size of entire freelist block */
} chunk_free_node_t;
/*
@@ -169,9 +169,9 @@ typedef struct gs_memory_chunk_s {
chunk_free_node_t *free_loc; /* free tree */
chunk_obj_node_t *defer_finalize_list;
chunk_obj_node_t *defer_free_list;
- unsigned long used;
- unsigned long max_used;
- unsigned long total_free;
+ size_t used;
+ size_t max_used;
+ size_t total_free;
#ifdef DEBUG_SEQ
unsigned int sequence;
#endif
@@ -755,12 +755,12 @@ static void remove_free(gs_memory_chunk_t *cmem, chunk_free_node_t *node)
/* All of the allocation routines reduce to this function */
static byte *
-chunk_obj_alloc(gs_memory_t *mem, uint size, gs_memory_type_ptr_t type, client_name_t cname)
+chunk_obj_alloc(gs_memory_t *mem, size_t size, gs_memory_type_ptr_t type, client_name_t cname)
{
gs_memory_chunk_t *cmem = (gs_memory_chunk_t *)mem;
chunk_free_node_t **ap, **okp;
chunk_free_node_t *a, *b, *c;
- uint newsize;
+ size_t newsize;
chunk_obj_node_t *obj = NULL;
newsize = round_up_to_align(size + SIZEOF_ROUND_ALIGN(chunk_obj_node_t)); /* space we will need */
@@ -778,10 +778,10 @@ chunk_obj_alloc(gs_memory_t *mem, uint size, gs_memory_type_ptr_t type, client_n
#ifdef DEBUG_CHUNK_PRINT
#ifdef DEBUG_SEQ
- dmlprintf4(cmem->target, "Event %x: malloc(chunk="PRI_INTPTR", size=%x, cname=%s)\n",
+ dmlprintf4(cmem->target, "Event %x: malloc(chunk="PRI_INTPTR", size="PRIxSIZE", cname=%s)\n",
cmem->sequence, (intptr_t)cmem, newsize, cname);
#else
- dmlprintf3(cmem->target, "malloc(chunk="PRI_INTPTR", size=%x, cname=%s)\n",
+ dmlprintf3(cmem->target, "malloc(chunk="PRI_INTPTR", size="PRIxSIZE", cname=%s)\n",
(intptr_t)cmem, newsize, cname);
#endif
#endif
@@ -951,14 +951,14 @@ chunk_obj_alloc(gs_memory_t *mem, uint size, gs_memory_type_ptr_t type, client_n
obj->sequence = cmem->sequence;
#endif
if (gs_debug_c('A'))
- dmlprintf3(mem, "[a+]chunk_obj_alloc (%s)(%u) = "PRI_INTPTR": OK.\n",
+ dmlprintf3(mem, "[a+]chunk_obj_alloc (%s)(%"PRIuSIZE") = "PRI_INTPTR": OK.\n",
client_name_string(cname), size, (intptr_t) obj);
#ifdef DEBUG_CHUNK_PRINT
#ifdef DEBUG_SEQ
- dmlprintf5(cmem->target, "Event %x: malloced(chunk="PRI_INTPTR", addr="PRI_INTPTR", size=%x, cname=%s)\n",
+ dmlprintf5(cmem->target, "Event %x: malloced(chunk="PRI_INTPTR", addr="PRI_INTPTR", size=%"PRIxSIZE", cname=%s)\n",
obj->sequence, (intptr_t)cmem, (intptr_t)obj, obj->size, cname);
#else
- dmlprintf4(cmem->target, "malloced(chunk="PRI_INTPTR", addr="PRI_INTPTR", size=%x, cname=%s)\n",
+ dmlprintf4(cmem->target, "malloced(chunk="PRI_INTPTR", addr="PRI_INTPTR", size=%"PRI_xSIZE", cname=%s)\n",
(intptr_t)cmem, (intptr_t)obj, obj->size, cname);
#endif
#endif
diff --git a/base/gsmchunk.h b/base/gsmchunk.h
index 50200e7a..2ecf7de8 100644
--- a/base/gsmchunk.h
+++ b/base/gsmchunk.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsmd5.c b/base/gsmd5.c
index db8c6ed8..b190cafa 100644
--- a/base/gsmd5.c
+++ b/base/gsmd5.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1999-2020 Artifex Software, Inc.
+ Copyright (C) 1999-2021 Artifex Software, Inc.
All rights reserved.
This software is provided 'as-is', without any express or implied
diff --git a/base/gsmd5.h b/base/gsmd5.h
index 61305928..9715ce83 100644
--- a/base/gsmd5.h
+++ b/base/gsmd5.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1999-2020 Artifex Software, Inc.
+ Copyright (C) 1999-2021 Artifex Software, Inc.
All rights reserved.
This software is provided 'as-is', without any express or implied
diff --git a/base/gsmdebug.h b/base/gsmdebug.h
index 5c9c8762..197107d0 100644
--- a/base/gsmdebug.h
+++ b/base/gsmdebug.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsmemory.c b/base/gsmemory.c
index 99a801f5..87eeed77 100644
--- a/base/gsmemory.c
+++ b/base/gsmemory.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -231,6 +231,8 @@ rc_object_type_name(const void *vp, const rc_header *prc)
if (prc->memory == 0)
return "(unknown)";
pstype = gs_object_type(prc->memory, vp);
+ if ((uintptr_t)pstype < 10000)
+ return ("?????");
if (prc->free != rc_free_struct_only) {
/*
* This object might be stack-allocated or have other unusual memory
@@ -242,7 +244,7 @@ rc_object_type_name(const void *vp, const rc_header *prc)
dist = (const char *)&dist - (const char *)vp;
if (dist < 10000 && dist > -10000)
return "(on stack)";
- if ((uintptr_t)pstype < 0x10000 || (uintptr_t)pstype < 0)
+ if ((uintptr_t)pstype < 0x10000)
return "(anomalous)";
}
return client_name_string(gs_struct_type_name(pstype));
diff --git a/base/gsmemory.h b/base/gsmemory.h
index 375c2fb7..5be297ea 100644
--- a/base/gsmemory.h
+++ b/base/gsmemory.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsmemraw.h b/base/gsmemraw.h
index 7782ca07..ab5d9bc1 100644
--- a/base/gsmemraw.h
+++ b/base/gsmemraw.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsmemret.c b/base/gsmemret.c
index 505f1f40..adc86b3c 100644
--- a/base/gsmemret.c
+++ b/base/gsmemret.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsmemret.h b/base/gsmemret.h
index c689bcfb..330e630f 100644
--- a/base/gsmemret.h
+++ b/base/gsmemret.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsmisc.c b/base/gsmisc.c
index f0604ef3..db73c007 100644
--- a/base/gsmisc.c
+++ b/base/gsmisc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -198,9 +198,11 @@ eprintf_program_ident(const char *program_name,
if (program_name) {
epf((revision_number ? "%s " : "%s"), program_name);
if (revision_number) {
- int fpart = revision_number % 100;
+ int major = (int)(revision_number / 1000);
+ int minor = (int)(revision_number - (major * 1000)) / 10;
+ int patch = revision_number % 10;
- epf("%d.%02d", (int)(revision_number / 100), fpart);
+ epf("%d.%02d.%d", major, minor, patch);
}
epf(": ");
}
diff --git a/base/gsnamecl.c b/base/gsnamecl.c
index 6de40ac1..2af52384 100644
--- a/base/gsnamecl.c
+++ b/base/gsnamecl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsnamecl.h b/base/gsnamecl.h
index d9acfb7a..556d6835 100644
--- a/base/gsnamecl.h
+++ b/base/gsnamecl.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsncdummy.c b/base/gsncdummy.c
index 352f9379..631bf2c4 100644
--- a/base/gsncdummy.c
+++ b/base/gsncdummy.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsncdummy.h b/base/gsncdummy.h
index 2b9acd59..0a9bd5bc 100644
--- a/base/gsncdummy.h
+++ b/base/gsncdummy.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsnogc.c b/base/gsnogc.c
index 717179ee..8edb35ff 100644
--- a/base/gsnogc.c
+++ b/base/gsnogc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsnogc.h b/base/gsnogc.h
index 7c61bafb..04017ea1 100644
--- a/base/gsnogc.h
+++ b/base/gsnogc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsnotify.c b/base/gsnotify.c
index f4544073..c4c917c5 100644
--- a/base/gsnotify.c
+++ b/base/gsnotify.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsnotify.h b/base/gsnotify.h
index 608a2c20..f1a04c51 100644
--- a/base/gsnotify.h
+++ b/base/gsnotify.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsovrc.c b/base/gsovrc.c
index 38ad867c..16cd729c 100644
--- a/base/gsovrc.c
+++ b/base/gsovrc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -1426,6 +1426,19 @@ overprint_dev_spec_op(gx_device* pdev, int dev_spec_op,
if (dev_spec_op == gxdso_overprint_active)
return !opdev->is_idle;
+ if (dev_spec_op == gxdso_device_child) {
+ gxdso_device_child_request *d = (gxdso_device_child_request *)data;
+ if (d->target == pdev) {
+ d->target = tdev;
+ return 1;
+ }
+ }
+ if (dev_spec_op == gxdso_device_insert_child) {
+ opdev->target = (gx_device *)data;
+ rc_increment(opdev->target);
+ rc_decrement_only(tdev, "overprint_dev_spec_op");
+ return 0;
+ }
return dev_proc(tdev, dev_spec_op)(tdev, dev_spec_op, data, size);
}
@@ -1473,6 +1486,7 @@ c_overprint_create_default_compositor(
const gs_overprint_t * ovrpct = (const gs_overprint_t *)pct;
overprint_device_t * opdev = 0;
gs_overprint_params_t params;
+ int code;
/* see if there is anything to do */
if ( !ovrpct->params.retain_any_comps) {
@@ -1525,5 +1539,8 @@ c_overprint_create_default_compositor(
opdev->retain_none_stroke = true;
/* set up the overprint parameters */
- return update_overprint_params(opdev, &params);
+ code = update_overprint_params(opdev, &params);
+ if (code < 0)
+ return code;
+ return 1;
}
diff --git a/base/gsovrc.h b/base/gsovrc.h
index 39f0e890..790fcaf5 100644
--- a/base/gsovrc.h
+++ b/base/gsovrc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gspaint.c b/base/gspaint.c
index a4dc31d8..70ff0ce6 100644
--- a/base/gspaint.c
+++ b/base/gspaint.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -712,10 +712,10 @@ static int do_fill_stroke(gs_gstate *pgs, int rule, int *restart)
abits = 0;
{
gx_device_color *col_fill = gs_currentdevicecolor_inline(pgs);
- gx_device_color *col_stroke = gs_altdevicecolor_inline(pgs);
+ gx_device_color *col_stroke = gs_swappeddevicecolor_inline(pgs);
devn = color_is_devn(col_fill) && color_is_devn(col_stroke);
/* could be devn and masked_devn */
- if (color_is_pure(col_fill) || color_is_pure(col_stroke) || devn)
+ if ((color_is_pure(col_fill) && color_is_pure(col_stroke)) || devn)
abits = alpha_buffer_bits(pgs);
}
if (abits > 1) {
@@ -778,11 +778,11 @@ static int do_fill_stroke(gs_gstate *pgs, int rule, int *restart)
}
}
out:
- if (gx_dc_is_pattern1_color(gs_altdevicecolor_inline(pgs))) {
+ if (gx_dc_is_pattern1_color(gs_swappeddevicecolor_inline(pgs))) {
gs_id id;
- if (gs_altdevicecolor_inline(pgs)->colors.pattern.p_tile != NULL) {
- id = gs_altdevicecolor_inline(pgs)->colors.pattern.p_tile->id;
+ if (gs_swappeddevicecolor_inline(pgs)->colors.pattern.p_tile != NULL) {
+ id = gs_swappeddevicecolor_inline(pgs)->colors.pattern.p_tile->id;
rcode = gx_pattern_cache_entry_set_lock(pgs, id, false);
if (rcode < 0)
return rcode; /* unlock failed -- shouldn't be possible */
diff --git a/base/gspaint.h b/base/gspaint.h
index 214c6e52..81be10b6 100644
--- a/base/gspaint.h
+++ b/base/gspaint.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsparam.c b/base/gsparam.c
index a5741565..e8a2f0c5 100644
--- a/base/gsparam.c
+++ b/base/gsparam.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -200,7 +200,7 @@ param_coerce_typed(gs_param_typed_value * pvalue, gs_param_type req_type,
}
case gs_param_type_float:
{
- float fl = (float)pvalue->value.l;
+ float fl = (float)pvalue->value.i;
pvalue->value.f = fl;
goto ok;
}
@@ -274,9 +274,9 @@ param_coerce_typed(gs_param_typed_value * pvalue, gs_param_type req_type,
}
case gs_param_type_int:
{
- int int1 = (int)pvalue->value.l;
+ int int1 = (int)pvalue->value.i64;
#if ARCH_SIZEOF_INT < 8 /* sizeof(int64_t) */
- if (pvalue->value.i64 != (int)int1)
+ if (pvalue->value.i64 != (int64_t)int1)
return_error(gs_error_rangecheck);
#endif
pvalue->value.i = int1;
@@ -309,9 +309,9 @@ param_coerce_typed(gs_param_typed_value * pvalue, gs_param_type req_type,
}
case gs_param_type_long:
{
- long l = (long)pvalue->value.i64;
+ long l = (long)pvalue->value.z;
#if ARCH_SIZEOF_LONG < 8 /* sizeof(int64_t) */
- if (pvalue->value.i64 != (int64_t)l)
+ if (pvalue->value.z != (size_t)l)
return_error(gs_error_rangecheck);
#endif
pvalue->value.l = l;
@@ -319,9 +319,9 @@ param_coerce_typed(gs_param_typed_value * pvalue, gs_param_type req_type,
}
case gs_param_type_int:
{
- int int1 = (int)pvalue->value.l;
+ int int1 = (int)pvalue->value.z;
#if ARCH_SIZEOF_INT < 8 /* sizeof(int64_t) */
- if (pvalue->value.i64 != (int)int1)
+ if (pvalue->value.z != (size_t)int1)
return_error(gs_error_rangecheck);
#endif
pvalue->value.i = int1;
@@ -329,7 +329,7 @@ param_coerce_typed(gs_param_typed_value * pvalue, gs_param_type req_type,
}
case gs_param_type_float:
{
- float fl = (float)pvalue->value.i64;
+ float fl = (float)pvalue->value.z;
pvalue->value.f = fl;
goto ok;
}
diff --git a/base/gsparam.h b/base/gsparam.h
index 3b0aaa21..43cc92d8 100644
--- a/base/gsparam.h
+++ b/base/gsparam.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -577,4 +577,8 @@ int gs_param_list_add_parsed_value(gs_param_list *plist, gs_param_name key, cons
* address pointed to be len. */
int gs_param_list_to_string(gs_param_list *plist, gs_param_name key, char *value, int *len);
+/* Debug function to dump a list of params. Do NOT use in production
+ * code! */
+int gs_param_list_dump(gs_param_list *plist);
+
#endif /* gsparam_INCLUDED */
diff --git a/base/gsparam2.c b/base/gsparam2.c
index cafd9041..949acf9a 100644
--- a/base/gsparam2.c
+++ b/base/gsparam2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsparaml.c b/base/gsparaml.c
index d7e5fcdb..3516a157 100644
--- a/base/gsparaml.c
+++ b/base/gsparaml.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -1046,3 +1046,31 @@ int gs_param_list_to_string(gs_param_list *plist, gs_param_name key, char *value
*value = 0;
return to_string(plist, key, &out);
}
+
+int gs_param_list_dump(gs_param_list *plist)
+{
+ gs_param_enumerator_t enumerator;
+ gs_param_key_t key;
+ int code;
+ char buffer[4096];
+ int len;
+
+ param_init_enumerator(&enumerator);
+ while ((code = param_get_next_key(plist, &enumerator, &key)) == 0) {
+ char string_key[256]; /* big enough for any reasonable key */
+
+ if (key.size > sizeof(string_key) - 1) {
+ code = gs_note_error(gs_error_rangecheck);
+ break;
+ }
+ memcpy(string_key, key.data, key.size);
+ string_key[key.size] = 0;
+ dlprintf1("%s ", string_key);
+ code = gs_param_list_to_string(plist, string_key, buffer, &len);
+ if (code < 0)
+ break;
+ dlprintf1("%s ", buffer);
+ }
+ dlprintf("\n");
+ return code;
+}
diff --git a/base/gsparams.c b/base/gsparams.c
index b7c06251..cc68ce1a 100644
--- a/base/gsparams.c
+++ b/base/gsparams.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsparams.h b/base/gsparams.h
index 676e5743..0ad4b0d6 100644
--- a/base/gsparams.h
+++ b/base/gsparams.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsparamx.c b/base/gsparamx.c
index 266da47f..2893253a 100644
--- a/base/gsparamx.c
+++ b/base/gsparamx.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsparamx.h b/base/gsparamx.h
index f73cc18c..0bc785d2 100644
--- a/base/gsparamx.h
+++ b/base/gsparamx.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gspath.c b/base/gspath.c
index 02d4c54b..a18278e8 100644
--- a/base/gspath.c
+++ b/base/gspath.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -324,7 +324,7 @@ static int common_clip(gs_gstate *, int);
/* Figure out the bbox for a path and a clip path with adjustment if we are
also doing a stroke. This is used by the xps interpeter to deteremine
- how big of a transparency group or softmask should be pushed. Often in
+ how big of a transparency group or softmask should be pushed. Often in
xps we fill a path with a particular softmask and some other graphic object.
The transparency group will be the intersection of the path and clipping
path */
diff --git a/base/gspath.h b/base/gspath.h
index 0d1ac9e8..ddf47968 100644
--- a/base/gspath.h
+++ b/base/gspath.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gspath1.c b/base/gspath1.c
index 96d19d5d..e9b91b06 100644
--- a/base/gspath1.c
+++ b/base/gspath1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gspath2.h b/base/gspath2.h
index b0cf8bb3..325ce7e8 100644
--- a/base/gspath2.h
+++ b/base/gspath2.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gspcolor.c b/base/gspcolor.c
index 7efa2900..4fb53680 100644
--- a/base/gspcolor.c
+++ b/base/gspcolor.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gspcolor.h b/base/gspcolor.h
index 5673fae8..abd43052 100644
--- a/base/gspcolor.h
+++ b/base/gspcolor.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gspenum.h b/base/gspenum.h
index b021acd8..bdba5dad 100644
--- a/base/gspenum.h
+++ b/base/gspenum.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gspmdrv.c b/base/gspmdrv.c
index 78281b17..759d5e60 100644
--- a/base/gspmdrv.c
+++ b/base/gspmdrv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gspmdrv.h b/base/gspmdrv.h
index e0c20c6e..e1837396 100644
--- a/base/gspmdrv.h
+++ b/base/gspmdrv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gspmdrv.rc b/base/gspmdrv.rc
index de6eae11..09e41830 100644
--- a/base/gspmdrv.rc
+++ b/base/gspmdrv.rc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -27,7 +27,7 @@ BEGIN
ICON ID_GSPMDRV, ID_GSPMDRV, 8, 56, 20, 16, WS_GROUP
LTEXT "Ghostscript Presentation Manager Driver", -1, 34, 64, 210, 8
LTEXT GSPMDRV_VERSION, -1, 34, 56, 210, 8
- LTEXT "Copyright (C) 1992, 1993, 2001-2020 Artifex Software Inc.", -1, 34, 48, 210, 8
+ LTEXT "Copyright (C) 1992, 1993, 2001-2021 Artifex Software Inc.", -1, 34, 48, 210, 8
LTEXT "All rights reserved", -1, 34, 40, 210, 8
PUSHBUTTON "OK", DID_OK, 105, 8, 40, 14
END
diff --git a/base/gsptype1.c b/base/gsptype1.c
index 92b1f278..c4589488 100644
--- a/base/gsptype1.c
+++ b/base/gsptype1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -119,10 +119,10 @@ gs_pattern1_init(gs_pattern1_template_t * ppat)
/* Make an instance of a PatternType 1 pattern. */
static int compute_inst_matrix(gs_pattern1_instance_t *pinst,
- gs_gstate *saved,
- gs_rect *pbbox,
- int width, int height,
+ gs_rect *pbbox, int width, int height,
float *bbw, float *bbh);
+static int fix_bbox_after_matrix_adjustment(gs_pattern1_instance_t *pinst,
+ gs_rect *pbbox);
int
gs_makepattern(gs_client_color * pcc, const gs_pattern1_template_t * pcp,
const gs_matrix * pmat, gs_gstate * pgs, gs_memory_t * mem)
@@ -185,7 +185,7 @@ gs_pattern1_make_pattern(gs_client_color * pcc,
goto fsaved;
}
inst.templat = *pcp;
- code = compute_inst_matrix(&inst, saved, &bbox, dev_width, dev_height, &bbw, &bbh);
+ code = compute_inst_matrix(&inst, &bbox, dev_width, dev_height, &bbw, &bbh);
if (code < 0)
goto fsaved;
@@ -194,22 +194,11 @@ gs_pattern1_make_pattern(gs_client_color * pcc,
to detect this since blending is expensive and we would like to avoid it
if possible. Note that any skew or rotation matrix will make it
neccessary to perform blending */
-
- { float width = inst.templat.BBox.q.x - inst.templat.BBox.p.x;
- float height = inst.templat.BBox.q.y - inst.templat.BBox.p.y;
-
- if ( inst.templat.XStep < width || inst.templat.YStep < height || ctm_only(saved).xy != 0 ||
- ctm_only(saved).yx != 0 ){
-
- inst.has_overlap = true;
-
- } else {
-
- inst.has_overlap = false;
-
- }
-
- }
+ inst.has_overlap =
+ (inst.templat.XStep < inst.templat.BBox.q.x - inst.templat.BBox.p.x ||
+ inst.templat.YStep < inst.templat.BBox.q.y - inst.templat.BBox.p.y ||
+ ctm_only(saved).xy != 0 ||
+ ctm_only(saved).yx != 0 );
#define mat inst.step_matrix
if_debug6m('t', mem, "[t]step_matrix=[%g %g %g %g %g %g]\n",
@@ -217,140 +206,168 @@ gs_pattern1_make_pattern(gs_client_color * pcc,
inst.step_matrix.yy, inst.step_matrix.tx, inst.step_matrix.ty);
if_debug5m('t', mem, "[t]bbox=(%g,%g),(%g,%g), uses_transparency=%d\n",
bbox.p.x, bbox.p.y, bbox.q.x, bbox.q.y, inst.templat.uses_transparency);
- {
- /* If the step and the size agree to within 1/2 pixel, */
- /* make them the same. */
- if (ADJUST_SCALE_BY_GS_TRADITION) {
- inst.size.x = (int)(bbw + 0.8); /* 0.8 is arbitrary */
- inst.size.y = (int)(bbh + 0.8);
- } else {
- inst.size.x = (int)ceil(bbw);
- inst.size.y = (int)ceil(bbh);
- }
- if (inst.size.x == 0 || inst.size.y == 0) {
- /*
- * The pattern is empty: the stepping matrix doesn't matter.
- */
- gs_make_identity(&inst.step_matrix);
- bbox.p.x = bbox.p.y = bbox.q.x = bbox.q.y = 0;
- } else {
- /* Check for singular stepping matrix. */
- if (fabs(inst.step_matrix.xx * inst.step_matrix.yy - inst.step_matrix.xy * inst.step_matrix.yx) < 1.0e-9) {
- code = gs_note_error(gs_error_rangecheck);
- goto fsaved;
+ /* If the step and the size agree to within 1/2 pixel, */
+ /* make them the same. */
+ if (ADJUST_SCALE_BY_GS_TRADITION) {
+ inst.size.x = (int)(bbw + 0.8); /* 0.8 is arbitrary */
+ inst.size.y = (int)(bbh + 0.8);
+ } else if (inst.templat.TilingType == 2) {
+ /* Always round up for TilingType 2, as we don't want any
+ * content to be lost. */
+ inst.size.x = (int)ceil(bbw);
+ inst.size.y = (int)ceil(bbh);
+ } else {
+ /* For TilingType's other than 2 allow us to round up or down
+ * to whatever is nearer. The scale we do later prevents us
+ * losing content. */
+ inst.size.x = (int)floor(bbw+0.5);
+ inst.size.y = (int)floor(bbh+0.5);
+ /* Ensure we never round down to 0. */
+ if (bbw > 0 && inst.size.x == 0)
+ inst.size.x = 1;
+ if (bbh > 0 && inst.size.y == 0)
+ inst.size.y = 1;
+ }
+
+ /* After compute_inst_matrix above, we are guaranteed that
+ * inst.step_matrix.xx > 0 and inst.step_matrix.yy > 0.
+ * Similarly, we are guaranteed that inst.size.x >= 0 and
+ * inst.size.y >= 0. */
+ if (inst.size.x == 0 || inst.size.y == 0) {
+ /* The pattern is empty: the stepping matrix doesn't matter. */
+ gs_make_identity(&inst.step_matrix);
+ bbox.p.x = bbox.p.y = bbox.q.x = bbox.q.y = 0;
+ } else if (fabs(inst.step_matrix.xx * inst.step_matrix.yy -
+ inst.step_matrix.xy * inst.step_matrix.yx) < 1.0e-9) {
+ /* Singular stepping matrix. */
+ code = gs_note_error(gs_error_rangecheck);
+ goto fsaved;
+ } else if (ADJUST_SCALE_BY_GS_TRADITION &&
+ inst.step_matrix.xy == 0 && inst.step_matrix.yx == 0 &&
+ fabs(inst.step_matrix.xx - bbw) < 0.5 &&
+ fabs(inst.step_matrix.yy - bbh) < 0.5) {
+ gs_scale(saved, inst.size.x / inst.step_matrix.xx,
+ inst.size.y / inst.step_matrix.yy);
+ if (ADJUST_SCALE_FOR_THIN_LINES) {
+ /* To allow thin lines at a cell boundary to be painted
+ * inside the cell, we adjust the scale so that the scaled
+ * width is in fixed_1 smaller. */
+ gs_scale(saved, (inst.size.x - 1.0 / fixed_scale) / inst.size.x,
+ (inst.size.y - 1.0 / fixed_scale) / inst.size.y);
+ }
+ code = compute_inst_matrix(&inst, &bbox,
+ dev_width, dev_height, &bbw, &bbh);
+ if (code < 0)
+ goto fsaved;
+ if_debug2m('t', mem,
+ "[t]adjusted XStep & YStep to size=(%d,%d)\n",
+ inst.size.x, inst.size.y);
+ if_debug4m('t', mem, "[t]bbox=(%g,%g),(%g,%g)\n",
+ bbox.p.x, bbox.p.y, bbox.q.x, bbox.q.y);
+ } else if ((ADJUST_AS_ADOBE) && (inst.templat.TilingType != 2)) {
+ if (inst.step_matrix.xy == 0 && inst.step_matrix.yx == 0 &&
+ fabs(inst.step_matrix.xx - bbw) < 0.5 &&
+ fabs(inst.step_matrix.yy - bbh) < 0.5) {
+ if (inst.step_matrix.xx <= 2) {
+ /* Prevent a degradation - see -r72 mspro.pdf */
+ gs_scale(saved, fabs(inst.size.x / inst.step_matrix.xx), 1);
+ inst.step_matrix.xx = (float)inst.size.x;
+ } else {
+ float cx, ox, dx;
+ /* We adjust the step matrix to an integer (as we
+ * can't quickly tile non-integer tiles). We bend
+ * the contents of the tile slightly so that they
+ * completely fill the tile (rather than potentially
+ * leaving gaps around the edge).
+ * To allow thin lines at a cell boundary to be painted
+ * inside the cell, we adjust the scale so that the
+ * scaled width is fixed_1 smaller. */
+ gs_scale(saved,
+ (inst.size.x - 1.0 / fixed_scale) / inst.step_matrix.xx,
+ 1);
+ /* We want the point in the centre of the displayed
+ region of this pattern not to move. We don't know
+ where the displayed region of the pattern is, so
+ we take the centre of the pattern bbox as a guess.
+ We call this (cx,cy). Let's suppose that this point
+ is the image of (ox,oy) under transformation.
+
+ (a 0 0)
+ (0 d 0)
+ (x y 1)
+ (ox oy 1)(ox.a+x oy.d+y 1)
+
+ Thus cx = ox.a + x, cy = oy.d + y
+ So ox = (cx - x)/a, oy = (cy - y)/d
+
+ We want to adjust the matrix to use A and D instead
+ of a and d, and also adjust x and y so that the image
+ of (ox,oy) is the same.
+
+ i.e. (A 0 0)
+ (0 D 0)
+ (X Y 1)
+ (ox oy 1)(ox.A+X oy.D+Y 1)
+
+ i.e. cx = ox.A+X, cy = oy.D+Y
+ So X = cx - ox.A
+ x = cx - ox.a
+ x-X = -ox.a + ox.A
+ = ox.(A-a)
+
+ BUT we've been at pains already to make sure that the
+ origin of the 0th tile falls on pixel boundaries. So
+ clamp our correction to whole pixels.
+ */
+ cx = (bbox.p.x + bbox.q.x)/2;
+ ox = (cx - inst.step_matrix.tx) / inst.step_matrix.xx;
+ dx = ox * (inst.size.x - inst.step_matrix.xx);
+ dx = floor(dx+0.5); /* Whole pixels! */
+ inst.step_matrix.xx = (float)inst.size.x;
+ inst.saved->ctm.tx -= dx;
}
- if (ADJUST_SCALE_BY_GS_TRADITION &&
- inst.step_matrix.xy == 0 && inst.step_matrix.yx == 0 &&
- fabs(fabs(inst.step_matrix.xx) - bbw) < 0.5 &&
- fabs(fabs(inst.step_matrix.yy) - bbh) < 0.5
- ) {
- gs_scale(saved, fabs(inst.size.x / inst.step_matrix.xx),
- fabs(inst.size.y / inst.step_matrix.yy));
- code = compute_inst_matrix(&inst, saved, &bbox,
- dev_width, dev_height, &bbw, &bbh);
- if (code < 0)
- goto fsaved;
- if (ADJUST_SCALE_FOR_THIN_LINES) {
- /* To allow thin lines at a cell boundary
- to be painted inside the cell,
- we adjust the scale so that
- the scaled width is in fixed_1 smaller */
- gs_scale(saved, (fabs(inst.size.x) - 1.0 / fixed_scale) / fabs(inst.size.x),
- (fabs(inst.size.y) - 1.0 / fixed_scale) / fabs(inst.size.y));
- }
- if_debug2m('t', mem,
- "[t]adjusted XStep & YStep to size=(%d,%d)\n",
- inst.size.x, inst.size.y);
- if_debug4m('t', mem, "[t]bbox=(%g,%g),(%g,%g)\n",
- bbox.p.x, bbox.p.y, bbox.q.x, bbox.q.y);
- } else if ((ADJUST_AS_ADOBE) && (inst.templat.TilingType != 2)) {
- if (inst.step_matrix.xy == 0 && inst.step_matrix.yx == 0 &&
- fabs(fabs(inst.step_matrix.xx) - bbw) < 0.5 &&
- fabs(fabs(inst.step_matrix.yy) - bbh) < 0.5
- ) {
- if (inst.step_matrix.xx <= 2) {
- /* Prevent a degradation - see -r72 mspro.pdf */
- gs_scale(saved, fabs(inst.size.x / inst.step_matrix.xx), 1);
- inst.step_matrix.xx = (float)inst.size.x;
- } else {
-#if 0
- /* New code from RJW, currently disabled. While
- * investigating an XPS pattern problem (caused by
- * a pattern with step 7.5 being rendered into an 8x8
- * tile with a fill adjust of 0 having empty edges),
- * I considered the following changed code, which seems
- * like the right thing to do. It produces many image
- * diffs, but none obscenely bad. We leave this
- * disabled for now, as the XPS problem has moved by
- * dint of us now using TilingType 2 instead. */
- /* We adjust the step matrix to an integer (as we
- * can't quickly tile non-integer tiles). We bend
- * the contents of the tile slightly so that they
- * completely fill the tile (rather than potentially
- * leaving gaps around the edge).
- * To allow thin lines at a cell boundary to be painted
- * inside the cell, we adjust the scale so that the
- * scaled width is fixed_1 smaller. */
- float newscale = (float)floor(inst.step_matrix.xx + 0.5);
- gs_scale(saved,
- (newscale - 1.0 / fixed_scale) / inst.step_matrix.xx,
- 1);
- inst.step_matrix.xx = newscale;
-#else
- inst.step_matrix.xx = (float)floor(inst.step_matrix.xx + 0.5);
- /* To allow thin lines at a cell boundary
- to be painted inside the cell,
- we adjust the scale so that
- the scaled width is in fixed_1 smaller */
- if (bbw >= inst.size.x - 1.0 / fixed_scale)
- gs_scale(saved, (fabs(inst.size.x) - 1.0 / fixed_scale) / fabs(inst.size.x), 1);
-#endif
- }
- if (inst.step_matrix.yy <= 2) {
- gs_scale(saved, 1, fabs(inst.size.y / inst.step_matrix.yy));
- inst.step_matrix.yy = (float)inst.size.y;
- } else {
-#if 0
- /* See above comment for explaination */
- float newscale = (float)floor(inst.step_matrix.yy + 0.5);
- gs_scale(saved,
- 1,
- (newscale - 1.0 / fixed_scale) / inst.step_matrix.yy);
- inst.step_matrix.yy = newscale;
-#else
- inst.step_matrix.yy = (float)floor(inst.step_matrix.yy + 0.5);
- if (bbh >= inst.size.y - 1.0 / fixed_scale)
- gs_scale(saved, 1, (fabs(inst.size.y) - 1.0 / fixed_scale) / fabs(inst.size.y));
-#endif
- }
- code = gs_bbox_transform(&inst.templat.BBox, &ctm_only(saved), &bbox);
- if (code < 0)
- goto fsaved;
- }
- } else if ((inst.templat.TilingType == 2) &&
- ((pgs->fill_adjust.x | pgs->fill_adjust.y) == 0)) {
- /* RJW: This codes with non-rotated cases (with or without a
- * skew), but won't cope with rotated ones. Find an example. */
- float shiftx = ((inst.step_matrix.yx == 0 &&
- fabs(fabs(inst.step_matrix.xx) - bbw) <= 0.5) ?
- (bbw - inst.size.x)/2 : 0);
- float shifty = ((inst.step_matrix.xy == 0 &&
- fabs(fabs(inst.step_matrix.yy) - bbh) <= 0.5) ?
- (bbh - inst.size.y)/2 : 0);
- gs_translate_untransformed(saved, shiftx, shifty);
- code = gs_bbox_transform(&inst.templat.BBox, &ctm_only(saved), &bbox);
- if (code < 0)
- goto fsaved;
+ if (inst.step_matrix.yy <= 2) {
+ gs_scale(saved, 1, inst.size.y / inst.step_matrix.yy);
+ inst.step_matrix.yy = (float)inst.size.y;
+ } else {
+ float cy, oy, dy;
+ /* See above comment for explanation */
+ gs_scale(saved,
+ 1,
+ (inst.size.y - 1.0 / fixed_scale) / inst.step_matrix.yy);
+ cy = (bbox.p.y + bbox.q.y)/2;
+ oy = (cy - inst.step_matrix.ty) / inst.step_matrix.yy;
+ dy = oy * (inst.size.y - inst.step_matrix.yy);
+ dy = floor(dy+0.5); /* Whole pixels! */
+ inst.step_matrix.yy = (float)inst.size.y;
+ inst.saved->ctm.ty -= dy;
}
+ code = fix_bbox_after_matrix_adjustment(&inst, &bbox);
+ if (code < 0)
+ goto fsaved;
}
+ } else if ((inst.templat.TilingType == 2) &&
+ ((pgs->fill_adjust.x | pgs->fill_adjust.y) == 0)) {
+ /* RJW: This codes with non-rotated cases (with or without a
+ * skew), but won't cope with rotated ones. Find an example. */
+ float shiftx = ((inst.step_matrix.yx == 0 &&
+ fabs(inst.step_matrix.xx - bbw) <= 0.5) ?
+ (bbw - inst.size.x)/2 : 0);
+ float shifty = ((inst.step_matrix.xy == 0 &&
+ fabs(inst.step_matrix.yy - bbh) <= 0.5) ?
+ (bbh - inst.size.y)/2 : 0);
+ gs_translate_untransformed(saved, shiftx, shifty);
+ code = fix_bbox_after_matrix_adjustment(&inst, &bbox);
+ if (code < 0)
+ goto fsaved;
}
if ((code = gs_bbox_transform_inverse(&bbox, &inst.step_matrix, &inst.bbox)) < 0)
goto fsaved;
if_debug4m('t', mem, "[t]ibbox=(%g,%g),(%g,%g)\n",
inst.bbox.p.x, inst.bbox.p.y, inst.bbox.q.x, inst.bbox.q.y);
- inst.is_simple = (fabs(inst.step_matrix.xx) == inst.size.x && inst.step_matrix.xy == 0 &&
- inst.step_matrix.yx == 0 && fabs(inst.step_matrix.yy) == inst.size.y);
+ inst.is_simple = (inst.step_matrix.xx == inst.size.x && inst.step_matrix.xy == 0 &&
+ inst.step_matrix.yx == 0 && inst.step_matrix.yy == inst.size.y);
if_debug6m('t', mem,
"[t]is_simple? xstep=(%g,%g) ystep=(%g,%g) size=(%d,%d)\n",
inst.step_matrix.xx, inst.step_matrix.xy,
@@ -526,15 +543,50 @@ clamp_pattern_bbox(gs_pattern1_instance_t * pinst, gs_rect * pbbox,
return 0;
}
+static int
+adjust_bbox_to_pixel_origin(gs_pattern1_instance_t *pinst, gs_rect *pbbox)
+{
+ gs_gstate * saved = pinst->saved;
+ float dx, dy;
+ int code = 0;
+
+ /*
+ * Adjust saved.ctm to map the bbox origin to pixels.
+ */
+ dx = pbbox->p.x - floor(pbbox->p.x + 0.5);
+ dy = pbbox->p.y - floor(pbbox->p.y + 0.5);
+ if (dx != 0 || dy != 0) {
+ pbbox->p.x -= dx;
+ pbbox->p.y -= dy;
+ pbbox->q.x -= dx;
+ pbbox->q.y -= dy;
+
+ if (saved->ctm.txy_fixed_valid) {
+ code = gx_translate_to_fixed(saved, float2fixed_rounded(saved->ctm.tx - dx),
+ float2fixed_rounded(saved->ctm.ty - dy));
+ } else { /* the ctm didn't fit in a fixed. Just adjust the float values */
+ saved->ctm.tx -= dx;
+ saved->ctm.ty -= dy;
+ /* not sure if this is needed for patterns, but lifted from gx_translate_to_fixed */
+ code = gx_path_translate(saved->path, float2fixed(-dx), float2fixed(-dy));
+ }
+ }
+ pinst->step_matrix.tx = saved->ctm.tx;
+ pinst->step_matrix.ty = saved->ctm.ty;
+
+ return code;
+}
+
/* Compute the stepping matrix and device space instance bounding box */
/* from the step values and the saved matrix. */
static int
-compute_inst_matrix(gs_pattern1_instance_t * pinst, gs_gstate * saved,
+compute_inst_matrix(gs_pattern1_instance_t * pinst,
gs_rect * pbbox, int width, int height,
float *pbbw, float *pbbh)
{
- float xx, xy, yx, yy, dx, dy, temp;
+ float xx, xy, yx, yy, temp;
int code;
+ gs_gstate * saved = pinst->saved;
gs_matrix m = ctm_only(saved);
/* Bug 702124: Due to the limited precision of floats, we find that
@@ -554,24 +606,8 @@ compute_inst_matrix(gs_pattern1_instance_t * pinst, gs_gstate * saved,
pbbox->p.y += ctm_only(saved).ty;
pbbox->q.x += ctm_only(saved).tx;
pbbox->q.y += ctm_only(saved).ty;
- /*
- * Adjust saved.ctm to map the bbox origin to pixels.
- */
- dx = pbbox->p.x - floor(pbbox->p.x + 0.5);
- dy = pbbox->p.y - floor(pbbox->p.y + 0.5);
- pbbox->p.x -= dx;
- pbbox->p.y -= dy;
- pbbox->q.x -= dx;
- pbbox->q.y -= dy;
- if (saved->ctm.txy_fixed_valid) {
- code = gx_translate_to_fixed(saved, float2fixed_rounded(saved->ctm.tx - dx),
- float2fixed_rounded(saved->ctm.ty - dy));
- } else { /* the ctm didn't fit in a fixed. Just adjust the float values */
- saved->ctm.tx -= dx;
- saved->ctm.ty -= dy;
- /* not sure if this is needed for patterns, but lifted from gx_translate_to_fixed */
- code = gx_path_translate(saved->path, float2fixed(-dx), float2fixed(-dy));
- }
+
+ code = adjust_bbox_to_pixel_origin(pinst, pbbox);
if (code < 0)
return code;
@@ -595,8 +631,7 @@ compute_inst_matrix(gs_pattern1_instance_t * pinst, gs_gstate * saved,
pinst->step_matrix.xy = xy;
pinst->step_matrix.yx = yx;
pinst->step_matrix.yy = yy;
- pinst->step_matrix.tx = saved->ctm.tx;
- pinst->step_matrix.ty = saved->ctm.ty;
+
/*
* Some applications produce patterns that are larger than the page.
* If the bounding box for the pattern is larger than the page. clamp
@@ -609,6 +644,23 @@ compute_inst_matrix(gs_pattern1_instance_t * pinst, gs_gstate * saved,
return code;
}
+static int
+fix_bbox_after_matrix_adjustment(gs_pattern1_instance_t *pinst, gs_rect *pbbox)
+{
+ int code;
+ gs_gstate * saved = pinst->saved;
+
+ code = gs_bbox_transform(&pinst->templat.BBox, &ctm_only(saved), pbbox);
+ if (code < 0)
+ return code;
+
+ code = adjust_bbox_to_pixel_origin(pinst, pbbox);
+ if (code < 0)
+ return code;
+
+ return code;
+}
+
/* Test whether a PatternType 1 pattern uses a base space. */
static bool
gs_pattern1_uses_base_space(const gs_pattern_template_t *ptemp)
@@ -822,8 +874,9 @@ mask_PaintProc(const gs_client_color * pcolor, gs_gstate * pgs)
gs_image_t_init_mask(&mask, true);
mask.Width = pbitmap->size.x;
mask.Height = pbitmap->size.y;
- gs_image_init(pen, &mask, false, false, pgs);
- code = bitmap_paint(pen, (gs_data_image_t *) & mask, pbitmap, pgs);
+ code = gs_image_init(pen, &mask, false, false, pgs);
+ if (code >= 0)
+ code = bitmap_paint(pen, (gs_data_image_t *) & mask, pbitmap, pgs);
gs_free_object(gs_gstate_memory(pgs), pen, "mask_PaintProc");
return code;
}
diff --git a/base/gsptype1.h b/base/gsptype1.h
index f1602d36..304d95da 100644
--- a/base/gsptype1.h
+++ b/base/gsptype1.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsptype2.c b/base/gsptype2.c
index 1181fccc..878fbe64 100644
--- a/base/gsptype2.c
+++ b/base/gsptype2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsptype2.h b/base/gsptype2.h
index fb8ae014..79bafc19 100644
--- a/base/gsptype2.h
+++ b/base/gsptype2.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsrect.h b/base/gsrect.h
index 5aa9bd0e..95b3ccea 100644
--- a/base/gsrect.h
+++ b/base/gsrect.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsrefct.h b/base/gsrefct.h
index a88c19a4..bfdb1a6f 100644
--- a/base/gsrefct.h
+++ b/base/gsrefct.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsromfs0.c b/base/gsromfs0.c
index fc30e3bc..83843932 100644
--- a/base/gsromfs0.c
+++ b/base/gsromfs0.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsrop.c b/base/gsrop.c
index f78ae09c..e2e28044 100644
--- a/base/gsrop.c
+++ b/base/gsrop.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsrop.h b/base/gsrop.h
index 2cbf5201..f7035be9 100644
--- a/base/gsrop.h
+++ b/base/gsrop.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsroprun.c b/base/gsroprun.c
index 3b65cddb..e4f7091e 100644
--- a/base/gsroprun.c
+++ b/base/gsroprun.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsroprun1.h b/base/gsroprun1.h
index e44b77ad..5a1ee5f6 100644
--- a/base/gsroprun1.h
+++ b/base/gsroprun1.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsroprun24.h b/base/gsroprun24.h
index 0afd02d8..a966e4aa 100644
--- a/base/gsroprun24.h
+++ b/base/gsroprun24.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsroprun8.h b/base/gsroprun8.h
index fdc1e5e2..e3de6d39 100644
--- a/base/gsroprun8.h
+++ b/base/gsroprun8.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsropt.h b/base/gsropt.h
index 65c6da87..82980d22 100644
--- a/base/gsropt.h
+++ b/base/gsropt.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsroptab.c b/base/gsroptab.c
index d768dd04..885c048c 100644
--- a/base/gsroptab.c
+++ b/base/gsroptab.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsserial.c b/base/gsserial.c
index 4eda39d1..21f824f4 100644
--- a/base/gsserial.c
+++ b/base/gsserial.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsserial.h b/base/gsserial.h
index c30407b1..85826a7b 100644
--- a/base/gsserial.h
+++ b/base/gsserial.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsshade.c b/base/gsshade.c
index 50c72216..e6421f95 100644
--- a/base/gsshade.c
+++ b/base/gsshade.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsshade.h b/base/gsshade.h
index 55d7a46b..b0993c05 100644
--- a/base/gsshade.h
+++ b/base/gsshade.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gssprintf.c b/base/gssprintf.c
index aab4051f..2b24580e 100644
--- a/base/gssprintf.c
+++ b/base/gssprintf.c
@@ -116,13 +116,13 @@ static const char null_string[] = "(null)";
#define NDIG 80
/* buf must have at least NDIG bytes */
-static char *apr_cvt(double arg, int ndigits, int *decpt, int *sign,
+static char *apr_cvt(double arg, int ndigits, int *decpt, int *sign,
int eflag, char *buf)
{
register int r2;
double fi, fj;
register char *p, *p1;
-
+
if (ndigits >= NDIG - 1)
ndigits = NDIG - 2;
r2 = 0;
@@ -387,7 +387,7 @@ static char *conv_10(register apr_int32_t num, register int is_unsigned,
*is_negative = (num < 0);
/*
- * On a 2's complement machine, negating the most negative integer
+ * On a 2's complement machine, negating the most negative integer
* results in a number that cannot be represented as a signed integer.
* Here is what we do to obtain the number's magnitude:
* a. add 1 to the number
@@ -402,7 +402,7 @@ static char *conv_10(register apr_int32_t num, register int is_unsigned,
}
/*
- * We use a do-while loop so that we write at least 1 digit
+ * We use a do-while loop so that we write at least 1 digit
*/
do {
register apr_uint32_t new_magnitude = magnitude / 10;
@@ -439,7 +439,7 @@ static char *conv_10_quad(apr_int64_t num, register int is_unsigned,
*is_negative = (num < 0);
/*
- * On a 2's complement machine, negating the most negative integer
+ * On a 2's complement machine, negating the most negative integer
* results in a number that cannot be represented as a signed integer.
* Here is what we do to obtain the number's magnitude:
* a. add 1 to the number
@@ -454,7 +454,7 @@ static char *conv_10_quad(apr_int64_t num, register int is_unsigned,
}
/*
- * We use a do-while loop so that we write at least 1 digit
+ * We use a do-while loop so that we write at least 1 digit
*/
do {
apr_uint64_t new_magnitude = magnitude / 10;
@@ -885,7 +885,7 @@ static int apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *),
(sizeof(APR_INT64_T_FMT) == 3 &&
fmt[0] == APR_INT64_T_FMT[0]) ||
(sizeof(APR_INT64_T_FMT) > 4 &&
- strncmp(fmt, APR_INT64_T_FMT,
+ strncmp(fmt, APR_INT64_T_FMT,
sizeof(APR_INT64_T_FMT) - 2) == 0)) {
/* Need to account for trailing 'd' and null in sizeof() */
var_type = IS_QUAD;
@@ -1413,7 +1413,7 @@ static int apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *),
}
/*
- * Print the string s.
+ * Print the string s.
*/
if (print_something == YES) {
for (i = s_len; i != 0; i--) {
diff --git a/base/gssprintf.h b/base/gssprintf.h
index e71fa434..0b5f6d3d 100644
--- a/base/gssprintf.h
+++ b/base/gssprintf.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsstate.c b/base/gsstate.c
index 898b879e..e8077d07 100644
--- a/base/gsstate.c
+++ b/base/gsstate.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -44,8 +44,10 @@
/* Forward references */
static gs_gstate *gstate_alloc(gs_memory_t *, client_name_t,
const gs_gstate *);
-static gs_gstate *gstate_clone(gs_gstate *, gs_memory_t *, client_name_t,
- gs_gstate_copy_reason_t);
+static gs_gstate *gstate_clone_for_gsave(gs_gstate *,
+ client_name_t);
+static gs_gstate *gstate_clone_for_gstate(const gs_gstate *, gs_memory_t *,
+ client_name_t);
static void gstate_free_contents(gs_gstate *);
static int gstate_copy(gs_gstate *, const gs_gstate *,
gs_gstate_copy_reason_t, client_name_t);
@@ -161,7 +163,7 @@ extern_st(st_gs_gstate); /* for gstate_alloc() */
/* Copy client data, using the copy_for procedure if available, */
/* the copy procedure otherwise. */
static int
-gstate_copy_client_data(gs_gstate * pgs, void *dto, void *dfrom,
+gstate_copy_client_data(const gs_gstate * pgs, void *dto, void *dfrom,
gs_gstate_copy_reason_t reason)
{
return (pgs->client_procs.copy_for != 0 ?
@@ -301,10 +303,9 @@ gs_gstate_free(gs_gstate * pgs)
int
gs_gsave(gs_gstate * pgs)
{
- gs_gstate *pnew = gstate_clone(pgs, pgs->memory, "gs_gsave",
- copy_for_gsave);
+ gs_gstate *pnew = gstate_clone_for_gsave(pgs, "gs_gsave");
- if (pnew == 0)
+ if (pnew == NULL)
return_error(gs_error_VMerror);
/* As of PLRM3, the interaction between gsave and the clip stack is
* now clear. gsave stores the clip stack into the saved graphics
@@ -314,10 +315,11 @@ gs_gsave(gs_gstate * pgs)
* on pgs->clip_stack, but gstate_clone() has an exception for
* the clip_stack field.
*/
- pgs->clip_stack = 0;
+ pgs->clip_stack = NULL;
pgs->saved = pnew;
if (pgs->show_gstate == pgs)
pgs->show_gstate = pnew->show_gstate = pnew;
+ pgs->trans_flags.xstate_change = false;
pgs->level++;
if_debug2m('g', pgs->memory, "[g]gsave -> "PRI_INTPTR", level = %d\n",
(intptr_t)pnew, pgs->level);
@@ -461,27 +463,23 @@ gs_grestoreall(gs_gstate * pgs)
/* Allocate and return a new graphics state. */
gs_gstate *
-gs_gstate_copy(gs_gstate * pgs, gs_memory_t * mem)
+gs_gstate_copy(const gs_gstate * pgs, gs_memory_t * mem)
{
gs_gstate *pnew;
- /* Prevent 'capturing' the view clip path. */
- gx_clip_path *view_clip = pgs->view_clip;
- pgs->view_clip = 0;
- pnew = gstate_clone(pgs, mem, "gs_gstate", copy_for_gstate);
- if (pnew == 0)
- return 0;
+ pnew = gstate_clone_for_gstate(pgs, mem, "gs_gstate");
+ if (pnew == NULL)
+ return NULL;
clip_stack_rc_adjust(pnew->clip_stack, 1, "gs_gstate_copy");
- pgs->view_clip = view_clip;
- pnew->saved = 0;
+ pnew->saved = NULL;
/*
* Prevent dangling references from the show_gstate pointer. If
* this context is its own show_gstate, set the pointer in the clone
* to point to the clone; otherwise, set the pointer in the clone to
- * 0, and let gs_setgstate fix it up.
+ * NULL, and let gs_setgstate fix it up.
*/
pnew->show_gstate =
- (pgs->show_gstate == pgs ? pnew : 0);
+ (pgs->show_gstate == pgs ? pnew : NULL);
return pnew;
}
@@ -593,7 +591,7 @@ gs_gstate_update_overprint(gs_gstate * pgs, const gs_overprint_params_t * pparam
pgs->memory,
NULL);
if (code >= 0 || code == gs_error_handled){
- if (ovptdev != dev) {
+ if (code == 1) {
gx_set_device_only(pgs, ovptdev);
/* Get rid of extra reference */
rc_decrement(ovptdev, "gs_gstate_update_overprint(ovptdev)");
@@ -641,7 +639,7 @@ gs_do_set_overprint(gs_gstate * pgs)
gs_color_space_index pcs_index = gs_color_space_get_index(pcs);
dev_proc(dev, get_profile)(dev, &dev_profile);
- if (!dev_profile->sim_overprint)
+ if (dev_profile->overprint_control == gs_overprint_control_disable)
return code;
/* Transparency device that supports spots and where we have
@@ -665,9 +663,12 @@ gs_do_set_overprint(gs_gstate * pgs)
return code;
}
}
-
}
+ /* If we have a CIE-based space, use the ICC equivalent space */
+ if (gs_color_space_is_PSCIE(pcs) && pcs->icc_equivalent != NULL)
+ pcs = pcs->icc_equivalent;
+
/* The spaces that do not allow opm (e.g. ones that are not ICC or DeviceCMYK)
will blow away any true setting later. But we have to be prepared
in case this is a CMYK ICC space for example. Hence we set effective mode
@@ -847,6 +848,8 @@ gs_initgraphics(gs_gstate * pgs)
const gs_gstate gstate_initial = {
gs_gstate_initial(1.0)
};
+ gs_matrix m;
+ gs_make_identity(&m);
gs_initmatrix(pgs);
if ((code = gs_newpath(pgs)) < 0 ||
@@ -980,7 +983,13 @@ gs_initgraphics(gs_gstate * pgs)
if (code < 0)
goto exit;
- return 0;
+ code = gs_settextmatrix(pgs, &m);
+ if (code < 0)
+ goto exit;
+
+ code = gs_settextlinematrix(pgs, &m);
+ if (code < 0)
+ goto exit;
exit:
return code;
}
@@ -1210,6 +1219,16 @@ gstate_free_parts(gs_gstate * parts, gs_memory_t * mem, client_name_t cname)
}
}
+static inline void
+gstate_parts_init_dev_color(gx_device_color *dc)
+{
+ gx_device_color_type dct = dc->type;
+ gs_graphics_type_tag_t gtt = dc->tag;
+ memset(dc, 0x00, sizeof(gx_device_color));
+ dc->type = dct;
+ dc->tag = gtt;
+}
+
/* Allocate the privately allocated parts of a gstate. */
static int
gstate_alloc_parts(gs_gstate * parts, const gs_gstate * shared,
@@ -1254,6 +1273,8 @@ gstate_alloc_parts(gs_gstate * parts, const gs_gstate * shared,
gstate_free_parts(parts, mem, cname);
return_error(gs_error_VMerror);
}
+ gstate_parts_init_dev_color(parts->color[0].dev_color);
+ gstate_parts_init_dev_color(parts->color[1].dev_color);
return 0;
}
@@ -1289,77 +1310,114 @@ gstate_copy_dash(gs_memory_t *mem, gx_dash_params *dash , const gs_gstate * pfro
pfrom->line_params.dash.offset, mem);
}
-/* Clone an existing graphics state. */
-/* Return 0 if the allocation fails. */
-/* If reason is for_gsave, the clone refers to the old contents, */
-/* and we switch the old state to refer to the new contents. */
+typedef struct {
+ gs_gstate_parts parts;
+ gx_dash_params dash;
+} gs_gstate_clone_data;
+
static gs_gstate *
-gstate_clone(gs_gstate * pfrom, gs_memory_t * mem, client_name_t cname,
- gs_gstate_copy_reason_t reason)
+gstate_clone_core(const gs_gstate *pfrom,
+ client_name_t cname,
+ gs_gstate_clone_data *clone_data,
+ gs_gstate_copy_reason_t reason)
{
+ gs_memory_t *mem = pfrom->memory;
gs_gstate *pgs = gstate_alloc(mem, cname, pfrom);
- gs_gstate_parts parts;
void *pdata = NULL;
- gx_dash_params dash;
if (pgs == NULL)
- return 0;
- GSTATE_ASSIGN_PARTS(&parts, pgs);
+ return NULL;
if (pfrom->client_data != NULL) {
pdata = (*pfrom->client_procs.alloc) (mem);
if (pdata == NULL ||
- gstate_copy_client_data(pfrom, pdata, pfrom->client_data, reason) < 0
- )
+ gstate_copy_client_data(pfrom, pdata, pfrom->client_data,
+ reason) < 0)
goto fail;
}
/* Copy the dash and dash pattern if necessary. */
- dash = gs_currentlineparams_inline(pfrom)->dash;
- if (pfrom->line_params.dash.pattern) {
+ clone_data->dash = gs_currentlineparams_inline(pfrom)->dash;
+ if (clone_data->dash.pattern) {
int code;
- dash.pattern = NULL; /* Ensures a fresh allocation */
- code = gstate_copy_dash(mem, &dash, pfrom);
+ clone_data->dash.pattern = NULL; /* Ensures a fresh allocation */
+ code = gstate_copy_dash(mem, &clone_data->dash, pfrom);
if (code < 0)
goto fail;
}
+ /* Some records within pgs are allocated. We copy pfrom into pgs
+ * wholesale (to avoid problems with the structure being updated and
+ * us having to keep it in sync), so we copy those allocated regions
+ * out first. The caller of this routine will then put them back
+ * into either pgs or pfrom as appropriate. */
+ GSTATE_ASSIGN_PARTS(&clone_data->parts, pgs);
*pgs = *pfrom;
pgs->client_data = pdata;
- gs_currentlineparams_inline(pgs)->dash = dash;
- pgs->memory = mem;
gs_gstate_copied(pgs);
/* Don't do anything to clip_stack. */
rc_increment(pgs->device);
- *parts.color[0].ccolor = *pfrom->color[0].ccolor;
- *parts.color[0].dev_color = *pfrom->color[0].dev_color;
- *parts.color[1].ccolor = *pfrom->color[1].ccolor;
- *parts.color[1].dev_color = *pfrom->color[1].dev_color;
- if (reason == copy_for_gsave) {
- float *dfrom = pfrom->line_params.dash.pattern;
- float *dto = pgs->line_params.dash.pattern;
-
- GSTATE_ASSIGN_PARTS(pfrom, &parts);
- pgs->line_params.dash.pattern = dfrom;
- pfrom->line_params.dash.pattern = dto;
- } else {
- GSTATE_ASSIGN_PARTS(pgs, &parts);
- }
- gs_swapcolors_quick(pgs);
- cs_adjust_counts_icc(pgs, 1);
- gs_swapcolors_quick(pgs);
+ *clone_data->parts.color[0].ccolor = *pgs->color[0].ccolor;
+ *clone_data->parts.color[0].dev_color = *pgs->color[0].dev_color;
+ *clone_data->parts.color[1].ccolor = *pgs->color[1].ccolor;
+ *clone_data->parts.color[1].dev_color = *pgs->color[1].dev_color;
cs_adjust_counts_icc(pgs, 1);
+ cs_adjust_swappedcounts_icc(pgs, 1);
+
return pgs;
+
fail:
if (pdata != NULL)
(*pfrom->client_procs.free) (pdata, mem, pgs);
- memset(pgs->color, 0, 2*sizeof(gs_gstate_color));
- gs_free_object(mem, pgs->line_params.dash.pattern, cname);
- GSTATE_ASSIGN_PARTS(pgs, &parts);
+ gs_free_object(mem, clone_data->dash.pattern, cname);
gstate_free_parts(pgs, mem, cname);
gs_free_object(mem, pgs, cname);
- return 0;
+
+ return NULL;
+}
+
+
+/* Clone an existing graphics state for use in gsave. The clone refers
+ * to the old contents, and the old state refers to the new contents. */
+/* Return NULL if the allocation fails. */
+static gs_gstate *
+gstate_clone_for_gsave(gs_gstate *pfrom,
+ client_name_t cname)
+{
+ gs_gstate_clone_data clone_data;
+ gs_gstate *pgs = gstate_clone_core(pfrom, cname, &clone_data,
+ copy_for_gsave);
+
+ if (pgs == NULL)
+ return NULL;
+
+ /* Newly allocated parts go back into pfrom, not pgs! */
+ GSTATE_ASSIGN_PARTS(pfrom, &clone_data.parts);
+ gs_currentlineparams_inline(pfrom)->dash = clone_data.dash;
+
+ return pgs;
+}
+
+/* Clone an existing graphics state. The view_clip is not copied. */
+/* Return NULL if the allocation fails. */
+static gs_gstate *
+gstate_clone_for_gstate(const gs_gstate *pfrom,
+ gs_memory_t *mem,
+ client_name_t cname)
+{
+ gs_gstate_clone_data clone_data;
+ gs_gstate *pgs = gstate_clone_core(pfrom, cname, &clone_data,
+ copy_for_gstate);
+
+ if (pgs == NULL)
+ return NULL;
+ GSTATE_ASSIGN_PARTS(pgs, &clone_data.parts);
+ pgs->view_clip = NULL;
+ gs_currentlineparams_inline(pgs)->dash = clone_data.dash;
+ pgs->memory = mem;
+
+ return pgs;
}
/* Adjust reference counters for the whole clip stack */
diff --git a/base/gsstate.h b/base/gsstate.h
index 4a4fe260..b786dde4 100644
--- a/base/gsstate.h
+++ b/base/gsstate.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -33,7 +33,7 @@ int gs_gsave(gs_gstate *), gs_grestore(gs_gstate *), gs_grestoreall(gs_gstate *)
int gs_grestore_only(gs_gstate *);
int gs_gsave_for_save(gs_gstate *, gs_gstate **), gs_grestoreall_for_restore(gs_gstate *, gs_gstate *);
-gs_gstate *gs_gstate_copy(gs_gstate *, gs_memory_t *);
+gs_gstate *gs_gstate_copy(const gs_gstate *, gs_memory_t *);
int gs_copygstate(gs_gstate * /*to */ , const gs_gstate * /*from */ ),
gs_currentgstate(gs_gstate * /*to */ , const gs_gstate * /*from */ ),
gs_setgstate(gs_gstate * /*to */ , const gs_gstate * /*from */ );
diff --git a/base/gsstrl.h b/base/gsstrl.h
index 4b745e22..3ea00623 100644
--- a/base/gsstrl.h
+++ b/base/gsstrl.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsstrtok.h b/base/gsstrtok.h
index 8dded3d3..a50ab3a1 100644
--- a/base/gsstrtok.h
+++ b/base/gsstrtok.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsstruct.h b/base/gsstruct.h
index a517a62d..663940d9 100644
--- a/base/gsstruct.h
+++ b/base/gsstruct.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsstype.h b/base/gsstype.h
index c3548fdd..7584ecc1 100644
--- a/base/gsstype.h
+++ b/base/gsstype.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gstext.c b/base/gstext.c
index bb258d39..e8373295 100644
--- a/base/gstext.c
+++ b/base/gstext.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -32,6 +32,8 @@
#include "gzstate.h"
#include "gsutil.h"
#include "gxdevsop.h"
+#include "gscspace.h"
+#include "gsicc_blacktext.h"
/* GC descriptors */
public_st_gs_text_params();
@@ -212,6 +214,7 @@ gs_text_enum_init(gs_text_enum_t *pte, const gs_text_enum_procs_t *procs,
pte->log2_scale.x = pte->log2_scale.y = 0;
/* init_dynamic sets index, xy_index, fstack */
code = gs_text_enum_init_dynamic(pte, font);
+ pte->k_text_release = 0;
if (code >= 0)
rc_increment(dev);
return code;
@@ -278,6 +281,23 @@ gs_text_begin(gs_gstate * pgs, const gs_text_params_t * text,
(pgs->text_rendering_mode == 0));
bool text_op_stroke = ((pgs->stroke_overprint || (!pgs->stroke_overprint && op_active)) &&
(pgs->text_rendering_mode == 1));
+ bool type3 = (pgs->font->FontType == ft_user_defined ||
+ pgs->font->FontType == ft_PDF_user_defined ||
+ pgs->font->FontType == ft_PCL_user_defined ||
+ pgs->font->FontType == ft_MicroType ||
+ pgs->font->FontType == ft_GL2_stick_user_defined ||
+ pgs->font->FontType == ft_GL2_531);
+ bool in_smask =
+ (dev_proc(pgs->device, dev_spec_op)(pgs->device, gxdso_in_smask_construction, NULL, 0)) > 0;
+ bool black_text = (text->operation & (TEXT_DO_DRAW | TEXT_DO_ANY_CHARPATH)) &&
+ !type3 && !in_smask;
+ cmm_dev_profile_t *icc_struct;
+
+ code = dev_proc(pgs->device, get_profile)((gx_device *)pgs->device, &icc_struct);
+ if (code < 0)
+ black_text = 0;
+ else
+ black_text = black_text && icc_struct->blacktext;
/*
* Detect nocurrentpoint now, even if the string is empty, for Adobe
@@ -311,9 +331,40 @@ gs_text_begin(gs_gstate * pgs, const gs_text_params_t * text,
/* Processing a text object operation */
ensure_tag_is_set(pgs, pgs->device, GS_TEXT_TAG); /* NB: may unset_dev_color */
+ if (black_text && pgs->black_text_state == NULL) {
+ gs_color_space *pcs_curr = gs_currentcolorspace_inline(pgs);
+ gs_color_space *pcs_alt = gs_swappedcolorspace_inline(pgs);
+
+ pgs->black_text_state = gsicc_blacktext_state_new(pgs->memory);
+ if (pgs->black_text_state == NULL)
+ return gs_error_VMerror;
+
+ rc_increment_cs(pcs_curr);
+ rc_increment_cs(pcs_alt);
+ pgs->black_text_state->pcs[0] = pcs_curr;
+ pgs->black_text_state->pcs[1] = pcs_alt;
+
+ pgs->black_text_state->pcc[0] = pgs->color[0].ccolor;
+ cs_adjust_color_count(pgs, 1); /* The set_gray will do a decrement */
+ pgs->black_text_state->value[0] = pgs->color[0].ccolor->paint.values[0];
+ gs_setgray(pgs, 0.0);
+
+ gs_swapcolors_quick(pgs);
+
+ pgs->black_text_state->pcc[1] = pgs->color[0].ccolor;
+ cs_adjust_color_count(pgs, 1);
+ pgs->black_text_state->value[1] = pgs->color[0].ccolor->paint.values[0];
+ gs_setgray(pgs, 0.0);
+
+ gs_swapcolors_quick(pgs);
+
+ pgs->black_text_state->is_fill = pgs->is_fill_color;
+ }
+
code = gx_set_dev_color(pgs);
if (code != 0)
return code;
+
code = gs_gstate_color_load(pgs);
if (code < 0)
return code;
@@ -340,7 +391,7 @@ gs_text_begin(gs_gstate * pgs, const gs_text_params_t * text,
cmm_dev_profile_t* dev_profile;
dev_proc(dev, get_profile)(dev, &dev_profile);
- if (dev_profile->sim_overprint &&
+ if ((dev_profile->overprint_control != gs_overprint_control_disable) &&
(dev_profile->device_profile[GS_DEFAULT_DEVICE_PROFILE]->data_cs == gsCMYK ||
dev_profile->device_profile[GS_DEFAULT_DEVICE_PROFILE]->data_cs == gsNCHANNEL)) {
if (pgs->text_rendering_mode == 0) {
@@ -354,10 +405,30 @@ gs_text_begin(gs_gstate * pgs, const gs_text_params_t * text,
}
pgs->device->sgr.stroke_stored = false;
- return gx_device_text_begin(pgs->device, pgs,
+ code = gx_device_text_begin(pgs->device, pgs,
text, pgs->font, pgs->path,
gs_currentdevicecolor_inline(pgs),
pcpath, mem, ppte);
+
+ /* we need to know if we are doing a highlevel device.
+ Also we need to know if we are doing any stroke
+ or stroke fill operations. This determines when
+ we need to release the black_text_state structure. */
+ if (code >= 0 && *ppte != NULL) {
+ if (black_text) {
+ if (!((*ppte)->k_text_release)) {
+ /* Not a high level device */
+ if (pgs->text_rendering_mode == 0 ||
+ pgs->text_rendering_mode == 4) {
+ /* No stroke */
+ (*ppte)->k_text_release = 1;
+ }
+ }
+ } else
+ (*ppte)->k_text_release = 0;
+ }
+
+ return code;
}
/*
@@ -762,8 +833,10 @@ rc_free_text_enum(gs_memory_t * mem, void *obj, client_name_t cname)
rc_free_struct_only(mem, obj, cname);
}
void
-gs_text_release(gs_text_enum_t * pte, client_name_t cname)
+gs_text_release(gs_gstate *pgs, gs_text_enum_t * pte, client_name_t cname)
{
+ if (pgs != NULL && pgs->black_text_state != NULL)
+ gsicc_restore_black_text(pgs);
rc_decrement_only(pte, cname);
}
diff --git a/base/gstext.h b/base/gstext.h
index a3317d0a..e8de9fea 100644
--- a/base/gstext.h
+++ b/base/gstext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -215,8 +215,6 @@ gs_show_begin(gs_gstate *, const byte *, uint,
gs_charboxpath_begin(gs_gstate *, const byte *, uint, bool,
gs_memory_t *, gs_text_enum_t **);
-/* Compute the number of characters in a text. */
-int gs_text_size(gs_gstate * pgs, gs_text_params_t *text, gs_memory_t * mem);
/* Retrieve text params from enumerator. */
gs_text_params_t *gs_get_text_params(gs_text_enum_t *pte);
@@ -301,7 +299,7 @@ int
int gs_text_retry(gs_text_enum_t *pte);
/* Release the text processing structures. */
-void gs_text_release(gs_text_enum_t *pte, client_name_t cname);
+void gs_text_release(gs_gstate *pgs, gs_text_enum_t *pte, client_name_t cname);
/* Compute the number of characters in a text. */
int gs_text_count_chars(gs_gstate * pgs, gs_text_params_t *text, gs_memory_t * mem);
diff --git a/base/gstiffio.c b/base/gstiffio.c
index 5482d783..004f9feb 100644
--- a/base/gstiffio.c
+++ b/base/gstiffio.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -293,6 +293,21 @@ _TIFFmemcmp(const void* p1, const void* p2, tmsize_t c)
return (memcmp(p1, p2, (size_t) c));
}
+#if !defined(HAVE_SNPRINTF) && !defined(HAVE__SNPRINTF)
+#include "gssprintf.h"
+int
+_TIFF_snprintf_f(char* buf, size_t size, const char* format, ...)
+{
+ int count;
+ va_list args;
+
+ va_start(args, format);
+ count = gs_vsnprintf(buf, size, format, args);
+ va_end(args);
+ return count;
+}
+#endif
+
/* We supply our own warning/error handlers when we invoke libtiff */
TIFFErrorHandler _TIFFwarningHandler = NULL;
TIFFErrorHandler _TIFFerrorHandler = NULL;
diff --git a/base/gstiffio.h b/base/gstiffio.h
index d71ec81e..405e0fac 100644
--- a/base/gstiffio.h
+++ b/base/gstiffio.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gstparam.h b/base/gstparam.h
index 44093bc9..d4bb833c 100644
--- a/base/gstparam.h
+++ b/base/gstparam.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gstrans.c b/base/gstrans.c
index cb3f2ce6..cb201eba 100644
--- a/base/gstrans.c
+++ b/base/gstrans.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -30,6 +30,7 @@
#include "gxarith.h"
#include "gxclist.h"
#include "gsicc_manage.h"
+#include "gsicc_cache.h"
/* ------ Transparency-related graphics state elements ------ */
@@ -144,9 +145,10 @@ gs_gstate_update_pdf14trans2(gs_gstate * pgs, gs_pdf14trans_params_t * pparams,
* If we created a new PDF 1.4 compositor device then we need to install it
* into the graphics state.
*/
- if (pdf14dev != dev) {
+ if (code == 1) {
gx_set_device_only(pgs, pdf14dev);
gx_device_retain(pdf14dev, retain_on_create);
+ code = 0;
}
/* If we had a color space change and we are in overprint, then we need to
@@ -270,7 +272,7 @@ gs_begin_transparency_group(gs_gstate *pgs,
blend_color_space->cmm_icc_profile_data->num_comps;
/* Get the ICC profile */
params.iccprofile = blend_color_space->cmm_icc_profile_data;
- params.icc_hash = blend_color_space->cmm_icc_profile_data->hashcode;
+ params.icc_hash = gsicc_get_hash(blend_color_space->cmm_icc_profile_data);
} else {
/* Color space was NOT ICC based. PS CIE space and DeviceN are the only
other option. Use the ICC default based upon the component count. */
@@ -296,7 +298,7 @@ gs_begin_transparency_group(gs_gstate *pgs,
params.group_color_type = ICC;
params.group_color_numcomps = profile->num_comps;
params.iccprofile = profile;
- params.icc_hash = profile->hashcode;
+ params.icc_hash = gsicc_get_hash(profile);
}
}
}
@@ -348,7 +350,11 @@ gx_begin_transparency_group(gs_gstate * pgs, gx_device * pdev,
tgp.group_opacity = pparams->opacity;
tgp.group_shape = pparams->shape;
- pgs->blend_mode = pparams->blend_mode;
+ if (tgp.Knockout && tgp.text_group == PDF14_TEXTGROUP_BT_PUSHED &&
+ ((pgs->overprint && pgs->is_fill_color) || (pgs->stroke_overprint && !pgs->is_fill_color)))
+ pgs->blend_mode = BLEND_MODE_CompatibleOverprint;
+ else
+ pgs->blend_mode = pparams->blend_mode;
bbox = pparams->bbox;
#ifdef DEBUG
if (gs_debug_c('v')) {
@@ -632,7 +638,7 @@ gs_begin_transparency_mask(gs_gstate * pgs,
* pdf14_update_device_color_procs_pop_c()
*/
params.iccprofile = blend_color_space->cmm_icc_profile_data;
- params.icc_hash = blend_color_space->cmm_icc_profile_data->hashcode;
+ params.icc_hash = gsicc_get_hash(blend_color_space->cmm_icc_profile_data);
} else {
params.group_color_type = GRAY_SCALE;
params.group_color_numcomps = 1; /* Need to check */
@@ -775,7 +781,8 @@ get_num_pdf14_spot_colors(gs_gstate * pgs)
}
int
-gs_push_pdf14trans_device(gs_gstate * pgs, bool is_pattern, bool retain)
+gs_push_pdf14trans_device(gs_gstate * pgs, bool is_pattern, bool retain,
+ int depth, int spot_color_count)
{
gs_pdf14trans_params_t params = { 0 };
cmm_profile_t *icc_profile;
@@ -797,6 +804,12 @@ gs_push_pdf14trans_device(gs_gstate * pgs, bool is_pattern, bool retain)
*/
params.num_spot_colors = get_num_pdf14_spot_colors(pgs);
params.is_pattern = is_pattern;
+
+ /* Information related to overprint simulation */
+ params.num_spot_colors_int = spot_color_count;
+ if (depth < 0)
+ params.overprint_sim_push = true;
+
/* If we happen to be in a situation where we are going out to a device
whose profile is CIELAB then we will need to make sure that we
do our blending in RGB and convert to CIELAB when we do the put_image
diff --git a/base/gstrans.h b/base/gstrans.h
index a441bbef..d7bf1e0d 100644
--- a/base/gstrans.h
+++ b/base/gstrans.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -91,6 +91,8 @@ struct gs_pdf14trans_params_s {
/* The type of trasnparency operation */
pdf14_compositor_operations pdf14_op;
int num_spot_colors; /* Only for devices which support spot colors. */
+ int num_spot_colors_int; /* Number of spot colors reported by the interpreter */
+ bool overprint_sim_push; /* If true, put_image will need special conversion */
/* Changed parameters flag */
int changed;
/* Parameters from the gs_transparency_group_params_t structure */
@@ -165,7 +167,17 @@ bool gs_currenttextknockout(const gs_gstate *);
* We have to abbreviate the procedure name because procedure names are
* only unique to 23 characters on VMS.
*/
-int gs_push_pdf14trans_device(gs_gstate * pgs, bool is_pattern, bool retain);
+/* For the push_pdf14trans_device, depth is a estimate (not authoritative) of
+ * the transparency stack depth. Value 0 means "unknown". If the depth value
+ * is < 0, that means that this pdf14 device is being used for the overprint
+ * simulation, and ordiniarly the value will be -1, since overprint
+ * simulation only needs the page buffer.
+ * The spot_color_count is provided for PDF input files to define the number
+ * of Spot colorants beyond CMYK. Thus 0 means CMYK only. If unknown, such
+ * as with PostScript input, the value will be -1.
+ */
+int gs_push_pdf14trans_device(gs_gstate * pgs, bool is_pattern, bool retain,
+ int depth, int spot_color_count);
int gs_pop_pdf14trans_device(gs_gstate * pgs, bool is_pattern);
diff --git a/base/gstrap.c b/base/gstrap.c
index 7ae01e32..b93b8ded 100644
--- a/base/gstrap.c
+++ b/base/gstrap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gstrap.h b/base/gstrap.h
index 9a29fe74..8c2cc928 100644
--- a/base/gstrap.h
+++ b/base/gstrap.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gstype1.c b/base/gstype1.c
index a8508623..870b2fb6 100644
--- a/base/gstype1.c
+++ b/base/gstype1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -164,69 +164,27 @@ gs_type1_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
if (cip == 0)
return (gs_note_error(gs_error_invalidfont));
cipend = cip + pgd->bits.size;
- call:state = crypt_charstring_seed;
- if (encrypted) {
- int skip = pdata->lenIV;
-
- /* Skip initial random bytes */
- for (; skip > 0; ++cip, --skip)
- decrypt_skip_next(*cip, state);
- }
- goto top;
- cont:if (ipsp < pcis->ipstack || ipsp->ip == 0)
- return (gs_note_error(gs_error_invalidfont));
- cip = ipsp->ip;
- cipend = ipsp->cs_data.bits.data + ipsp->cs_data.bits.size;
- state = ipsp->dstate;
- top:for (;;) {
+ goto call;
+ for (;;) {
uint c0 = *cip++;
if (cip > cipend)
return_error(gs_error_invalidfont);
charstring_next(c0, state, c, encrypted);
- if (c >= c_num1) {
- /* This is a number, decode it and push it on the stack. */
-
- if (c < c_pos2_0) { /* 1-byte number */
- decode_push_num1(csp, cstack, c);
- } else if (c < cx_num4) { /* 2-byte number */
- decode_push_num2(csp, cstack, c, cip, state, encrypted);
- } else if (c == cx_num4) { /* 4-byte number */
- long lw;
-
- decode_num4(lw, cip, state, encrypted);
- CS_CHECK_PUSH(csp, cstack);
- *++csp = int2fixed(lw);
- if (lw != fixed2long(*csp)) {
- /*
- * The integer was too large to handle in fixed point.
- * Handle this case specially.
- */
- code = gs_type1_check_float(&state, encrypted, &cip, csp, lw);
- if (code < 0)
- return code;
- }
- } else /* not possible */
- return_error(gs_error_invalidfont);
- pushed:if_debug3m('1', pfont->memory, "[1]%d: (%d) %f\n",
- (int)(csp - cstack), c, fixed2float(*csp));
- continue;
- }
+ if (c < c_num1) {
#ifdef DEBUG
- if (gs_debug['1']) {
- static const char *const c1names[] =
- {char1_command_names};
-
- if (c1names[c] == 0)
- dmlprintf2(pfont->memory, "[1]"PRI_INTPTR": %02x??\n", (intptr_t)(cip - 1), c);
- else
- dmlprintf3(pfont->memory, "[1]"PRI_INTPTR": %02x %s\n", (intptr_t)(cip - 1), c,
- c1names[c]);
- }
+ if (gs_debug['1']) {
+ static const char *const c1names[] =
+ {char1_command_names};
+
+ if (c1names[c] == 0)
+ dmlprintf2(pfont->memory, "[1]"PRI_INTPTR": %02x??\n", (intptr_t)(cip - 1), c);
+ else
+ dmlprintf3(pfont->memory, "[1]"PRI_INTPTR": %02x %s\n", (intptr_t)(cip - 1), c,
+ c1names[c]);
+ }
#endif
- switch ((char_command) c) {
-#define cnext clear; goto top
-#define inext goto top
+ switch ((char_command) c) {
/* Commands with identical functions in Type 1 and Type 2, */
/* except for 'escape'. */
@@ -253,10 +211,16 @@ gs_type1_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
gs_glyph_data_free(&ipsp->cs_data, "gs_type1_interpret");
CS_CHECK_IPSTACK(ipsp, pcis->ipstack);
--ipsp;
- goto cont;
+ cont: if (ipsp < pcis->ipstack || ipsp->ip == 0)
+ return (gs_note_error(gs_error_invalidfont));
+ cip = ipsp->ip;
+ cipend = ipsp->cs_data.bits.data + ipsp->cs_data.bits.size;
+ state = ipsp->dstate;
+ continue;
case c_undoc15:
/* See gstype1.h for information on this opcode. */
- cnext;
+ clear;
+ continue;
/* Commands with similar but not identical functions */
/* in Type 1 and Type 2 charstrings. */
@@ -265,24 +229,18 @@ gs_type1_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
code = t1_hinter__hstem(h, cs0, cs1);
if (code < 0)
return code;
- cnext;
+ clear;
+ continue;
case cx_vstem:
code = t1_hinter__vstem(h, cs0, cs1);
if (code < 0)
return code;
- cnext;
+ clear;
+ continue;
case cx_vmoveto:
cs1 = cs0;
cs0 = 0;
- move: /* cs0 = dx, cs1 = dy for hint checking. */
- code = t1_hinter__rmoveto(h, cs0, cs1);
- goto cc;
- case cx_rlineto:
- line: /* cs0 = dx, cs1 = dy for hint checking. */
- code = t1_hinter__rlineto(h, cs0, cs1);
- cc:if (code < 0)
- return code;
- cnext;
+ goto move;
case cx_hlineto:
cs1 = 0;
goto line;
@@ -290,6 +248,10 @@ gs_type1_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
cs1 = cs0;
cs0 = 0;
goto line;
+ case cx_rlineto:
+ line: /* cs0 = dx, cs1 = dy for hint checking. */
+ code = t1_hinter__rlineto(h, cs0, cs1);
+ goto cc;
case cx_rrcurveto:
code = t1_hinter__rcurveto(h, cs0, cs1, cs2, cs3, cs4, cs5);
goto cc;
@@ -336,7 +298,9 @@ gs_type1_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
goto move;
case cx_hmoveto:
cs1 = 0;
- goto move;
+ move: /* cs0 = dx, cs1 = dy for hint checking. */
+ code = t1_hinter__rmoveto(h, cs0, cs1);
+ goto cc;
case cx_vhcurveto:
code = t1_hinter__rcurveto(h, 0, cs0, cs1, cs2, cs3, 0);
goto cc;
@@ -349,7 +313,10 @@ gs_type1_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
case c1_closepath:
code = t1_hinter__closepath(h);
- goto cc;
+ cc: if (code < 0)
+ return code;
+ clear;
+ continue;
case c1_hsbw:
if (!pcis->seac_flag) {
fixed sbx = cs0, sby = fixed_0, wx = cs1, wy = fixed_0;
@@ -378,17 +345,7 @@ gs_type1_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
return code;
gs_type1_sbw(pcis, cs0, fixed_0, cs1, fixed_0);
cs1 = fixed_0;
-rsbw: /* Give the caller the opportunity to intervene. */
- pcis->os_count = 0; /* clear */
- ipsp->ip = cip, ipsp->dstate = state;
- pcis->ips_count = ipsp - &pcis->ipstack[0] + 1;
- /* If we aren't in a seac, do nothing else now; */
- /* finish_init will take care of the rest. */
- if (pcis->init_done < 0) {
- /* Finish init when we return. */
- pcis->init_done = 0;
- }
- return type1_result_sbw;
+ goto rsbw;
case cx_escape:
charstring_next(*cip, state, c, encrypted);
++cip;
@@ -412,17 +369,20 @@ rsbw: /* Give the caller the opportunity to intervene. */
code = t1_hinter__dotsection(h);
if (code < 0)
return code;
- cnext;
+ clear;
+ continue;
case ce1_vstem3:
code = t1_hinter__vstem3(h, cs0, cs1, cs2, cs3, cs4, cs5);
if (code < 0)
return code;
- cnext;
+ clear;
+ continue;
case ce1_hstem3:
code = t1_hinter__hstem3(h, cs0, cs1, cs2, cs3, cs4, cs5);
if (code < 0)
return code;
- cnext;
+ clear;
+ continue;
case ce1_seac:
code = gs_type1_seac(pcis, cstack + 1, cstack[0],
ipsp);
@@ -433,7 +393,16 @@ rsbw: /* Give the caller the opportunity to intervene. */
clear;
cip = ipsp->cs_data.bits.data;
cipend = ipsp->cs_data.bits.data + ipsp->cs_data.bits.size;
- goto call;
+ call:
+ state = crypt_charstring_seed;
+ if (encrypted) {
+ int skip = pdata->lenIV;
+
+ /* Skip initial random bytes */
+ for (; skip > 0; ++cip, --skip)
+ decrypt_skip_next(*cip, state);
+ }
+ continue;
case ce1_sbw:
if (!pcis->seac_flag)
code = t1_hinter__sbw(h, cs0, cs1, cs2, cs3);
@@ -442,7 +411,18 @@ rsbw: /* Give the caller the opportunity to intervene. */
if (code < 0)
return code;
gs_type1_sbw(pcis, cs0, cs1, cs2, cs3);
- goto rsbw;
+ rsbw:
+ /* Give the caller the opportunity to intervene. */
+ pcis->os_count = 0; /* clear */
+ ipsp->ip = cip, ipsp->dstate = state;
+ pcis->ips_count = ipsp - &pcis->ipstack[0] + 1;
+ /* If we aren't in a seac, do nothing else now; */
+ /* finish_init will take care of the rest. */
+ if (pcis->init_done < 0) {
+ /* Finish init when we return. */
+ pcis->init_done = 0;
+ }
+ return type1_result_sbw;
case ce1_div:
CS_CHECK_POP(&csp[-1], cstack);
csp[-1] = float2fixed((double)csp[-1] / (double)*csp);
@@ -450,7 +430,8 @@ rsbw: /* Give the caller the opportunity to intervene. */
goto pushed;
case ce1_undoc15:
/* See gstype1.h for information on this opcode. */
- cnext;
+ clear;
+ continue;
case ce1_callothersubr:
{
int num_results;
@@ -477,7 +458,7 @@ rsbw: /* Give the caller the opportunity to intervene. */
if (code < 0)
return code;
pcis->flex_count = flex_max; /* not inside flex */
- inext;
+ continue;
case 1:
CS_CHECK_POP(csp, cstack);
code = t1_hinter__flex_beg(h);
@@ -485,7 +466,7 @@ rsbw: /* Give the caller the opportunity to intervene. */
return code;
pcis->flex_count = 1;
csp -= 2;
- inext;
+ continue;
case 2:
CS_CHECK_POP(csp, cstack);
if (pcis->flex_count >= flex_max)
@@ -494,7 +475,7 @@ rsbw: /* Give the caller the opportunity to intervene. */
if (code < 0)
return code;
csp -= 2;
- inext;
+ continue;
case 3:
CS_CHECK_POP(csp, cstack);
/* Assume the next opcode is a `pop'. */
@@ -505,22 +486,15 @@ rsbw: /* Give the caller the opportunity to intervene. */
if (code < 0)
return code;
csp -= 2;
- inext;
+ continue;
case 12:
case 13:
/* Counter control isn't implemented. */
- cnext;
+ clear;
+ continue;
case 14:
num_results = 1;
- blend:
- code = gs_type1_blend(pcis, csp,
- num_results);
- if (code < 0)
- return code;
- if (!CS_CHECK_CSTACK_BOUNDS(&csp[1 - code], cstack))
- return_error(gs_error_invalidfont);
- csp -= code;
- inext;
+ goto blend;
case 15:
num_results = 2;
goto blend;
@@ -532,7 +506,15 @@ rsbw: /* Give the caller the opportunity to intervene. */
goto blend;
case 18:
num_results = 6;
- goto blend;
+ blend:
+ code = gs_type1_blend(pcis, csp,
+ num_results);
+ if (code < 0)
+ return code;
+ if (!CS_CHECK_CSTACK_BOUNDS(&csp[1 - code], cstack))
+ return_error(gs_error_invalidfont);
+ csp -= code;
+ continue;
}
}
/* Not a recognized othersubr, */
@@ -567,7 +549,7 @@ rsbw: /* Give the caller the opportunity to intervene. */
/* a known othersubr. */
if (pcis->ignore_pops != 0) {
pcis->ignore_pops--;
- inext;
+ continue;
}
CS_CHECK_PUSH(csp, cstack);
++csp;
@@ -580,7 +562,8 @@ rsbw: /* Give the caller the opportunity to intervene. */
cs0 += pcis->adxy.x + pcis->origin_offset.x;
cs1 += pcis->adxy.y + pcis->origin_offset.y;
t1_hinter__setcurrentpoint(h, cs0, cs1);
- cnext;
+ clear;
+ continue;
default:
return_error(gs_error_invalidfont);
}
@@ -591,6 +574,35 @@ rsbw: /* Give the caller the opportunity to intervene. */
case_c1_undefs:
default: /* pacify compiler */
return_error(gs_error_invalidfont);
+ }
+ } else {
+ /* This is a number, decode it and push it on the stack. */
+
+ if (c < c_pos2_0) { /* 1-byte number */
+ decode_push_num1(csp, cstack, c);
+ } else if (c < cx_num4) { /* 2-byte number */
+ decode_push_num2(csp, cstack, c, cip, state, encrypted);
+ } else if (c == cx_num4) { /* 4-byte number */
+ long lw;
+
+ decode_num4(lw, cip, state, encrypted);
+ CS_CHECK_PUSH(csp, cstack);
+ *++csp = int2fixed(lw);
+ if (lw != fixed2long(*csp)) {
+ /*
+ * The integer was too large to handle in fixed point.
+ * Handle this case specially.
+ */
+ code = gs_type1_check_float(&state, encrypted, &cip, csp, lw);
+ if (code < 0)
+ return code;
+ }
+ } else /* not possible */
+ return_error(gs_error_invalidfont);
+ pushed:
+ if_debug3m('1', pfont->memory, "[1]%d: (%d) %f\n",
+ (int)(csp - cstack), c, fixed2float(*csp));
+ continue;
}
}
}
diff --git a/base/gstype1.h b/base/gstype1.h
index e88be5cc..71937b6e 100644
--- a/base/gstype1.h
+++ b/base/gstype1.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gstype2.c b/base/gstype2.c
index 870e13dd..a4a44335 100644
--- a/base/gstype2.c
+++ b/base/gstype2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -176,20 +176,8 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
cip = pgd->bits.data;
if (cip == 0)
return (gs_note_error(gs_error_invalidfont));
- call:state = crypt_charstring_seed;
- if (encrypted) {
- int skip = pdata->lenIV;
-
- /* Skip initial random bytes */
- for (; skip > 0; ++cip, --skip)
- decrypt_skip_next(*cip, state);
- }
- goto top;
- cont:if (ipsp < pcis->ipstack || ipsp->ip == 0)
- return (gs_note_error(gs_error_invalidfont));
- cip = ipsp->ip;
- state = ipsp->dstate;
- top:for (;;) {
+ goto call;
+ for (;;) {
uint c0 = *cip++;
charstring_next(c0, state, c, encrypted);
@@ -209,9 +197,7 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
*++csp = arith_rshift(lw, 16 - _fixed_shift);
} else /* not possible */
return_error(gs_error_invalidfont);
- pushed:if_debug3m('1', pfont->memory, "[1]%d: (%d) %f\n",
- (int)(csp - cstack), c, fixed2float(*csp));
- continue;
+ goto pushed;
}
#ifdef DEBUG
if (gs_debug['1']) {
@@ -227,7 +213,6 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
}
#endif
switch ((char_command) c) {
-#define cnext clear; goto top
/* Commands with identical functions in Type 1 and Type 2, */
/* except for 'escape'. */
@@ -241,38 +226,27 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
c = fixed2int_var(*csp) + pdata->subroutineNumberBias;
code = pdata->procs.subr_data
(pfont, c, false, &ipsp[1].cs_data);
- subr:
- if (code < 0) {
- /* Calling a Subr with an out-of-range index is clearly a error:
- * the Adobe documentation says the results of doing this are
- * undefined. However, we have seen a PDF file produced by Adobe
- * PDF Library 4.16 that included a Type 2 font that called an
- * out-of-range Subr, and Acrobat Reader did not signal an error.
- * Therefore, we ignore such calls.
- */
- cip++;
- goto top;
- }
- --csp;
- ipsp->ip = cip, ipsp->dstate = state;
- ++ipsp;
- cip = ipsp->cs_data.bits.data;
- goto call;
+ goto subr;
}
else {
/* Consider a missing index to be "out-of-range", and see above
* comment.
*/
cip++;
- goto top;
+ continue;
}
case c_return:
gs_glyph_data_free(&ipsp->cs_data, "gs_type2_interpret");
--ipsp;
- goto cont;
+ cont: if (ipsp < pcis->ipstack || ipsp->ip == 0)
+ return (gs_note_error(gs_error_invalidfont));
+ cip = ipsp->ip;
+ state = ipsp->dstate;
+ continue;
case c_undoc15:
/* See gstype1.h for information on this opcode. */
- cnext;
+ clear;
+ continue;
/* Commands with similar but not identical functions */
/* in Type 1 and Type 2 charstrings. */
@@ -285,11 +259,7 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
if (CS_CHECK_CSTACK_BOUNDS(csp, cstack)) {
check_first_operator(csp > cstack);
code = t1_hinter__rmoveto(h, 0, *csp);
- move:
- cc:
- if (code < 0)
- return code;
- goto pp;
+ goto move;
}
else {
return_error(gs_error_invalidfont);
@@ -300,8 +270,7 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
if (code < 0)
return code;
}
- pp:
- cnext;
+ goto pp;
case cx_hlineto:
vertical = false;
goto hvl;
@@ -452,7 +421,8 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
pfont->data.WeightVector.values[i]);
} else
return gs_note_error(gs_error_invalidfont);
- cnext;
+ clear;
+ continue;
case c2_hstemhm:
hstem: check_first_operator(!((csp - cstack) & 1));
{
@@ -465,7 +435,8 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
}
}
pcis->num_hints += (csp + 1 - cstack) >> 1;
- cnext;
+ clear;
+ continue;
case c2_hintmask:
/*
* A hintmask at the beginning of the CharString is
@@ -513,7 +484,8 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
type2_vstem(pcis, csp, cstack);
}else
return gs_note_error(gs_error_invalidfont);
- cnext;
+ clear;
+ continue;
case c2_rcurveline:
for (ap = cstack; ap + 5 <= csp; ap += 6) {
code = t1_hinter__rcurveto(h, ap[0], ap[1], ap[2], ap[3],
@@ -531,7 +503,11 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
}
code = t1_hinter__rcurveto(h, ap[0], ap[1], ap[2], ap[3],
ap[4], ap[5]);
- goto cc;
+ move:
+ cc:
+ if (code < 0)
+ return code;
+ goto pp;
case c2_vvcurveto:
ap = cstack;
{
@@ -561,7 +537,9 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
dya = 0;
}
}
- goto pp;
+ pp:
+ clear;
+ continue;
case c2_shortint:
{
int c1, c2;
@@ -573,16 +551,43 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
CS_CHECK_PUSH(csp, cstack);
*++csp = int2fixed((((c1 ^ 0x80) - 0x80) << 8) + c2);
}
- goto pushed;
+ pushed: if_debug3m('1', pfont->memory, "[1]%d: (%d) %f\n",
+ (int)(csp - cstack), c, fixed2float(*csp));
+ continue;
case c2_callgsubr:
if (CS_CHECK_CSTACK_BOUNDS(csp, cstack)) {
c = fixed2int_var(*csp) + pdata->gsubrNumberBias;
code = pdata->procs.subr_data
(pfont, c, true, &ipsp[1].cs_data);
- goto subr;
+ subr:
+ if (code < 0) {
+ /* Calling a Subr with an out-of-range index is clearly a error:
+ * the Adobe documentation says the results of doing this are
+ * undefined. However, we have seen a PDF file produced by Adobe
+ * PDF Library 4.16 that included a Type 2 font that called an
+ * out-of-range Subr, and Acrobat Reader did not signal an error.
+ * Therefore, we ignore such calls.
+ */
+ cip++;
+ continue;
+ }
+ --csp;
+ ipsp->ip = cip, ipsp->dstate = state;
+ ++ipsp;
+ cip = ipsp->cs_data.bits.data;
+ call:
+ state = crypt_charstring_seed;
+ if (encrypted) {
+ int skip = pdata->lenIV;
+
+ /* Skip initial random bytes */
+ for (; skip > 0; ++cip, --skip)
+ decrypt_skip_next(*cip, state);
+ }
+ continue;
} else {
cip++;
- goto top;
+ continue;
}
case cx_escape:
charstring_next(*cip, state, c, encrypted);
@@ -810,6 +815,34 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
if (!CS_CHECK_CSTACK_BOUNDS(&csp[-12], cstack))
return_error(gs_error_invalidfont);
*csp /= 100; /* fd/100 */
+ goto flex;
+ case ce2_hflex1:
+ if (!CS_CHECK_CSTACK_BOUNDS(&csp[-3], cstack))
+ return_error(gs_error_invalidfont);
+ CS_CHECK_PUSHN(csp, cstack, 4);
+ csp[4] = fixed_half; /* fd/100 */
+ csp[2] = *csp; /* dx6 */
+ csp[3] = -(csp[-7] + csp[-5] + csp[-1]); /* dy6 */
+ *csp = csp[-2], csp[1] = csp[-1]; /* dx5, dy5 */
+ csp[-2] = csp[-3], csp[-1] = 0; /* dx4, dy4 */
+ csp[-3] = 0; /* dy3 */
+ csp += 4;
+ goto flex;
+ case ce2_flex1:
+ if (!CS_CHECK_CSTACK_BOUNDS(&csp[-10], cstack))
+ return_error(gs_error_invalidfont);
+ CS_CHECK_PUSHN(csp, cstack, 2);
+ {
+ fixed dx = csp[-10] + csp[-8] + csp[-6] + csp[-4] + csp[-2];
+ fixed dy = csp[-9] + csp[-7] + csp[-5] + csp[-3] + csp[-1];
+
+ if (any_abs(dx) > any_abs(dy))
+ csp[1] = -dy; /* d6 is dx6 */
+ else
+ csp[1] = *csp, *csp = -dx; /* d6 is dy6 */
+ }
+ csp[2] = fixed_half; /* fd/100 */
+ csp += 2;
flex: {
fixed x_join = csp[-12] + csp[-10] + csp[-8];
fixed y_join = csp[-11] + csp[-9] + csp[-7];
@@ -860,35 +893,8 @@ flex: {
if (code < 0)
return code;
}
- cnext;
- case ce2_hflex1:
- if (!CS_CHECK_CSTACK_BOUNDS(&csp[-3], cstack))
- return_error(gs_error_invalidfont);
- CS_CHECK_PUSHN(csp, cstack, 4);
- csp[4] = fixed_half; /* fd/100 */
- csp[2] = *csp; /* dx6 */
- csp[3] = -(csp[-7] + csp[-5] + csp[-1]); /* dy6 */
- *csp = csp[-2], csp[1] = csp[-1]; /* dx5, dy5 */
- csp[-2] = csp[-3], csp[-1] = 0; /* dx4, dy4 */
- csp[-3] = 0; /* dy3 */
- csp += 4;
- goto flex;
- case ce2_flex1:
- if (!CS_CHECK_CSTACK_BOUNDS(&csp[-10], cstack))
- return_error(gs_error_invalidfont);
- CS_CHECK_PUSHN(csp, cstack, 2);
- {
- fixed dx = csp[-10] + csp[-8] + csp[-6] + csp[-4] + csp[-2];
- fixed dy = csp[-9] + csp[-7] + csp[-5] + csp[-3] + csp[-1];
-
- if (any_abs(dx) > any_abs(dy))
- csp[1] = -dy; /* d6 is dx6 */
- else
- csp[1] = *csp, *csp = -dx; /* d6 is dy6 */
- }
- csp[2] = fixed_half; /* fd/100 */
- csp += 2;
- goto flex;
+ clear;
+ continue;
}
break;
diff --git a/base/gstype42.c b/base/gstype42.c
index 55889201..dab1b52c 100644
--- a/base/gstype42.c
+++ b/base/gstype42.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -346,9 +346,10 @@ gs_type42_font_init(gs_font_type42 * pfont, int subfontID)
code = gs_font_notify_register((gs_font *)pfont, gs_len_glyphs_release, (void *)pfont);
if (code < 0) {
gs_free_object(pfont->memory, pfont->data.len_glyphs, "gs_len_glyphs_release");
+ pfont->data.len_glyphs = NULL;
return code;
}
-
+ memset(pfont->data.len_glyphs, 0x00, loca_size * sizeof(uint));
/* The 'loca' may not be in order, so we construct a glyph length array */
/* Since 'loca' is usually sorted, first try the simple linear scan to */
/* avoid the need to perform the more expensive process. */
@@ -386,7 +387,7 @@ gs_type42_font_init(gs_font_type42 * pfont, int subfontID)
gs_type42_font_init_sort_t *psortary =
(gs_type42_font_init_sort_t *)gs_alloc_byte_array(pfont->memory,
loca_size, sizeof(gs_type42_font_init_sort_t), "gs_type42_font_init(sort loca)");
-
+
if (psortary == 0)
return_error(gs_error_VMerror);
/* loca_size > 0 due to condition above, so we always have the 0th element. */
@@ -406,7 +407,7 @@ gs_type42_font_init(gs_font_type42 * pfont, int subfontID)
return_error(gs_error_invalidfont);
for (i = num_valid_loca_elm; i--;) {
long old_length;
-
+
psort = psortary + i;
old_length = psort->glyph_length;
if (old_length < 0 || old_length > 2000 /* arbitrary */) {
diff --git a/base/gstypes.h b/base/gstypes.h
index cd163b9d..cdfc31c4 100644
--- a/base/gstypes.h
+++ b/base/gstypes.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsuid.h b/base/gsuid.h
index 1f0632c7..11310963 100644
--- a/base/gsuid.h
+++ b/base/gsuid.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsutil.c b/base/gsutil.c
index 3b7870f1..ee6c9c48 100644
--- a/base/gsutil.c
+++ b/base/gsutil.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -24,16 +24,22 @@
#include "gsrect.h" /* for prototypes */
#include "gsuid.h"
#include "gsutil.h" /* for prototypes */
+#include "gxsync.h" /* for gx_monitor_t */
/* ------ Unique IDs ------ */
+/* This is used by multiple threads, so lock around updates */
ulong
gs_next_ids(const gs_memory_t *mem, uint count)
{
gs_lib_ctx_core_t *core = mem->gs_lib_ctx->core;
- ulong id = core->gs_next_id;
+ ulong id;
+ gx_monitor_enter((gx_monitor_t *)(core->monitor));
+ id = core->gs_next_id;
core->gs_next_id += count;
+ gx_monitor_leave((gx_monitor_t *)(core->monitor));
+
return id;
}
diff --git a/base/gsutil.h b/base/gsutil.h
index e3269311..18cbe33f 100644
--- a/base/gsutil.h
+++ b/base/gsutil.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gswin.rc b/base/gswin.rc
index 5ba2d341..bdde58e1 100644
--- a/base/gswin.rc
+++ b/base/gswin.rc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gsxfont.h b/base/gsxfont.h
index ef45a1a3..c8c5d747 100644
--- a/base/gsxfont.h
+++ b/base/gsxfont.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gx.h b/base/gx.h
index 60a411aa..ca2dc273 100644
--- a/base/gx.h
+++ b/base/gx.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxacpath.c b/base/gxacpath.c
index fe9184ad..36ff8c3f 100644
--- a/base/gxacpath.c
+++ b/base/gxacpath.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxalloc.h b/base/gxalloc.h
index dd164756..1ea4f787 100644
--- a/base/gxalloc.h
+++ b/base/gxalloc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxalpha.h b/base/gxalpha.h
index de14cd89..4134d857 100644
--- a/base/gxalpha.h
+++ b/base/gxalpha.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxarith.h b/base/gxarith.h
index 3d4c7d9a..b2833178 100644
--- a/base/gxarith.h
+++ b/base/gxarith.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxband.h b/base/gxband.h
index 1af69cbf..6e13e9ea 100644
--- a/base/gxband.h
+++ b/base/gxband.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxbcache.c b/base/gxbcache.c
index adcd9b46..184c7647 100644
--- a/base/gxbcache.c
+++ b/base/gxbcache.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -18,6 +18,7 @@
#include "memory_.h"
#include "stdint_.h"
#include "gx.h"
+#include "gxobj.h"
#include "gsmdebug.h"
#include "gxbcache.h"
@@ -59,8 +60,10 @@ gx_bits_cache_chunk_init(gx_bits_cache_chunk * bck, byte * data, uint size)
/* If there isn't enough room, set *pcbh to an entry requiring freeing, */
/* or to 0 if we are at the end of the chunk, and return -1. */
int
-gx_bits_cache_alloc(gx_bits_cache * bc, ulong lsize, gx_cached_bits_head ** pcbh)
+gx_bits_cache_alloc(gx_bits_cache * bc, ulong lsize0, gx_cached_bits_head ** pcbh)
{
+ ulong lsize = ROUND_UP(lsize0, obj_align_mod);
+
#define ssize ((uint)lsize)
ulong lsize1 = lsize + sizeof(gx_cached_bits_head);
diff --git a/base/gxbcache.h b/base/gxbcache.h
index be601b69..be85bcc8 100644
--- a/base/gxbcache.h
+++ b/base/gxbcache.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxbitfmt.h b/base/gxbitfmt.h
index 8cdc0bc0..134d02db 100644
--- a/base/gxbitfmt.h
+++ b/base/gxbitfmt.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxbitmap.h b/base/gxbitmap.h
index 9f18a94b..c4cd64de 100644
--- a/base/gxbitmap.h
+++ b/base/gxbitmap.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxbitops.h b/base/gxbitops.h
index 8b1e9074..8ab1e2a2 100644
--- a/base/gxbitops.h
+++ b/base/gxbitops.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxblend.c b/base/gxblend.c
index 41059483..a7c22332 100644
--- a/base/gxblend.c
+++ b/base/gxblend.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -402,7 +402,8 @@ void smask_copy(int num_rows, int num_cols, int row_stride,
}
}
-void smask_icc(gx_device *dev, int num_rows, int num_cols, int n_chan,
+int
+smask_icc(gx_device *dev, int num_rows, int num_cols, int n_chan,
int row_stride, int plane_stride, byte *gs_restrict src, const byte *gs_restrict dst,
gsicc_link_t *icclink, bool deep)
{
@@ -427,7 +428,7 @@ void smask_icc(gx_device *dev, int num_rows, int num_cols, int n_chan,
false, false, true, plane_stride,
row_stride, num_rows, num_cols);
/* Transform the data */
- (icclink->procs.map_buffer)(dev, icclink, &input_buff_desc, &output_buff_desc,
+ return (icclink->procs.map_buffer)(dev, icclink, &input_buff_desc, &output_buff_desc,
(void*) src, (void*) dst);
}
@@ -1244,7 +1245,7 @@ art_blend_pixel_8_inline(byte *gs_restrict dst, const byte *gs_restrict backdrop
break;
case BLEND_MODE_Hue:
{
- byte tmp[4];
+ byte tmp[ART_MAX_CHAN];
pblend_procs->blend_luminosity(n_chan, tmp, src, backdrop);
pblend_procs->blend_saturation(n_chan, dst, tmp, backdrop);
@@ -1504,7 +1505,7 @@ art_blend_pixel_16_inline(uint16_t *gs_restrict dst, const uint16_t *gs_restrict
break;
case BLEND_MODE_Hue:
{
- uint16_t tmp[4];
+ uint16_t tmp[ART_MAX_CHAN];
pblend_procs->blend_luminosity16(n_chan, tmp, src, backdrop);
pblend_procs->blend_saturation16(n_chan, dst, tmp, backdrop);
@@ -5165,10 +5166,11 @@ do_mark_fill_rectangle(gx_device * dev, int x, int y, int w, int h,
* Unpack the gx_color_index values. Complement the components for subtractive
* color spaces.
*/
- if (has_tags) {
- curr_tag = (color >> (num_comp*8)) & 0xff;
- }
+
if (devn) {
+ if (has_tags) {
+ curr_tag = pdc->tag;
+ }
if (additive) {
for (j = 0; j < (num_comp - num_spots); j++) {
src[j] = ((pdc->colors.devn.values[j]) >> shift & mask);
@@ -5182,8 +5184,12 @@ do_mark_fill_rectangle(gx_device * dev, int x, int y, int w, int h,
src[j] = 255 - ((pdc->colors.devn.values[j]) >> shift & mask);
}
}
- } else
+ } else {
+ if (has_tags) {
+ curr_tag = (color >> (num_comp * 8)) & 0xff;
+ }
pdev->pdf14_procs->unpack_color(num_comp, color, pdev, src);
+ }
src_alpha = src[num_comp] = (byte)floor (255 * pdev->alpha + 0.5);
if (has_shape)
shape = (byte)floor (255 * pdev->shape + 0.5);
@@ -5796,10 +5802,10 @@ do_mark_fill_rectangle16(gx_device * dev, int x, int y, int w, int h,
* Unpack the gx_color_index values. Complement the components for subtractive
* color spaces.
*/
- if (has_tags) {
- curr_tag = (color >> (num_comp*16)) & 0xff;
- }
if (devn) {
+ if (has_tags) {
+ curr_tag = pdc->tag;
+ }
if (additive) {
for (j = 0; j < (num_comp - num_spots); j++) {
src[j] = pdc->colors.devn.values[j];
@@ -5813,8 +5819,12 @@ do_mark_fill_rectangle16(gx_device * dev, int x, int y, int w, int h,
src[j] = 65535 - pdc->colors.devn.values[j];
}
}
- } else
+ } else {
+ if (has_tags) {
+ curr_tag = (color >> (num_comp * 16)) & 0xff;
+ }
pdev->pdf14_procs->unpack_color16(num_comp, color, pdev, src);
+ }
src_alpha = src[num_comp] = (uint16_t)floor (65535 * pdev->alpha + 0.5);
if (has_shape)
shape = (uint16_t)floor (65535 * pdev->shape + 0.5);
diff --git a/base/gxblend.h b/base/gxblend.h
index 0ac93877..a1f62e18 100644
--- a/base/gxblend.h
+++ b/base/gxblend.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -100,7 +100,7 @@ void smask_blend(byte *gs_restrict src, int width, int height, int rowstride,
void smask_copy(int num_rows, int num_cols, int row_stride,
byte *gs_restrict src, const byte *gs_restrict des);
-void smask_icc(gx_device *dev, int num_rows, int num_cols, int n_chan,
+int smask_icc(gx_device *dev, int num_rows, int num_cols, int n_chan,
int row_stride, int plane_stride, byte *gs_restrict src, const byte *gs_restrict des,
gsicc_link_t *icclink, bool deep);
/* For spot colors, blend modes must be white preserving and separable */
@@ -389,7 +389,7 @@ void gx_build_blended_image_row16(const byte *gs_restrict buf_ptr, int planestri
void gx_blend_image_buffer(byte *buf_ptr, int width, int height,
int rowstride, int planestride, int num_comp, byte bg);
void gx_blend_image_buffer16(byte *buf_ptr, int width, int height,
- int rowstride, int planestride, int num_comp, uint16_t bg);
+ int rowstride, int planestride, int num_comp, uint16_t bg, bool keep_native);
void gx_blend_image_buffer8to16(const byte *buf_ptr, unsigned short *buf_ptr_out,
int width, int height, int rowstride, int planestride, int num_comp, byte bg);
int gx_put_blended_image_custom(gx_device *target, byte *buf_ptr,
diff --git a/base/gxblend1.c b/base/gxblend1.c
index 6d42a094..c4f14e6c 100644
--- a/base/gxblend1.c
+++ b/base/gxblend1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -226,6 +226,7 @@ pdf14_preserve_backdrop_cm(pdf14_buf *buf, cmm_profile_t *group_profile,
int y0 = max(buf->rect.p.y, tos->rect.p.y);
int y1 = min(buf->rect.q.y, tos->rect.q.y);
bool deep = buf->deep;
+ int code;
if (x0 < x1 && y0 < y1) {
int width = x1 - x0;
@@ -283,9 +284,11 @@ pdf14_preserve_backdrop_cm(pdf14_buf *buf, cmm_profile_t *group_profile,
false, true, buf->planestride, buf->rowstride, height,
width);
/* Transform the data. */
- (icc_link->procs.map_buffer)(dev, icc_link, &input_buff_desc,
+ code = (icc_link->procs.map_buffer)(dev, icc_link, &input_buff_desc,
&output_buff_desc, tos_plane, buf_plane);
gsicc_release_link(icc_link);
+ if (code < 0)
+ return gs_throw(gs_error_unknownerror, "ICC transform failed. Trans backdrop");
}
/* Copy the alpha data */
buf_plane += buf->planestride * (buf->n_chan - 1);
@@ -840,7 +843,7 @@ gx_blend_image_buffer(byte *buf_ptr, int width, int height, int rowstride,
void
gx_blend_image_buffer16(byte *buf_ptr_, int width, int height, int rowstride,
- int planestride, int num_comp, uint16_t bg)
+ int planestride, int num_comp, uint16_t bg, bool keep_native)
{
uint16_t *buf_ptr = (uint16_t *)(void *)buf_ptr_;
int x, y;
@@ -870,10 +873,12 @@ gx_blend_image_buffer16(byte *buf_ptr_, int width, int height, int rowstride,
} else if (a == 0xffff) {
#if ARCH_IS_BIG_ENDIAN
#else
- for (comp_num = 0; comp_num < num_comp; comp_num++) {
- comp = buf_ptr[position + planestride * comp_num];
- ((byte *)&buf_ptr[position + planestride * comp_num])[0] = comp>>8;
- ((byte *)&buf_ptr[position + planestride * comp_num])[1] = comp;
+ if (!keep_native) {
+ for (comp_num = 0; comp_num < num_comp; comp_num++) {
+ comp = buf_ptr[position + planestride * comp_num];
+ ((byte *)&buf_ptr[position + planestride * comp_num])[0] = comp >> 8;
+ ((byte *)&buf_ptr[position + planestride * comp_num])[1] = comp;
+ }
}
#endif
} else {
diff --git a/base/gxccache.c b/base/gxccache.c
index e4f4364c..250d3896 100644
--- a/base/gxccache.c
+++ b/base/gxccache.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxccman.c b/base/gxccman.c
index b2d84305..b31b6959 100644
--- a/base/gxccman.c
+++ b/base/gxccman.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -34,6 +34,7 @@
#include "gxxfont.h"
#include "gxttfb.h"
#include "gxfont42.h"
+#include "gxobj.h"
/* Define the descriptors for the cache structures. */
private_st_cached_fm_pair();
@@ -79,7 +80,7 @@ gx_char_cache_alloc(gs_memory_t * struct_mem, gs_memory_t * bits_mem,
cache character memory before filling the table. The searching
code uses an empty table entry as a sentinel. */
chsize = max(chsize, ROUND_UP(bmax, sizeof_cached_char) / sizeof_cached_char + 1);
-
+
/* Round up chsize to a power of 2. */
while (chsize & (chsize + 1))
chsize |= chsize >> 1;
@@ -932,8 +933,8 @@ alloc_char(gs_font_dir * dir, ulong icdsize, cached_char **pcc)
gs_memory_t *mem = dir->ccache.bits_memory;
char_cache_chunk *cck_prev = dir->ccache.chunks;
char_cache_chunk *cck;
- uint cksize = dir->ccache.bmax / 5 + 1;
- uint tsize = dir->ccache.bmax - dir->ccache.bspace;
+ uint cksize = ROUND_UP(dir->ccache.bmax / 5 + 1, obj_align_mod);
+ uint tsize = ROUND_UP(dir->ccache.bmax - dir->ccache.bspace, obj_align_mod);
byte *cdata;
if (cksize > tsize)
diff --git a/base/gxcdevn.h b/base/gxcdevn.h
index 62ecb8db..61874118 100644
--- a/base/gxcdevn.h
+++ b/base/gxcdevn.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxchar.c b/base/gxchar.c
index 7d6259d9..2332b70a 100644
--- a/base/gxchar.c
+++ b/base/gxchar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxchar.h b/base/gxchar.h
index 04ff7deb..4a26768f 100644
--- a/base/gxchar.h
+++ b/base/gxchar.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxchrout.c b/base/gxchrout.c
index 87fcd43c..55aafdfd 100644
--- a/base/gxchrout.c
+++ b/base/gxchrout.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxchrout.h b/base/gxchrout.h
index 8bbb3524..6f31f043 100644
--- a/base/gxchrout.h
+++ b/base/gxchrout.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxcht.c b/base/gxcht.c
index e4b47ce4..dc1064a1 100644
--- a/base/gxcht.c
+++ b/base/gxcht.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -841,12 +841,12 @@ static const gx_const_strip_bitmap ht_no_bitmap = {
/* Set the color value(s) and halftone mask for one plane. */
static inline void set_plane_color(int i, color_values_pair_t *pvp, const gx_device_color * pdc,
- const gx_const_strip_bitmap * sbits[MAX_DCC], gx_ht_cache * caches[MAX_DCC],
+ const gx_const_strip_bitmap * sbits[MAX_DCC], gx_ht_cache * caches[MAX_DCC],
gx_color_value max_color, bool invert)
{
uint q = pdc->colors.colored.c_base[i];
uint r = pdc->colors.colored.c_level[i];
-
+
pvp->values[0][i] = fractional_color(q, max_color);
if (r == 0)
pvp->values[1][i] = pvp->values[0][i], sbits[i] = &ht_no_bitmap;
@@ -855,7 +855,7 @@ static inline void set_plane_color(int i, color_values_pair_t *pvp, const gx_dev
sbits[i] = (const gx_const_strip_bitmap *) &gx_render_ht(caches[i], r)->tiles;
} else {
const gx_device_halftone *pdht = pdc->colors.colored.c_ht;
- int nlevels =
+ int nlevels =
(pdht->components ? pdht->components[i].corder.num_levels : pdht->order.num_levels);
pvp->values[1][i] = pvp->values[0][i];
pvp->values[0][i] = fractional_color(q + 1, max_color);
diff --git a/base/gxcid.h b/base/gxcid.h
index c172b72c..8e8b2c5d 100644
--- a/base/gxcid.h
+++ b/base/gxcid.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxcie.h b/base/gxcie.h
index 860bf292..f9aab2dc 100644
--- a/base/gxcie.h
+++ b/base/gxcie.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxcindex.h b/base/gxcindex.h
index 5e0d2761..e7e86cf6 100644
--- a/base/gxcindex.h
+++ b/base/gxcindex.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxclbits.c b/base/gxclbits.c
index 519cdacb..9fd0990c 100644
--- a/base/gxclbits.c
+++ b/base/gxclbits.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -95,28 +95,28 @@ cmd_compress_bitmap(stream_state * st, const byte * data, uint width_bits,
uint mask = (0xff00>>(width_bits & 7)) & 0xff;
uint padding = width_bytes - ((width_bits+7)>>3);
- r.ptr = data - 1;
if (raster == whole_bytes) {
- r.limit = r.ptr + raster * height;
+ stream_cursor_read_init(&r, data, raster * (size_t)height);
status = (*st->templat->process) (st, &r, pw, true);
} else { /* Compress row-by-row. */
uint y;
+ stream_cursor_read_init(&r, data, whole_bytes);
+
for (y = height-1; (r.limit = r.ptr + whole_bytes), y > 0; y--) {
status = go_process(st, &r, pw, false);
if (status)
break;
if (mask) {
byte b = r.ptr[1] & mask;
- r2.limit = &b;
- r2.ptr = r2.limit-1;
+
+ stream_cursor_read_init(&r2, &b, 1);
status = go_process(st, &r2, pw, false);
if (status)
break;
}
if (padding) {
- r2.ptr = zeros - 1;
- r2.limit = r2.ptr + padding;
+ stream_cursor_read_init(&r2, zeros, padding);
status = go_process(st, &r2, pw, false);
if (status)
break;
@@ -127,13 +127,12 @@ cmd_compress_bitmap(stream_state * st, const byte * data, uint width_bits,
status = go_process(st, &r, pw, padding == 0 && mask == 0);
if (status == 0 && mask) {
byte b = r.ptr[1] & mask;
- r2.limit = &b;
- r2.ptr = r2.limit-1;
+
+ stream_cursor_read_init(&r2, &b, 1);
status = go_process(st, &r2, pw, padding == 0);
}
if (status == 0 && padding) {
- r2.ptr = zeros - 1;
- r2.limit = r2.ptr + padding;
+ stream_cursor_read_init(&r2, zeros, padding);
status = go_process(st, &r2, pw, true);
}
}
@@ -234,7 +233,7 @@ cmd_put_bits(gx_device_clist_writer * cldev, gx_clist_state * pcls,
uint wcount = w.ptr - wbase;
cmd_shorten_list_op(cldev,
- (pcls ? &pcls->list : &cldev->band_range_list),
+ (pcls ? &pcls->list : cldev->band_range_list),
try_size - (op_size + wcount));
*psize = op_size + wcount;
goto out;
@@ -246,7 +245,7 @@ cmd_put_bits(gx_device_clist_writer * cldev, gx_clist_state * pcls,
"[L]Uncompressed bits %u too large for buffer\n",
uncompressed_size);
cmd_shorten_list_op(cldev,
- (pcls ? &pcls->list : &cldev->band_range_list),
+ (pcls ? &pcls->list : cldev->band_range_list),
try_size);
return_error(gs_error_limitcheck);
}
@@ -254,7 +253,7 @@ cmd_put_bits(gx_device_clist_writer * cldev, gx_clist_state * pcls,
if_debug2m('L',cldev->memory,"[L]Shortening bits from %u to %u\n",
try_size, op_size + short_size);
cmd_shorten_list_op(cldev,
- (pcls ? &pcls->list : &cldev->band_range_list),
+ (pcls ? &pcls->list : cldev->band_range_list),
try_size - (op_size + short_size));
*psize = op_size + short_size;
}
@@ -273,7 +272,7 @@ cmd_put_bits(gx_device_clist_writer * cldev, gx_clist_state * pcls,
if ((compression_mask & (1 << cmd_compress_const)) &&
(code = bytes_rectangle_is_const(data, raster, uncompressed_raster << 3, height)) >= 0) {
cmd_shorten_list_op(cldev,
- (pcls ? &pcls->list : &cldev->band_range_list),
+ (pcls ? &pcls->list : cldev->band_range_list),
*psize - (op_size + 1));
*psize = op_size + 1;
dp[op_size] = code;
diff --git a/base/gxcldev.h b/base/gxcldev.h
index 00dca1c8..290c6cda 100644
--- a/base/gxcldev.h
+++ b/base/gxcldev.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -271,7 +271,7 @@ struct gx_clist_state_s {
short clip_enabled; /* 0 = don't clip, 1 = do clip, */
/* -1 is used internally */
bool color_is_alpha; /* for copy_color_alpha */
- bool color_is_devn; /* more overload of copy_color_alpha for devn support */
+ bool color_is_devn; /* more overload of copy_color_alpha for devn support */
uint known; /* flags for whether this band */
/* knows various misc. parameters */
/* We assign 'known' flags here from the high end; */
@@ -451,7 +451,7 @@ typedef struct {
extern const clist_select_color_t
clist_select_color0, clist_select_color1, clist_select_tile_color0,
- clist_select_tile_color1, clist_select_devn_color0,
+ clist_select_tile_color1, clist_select_devn_color0,
clist_select_devn_color1;
/* See comments in gxclutil.c */
@@ -565,8 +565,8 @@ const byte *cmd_read_matrix(gs_matrix * pmat, const byte * cbp);
int cmd_write_rect_cmd(gx_device_clist_writer * cldev, gx_clist_state * pcls,
int op, int x, int y, int width, int height);
/* Put out a fill with a devn color */
-int cmd_write_rect_hl_cmd(gx_device_clist_writer * cldev,
- gx_clist_state * pcls, int op, int x, int y,
+int cmd_write_rect_hl_cmd(gx_device_clist_writer * cldev,
+ gx_clist_state * pcls, int op, int x, int y,
int width, int height, bool extended_command);
/* Put out a fill or tile rectangle command for fillpage. */
int cmd_write_page_rect_cmd(gx_device_clist_writer * cldev, int op);
@@ -689,6 +689,8 @@ int clist_writer_pop_cropping(gx_device_clist_writer *cdev);
int clist_writer_check_empty_cropping_stack(gx_device_clist_writer *cdev);
int clist_read_icctable(gx_device_clist_reader *crdev);
int clist_read_color_usage_array(gx_device_clist_reader *crdev);
+int clist_read_op_equiv_cmyk_colors(gx_device_clist_reader *crdev,
+ equivalent_cmyk_color_params *op_equiv);
/* Special write out for the serialized icc profile table */
@@ -699,9 +701,9 @@ int cmd_write_icctable(gx_device_clist_writer * cldev, unsigned char *pbuf, int
may later include compressed image data */
typedef enum {
-
COLOR_USAGE_OFFSET = 1,
- ICC_TABLE_OFFSET = 2
+ SPOT_EQUIV_COLORS = 2,
+ ICC_TABLE_OFFSET = 3
} psuedoband_offset;
diff --git a/base/gxclfile.c b/base/gxclfile.c
index 4476ef5c..f03646ec 100644
--- a/base/gxclfile.c
+++ b/base/gxclfile.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxclimag.c b/base/gxclimag.c
index 9747c899..d638bea6 100644
--- a/base/gxclimag.c
+++ b/base/gxclimag.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -478,6 +478,7 @@ clist_begin_typed_image(gx_device * dev, const gs_gstate * pgs,
bool is_planar_dev = dev->is_planar;
bool render_is_valid;
int csi;
+ gx_clip_path *lpcpath = NULL;
/* We can only handle a limited set of image types. */
switch ((gs_debug_c('`') ? -1 : pic->type->index)) {
@@ -600,7 +601,19 @@ clist_begin_typed_image(gx_device * dev, const gs_gstate * pgs,
pie->rect.q.x = pim->Width, pie->rect.q.y = pim->Height;
}
pie->pgs = pgs;
- pie->pcpath = pcpath;
+
+ if (pcpath) {
+ lpcpath = gx_cpath_alloc(mem, "clist_begin_typed_image(lpcpath)");
+ if (!lpcpath) {
+ goto use_default;
+ }
+ code = gx_cpath_copy(pcpath, lpcpath);
+ if (code < 0) {
+ goto use_default;
+ }
+ }
+ pie->pcpath = lpcpath;
+
pie->buffer = NULL;
pie->format = format;
pie->bits_per_plane = bits_per_pixel / pie->num_planes;
@@ -767,7 +780,7 @@ clist_begin_typed_image(gx_device * dev, const gs_gstate * pgs,
gs_bbox_transform(&sbox, &mat, &dbox);
if (cdev->disable_mask & clist_disable_complex_clip)
- if (!check_rect_for_trivial_clip(pcpath,
+ if (!check_rect_for_trivial_clip(lpcpath,
(int)floor(dbox.p.x), (int)floor(dbox.p.y),
(int)ceil(dbox.q.x), (int)ceil(dbox.q.y)))
goto use_default;
@@ -797,7 +810,7 @@ clist_begin_typed_image(gx_device * dev, const gs_gstate * pgs,
if (!indexed) {
pie->monitor_color = true;
/* Set up the unpacking proc for monitoring */
- get_unpack_proc((gx_image_enum_common_t*) pie, &(pie->decode),
+ get_unpack_proc((gx_image_enum_common_t*) pie, &(pie->decode),
pim->format, pim->Decode);
get_map(&(pie->decode), pim->format, pim->Decode);
if (pie->decode.unpack == NULL) {
@@ -874,10 +887,14 @@ clist_begin_typed_image(gx_device * dev, const gs_gstate * pgs,
for (i = 0; i <= max_value; ++i) {
/* Enumerate the indexed colors, or just Black (DeviceGray = 0) */
cc.paint.values[0] = (double)i;
- remap_color(&cc, pcs, &dcolor, pgs, dev,
+ code = remap_color(&cc, pcs, &dcolor, pgs, dev,
gs_color_select_source);
+ if (code < 0)
+ break;
color_usage |= cmd_drawing_color_usage(cdev, &dcolor);
}
+ if (code < 0)
+ goto use_default;
}
}
pie->color_usage.or = color_usage;
@@ -892,9 +909,9 @@ clist_begin_typed_image(gx_device * dev, const gs_gstate * pgs,
int y0 = (int)floor(dbox.p.y - 0.51); /* adjust + rounding slop */
int y1 = (int)ceil(dbox.q.y + 0.51); /* ditto */
- if (pcpath) {
+ if (lpcpath) {
gs_fixed_rect obox;
- gx_cpath_outer_box(pcpath, &obox);
+ gx_cpath_outer_box(lpcpath, &obox);
pie->ymin = max(0, max(y0, fixed2int(obox.p.y)));
pie->ymax = min(min(y1, fixed2int(obox.q.y)), dev->height);
} else {
@@ -931,6 +948,9 @@ use_default:
gs_free_object(mem, pie, "clist_begin_typed_image");
*pinfo = NULL;
+ if (lpcpath != NULL)
+ gx_cpath_free(lpcpath, "clist_begin_typed_image(lpcpath)");
+
if (pgs->has_transparency){
return -1;
} else {
@@ -1258,6 +1278,9 @@ clist_image_end_image(gx_image_enum_common_t * info, bool draw_last)
#endif
code = write_image_end_all(dev, pie);
cdev->image_enum_id = gs_no_id;
+ gx_cpath_free((gx_clip_path *)pie->pcpath, "clist_image_end_image(pie->pcpath)");
+ cdev->clip_path = NULL;
+ cdev->clip_path_id = gs_no_id;
gx_image_free_enum(&info);
return code;
}
@@ -1278,6 +1301,7 @@ clist_create_compositor(gx_device * dev,
int first_band = 0, no_of_bands = cdev->nbands;
int code = pcte->type->procs.write(pcte, 0, &size, cdev);
int temp_cropping_min, temp_cropping_max;
+ int newdev;
CMD_CHECK_LAST_OP_BLOCK_DEFINED(cdev);
@@ -1291,6 +1315,7 @@ clist_create_compositor(gx_device * dev,
pcdev, pgs, mem);
if (code < 0)
return code;
+ newdev = code == 1;
CMD_CHECK_LAST_OP_BLOCK_DEFINED(cdev);
@@ -1356,6 +1381,9 @@ clist_create_compositor(gx_device * dev,
/* serialize the remainder of the compositor */
if ((code = pcte->type->procs.write(pcte, dp + 3, &size_dummy, cdev)) < 0)
((gx_device_clist_writer *)dev)->cnext = dp;
+
+ if (code >= 0 && newdev)
+ code = 1; /* Return 1 to indicate we created a new device. */
return code;
}
if (cropping_op == PUSHCROP) {
@@ -1372,6 +1400,11 @@ clist_create_compositor(gx_device * dev,
temp_cropping_min = cdev->cropping_min;
temp_cropping_max = cdev->cropping_max;
}
+ /* Adjust the lower and upper bound to allow for image gridfitting changing boundaries */
+ if (temp_cropping_min > 0)
+ temp_cropping_min--;
+ if (temp_cropping_max < dev->height - 1)
+ temp_cropping_max++;
if (temp_cropping_min < temp_cropping_max) {
/* The pdf14 compositor could be applied
only to bands covered by the pcte->params.bbox. */
@@ -1397,6 +1430,9 @@ clist_create_compositor(gx_device * dev,
return code;
}
+ if (newdev)
+ code = 1; /* Return 1 to indicate we created a new device. */
+
return code;
}
@@ -2004,7 +2040,7 @@ cmd_image_plane_data_mon(gx_device_clist_writer * cldev, gx_clist_state * pcls,
to see if we have any non-neutral colors */
int pdata_x;
byte *data_ptr = (byte *)(planes[0].data + i * planes[0].raster + offsets[0] + offset);
- byte *buffer = (byte *)(*pie_c->decode.unpack)(pie_c->buffer, &pdata_x,
+ byte *buffer = (byte *)(*pie_c->decode.unpack)(pie_c->buffer, &pdata_x,
data_ptr, 0, dsize, pie_c->decode.map,
pie_c->decode.spread, pie_c->decode.spp);
diff --git a/base/gxclio.h b/base/gxclio.h
index 9e2e28f9..8dcb8308 100644
--- a/base/gxclio.h
+++ b/base/gxclio.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxclip.c b/base/gxclip.c
index f566e09f..0b7939ef 100644
--- a/base/gxclip.c
+++ b/base/gxclip.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -590,7 +590,7 @@ clip_fill_rectangle(gx_device * dev, int x, int y, int w, int h,
}
int
-clip_call_fill_rectangle_hl_color(clip_callback_data_t * pccd, int xc, int yc,
+clip_call_fill_rectangle_hl_color(clip_callback_data_t * pccd, int xc, int yc,
int xec, int yec)
{
gs_fixed_rect rect;
@@ -1245,7 +1245,7 @@ clip_copy_alpha(gx_device * dev,
}
int
-clip_call_copy_alpha_hl_color(clip_callback_data_t * pccd, int xc, int yc,
+clip_call_copy_alpha_hl_color(clip_callback_data_t * pccd, int xc, int yc,
int xec, int yec)
{
return (*dev_proc(pccd->tdev, copy_alpha_hl_color))
@@ -1308,8 +1308,8 @@ clip_call_strip_tile_rect_devn(clip_callback_data_t * pccd, int xc, int yc, int
static int
clip_strip_tile_rect_devn(gx_device * dev, const gx_strip_bitmap * tiles,
int x, int y, int w, int h,
- const gx_drawing_color *pdcolor0,
- const gx_drawing_color *pdcolor1, int phase_x,
+ const gx_drawing_color *pdcolor0,
+ const gx_drawing_color *pdcolor1, int phase_x,
int phase_y)
{
gx_device_clip *rdev = (gx_device_clip *) dev;
diff --git a/base/gxclip.h b/base/gxclip.h
index 70640afc..5d44bc00 100644
--- a/base/gxclip.h
+++ b/base/gxclip.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxclip2.c b/base/gxclip2.c
index 1b4d1558..38e79fab 100644
--- a/base/gxclip2.c
+++ b/base/gxclip2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -155,7 +155,7 @@ tile_clip_set_phase(gx_device_tile_clip * cdev, int px, int py)
/* Fill a rectangle with high level devn color by tiling with the mask. */
static int
tile_clip_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect,
- const gs_gstate *pgs, const gx_drawing_color *pdcolor,
+ const gs_gstate *pgs, const gx_drawing_color *pdcolor,
const gx_clip_path *pcpath)
{
gx_device_tile_clip *cdev = (gx_device_tile_clip *) dev;
@@ -177,7 +177,7 @@ tile_clip_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect,
w = fixed2int(rect->q.x) - x;
h = fixed2int(rect->q.y) - y;
return (*dev_proc(tdev, strip_tile_rect_devn))(tdev, &cdev->tiles,
- x, y, w, h, &dcolor0, &dcolor1,
+ x, y, w, h, &dcolor0, &dcolor1,
cdev->phase.x, cdev->phase.y);
}
@@ -379,7 +379,7 @@ tile_clip_copy_alpha(gx_device * dev,
static int
tile_clip_copy_alpha_hl_color(gx_device * dev,
const byte * data, int sourcex, int raster, gx_bitmap_id id,
- int x, int y, int w, int h, const gx_drawing_color *pdcolor,
+ int x, int y, int w, int h, const gx_drawing_color *pdcolor,
int depth)
{
gx_device_tile_clip *cdev = (gx_device_tile_clip *) dev;
diff --git a/base/gxclip2.h b/base/gxclip2.h
index 20ebf024..616c8ece 100644
--- a/base/gxclip2.h
+++ b/base/gxclip2.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxclipm.c b/base/gxclipm.c
index ec02ba9a..59f1e765 100644
--- a/base/gxclipm.c
+++ b/base/gxclipm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -152,7 +152,7 @@ mask_clip_fill_rectangle_hl_color(gx_device *dev,
/* It would be nice to have a higher level way to do this operation
like a copy_mono_hl_color */
return (pdcolor->type->fill_masked)
- (pdcolor, cdev->tiles.data + my0 * cdev->tiles.raster, mx0,
+ (pdcolor, cdev->tiles.data + my0 * cdev->tiles.raster, mx0,
cdev->tiles.raster, cdev->tiles.id, mx0 - cdev->phase.x,
my0 - cdev->phase.y, mx1 - mx0, my1 - my0,
tdev, lop_default, false);
@@ -404,7 +404,7 @@ mask_clip_copy_alpha(gx_device * dev,
static int
mask_clip_copy_alpha_hl_color(gx_device * dev,
const byte * data, int sourcex, int raster, gx_bitmap_id id,
- int x, int y, int w, int h, const gx_drawing_color *pdcolor,
+ int x, int y, int w, int h, const gx_drawing_color *pdcolor,
int depth)
{
gx_device_mask_clip *cdev = (gx_device_mask_clip *) dev;
@@ -437,7 +437,7 @@ mask_clip_strip_tile_rectangle(gx_device * dev, const gx_strip_bitmap * tiles,
static int
mask_clip_strip_tile_rect_devn(gx_device * dev, const gx_strip_bitmap * tiles,
int x, int y, int w, int h,
- const gx_drawing_color *pdcolor0,
+ const gx_drawing_color *pdcolor0,
const gx_drawing_color *pdcolor1,
int phase_x, int phase_y)
{
diff --git a/base/gxclipm.h b/base/gxclipm.h
index dcae2baf..429f1595 100644
--- a/base/gxclipm.h
+++ b/base/gxclipm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxclipsr.h b/base/gxclipsr.h
index 20e57011..716c0744 100644
--- a/base/gxclipsr.h
+++ b/base/gxclipsr.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxclist.c b/base/gxclist.c
index 9df5f7c9..7c7f0aa4 100644
--- a/base/gxclist.c
+++ b/base/gxclist.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -31,6 +31,7 @@
#include "gsicc_manage.h"
#include "gsicc_cache.h"
#include "gxdevsop.h"
+#include "gxobj.h"
#include "valgrind.h"
@@ -361,7 +362,7 @@ clist_minimum_buffer(int nbands) {
/*
* Initialize the allocation for the band states, which are used only
- * when writing. Requires: nbands. Sets: states, cbuf, cend.
+ * when writing. Requires: nbands. Sets: states, cbuf, cend, band_range_list.
*/
static int
clist_init_states(gx_device * dev, byte * init_data, uint data_size)
@@ -378,7 +379,8 @@ clist_init_states(gx_device * dev, byte * init_data, uint data_size)
cdev->cend = init_data + data_size;
init_data += alignment;
cdev->states = (gx_clist_state *) init_data;
- cdev->cbuf = init_data + state_size;
+ cdev->band_range_list = (cmd_list *)(init_data + state_size);
+ cdev->cbuf = init_data + state_size + sizeof(cmd_list);
return 0;
}
@@ -410,6 +412,8 @@ clist_init_data(gx_device * dev, byte * init_data, uint data_size)
int code;
int align = 1 << (target->log2_align_mod > log2_align_bitmap_mod ? target->log2_align_mod : log2_align_bitmap_mod);
+ align = align < obj_align_mod ? obj_align_mod : align;
+
/* the clist writer has its own color info that depends upon the
transparency group color space (if transparency exists). The data that is
used in the clist writing. Here it is initialized with
@@ -540,7 +544,7 @@ clist_reset(gx_device * dev)
sizeof(*cdev->tile_table));
cdev->cnext = cdev->cbuf;
cdev->ccl = 0;
- cdev->band_range_list.head = cdev->band_range_list.tail = 0;
+ cdev->band_range_list->head = cdev->band_range_list->tail = 0;
cdev->band_range_min = 0;
cdev->band_range_max = nbands - 1;
{
@@ -756,6 +760,17 @@ clist_close(gx_device *dev)
gs_free_object(cdev->memory->thread_safe_memory, cdev->icc_cache_list, "clist_close");
cdev->icc_cache_list = NULL;
+ /* So despite the comment above, it seems necessary to free the cache_chunk here,
+ * if the device is not being retained. The code in gx_pattern_cache_free_entry() doesn't
+ * actually free it, in at least some cases.
+ * TODO: Is it sufficient to only free it here, and not in the places mentioned above?
+ */
+ if (!cdev->retained) {
+ gs_free_object(cdev->memory->non_gc_memory, cdev->cache_chunk,
+ "clist_close(cache_chunk)");
+ cdev->cache_chunk = NULL;
+ }
+
if (cdev->do_not_open_or_close_bandfiles)
return 0;
if (dev_proc(cdev, open_device) == pattern_clist_open_device) {
@@ -848,6 +863,7 @@ clist_end_page(gx_device_clist_writer * cldev)
clist_free_icc_table(cldev->icc_table, cldev->memory);
cldev->icc_table = NULL;
}
+
if (code >= 0) {
code = clist_write_color_usage_array(cldev);
if (code >= 0) {
@@ -1205,6 +1221,17 @@ clist_write_color_usage_array(gx_device_clist_writer *cldev)
return(0);
}
+/* This writes out the spot equivalent cmyk values for the page.
+ These are used for overprint simulation. Read back by the
+ pdf14 device during the put_image operation */
+int
+clist_write_op_equiv_cmyk_colors(gx_device_clist_writer *cldev,
+ equivalent_cmyk_color_params *op_equiv_cmyk)
+{
+ return cmd_write_pseudo_band(cldev, (unsigned char *)op_equiv_cmyk,
+ sizeof(equivalent_cmyk_color_params), SPOT_EQUIV_COLORS);
+}
+
/* Compute color_usage over a Y range while writing clist */
/* Sets color_usage fields and range_start. */
/* Returns range end (max dev->height) */
@@ -1351,7 +1378,7 @@ clist_make_accum_device(gs_memory_t *mem, gx_device *target, const char *dname,
bool use_memory_clist, bool uses_transparency,
gs_pattern1_instance_t *pinst)
{
- gx_device_clist *cdev = gs_alloc_struct(mem, gx_device_clist,
+ gx_device_clist *cdev = gs_alloc_struct(mem->stable_memory, gx_device_clist,
&st_device_clist, "clist_make_accum_device");
gx_device_clist_writer *cwdev = (gx_device_clist_writer *)cdev;
@@ -1361,10 +1388,10 @@ clist_make_accum_device(gs_memory_t *mem, gx_device *target, const char *dname,
cwdev->params_size = sizeof(gx_device_clist);
cwdev->static_procs = NULL;
cwdev->dname = dname;
- cwdev->memory = mem;
+ cwdev->memory = mem->stable_memory;
cwdev->stype = &st_device_clist;
cwdev->stype_is_dynamic = false;
- rc_init(cwdev, mem, 1);
+ rc_init(cwdev, mem->stable_memory, 1);
cwdev->retained = true;
cwdev->is_open = false;
cwdev->color_info = target->color_info;
@@ -1447,3 +1474,116 @@ RELOC_PTRS_WITH(device_clist_mutatable_reloc_ptrs, gx_device_clist_mutatable *pd
RELOC_PREFIX(st_device_forward);
} RELOC_PTRS_END
public_st_device_clist_mutatable();
+
+int
+clist_mutate_to_clist(gx_device_clist_mutatable *pdev,
+ gs_memory_t *buffer_memory,
+ byte **the_memory,
+ const gdev_space_params *space_params,
+ bool bufferSpace_is_exact,
+ const gx_device_buf_procs_t *buf_procs,
+ dev_proc_dev_spec_op(dev_spec_op),
+ uint min_buffer_space)
+{
+ gx_device *target = (gx_device *)pdev;
+ uint space;
+ int code;
+ gx_device_clist *const pclist_dev = (gx_device_clist *)pdev;
+ gx_device_clist_common * const pcldev = &pclist_dev->common;
+ bool reallocate = the_memory != NULL && *the_memory != NULL;
+ byte *base;
+ bool save_is_open = pdev->is_open; /* Save around temporary failure in open_c loop */
+
+ while (target->parent != NULL) {
+ target = target->parent;
+ gx_update_from_subclass(target);
+ }
+
+ /* Try to allocate based simply on param-requested buffer size */
+#ifdef DEBUGGING_HACKS
+#define BACKTRACE(first_arg)\
+ BEGIN\
+ ulong *fp_ = (ulong *)&first_arg - 2;\
+ for (; fp_ && (fp_[1] & 0xff000000) == 0x08000000; fp_ = (ulong *)*fp_)\
+ dmprintf2(buffer_memory, " fp="PRI_INTPTR" ip=0x%lx\n", (intptr_t)fp_, fp_[1]);\
+ END
+dmputs(buffer_memory, "alloc buffer:\n");
+BACKTRACE(pdev);
+#endif /*DEBUGGING_HACKS*/
+ for ( space = space_params->BufferSpace; ; ) {
+ base = (reallocate ?
+ (byte *)gs_resize_object(buffer_memory, *the_memory, space,
+ "cmd list buffer") :
+ gs_alloc_bytes(buffer_memory, space,
+ "cmd list buffer"));
+ if (base != NULL)
+ break; /* Allocation worked! Stop trying. */
+ if (bufferSpace_is_exact) {
+ /* We wanted a specific size. Accept no substitutes. */
+ break;
+ }
+ /* Let's try again for half the size. */
+ if (space == min_buffer_space)
+ break; /* We already failed at the minimum size. */
+ space >>= 1;
+ if (space < min_buffer_space)
+ space = min_buffer_space;
+ }
+ if (base == NULL)
+ return_error(gs_error_VMerror);
+
+ /* Try opening the command list, to see if we allocated */
+ /* enough buffer space. */
+open_c:
+ if (the_memory)
+ *the_memory = base;
+ pdev->buf = base;
+ pdev->buffer_space = space;
+ pclist_dev->common.orig_spec_op = dev_spec_op;
+ clist_init_io_procs(pclist_dev, pdev->BLS_force_memory);
+ clist_init_params(pclist_dev, base, space, target,
+ *buf_procs,
+ space_params->band,
+ false, /* do_not_open_or_close_bandfiles */
+ (pdev->bandlist_memory == 0 ? pdev->memory->non_gc_memory:
+ pdev->bandlist_memory),
+ pdev->clist_disable_mask,
+ pdev->page_uses_transparency,
+ pdev->page_uses_overprint);
+ code = (*gs_clist_device_procs.open_device)( (gx_device *)pcldev );
+ if (code < 0) {
+ /* If there wasn't enough room, and we haven't */
+ /* already shrunk the buffer, try enlarging it. */
+ if ( code == gs_error_rangecheck &&
+ space >= space_params->BufferSpace &&
+ !bufferSpace_is_exact
+ ) {
+ space += space / 8;
+ if (reallocate) {
+ base = gs_resize_object(buffer_memory,
+ *the_memory, space,
+ "cmd list buf(retry open)");
+ } else {
+ gs_free_object(buffer_memory, base,
+ "cmd list buf(retry open)");
+ base = gs_alloc_bytes(buffer_memory, space,
+ "cmd list buf(retry open)");
+ if (the_memory != NULL)
+ *the_memory = base;
+ }
+ if (base != NULL) {
+ pdev->is_open = save_is_open; /* allow for success when we loop */
+ goto open_c;
+ }
+ }
+ /* Failure. */
+ if (!reallocate) {
+ gs_free_object(buffer_memory, base, "cmd list buf");
+ pdev->buffer_space = 0;
+ if (the_memory != NULL)
+ *the_memory = NULL;
+ pdev->buf = NULL;
+ }
+ }
+ return code;
+}
diff --git a/base/gxclist.h b/base/gxclist.h
index cdb0136f..a30331fb 100644
--- a/base/gxclist.h
+++ b/base/gxclist.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -310,7 +310,7 @@ struct gx_device_clist_writer_s {
byte *cnext; /* next slot in command buffer */
byte *cend; /* end of command buffer */
cmd_list *ccl; /* &clist_state.list of last command */
- cmd_list band_range_list; /* list of band-range commands */
+ cmd_list *band_range_list; /* list of band-range commands */
int band_range_min, band_range_max; /* range for list */
uint tile_max_size; /* max size of a single tile (bytes) */
uint tile_max_count; /* max # of hash table entries */
@@ -418,7 +418,7 @@ extern_st(st_device_clist);
#define CLIST_IS_WRITER(cdev) ((cdev)->common.ymin < 0)
/* setup before opening clist device */
-#define clist_init_params(xclist, xdata, xdata_size, xtarget, xbuf_procs, xband_params, xexternal, xmemory, xdisable, pageusestransparency)\
+#define clist_init_params(xclist, xdata, xdata_size, xtarget, xbuf_procs, xband_params, xexternal, xmemory, xdisable, pageusestransparency, pageusesoverprint)\
BEGIN\
(xclist)->common.data = (xdata);\
(xclist)->common.data_size = (xdata_size);\
@@ -429,6 +429,7 @@ extern_st(st_device_clist);
(xclist)->common.bandlist_memory = (xmemory);\
(xclist)->writer.disable_mask = (xdisable);\
(xclist)->writer.page_uses_transparency = (pageusestransparency);\
+ (xclist)->writer.page_uses_overprint = (pageusesoverprint);\
(xclist)->writer.pinst = NULL;\
END
@@ -493,6 +494,10 @@ int clist_put_data(const gx_device_clist *cdev, int select, int64_t offset, cons
/* Write out the array of color usage entries (one per band) */
int clist_write_color_usage_array(gx_device_clist_writer *cldev);
+/* Write out simulated overprint CMYK equiv. values for spot colors */
+int clist_write_op_equiv_cmyk_colors(gx_device_clist_writer *cldev,
+ equivalent_cmyk_color_params *op_equiv_cmyk);
+
/* get the color_usage summary over a Y range from the clist writer states */
/* Not expected to be used */
int clist_writer_color_usage(gx_device_clist_writer *cldev, int y, int height,
@@ -661,4 +666,14 @@ extern_st(st_device_clist_mutatable);
#define CLIST_MUTATABLE_HAS_MUTATED(pdev) \
(((gx_device_clist_mutatable *)(pdev))->buffer_space != 0)
+int
+clist_mutate_to_clist(gx_device_clist_mutatable *pdev,
+ gs_memory_t *buffer_memory,
+ byte **the_memory,
+ const gdev_space_params *space_params,
+ bool bufferSpace_is_exact,
+ const gx_device_buf_procs_t *buf_procs,
+ dev_proc_dev_spec_op(dev_spec_op),
+ uint min_buffer_space);
+
#endif /* gxclist_INCLUDED */
diff --git a/base/gxcllzw.c b/base/gxcllzw.c
index 333d49d4..ad36e6de 100644
--- a/base/gxcllzw.c
+++ b/base/gxcllzw.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxclmem.c b/base/gxclmem.c
index e4791152..832d1204 100644
--- a/base/gxclmem.c
+++ b/base/gxclmem.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxclmem.h b/base/gxclmem.h
index 18fc9511..cf63160c 100644
--- a/base/gxclmem.h
+++ b/base/gxclmem.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxclpage.c b/base/gxclpage.c
index 63573269..18ff9b81 100644
--- a/base/gxclpage.c
+++ b/base/gxclpage.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxclpage.h b/base/gxclpage.h
index eaf8573c..c73b40b7 100644
--- a/base/gxclpage.h
+++ b/base/gxclpage.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxclpath.c b/base/gxclpath.c
index c97379b9..5c757e36 100644
--- a/base/gxclpath.c
+++ b/base/gxclpath.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxclpath.h b/base/gxclpath.h
index 962c5704..7a393730 100644
--- a/base/gxclpath.h
+++ b/base/gxclpath.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxclrast.c b/base/gxclrast.c
index 60c0ef77..f9f42d88 100644
--- a/base/gxclrast.c
+++ b/base/gxclrast.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -475,7 +475,8 @@ read_set_misc_map(byte cb, command_buf_t *pcb, gs_gstate *pgs, gs_memory_t *mem)
int
clist_playback_band(clist_playback_action playback_action,
gx_device_clist_reader *cdev, stream *s,
- gx_device *target, int x0, int y0, gs_memory_t * mem)
+ gx_device *target, int x0, int y0,
+ gs_memory_t * mem) /* lgtm [cpp/use-of-goto] */
{
byte *cbuf_storage;
command_buf_t cbuf;
@@ -3095,18 +3096,11 @@ static int apply_create_compositor(gx_device_clist_reader *cdev, gs_gstate *pgs,
* change the target device.
*/
code = dev_proc(tdev, create_compositor)(tdev, &tdev, pcomp, pgs, mem, (gx_device*) cdev);
- if (code >= 0 && tdev != *ptarget) {
- /* If we created a new compositor here, then that new compositor should
- * become the device to which we send all future drawing requests. If
- * the above create_compositor call found an existing compositor
- * already in the chain of devices (such as might happen when we are
- * playing back a clist based pattern, and the top device is a clip
- * device that forwards to a pdf14 device), then we'll just reuse
- * that one. We do not want to send new drawing operations to the
- * compositor, as that will sidestep the clipping. We therefore check
- * the reference count to see if this is a new device or not. */
- if (tdev->rc.ref_count == 1)
- *ptarget = tdev;
+ if (code == 1) {
+ /* A new compositor was created that wrapped tdev. This should
+ * be our new target. */
+ *ptarget = tdev;
+ code = 0;
}
if (code < 0)
return code;
diff --git a/base/gxclread.c b/base/gxclread.c
index f2ebf6b5..2323b68c 100644
--- a/base/gxclread.c
+++ b/base/gxclread.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -377,7 +377,8 @@ clist_close_writer_and_init_reader(gx_device_clist *cldev)
/* Used to find the command block information in the bfile
that is related to extra information stored in a psuedo band.
Currently application of this is storage of the ICC profile
- table and the per-band color_usage array. We may eventually
+ table, the per-band color_usage array, and the spot equivalent
+ colors when doing overprint simulation. We may eventually
use this for storing other information like compressed images. */
static int
@@ -468,6 +469,23 @@ clist_read_color_usage_array(gx_device_clist_reader *crdev)
return code;
}
+/* read the cmyk equivalent spot colors */
+int
+clist_read_op_equiv_cmyk_colors(gx_device_clist_reader *crdev,
+ equivalent_cmyk_color_params *op_equiv_cmyk_colors)
+{
+ int code;
+ cmd_block cb;
+
+ code = clist_find_pseudoband(crdev, crdev->nbands + SPOT_EQUIV_COLORS - 1, &cb);
+ if (code < 0)
+ return code;
+
+ code = clist_read_chunk(crdev, cb.pos, sizeof(equivalent_cmyk_color_params),
+ (unsigned char *)op_equiv_cmyk_colors);
+ return code;
+}
+
/* Unserialize the icc table information stored in the cfile and
place it in the reader device */
static int
diff --git a/base/gxclrect.c b/base/gxclrect.c
index 6f71b61a..bbfb40d8 100644
--- a/base/gxclrect.c
+++ b/base/gxclrect.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -24,8 +24,6 @@
#include "gxclpath.h"
#include "gxdevsop.h"
-extern dev_proc_dev_spec_op(gdev_prn_forwarding_dev_spec_op);
-
/* ---------------- Writing utilities ---------------- */
#define cmd_set_rect(rect)\
@@ -599,6 +597,10 @@ clist_dev_spec_op(gx_device *pdev, int dev_spec_op, void *data, int size)
return 1;
if (dev_spec_op == gxdso_pattern_shfill_doesnt_need_path)
return 1;
+ if (dev_spec_op == gxdso_copy_alpha_disabled) {
+ gx_device_clist_writer * const cdev = &((gx_device_clist *)pdev)->writer;
+ return (cdev->disable_mask & clist_disable_copy_alpha) != 0;
+ }
if (dev_spec_op == gxdso_supports_devn
|| dev_spec_op == gxdso_skip_icc_component_validation) {
cmm_dev_profile_t *dev_profile;
@@ -619,10 +621,17 @@ clist_dev_spec_op(gx_device *pdev, int dev_spec_op, void *data, int size)
ibox->q.y = cwdev->cropping_max;
return 0;
}
+ if (dev_spec_op == gxdso_is_clist_device)
+ return 1;
if (dev_spec_op == gxdso_overprint_active) {
gx_device_clist_writer* cwdev = &((gx_device_clist*)pdev)->writer;
return cwdev->op_fill_active || cwdev->op_stroke_active;
}
+ /* This is a horrible hack. Accumulator devices have their procs
+ * overriden by clist ones in gdev_prn_open. */
+ if (strncmp(pdev->dname, "pdf14-accum-", 12) == 0) {
+ return pdf14_accum_dev_spec_op(pdev, dev_spec_op, data, size);
+ }
/* forward to the appropriate super class */
if (cdev->orig_spec_op)
return cdev->orig_spec_op(pdev, dev_spec_op, data, size);
diff --git a/base/gxclthrd.c b/base/gxclthrd.c
index 64b6f530..088de2bf 100644
--- a/base/gxclthrd.c
+++ b/base/gxclthrd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -119,7 +119,7 @@ setup_device_and_mem_for_thread(gs_memory_t *chunk_base_mem, gx_device *dev, boo
OI_PROFILE, strlen(OI_PROFILE)) == 0)
|| (dev->icc_struct->proof_profile != NULL &&
strncmp(dev->icc_struct->proof_profile->name, OI_PROFILE, strlen(OI_PROFILE)) == 0)))) {
- ndev->icc_struct = gsicc_new_device_profile_array(ndev->memory);
+ ndev->icc_struct = gsicc_new_device_profile_array(ndev);
if (!ndev->icc_struct) {
emprintf1(ndev->memory,
"Error setting up device profile array, code=%d. Rendering threads not started.\n",
diff --git a/base/gxclthrd.h b/base/gxclthrd.h
index bc83c9bc..086e3325 100644
--- a/base/gxclthrd.h
+++ b/base/gxclthrd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxclutil.c b/base/gxclutil.c
index a66b37b6..055fbcf7 100644
--- a/base/gxclutil.c
+++ b/base/gxclutil.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -268,7 +268,7 @@ cmd_write_buffer(gx_device_clist_writer * cldev, byte cmd_end)
int band;
int code = cmd_write_band(cldev, cldev->band_range_min,
cldev->band_range_max,
- &cldev->band_range_list,
+ cldev->band_range_list,
cmd_opv_end_run);
int warning = code;
@@ -398,7 +398,7 @@ cmd_put_range_op(gx_device_clist_writer * cldev, int band_min, int band_max,
if_debug4m('L', cldev->memory, "[L]band range(%d,%d): size=%u, left=%u",
band_min, band_max, size, 0);
if (cldev->ccl != 0 &&
- (cldev->ccl != &cldev->band_range_list ||
+ (cldev->ccl != cldev->band_range_list ||
band_min != cldev->band_range_min ||
band_max != cldev->band_range_max)
) {
@@ -408,7 +408,7 @@ cmd_put_range_op(gx_device_clist_writer * cldev, int band_min, int band_max,
cldev->band_range_min = band_min;
cldev->band_range_max = band_max;
}
- return cmd_put_list_op(cldev, &cldev->band_range_list, size);
+ return cmd_put_list_op(cldev, cldev->band_range_list, size);
}
/* Write a variable-size positive integer. */
@@ -799,7 +799,7 @@ cmd_put_params(gx_device_clist_writer *cldev,
if (code < 0) {
/* error serializing: back out by writing a 0-length parm list */
memset(dp - sizeof(unsigned), 0, sizeof(unsigned));
- cmd_shorten_list_op(cldev, &cldev->band_range_list,
+ cmd_shorten_list_op(cldev, cldev->band_range_list,
old_param_length);
}
} else
diff --git a/base/gxclzlib.c b/base/gxclzlib.c
index d823f092..aaea9f57 100644
--- a/base/gxclzlib.c
+++ b/base/gxclzlib.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxcmap.c b/base/gxcmap.c
index 7e92621d..cba4908e 100644
--- a/base/gxcmap.c
+++ b/base/gxcmap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -2276,7 +2276,9 @@ gx_get_cmapper(gx_cmapper_t *data, const gs_gstate *pgs,
data->direct = 0;
if (has_transfer && dev->color_info.opmode == GX_CINFO_OPMODE_UNKNOWN)
check_cmyk_color_model_comps(dev);
- if (pgs->effective_transfer_non_identity_count == 0)
+ /* Per spec. Images with soft mask, and the mask, do not use transfer function */
+ if (pgs->effective_transfer_non_identity_count == 0 ||
+ (dev_proc(dev, dev_spec_op)(dev, gxdso_in_smask, NULL, 0)) > 0)
has_transfer = 0;
if (has_transfer) {
if (dev->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE) {
diff --git a/base/gxcmap.h b/base/gxcmap.h
index fd3e9793..b626e632 100644
--- a/base/gxcmap.h
+++ b/base/gxcmap.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -168,10 +168,13 @@ void gx_set_cmap_procs(gs_gstate *, const gx_device *);
routines. Note: This information is currently being used by the routines
for identifying when they are being given a separation name. Some devices
automaticaly add separations to the device's components if the separation
- is not previously known and there is room in the device.
+ is not previously known and there is room in the device. Overprint
+ simulation required a split of the NO_COMP_NAME_TYPE depending if we
+ are calling from the halftone setup or overprint setup.
*/
-#define NO_COMP_NAME_TYPE 0
-#define SEPARATION_NAME 1
+#define NO_COMP_NAME_TYPE_HT 0
+#define NO_COMP_NAME_TYPE_OP 1
+#define SEPARATION_NAME 2
/*
Convert a color component name into a colorant index.
diff --git a/base/gxcolor2.h b/base/gxcolor2.h
index bb9376eb..8a3ca3f9 100644
--- a/base/gxcolor2.h
+++ b/base/gxcolor2.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxcomp.h b/base/gxcomp.h
index 2c741095..a3aef8d2 100644
--- a/base/gxcomp.h
+++ b/base/gxcomp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -106,7 +106,7 @@ typedef struct gs_composite_type_procs_s {
/*
* Checks whether a next compositor operation closes this one.
* Must set the 2nd argument with a pointer to the opening compositor operation.
- * Return coides : <0 - error, 0 - not closing,
+ * Return codes : <0 - error, 0 - not closing,
* 1 - closing with annihilation, 2 - execute immediately,
* 3 - closing and replacing, 4 - replace one, 5 - drop queue.
*/
@@ -116,7 +116,7 @@ typedef struct gs_composite_type_procs_s {
/*
* Checks whether a next operation is friendly to the compositor
- * so that it may commutate with the compositor operation.
+ * so that it may commute with the compositor operation.
*/
#define composite_is_friendly_proc(proc)\
bool proc(const gs_composite_t *this, byte cmd0, byte cmd1)
diff --git a/base/gxcoord.h b/base/gxcoord.h
index b8633928..24e560b7 100644
--- a/base/gxcoord.h
+++ b/base/gxcoord.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxcpath.c b/base/gxcpath.c
index c9fde9d4..4cec26c7 100644
--- a/base/gxcpath.c
+++ b/base/gxcpath.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxcpath.h b/base/gxcpath.h
index 9d1fdace..4633c945 100644
--- a/base/gxcpath.h
+++ b/base/gxcpath.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxcspace.h b/base/gxcspace.h
index 3218019c..40fbee16 100644
--- a/base/gxcspace.h
+++ b/base/gxcspace.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -165,16 +165,30 @@ struct gs_color_space_type_s {
#define cs_proc_adjust_color_count(proc)\
void proc(const gs_client_color *, const gs_color_space *, int)
+
+ /* Adjust the color reference counts for the current space. */
#define cs_adjust_color_count(pgs, delta)\
(*gs_currentcolorspace_inline(pgs)->type->adjust_color_count)\
(gs_currentcolor_inline(pgs), gs_currentcolorspace_inline(pgs), delta)
+ /* Adjust the color reference counts for the swapped space (i.e.
+ * the one that is not current). */
+#define cs_adjust_swappedcolor_count(pgs, delta)\
+ (*gs_swappedcolorspace_inline(pgs)->type->adjust_color_count)\
+ (gs_swappedcolor_inline(pgs), gs_swappedcolorspace_inline(pgs), delta)
+
cs_proc_adjust_color_count((*adjust_color_count));
-/* Adjust both reference counts. */
+/* Adjust both reference counts for the current color/colorspace. */
#define cs_adjust_counts(pgs, delta)\
cs_adjust_color_count(pgs, delta); \
rc_adjust_const(gs_currentcolorspace_inline(pgs), delta, "cs_adjust_counts")
+/* Adjust both reference counts for the swapped (i.e. non-current)
+ * color/colorspace. */
+#define cs_adjust_swappedcounts(pgs, delta)\
+ cs_adjust_swappedcolor_count(pgs, delta); \
+ rc_adjust_const(gs_swappedcolorspace_inline(pgs), delta, "cs_adjust_swappedcounts")
+
/* Serialization. */
/*
* Note : We don't include *(pcs)->type into serialization,
diff --git a/base/gxctable.c b/base/gxctable.c
index 4662d090..349fbb71 100644
--- a/base/gxctable.c
+++ b/base/gxctable.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxctable.h b/base/gxctable.h
index a2fc8cad..392c5033 100644
--- a/base/gxctable.h
+++ b/base/gxctable.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxcvalue.h b/base/gxcvalue.h
index 92efa325..5d265262 100644
--- a/base/gxcvalue.h
+++ b/base/gxcvalue.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxdcconv.c b/base/gxdcconv.c
index c492ec0b..67a027b0 100644
--- a/base/gxdcconv.c
+++ b/base/gxdcconv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxdcconv.h b/base/gxdcconv.h
index 68803375..16f3b59f 100644
--- a/base/gxdcconv.h
+++ b/base/gxdcconv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxdcolor.c b/base/gxdcolor.c
index b4178871..20116fd8 100644
--- a/base/gxdcolor.c
+++ b/base/gxdcolor.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -540,7 +540,11 @@ gx_dc_devn_equal(const gx_device_color * pdevc1, const gx_device_color * pdevc2)
/*
* Utility to write a devn color into the clist. We should only be here
* if the device can handle these colors (e.g. a separation device like
- * tiffsep). TODO: Reduce the size of this by removing leading zeros in
+ * tiffsep). We can also be here if we are doing simulated overprint
+ * and the source document has spot colors in which case pdf14cmykspot
+ * device has been pushed and will handle devn colors. Because the target
+ * could be bitrgbtags we need to send the tag information along.
+ * TODO: Reduce the size of this by removing leading zeros in
* the mask.
*
*/
@@ -569,8 +573,8 @@ gx_devn_write_color(
mask = comp_bits;
num_bytes1 = sizeof(gx_color_index);
- num_bytes = num_bytes1 + count * 2;
- num_bytes_temp = num_bytes1;
+ num_bytes = num_bytes1 + count * 2 + 1; /* One for the tag byte */
+ num_bytes_temp = num_bytes1 + 1;
/* check for adequate space */
if (*psize < num_bytes) {
@@ -578,12 +582,20 @@ gx_devn_write_color(
return_error(gs_error_rangecheck);
}
*psize = num_bytes;
+
/* write out the mask */
mask_temp = mask;
while (--num_bytes1 >= 0) {
pdata[num_bytes1] = mask_temp & 0xff;
mask_temp >>= 8;
}
+
+ /* Now the tag */
+ if (dev->graphics_type_tag & GS_DEVICE_ENCODES_TAGS)
+ pdata[num_bytes_temp - 1] = (dev->graphics_type_tag & ~GS_DEVICE_ENCODES_TAGS);
+ else
+ pdata[num_bytes_temp - 1] = GS_UNTOUCHED_TAG;
+
/* Now the data */
for (i = 0; i < ncomps; i++) {
if (mask & 1) {
@@ -668,6 +680,7 @@ gx_dc_devn_write(
static int
gx_devn_read_color(
ushort values[],
+ gs_graphics_type_tag_t * tag,
const gx_device * dev,
const byte * pdata,
int size )
@@ -687,6 +700,12 @@ gx_devn_read_color(
mask = (mask << 8) | pdata[i];
pos = i;
num_bytes = i;
+
+ /* Now the tag */
+ *tag = pdata[pos];
+ pos++;
+ num_bytes++;
+
/* Now the data */
for (i = 0; i < ncomps; i++) {
if (mask & 1) {
@@ -738,13 +757,14 @@ gx_dc_devn_read(
const gs_gstate * pgs, /* ignored */
const gx_device_color * prior_devc, /* ignored */
const gx_device * dev,
- int64_t offset, /* ignored */
+ int64_t offset, /* ignored */
const byte * pdata,
uint size,
gs_memory_t * mem ) /* ignored */
{
pdevc->type = gx_dc_type_devn;
- return gx_devn_read_color(&(pdevc->colors.devn.values[0]), dev, pdata, size);
+ return gx_devn_read_color(&(pdevc->colors.devn.values[0]), &(pdevc->tag),
+ dev, pdata, size);
}
/* Remember these are 16 bit values. Also here we return the number of
@@ -853,7 +873,7 @@ gx_dc_pure_fill_masked(const gx_device_color * pdevc, const byte * data,
if (!rop3_uses_S(lop))
lop |= rop3_S;
-
+
return (*dev_proc(dev, strip_copy_rop))
(dev, data, data_x, raster, id, scolors,
NULL, tcolors, x, y, w, h, 0, 0,
diff --git a/base/gxdcolor.h b/base/gxdcolor.h
index 9e979b32..8a1f4135 100644
--- a/base/gxdcolor.h
+++ b/base/gxdcolor.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -302,10 +302,10 @@ int gx_remap_color(gs_gstate *);
#define gx_unset_dev_color(pgs)\
color_unset(gs_currentdevicecolor_inline(pgs))
#define gx_unset_alt_dev_color(pgs)\
- color_unset(gs_altdevicecolor_inline(pgs))
+ color_unset(gs_swappeddevicecolor_inline(pgs))
#define gx_unset_both_dev_colors(pgs)\
(color_unset(gs_currentdevicecolor_inline(pgs)),\
- color_unset(gs_altdevicecolor_inline(pgs)))
+ color_unset(gs_swappeddevicecolor_inline(pgs)))
/* Load the halftone cache in preparation for drawing. */
#define gx_color_load_select(pdevc, pgs, dev, select)\
diff --git a/base/gxdda.h b/base/gxdda.h
index ab577342..6c7c4e7a 100644
--- a/base/gxdda.h
+++ b/base/gxdda.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxdevbuf.h b/base/gxdevbuf.h
index 8f5fd0a7..969454c3 100644
--- a/base/gxdevbuf.h
+++ b/base/gxdevbuf.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxdevcli.h b/base/gxdevcli.h
index 0bdf3c02..f41f8d11 100644
--- a/base/gxdevcli.h
+++ b/base/gxdevcli.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -706,6 +706,11 @@ typedef struct gdev_space_params_s {
int gdev_space_params_cmp(const gdev_space_params sp1,
const gdev_space_params sp2);
+typedef struct gdev_nupcontrol_s {
+ rc_header rc;
+ char *nupcontrol_str; /* NUL termintated string */
+} gdev_nupcontrol;
+
typedef struct gdev_pagelist_s {
rc_header rc;
char *Pages;
@@ -759,6 +764,8 @@ typedef struct gdev_pagelist_s {
bool DisablePageHandler; /* Can be set by the interpreter if it will process FirstPage and LastPage itself */\
int ObjectFilter; /* Bit field for which object filters to apply */\
bool ObjectHandlerPushed; /* Handles filtering of objects to devices */\
+ gdev_nupcontrol *NupControl;\
+ bool NupHandlerPushed; /* Handles Nup operations */\
long PageCount; /* number of pages written */\
long ShowpageCount; /* number of calls on showpage */\
int NumCopies;\
@@ -772,6 +779,7 @@ typedef struct gdev_pagelist_s {
gx_stroked_gradient_recognizer_t sgr;\
size_t MaxPatternBitmap; /* Threshold for switching to pattern_clist mode */\
bool page_uses_transparency; /* PDF 1.4 transparency is used. */\
+ bool page_uses_overprint; /* overprint is used. */\
gdev_space_params space_params;\
cmm_dev_profile_t *icc_struct; /* object dependent profiles */\
gs_graphics_type_tag_t graphics_type_tag; /* e.g. vector, image or text */\
@@ -1681,11 +1689,6 @@ typedef struct gx_image_plane_s {
((*dev_proc(dev, begin_typed_image))\
(dev, pgs, pmat, pim, prect, pdcolor, pcpath, memory, pinfo))
-/*
- * The driver-like procedures gx_device_{image_data, image_plane_data,
- * end_image} are now DEPRECATED and will eventually be removed.
- * Their replacements no longer take an ignored dev argument.
- */
int gx_image_data(gx_image_enum_common_t *info, const byte **planes,
int data_x, uint raster, int height);
/*
@@ -1701,13 +1704,6 @@ int gx_image_flush(gx_image_enum_common_t *info);
bool gx_image_planes_wanted(const gx_image_enum_common_t *info, byte *wanted);
int gx_image_end(gx_image_enum_common_t *info, bool draw_last);
-#define gx_device_image_data(dev, info, planes, data_x, raster, height)\
- gx_image_data(info, planes, data_x, raster, height)
-#define gx_device_image_plane_data(dev, info, planes, height)\
- gx_image_plane_data(info, planes, height)
-#define gx_device_end_image(dev, info, draw_last)\
- gx_image_end(info, draw_last)
-
/*
* Get the anti-aliasing parameters for a device. This replaces the
* obsolete get_alpha_bits device procedure.
diff --git a/base/gxdevice.h b/base/gxdevice.h
index e53f0b90..c757fa2d 100644
--- a/base/gxdevice.h
+++ b/base/gxdevice.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -101,7 +101,7 @@
#define std_device_part1_(devtype, ptr_procs, dev_name, stype, open_init)\
sizeof(devtype), ptr_procs, dev_name,\
0 /*memory*/, stype, 0 /*stype_is_dynamic*/, 0 /*finalize*/,\
- { 0 } /*rc*/, 0 /*retained*/, 0 /* parent */, 0 /* child */, 0 /* subclass_data */, 0, /* PageList */\
+ { 0 } /*rc*/, 0 /*retained*/, 0 /* parent */, 0 /* child */, 0 /* subclass_data */, 0 /* PageList */,\
open_init() /*is_open, max_fill_band*/
/* color_info goes here */
/*
@@ -119,12 +119,14 @@
/* offsets and margins go here */
#define std_device_part3_()\
- 0/*FirstPage*/, 0/*LastPage*/, 0/*PageHandlerPushed*/, 0/*DisablePageHandler*/, 0/* Object Filter*/, 0/*ObjectHandlerPushed*/,\
+ 0/*FirstPage*/, 0/*LastPage*/, 0/*PageHandlerPushed*/, 0/*DisablePageHandler*/,\
+ 0/* Object Filter*/, 0/*ObjectHandlerPushed*/,\
+ 0, /* NupControl */ 0, /* NupHandlerPushed */\
0/*PageCount*/, 0/*ShowpageCount*/, 1/*NumCopies*/, 0/*NumCopies_set*/,\
0/*IgnoreNumCopies*/, 0/*UseCIEColor*/, 0/*LockSafetyParams*/,\
0/*band_offset_x*/, 0/*band_offset_y*/, false /*BLS_force_memory*/, \
{false}/* sgr */,\
- 0/* MaxPatternBitmap */, 0/*page_uses_transparency*/,\
+ 0/* MaxPatternBitmap */, 0/*page_uses_transparency*/, 0/*page_uses_overprint*/,\
{ MAX_BITMAP, BUFFER_SPACE,\
{ BAND_PARAMS_INITIAL_VALUES },\
0/*false*/, /* params_are_read_only */\
diff --git a/base/gxdevmem.h b/base/gxdevmem.h
index a5e2c6db..bb890a27 100644
--- a/base/gxdevmem.h
+++ b/base/gxdevmem.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxdevndi.c b/base/gxdevndi.c
index 407226d0..29c6f3ea 100644
--- a/base/gxdevndi.c
+++ b/base/gxdevndi.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxdevrop.h b/base/gxdevrop.h
index 93049fa1..10e502a1 100644
--- a/base/gxdevrop.h
+++ b/base/gxdevrop.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxdevsop.h b/base/gxdevsop.h
index f41a780a..a5af0f41 100644
--- a/base/gxdevsop.h
+++ b/base/gxdevsop.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -29,7 +29,7 @@
* ioctl is to unix file handles.
*
* Design features of this scheme ensure that:
- * * Devices that support a given call call efficiently implement both
+ * * Devices that support a given call can efficiently implement both
* input and output.
* * Devices that do not support a given call can efficiently refuse it
* (without having to know all the possible calls).
@@ -366,7 +366,13 @@ enum {
* 0 otherwise.
*/
gxdso_in_smask,
-
+ /* gxdso_in_smask_construction:
+ * data = NULL
+ * size = 0
+ * Returns 1 if we are within an smask construction,
+ * 0 otherwise.
+ */
+ gxdso_in_smask_construction,
/* Debug only dsos follow here */
#ifdef DEBUG
/* Private dso used to check that a printer device properly forwards to the default */
@@ -395,6 +401,35 @@ enum {
* for example).
*/
gxdso_skip_icc_component_validation,
+
+ /* gxdso_copy_alpha_disabled:
+ * data = NULL
+ * size = 0
+ * Returns 1 if the command list device sets clist_disable_copy_alpha flag,
+ * 0 otherwise.
+ */
+ gxdso_copy_alpha_disabled,
+
+ /* gxdso_set_HWSize:
+ * data = int[2], [0] is width [1] is height
+ * size = sizeof(int[2])
+ * Returns 1 if the device controls dev->width, dev->height
+ * 0 otherwise.
+ * NB: caller should set dev->wdith and dev->height if return is <= 0
+ */
+ gxdso_set_HWSize,
+
+ /* gxdso_device_insert_child:
+ * data = pointer to device to insert as child of the device
+ * handling this special op.
+ * size = 0
+ * Returns 0 if completed successfully, negative otherwise.
+ */
+ gxdso_device_insert_child,
+
+ /* Determine if a given device is a clist one. Returns 1 if it is. */
+ gxdso_is_clist_device,
+
/* Add new gxdso_ keys above this. */
gxdso_pattern__LAST
};
diff --git a/base/gxdht.h b/base/gxdht.h
index 8bb51c2c..d365606e 100644
--- a/base/gxdht.h
+++ b/base/gxdht.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -188,11 +188,14 @@ typedef struct gx_ht_order_procs_s {
} gx_ht_order_procs_t;
/*
* Define the procedure vectors for the supported implementations
- * (in gxhtbit.c).
+ * (in gxhtbit.c). This defines the type of data that the turn-on-sequence (TOS)
+ * elements are pointing too. For the ushort and uint case, they are offsets
+ * into the address of the bitmap tiles.
*/
-extern const gx_ht_order_procs_t ht_order_procs_table[2];
+extern const gx_ht_order_procs_t ht_order_procs_table[3];
#define ht_order_procs_default ht_order_procs_table[0] /* bit_data is gx_ht_bit[] */
#define ht_order_procs_short ht_order_procs_table[1] /* bit_data is ushort[] */
+#define ht_order_procs_uint ht_order_procs_table[2] /* bit_data is uint[] */
/* For screen/spot halftones, we must record additional parameters. */
typedef struct gx_ht_order_screen_params_s {
gs_matrix matrix; /* CTM when the function was sampled */
diff --git a/base/gxdhtres.h b/base/gxdhtres.h
index 97734514..20a03dd4 100644
--- a/base/gxdhtres.h
+++ b/base/gxdhtres.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxdhtserial.c b/base/gxdhtserial.c
index 63cab5a3..6f8bb18f 100644
--- a/base/gxdhtserial.c
+++ b/base/gxdhtserial.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxdhtserial.h b/base/gxdhtserial.h
index 987fb1ec..ceb19051 100644
--- a/base/gxdhtserial.h
+++ b/base/gxdhtserial.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxdither.h b/base/gxdither.h
index e6e27cd1..8484a3ea 100644
--- a/base/gxdither.h
+++ b/base/gxdither.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxdownscale.c b/base/gxdownscale.c
index 1a348da5..fd51a695 100644
--- a/base/gxdownscale.c
+++ b/base/gxdownscale.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxdownscale.h b/base/gxdownscale.h
index c9db668e..ed945b46 100644
--- a/base/gxdownscale.h
+++ b/base/gxdownscale.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxdtfill.h b/base/gxdtfill.h
index 7ee73003..ca6d028e 100644
--- a/base/gxdtfill.h
+++ b/base/gxdtfill.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxfapi.c b/base/gxfapi.c
index e6bc445d..6b97d708 100644
--- a/base/gxfapi.c
+++ b/base/gxfapi.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -285,7 +285,7 @@ recreate_multiple_master(gs_font_base *pbfont)
changed = (memcmp(I->face.WeightVector.values, pfont1->data.WeightVector.values,
pfont1->data.WeightVector.count * sizeof(pfont1->data.WeightVector.values[0])) != 0);
}
-
+
if (changed) {
r = (I->set_mm_weight_vector(I, &I->ff, pfont1->data.WeightVector.values, pfont1->data.WeightVector.count) == gs_error_invalidaccess);
I->face.WeightVector.count = pfont1->data.WeightVector.count;
@@ -565,8 +565,8 @@ outline_char(gs_memory_t *mem, gs_fapi_server *I, int import_shift_v,
gs_gstate *pgs = penum_s->pgs;
olh.path = path;
- olh.x0 = pgs->ctm.tx_fixed;
- olh.y0 = pgs->ctm.ty_fixed;
+ olh.x0 = pgs->ctm.tx_fixed - float2fixed(penum_s->fapi_glyph_shift.x);
+ olh.y0 = pgs->ctm.ty_fixed - float2fixed(penum_s->fapi_glyph_shift.y);
olh.close_path = close_path;
olh.need_close = false;
path_interface.olh = &olh;
@@ -849,7 +849,7 @@ fapi_image_uncached_glyph(gs_font *pfont, gs_gstate *pgs, gs_show_enum *penum,
code = gs_gstate_color_load(pgs);
if (code < 0)
return code;
-
+
code = gx_image_fill_masked(dev, r, 0, dstr, gx_no_bitmap_id,
(int)dx, (int)dy,
rast->width, rast->height,
@@ -872,7 +872,7 @@ fapi_image_uncached_glyph(gs_font *pfont, gs_gstate *pgs, gs_show_enum *penum,
byte *bold_lines = NULL;
byte *line = NULL;
int ascent = 0;
-
+
pie = gs_image_enum_alloc(mem, "image_char(image_enum)");
if (!pie) {
return_error(gs_error_VMerror);
@@ -943,7 +943,7 @@ fapi_image_uncached_glyph(gs_font *pfont, gs_gstate *pgs, gs_show_enum *penum,
bits_merge(merged_line(y - kmask), merged_line(y - (kmask >> 1)), dest_bytes);
}
- }
+ }
/*
* As of this point in the loop, we maintain the following
@@ -1695,7 +1695,7 @@ gs_fapi_do_char(gs_font *pfont, gs_gstate *pgs, gs_text_enum_t *penum, char *fon
I->ff.fapi_set_cache(penum, pbfont, &enc_char_name_string, index,
sbw + 2, &char_bbox, sbwp, &imagenow);
}
-
+
/* If we can render the glyph now, do so.
* we may not be able to in the PS world if there's a CDevProc in the font
* in which case gs_fapi_finish_render() will be called from the PS
@@ -1746,12 +1746,12 @@ gs_fapi_passfont(gs_font *pfont, int subfont, char *font_file_path,
int code = 0;
gs_fapi_server *I, **list;
bool free_params = false;
- gs_memory_t *mem = pfont->memory;
+ gs_memory_t *mem = pfont->memory;
const char *decodingID = NULL;
bool do_restart = false;
-
+
list = gs_fapi_get_server_list(mem);
-
+
if (!list) /* Should never happen */
return_error(gs_error_unregistered);
diff --git a/base/gxfapi.h b/base/gxfapi.h
index a1a747b6..728630e6 100644
--- a/base/gxfapi.h
+++ b/base/gxfapi.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -334,9 +334,9 @@ struct gs_fapi_server_s
/* Used to use the stored 'OrigFont' entry but */
/* this did not change f a font was defined */
/* using an existing base font */
-
-
-
+
+
+
gs_fapi_retcode(*ensure_open) (gs_fapi_server *server, const char *param, int param_size);
gs_fapi_retcode(*get_scaled_font) (gs_fapi_server *server, gs_fapi_font *ff, const gs_fapi_font_scale *scale, const char *xlatmap, gs_fapi_descendant_code dc);
gs_fapi_retcode(*get_decodingID) (gs_fapi_server *server, gs_fapi_font *ff, const char **decodingID);
@@ -352,7 +352,7 @@ struct gs_fapi_server_s
gs_fapi_retcode(*get_char_outline_metrics) (gs_fapi_server *server, gs_fapi_font *ff, gs_fapi_char_ref *c, gs_fapi_metrics *metrics);
gs_fapi_retcode(*get_char_outline) (gs_fapi_server *server, gs_fapi_path *p);
gs_fapi_retcode(*release_char_data) (gs_fapi_server *server);
-
+
gs_fapi_retcode(*release_typeface) (gs_fapi_server *server, void *server_font_data);
gs_fapi_retcode(*check_cmap_for_GID) (gs_fapi_server *server, uint *index);
gs_fapi_retcode(*get_font_info) (gs_fapi_server *server, gs_fapi_font *ff, gs_fapi_font_info item, int index, void *data, int *datalen);
@@ -442,7 +442,7 @@ gs_fapi_do_char(gs_font *pfont, gs_gstate *pgs, gs_text_enum_t *penum, char *fon
* to hold the requested information - data == NULL, or data_len too
* small will see data_len set to the required amount, and an error
* returned.
- */
+ */
int
gs_fapi_get_font_info(gs_font *pfont, gs_fapi_font_info item, int index,
void *data, int *data_len);
diff --git a/base/gxfapiu.c b/base/gxfapiu.c
index 125b47f5..5268c6c2 100644
--- a/base/gxfapiu.c
+++ b/base/gxfapiu.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxfapiu.h b/base/gxfapiu.h
index 16117c29..69fd33bd 100644
--- a/base/gxfapiu.h
+++ b/base/gxfapiu.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxfarith.h b/base/gxfarith.h
index 7a3aefc3..e712b914 100644
--- a/base/gxfarith.h
+++ b/base/gxfarith.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxfcache.h b/base/gxfcache.h
index b265f2f3..4001cd7f 100644
--- a/base/gxfcache.h
+++ b/base/gxfcache.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -261,7 +261,7 @@ struct gs_font_dir_s {
/* User parameter GridFitTT. */
uint grid_fit_tt;
gx_device_spot_analyzer *san;
- int (*global_glyph_code)(const gs_memory_t *mem, gs_const_string *gstr, gs_glyph *pglyph);
+ int (*global_glyph_code)(const gs_font *pfont, gs_const_string *gstr, gs_glyph *pglyph);
ulong text_enum_id; /* debug purpose only. */
};
diff --git a/base/gxfcid.h b/base/gxfcid.h
index 5b42e3dc..bc95b3a0 100644
--- a/base/gxfcid.h
+++ b/base/gxfcid.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxfcmap.h b/base/gxfcmap.h
index 29c2b7a7..f7b815e9 100644
--- a/base/gxfcmap.h
+++ b/base/gxfcmap.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxfcmap1.h b/base/gxfcmap1.h
index 496a97c3..a0f6d562 100644
--- a/base/gxfcmap1.h
+++ b/base/gxfcmap1.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxfill.c b/base/gxfill.c
index bde98416..921c2baf 100644
--- a/base/gxfill.c
+++ b/base/gxfill.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxfill.h b/base/gxfill.h
index 4ca95cd3..c4616a09 100644
--- a/base/gxfill.h
+++ b/base/gxfill.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxfillsl.h b/base/gxfillsl.h
index c479d01b..5d7de3ec 100644
--- a/base/gxfillsl.h
+++ b/base/gxfillsl.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxfilltr.h b/base/gxfilltr.h
index 0ac779bf..e44176d1 100644
--- a/base/gxfilltr.h
+++ b/base/gxfilltr.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxfillts.h b/base/gxfillts.h
index e693415b..0104e6ea 100644
--- a/base/gxfillts.h
+++ b/base/gxfillts.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxfixed.h b/base/gxfixed.h
index 2049df03..d97f089b 100644
--- a/base/gxfixed.h
+++ b/base/gxfixed.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxfmap.h b/base/gxfmap.h
index 32d21955..d877ad5e 100644
--- a/base/gxfmap.h
+++ b/base/gxfmap.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxfont.h b/base/gxfont.h
index c277e0c1..c7a896eb 100644
--- a/base/gxfont.h
+++ b/base/gxfont.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxfont0.h b/base/gxfont0.h
index bd72fbd1..892554d1 100644
--- a/base/gxfont0.h
+++ b/base/gxfont0.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxfont0c.h b/base/gxfont0c.h
index f436e6b4..f8a4879d 100644
--- a/base/gxfont0c.h
+++ b/base/gxfont0c.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxfont1.h b/base/gxfont1.h
index 51a4ecf1..f22429a0 100644
--- a/base/gxfont1.h
+++ b/base/gxfont1.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxfont42.h b/base/gxfont42.h
index 5cacf809..26377784 100644
--- a/base/gxfont42.h
+++ b/base/gxfont42.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxfrac.h b/base/gxfrac.h
index 4af9cecc..6bbdcf75 100644
--- a/base/gxfrac.h
+++ b/base/gxfrac.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxftype.h b/base/gxftype.h
index 10d73275..55f618f0 100644
--- a/base/gxftype.h
+++ b/base/gxftype.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxfunc.h b/base/gxfunc.h
index eea2e8d9..fb715f56 100644
--- a/base/gxfunc.h
+++ b/base/gxfunc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxgetbit.h b/base/gxgetbit.h
index 54b13d1a..ea3e1afa 100644
--- a/base/gxgetbit.h
+++ b/base/gxgetbit.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxgstate.h b/base/gxgstate.h
index 2ab96a3f..a6309d89 100644
--- a/base/gxgstate.h
+++ b/base/gxgstate.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -42,6 +42,7 @@
#include "gsccolor.h"
#include "gsht1.h"
#include "gxclipsr.h"
+#include "gsicc_blacktext.h"
/*
@@ -201,7 +202,9 @@ typedef struct gs_xstate_trans_flags {
#define gs_currentdevicecolor_inline(pgs) ((pgs)->color[0].dev_color)
#define gs_currentcolor_inline(pgs) ((pgs)->color[0].ccolor)
#define gs_currentcolorspace_inline(pgs) ((pgs)->color[0].color_space)
-#define gs_altdevicecolor_inline(pgs) ((pgs)->color[1].dev_color)
+#define gs_swappeddevicecolor_inline(pgs) ((pgs)->color[1].dev_color)
+#define gs_swappedcolor_inline(pgs) ((pgs)->color[1].ccolor)
+#define gs_swappedcolorspace_inline(pgs) ((pgs)->color[1].color_space)
#define gs_currentcolor_eopm(pgs) ((pgs)->color[0].effective_opm)
#define char_tm_only(pgs) *(gs_matrix *)&(pgs)->char_tm
@@ -261,6 +264,8 @@ struct gs_gstate_s {
gsicc_manager_t *icc_manager; /* ICC color manager, profile */
gsicc_link_cache_t *icc_link_cache; /* ICC linked transforms */
gsicc_profile_cache_t *icc_profile_cache; /* ICC profiles from PS. */
+ gsicc_blacktext_state_t *black_text_state; /* Used to store and restore cs for black text */
+
CUSTOM_COLOR_PTR /* Pointer to custom color callback struct */
const gx_color_map_procs *
(*get_cmap_procs)(const gs_gstate *, const gx_device *);
@@ -326,7 +331,7 @@ struct gs_gstate_s {
lop_default, BLEND_MODE_Compatible,\
{0, 0}, 0, 1/*true*/, 0, 0/*false*/, 0, 0/*false*/, 0, 0/*false*/, 1.0, \
{ fixed_half, fixed_half }, 0/*false*/, 1/*true*/, 0/*false*/, (float)0.02,\
- 1, 1/* bpt true */, 0, 0, 0, INIT_CUSTOM_COLOR_PTR /* 'Custom color' callback pointer */ \
+ 1, 1/* bpt true */, 0, 0, 0, 0, INIT_CUSTOM_COLOR_PTR /* 'Custom color' callback pointer */ \
gx_default_get_cmap_procs
#define GS_STATE_INIT_VALUES(s, scale) \
@@ -364,6 +369,7 @@ struct gs_gstate_s {
s->icc_link_cache = __state_init.icc_link_cache; \
s->icc_profile_cache = __state_init.icc_profile_cache; \
s->get_cmap_procs = __state_init.get_cmap_procs; \
+ s->black_text_state = NULL; \
s->show_gstate = NULL; \
s->is_fill_color = 1; \
s->strokeconstantalpha = 1.0; \
@@ -406,9 +412,10 @@ struct_proc_finalize(gs_gstate_finalize);
m(16, color[1].dev_color)\
m(17, font) \
m(18, root_font) \
- m(19, show_gstate)
+ m(19, show_gstate) \
+ m(20, black_text_state)
-#define gs_gstate_num_ptrs 20
+#define gs_gstate_num_ptrs 21
/* The '+1' in the following is because gs_gstate.device
* is handled specially
@@ -430,7 +437,6 @@ void gs_gstate_pre_assign(gs_gstate *to, const gs_gstate *from);
void gs_gstate_release(gs_gstate * pgs);
int gs_currentscreenphase_pgs(const gs_gstate *, gs_int_point *, gs_color_select_t);
-
/* The following macro is used for development purpose for designating places
where current point is changed. Clients must not use it. */
#define gx_setcurrentpoint(pgs, xx, yy)\
diff --git a/base/gxhintn.c b/base/gxhintn.c
index 30847bcb..2b91c3f7 100644
--- a/base/gxhintn.c
+++ b/base/gxhintn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxhintn.h b/base/gxhintn.h
index 115c7582..72a1f262 100644
--- a/base/gxhintn.h
+++ b/base/gxhintn.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxhintn1.c b/base/gxhintn1.c
index ad579893..1c7d5074 100644
--- a/base/gxhintn1.c
+++ b/base/gxhintn1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxhldevc.c b/base/gxhldevc.c
index 9060590e..9188a029 100644
--- a/base/gxhldevc.c
+++ b/base/gxhldevc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxhldevc.h b/base/gxhldevc.h
index 60b275c0..bfe28426 100644
--- a/base/gxhldevc.h
+++ b/base/gxhldevc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxht.c b/base/gxht.c
index 77ea765a..aeb23362 100644
--- a/base/gxht.c
+++ b/base/gxht.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxht.h b/base/gxht.h
index f2b33f0d..b2743a5a 100644
--- a/base/gxht.h
+++ b/base/gxht.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxht_thresh.c b/base/gxht_thresh.c
index eb4d6edb..348307ec 100644
--- a/base/gxht_thresh.c
+++ b/base/gxht_thresh.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxht_thresh.h b/base/gxht_thresh.h
index 3ac7eab9..4c7028a7 100644
--- a/base/gxht_thresh.h
+++ b/base/gxht_thresh.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxhtbit.c b/base/gxhtbit.c
index 6cb6fdcb..243583e7 100644
--- a/base/gxhtbit.c
+++ b/base/gxhtbit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -25,6 +25,9 @@
#include "gxtmap.h"
#include "gxdht.h"
#include "gxdhtres.h"
+#include "gp.h"
+
+#define DUMP_TOS 0
extern_gx_device_halftone_list();
@@ -75,7 +78,6 @@ construct_ht_order_short(gx_ht_order *porder, const byte *thresholds)
for (i = 0; i < size; i++) {
uint value = max(1, thresholds[i]);
- /* Adjust the bit index to account for padding. */
bits[levels[value]++] = i + (i / width * padding);
}
}
@@ -114,10 +116,101 @@ construct_ht_order_short(gx_ht_order *porder, const byte *thresholds)
}
}
}
+#if DUMP_TOS
+/* Lets look at the bit data which is the TOS level by level if I understand what the above
+ code is supposed to be doing */
+ {
+ char file_name[50];
+ gp_file *fid;
+
+ snprintf(file_name, 50, "TOS_porder_%dx%d.raw", porder->width, porder->height);
+ fid = gp_fopen(porder->data_memory, file_name, "wb");
+ if (fid) {
+ gp_fwrite(porder->bit_data, sizeof(unsigned short), size, fid);
+ gp_fclose(fid);
+ }
+ }
+#endif
+
out:
return 0;
}
+/*
+ * Construct a uint-representation order from a threshold array.
+ * Uses porder->width, num_levels, num_bits, levels, bit_data;
+ * sets porder->levels[], bit_data[].
+ */
+static int
+construct_ht_order_uint(gx_ht_order *porder, const byte *thresholds)
+{
+ uint size = porder->num_bits;
+ uint i;
+ uint *bits = (uint *)porder->bit_data;
+ uint *levels = porder->levels;
+ uint num_levels = porder->num_levels;
+
+ memset(levels, 0, num_levels * sizeof(*levels));
+
+ /* Count the number of threshold elements with each value. */
+ for (i = 0; i < size; i++) {
+ uint value = max(1, thresholds[i]);
+
+ if (value + 1 < num_levels)
+ levels[value + 1]++;
+ }
+ for (i = 2; i < num_levels; ++i)
+ levels[i] += levels[i - 1];
+ /* Now construct the actual order. */
+ {
+ uint width = porder->width;
+ uint padding = bitmap_raster(width) * 8 - width;
+
+ for (i = 0; i < size; i++) {
+ uint value = max(1, thresholds[i]);
+
+ bits[levels[value]++] = i + (i / width * padding);
+ }
+ }
+
+ /* Check whether this is a predefined halftone. */
+ {
+ const gx_dht_proc *phtrp = gx_device_halftone_list;
+
+ for (; *phtrp; ++phtrp) {
+ const gx_device_halftone_resource_t *const *pphtr = (*phtrp)();
+ const gx_device_halftone_resource_t *phtr;
+
+ while ((phtr = *pphtr++) != 0) {
+ if (phtr->Width == porder->width &&
+ phtr->Height == porder->height &&
+ phtr->elt_size == sizeof(uint) &&
+ !memcmp(phtr->levels, levels, num_levels * sizeof(*levels)) &&
+ !memcmp(phtr->bit_data, porder->bit_data,
+ (size_t)size * phtr->elt_size)
+ ) {
+ /*
+ * This is a predefined halftone. Free the levels and
+ * bit_data arrays, replacing them with the built-in ones.
+ */
+ if (porder->data_memory) {
+ gs_free_object(porder->data_memory, porder->bit_data,
+ "construct_ht_order_uint(bit_data)");
+ gs_free_object(porder->data_memory, porder->levels,
+ "construct_ht_order_uint(levels)");
+ }
+ porder->data_memory = 0;
+ porder->levels = (uint *)phtr->levels; /* actually const */
+ porder->bit_data = (void *)phtr->bit_data; /* actually const */
+ goto out;
+ }
+ }
+ }
+ }
+out:
+ return 0;
+}
+
/* Return the bit coordinate using the standard representation. */
static int
ht_bit_index_default(const gx_ht_order *porder, uint index, gs_int_point *ppt)
@@ -145,6 +238,18 @@ ht_bit_index_short(const gx_ht_order *porder, uint index, gs_int_point *ppt)
return 0;
}
+/* Return the bit coordinate using the uint representation. */
+static int
+ht_bit_index_uint(const gx_ht_order *porder, uint index, gs_int_point *ppt)
+{
+ uint bit_index = ((const uint *)porder->bit_data)[index];
+ uint bit_raster = porder->raster * 8;
+
+ ppt->x = bit_index % bit_raster;
+ ppt->y = bit_index / bit_raster;
+ return 0;
+}
+
/* Update a halftone tile using the default order representation. */
static int
render_ht_default(gx_ht_tile *pbt, int level, const gx_ht_order *porder)
@@ -264,10 +369,70 @@ render_ht_short(gx_ht_tile *pbt, int level, const gx_ht_order *porder)
return 0;
}
+/* Update a halftone tile using the uint representation. */
+static int
+render_ht_uint(gx_ht_tile *pbt, int level, const gx_ht_order *porder)
+{
+ int old_level = pbt->level;
+ register const uint *p = (const uint *)porder->bit_data + old_level;
+ register byte *data = pbt->tiles.data;
+
+ /* Invert bits between the two levels. */
+#define INVERT_DATA(i)\
+ BEGIN\
+ uint bit_index = p[i];\
+ byte *dp = &data[bit_index >> 3];\
+ *dp ^= 0x80 >> (bit_index & 7);\
+ END
+#ifdef DEBUG
+# define INVERT(i)\
+ BEGIN\
+ if_debug3('H', "[H]invert level=%d offset=%u mask=0x%x\n",\
+ (int)(p + i - (const uint *)porder->bit_data),\
+ p[i] >> 3, 0x80 >> (p[i] & 7));\
+ INVERT_DATA(i);\
+ END
+#else
+# define INVERT(i) INVERT_DATA(i)
+#endif
+sw:switch (level - old_level) {
+default:
+ if (level > old_level) {
+ INVERT(0); INVERT(1); INVERT(2); INVERT(3);
+ p += 4; old_level += 4;
+ }
+ else {
+ INVERT(-1); INVERT(-2); INVERT(-3); INVERT(-4);
+ p -= 4; old_level -= 4;
+ }
+ goto sw;
+case 7: INVERT(6);
+case 6: INVERT(5);
+case 5: INVERT(4);
+case 4: INVERT(3);
+case 3: INVERT(2);
+case 2: INVERT(1);
+case 1: INVERT(0);
+case 0: break; /* Shouldn't happen! */
+case -7: INVERT(-7);
+case -6: INVERT(-6);
+case -5: INVERT(-5);
+case -4: INVERT(-4);
+case -3: INVERT(-3);
+case -2: INVERT(-2);
+case -1: INVERT(-1);
+}
+#undef INVERT_DATA
+#undef INVERT
+return 0;
+}
+
/* Define the procedure vectors for the order data implementations. */
-const gx_ht_order_procs_t ht_order_procs_table[2] = {
+const gx_ht_order_procs_t ht_order_procs_table[3] = {
{ sizeof(gx_ht_bit), construct_ht_order_default, ht_bit_index_default,
render_ht_default },
{ sizeof(ushort), construct_ht_order_short, ht_bit_index_short,
- render_ht_short }
+ render_ht_short },
+ { sizeof(uint), construct_ht_order_uint, ht_bit_index_uint,
+ render_ht_uint }
};
diff --git a/base/gxhttile.h b/base/gxhttile.h
index 6558784a..8c053921 100644
--- a/base/gxhttile.h
+++ b/base/gxhttile.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxhttype.h b/base/gxhttype.h
index d6605aeb..9a2c4f63 100644
--- a/base/gxhttype.h
+++ b/base/gxhttype.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxi12bit.c b/base/gxi12bit.c
index fdf56fb1..441e4a7e 100644
--- a/base/gxi12bit.c
+++ b/base/gxi12bit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -666,19 +666,23 @@ image_render_icc16(gx_image_enum * penum, const byte * buffer, int data_x,
(const unsigned short*) (psrc_decode+w),
get_cie_range(penum->pcs));
}
- (penum->icc_link->procs.map_buffer)(dev, penum->icc_link,
+ code = (penum->icc_link->procs.map_buffer)(dev, penum->icc_link,
&input_buff_desc,
&output_buff_desc,
(void*) psrc_decode,
(void*) psrc_cm);
gs_free_object(pgs->memory, (byte *)psrc_decode, "image_render_color_icc");
+ if (code < 0)
+ return code;
} else {
/* CM only. No decode */
- (penum->icc_link->procs.map_buffer)(dev, penum->icc_link,
+ code = (penum->icc_link->procs.map_buffer)(dev, penum->icc_link,
&input_buff_desc,
&output_buff_desc,
(void*) psrc,
(void*) psrc_cm);
+ if (code < 0)
+ return code;
}
}
}
diff --git a/base/gxi16bit.c b/base/gxi16bit.c
index 7d2f7da3..300a2fdb 100644
--- a/base/gxi16bit.c
+++ b/base/gxi16bit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxiclass.h b/base/gxiclass.h
index 89721ae9..0db93784 100644
--- a/base/gxiclass.h
+++ b/base/gxiclass.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxicolor.c b/base/gxicolor.c
index 58ead88a..05820695 100644
--- a/base/gxicolor.c
+++ b/base/gxicolor.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -566,19 +566,23 @@ image_color_icc_prep(gx_image_enum *penum_orig, const byte *psrc, uint w,
decode_row_cie(penum, psrc, spp, psrc_decode,
psrc_decode+w, get_cie_range(penum->pcs));
}
- (penum->icc_link->procs.map_buffer)(dev, penum->icc_link,
+ code = (penum->icc_link->procs.map_buffer)(dev, penum->icc_link,
&input_buff_desc,
&output_buff_desc,
(void*) psrc_decode,
(void*) *psrc_cm);
gs_free_object(pgs->memory, psrc_decode, "image_color_icc_prep");
+ if (code < 0)
+ return code;
} else {
/* CM only. No decode */
- (penum->icc_link->procs.map_buffer)(dev, penum->icc_link,
+ code = (penum->icc_link->procs.map_buffer)(dev, penum->icc_link,
&input_buff_desc,
&output_buff_desc,
(void*) psrc,
(void*) *psrc_cm);
+ if (code < 0)
+ return code;
}
}
}
@@ -1134,6 +1138,14 @@ image_render_color_DeviceN(gx_image_enum *penum_orig, const byte *buffer, int da
bits32 test = penum->mask_color.test;
bool lab_case = false;
+ if (device_encodes_tags(dev)) {
+ devc1.tag = (dev->graphics_type_tag & ~GS_DEVICE_ENCODES_TAGS);
+ devc2.tag = (dev->graphics_type_tag & ~GS_DEVICE_ENCODES_TAGS);
+ } else {
+ devc1.tag = 0;
+ devc2.tag = 0;
+ }
+
if (h == 0)
return 0;
diff --git a/base/gxidata.c b/base/gxidata.c
index 857d314d..8ce26a07 100644
--- a/base/gxidata.c
+++ b/base/gxidata.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -208,7 +208,7 @@ gx_image1_plane_data(gx_image_enum_common_t * info,
dmprintf1(dev->memory, "[b]image1 y=%d\n", y);
if (gs_debug_c('B')) {
int i, n = width_spp;
- byte *buftemp = (buffer == NULL) ? penum->buffer : buffer;
+ byte *buftemp = (buffer == NULL) ? penum->buffer : (byte *)buffer;
if (penum->bps > 8)
n *= 2;
@@ -521,6 +521,11 @@ gx_image1_end_image(gx_image_enum_common_t * info, bool draw_last)
if (penum->clues != NULL) {
gs_free_object(mem,penum->clues, "image clues");
}
+
+ /* decrement this ref that was incremented in gx_image_enum_begin() */
+ rc_decrement_only(penum->pcs, "pcs");
+ penum->pcs = NULL;
+
gs_free_object(mem, penum->line, "image line");
gs_free_object(mem, penum->buffer, "image buffer");
diff --git a/base/gxifast.c b/base/gxifast.c
index 97188230..b93c5861 100644
--- a/base/gxifast.c
+++ b/base/gxifast.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -507,7 +507,11 @@ sw: if ((data = psrc[1]) != 0) {
break;
}
end:
+ {
+#ifdef PACIFY_VALGRIND
VALGRIND_SET_VBITS(stop,&vbits,1);
+#endif
+ }
}
/* Copy one rendered scan line to the device. */
diff --git a/base/gximag3x.c b/base/gximag3x.c
index 1c39b487..3e6b4009 100644
--- a/base/gximag3x.c
+++ b/base/gximag3x.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -144,6 +144,7 @@ gx_begin_image3x_generic(gx_device * dev,
gs_int_point origin[2];
int code;
int i;
+ gs_color_space *pmcs = NULL;
/* Validate the parameters. */
if (pim->Height <= 0)
@@ -207,9 +208,6 @@ gx_begin_image3x_generic(gx_device * dev,
* The mask data has to be defined in a DevicePixel color space
* of the correct depth so that no color mapping will occur.
*/
- /****** FREE COLOR SPACE ON ERROR OR AT END ******/
- gs_color_space *pmcs;
-
if (penum->mask[i].depth == 0) { /* mask not supplied */
midev[i] = 0;
minfo[i] = 0;
@@ -217,19 +215,19 @@ gx_begin_image3x_generic(gx_device * dev,
}
code = gs_cspace_new_DevicePixel(mem, &pmcs, penum->mask[i].depth);
if (code < 0)
- return code;
+ goto out1;
mrect.p.x = mrect.p.y = 0;
mrect.q.x = penum->mask[i].width;
mrect.q.y = penum->mask[i].height;
if ((code = gs_matrix_multiply(&mask[i].matrix, pmat, &mat)) < 0 ||
(code = gs_bbox_transform(&mrect, &mat, &mrect)) < 0
)
- return code;
+ goto out1;
/* Bug 700438: If the rectangle is out of range, bail */
if (mrect.p.x >= (double)INT_MAX || mrect.q.x <= (double)INT_MIN ||
mrect.p.y >= (double)INT_MAX || mrect.q.y <= (double)INT_MIN) {
- code = gs_note_error(gs_error_rangecheck);
+ code = gs_note_error(gs_error_rangecheck);
goto out1;
}
@@ -292,6 +290,8 @@ gx_begin_image3x_generic(gx_device * dev,
}
midev[i] = mdev;
minfo[i] = penum->mask[i].info;
+ rc_decrement_only(pmcs, "gx_begin_image3x_generic(pmcs)");
+ pmcs = NULL;
}
gs_image_t_init(&pixel.image, pim->ColorSpace);
{
@@ -365,6 +365,7 @@ gx_begin_image3x_generic(gx_device * dev,
"gx_begin_image3x(mask[0].mdev)");
}
out1:
+ rc_decrement(pmcs, "gx_begin_image3x_generic(pmcs)");
gs_free_object(mem, penum->mask[0].data, "gx_begin_image3x(mask[0].data)");
gs_free_object(mem, penum->mask[1].data, "gx_begin_image3x(mask[1].data)");
gs_free_object(mem, penum->pixel.data, "gx_begin_image3x(pixel.data)");
diff --git a/base/gximag3x.h b/base/gximag3x.h
index 989c80a9..865740d7 100644
--- a/base/gximag3x.h
+++ b/base/gximag3x.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gximage.c b/base/gximage.c
index 74456b47..1d97ac26 100644
--- a/base/gximage.c
+++ b/base/gximage.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gximage.h b/base/gximage.h
index ae492d29..189508f0 100644
--- a/base/gximage.h
+++ b/base/gximage.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -216,7 +216,7 @@ struct gx_image_enum_s {
irender_proc((*render));
int (*skip_next_line)(gx_image_enum *penum, gx_device *dev);
const gs_gstate *pgs;
- const gs_color_space *pcs; /* color space of image */
+ gs_color_space *pcs; /* color space of image */
byte *buffer; /* for expanding samples to a */
/* byte or frac */
uint buffer_size;
diff --git a/base/gximage1.c b/base/gximage1.c
index a008fb54..787fb4a1 100644
--- a/base/gximage1.c
+++ b/base/gximage1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gximage3.c b/base/gximage3.c
index 522c71ff..9fd47798 100644
--- a/base/gximage3.c
+++ b/base/gximage3.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -368,7 +368,10 @@ gx_begin_image3_generic(gx_device * dev,
/* Bug 700438: If the rectangle is out of range, bail */
if (mrect.p.x >= (double)INT_MAX || mrect.q.x <= (double)INT_MIN ||
- mrect.p.y >= (double)INT_MAX || mrect.q.y <= (double)INT_MIN) {
+ mrect.p.y >= (double)INT_MAX || mrect.q.y <= (double)INT_MIN ||
+ mrect.p.x <= (double)INT_MIN || mrect.q.x >= (double)INT_MAX ||
+ mrect.p.y <= (double)INT_MIN || mrect.q.y >= (double)INT_MAX
+ ) {
code = gs_note_error(gs_error_rangecheck);
goto out1;
}
diff --git a/base/gximage3.h b/base/gximage3.h
index dac31c3b..1c7a0e6c 100644
--- a/base/gximage3.h
+++ b/base/gximage3.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gximage4.c b/base/gximage4.c
index 4bd9ddb2..1a3a4761 100644
--- a/base/gximage4.c
+++ b/base/gximage4.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gximask.c b/base/gximask.c
index d1c155b7..166ee4ba 100644
--- a/base/gximask.c
+++ b/base/gximask.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gximask.h b/base/gximask.h
index 58807e64..00434e68 100644
--- a/base/gximask.h
+++ b/base/gximask.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gximdecode.c b/base/gximdecode.c
index b41de6a0..e24c6c06 100644
--- a/base/gximdecode.c
+++ b/base/gximdecode.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2020 Artifex Software, Inc.
+/* Copyright (C) 2014-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -22,7 +22,7 @@ monitoring in clist and for creating TIFF files for xpswrite device */
/* We need to have the unpacking proc so that we can monitor the data for color
or decode during xpswrite */
void
-get_unpack_proc(gx_image_enum_common_t *pie, image_decode_t *imd,
+get_unpack_proc(gx_image_enum_common_t *pie, image_decode_t *imd,
gs_image_format_t format, const float *decode) {
static sample_unpack_proc_t procs[2][6] = {
diff --git a/base/gximdecode.h b/base/gximdecode.h
index 2a21d973..d2ea23e7 100644
--- a/base/gximdecode.h
+++ b/base/gximdecode.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2018 Artifex Software, Inc.
+/* Copyright (C) 2014-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gximono.c b/base/gximono.c
index 77fa700e..659a6ccb 100644
--- a/base/gximono.c
+++ b/base/gximono.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -400,6 +400,7 @@ image_render_mono(gx_image_enum * penum, const byte * buffer, int data_x,
code = (*remap_color)(&cc, pcs, pdevc, pgs, dev, gs_color_select_source);\
if (code < 0)\
goto err;\
+ pdevc->tag = (dev->graphics_type_tag & ~GS_DEVICE_ENCODES_TAGS);\
}\
} else if (!color_is_pure(pdevc)) {\
code = gx_color_load_select(pdevc, pgs, dev, gs_color_select_source);\
diff --git a/base/gxiodev.h b/base/gxiodev.h
index 704ab9ac..f33d8b61 100644
--- a/base/gxiodev.h
+++ b/base/gxiodev.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxiparam.h b/base/gxiparam.h
index 8d6083fb..0336ca8a 100644
--- a/base/gxiparam.h
+++ b/base/gxiparam.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxipixel.c b/base/gxipixel.c
index c6057577..2f367e14 100644
--- a/base/gxipixel.c
+++ b/base/gxipixel.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -270,7 +270,7 @@ gx_image_enum_begin(gx_device * dev, const gs_gstate * pgs,
const float *decode = pim->Decode;
gs_matrix_double mat;
int index_bps;
- const gs_color_space *pcs = pim->ColorSpace;
+ gs_color_space *pcs = pim->ColorSpace;
gs_logical_operation_t lop = (pgs ? pgs->log_op : lop_default);
int code;
int log2_xbytes = (bps <= 8 ? 0 : arch_log2_sizeof_frac);
@@ -630,6 +630,9 @@ gx_image_enum_begin(gx_device * dev, const gs_gstate * pgs,
penum->icolor0 = &(penum->icolor0_val);
penum->icolor1 = &(penum->icolor1_val);
}
+ penum->icolor0->tag = (dev->graphics_type_tag & ~GS_DEVICE_ENCODES_TAGS);
+ penum->icolor1->tag = (dev->graphics_type_tag & ~GS_DEVICE_ENCODES_TAGS);
+
if (masked) { /* This is imagemask. */
if (bps != 1 || pcs != NULL || penum->alpha || decode[0] == decode[1]) {
code = gs_error_rangecheck;
@@ -806,6 +809,7 @@ gx_image_enum_begin(gx_device * dev, const gs_gstate * pgs,
image_skewed);
penum->pgs = pgs;
penum->pcs = pcs;
+ rc_increment_cs(pcs); /* Grab a ref (will decrement in gx_image1_end_image() */
penum->memory = mem;
penum->buffer = buffer;
penum->buffer_size = bsize;
@@ -1100,11 +1104,11 @@ decode_range_needed(gx_image_enum *penum)
bool scale = true;
if (penum->map[0].decoding == sd_compute) {
- if (!(gs_color_space_is_ICC(penum->pcs) ||
+ if (!(gs_color_space_is_ICC(penum->pcs) ||
gs_color_space_is_PSCIE(penum->pcs))) {
scale = false;
- }
- }
+ }
+ }
return scale;
}
@@ -1133,6 +1137,7 @@ image_init_color_cache(gx_image_enum * penum, int bps, int spp)
gsicc_bufferdesc_t input_buff_desc;
gsicc_bufferdesc_t output_buff_desc;
gx_color_value conc[GX_DEVICE_COLOR_MAX_COMPONENTS];
+ int code;
if (penum->icc_link == NULL) {
return gs_rethrow(-1, "ICC Link not created during image render color");
@@ -1265,10 +1270,13 @@ image_init_color_cache(gx_image_enum * penum, int bps, int spp)
gsicc_init_buffer(&output_buff_desc, num_des_comp, 1, false, false, false,
0, num_entries * num_des_comp,
1, num_entries);
- (penum->icc_link->procs.map_buffer)(penum->dev, penum->icc_link,
- &input_buff_desc, &output_buff_desc,
+ code = (penum->icc_link->procs.map_buffer)(penum->dev, penum->icc_link,
+ &input_buff_desc, &output_buff_desc,
(void*) temp_buffer,
(void*) penum->color_cache->device_contone);
+ if (code < 0)
+ return gs_rethrow(code, "Failure to map color buffer");
+
/* Check if we need to apply any transfer functions. If so then do it now */
if (has_transfer) {
for (k = 0; k < num_entries; k++) {
@@ -1439,12 +1447,12 @@ image_init_colors(gx_image_enum * penum, int bps, int spp,
cc.paint.values[0] = real_decode[0];
code = (*pcs->type->remap_color) (&cc, pcs, penum->icolor0,
pgs, dev, gs_color_select_source);
- if (code < 0)
+ if (code < 0)
return code;
cc.paint.values[0] = real_decode[1];
code = (*pcs->type->remap_color) (&cc, pcs, penum->icolor1,
pgs, dev, gs_color_select_source);
- if (code < 0)
+ if (code < 0)
return code;
}
}
diff --git a/base/gxiscale.c b/base/gxiscale.c
index 83427431..7cd34f9b 100644
--- a/base/gxiscale.c
+++ b/base/gxiscale.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -145,10 +145,13 @@ static int mask_suitable_for_interpolation(gx_image_enum *penum)
int code;
int high_level_color = 1;
- if (gx_device_must_halftone(penum->dev)) {
+ if (gx_device_must_halftone(penum->dev))
/* We don't interpolate when going to 1bpp outputs */
return -1;
- } else if (gx_dc_is_pure(pdc1) && (pdc1)->colors.pure != gx_no_color_index &&
+ if (dev_proc(penum->dev, dev_spec_op)(penum->dev, gxdso_copy_alpha_disabled, NULL, 0) == 1)
+ /* The target device has copy_alpha() disabled. */
+ return -1;
+ if (gx_dc_is_pure(pdc1) && (pdc1)->colors.pure != gx_no_color_index &&
dev_proc(penum->dev, copy_alpha) != NULL &&
dev_proc(penum->dev, copy_alpha) != gx_no_copy_alpha) {
/* We have a 'pure' color, and a valid copy_alpha. We can work with that. */
@@ -173,6 +176,19 @@ static int mask_suitable_for_interpolation(gx_image_enum *penum)
return high_level_color;
}
+/*
+ Helper function to take an int64_t, and "fixed2int_pixround_perfect"
+ it while testing for overflow.
+*/
+static int
+safe64fixed2int(int64_t v, int *overflow)
+{
+ if (v > (int)((1U<<(sizeof(int)*8-1))-128) ||
+ v < 0)
+ *overflow = 1;
+ return fixed2int_pixround_perfect(v);
+}
+
int
gs_image_class_0_interpolate(gx_image_enum * penum, irender_proc_t *render_fn)
{
@@ -192,6 +208,7 @@ gs_image_class_0_interpolate(gx_image_enum * penum, irender_proc_t *render_fn)
int interpolate_control = penum->dev->interpolate_control;
int abs_interp_limit = max(1, any_abs(interpolate_control));
int limited_WidthOut, limited_HeightOut;
+ int overflow = 0;
if (interpolate_control < 0)
penum->interpolate = interp_on; /* not the same as "interp_force" -- threshold still used */
@@ -275,6 +292,7 @@ gs_image_class_0_interpolate(gx_image_enum * penum, irender_proc_t *render_fn)
if(!gx_device_uses_std_cmap_procs(penum->dev, penum->pgs)) {
use_icc = false;
}
+ pol = cs_polarity(pcs);
}
/*
* USE_CONSERVATIVE_INTERPOLATION_RULES is normally NOT defined since
@@ -317,64 +335,63 @@ gs_image_class_0_interpolate(gx_image_enum * penum, irender_proc_t *render_fn)
if (penum->posture == image_portrait) {
fixed dw = any_abs(penum->dst_width);
fixed dh = any_abs(penum->dst_height);
- iss.WidthOut = fixed2int_pixround_perfect((fixed)((int64_t)(penum->rect.x + penum->rect.w) *
- dw / penum->Width))
- - fixed2int_pixround_perfect((fixed)((int64_t)penum->rect.x *
- dw / penum->Width));
- iss.HeightOut = fixed2int_pixround_perfect((fixed)((int64_t)(penum->rect.y + penum->rect.h) *
- dh / penum->Height))
- - fixed2int_pixround_perfect((fixed)((int64_t)penum->rect.y *
- dh / penum->Height));
- iss.EntireWidthOut = fixed2int_pixround(dw);
- iss.EntireHeightOut = fixed2int_pixround(dh);
- iss.TopMarginOut = fixed2int_pixround_perfect((fixed)((int64_t)(penum->rrect.y - penum->rect.y) *
- dh / penum->Height));
- iss.PatchHeightOut = fixed2int_pixround_perfect((fixed)((int64_t)penum->rrect.h *
- dh / penum->Height))
+ iss.WidthOut = safe64fixed2int((int64_t)(penum->rect.x + penum->rect.w) *
+ dw / penum->Width, &overflow)
+ - safe64fixed2int((int64_t)penum->rect.x *
+ dw / penum->Width, &overflow);
+ iss.HeightOut = safe64fixed2int((int64_t)(penum->rect.y + penum->rect.h) *
+ dh / penum->Height, &overflow)
+ - safe64fixed2int((int64_t)penum->rect.y *
+ dh / penum->Height, &overflow);
+ iss.EntireWidthOut = safe64fixed2int(dw, &overflow);
+ iss.EntireHeightOut = safe64fixed2int(dh, &overflow);
+ iss.TopMarginOut = safe64fixed2int((int64_t)(penum->rrect.y - penum->rect.y) *
+ dh / penum->Height, &overflow);
+ iss.PatchHeightOut = safe64fixed2int((int64_t)penum->rrect.h *
+ dh / penum->Height, &overflow)
- iss.TopMarginOut;
- iss.PatchWidthOut = fixed2int_pixround_perfect((fixed)((int64_t)(penum->rrect.x + penum->rrect.w) *
- dw / penum->Width))
- - fixed2int_pixround_perfect((fixed)((int64_t)penum->rrect.x *
- dw / penum->Width));
- iss.LeftMarginOut = fixed2int_pixround_perfect((fixed)((int64_t)(penum->rrect.x - penum->rect.x) *
- dw / penum->Width));
- iss.TopMarginOut2 = fixed2int_pixround_perfect((fixed)((int64_t)penum->rrect.y *
- dh / penum->Height));
- iss.PatchHeightOut2 = fixed2int_pixround_perfect((fixed)((int64_t)(penum->rrect.y + penum->rrect.h) *
- dh / penum->Height))
+ iss.PatchWidthOut = safe64fixed2int((int64_t)(penum->rrect.x + penum->rrect.w) *
+ dw / penum->Width, &overflow)
+ - safe64fixed2int((int64_t)penum->rrect.x *
+ dw / penum->Width, &overflow);
+ iss.LeftMarginOut = safe64fixed2int((int64_t)(penum->rrect.x - penum->rect.x) *
+ dw / penum->Width, &overflow);
+ iss.TopMarginOut2 = safe64fixed2int((int64_t)penum->rrect.y *
+ dh / penum->Height, &overflow);
+ iss.PatchHeightOut2 = safe64fixed2int((int64_t)(penum->rrect.y + penum->rrect.h) *
+ dh / penum->Height, &overflow)
- iss.TopMarginOut2;
iss.pad_y = iss.TopMarginOut2
- - fixed2int_pixround_perfect(
- (fixed)((int64_t)penum->rect.y *
- dh / penum->Height));
+ - safe64fixed2int((int64_t)penum->rect.y *
+ dh / penum->Height, &overflow);
} else {
fixed dw = any_abs(penum->dst_width);
fixed dh = any_abs(penum->dst_height);
- iss.WidthOut = fixed2int_pixround_perfect((fixed)((int64_t)(penum->rect.x + penum->rect.w) *
- dh / penum->Width))
- - fixed2int_pixround_perfect((fixed)((int64_t)penum->rect.x *
- dh / penum->Width));
- iss.HeightOut = fixed2int_pixround_perfect((fixed)((int64_t)(penum->rect.y + penum->rect.h) *
- dw / penum->Height))
- - fixed2int_pixround_perfect((fixed)((int64_t)penum->rect.y *
- dw / penum->Height));
- iss.EntireWidthOut = fixed2int_pixround(dh);
- iss.EntireHeightOut = fixed2int_pixround(dw);
- iss.TopMarginOut = fixed2int_pixround_perfect((fixed)((int64_t)(penum->rrect.y - penum->rect.y) *
- dw / penum->Height));
- iss.PatchHeightOut = fixed2int_pixround_perfect((fixed)((int64_t)penum->rrect.h *
- dw / penum->Height))
+ iss.WidthOut = safe64fixed2int((int64_t)(penum->rect.x + penum->rect.w) *
+ dh / penum->Width, &overflow)
+ - safe64fixed2int((int64_t)penum->rect.x *
+ dh / penum->Width, &overflow);
+ iss.HeightOut = safe64fixed2int((int64_t)(penum->rect.y + penum->rect.h) *
+ dw / penum->Height, &overflow)
+ - safe64fixed2int((int64_t)penum->rect.y *
+ dw / penum->Height, &overflow);
+ iss.EntireWidthOut = safe64fixed2int(dh, &overflow);
+ iss.EntireHeightOut = safe64fixed2int(dw, &overflow);
+ iss.TopMarginOut = safe64fixed2int((int64_t)(penum->rrect.y - penum->rect.y) *
+ dw / penum->Height, &overflow);
+ iss.PatchHeightOut = safe64fixed2int((int64_t)penum->rrect.h *
+ dw / penum->Height, &overflow)
- iss.TopMarginOut;
- iss.PatchWidthOut = fixed2int_pixround_perfect((fixed)((int64_t)(penum->rrect.x + penum->rrect.w) *
- dh / penum->Width))
- - fixed2int_pixround_perfect((fixed)((int64_t)penum->rrect.x *
- dh / penum->Width));
- iss.LeftMarginOut = fixed2int_pixround_perfect((fixed)((int64_t)(penum->rrect.x - penum->rect.x) *
- dh / penum->Width));
- iss.TopMarginOut2 = fixed2int_pixround_perfect((fixed)((int64_t)penum->rrect.y *
- dw / penum->Height));
- iss.PatchHeightOut2 = fixed2int_pixround_perfect((fixed)((int64_t)(penum->rrect.y + penum->rrect.h) *
- dw / penum->Height))
+ iss.PatchWidthOut = safe64fixed2int((int64_t)(penum->rrect.x + penum->rrect.w) *
+ dh / penum->Width, &overflow)
+ - safe64fixed2int((int64_t)penum->rrect.x *
+ dh / penum->Width, &overflow);
+ iss.LeftMarginOut = safe64fixed2int((int64_t)(penum->rrect.x - penum->rect.x) *
+ dh / penum->Width, &overflow);
+ iss.TopMarginOut2 = safe64fixed2int((int64_t)penum->rrect.y *
+ dw / penum->Height, &overflow);
+ iss.PatchHeightOut2 = safe64fixed2int((int64_t)(penum->rrect.y + penum->rrect.h) *
+ dw / penum->Height, &overflow)
- iss.TopMarginOut2;
iss.pad_y = 0;
}
@@ -399,7 +416,7 @@ gs_image_class_0_interpolate(gx_image_enum * penum, irender_proc_t *render_fn)
iss.LeftMarginOut = iss.WidthOut - iss.LeftMarginOut - iss.PatchWidthOut;
/* For interpolator cores that don't set Active, have us always active */
iss.Active = 1;
- if (iss.EntireWidthOut == 0 || iss.EntireHeightOut == 0)
+ if (iss.EntireWidthOut == 0 || iss.EntireHeightOut == 0 || overflow)
{
penum->interpolate = interp_off;
return 0;
@@ -2171,9 +2188,12 @@ image_render_interpolate_icc(gx_image_enum * penum, const byte * buffer,
1, width_in);
/* Do the transformation */
psrc = (byte*) (stream_r.ptr + 1);
- (penum->icc_link->procs.map_buffer)(dev, penum->icc_link, &input_buff_desc,
+ code = (penum->icc_link->procs.map_buffer)(dev, penum->icc_link, &input_buff_desc,
&output_buff_desc, (void*) psrc,
(void*) p_cm_buff);
+ if (code < 0)
+ return code;
+
/* Re-set the reading stream to use the cm data */
stream_r.ptr = p_cm_buff - 1;
stream_r.limit = stream_r.ptr + num_bytes_decode * width_in * spp_cm;
@@ -2232,11 +2252,13 @@ image_render_interpolate_icc(gx_image_enum * penum, const byte * buffer,
pinterp += (pss->params.LeftMarginOut / abs_interp_limit) * spp_decode;
p_cm_interp = (unsigned short *) p_cm_buff;
p_cm_interp += (pss->params.LeftMarginOut / abs_interp_limit) * spp_cm;
- (penum->icc_link->procs.map_buffer)(dev, penum->icc_link,
+ code = (penum->icc_link->procs.map_buffer)(dev, penum->icc_link,
&input_buff_desc,
&output_buff_desc,
(void*) pinterp,
(void*) p_cm_interp);
+ if (code < 0)
+ return code;
}
code = irii_core(penum, xo, xe, spp_cm, p_cm_interp, dev, abs_interp_limit, bpp, raster, yo, dy, lop);
if (code < 0)
@@ -2660,9 +2682,12 @@ image_render_interpolate_landscape_icc(gx_image_enum * penum,
1, width_in);
/* Do the transformation */
psrc = (byte*) (stream_r.ptr + 1);
- (penum->icc_link->procs.map_buffer)(dev, penum->icc_link, &input_buff_desc,
+ code = (penum->icc_link->procs.map_buffer)(dev, penum->icc_link, &input_buff_desc,
&output_buff_desc, (void*) psrc,
(void*) p_cm_buff);
+ if (code < 0)
+ return code;
+
/* Re-set the reading stream to use the cm data */
stream_r.ptr = p_cm_buff - 1;
stream_r.limit = stream_r.ptr + num_bytes_decode * width_in * spp_cm;
@@ -2728,18 +2753,20 @@ image_render_interpolate_landscape_icc(gx_image_enum * penum,
if (penum->icc_link->is_identity || pss->params.early_cm) {
/* Fastest case. No CM needed */
p_cm_interp = (unsigned short *) pinterp;
+ p_cm_interp += (pss->params.LeftMarginOut / abs_interp_limit) * spp_cm;
} else {
/* Transform */
pinterp += (pss->params.LeftMarginOut / abs_interp_limit) * spp_decode;
p_cm_interp = (unsigned short *) p_cm_buff;
p_cm_interp += (pss->params.LeftMarginOut / abs_interp_limit) * spp_cm;
- (penum->icc_link->procs.map_buffer)(dev, penum->icc_link,
+ code = (penum->icc_link->procs.map_buffer)(dev, penum->icc_link,
&input_buff_desc,
&output_buff_desc,
(void*) pinterp,
(void*) p_cm_interp);
+ if (code < 0)
+ return code;
}
- p_cm_interp += (pss->params.LeftMarginOut / abs_interp_limit) * spp_cm;
for (x = xo; x < xe;) {
#ifdef DEBUG
if (gs_debug_c('B')) {
diff --git a/base/gxline.h b/base/gxline.h
index 1571e585..c7d90ef4 100644
--- a/base/gxline.h
+++ b/base/gxline.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxlum.h b/base/gxlum.h
index 38f3940d..4d809d49 100644
--- a/base/gxlum.h
+++ b/base/gxlum.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxmatrix.h b/base/gxmatrix.h
index 3a987694..3e18542e 100644
--- a/base/gxmatrix.h
+++ b/base/gxmatrix.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxmclip.c b/base/gxmclip.c
index 7e991416..b2b59e35 100644
--- a/base/gxmclip.c
+++ b/base/gxmclip.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxmclip.h b/base/gxmclip.h
index 926a72e3..8e690fc3 100644
--- a/base/gxmclip.h
+++ b/base/gxmclip.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxobj.h b/base/gxobj.h
index 376bab4f..927e1cdc 100644
--- a/base/gxobj.h
+++ b/base/gxobj.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxoprect.c b/base/gxoprect.c
index b04d9032..9b409e8c 100644
--- a/base/gxoprect.c
+++ b/base/gxoprect.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxoprect.h b/base/gxoprect.h
index 6a8d77df..a9f12d81 100644
--- a/base/gxoprect.h
+++ b/base/gxoprect.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxp1fill.c b/base/gxp1fill.c
index 80180972..dab8c333 100644
--- a/base/gxp1fill.c
+++ b/base/gxp1fill.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxp1impl.h b/base/gxp1impl.h
index 303319b4..0affb7c0 100644
--- a/base/gxp1impl.h
+++ b/base/gxp1impl.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxpaint.c b/base/gxpaint.c
index f570334e..2e4955c1 100644
--- a/base/gxpaint.c
+++ b/base/gxpaint.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -67,9 +67,16 @@ gx_stroke_fill(gx_path * ppath, gs_gstate * pgs)
return code;
params.flatness = (caching_an_outline_font(pgs) ? 0.0 : pgs->flatness);
params.traditional = false;
- return (*dev_proc(dev, stroke_path))
+
+ code = (*dev_proc(dev, stroke_path))
(dev, (const gs_gstate *)pgs, ppath, &params,
gs_currentdevicecolor_inline(pgs), pcpath);
+
+ if (pgs->black_text_state) {
+ gsicc_restore_black_text(pgs);
+ }
+
+ return code;
}
int
@@ -89,11 +96,18 @@ gx_fill_stroke_path(gs_gstate * pgs, int rule)
fill_params.flatness = (caching_an_outline_font(pgs) ? 0.0 : pgs->flatness);
stroke_params.flatness = (caching_an_outline_font(pgs) ? 0.0 : pgs->flatness);
stroke_params.traditional = false;
- return (*dev_proc(dev, fill_stroke_path))
+
+ code = (*dev_proc(dev, fill_stroke_path))
(dev, (const gs_gstate *)pgs, pgs->path,
&fill_params, gs_currentdevicecolor_inline(pgs),
- &stroke_params, gs_altdevicecolor_inline(pgs),
+ &stroke_params, gs_swappeddevicecolor_inline(pgs),
pcpath);
+
+ if (pgs->black_text_state) {
+ gsicc_restore_black_text(pgs);
+ }
+
+ return code;
}
int
diff --git a/base/gxpaint.h b/base/gxpaint.h
index 2dee3a66..f71440a4 100644
--- a/base/gxpaint.h
+++ b/base/gxpaint.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxpath.c b/base/gxpath.c
index ffdea761..5bbcf5d0 100644
--- a/base/gxpath.c
+++ b/base/gxpath.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxpath.h b/base/gxpath.h
index 01a04240..90d62bed 100644
--- a/base/gxpath.h
+++ b/base/gxpath.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -44,10 +44,10 @@ typedef enum {
sn_dash_tail = 8, /* segment is followed by dash break */
} segment_notes;
-/*
- * Used by interpreters for optimizing bbox size for transparency groups.
- * Depending upon the option we will return a bbox that may just included the
- * clip path or may include the intersection of the current path and the clip
+/*
+ * Used by interpreters for optimizing bbox size for transparency groups.
+ * Depending upon the option we will return a bbox that may just included the
+ * clip path or may include the intersection of the current path and the clip
* path and may include an adjustement for the stroke width.
*/
typedef enum {
@@ -311,7 +311,7 @@ int gx_default_clip_box(const gs_gstate *, gs_fixed_rect *);
int gx_effective_clip_path(gs_gstate *, gx_clip_path **);
int gx_curr_fixed_bbox(gs_gstate * pgs, gs_fixed_rect *bbox, gs_bbox_comp_t comp_type);
int gx_curr_bbox(gs_gstate * pgs, gs_rect *bbox, gs_bbox_comp_t comp_type);
-
+
/* Opaque type for a clip list. */
typedef struct gx_clip_list_s gx_clip_list;
diff --git a/base/gxpath2.c b/base/gxpath2.c
index d1bbe236..0f856f5a 100644
--- a/base/gxpath2.c
+++ b/base/gxpath2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxpcache.h b/base/gxpcache.h
index 8b37771e..33048664 100644
--- a/base/gxpcache.h
+++ b/base/gxpcache.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxpcmap.c b/base/gxpcmap.c
index 356ec0f9..e6ec7b9a 100644
--- a/base/gxpcmap.c
+++ b/base/gxpcmap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -1498,7 +1498,7 @@ gx_pattern_load(gx_device_color * pdc, const gs_gstate * pgs,
goto fail;
if (pinst->templat.uses_transparency) {
if_debug0m('v', mem, "gx_pattern_load: pushing the pdf14 compositor device into this graphics state\n");
- if ((code = gs_push_pdf14trans_device(saved, true, false)) < 0)
+ if ((code = gs_push_pdf14trans_device(saved, true, false, 0, 0)) < 0) /* FIXME: do we need spot_color_count ??? */
return code;
saved->device->is_open = true;
} else {
diff --git a/base/gxpcolor.h b/base/gxpcolor.h
index 9d1856bd..197b7532 100644
--- a/base/gxpcolor.h
+++ b/base/gxpcolor.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxpcopy.c b/base/gxpcopy.c
index 51abb19d..fdffe76b 100644
--- a/base/gxpcopy.c
+++ b/base/gxpcopy.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -330,7 +330,7 @@ adjust_point_to_tangent(segment * pseg, const segment * next,
return; /* anomalous case */
if_debug1('2', "[2]adjusting vertical: DT = %g\n",
fixed2float(DT));
- if ((DT ^ fD) > 0)
+ if ((DT ^ fD) > 0) /* lgtm [cpp/bitwise-sign-check] */
pseg->pt.y = DT + y0;
} else if (fD == 0) {
/* Horizontal tangent. */
@@ -338,7 +338,7 @@ adjust_point_to_tangent(segment * pseg, const segment * next,
if_debug1('2', "[2]adjusting horizontal: CT = %g\n",
fixed2float(CT));
- if ((CT ^ fC) > 0)
+ if ((CT ^ fC) > 0) /* lgtm [cpp/bitwise-sign-check] */
pseg->pt.x = CT + x0;
} else {
/* General case. */
diff --git a/base/gxpdash.c b/base/gxpdash.c
index 2e45b3cd..281e23a2 100644
--- a/base/gxpdash.c
+++ b/base/gxpdash.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxpflat.c b/base/gxpflat.c
index fa90fc28..928a24c2 100644
--- a/base/gxpflat.c
+++ b/base/gxpflat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxrplane.h b/base/gxrplane.h
index 38694e89..e931f832 100644
--- a/base/gxrplane.h
+++ b/base/gxrplane.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxsample.c b/base/gxsample.c
index 519abd82..33f96417 100644
--- a/base/gxsample.c
+++ b/base/gxsample.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxsample.h b/base/gxsample.h
index 25db3174..00c3ccf7 100644
--- a/base/gxsample.h
+++ b/base/gxsample.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxsamplp.h b/base/gxsamplp.h
index c6f6c0ae..143b240c 100644
--- a/base/gxsamplp.h
+++ b/base/gxsamplp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxscanc.c b/base/gxscanc.c
index 7776d486..9842b2c3 100644
--- a/base/gxscanc.c
+++ b/base/gxscanc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -3627,7 +3627,9 @@ no_merge:
} else if (sx < ex) {
/* Lines increasing in x. (Rightwards, rising) */
int phase1_x_steps, phase3_x_steps;
- fixed x_steps = ex - sx;
+ /* Use unsigned int here, to allow for extreme cases like
+ * ex = 0x7fffffff, sx = 0x80000000 */
+ unsigned int x_steps = ex - sx;
/* Phase 1: */
if (phase1_y_steps) {
@@ -3693,7 +3695,9 @@ no_merge:
} else {
/* Lines decreasing in x. (Leftwards, rising) */
int phase1_x_steps, phase3_x_steps;
- fixed x_steps = sx - ex;
+ /* Use unsigned int here, to allow for extreme cases like
+ * sx = 0x7fffffff, ex = 0x80000000 */
+ unsigned int x_steps = sx - ex;
/* Phase 1: */
if (phase1_y_steps) {
@@ -3813,7 +3817,9 @@ endFallingLeftOnEdgeOfPixel:
} else if (sx < ex) {
/* Lines increasing in x. (Rightwards, falling) */
int phase1_x_steps, phase3_x_steps;
- fixed x_steps = ex - sx;
+ /* Use unsigned int here, to allow for extreme cases like
+ * ex = 0x7fffffff, sx = 0x80000000 */
+ unsigned int x_steps = ex - sx;
/* Phase 1: */
if (phase1_y_steps) {
@@ -3878,7 +3884,9 @@ endFallingRightOnEdgeOfPixel:
} else {
/* Lines decreasing in x. (Falling) */
int phase1_x_steps, phase3_x_steps;
- fixed x_steps = sx - ex;
+ /* Use unsigned int here, to allow for extreme cases like
+ * sx = 0x7fffffff, ex = 0x80000000 */
+ unsigned int x_steps = sx - ex;
/* Phase 1: */
if (phase1_y_steps) {
diff --git a/base/gxscanc.h b/base/gxscanc.h
index a585ef44..7bf71be3 100644
--- a/base/gxscanc.h
+++ b/base/gxscanc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxshade.c b/base/gxshade.c
index 27413ac1..80e3b742 100644
--- a/base/gxshade.c
+++ b/base/gxshade.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxshade.h b/base/gxshade.h
index 19a0aa38..4990b25e 100644
--- a/base/gxshade.h
+++ b/base/gxshade.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxshade1.c b/base/gxshade1.c
index 4b86d138..c105f6cf 100644
--- a/base/gxshade1.c
+++ b/base/gxshade1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -343,7 +343,7 @@ gs_shading_A_fill_rectangle(const gs_shading_t * psh0, const gs_rect * rect,
* For the purposes of explanation, we shall label the octants as below:
*
* \2|1/ and Quadrants as: |
- * 3\|/0 Q1 | Q0
+ * 3\|/0 Q1 | Q0
* ---+--- ----+----
* 4/|\7 Q2 | Q3
* /5|6\ |
@@ -351,7 +351,7 @@ gs_shading_A_fill_rectangle(const gs_shading_t * psh0, const gs_rect * rect,
* We find (dx,dy), the difference between the centres of the circles.
* We look to see which octant this falls in. Firstly, this tells us which
* quadrant of the circle we need to draw first (Octant n, starts with
- * Quadrant floor(n/2)). Secondly, it tells us which direction to form the
+ * Quadrant floor(n/2)). Secondly, it tells us which direction to form the
* tensor patch in; we always want to draw from the side 'closest' to
* dx/dy to the side further away. This ensures that we don't overwrite
* pixels in the incorrect order as the patch decomposes.
diff --git a/base/gxshade4.c b/base/gxshade4.c
index 86cc1a57..f2058b98 100644
--- a/base/gxshade4.c
+++ b/base/gxshade4.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxshade4.h b/base/gxshade4.h
index 973a43c9..e5113c92 100644
--- a/base/gxshade4.h
+++ b/base/gxshade4.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxshade6.c b/base/gxshade6.c
index e48bcfb4..e8f9349b 100644
--- a/base/gxshade6.c
+++ b/base/gxshade6.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -1482,6 +1482,13 @@ constant_color_trapezoid(patch_fill_state_t *pfs, gs_fixed_edge *le, gs_fixed_ed
code = patch_color_to_device_color_inline(pfs, c, &dc, NULL);
if (code < 0)
return code;
+
+ if (device_encodes_tags(pfs->dev)) {
+ dc.tag = (pfs->dev->graphics_type_tag & ~GS_DEVICE_ENCODES_TAGS);
+ } else {
+ dc.tag = 0;
+ }
+
return dev_proc(pfs->dev, fill_trapezoid)(pfs->dev,
le, re, ybot, ytop, swap_axes, &dc, pfs->pgs->log_op);
}
@@ -2539,6 +2546,12 @@ constant_color_quadrangle_aux(patch_fill_state_t *pfs, const quadrangle_patch *p
gx_device_color dc;
bool orient;
+ if (device_encodes_tags(pfs->dev)) {
+ dc.tag = (pfs->dev->graphics_type_tag & ~GS_DEVICE_ENCODES_TAGS);
+ } else {
+ dc.tag = 0;
+ }
+
patch_interpolate_color(c[1], p->p[0][0]->c, p->p[0][1]->c, pfs, 0.5);
patch_interpolate_color(c[2], p->p[1][0]->c, p->p[1][1]->c, pfs, 0.5);
patch_interpolate_color(c[0], c[1], c[2], pfs, 0.5);
diff --git a/base/gxstate.h b/base/gxstate.h
index 2d67efb8..cf61b297 100644
--- a/base/gxstate.h
+++ b/base/gxstate.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxstdio.h b/base/gxstdio.h
index 0956c560..a2f4a51c 100644
--- a/base/gxstdio.h
+++ b/base/gxstdio.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxstroke.c b/base/gxstroke.c
index e99497b6..87def483 100644
--- a/base/gxstroke.c
+++ b/base/gxstroke.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxsync.c b/base/gxsync.c
index 7f41a273..ad054111 100644
--- a/base/gxsync.c
+++ b/base/gxsync.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxsync.h b/base/gxsync.h
index 762fb2fe..c2c9017d 100644
--- a/base/gxsync.h
+++ b/base/gxsync.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxtext.h b/base/gxtext.h
index afe0bc89..e6836ae7 100644
--- a/base/gxtext.h
+++ b/base/gxtext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -126,6 +126,7 @@ rc_free_proc(rc_free_text_enum);
int bytes_decoded; \
gs_point FontBBox_as_Metrics2; /* used with FontType 9,11 && WMode 1 */\
ulong text_enum_id; /* debug purpose only - not used by algorythm. */\
+ bool k_text_release; /* Set at time of gs_text_begin to know to do release of black_text_state */\
/* The following is controlled by a device. */\
bool device_disabled_grid_fitting;\
/* Following two members moved from the show enumerator */\
@@ -168,7 +169,7 @@ rc_free_proc(rc_free_text_enum);
show_width_status width_status; \
/*gs_log2_scale_point log2_scale;*/ \
int (*continue_proc) (gs_show_enum *) /* continuation procedure */
-
+
/* The typedef is in gstext.h. */
struct gs_text_enum_s {
gs_text_enum_common;
diff --git a/base/gxtmap.h b/base/gxtmap.h
index 994c38e5..676b4906 100644
--- a/base/gxtmap.h
+++ b/base/gxtmap.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxttf.h b/base/gxttf.h
index ab683ba9..a53065e3 100644
--- a/base/gxttf.h
+++ b/base/gxttf.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxttfb.c b/base/gxttfb.c
index d0a8c882..582c05c8 100644
--- a/base/gxttfb.c
+++ b/base/gxttfb.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxttfb.h b/base/gxttfb.h
index 487ac941..97c93f1c 100644
--- a/base/gxttfb.h
+++ b/base/gxttfb.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxtype1.c b/base/gxtype1.c
index 3169751f..44dfab43 100644
--- a/base/gxtype1.c
+++ b/base/gxtype1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxtype1.h b/base/gxtype1.h
index 6519f113..86911386 100644
--- a/base/gxtype1.h
+++ b/base/gxtype1.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gxxfont.h b/base/gxxfont.h
index b239cd27..c446de36 100644
--- a/base/gxxfont.h
+++ b/base/gxxfont.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gzacpath.h b/base/gzacpath.h
index 4670b478..1f135f51 100644
--- a/base/gzacpath.h
+++ b/base/gzacpath.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gzcpath.h b/base/gzcpath.h
index da5d2758..726864bf 100644
--- a/base/gzcpath.h
+++ b/base/gzcpath.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gzht.h b/base/gzht.h
index 1adb06d0..9c1e0fe8 100644
--- a/base/gzht.h
+++ b/base/gzht.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gzline.h b/base/gzline.h
index 919b3ad6..80293597 100644
--- a/base/gzline.h
+++ b/base/gzline.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gzpath.h b/base/gzpath.h
index 1c78caf8..39416894 100644
--- a/base/gzpath.h
+++ b/base/gzpath.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gzspotan.c b/base/gzspotan.c
index 46fd35bf..847f3c9d 100644
--- a/base/gzspotan.c
+++ b/base/gzspotan.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gzspotan.h b/base/gzspotan.h
index 4a60b19e..fd95825b 100644
--- a/base/gzspotan.h
+++ b/base/gzspotan.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gzstate.h b/base/gzstate.h
index 648534c3..5a1f456f 100644
--- a/base/gzstate.h
+++ b/base/gzstate.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/icc34.h b/base/icc34.h
index a58b0b9d..be36c272 100644
--- a/base/icc34.h
+++ b/base/icc34.h
@@ -2,55 +2,55 @@
#ifndef ICC_H
#define ICC_H
-/*****************************************************************
+/*****************************************************************
Copyright (c) 1994-1996 SunSoft, Inc.
Rights Reserved
-Permission is hereby granted, free of charge, to any person
+Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without restrict-
-ion, including without limitation the rights to use, copy, modify,
-merge, publish distribute, sublicense, and/or sell copies of the
-Software, and to permit persons to whom the Software is furnished
-to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+files (the "Software"), to deal in the Software without restrict-
+ion, including without limitation the rights to use, copy, modify,
+merge, publish distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-
-INFRINGEMENT. IN NO EVENT SHALL SUNSOFT, INC. OR ITS PARENT
-COMPANY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of SunSoft, Inc.
-shall not be used in advertising or otherwise to promote the
-sale, use or other dealings in this Software without written
-authorization from SunSoft Inc.
+INFRINGEMENT. IN NO EVENT SHALL SUNSOFT, INC. OR ITS PARENT
+COMPANY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of SunSoft, Inc.
+shall not be used in advertising or otherwise to promote the
+sale, use or other dealings in this Software without written
+authorization from SunSoft Inc.
******************************************************************/
/*
* This version of the header file corresponds to the profile
* specification version 3.4.
*
- * All header file entries are pre-fixed with "ic" to help
+ * All header file entries are pre-fixed with "ic" to help
* avoid name space collisions. Signatures are pre-fixed with
* icSig.
*
* The structures defined in this header file were created to
* represent a description of an ICC profile on disk. Rather
- * than use pointers a technique is used where a single byte array
+ * than use pointers a technique is used where a single byte array
* was placed at the end of each structure. This allows us in "C"
* to extend the structure by allocating more data than is needed
* to account for variable length structures.
*
* This also ensures that data following is allocated
* contiguously and makes it easier to write and read data from
- * the file.
+ * the file.
*
* For example to allocate space for a 256 count length UCR
* and BG array, and fill the allocated data. Note strlen + 1
@@ -62,20 +62,20 @@ authorization from SunSoft Inc.
char ucr_string[100], *ucr_char;
strcpy(ucr_string, "Example ucrBG curves");
- ucr_nbytes = sizeof(icUInt32Number) +
+ ucr_nbytes = sizeof(icUInt32Number) +
(UCR_CURVE_SIZE * sizeof(icUInt16Number));
- bg_nbytes = sizeof(icUInt32Number) +
+ bg_nbytes = sizeof(icUInt32Number) +
(BG_CURVE_SIZE * sizeof(icUInt16Number));
string_bytes = strlen(ucr_string) + 1;
ucrBgWrite = (icUcrBg *)malloc(
(ucr_nbytes + bg_nbytes + string_bytes));
-
+
ucrCurve = (icUcrBgCurve *)ucrBgWrite->data;
ucrCurve->count = UCR_CURVE_SIZE;
for (i=0; i<ucrCurve->count; i++)
ucrCurve->curve[i] = (icUInt16Number)i;
-
+
bgCurve = (icUcrBgCurve *)((char *)ucrCurve + ucr_nbytes);
bgCurve->count = BG_CURVE_SIZE;
for (i=0; i<bgCurve->count; i++)
@@ -106,7 +106,7 @@ authorization from SunSoft Inc.
#define icLinesPerInch 0x00000002L /* Bit pos 1 */
#define icLinesPerCm 0x00000000L /* Bit pos 1 */
-/*
+/*
* Device attributes, currently defined values correspond
* to the low 4 bytes of the 8 byte attribute quantity, see
* the header for their location.
@@ -126,10 +126,10 @@ authorization from SunSoft Inc.
#define icUseWithEmbeddedDataOnly 0x00000002L /* Bit pos 1 */
/* Ascii or Binary data */
-#define icAsciiData 0x00000000L
+#define icAsciiData 0x00000000L
#define icBinaryData 0x00000001L
-/*
+/*
* Define used to indicate that this is a variable length array
*/
#define icAny 1
@@ -147,8 +147,8 @@ authorization from SunSoft Inc.
#ifdef PACKAGE_NAME
/*
June 9, 2003, Adapted for use with configure by Bob Friesenhahn
- Added the stupid check for autoconf by Marti Maria.
- PACKAGE_NAME is defined if autoconf is being used
+ Added the stupid check for autoconf by Marti Maria.
+ PACKAGE_NAME is defined if autoconf is being used
*/
typedef @UINT8_T@ icUInt8Number;
@@ -163,7 +163,7 @@ typedef @INT32_T@ icInt64Number[2];
#elif defined (__digital__) && defined (__unix__)
-/*
+/*
*Apr-17-2002: Modified by Marti Maria in order to provide wider portability.
*/
@@ -267,16 +267,16 @@ typedef icUInt32Number icU16Fixed16Number;
/*------------------------------------------------------------------------*/
/* public tags and sizes */
typedef enum {
- icSigAToB0Tag = 0x41324230L, /* 'A2B0' */
+ icSigAToB0Tag = 0x41324230L, /* 'A2B0' */
icSigAToB1Tag = 0x41324231L, /* 'A2B1' */
- icSigAToB2Tag = 0x41324232L, /* 'A2B2' */
+ icSigAToB2Tag = 0x41324232L, /* 'A2B2' */
icSigBlueColorantTag = 0x6258595AL, /* 'bXYZ' */
icSigBlueTRCTag = 0x62545243L, /* 'bTRC' */
icSigBToA0Tag = 0x42324130L, /* 'B2A0' */
icSigBToA1Tag = 0x42324131L, /* 'B2A1' */
icSigBToA2Tag = 0x42324132L, /* 'B2A2' */
icSigCalibrationDateTimeTag = 0x63616C74L, /* 'calt' */
- icSigCharTargetTag = 0x74617267L, /* 'targ' */
+ icSigCharTargetTag = 0x74617267L, /* 'targ' */
icSigCopyrightTag = 0x63707274L, /* 'cprt' */
icSigCrdInfoTag = 0x63726469L, /* 'crdi' */
icSigDeviceMfgDescTag = 0x646D6E64L, /* 'dmnd' */
@@ -289,7 +289,7 @@ typedef enum {
icSigMeasurementTag = 0x6D656173L, /* 'meas' */
icSigMediaBlackPointTag = 0x626B7074L, /* 'bkpt' */
icSigMediaWhitePointTag = 0x77747074L, /* 'wtpt' */
- icSigNamedColorTag = 0x6E636f6CL, /* 'ncol'
+ icSigNamedColorTag = 0x6E636f6CL, /* 'ncol'
* OBSOLETE, use ncl2 */
icSigNamedColor2Tag = 0x6E636C32L, /* 'ncl2' */
icSigPreview0Tag = 0x70726530L, /* 'pre0' */
@@ -311,7 +311,7 @@ typedef enum {
icSigUcrBgTag = 0x62666420L, /* 'bfd ' */
icSigViewingCondDescTag = 0x76756564L, /* 'vued' */
icSigViewingConditionsTag = 0x76696577L, /* 'view' */
- icMaxEnumTag = 0xFFFFFFFFL
+ icMaxEnumTag = 0xFFFFFFFFL
} icTagSignature;
/* technology signature descriptions */
@@ -319,7 +319,7 @@ typedef enum {
icSigDigitalCamera = 0x6463616DL, /* 'dcam' */
icSigFilmScanner = 0x6673636EL, /* 'fscn' */
icSigReflectiveScanner = 0x7273636EL, /* 'rscn' */
- icSigInkJetPrinter = 0x696A6574L, /* 'ijet' */
+ icSigInkJetPrinter = 0x696A6574L, /* 'ijet' */
icSigThermalWaxPrinter = 0x74776178L, /* 'twax' */
icSigElectrophotographicPrinter = 0x6570686FL, /* 'epho' */
icSigElectrostaticPrinter = 0x65737461L, /* 'esta' */
@@ -338,7 +338,7 @@ typedef enum {
icSigOffsetLithography = 0x6F666673L, /* 'offs' */
icSigSilkscreen = 0x73696C6BL, /* 'silk' */
icSigFlexography = 0x666C6578L, /* 'flex' */
- icMaxEnumTechnology = 0xFFFFFFFFL
+ icMaxEnumTechnology = 0xFFFFFFFFL
} icTechnologySignature;
/* type signatures */
@@ -349,7 +349,7 @@ typedef enum {
icSigLut16Type = 0x6d667432L, /* 'mft2' */
icSigLut8Type = 0x6d667431L, /* 'mft1' */
icSigMeasurementType = 0x6D656173L, /* 'meas' */
- icSigNamedColorType = 0x6E636f6CL, /* 'ncol'
+ icSigNamedColorType = 0x6E636f6CL, /* 'ncol'
* OBSOLETE, use ncl2 */
icSigProfileSequenceDescType = 0x70736571L, /* 'pseq' */
icSigS15Fixed16ArrayType = 0x73663332L, /* 'sf32' */
@@ -368,14 +368,14 @@ typedef enum {
icSigXYZArrayType = 0x58595A20L, /* 'XYZ ' */
icSigNamedColor2Type = 0x6E636C32L, /* 'ncl2' */
icSigCrdInfoType = 0x63726469L, /* 'crdi' */
- icMaxEnumType = 0xFFFFFFFFL
+ icMaxEnumType = 0xFFFFFFFFL
} icTagTypeSignature;
-/*
+/*
* Color Space Signatures
* Note that only icSigXYZData and icSigLabData are valid
* Profile Connection Spaces (PCSs)
- */
+ */
typedef enum {
icSigXYZData = 0x58595A20L, /* 'XYZ ' */
icSigLabData = 0x4C616220L, /* 'Lab ' */
@@ -402,7 +402,7 @@ typedef enum {
icSig13colorData = 0x44434C52L, /* 'DCLR' */
icSig14colorData = 0x45434C52L, /* 'ECLR' */
icSig15colorData = 0x46434C52L, /* 'FCLR' */
- icMaxEnumData = 0xFFFFFFFFL
+ icMaxEnumData = 0xFFFFFFFFL
} icColorSpaceSignature;
/* profileClass enumerations */
@@ -414,7 +414,7 @@ typedef enum {
icSigAbstractClass = 0x61627374L, /* 'abst' */
icSigColorSpaceClass = 0x73706163L, /* 'spac' */
icSigNamedColorClass = 0x6e6d636cL, /* 'nmcl' */
- icMaxEnumClass = 0xFFFFFFFFL
+ icMaxEnumClass = 0xFFFFFFFFL
} icProfileClassSignature;
/* Platform Signatures */
@@ -424,7 +424,7 @@ typedef enum {
icSigSolaris = 0x53554E57L, /* 'SUNW' */
icSigSGI = 0x53474920L, /* 'SGI ' */
icSigTaligent = 0x54474E54L, /* 'TGNT' */
- icMaxEnumPlatform = 0xFFFFFFFFL
+ icMaxEnumPlatform = 0xFFFFFFFFL
} icPlatformSignature;
/*------------------------------------------------------------------------*/
@@ -436,7 +436,7 @@ typedef enum {
typedef enum {
icFlare0 = 0x00000000L, /* 0% flare */
icFlare100 = 0x00000001L, /* 100% flare */
- icMaxFlare = 0xFFFFFFFFL
+ icMaxFlare = 0xFFFFFFFFL
} icMeasurementFlare;
/* Measurement Geometry, used in the measurmentType tag */
@@ -444,7 +444,7 @@ typedef enum {
icGeometryUnknown = 0x00000000L, /* Unknown */
icGeometry045or450 = 0x00000001L, /* 0/45, 45/0 */
icGeometry0dord0 = 0x00000002L, /* 0/d or d/0 */
- icMaxGeometry = 0xFFFFFFFFL
+ icMaxGeometry = 0xFFFFFFFFL
} icMeasurementGeometry;
/* Rendering Intents, used in the profile header */
@@ -453,7 +453,7 @@ typedef enum {
icRelativeColorimetric = 1,
icSaturation = 2,
icAbsoluteColorimetric = 3,
- icMaxEnumIntent = 0xFFFFFFFFL
+ icMaxEnumIntent = 0xFFFFFFFFL
} icRenderingIntent;
/* Different Spot Shapes currently defined, used for screeningType */
@@ -466,7 +466,7 @@ typedef enum {
icSpotShapeLine = 5,
icSpotShapeSquare = 6,
icSpotShapeCross = 7,
- icMaxEnumSpot = 0xFFFFFFFFL
+ icMaxEnumSpot = 0xFFFFFFFFL
} icSpotShape;
/* Standard Observer, used in the measurmentType tag */
@@ -474,7 +474,7 @@ typedef enum {
icStdObsUnknown = 0x00000000L, /* Unknown */
icStdObs1931TwoDegrees = 0x00000001L, /* 2 deg */
icStdObs1964TenDegrees = 0x00000002L, /* 10 deg */
- icMaxStdObs = 0xFFFFFFFFL
+ icMaxStdObs = 0xFFFFFFFFL
} icStandardObserver;
/* Pre-defined illuminants, used in measurement and viewing conditions type */
@@ -486,15 +486,15 @@ typedef enum {
icIlluminantF2 = 0x00000004L,
icIlluminantD55 = 0x00000005L,
icIlluminantA = 0x00000006L,
- icIlluminantEquiPowerE = 0x00000007L,
- icIlluminantF8 = 0x00000008L,
- icMaxEnumIluminant = 0xFFFFFFFFL
+ icIlluminantEquiPowerE = 0x00000007L,
+ icIlluminantF8 = 0x00000008L,
+ icMaxEnumIluminant = 0xFFFFFFFFL
} icIlluminant;
/*------------------------------------------------------------------------*/
/*
- * Arrays of numbers
+ * Arrays of numbers
*/
/* Int8 Array */
@@ -536,7 +536,7 @@ typedef struct {
typedef struct {
icInt64Number data[icAny]; /* Variable array of values */
} icInt64Array;
-
+
/* u16Fixed16 Array */
typedef struct {
icU16Fixed16Number data[icAny]; /* Variable array of values */
@@ -592,13 +592,13 @@ typedef struct {
icUInt8Number clutPoints; /* Number of grid points */
icInt8Number pad; /* Padding for byte alignment */
icS15Fixed16Number e00; /* e00 in the 3 * 3 */
- icS15Fixed16Number e01; /* e01 in the 3 * 3 */
+ icS15Fixed16Number e01; /* e01 in the 3 * 3 */
icS15Fixed16Number e02; /* e02 in the 3 * 3 */
icS15Fixed16Number e10; /* e10 in the 3 * 3 */
- icS15Fixed16Number e11; /* e11 in the 3 * 3 */
- icS15Fixed16Number e12; /* e12 in the 3 * 3 */
+ icS15Fixed16Number e11; /* e11 in the 3 * 3 */
+ icS15Fixed16Number e12; /* e12 in the 3 * 3 */
icS15Fixed16Number e20; /* e20 in the 3 * 3 */
- icS15Fixed16Number e21; /* e21 in the 3 * 3 */
+ icS15Fixed16Number e21; /* e21 in the 3 * 3 */
icS15Fixed16Number e22; /* e22 in the 3 * 3 */
icUInt16Number inputEnt; /* Num of in-table entries */
icUInt16Number outputEnt; /* Num of out-table entries */
@@ -607,7 +607,7 @@ typedef struct {
* Data that follows is of this form
*
* icUInt16Number inputTable[inputChan][icAny]; * The in-table
- * icUInt16Number clutTable[icAny]; * The clut
+ * icUInt16Number clutTable[icAny]; * The clut
* icUInt16Number outputTable[outputChan][icAny]; * The out-table
*/
} icLut16;
@@ -619,20 +619,20 @@ typedef struct {
icUInt8Number clutPoints; /* Num of grid points */
icInt8Number pad;
icS15Fixed16Number e00; /* e00 in the 3 * 3 */
- icS15Fixed16Number e01; /* e01 in the 3 * 3 */
+ icS15Fixed16Number e01; /* e01 in the 3 * 3 */
icS15Fixed16Number e02; /* e02 in the 3 * 3 */
icS15Fixed16Number e10; /* e10 in the 3 * 3 */
- icS15Fixed16Number e11; /* e11 in the 3 * 3 */
- icS15Fixed16Number e12; /* e12 in the 3 * 3 */
+ icS15Fixed16Number e11; /* e11 in the 3 * 3 */
+ icS15Fixed16Number e12; /* e12 in the 3 * 3 */
icS15Fixed16Number e20; /* e20 in the 3 * 3 */
- icS15Fixed16Number e21; /* e21 in the 3 * 3 */
+ icS15Fixed16Number e21; /* e21 in the 3 * 3 */
icS15Fixed16Number e22; /* e22 in the 3 * 3 */
icUInt8Number data[icAny]; /* Data follows see spec */
/*
* Data that follows is of this form
*
* icUInt8Number inputTable[inputChan][256]; * The in-table
- * icUInt8Number clutTable[icAny]; * The clut
+ * icUInt8Number clutTable[icAny]; * The clut
* icUInt8Number outputTable[outputChan][256]; * The out-table
*/
} icLut8;
@@ -649,7 +649,7 @@ typedef struct {
/* Named color */
/*
- * icNamedColor2 takes the place of icNamedColor
+ * icNamedColor2 takes the place of icNamedColor
*/
typedef struct {
icUInt32Number vendorFlag; /* Bottom 16 bits for IC use */
@@ -670,16 +670,16 @@ typedef struct {
* :
* :
* Repeat for name and PCS and device color coordinates up to (count-1)
- *
- * NOTES:
+ *
+ * NOTES:
* PCS and device space can be determined from the header.
*
- * PCS coordinates are icUInt16 numbers and are described in Annex A of
- * the ICC spec. Only 16 bit L*a*b* and XYZ are allowed. The number of
+ * PCS coordinates are icUInt16 numbers and are described in Annex A of
+ * the ICC spec. Only 16 bit L*a*b* and XYZ are allowed. The number of
* coordinates is consistent with the headers PCS.
*
* Device coordinates are icUInt16 numbers where 0x0000 represents
- * the minimum value and 0xFFFF represents the maximum value.
+ * the minimum value and 0xFFFF represents the maximum value.
* If the nDeviceCoords value is 0 this field is not given.
*/
} icNamedColor2;
@@ -693,7 +693,7 @@ typedef struct {
icInt8Number data[icAny]; /* Desc text follows */
/*
* Data that follows is of this form, this is an icInt8Number
- * to avoid problems with a compiler generating bad code as
+ * to avoid problems with a compiler generating bad code as
* these arrays are variable in length.
*
* icTextDescription deviceMfgDesc; * Manufacturer text
@@ -753,7 +753,7 @@ typedef struct {
icInt8Number data[icAny]; /* The Ucr BG data */
/*
* Data that follows is of this form, this is a icInt8Number
- * to avoid problems with a compiler generating bad code as
+ * to avoid problems with a compiler generating bad code as
* these arrays are variable in length.
*
* icUcrBgCurve ucr; * Ucr curve
@@ -900,7 +900,7 @@ typedef struct {
icTagBase base; /* Signature, "ui64" */
icUInt64Array data; /* Variable array of values */
} icUInt64ArrayType;
-
+
/* uInt8Type */
typedef struct {
icTagBase base; /* Signature, "ui08" */
@@ -927,11 +927,11 @@ typedef struct {
icCrdInfo info; /* 5 sets of counts & strings */
}icCrdInfoType;
/* icCrdInfo productName; PS product count/string */
- /* icCrdInfo CRDName0; CRD name for intent 0 */
- /* icCrdInfo CRDName1; CRD name for intent 1 */
- /* icCrdInfo CRDName2; CRD name for intent 2 */
+ /* icCrdInfo CRDName0; CRD name for intent 0 */
+ /* icCrdInfo CRDName1; CRD name for intent 1 */
+ /* icCrdInfo CRDName2; CRD name for intent 2 */
/* icCrdInfo CRDName3; CRD name for intent 3 */
-
+
/*------------------------------------------------------------------------*/
/*
@@ -941,8 +941,8 @@ typedef struct {
/* A tag */
typedef struct {
icTagSignature sig; /* The tag signature */
- icUInt32Number offset; /* Start of tag relative to
- * start of header, Spec
+ icUInt32Number offset; /* Start of tag relative to
+ * start of header, Spec
* Clause 5 */
icUInt32Number size; /* Size in bytes */
} icTag;
@@ -974,8 +974,8 @@ typedef struct {
icInt8Number reserved[44]; /* Reserved */
} icHeader;
-/*
- * A profile,
+/*
+ * A profile,
* we can't use icTagList here because its not at the end of the structure
*/
typedef struct {
@@ -985,10 +985,10 @@ typedef struct {
/*
* Data that follows is of the form
*
- * icTag tagTable[icAny]; * The tag table
- * icInt8Number tagData[icAny]; * The tag data
+ * icTag tagTable[icAny]; * The tag table
+ * icInt8Number tagData[icAny]; * The tag data
*/
-} icProfile;
+} icProfile;
/*------------------------------------------------------------------------*/
/* Obsolete entries */
@@ -1001,12 +1001,12 @@ typedef struct {
/*
* Data that follows is of this form
*
- * icInt8Number prefix[icAny]; * Prefix
- * icInt8Number suffix[icAny]; * Suffix
- * icInt8Number root1[icAny]; * Root name
- * icInt8Number coords1[icAny]; * Color coordinates
- * icInt8Number root2[icAny]; * Root name
- * icInt8Number coords2[icAny]; * Color coordinates
+ * icInt8Number prefix[icAny]; * Prefix
+ * icInt8Number suffix[icAny]; * Suffix
+ * icInt8Number root1[icAny]; * Root name
+ * icInt8Number coords1[icAny]; * Color coordinates
+ * icInt8Number root2[icAny]; * Root name
+ * icInt8Number coords2[icAny]; * Color coordinates
* :
* :
* Repeat for root name and color coordinates up to (count-1)
diff --git a/base/ijs.mak b/base/ijs.mak
index 557dae5b..fe249c55 100644
--- a/base/ijs.mak
+++ b/base/ijs.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -36,8 +36,8 @@ IJSO_=$(O_)$(IJSOBJ)
# IJSI_ and IJSF_ are defined in gs.mak (why?)
# as are IJSGENDIR and IJSOBJDIR above.
IJS_INCL=$(I_)$(IJSI_)$(_I)
-IJS_CCFLAGS=$(IJS_INCL) $(IJSF_)
-IJS_CC=$(CC_) $(IJS_CCFLAGS)
+IJS_CCFLAGS=$(IJS_INCL) $(IJSF_)
+IJS_CC=$(CC) $(IJS_CCFLAGS) $(CCFLAGS)
# Define the name of this makefile.
IJS_MAK=$(GLSRC)ijs.mak $(TOP_MAKEFILES)
diff --git a/base/instcopy b/base/instcopy
index ef1e260d..acaef63e 100755
--- a/base/instcopy
+++ b/base/instcopy
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
diff --git a/base/jbig2.mak b/base/jbig2.mak
index 2ec14d94..7e37b0de 100644
--- a/base/jbig2.mak
+++ b/base/jbig2.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -93,7 +93,7 @@ jbig2.config-clean :
JBIG2DEP=$(AK)
-JBIG2_CC=$(CC_) $(CFLAGS) $(I_)$(JBIG2GENDIR) $(II)$(JB2I_)$(_I) $(JB2CF_) -DJBIG_EXTERNAL_MEMENTO_H=\"../base/memento.h\"
+JBIG2_CC=$(CC) $(I_)$(JBIG2GENDIR) $(II)$(JB2I_)$(_I) $(JB2CF_) -DJBIG_EXTERNAL_MEMENTO_H=\"../base/memento.h\" $(CCFLAGS)
JBIG2O_=$(O_)$(JBIG2OBJ)
# switch in the version of libjbig2.dev we're actually using
@@ -109,7 +109,7 @@ $(JBIG2GEN)jbig2dec_0.dev : $(JBIG2_MAK) $(ECHOGS_XE) $(libjbig2_OBJS) $(JBIG2_M
$(SETMOD) $(JBIG2GEN)jbig2dec_0 $(libjbig2_OBJS1)
$(ADDMOD) $(JBIG2GEN)jbig2dec_0 $(libjbig2_OBJS2)
-# explicit rules for building the source files.
+# explicit rules for building the source files.
$(JBIG2OBJ)snprintf.$(OBJ) : $(JBIG2SRC)snprintf.c $(JBIG2DEP) $(JBIG2_MAK) $(MAKEDIRS)
$(JBIG2_CC) $(JBIG2O_)snprintf.$(OBJ) $(C_) $(JBIG2SRC)snprintf.c
@@ -137,7 +137,7 @@ $(JBIG2OBJ)jbig2_generic.$(OBJ) : $(JBIG2SRC)jbig2_generic.c $(libjbig2_HDRS) $(
$(JBIG2OBJ)jbig2_refinement.$(OBJ) : $(JBIG2SRC)jbig2_refinement.c $(libjbig2_HDRS) $(JBIG2DEP) $(JBIG2_MAK) $(MAKEDIRS)
$(JBIG2_CC) $(JBIG2O_)jbig2_refinement.$(OBJ) $(C_) $(JBIG2SRC)jbig2_refinement.c
-
+
$(JBIG2OBJ)jbig2_huffman.$(OBJ) : $(JBIG2SRC)jbig2_huffman.c $(libjbig2_HDRS) $(JBIG2DEP) $(JBIG2_MAK) $(MAKEDIRS)
$(JBIG2_CC) $(JBIG2O_)jbig2_huffman.$(OBJ) $(C_) $(JBIG2SRC)jbig2_huffman.c
diff --git a/base/jerror_.h b/base/jerror_.h
index dafcf480..297ae610 100644
--- a/base/jerror_.h
+++ b/base/jerror_.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/jmemcust.c b/base/jmemcust.c
index bdcbb7ec..79490f56 100644
--- a/base/jmemcust.c
+++ b/base/jmemcust.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/jmemcust.h b/base/jmemcust.h
index 8d2f97d5..c9862cdf 100644
--- a/base/jmemcust.h
+++ b/base/jmemcust.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/jpeg.mak b/base/jpeg.mak
index c1929e63..eea6ce10 100644
--- a/base/jpeg.mak
+++ b/base/jpeg.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -107,7 +107,7 @@ jpeg.config-clean :
# JI_ and JF_ are defined in gs.mak.
# See below for why we need to include GLGENDIR here.
-JCC=$(CC_) $(I_)$(GLGENDIR) $(II)$(JI_)$(_I) $(JF_)
+JCC=$(CC) $(I_)$(GLGENDIR) $(II)$(JI_)$(_I) $(JF_) $(CCFLAGS)
# We need our own version of jconfig.h, and our own "wrapper" for
# jmorecfg.h.
@@ -125,9 +125,9 @@ jmorecf__h=$(GLGEN)jmorecf_.h
# We use our own jconfig.h and jmorecfg.h iff we aren't sharing the library.
# The library itself may need copies of them.
-
jconfig_h=$(GLGEN)jconfig.h
jmorecfg_h=$(GLGEN)jmorecfg.h
+jmemcust_h=$(GLSRC)jmemcust.h $(jconfig_h)
$(GLGEN)jconfig_.h : $(GLGEN)jconfig$(SHARE_JPEG).h $(JPEG_MAK) $(MAKEDIRS)
$(CP_) $(GLGEN)jconfig$(SHARE_JPEG).h $(GLGEN)jconfig_.h
diff --git a/base/jpegxr.mak b/base/jpegxr.mak
index daa5f62f..73aa632f 100644
--- a/base/jpegxr.mak
+++ b/base/jpegxr.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -31,7 +31,7 @@ JPEGXR_GEN=$(JPEGXR_GENDIR)$(D)
JPEGXR_OBJ=$(JPEGXR_OBJDIR)$(D)
JPEGXR_O_=$(O_)$(JPEGXR_OBJ)
-JPEGXR_CC=$(CC_) $(JPEGXR_CFLAGS) $(D_)JXR_DLL_EXPORTS=1$(_D) $(D_)NDEBUG$(_D)
+JPEGXR_CC=$(CC) $(JPEGXR_CFLAGS) $(D_)JXR_DLL_EXPORTS=1$(_D) $(D_)NDEBUG$(_D) $(CCFLAGS)
jpegxr.clean : jpegxr.config-clean jpegxr.clean-not-config-clean
diff --git a/base/lcms2.mak b/base/lcms2.mak
index a4224675..f53d6f70 100644
--- a/base/lcms2.mak
+++ b/base/lcms2.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
diff --git a/base/lcms2mt.mak b/base/lcms2mt.mak
index 68974579..e03e7e34 100644
--- a/base/lcms2mt.mak
+++ b/base/lcms2mt.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
diff --git a/base/lcups.mak b/base/lcups.mak
index e5974625..5189fe71 100644
--- a/base/lcups.mak
+++ b/base/lcups.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -30,7 +30,7 @@ LCUPSO_=$(O_)$(LIBCUPSOBJ)
# NB: we can't use the normal $(CC_) here because msvccmd.mak
# adds /Za which conflicts with the cups source.
-LCUPS_CC=$(CUPS_CC) $(I_)$(LIBCUPSSRC) $(I_)$(LIBCUPSGEN)$(D)cups $(I_)$(LCUPSSRCDIR)$(D)libs
+LCUPS_CC=$(CUPS_CC) $(I_)$(LIBCUPSSRC) $(I_)$(LIBCUPSGEN)$(D)cups $(I_)$(LCUPSSRCDIR)$(D)libs
# Define the name of this makefile.
LCUPS_MAK=$(GLSRC)lcups.mak $(TOP_MAKEFILES)
@@ -79,7 +79,7 @@ LIBCUPS_OBJS =\
$(LIBCUPSOBJ)cups_snpf.$(OBJ) \
$(LIBCUPSOBJ)usersys.$(OBJ) \
$(LIBCUPSOBJ)ppd-cache.$(OBJ) \
- $(LIBCUPSOBJ)thread.$(OBJ)
+ $(LIBCUPSOBJ)thread.$(OBJ)
# $(LIBCUPSOBJ)sidechannel.$(OBJ) \
# $(LIBCUPSOBJ)getifaddrs.$(OBJ) \
# $(LIBCUPSOBJ)pwg-ppd.$(OBJ) \
@@ -138,12 +138,12 @@ $(LIBCUPSGEN)lcups_0.dev : $(ECHOGS_XE) $(LIBCUPS_OBJS) $(LIBCUPS_DEPS)
$(LIBCUPSGEN)$(D)cups$(D)config.h : $(LCUPSSRCDIR)$(D)libs$(D)config$(LCUPSBUILDTYPE).h $(LIBCUPS_DEPS)
$(CP_) $(LCUPSSRCDIR)$(D)libs$(D)config$(LCUPSBUILDTYPE).h $(LIBCUPSGEN)$(D)cups$(D)config.h
-$(LIBCUPSOBJ)adminutil.$(OBJ) : $(LIBCUPSSRC)adminutil.c $(LIBCUPSGEN)$(D)cups$(D)config.h $(LIBCUPS_DEPS)
+$(LIBCUPSOBJ)adminutil.$(OBJ) : $(LIBCUPSSRC)adminutil.c $(LIBCUPSGEN)$(D)cups$(D)config.h $(LIBCUPS_DEPS)
$(LCUPS_CC) $(LCUPSO_)adminutil.$(OBJ) $(C_) $(LIBCUPSSRC)adminutil.c
-
+
$(LIBCUPSOBJ)array.$(OBJ) : $(LIBCUPSSRC)array.c $(LIBCUPS_DEPS)
$(LCUPS_CC) $(LCUPSO_)array.$(OBJ) $(C_) $(LIBCUPSSRC)array.c
-
+
$(LIBCUPSOBJ)attr.$(OBJ) : $(LIBCUPSSRC)attr.c $(LIBCUPS_DEPS)
$(LCUPS_CC) $(LCUPSO_)attr.$(OBJ) $(C_) $(LIBCUPSSRC)attr.c
diff --git a/base/lcupsi.mak b/base/lcupsi.mak
index 5b861174..f2ec1c04 100644
--- a/base/lcupsi.mak
+++ b/base/lcupsi.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -32,7 +32,7 @@ LCUPSIO_=$(O_)$(LIBCUPSIOBJ)
# NB: we can't use the normal $(CC_) here because msvccmd.mak
# adds /Za which conflicts with the cups source.
LCUPSI_CC=$(CUPS_CC) $(I_)$(LIBCUPSISRC) $(I_)$(LIBCUPSIGEN)$(D)cups $(I_)$(LCUPSISRCDIR)$(D)libs $(I_)$(GLGENDIR) \
- $(I_)$(ZSRCDIR) $(I_)$(PNGSRCDIR) $(I_)$(TIFFSRCDIR) $(I_)$(TIFFCONFDIR) $(I_)$(TI_)
+ $(I_)$(ZSRCDIR) $(I_)$(PNGSRCDIR) $(I_)$(TIFFSRCDIR) $(I_)$(TIFFCONFDIR) $(I_)$(TI_)
# Define the name of this makefile.
LCUPSI_MAK=$(GLSRC)lcupsi.mak $(TOP_MAKEFILES)
@@ -77,49 +77,49 @@ $(LIBCUPSIOBJ)image-bmp.$(OBJ) : $(LIBCUPSISRC)image-bmp.c $(LIBCUPSI_DEPS)
$(LIBCUPSIOBJ)image-colorspace.$(OBJ) : $(LIBCUPSISRC)image-colorspace.c $(LIBCUPSI_DEPS)
$(LCUPSI_CC) $(LCUPSIO_)image-colorspace.$(OBJ) $(C_) $(LIBCUPSISRC)image-colorspace.c
-
+
$(LIBCUPSIOBJ)image-gif.$(OBJ) : $(LIBCUPSISRC)image-gif.c $(LIBCUPSI_DEPS)
$(LCUPSI_CC) $(LCUPSIO_)image-gif.$(OBJ) $(C_) $(LIBCUPSISRC)image-gif.c
-
+
$(LIBCUPSIOBJ)image-jpeg.$(OBJ) : $(LIBCUPSISRC)image-jpeg.c $(LIBCUPSI_DEPS)
$(LCUPSI_CC) $(LCUPSIO_)image-jpeg.$(OBJ) $(C_) $(LIBCUPSISRC)image-jpeg.c
-
+
$(LIBCUPSIOBJ)image-photocd.$(OBJ) : $(LIBCUPSISRC)image-photocd.c $(LIBCUPSI_DEPS)
$(LCUPSI_CC) $(LCUPSIO_)image-photocd.$(OBJ) $(C_) $(LIBCUPSISRC)image-photocd.c
-
+
$(LIBCUPSIOBJ)image-pix.$(OBJ) : $(LIBCUPSISRC)image-pix.c $(LIBCUPSI_DEPS)
$(LCUPSI_CC) $(LCUPSIO_)image-pix.$(OBJ) $(C_) $(LIBCUPSISRC)image-pix.c
-
+
$(LIBCUPSIOBJ)image-png.$(OBJ) : $(LIBCUPSISRC)image-png.c $(LIBCUPSI_DEPS)
$(LCUPSI_CC) $(LCUPSIO_)image-png.$(OBJ) $(C_) $(LIBCUPSISRC)image-png.c
-
+
$(LIBCUPSIOBJ)image-pnm.$(OBJ) : $(LIBCUPSISRC)image-pnm.c $(LIBCUPSI_DEPS)
$(LCUPSI_CC) $(LCUPSIO_)image-pnm.$(OBJ) $(C_) $(LIBCUPSISRC)image-pnm.c
-
+
$(LIBCUPSIOBJ)image-sgi.$(OBJ) : $(LIBCUPSISRC)image-sgi.c $(LIBCUPSI_DEPS)
$(LCUPSI_CC) $(LCUPSIO_)image-sgi.$(OBJ) $(C_) $(LIBCUPSISRC)image-sgi.c
-
+
$(LIBCUPSIOBJ)image-sgilib.$(OBJ) : $(LIBCUPSISRC)image-sgilib.c $(LIBCUPSI_DEPS)
$(LCUPSI_CC) $(LCUPSIO_)image-sgilib.$(OBJ) $(C_) $(LIBCUPSISRC)image-sgilib.c
-
+
$(LIBCUPSIOBJ)image-sun.$(OBJ) : $(LIBCUPSISRC)image-sun.c $(LIBCUPSI_DEPS)
$(LCUPSI_CC) $(LCUPSIO_)image-sun.$(OBJ) $(C_) $(LIBCUPSISRC)image-sun.c
-
+
$(LIBCUPSIOBJ)image-tiff.$(OBJ) : $(LIBCUPSISRC)image-tiff.c $(LIBCUPSI_DEPS)
$(LCUPSI_CC) $(LCUPSIO_)image-tiff.$(OBJ) $(C_) $(LIBCUPSISRC)image-tiff.c
-
+
$(LIBCUPSIOBJ)image-zoom.$(OBJ) : $(LIBCUPSISRC)image-zoom.c $(LIBCUPSI_DEPS)
$(LCUPSI_CC) $(LCUPSIO_)image-zoom.$(OBJ) $(C_) $(LIBCUPSISRC)image-zoom.c
-
+
$(LIBCUPSIOBJ)image.$(OBJ) : $(LIBCUPSISRC)image.c $(LIBCUPSI_DEPS)
$(LCUPSI_CC) $(LCUPSIO_)image.$(OBJ) $(C_) $(LIBCUPSISRC)image.c
-
+
$(LIBCUPSIOBJ)error.$(OBJ) : $(LIBCUPSISRC)error.c $(LIBCUPSI_DEPS)
$(LCUPSI_CC) $(LCUPSIO_)error.$(OBJ) $(C_) $(LIBCUPSISRC)error.c
-
+
$(LIBCUPSIOBJ)interpret.$(OBJ) : $(LIBCUPSISRC)interpret.c $(LIBCUPSI_DEPS)
$(LCUPSI_CC) $(LCUPSIO_)interpret.$(OBJ) $(C_) $(LIBCUPSISRC)interpret.c
-
+
$(LIBCUPSIOBJ)cupsraster.$(OBJ) : $(LIBCUPSISRC)cupsraster.c $(LIBCUPSI_DEPS)
$(LCUPSI_CC) $(LCUPSIO_)cupsraster.$(OBJ) $(C_) $(LIBCUPSISRC)cupsraster.c
-
+
diff --git a/base/ldf_jb2.mak b/base/ldf_jb2.mak
deleted file mode 100644
index 5005d80a..00000000
--- a/base/ldf_jb2.mak
+++ /dev/null
@@ -1,497 +0,0 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
-# All Rights Reserved.
-#
-# This software is provided AS-IS with no warranty, either express or
-# implied.
-#
-# This software is distributed under license and may not be copied,
-# modified or distributed except as expressly authorized under the terms
-# of the license contained in the file LICENSE in this distribution.
-#
-# Refer to licensing information at http://www.artifex.com or contact
-# Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
-# CA 94945, U.S.A., +1(415)492-9861, for further information.
-#
-
-# makefile for Luratech ldf_jb2 library code.
-# Users of this makefile must define the following:
-# SHARE_JBIG2 - whether to compile in or link to the library
-# JBIG2SRCDIR - the library source directory
-#
-# gs.mak and friends define the following:
-# JBIG2OBJDIR - the output obj directory
-# JBIG2GENDIR - generated (.dev) file directory
-# LDF_JB2I_ - include path for the library
-# JB2CF_ - cflags for building the library
-#
-# We define the ldf_jb2.dev target and its dependencies
-#
-# This partial makefile compiles the ldf_jb2 library for use in
-# Ghostscript.
-
-LDF_JB2_MAK=$(GLSRC)ldf_jb2.mak $(TOP_MAKEFILES)
-
-LDF_JB2_SRC=$(JBIG2SRCDIR)$(D)
-LDF_JB2_GEN=$(JBIG2OBJDIR)$(D)
-LDF_JB2_OBJ=$(JBIG2OBJDIR)$(D)
-
-# paths to source directories
-LDF_JB2_COMMON=$(JBIG2SRCDIR)$(D)source$(D)common$(D)
-LDF_JB2_COMPRESS=$(JBIG2SRCDIR)$(D)source$(D)compress$(D)
-
-
-# source files to build from the CSDK source
-
-ldf_jb2_common_OBJS = \
- $(LDF_JB2_OBJ)jb2_adt_cache.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_context_buffer.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_context_decoder.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_context_ref_buffer.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_context_ref_decoder.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_decoder_collective_bitmap.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_decoder_generic_region.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_decoder_halftone_region.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_decoder_pattern_dict.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_decoder_symbol_dict.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_decoder_text_region.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_external_cache.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_file.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_file_extras.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_handle_document.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_huffman_decoder.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_huffman_table.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_huffman_table_standard.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_huffman_table_symbol.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_huffman_table_user_defined.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_huffman_tree.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_location.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_memory.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_message.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_mmr_decoder.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_mmr_tables.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_mq_decoder.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_mq_state.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_pattern_dict.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_pdf_file.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_pdf_stream.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_props_decompress.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_read_bit_buffer.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_read_data.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_render_common.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_render_generic_region.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_render_halftone_region.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_render_text_region.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_segment.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_segment_array.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_segment_end_of_stripe.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_segment_generic_region.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_segment_halftone_region.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_segment_page_info.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_segment_pattern_dict.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_segment_region.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_segment_symbol_dict.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_segment_table.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_segment_text_region.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_segment_types.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_symbol.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_symbol_dict.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_symbol_instance.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_write_bits.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_write_data.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_write_pdf.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_common.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_license_dummy.$(OBJ)
-
-ldf_jb2_compress_OBJS = \
- $(LDF_JB2_OBJ)jb2_adt_component.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_component_class.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_component_group.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_component_match.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_context_encoder.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_context_ref_encoder.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_encoder_generic_region.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_encoder_symbol_dict.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_encoder_text_region.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_handle_compress.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_huffman_encoder.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_mmr_encoder.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_mq_encoder.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_props_compress.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_run_array.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_stack.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_stripe_clean_up.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_stripe_encoder.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_stripe_half_tone.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_stripe_preprocessing.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_stripe_text.$(OBJ) \
- $(LDF_JB2_OBJ)jb2_adt_symbol_unify.$(OBJ)
-
-ldf_jb2_common_HDRS = \
- $(LDF_JB2_COMMON)jb2_adt_cache.h \
- $(LDF_JB2_COMMON)jb2_adt_context_buffer.h \
- $(LDF_JB2_COMMON)jb2_adt_context_decoder.h \
- $(LDF_JB2_COMMON)jb2_adt_context_ref_buffer.h \
- $(LDF_JB2_COMMON)jb2_adt_context_ref_decoder.h \
- $(LDF_JB2_COMMON)jb2_adt_decoder_collective_bitmap.h \
- $(LDF_JB2_COMMON)jb2_adt_decoder_generic_region.h \
- $(LDF_JB2_COMMON)jb2_adt_decoder_halftone_region.h \
- $(LDF_JB2_COMMON)jb2_adt_decoder_pattern_dict.h \
- $(LDF_JB2_COMMON)jb2_adt_decoder_symbol_dict.h \
- $(LDF_JB2_COMMON)jb2_adt_decoder_text_region.h \
- $(LDF_JB2_COMMON)jb2_adt_external_cache.h \
- $(LDF_JB2_COMMON)jb2_adt_file.h \
- $(LDF_JB2_COMMON)jb2_adt_file_extras.h \
- $(LDF_JB2_COMMON)jb2_adt_huffman_decoder.h \
- $(LDF_JB2_COMMON)jb2_adt_huffman_table.h \
- $(LDF_JB2_COMMON)jb2_adt_huffman_table_entry.h \
- $(LDF_JB2_COMMON)jb2_adt_huffman_table_standard.h \
- $(LDF_JB2_COMMON)jb2_adt_huffman_table_symbol.h \
- $(LDF_JB2_COMMON)jb2_adt_huffman_table_user_defined.h \
- $(LDF_JB2_COMMON)jb2_adt_huffman_tree.h \
- $(LDF_JB2_COMMON)jb2_adt_location.h \
- $(LDF_JB2_COMMON)jb2_adt_memory.h \
- $(LDF_JB2_COMMON)jb2_adt_message.h \
- $(LDF_JB2_COMMON)jb2_adt_mmr_decoder.h \
- $(LDF_JB2_COMMON)jb2_adt_mmr_tables.h \
- $(LDF_JB2_COMMON)jb2_adt_mq_decoder.h \
- $(LDF_JB2_COMMON)jb2_adt_mq_ids.h \
- $(LDF_JB2_COMMON)jb2_adt_mq_state.h \
- $(LDF_JB2_COMMON)jb2_adt_pattern_dict.h \
- $(LDF_JB2_COMMON)jb2_adt_pdf_file.h \
- $(LDF_JB2_COMMON)jb2_adt_pdf_stream.h \
- $(LDF_JB2_COMMON)jb2_adt_props_decompress.h \
- $(LDF_JB2_COMMON)jb2_adt_read_bit_buffer.h \
- $(LDF_JB2_COMMON)jb2_adt_read_data.h \
- $(LDF_JB2_COMMON)jb2_adt_render_common.h \
- $(LDF_JB2_COMMON)jb2_adt_render_generic_region.h \
- $(LDF_JB2_COMMON)jb2_adt_render_halftone_region.h \
- $(LDF_JB2_COMMON)jb2_adt_render_text_region.h \
- $(LDF_JB2_COMMON)jb2_adt_segment.h \
- $(LDF_JB2_COMMON)jb2_adt_segment_array.h \
- $(LDF_JB2_COMMON)jb2_adt_segment_end_of_file.h \
- $(LDF_JB2_COMMON)jb2_adt_segment_end_of_page.h \
- $(LDF_JB2_COMMON)jb2_adt_segment_end_of_stripe.h \
- $(LDF_JB2_COMMON)jb2_adt_segment_generic_region.h \
- $(LDF_JB2_COMMON)jb2_adt_segment_halftone_region.h \
- $(LDF_JB2_COMMON)jb2_adt_segment_page_info.h \
- $(LDF_JB2_COMMON)jb2_adt_segment_pattern_dict.h \
- $(LDF_JB2_COMMON)jb2_adt_segment_region.h \
- $(LDF_JB2_COMMON)jb2_adt_segment_symbol_dict.h \
- $(LDF_JB2_COMMON)jb2_adt_segment_table.h \
- $(LDF_JB2_COMMON)jb2_adt_segment_text_region.h \
- $(LDF_JB2_COMMON)jb2_adt_segment_types.h \
- $(LDF_JB2_COMMON)jb2_adt_symbol.h \
- $(LDF_JB2_COMMON)jb2_adt_symbol_array.h \
- $(LDF_JB2_COMMON)jb2_adt_symbol_dict.h \
- $(LDF_JB2_COMMON)jb2_adt_symbol_instance.h \
- $(LDF_JB2_COMMON)jb2_adt_symbol_instance_array.h \
- $(LDF_JB2_COMMON)jb2_adt_write_bits.h \
- $(LDF_JB2_COMMON)jb2_adt_write_data.h \
- $(LDF_JB2_COMMON)jb2_adt_write_pdf.h \
- $(LDF_JB2_COMMON)jb2_common.h \
- $(LDF_JB2_COMMON)jb2_defines.h \
- $(LDF_JB2_COMMON)jb2_license.h
-
-ldf_jb2_compress_HDRS = \
- $(LDF_JB2_COMPRESS)jb2_adt_run_array.h \
- $(LDF_JB2_COMPRESS)jb2_adt_encoder_text_region.h \
- $(LDF_JB2_COMPRESS)jb2_adt_context_ref_encoder.h \
- $(LDF_JB2_COMPRESS)jb2_adt_encoder_generic_region.h \
- $(LDF_JB2_COMPRESS)jb2_adt_props_compress.h \
- $(LDF_JB2_COMPRESS)jb2_adt_component_match.h \
- $(LDF_JB2_COMPRESS)jb2_adt_symbol_unify.h \
- $(LDF_JB2_COMPRESS)jb2_adt_huffman_encoder.h \
- $(LDF_JB2_COMPRESS)jb2_adt_stripe_half_tone.h \
- $(LDF_JB2_COMPRESS)jb2_adt_component.h \
- $(LDF_JB2_COMPRESS)jb2_adt_stripe_clean_up.h \
- $(LDF_JB2_COMPRESS)jb2_adt_run.h \
- $(LDF_JB2_COMPRESS)jb2_adt_stripe_text.h \
- $(LDF_JB2_COMPRESS)jb2_adt_stack.h \
- $(LDF_JB2_COMPRESS)jb2_adt_component_group.h \
- $(LDF_JB2_COMPRESS)jb2_adt_encoder_symbol_dict.h \
- $(LDF_JB2_COMPRESS)jb2_adt_context_encoder.h \
- $(LDF_JB2_COMPRESS)jb2_adt_component_array.h \
- $(LDF_JB2_COMPRESS)jb2_adt_mq_encoder.h \
- $(LDF_JB2_COMPRESS)jb2_adt_mmr_encoder.h \
- $(LDF_JB2_COMPRESS)jb2_adt_stripe_preprocessing.h \
- $(LDF_JB2_COMPRESS)jb2_adt_component_class.h \
- $(LDF_JB2_COMPRESS)jb2_adt_stripe_encoder.h
-
-
-ldf_jb2_OBJS=$(ldf_jb2_common_OBJS) $(ldf_jb2_compress_OBJS)
-ldf_jb2_HDRS=$(ldf_jb2_common_HDRS) $(ldf_jb2_compress_HDRS)
-
-# switch in the selected library .dev
-$(LDF_JB2_GEN)ldf_jb2.dev : $(LDF_JB2_GEN)ldf_jb2_$(SHARE_JBIG2).dev \
- $(LDF_JB2_MAK) $(MAKEDIRS)
- $(CP_) $(LDF_JB2_GEN)ldf_jb2_$(SHARE_JBIG2).dev $(LDF_JB2_GEN)ldf_jb2.dev
-
-# external link .dev
-$(LDF_JB2_GEN)ldf_jb2_1.dev : $(ECHOGS_XE) \
- $(LDF_JB2_MAK) $(MAKEDIRS)
- $(SETMOD) $(LDF_JB2_GEN)ldf_jb2_1 -lib ldf_jb2
-
-# compile our own .dev
-$(LDF_JB2_GEN)ldf_jb2_0.dev : $(ECHOGS_XE) $(ldf_jb2_OBJS) \
- $(LDF_JB2_MAK) $(MAKEDIRS)
- $(SETMOD) $(LDF_JB2_GEN)ldf_jb2_0 $(ldf_jb2_common_OBJS)
- $(ADDMOD) $(LDF_JB2_GEN)ldf_jb2_0 $(ldf_jb2_compress_OBJS)
-
-# define our specific compiler
-LDF_JB2_CC=$(CC_) $(I_)$(LDF_JB2I_) $(II)$(LDF_JB2_COMMON) $(II)$(LDF_JB2_COMPRESS)$(_I) $(JB2CF_)
-LDF_JB2_O=$(O_)$(LDF_JB2_OBJ)
-
-LDF_JB2_DEP=$(AK) $(LDF_JB2_MAK) $(MAKEDIRS)
-
-
-# explicit rules for building each source file
-# for simplicity we have every source file depend on all headers
-
-$(LDF_JB2_OBJ)jb2_adt_cache.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_cache.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_cache.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_cache.c
-
-$(LDF_JB2_OBJ)jb2_adt_context_buffer.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_context_buffer.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_context_buffer.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_context_buffer.c
-
-$(LDF_JB2_OBJ)jb2_adt_context_decoder.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_context_decoder.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_context_decoder.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_context_decoder.c
-
-$(LDF_JB2_OBJ)jb2_adt_context_ref_buffer.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_context_ref_buffer.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_context_ref_buffer.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_context_ref_buffer.c
-
-$(LDF_JB2_OBJ)jb2_adt_context_ref_decoder.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_context_ref_decoder.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_context_ref_decoder.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_context_ref_decoder.c
-
-$(LDF_JB2_OBJ)jb2_adt_decoder_collective_bitmap.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_decoder_collective_bitmap.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_decoder_collective_bitmap.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_decoder_collective_bitmap.c
-
-$(LDF_JB2_OBJ)jb2_adt_decoder_generic_region.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_decoder_generic_region.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_decoder_generic_region.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_decoder_generic_region.c
-
-$(LDF_JB2_OBJ)jb2_adt_decoder_halftone_region.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_decoder_halftone_region.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_decoder_halftone_region.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_decoder_halftone_region.c
-
-$(LDF_JB2_OBJ)jb2_adt_decoder_pattern_dict.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_decoder_pattern_dict.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_decoder_pattern_dict.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_decoder_pattern_dict.c
-
-$(LDF_JB2_OBJ)jb2_adt_decoder_symbol_dict.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_decoder_symbol_dict.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_decoder_symbol_dict.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_decoder_symbol_dict.c
-
-$(LDF_JB2_OBJ)jb2_adt_decoder_text_region.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_decoder_text_region.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_decoder_text_region.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_decoder_text_region.c
-
-$(LDF_JB2_OBJ)jb2_adt_external_cache.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_external_cache.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_external_cache.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_external_cache.c
-
-$(LDF_JB2_OBJ)jb2_adt_file.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_file.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_file.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_file.c
-
-$(LDF_JB2_OBJ)jb2_adt_file_extras.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_file_extras.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_file_extras.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_file_extras.c
-
-$(LDF_JB2_OBJ)jb2_adt_handle_document.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_handle_document.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_handle_document.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_handle_document.c
-
-$(LDF_JB2_OBJ)jb2_adt_huffman_decoder.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_huffman_decoder.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_huffman_decoder.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_huffman_decoder.c
-
-$(LDF_JB2_OBJ)jb2_adt_huffman_table.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_huffman_table.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_huffman_table.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_huffman_table.c
-
-$(LDF_JB2_OBJ)jb2_adt_huffman_table_standard.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_huffman_table_standard.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_huffman_table_standard.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_huffman_table_standard.c
-
-$(LDF_JB2_OBJ)jb2_adt_huffman_table_symbol.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_huffman_table_symbol.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_huffman_table_symbol.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_huffman_table_symbol.c
-
-$(LDF_JB2_OBJ)jb2_adt_huffman_table_user_defined.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_huffman_table_user_defined.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_huffman_table_user_defined.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_huffman_table_user_defined.c
-
-$(LDF_JB2_OBJ)jb2_adt_huffman_tree.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_huffman_tree.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_huffman_tree.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_huffman_tree.c
-
-$(LDF_JB2_OBJ)jb2_adt_location.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_location.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_location.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_location.c
-
-$(LDF_JB2_OBJ)jb2_adt_memory.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_memory.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_memory.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_memory.c
-
-$(LDF_JB2_OBJ)jb2_adt_message.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_message.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_message.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_message.c
-
-$(LDF_JB2_OBJ)jb2_adt_mmr_decoder.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_mmr_decoder.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_mmr_decoder.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_mmr_decoder.c
-
-$(LDF_JB2_OBJ)jb2_adt_mmr_tables.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_mmr_tables.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_mmr_tables.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_mmr_tables.c
-
-$(LDF_JB2_OBJ)jb2_adt_mq_decoder.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_mq_decoder.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_mq_decoder.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_mq_decoder.c
-
-$(LDF_JB2_OBJ)jb2_adt_mq_state.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_mq_state.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_mq_state.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_mq_state.c
-
-$(LDF_JB2_OBJ)jb2_adt_pattern_dict.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_pattern_dict.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_pattern_dict.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_pattern_dict.c
-
-$(LDF_JB2_OBJ)jb2_adt_pdf_file.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_pdf_file.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_pdf_file.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_pdf_file.c
-
-$(LDF_JB2_OBJ)jb2_adt_pdf_stream.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_pdf_stream.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_pdf_stream.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_pdf_stream.c
-
-$(LDF_JB2_OBJ)jb2_adt_props_decompress.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_props_decompress.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_props_decompress.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_props_decompress.c
-
-$(LDF_JB2_OBJ)jb2_adt_read_bit_buffer.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_read_bit_buffer.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_read_bit_buffer.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_read_bit_buffer.c
-
-$(LDF_JB2_OBJ)jb2_adt_read_data.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_read_data.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_read_data.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_read_data.c
-
-$(LDF_JB2_OBJ)jb2_adt_render_common.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_render_common.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_render_common.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_render_common.c
-
-$(LDF_JB2_OBJ)jb2_adt_render_generic_region.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_render_generic_region.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_render_generic_region.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_render_generic_region.c
-
-$(LDF_JB2_OBJ)jb2_adt_render_halftone_region.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_render_halftone_region.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_render_halftone_region.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_render_halftone_region.c
-
-$(LDF_JB2_OBJ)jb2_adt_render_text_region.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_render_text_region.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_render_text_region.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_render_text_region.c
-
-$(LDF_JB2_OBJ)jb2_adt_segment.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_segment.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_segment.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_segment.c
-
-$(LDF_JB2_OBJ)jb2_adt_segment_array.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_segment_array.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_segment_array.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_segment_array.c
-
-$(LDF_JB2_OBJ)jb2_adt_segment_end_of_file.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_segment_end_of_file.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_segment_end_of_file.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_segment_end_of_file.c
-
-$(LDF_JB2_OBJ)jb2_adt_segment_end_of_page.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_segment_end_of_page.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_segment_end_of_page.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_segment_end_of_page.c
-
-$(LDF_JB2_OBJ)jb2_adt_segment_end_of_stripe.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_segment_end_of_stripe.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_segment_end_of_stripe.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_segment_end_of_stripe.c
-
-$(LDF_JB2_OBJ)jb2_adt_segment_generic_region.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_segment_generic_region.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_segment_generic_region.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_segment_generic_region.c
-
-$(LDF_JB2_OBJ)jb2_adt_segment_halftone_region.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_segment_halftone_region.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_segment_halftone_region.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_segment_halftone_region.c
-
-$(LDF_JB2_OBJ)jb2_adt_segment_page_info.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_segment_page_info.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_segment_page_info.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_segment_page_info.c
-
-$(LDF_JB2_OBJ)jb2_adt_segment_pattern_dict.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_segment_pattern_dict.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_segment_pattern_dict.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_segment_pattern_dict.c
-
-$(LDF_JB2_OBJ)jb2_adt_segment_region.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_segment_region.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_segment_region.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_segment_region.c
-
-$(LDF_JB2_OBJ)jb2_adt_segment_symbol_dict.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_segment_symbol_dict.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_segment_symbol_dict.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_segment_symbol_dict.c
-
-$(LDF_JB2_OBJ)jb2_adt_segment_table.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_segment_table.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_segment_table.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_segment_table.c
-
-$(LDF_JB2_OBJ)jb2_adt_segment_text_region.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_segment_text_region.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_segment_text_region.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_segment_text_region.c
-
-$(LDF_JB2_OBJ)jb2_adt_segment_types.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_segment_types.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_segment_types.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_segment_types.c
-
-$(LDF_JB2_OBJ)jb2_adt_symbol.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_symbol.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_symbol.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_symbol.c
-
-$(LDF_JB2_OBJ)jb2_adt_symbol_dict.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_symbol_dict.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_symbol_dict.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_symbol_dict.c
-
-$(LDF_JB2_OBJ)jb2_adt_symbol_instance.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_symbol_instance.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_symbol_instance.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_symbol_instance.c
-
-$(LDF_JB2_OBJ)jb2_adt_write_bits.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_write_bits.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_write_bits.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_write_bits.c
-
-$(LDF_JB2_OBJ)jb2_adt_write_data.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_write_data.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_write_data.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_write_data.c
-
-$(LDF_JB2_OBJ)jb2_adt_write_pdf.$(OBJ) : $(LDF_JB2_COMMON)jb2_adt_write_pdf.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_write_pdf.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_adt_write_pdf.c
-
-$(LDF_JB2_OBJ)jb2_common.$(OBJ) : $(LDF_JB2_COMMON)jb2_common.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_common.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_common.c
-
-$(LDF_JB2_OBJ)jb2_license_dummy.$(OBJ) : $(LDF_JB2_COMMON)jb2_license_dummy.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_license_dummy.$(OBJ) $(C_) $(LDF_JB2_COMMON)jb2_license_dummy.c
-
-$(LDF_JB2_OBJ)jb2_adt_component.$(OBJ) : $(LDF_JB2_COMPRESS)jb2_adt_component.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_component.$(OBJ) $(C_) $(LDF_JB2_COMPRESS)jb2_adt_component.c
-
-$(LDF_JB2_OBJ)jb2_adt_component_class.$(OBJ) : $(LDF_JB2_COMPRESS)jb2_adt_component_class.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_component_class.$(OBJ) $(C_) $(LDF_JB2_COMPRESS)jb2_adt_component_class.c
-
-$(LDF_JB2_OBJ)jb2_adt_component_group.$(OBJ) : $(LDF_JB2_COMPRESS)jb2_adt_component_group.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_component_group.$(OBJ) $(C_) $(LDF_JB2_COMPRESS)jb2_adt_component_group.c
-
-$(LDF_JB2_OBJ)jb2_adt_component_match.$(OBJ) : $(LDF_JB2_COMPRESS)jb2_adt_component_match.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_component_match.$(OBJ) $(C_) $(LDF_JB2_COMPRESS)jb2_adt_component_match.c
-
-$(LDF_JB2_OBJ)jb2_adt_context_encoder.$(OBJ) : $(LDF_JB2_COMPRESS)jb2_adt_context_encoder.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_context_encoder.$(OBJ) $(C_) $(LDF_JB2_COMPRESS)jb2_adt_context_encoder.c
-
-$(LDF_JB2_OBJ)jb2_adt_context_ref_encoder.$(OBJ) : $(LDF_JB2_COMPRESS)jb2_adt_context_ref_encoder.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_context_ref_encoder.$(OBJ) $(C_) $(LDF_JB2_COMPRESS)jb2_adt_context_ref_encoder.c
-
-$(LDF_JB2_OBJ)jb2_adt_encoder_generic_region.$(OBJ) : $(LDF_JB2_COMPRESS)jb2_adt_encoder_generic_region.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_encoder_generic_region.$(OBJ) $(C_) $(LDF_JB2_COMPRESS)jb2_adt_encoder_generic_region.c
-
-$(LDF_JB2_OBJ)jb2_adt_encoder_symbol_dict.$(OBJ) : $(LDF_JB2_COMPRESS)jb2_adt_encoder_symbol_dict.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_encoder_symbol_dict.$(OBJ) $(C_) $(LDF_JB2_COMPRESS)jb2_adt_encoder_symbol_dict.c
-
-$(LDF_JB2_OBJ)jb2_adt_encoder_text_region.$(OBJ) : $(LDF_JB2_COMPRESS)jb2_adt_encoder_text_region.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_encoder_text_region.$(OBJ) $(C_) $(LDF_JB2_COMPRESS)jb2_adt_encoder_text_region.c
-
-$(LDF_JB2_OBJ)jb2_adt_handle_compress.$(OBJ) : $(LDF_JB2_COMPRESS)jb2_adt_handle_compress.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_handle_compress.$(OBJ) $(C_) $(LDF_JB2_COMPRESS)jb2_adt_handle_compress.c
-
-$(LDF_JB2_OBJ)jb2_adt_huffman_encoder.$(OBJ) : $(LDF_JB2_COMPRESS)jb2_adt_huffman_encoder.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_huffman_encoder.$(OBJ) $(C_) $(LDF_JB2_COMPRESS)jb2_adt_huffman_encoder.c
-
-$(LDF_JB2_OBJ)jb2_adt_mmr_encoder.$(OBJ) : $(LDF_JB2_COMPRESS)jb2_adt_mmr_encoder.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_mmr_encoder.$(OBJ) $(C_) $(LDF_JB2_COMPRESS)jb2_adt_mmr_encoder.c
-
-$(LDF_JB2_OBJ)jb2_adt_mq_encoder.$(OBJ) : $(LDF_JB2_COMPRESS)jb2_adt_mq_encoder.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_mq_encoder.$(OBJ) $(C_) $(LDF_JB2_COMPRESS)jb2_adt_mq_encoder.c
-
-$(LDF_JB2_OBJ)jb2_adt_props_compress.$(OBJ) : $(LDF_JB2_COMPRESS)jb2_adt_props_compress.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_props_compress.$(OBJ) $(C_) $(LDF_JB2_COMPRESS)jb2_adt_props_compress.c
-
-$(LDF_JB2_OBJ)jb2_adt_run_array.$(OBJ) : $(LDF_JB2_COMPRESS)jb2_adt_run_array.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_run_array.$(OBJ) $(C_) $(LDF_JB2_COMPRESS)jb2_adt_run_array.c
-
-$(LDF_JB2_OBJ)jb2_adt_stack.$(OBJ) : $(LDF_JB2_COMPRESS)jb2_adt_stack.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_stack.$(OBJ) $(C_) $(LDF_JB2_COMPRESS)jb2_adt_stack.c
-
-$(LDF_JB2_OBJ)jb2_adt_stripe_clean_up.$(OBJ) : $(LDF_JB2_COMPRESS)jb2_adt_stripe_clean_up.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_stripe_clean_up.$(OBJ) $(C_) $(LDF_JB2_COMPRESS)jb2_adt_stripe_clean_up.c
-
-$(LDF_JB2_OBJ)jb2_adt_stripe_encoder.$(OBJ) : $(LDF_JB2_COMPRESS)jb2_adt_stripe_encoder.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_stripe_encoder.$(OBJ) $(C_) $(LDF_JB2_COMPRESS)jb2_adt_stripe_encoder.c
-
-$(LDF_JB2_OBJ)jb2_adt_stripe_half_tone.$(OBJ) : $(LDF_JB2_COMPRESS)jb2_adt_stripe_half_tone.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_stripe_half_tone.$(OBJ) $(C_) $(LDF_JB2_COMPRESS)jb2_adt_stripe_half_tone.c
-
-$(LDF_JB2_OBJ)jb2_adt_stripe_preprocessing.$(OBJ) : $(LDF_JB2_COMPRESS)jb2_adt_stripe_preprocessing.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_stripe_preprocessing.$(OBJ) $(C_) $(LDF_JB2_COMPRESS)jb2_adt_stripe_preprocessing.c
-
-$(LDF_JB2_OBJ)jb2_adt_stripe_text.$(OBJ) : $(LDF_JB2_COMPRESS)jb2_adt_stripe_text.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_stripe_text.$(OBJ) $(C_) $(LDF_JB2_COMPRESS)jb2_adt_stripe_text.c
-
-$(LDF_JB2_OBJ)jb2_adt_symbol_unify.$(OBJ) : $(LDF_JB2_COMPRESS)jb2_adt_symbol_unify.c $(ldf_jb2_HDRS) $(LDF_JB2_DEP)
- $(LDF_JB2_CC) $(LDF_JB2_O)jb2_adt_symbol_unify.$(OBJ) $(C_) $(LDF_JB2_COMPRESS)jb2_adt_symbol_unify.c
-
-
-# end of file
diff --git a/base/leptonica.mak b/base/leptonica.mak
index 0929e376..df72241d 100644
--- a/base/leptonica.mak
+++ b/base/leptonica.mak
@@ -108,9 +108,6 @@ $(LEPTOBJ)classapp.$(OBJ) : $(LEPTONICADIR)/src/classapp.c $(LEPTDEPS)
$(LEPTOBJ)colorcontent.$(OBJ) : $(LEPTONICADIR)/src/colorcontent.c $(LEPTDEPS)
$(LEPTCC) $(LEPTO_)colorcontent.$(OBJ) $(C_) $(LEPTONICADIR)/src/colorcontent.c
-$(LEPTOBJ)colorinfo.$(OBJ) : $(LEPTONICADIR)/src/colorinfo.c $(LEPTDEPS)
- $(LEPTCC) $(LEPTO_)colorinfo.$(OBJ) $(C_) $(LEPTONICADIR)/src/colorinfo.c
-
$(LEPTOBJ)coloring.$(OBJ) : $(LEPTONICADIR)/src/coloring.c $(LEPTDEPS)
$(LEPTCC) $(LEPTO_)coloring.$(OBJ) $(C_) $(LEPTONICADIR)/src/coloring.c
@@ -515,7 +512,6 @@ LEPTONICA_OBJS=\
$(LEPTOBJ)ccbord.$(OBJ)\
$(LEPTOBJ)classapp.$(OBJ)\
$(LEPTOBJ)colorcontent.$(OBJ)\
- $(LEPTOBJ)colorinfo.$(OBJ)\
$(LEPTOBJ)coloring.$(OBJ)\
$(LEPTOBJ)colormap.$(OBJ)\
$(LEPTOBJ)colormorph.$(OBJ)\
diff --git a/base/lib.mak b/base/lib.mak
index 0c2dffb9..f6845c97 100644
--- a/base/lib.mak
+++ b/base/lib.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -44,14 +44,17 @@ GLINCLUDES=$(I_)$(GLI_)$(_I)
GLCCFLAGS=$(GLINCLUDES) $(GLF_) $(D_)WHICH_CMS="$(WHICH_CMS)"$(_D)
GLCC=$(CC_) $(GLCCFLAGS)
GLCCAUX=$(CCAUX_) $(GLCCFLAGS)
-GLJCC=$(CC_) $(I_)$(GLI_) $(II)$(JI_)$(_I) $(JCF_) $(GLF_)
-GLZCC=$(CC_) $(I_)$(GLI_) $(II)$(ZI_)$(_I) $(ZCF_) $(GLF_)
-GLJBIG2CC=$(CC_) $(I_)$(GLI_) $(II)$(JB2I_)$(_I) $(JB2CF_) $(GLF_)
-GLJASCC=$(CC_) $(I_)$(JPXI_) $(II)$(GLI_)$(_I) $(JPXCF_) $(GLF_)
GLLDFJB2CC=$(CC_) $(I_)$(LDF_JB2I_) $(II)$(GLI_)$(_I) $(JB2CF_) $(GLF_)
GLLWFJPXCC=$(CC_) $(I_)$(LWF_JPXI_) $(II)$(GLI_)$(_I) $(JPXCF_) $(GLF_)
-GLJPXOPJCC=$(CC_) $(I_)$(JPX_OPENJPEG_I_)$(D).. $(I_)$(JPX_OPENJPEG_I_) $(II)$(GLI_)$(_I) $(JPXCF_) $(GLF_)
GLCCSHARED=$(CC_SHARED) $(GLCCFLAGS)
+
+GLJCC=$(CC) $(I_)$(GLI_) $(II)$(JI_)$(_I) $(JCF_) $(GLF_) $(CCFLAGS)
+GLZCC=$(CC) $(I_)$(GLI_) $(II)$(ZI_)$(_I) $(ZCF_) $(GLF_) $(CCFLAGS)
+GLJBIG2CC=$(CC) $(I_)$(GLI_) $(II)$(JB2I_)$(_I) $(JB2CF_) $(GLF_) $(CCFLAGS)
+GLJASCC=$(CC) $(I_)$(JPXI_) $(II)$(GLI_)$(_I) $(JPXCF_) $(GLF_) $(CCFLAGS)
+GLJPXOPJCC=$(CC) $(I_)$(JPX_OPENJPEG_I_)$(D).. $(I_)$(JPX_OPENJPEG_I_) $(II)$(GLI_)$(_I) $(JPXCF_) $(GLF_) $(CCFLAGS)
+GLFTCC=$(CC) $(FT_CFLAGS) $(D_)FT_CONFIG_OPTIONS_H=\"$(FTCONFH)\"$(_D) $(CCFLAGS) $(GLCCFLAGS)
+
# We can't use $(CC_) for GLLCMS2MTCC because that includes /Za on
# msvc builds, and lcms configures itself to depend on msvc extensions
# (inline asm, including windows.h) when compiled under msvc.
@@ -383,7 +386,7 @@ $(GLOBJ)gsserial.$(OBJ) : $(GLSRC)gsserial.c $(stdpre_h) $(gstypes_h)\
$(GLOBJ)gsutil.$(OBJ) : $(GLSRC)gsutil.c $(AK) $(memory__h)\
$(string__h) $(gstypes_h) $(gserrors_h) $(gsmemory_h)\
- $(gsrect_h) $(gsuid_h) $(gsutil_h) $(LIB_MAK) $(MAKEDIRS)
+ $(gsrect_h) $(gsuid_h) $(gsutil_h) $(gxsync_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gsutil.$(OBJ) $(C_) $(GLSRC)gsutil.c
$(AUX)gsutil.$(OBJ) : $(GLSRC)gsutil.c $(AK) $(memory__h) $(string__h)\
@@ -594,8 +597,6 @@ smd5_h=$(GLSRC)smd5.h
sarc4_h=$(GLSRC)sarc4.h
saes_h=$(GLSRC)saes.h
sjbig2_h=$(GLSRC)sjbig2.h
-sjbig2_luratech_h=$(GLSRC)sjbig2_luratech.h $(scommon_h)
-sjpx_luratech_h=$(GLSRC)sjpx_luratech.h $(scommon_h)
sjpx_openjpeg_h=$(GLSRC)sjpx_openjpeg.h $(scommon_h) $(openjpeg_h)
spdiffx_h=$(GLSRC)spdiffx.h
spngpx_h=$(GLSRC)spngpx.h
@@ -644,6 +645,8 @@ gdevdevnprn_h=$(GLSRC)gdevdevnprn.h
gdevoflt_h=$(GLSRC)gdevoflt.h
+gdevnup_h=$(GLSRC)gdevnup.h
+
png__h=$(GLSRC)png_.h $(MAKEFILE)
x__h=$(GLSRC)x_.h
@@ -676,8 +679,8 @@ $(GLOBJ)gxacpath.$(OBJ) : $(GLSRC)gxacpath.c $(AK) $(gx_h)\
$(gzacpath_h) $(gzcpath_h) $(gzpath_h) $(gxdevsop_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxacpath.$(OBJ) $(C_) $(GLSRC)gxacpath.c
-$(GLOBJ)gxbcache.$(OBJ) : $(GLSRC)gxbcache.c $(AK) $(gx_h) $(memory__h)\
- $(gsmdebug_h) $(gxbcache_h) $(LIB_MAK) $(MAKEDIRS)
+$(GLOBJ)gxbcache.$(OBJ) : $(GLSRC)gxbcache.c $(AK) $(gx_h) $(gxobj_h) \
+ $(memory__h) $(gsmdebug_h) $(gxbcache_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxbcache.$(OBJ) $(C_) $(GLSRC)gxbcache.c
$(GLOBJ)gxccache.$(OBJ) : $(GLSRC)gxccache.c $(AK) $(gx_h)\
@@ -693,7 +696,8 @@ $(GLOBJ)gxccman.$(OBJ) : $(GLSRC)gxccman.c $(AK) $(gx_h) $(gserrors_h)\
$(memory__h) $(gpcheck_h)\
$(gsbitops_h) $(gsstruct_h) $(gsutil_h) $(gxfixed_h) $(gxmatrix_h)\
$(gxdevice_h) $(gxdevmem_h) $(gxfont_h) $(gxfcache_h) $(gxchar_h)\
- $(gxpath_h) $(gxxfont_h) $(gzstate_h) $(gxttfb_h) $(gxfont42_h) $(LIB_MAK) $(MAKEDIRS)
+ $(gxpath_h) $(gxxfont_h) $(gzstate_h) $(gxttfb_h) $(gxfont42_h) $(gxobj_h) \
+ $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxccman.$(OBJ) $(C_) $(GLSRC)gxccman.c
$(GLOBJ)gxchar.$(OBJ) : $(GLSRC)gxchar.c $(AK) $(gx_h) $(gserrors_h)\
@@ -765,7 +769,7 @@ $(GLOBJ)gxht.$(OBJ) : $(GLSRC)gxht.c $(AK) $(gx_h) $(gserrors_h)\
$(GLOBJ)gxhtbit.$(OBJ) : $(GLSRC)gxhtbit.c $(AK) $(gx_h) $(gserrors_h)\
$(memory__h) $(gsbitops_h) $(gscdefs_h)\
- $(gxbitmap_h) $(gxdht_h) $(gxdhtres_h) $(gxhttile_h) $(gxtmap_h) $(LIB_MAK) $(MAKEDIRS)
+ $(gxbitmap_h) $(gxdht_h) $(gxdhtres_h) $(gxhttile_h) $(gxtmap_h) $(gp_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxhtbit.$(OBJ) $(C_) $(GLSRC)gxhtbit.c
$(GLOBJ)gxht_thresh.$(OBJ) : $(GLSRC)gxht_thresh.c $(AK) $(memory__h)\
@@ -983,7 +987,7 @@ $(GLOBJ)gsdevmem.$(OBJ) : $(GLSRC)gsdevmem.c $(AK) $(gx_h)\
$(GLOBJ)gsdparam.$(OBJ) : $(GLSRC)gsdparam.c $(AK) $(gx_h)\
$(gserrors_h) $(memory__h) $(string__h)\
- $(gsdevice_h) $(gsparam_h) $(gxdevice_h) $(gxfixed_h)\
+ $(gsdevice_h) $(gsparam_h) $(gsparamx_h) $(gxdevice_h) $(gxfixed_h)\
$(gsicc_manage_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gsdparam.$(OBJ) $(C_) $(GLSRC)gsdparam.c
@@ -1009,7 +1013,7 @@ $(GLOBJ)gsgcache.$(OBJ) : $(GLSRC)gsgcache.c $(AK) $(gx_h)\
$(GLOBJ)gsht.$(OBJ) : $(GLSRC)gsht.c $(AK) $(gx_h) $(gserrors_h)\
$(memory__h) $(string__h) $(gsstruct_h) $(gsutil_h) $(gxarith_h)\
- $(gxdevice_h) $(gzht_h) $(gzstate_h) $(gxfmap_h) $(LIB_MAK) $(MAKEDIRS)
+ $(gxdevice_h) $(gzht_h) $(gzstate_h) $(gxfmap_h) $(gp_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gsht.$(OBJ) $(C_) $(GLSRC)gsht.c
$(GLOBJ)gshtscr.$(OBJ) : $(GLSRC)gshtscr.c $(AK) $(gx_h) $(gserrors_h)\
@@ -1065,7 +1069,6 @@ $(GLOBJ)gsparam.$(OBJ) : $(GLSRC)gsparam.c $(AK) $(gx_h) $(gserrors_h)\
$(memory__h) $(string__h) $(gsparam_h) $(gsstruct_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gsparam.$(OBJ) $(C_) $(GLSRC)gsparam.c
-# gsparamx is not included in the base configuration.
$(GLOBJ)gsparamx.$(OBJ) : $(AK) $(GLSRC)gsparamx.c $(string__h)\
$(gserrors_h) $(gsmemory_h) $(gsparam_h) $(gsparamx_h)\
$(gstypes_h) $(LIB_MAK) $(MAKEDIRS)
@@ -1102,7 +1105,8 @@ $(GLOBJ)gsstate.$(OBJ) : $(GLSRC)gsstate.c $(AK) $(gx_h) $(gserrors_h)\
$(GLOBJ)gstext.$(OBJ) : $(GLSRC)gstext.c $(AK) $(memory__h) $(gdebug_h)\
$(gserrors_h) $(gsmemory_h) $(gsstruct_h) $(gstypes_h)\
$(gxfcache_h) $(gxdevcli_h) $(gxdcolor_h) $(gxfont_h) $(gxpath_h)\
- $(gxtext_h) $(gzstate_h) $(gsutil_h) $(gxdevsop_h) $(LIB_MAK) $(MAKEDIRS)
+ $(gxtext_h) $(gzstate_h) $(gsutil_h) $(gxdevsop_h)\
+ $(gscspace_h) $(gsicc_blacktext_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gstext.$(OBJ) $(C_) $(GLSRC)gstext.c
# We make gsiodevs a separate module so the PS interpreter can replace it.
@@ -1326,7 +1330,7 @@ $(GLOBJ)fapi_ft_0.$(OBJ) : $(GLSRC)fapi_ft.c $(AK)\
$(gsmemory_h) $(gsmalloc_h) $(gxfixed_h) $(gdebug_h) $(gxbitmap_h)\
$(gsmchunk_h) $(stream_h) $(gxiodev_h) $(gsfname_h) $(gxfapi_h) $(gxfont1_h)\
$(gxfont_h) $(BASEFTCONFH) $(LIB_MAK) $(MAKEDIRS)
- $(GLCC) $(FT_CFLAGS) $(D_)FT_CONFIG_OPTIONS_H=\"$(FTCONFH)\"$(_D) $(GLO_)fapi_ft_0.$(OBJ) $(C_) $(GLSRC)fapi_ft.c
+ $(GLFTCC) $(FT_CFLAGS) $(D_)FT_CONFIG_OPTIONS_H=\"$(FTCONFH)\"$(_D) $(GLO_)fapi_ft_0.$(OBJ) $(C_) $(GLSRC)fapi_ft.c
$(GLOBJ)fapi_ft_1.$(OBJ) : $(GLSRC)fapi_ft.c $(AK)\
$(stdio__h) $(malloc__h) $(write_t1_h) $(write_t2_h) $(math__h) $(gserrors_h)\
@@ -1414,7 +1418,7 @@ $(GLOBJ)gxdownscale.$(OBJ) : $(GLOBJ)gxdownscale_$(WITH_CAL).$(OBJ) $(AK) $(gp_h
LIB0s=$(GLOBJ)gpmisc.$(OBJ) $(GLOBJ)stream.$(OBJ) $(GLOBJ)strmio.$(OBJ)
LIB1s=$(GLOBJ)gsalloc.$(OBJ) $(GLOBJ)gxdownscale.$(OBJ) $(downscale_) $(GLOBJ)gdevprn.$(OBJ) $(GLOBJ)gdevflp.$(OBJ) $(GLOBJ)gdevkrnlsclass.$(OBJ) $(GLOBJ)gdevepo.$(OBJ)
-LIB2s=$(GLOBJ)gdevmplt.$(OBJ) $(GLOBJ)gsbitcom.$(OBJ) $(GLOBJ)gsbitops.$(OBJ) $(GLOBJ)gsbittab.$(OBJ) $(GLOBJ)gdevoflt.$(OBJ) $(GLOBJ)gdevsclass.$(OBJ)
+LIB2s=$(GLOBJ)gdevmplt.$(OBJ) $(GLOBJ)gsbitcom.$(OBJ) $(GLOBJ)gsbitops.$(OBJ) $(GLOBJ)gsbittab.$(OBJ) $(GLOBJ)gdevoflt.$(OBJ) $(GLOBJ)gdevnup.$(OBJ) $(GLOBJ)gdevsclass.$(OBJ)
# Note: gschar.c is no longer required for a standard build;
# we include it only for backward compatibility for library clients.
LIB3s=$(GLOBJ)gscedata.$(OBJ) $(GLOBJ)gscencs.$(OBJ) $(GLOBJ)gschar.$(OBJ) $(GLOBJ)gscolor.$(OBJ)
@@ -1849,22 +1853,6 @@ $(GLOBJ)snojbig2.$(OBJ) : $(GLSRC)snojbig2.c $(AK) \
$(strimpl_h) $(LIB_MAK) $(MAKEDIRS)
$(GLJBIG2CC) $(GLO_)snojbig2.$(OBJ) $(C_) $(GLSRC)snojbig2.c
-# luratech version
-sjbig2_luratech=$(GLOBJ)sjbig2_luratech.$(OBJ)
-
-$(GLD)sjbig2_luratech.dev : $(LIB_MAK) $(ECHOGS_XE) \
- $(GLD)ldf_jb2.dev $(sjbig2_luratech)
- $(SETMOD) $(GLD)sjbig2_luratech $(sjbig2_luratech)
- $(ADDMOD) $(GLD)sjbig2_luratech -include $(GLD)ldf_jb2.dev
-
-# ldf_jb2.dev is defined in jbig2_luratech.mak
-
-$(GLOBJ)sjbig2_luratech.$(OBJ) : $(GLSRC)sjbig2_luratech.c $(AK) \
- $(memory__h) $(malloc__h) $(gserrors_h) $(gdebug_h) \
- $(strimpl_h) $(sjbig2_luratech_h) $(LIB_MAK) $(MAKEDIRS)
- $(GLLDFJB2CC) $(GLO_)sjbig2_luratech.$(OBJ) \
- $(C_) $(GLSRC)sjbig2_luratech.c
-
# ---------------- JPEG 2000 compression filter ---------------- #
$(GLD)sjpx.dev : $(LIB_MAK) $(ECHOGS_XE) $(GLD)sjpx_$(JPX_LIB).dev $(LIB_MAK) $(MAKEDIRS)
@@ -1875,22 +1863,6 @@ $(GLOBJ)sjpx.$(OBJ) : $(GLSRC)sjpx.c $(AK) \
$(gdebug_h) $(strimpl_h) $(sjpx_h) $(LIB_MAK) $(MAKEDIRS)
$(GLJASCC) $(GLO_)sjpx.$(OBJ) $(C_) $(GLSRC)sjpx.c
-# luratech version
-sjpx_luratech=$(GLOBJ)sjpx_luratech.$(OBJ)
-$(GLD)sjpx_luratech.dev : $(LIB_MAK) $(ECHOGS_XE) \
- $(GLD)lwf_jp2.dev $(sjpx_luratech) $(LIB_MAK) $(MAKEDIRS)
- $(SETMOD) $(GLD)sjpx_luratech $(sjpx_luratech)
- $(ADDMOD) $(GLD)sjpx_luratech -include $(GLD)lwf_jp2.dev
-
-$(GLD)luratech_jp2.dev : $(ECHOGS_XE) $(LIB_MAK) $(MAKEDIRS)
- $(SETMOD) $(GLD)luratech_jp2 $(GLD)liblwf_jp2.a
-
-$(GLOBJ)sjpx_luratech.$(OBJ) : $(GLSRC)sjpx_luratech.c $(AK) \
- $(memory__h) $(gserrors_h) \
- $(gdebug_h) $(strimpl_h) $(sjpx_luratech_h) $(LIB_MAK) $(MAKEDIRS)
- $(GLLWFJPXCC) $(GLO_)sjpx_luratech.$(OBJ) \
- $(C_) $(GLSRC)sjpx_luratech.c
-
# openjpeg version
sjpx_openjpeg=$(GLOBJ)sjpx_openjpeg.$(OBJ)
$(GLD)sjpx_openjpeg.dev : $(LIB_MAK) $(ECHOGS_XE) \
@@ -2079,7 +2051,7 @@ gdevprn_h=$(GLSRC)gdevprn.h
gdevmplt_h=$(GLSRC)gdevmplt.h
page_=$(GLOBJ)gdevprn.$(OBJ) $(GLOBJ)gdevppla.$(OBJ) $(GLOBJ)gdevmplt.$(OBJ) $(GLOBJ)gdevflp.$(OBJ)\
- $(downscale_) $(GLOBJ)gdevoflt.$(OBJ) $(GLOBJ)gdevsclass.$(OBJ) $(GLOBJ)gdevepo.$(OBJ)
+ $(downscale_) $(GLOBJ)gdevoflt.$(OBJ) $(GLOBJ)gdevnup.$(OBJ) $(GLOBJ)gdevsclass.$(OBJ) $(GLOBJ)gdevepo.$(OBJ)
$(GLD)page.dev : $(LIB_MAK) $(ECHOGS_XE) $(page_) $(LIB_MAK) $(MAKEDIRS)
$(SETMOD) $(GLD)page $(page_)
@@ -2118,6 +2090,12 @@ $(GLOBJ)gdevoflt.$(OBJ) : $(GLSRC)gdevoflt.c $(gdevoflt_h) $(gdevp14_h)\
$(gximage_h) $(gxiparam_h) $(gxpaint_h) $(gxpath_h) $(math__h) $(memory__h)
$(GLCC) $(GLO_)gdevoflt.$(OBJ) $(C_) $(GLSRC)gdevoflt.c
+$(GLOBJ)gdevnup.$(OBJ) : $(GLSRC)gdevnup.c $(gdevnup_h) $(gdevp14_h)\
+ $(gdevprn_h) $(gdevsclass_h) $(gsdevice_h) $(gserrors_h) $(gsparam_h)\
+ $(gsstype_h) $(gx_h) $(gxdevice_h)\
+ $(math__h) $(memory__h)
+ $(GLCC) $(GLO_)gdevnup.$(OBJ) $(C_) $(GLSRC)gdevnup.c
+
$(GLOBJ)gdevsclass.$(OBJ) : $(GLSRC)gdevsclass.c $(gdevsclass_h) $(gdevp14_h)\
$(gdevprn_h) $(gsdevice_h) $(gserrors_h) $(gsparam_h) $(gsstype_h) $(gx_h)\
$(gxcmap_h) $(gxcpath_h) $(gxdcolor_h) $(gxdevice_h) $(gxgstate_h)\
@@ -2174,7 +2152,7 @@ gxclpath_h=$(GLSRC)gxclpath.h
clbase1_=$(GLOBJ)gxclist.$(OBJ) $(GLOBJ)gxclbits.$(OBJ) $(GLOBJ)gxclpage.$(OBJ)
clbase2_=$(GLOBJ)gxclrast.$(OBJ) $(GLOBJ)gxclread.$(OBJ) $(GLOBJ)gxclrect.$(OBJ)
-clbase3_=$(GLOBJ)gxclutil.$(OBJ) $(GLOBJ)gsparams.$(OBJ) $(GLOBJ)gsparaml.$(OBJ) $(GLOBJ)gxshade6.$(OBJ)
+clbase3_=$(GLOBJ)gxclutil.$(OBJ) $(GLOBJ)gsparams.$(OBJ) $(GLOBJ)gsparaml.$(OBJ) $(GLOBJ)gsparamx.$(OBJ) $(GLOBJ)gxshade6.$(OBJ)
# gxclrect.c requires rop_proc_table, so we need gsroptab here.
clbase4_=$(GLOBJ)gsroptab.$(OBJ) $(GLOBJ)gsroprun.$(OBJ) $(GLOBJ)stream.$(OBJ)
clpath_=$(GLOBJ)gxclimag.$(OBJ) $(GLOBJ)gxclpath.$(OBJ) $(GLOBJ)gxdhtserial.$(OBJ)
@@ -2203,7 +2181,8 @@ $(GLD)clist.dev : $(LIB_MAK) $(ECHOGS_XE) $(clist_)\
$(GLOBJ)gxclist.$(OBJ) : $(GLSRC)gxclist.c $(AK) $(gx_h) $(gserrors_h)\
$(memory__h) $(string__h) $(gp_h) $(gpcheck_h) $(gsparams_h) $(valgrind_h)\
$(gxcldev_h) $(gxclpath_h) $(gxdevice_h) $(gxdevmem_h) $(gxdcolor_h)\
- $(gscms_h) $(gsicc_manage_h) $(gsicc_cache_h) $(gxdevsop_h) $(LIB_MAK) $(MAKEDIRS)
+ $(gscms_h) $(gsicc_manage_h) $(gsicc_cache_h) $(gxdevsop_h) $(gxobj_h) \
+ $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxclist.$(OBJ) $(C_) $(GLSRC)gxclist.c
$(GLOBJ)gxclbits.$(OBJ) : $(GLSRC)gxclbits.c $(AK) $(gx_h)\
@@ -2954,7 +2933,8 @@ $(GLOBJ)gxctable.$(OBJ) : $(GLSRC)gxctable.c $(AK) $(gx_h)\
gsicc_=$(GLOBJ)gsicc_manage.$(OBJ) $(GLOBJ)gsicc_cache.$(OBJ)\
$(GLOBJ)gsicc_$(WHICH_CMS).$(OBJ) $(GLOBJ)gsicc_profilecache.$(OBJ)\
$(GLOBJ)gsicc_create.$(OBJ) $(GLOBJ)gsicc_nocm.$(OBJ)\
- $(GLOBJ)gsicc_replacecm.$(OBJ) $(GLOBJ)gsicc_monitorcm.$(OBJ)
+ $(GLOBJ)gsicc_replacecm.$(OBJ) $(GLOBJ)gsicc_monitorcm.$(OBJ)\
+ $(GLOBJ)gsicc_blacktext.$(OBJ)
sicclib_=$(GLOBJ)gsicc.$(OBJ)
$(GLD)sicclib.dev : $(LIB_MAK) $(ECHOGS_XE) $(sicclib_) $(gsicc_) $(md5_)\
@@ -2975,6 +2955,7 @@ gsicc_cms_h=$(GLSRC)gsicc_cms.h
gsicc_manage_h=$(GLSRC)gsicc_manage.h
gsicc_cache_h=$(GLSRC)gsicc_cache.h
gsicc_profilecache_h=$(GLSRC)gsicc_profilecache.h
+gsicc_blacktext_h=$(GLSRC)gsicc_blacktext.h
$(GLOBJ)gsicc_monitorcm.$(OBJ) : $(GLSRC)gsicc_monitorcm.c $(AK) $(std_h)\
$(stdpre_h) $(gstypes_h) $(gsmemory_h) $(gxdevcli_h)\
@@ -3015,6 +2996,11 @@ $(GLOBJ)gsicc_profilecache.$(OBJ) : $(GLSRC)gsicc_profilecache.c $(AK)\
$(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gsicc_profilecache.$(OBJ) $(C_) $(GLSRC)gsicc_profilecache.c
+$(GLOBJ)gsicc_blacktext.$(OBJ) : $(GLSRC)gsicc_blacktext.c $(AK)\
+ $(gsmemory_h) $(gsstruct_h) $(gzstate_h) $(gsicc_blacktext_h)\
+ $(LIB_MAK) $(MAKEDIRS)
+ $(GLCC) $(GLO_)gsicc_blacktext.$(OBJ) $(C_) $(GLSRC)gsicc_blacktext.c
+
$(GLOBJ)gsicc_lcms2mt_1_0.$(OBJ) : $(GLSRC)gsicc_lcms2mt.c\
$(memory__h) $(gsicc_cms_h) $(gslibctx_h) $(gserrors_h) $(gxdevice_h) $(LIB_MAK) $(MAKEDIRS)
$(GLLCMS2MTCC) $(GLO_)gsicc_lcms2mt_1_0.$(OBJ) $(C_) $(GLSRC)gsicc_lcms2mt.c
@@ -3187,7 +3173,7 @@ gxblend_h=$(GLSRC)gxblend.h
gdevp14_h=$(GLSRC)gdevp14.h
$(GLOBJ)gstrans.$(OBJ) : $(GLSRC)gstrans.c $(AK) $(gx_h) $(gserrors_h)\
- $(math__h) $(memory__h) $(gdevp14_h) $(gstrans_h)\
+ $(math__h) $(memory__h) $(gdevp14_h) $(gstrans_h) $(gsicc_cache_h)\
$(gsutil_h) $(gxdevcli_h) $(gzstate_h) $(gscspace_h)\
$(gxclist_h) $(gsicc_manage_h) $(gdevdevn_h) $(gxarith_h) $(gxblend_h)\
$(LIB_MAK) $(MAKEDIRS)
@@ -3327,7 +3313,7 @@ $(GLD)shadelib.dev : $(LIB_MAK) $(ECHOGS_XE) $(shadelib_)\
$(ADDMOD) $(GLD)shadelib -include $(GLD)funclib $(GLD)patlib
$(GLOBJ)gen_ordered.$(OBJ) : $(GLSRC)gen_ordered.c $(GLSRC)gen_ordered.h\
- $(std_h) $(gsmemory_h) $(math__h) $(string__h) $(LIB_MAK) $(MAKEDIRS)
+ $(std_h) $(gsmemory_h) $(math__h) $(string__h) $(gp_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gen_ordered.$(OBJ) $(C_) $(D_)GS_LIB_BUILD$(_D) \
$(GLSRC)gen_ordered.c
@@ -3346,7 +3332,7 @@ $(GLD)romfs0.dev : $(LIB_MAK) $(ECHOGS_XE) $(LIB_MAK) $(MAKEDIRS)
$(GLGEN)gsromfs1_.c : $(MKROMFS_XE) $(PS_ROMFS_DEPS) $(LIB_MAK) $(MAKEDIRS)
$(EXP)$(MKROMFS_XE) -o $(GLGEN)gsromfs1_.c \
$(MKROMFS_FLAGS) -X .svn -X CVS -P $(GLSRCDIR)$(D)..$(D) iccprofiles$(D)* \
- $(PS_ROMFS_ARGS) $(PS_FONT_ROMFS_ARGS) $(GL_ROMFS_ARGS) $(TESS_ROMFS_ARGS)
+ $(TESS_ROMFS_ARGS) $(PS_ROMFS_ARGS) $(PS_FONT_ROMFS_ARGS) $(GL_ROMFS_ARGS)
$(GLGEN)gsromfs1_1.c : $(MKROMFS_XE) $(PS_ROMFS_DEPS) $(LIB_MAK) $(MAKEDIRS)
$(EXP)$(MKROMFS_XE) -o $(GLGEN)gsromfs1_1.c \
@@ -4376,6 +4362,7 @@ $(GLSRC)gdevflp.h:$(GLGEN)arch.h
$(GLSRC)gdevflp.h:$(GLSRC)gs_dll_call.h
$(GLSRC)gdevkrnlsclass.h:$(GLSRC)gdevflp.h
$(GLSRC)gdevkrnlsclass.h:$(GLSRC)gdevoflt.h
+$(GLSRC)gdevkrnlsclass.h:$(GLSRC)gdevnup.h
$(GLSRC)gdevkrnlsclass.h:$(GLSRC)gxdevice.h
$(GLSRC)gdevkrnlsclass.h:$(GLSRC)gxdevcli.h
$(GLSRC)gdevkrnlsclass.h:$(GLSRC)gxcmap.h
@@ -10264,6 +10251,64 @@ $(GLSRC)gdevoflt.h:$(GLSRC)std.h
$(GLSRC)gdevoflt.h:$(GLSRC)stdpre.h
$(GLSRC)gdevoflt.h:$(GLGEN)arch.h
$(GLSRC)gdevoflt.h:$(GLSRC)gs_dll_call.h
+$(GLSRC)gdevnup.h:$(GLSRC)gxdevice.h
+$(GLSRC)gdevnup.h:$(GLSRC)gxdevcli.h
+$(GLSRC)gdevnup.h:$(GLSRC)gsnamecl.h
+$(GLSRC)gdevnup.h:$(GLSRC)gstparam.h
+$(GLSRC)gdevnup.h:$(GLSRC)gxfmap.h
+$(GLSRC)gdevnup.h:$(GLSRC)gsmalloc.h
+$(GLSRC)gdevnup.h:$(GLSRC)gscsel.h
+$(GLSRC)gdevnup.h:$(GLSRC)gxbcache.h
+$(GLSRC)gdevnup.h:$(GLSRC)gxdda.h
+$(GLSRC)gdevnup.h:$(GLSRC)gxpath.h
+$(GLSRC)gdevnup.h:$(GLSRC)gxfrac.h
+$(GLSRC)gdevnup.h:$(GLSRC)gxtmap.h
+$(GLSRC)gdevnup.h:$(GLSRC)gxftype.h
+$(GLSRC)gdevnup.h:$(GLSRC)gsrect.h
+$(GLSRC)gdevnup.h:$(GLSRC)gslparam.h
+$(GLSRC)gdevnup.h:$(GLSRC)gsdevice.h
+$(GLSRC)gdevnup.h:$(GLSRC)gscpm.h
+$(GLSRC)gdevnup.h:$(GLSRC)gsgstate.h
+$(GLSRC)gdevnup.h:$(GLSRC)gxstdio.h
+$(GLSRC)gdevnup.h:$(GLSRC)gsxfont.h
+$(GLSRC)gdevnup.h:$(GLSRC)gsdsrc.h
+$(GLSRC)gdevnup.h:$(GLSRC)gsio.h
+$(GLSRC)gdevnup.h:$(GLSRC)gsiparam.h
+$(GLSRC)gdevnup.h:$(GLSRC)gxfixed.h
+$(GLSRC)gdevnup.h:$(GLSRC)gscompt.h
+$(GLSRC)gdevnup.h:$(GLSRC)gsmatrix.h
+$(GLSRC)gdevnup.h:$(GLSRC)gspenum.h
+$(GLSRC)gdevnup.h:$(GLSRC)gsparam.h
+$(GLSRC)gdevnup.h:$(GLSRC)gp.h
+$(GLSRC)gdevnup.h:$(GLSRC)memento.h
+$(GLSRC)gdevnup.h:$(GLSRC)memory_.h
+$(GLSRC)gdevnup.h:$(GLSRC)gsuid.h
+$(GLSRC)gdevnup.h:$(GLSRC)gsstruct.h
+$(GLSRC)gdevnup.h:$(GLSRC)gxsync.h
+$(GLSRC)gdevnup.h:$(GLSRC)gxbitmap.h
+$(GLSRC)gdevnup.h:$(GLSRC)srdline.h
+$(GLSRC)gdevnup.h:$(GLSRC)scommon.h
+$(GLSRC)gdevnup.h:$(GLSRC)gsfname.h
+$(GLSRC)gdevnup.h:$(GLSRC)gsbitmap.h
+$(GLSRC)gdevnup.h:$(GLSRC)gsccolor.h
+$(GLSRC)gdevnup.h:$(GLSRC)gxarith.h
+$(GLSRC)gdevnup.h:$(GLSRC)stat_.h
+$(GLSRC)gdevnup.h:$(GLSRC)gpsync.h
+$(GLSRC)gdevnup.h:$(GLSRC)gsstype.h
+$(GLSRC)gdevnup.h:$(GLSRC)gsmemory.h
+$(GLSRC)gdevnup.h:$(GLSRC)gpgetenv.h
+$(GLSRC)gdevnup.h:$(GLSRC)gscdefs.h
+$(GLSRC)gdevnup.h:$(GLSRC)gslibctx.h
+$(GLSRC)gdevnup.h:$(GLSRC)gxcindex.h
+$(GLSRC)gdevnup.h:$(GLSRC)stdio_.h
+$(GLSRC)gdevnup.h:$(GLSRC)gsccode.h
+$(GLSRC)gdevnup.h:$(GLSRC)stdint_.h
+$(GLSRC)gdevnup.h:$(GLSRC)gssprintf.h
+$(GLSRC)gdevnup.h:$(GLSRC)gstypes.h
+$(GLSRC)gdevnup.h:$(GLSRC)std.h
+$(GLSRC)gdevnup.h:$(GLSRC)stdpre.h
+$(GLSRC)gdevnup.h:$(GLGEN)arch.h
+$(GLSRC)gdevnup.h:$(GLSRC)gs_dll_call.h
$(GLSRC)gxfapi.h:$(GLSRC)gstext.h
$(GLSRC)gxfapi.h:$(GLSRC)gsfont.h
$(GLSRC)gxfapi.h:$(GLSRC)gsdcolor.h
diff --git a/base/locale_.h b/base/locale_.h
index 9bfeaf9a..19f52f91 100644
--- a/base/locale_.h
+++ b/base/locale_.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/lwf_jp2.mak b/base/lwf_jp2.mak
deleted file mode 100644
index bfe67747..00000000
--- a/base/lwf_jp2.mak
+++ /dev/null
@@ -1,397 +0,0 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
-# All Rights Reserved.
-#
-# This software is provided AS-IS with no warranty, either express or
-# implied.
-#
-# This software is distributed under license and may not be copied,
-# modified or distributed except as expressly authorized under the terms
-# of the license contained in the file LICENSE in this distribution.
-#
-# Refer to licensing information at http://www.artifex.com or contact
-# Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
-# CA 94945, U.S.A., +1(415)492-9861, for further information.
-#
-
-# makefile for Luratech lwf_jp2 library code.
-# Users of this makefile must define the following:
-# SHARE_JPX - whether to compile in or link to the library
-# JPXSRCDIR - the library source directory
-#
-# gs.mak and friends define the following:
-# JPXOBJDIR - the output obj directory
-# JPXGENDIR - generated (.dev) file directory
-# LWF_JPXI_ - include path for the library headers
-# JPXCF_ - cflags for building the library
-#
-# We define the lwf_jp2.dev target and its dependencies
-#
-# This partial makefile compiles the lwf_jp2 library for use in
-# Ghostscript.
-
-LWF_JP2_MAK=$(GLSRC)lwf_jp2.mak $(TOP_MAKEFILES)
-
-LWF_JP2_SRC=$(JPXSRCDIR)$(D)library$(D)source$(D)
-LWF_JP2_GEN=$(JPXOBJDIR)$(D)
-LWF_JP2_OBJ=$(JPXOBJDIR)$(D)
-
-# source files to build from the CSDK source
-
-lwf_jp2_OBJS = \
- $(LWF_JP2_OBJ)jp2_adt_band_array.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_adt_band_buffer.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_adt_block_array.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_adt_cache.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_adt_comp.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_adt_component_array.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_adt_decomp.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_adt_ebcot_decoder.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_adt_external_cache.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_adt_image.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_adt_memory.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_adt_mq_decoder.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_adt_mq_state.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_adt_packet_decoder.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_adt_precinct_array.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_adt_rate.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_adt_rate_list.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_adt_read_bits.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_adt_read_data.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_adt_reader_requirements.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_adt_resolution_array.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_adt_tile_array.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_adt_tlm_marker_array.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_adt_write_data.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_buffer.$(OBJ) \
- $(LWF_JP2_OBJ)jp2c_code_cb.$(OBJ) \
- $(LWF_JP2_OBJ)jp2c_coder.$(OBJ) \
- $(LWF_JP2_OBJ)jp2c_codestream.$(OBJ) \
- $(LWF_JP2_OBJ)jp2c_file_format.$(OBJ) \
- $(LWF_JP2_OBJ)jp2c_format.$(OBJ) \
- $(LWF_JP2_OBJ)jp2c_memory.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_code_cb.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_common.$(OBJ) \
- $(LWF_JP2_OBJ)jp2c_progression.$(OBJ) \
- $(LWF_JP2_OBJ)jp2c_quant.$(OBJ) \
- $(LWF_JP2_OBJ)jp2c_wavelet.$(OBJ) \
- $(LWF_JP2_OBJ)jp2c_wavelet_lifting.$(OBJ) \
- $(LWF_JP2_OBJ)jp2c_wavelet_lifting_mmx.$(OBJ) \
- $(LWF_JP2_OBJ)jp2c_weights.$(OBJ) \
- $(LWF_JP2_OBJ)jp2c_write.$(OBJ) \
- $(LWF_JP2_OBJ)jp2d_codestream.$(OBJ) \
- $(LWF_JP2_OBJ)jp2d_decoder.$(OBJ) \
- $(LWF_JP2_OBJ)jp2d_file_format.$(OBJ) \
- $(LWF_JP2_OBJ)jp2d_format.$(OBJ) \
- $(LWF_JP2_OBJ)jp2d_image.$(OBJ) \
- $(LWF_JP2_OBJ)jp2d_memory.$(OBJ) \
- $(LWF_JP2_OBJ)jp2d_partial_decoding.$(OBJ) \
- $(LWF_JP2_OBJ)jp2d_progression.$(OBJ) \
- $(LWF_JP2_OBJ)jp2d_quant.$(OBJ) \
- $(LWF_JP2_OBJ)jp2d_scale.$(OBJ) \
- $(LWF_JP2_OBJ)jp2d_wavelet.$(OBJ) \
- $(LWF_JP2_OBJ)jp2d_wavelet_lifting.$(OBJ) \
- $(LWF_JP2_OBJ)jp2d_wavelet_lifting_mmx.$(OBJ) \
- $(LWF_JP2_OBJ)jp2d_write.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_icc.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_license.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_packet.$(OBJ) \
- $(LWF_JP2_OBJ)jp2_tag_tree.$(OBJ) \
- $(LWF_JP2_OBJ)jp2t_codestream.$(OBJ) \
- $(LWF_JP2_OBJ)jp2t_file_format.$(OBJ) \
- $(LWF_JP2_OBJ)jp2t_image.$(OBJ) \
- $(LWF_JP2_OBJ)jp2t_memory.$(OBJ) \
- $(LWF_JP2_OBJ)jp2t_progression.$(OBJ) \
- $(LWF_JP2_OBJ)jp2t_transcoder.$(OBJ)
-
-lwf_jp2_HDRS = \
- $(LWF_JP2_SRC)jp2_adt_band_array.h \
- $(LWF_JP2_SRC)jp2_adt_band_buffer.h \
- $(LWF_JP2_SRC)jp2_adt_block_array.h \
- $(LWF_JP2_SRC)jp2_adt_cache.h \
- $(LWF_JP2_SRC)jp2_adt_comp.h \
- $(LWF_JP2_SRC)jp2_adt_component_array.h \
- $(LWF_JP2_SRC)jp2_adt_decomp.h \
- $(LWF_JP2_SRC)jp2_adt_ebcot_decoder.h \
- $(LWF_JP2_SRC)jp2_adt_external_cache.h \
- $(LWF_JP2_SRC)jp2_adt_image.h \
- $(LWF_JP2_SRC)jp2_adt_memory.h \
- $(LWF_JP2_SRC)jp2_adt_mq_decoder.h \
- $(LWF_JP2_SRC)jp2_adt_mq_state.h \
- $(LWF_JP2_SRC)jp2_adt_packet_decoder.h \
- $(LWF_JP2_SRC)jp2_adt_precinct_array.h \
- $(LWF_JP2_SRC)jp2_adt_rate.h \
- $(LWF_JP2_SRC)jp2_adt_rate_list.h \
- $(LWF_JP2_SRC)jp2_adt_read_bits.h \
- $(LWF_JP2_SRC)jp2_adt_read_data.h \
- $(LWF_JP2_SRC)jp2_adt_reader_requirements.h \
- $(LWF_JP2_SRC)jp2_adt_resolution_array.h \
- $(LWF_JP2_SRC)jp2_adt_tile_array.h \
- $(LWF_JP2_SRC)jp2_adt_tlm_marker_array.h \
- $(LWF_JP2_SRC)jp2_adt_write_data.h \
- $(LWF_JP2_SRC)jp2_assembly.h \
- $(LWF_JP2_SRC)jp2_buffer.h \
- $(LWF_JP2_SRC)jp2c_coder.h \
- $(LWF_JP2_SRC)jp2c_codestream.h \
- $(LWF_JP2_SRC)jp2c_file_format.h \
- $(LWF_JP2_SRC)jp2c_format.h \
- $(LWF_JP2_SRC)jp2c_memory.h \
- $(LWF_JP2_SRC)jp2_code_cb.h \
- $(LWF_JP2_SRC)jp2_codestream.h \
- $(LWF_JP2_SRC)jp2_common.h \
- $(LWF_JP2_SRC)jp2c_progression.h \
- $(LWF_JP2_SRC)jp2c_quant.h \
- $(LWF_JP2_SRC)jp2c_wavelet.h \
- $(LWF_JP2_SRC)jp2c_wavelet_lifting.h \
- $(LWF_JP2_SRC)jp2c_wavelet_lifting_mmx.h \
- $(LWF_JP2_SRC)jp2c_weights.h \
- $(LWF_JP2_SRC)jp2c_write.h \
- $(LWF_JP2_SRC)jp2d_codestream.h \
- $(LWF_JP2_SRC)jp2d_decoder.h \
- $(LWF_JP2_SRC)jp2d_file_format.h \
- $(LWF_JP2_SRC)jp2d_format.h \
- $(LWF_JP2_SRC)jp2d_image.h \
- $(LWF_JP2_SRC)jp2d_memory.h \
- $(LWF_JP2_SRC)jp2d_partial_decoding.h \
- $(LWF_JP2_SRC)jp2d_progression.h \
- $(LWF_JP2_SRC)jp2d_quant.h \
- $(LWF_JP2_SRC)jp2d_scale.h \
- $(LWF_JP2_SRC)jp2d_wavelet.h \
- $(LWF_JP2_SRC)jp2d_wavelet_lifting.h \
- $(LWF_JP2_SRC)jp2d_wavelet_lifting_mmx.h \
- $(LWF_JP2_SRC)jp2d_write.h \
- $(LWF_JP2_SRC)jp2_file_format.h \
- $(LWF_JP2_SRC)jp2_icc.h \
- $(LWF_JP2_SRC)jp2_image.h \
- $(LWF_JP2_SRC)jp2_license.h \
- $(LWF_JP2_SRC)jp2_mac_carbon.h \
- $(LWF_JP2_SRC)jp2_packet.h \
- $(LWF_JP2_SRC)jp2_tag_tree.h \
- $(LWF_JP2_SRC)jp2t_codestream.h \
- $(LWF_JP2_SRC)jp2t_file_format.h \
- $(LWF_JP2_SRC)jp2t_image.h \
- $(LWF_JP2_SRC)jp2t_memory.h \
- $(LWF_JP2_SRC)jp2t_progression.h \
- $(LWF_JP2_SRC)jp2t_transcoder.h \
- $(LWF_JP2_SRC)lwf_jp2.h
-
-# switch in the selected library .dev
-$(LWF_JP2_GEN)lwf_jp2.dev : $(LWF_JP2_GEN)lwf_jp2_$(SHARE_JPX).dev \
- $(LWF_JP2_MAK) $(MAKEDIRS)
- $(CP_) $(LWF_JP2_GEN)lwf_jp2_$(SHARE_JPX).dev $(LWF_JP2_GEN)lwf_jp2.dev
-
-# external link .dev
-$(LWF_JP2_GEN)lwf_jp2_1.dev : $(LWF_JP2_MAK) $(ECHOGS_XE) \
- $(MAKEDIRS)
- $(SETMOD) $(LWF_JP2_GEN)lwf_jp2_1 -lib lwf_jp2
-
-# compile our own .dev
-$(LWF_JP2_GEN)lwf_jp2_0.dev : $(LWF_JP2_MAK) $(ECHOGS_XE) $(lwf_jp2_OBJS) \
- $(MAKEDIRS)
- $(SETMOD) $(LWF_JP2_GEN)lwf_jp2_0 $(lwf_jp2_OBJS)
-
-# define our specific compiler
-LWF_JP2_CC=$(CC_) $(CFLAGS) $(I_)$(LWF_JPXI_)$(_I) $(JPXCF_)
-LWF_JP2_O=$(O_)$(LWF_JP2_OBJ)
-
-LWF_JP2_DEP=$(AK) $(LWF_JP2_MAK) $(MAKEDIRS)
-
-# explicit rules for building each source file
-# for simplicity we have every source file depend on all headers
-
-$(LWF_JP2_OBJ)jp2_adt_band_array.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_band_array.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_band_array.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_band_array.c
-
-$(LWF_JP2_OBJ)jp2_adt_band_buffer.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_band_buffer.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_band_buffer.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_band_buffer.c
-
-$(LWF_JP2_OBJ)jp2_adt_block_array.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_block_array.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_block_array.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_block_array.c
-
-$(LWF_JP2_OBJ)jp2_adt_cache.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_cache.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_cache.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_cache.c
-
-$(LWF_JP2_OBJ)jp2_adt_comp.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_comp.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_comp.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_comp.c
-
-$(LWF_JP2_OBJ)jp2_adt_component_array.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_component_array.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_component_array.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_component_array.c
-
-$(LWF_JP2_OBJ)jp2_adt_decomp.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_decomp.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_decomp.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_decomp.c
-
-$(LWF_JP2_OBJ)jp2_adt_ebcot_decoder.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_ebcot_decoder.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_ebcot_decoder.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_ebcot_decoder.c
-
-$(LWF_JP2_OBJ)jp2_adt_external_cache.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_external_cache.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_external_cache.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_external_cache.c
-
-$(LWF_JP2_OBJ)jp2_adt_image.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_image.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_image.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_image.c
-
-$(LWF_JP2_OBJ)jp2_adt_memory.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_memory.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_memory.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_memory.c
-
-$(LWF_JP2_OBJ)jp2_adt_mq_decoder.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_mq_decoder.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_mq_decoder.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_mq_decoder.c
-
-$(LWF_JP2_OBJ)jp2_adt_mq_state.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_mq_state.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_mq_state.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_mq_state.c
-
-$(LWF_JP2_OBJ)jp2_adt_packet_decoder.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_packet_decoder.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_packet_decoder.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_packet_decoder.c
-
-$(LWF_JP2_OBJ)jp2_adt_precinct_array.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_precinct_array.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_precinct_array.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_precinct_array.c
-
-$(LWF_JP2_OBJ)jp2_adt_rate.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_rate.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_rate.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_rate.c
-
-$(LWF_JP2_OBJ)jp2_adt_rate_list.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_rate_list.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_rate_list.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_rate_list.c
-
-$(LWF_JP2_OBJ)jp2_adt_read_bits.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_read_bits.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_read_bits.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_read_bits.c
-
-$(LWF_JP2_OBJ)jp2_adt_read_data.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_read_data.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_read_data.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_read_data.c
-
-$(LWF_JP2_OBJ)jp2_adt_reader_requirements.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_reader_requirements.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_reader_requirements.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_reader_requirements.c
-
-$(LWF_JP2_OBJ)jp2_adt_resolution_array.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_resolution_array.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_resolution_array.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_resolution_array.c
-
-$(LWF_JP2_OBJ)jp2_adt_tile_array.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_tile_array.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_tile_array.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_tile_array.c
-
-$(LWF_JP2_OBJ)jp2_adt_tlm_marker_array.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_tlm_marker_array.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_tlm_marker_array.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_tlm_marker_array.c
-
-$(LWF_JP2_OBJ)jp2_adt_write_data.$(OBJ) : $(LWF_JP2_SRC)jp2_adt_write_data.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_adt_write_data.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_adt_write_data.c
-
-$(LWF_JP2_OBJ)jp2_buffer.$(OBJ) : $(LWF_JP2_SRC)jp2_buffer.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_buffer.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_buffer.c
-
-$(LWF_JP2_OBJ)jp2c_code_cb.$(OBJ) : $(LWF_JP2_SRC)jp2c_code_cb.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2c_code_cb.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2c_code_cb.c
-
-$(LWF_JP2_OBJ)jp2c_coder.$(OBJ) : $(LWF_JP2_SRC)jp2c_coder.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2c_coder.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2c_coder.c
-
-$(LWF_JP2_OBJ)jp2c_codestream.$(OBJ) : $(LWF_JP2_SRC)jp2c_codestream.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2c_codestream.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2c_codestream.c
-
-$(LWF_JP2_OBJ)jp2c_file_format.$(OBJ) : $(LWF_JP2_SRC)jp2c_file_format.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2c_file_format.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2c_file_format.c
-
-$(LWF_JP2_OBJ)jp2c_format.$(OBJ) : $(LWF_JP2_SRC)jp2c_format.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2c_format.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2c_format.c
-
-$(LWF_JP2_OBJ)jp2c_memory.$(OBJ) : $(LWF_JP2_SRC)jp2c_memory.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2c_memory.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2c_memory.c
-
-$(LWF_JP2_OBJ)jp2_code_cb.$(OBJ) : $(LWF_JP2_SRC)jp2_code_cb.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_code_cb.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_code_cb.c
-
-$(LWF_JP2_OBJ)jp2_common.$(OBJ) : $(LWF_JP2_SRC)jp2_common.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_common.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_common.c
-
-$(LWF_JP2_OBJ)jp2c_progression.$(OBJ) : $(LWF_JP2_SRC)jp2c_progression.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2c_progression.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2c_progression.c
-
-$(LWF_JP2_OBJ)jp2c_quant.$(OBJ) : $(LWF_JP2_SRC)jp2c_quant.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2c_quant.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2c_quant.c
-
-$(LWF_JP2_OBJ)jp2c_wavelet.$(OBJ) : $(LWF_JP2_SRC)jp2c_wavelet.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2c_wavelet.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2c_wavelet.c
-
-$(LWF_JP2_OBJ)jp2c_wavelet_lifting.$(OBJ) : $(LWF_JP2_SRC)jp2c_wavelet_lifting.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2c_wavelet_lifting.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2c_wavelet_lifting.c
-
-$(LWF_JP2_OBJ)jp2c_wavelet_lifting_mmx.$(OBJ) : $(LWF_JP2_SRC)jp2c_wavelet_lifting_mmx.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2c_wavelet_lifting_mmx.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2c_wavelet_lifting_mmx.c
-
-$(LWF_JP2_OBJ)jp2c_weights.$(OBJ) : $(LWF_JP2_SRC)jp2c_weights.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2c_weights.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2c_weights.c
-
-$(LWF_JP2_OBJ)jp2c_write.$(OBJ) : $(LWF_JP2_SRC)jp2c_write.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2c_write.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2c_write.c
-
-$(LWF_JP2_OBJ)jp2d_codestream.$(OBJ) : $(LWF_JP2_SRC)jp2d_codestream.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2d_codestream.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2d_codestream.c
-
-$(LWF_JP2_OBJ)jp2d_decoder.$(OBJ) : $(LWF_JP2_SRC)jp2d_decoder.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2d_decoder.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2d_decoder.c
-
-$(LWF_JP2_OBJ)jp2_demo.$(OBJ) : $(LWF_JP2_SRC)jp2_demo.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_demo.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_demo.c
-
-$(LWF_JP2_OBJ)jp2d_file_format.$(OBJ) : $(LWF_JP2_SRC)jp2d_file_format.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2d_file_format.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2d_file_format.c
-
-$(LWF_JP2_OBJ)jp2d_format.$(OBJ) : $(LWF_JP2_SRC)jp2d_format.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2d_format.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2d_format.c
-
-$(LWF_JP2_OBJ)jp2d_image.$(OBJ) : $(LWF_JP2_SRC)jp2d_image.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2d_image.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2d_image.c
-
-$(LWF_JP2_OBJ)jp2d_memory.$(OBJ) : $(LWF_JP2_SRC)jp2d_memory.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2d_memory.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2d_memory.c
-
-$(LWF_JP2_OBJ)jp2d_partial_decoding.$(OBJ) : $(LWF_JP2_SRC)jp2d_partial_decoding.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2d_partial_decoding.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2d_partial_decoding.c
-
-$(LWF_JP2_OBJ)jp2d_progression.$(OBJ) : $(LWF_JP2_SRC)jp2d_progression.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2d_progression.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2d_progression.c
-
-$(LWF_JP2_OBJ)jp2d_quant.$(OBJ) : $(LWF_JP2_SRC)jp2d_quant.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2d_quant.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2d_quant.c
-
-$(LWF_JP2_OBJ)jp2d_scale.$(OBJ) : $(LWF_JP2_SRC)jp2d_scale.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2d_scale.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2d_scale.c
-
-$(LWF_JP2_OBJ)jp2d_wavelet.$(OBJ) : $(LWF_JP2_SRC)jp2d_wavelet.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2d_wavelet.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2d_wavelet.c
-
-$(LWF_JP2_OBJ)jp2d_wavelet_lifting.$(OBJ) : $(LWF_JP2_SRC)jp2d_wavelet_lifting.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2d_wavelet_lifting.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2d_wavelet_lifting.c
-
-$(LWF_JP2_OBJ)jp2d_wavelet_lifting_mmx.$(OBJ) : $(LWF_JP2_SRC)jp2d_wavelet_lifting_mmx.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2d_wavelet_lifting_mmx.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2d_wavelet_lifting_mmx.c
-
-$(LWF_JP2_OBJ)jp2d_write.$(OBJ) : $(LWF_JP2_SRC)jp2d_write.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2d_write.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2d_write.c
-
-$(LWF_JP2_OBJ)jp2_icc.$(OBJ) : $(LWF_JP2_SRC)jp2_icc.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_icc.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_icc.c
-
-$(LWF_JP2_OBJ)jp2_license.$(OBJ) : $(LWF_JP2_SRC)jp2_license.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_license.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_license.c
-
-$(LWF_JP2_OBJ)jp2_packet.$(OBJ) : $(LWF_JP2_SRC)jp2_packet.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_packet.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_packet.c
-
-$(LWF_JP2_OBJ)jp2_tag_tree.$(OBJ) : $(LWF_JP2_SRC)jp2_tag_tree.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2_tag_tree.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2_tag_tree.c
-
-$(LWF_JP2_OBJ)jp2t_codestream.$(OBJ) : $(LWF_JP2_SRC)jp2t_codestream.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2t_codestream.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2t_codestream.c
-
-$(LWF_JP2_OBJ)jp2t_file_format.$(OBJ) : $(LWF_JP2_SRC)jp2t_file_format.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2t_file_format.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2t_file_format.c
-
-$(LWF_JP2_OBJ)jp2t_image.$(OBJ) : $(LWF_JP2_SRC)jp2t_image.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2t_image.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2t_image.c
-
-$(LWF_JP2_OBJ)jp2t_memory.$(OBJ) : $(LWF_JP2_SRC)jp2t_memory.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2t_memory.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2t_memory.c
-
-$(LWF_JP2_OBJ)jp2t_progression.$(OBJ) : $(LWF_JP2_SRC)jp2t_progression.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2t_progression.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2t_progression.c
-
-$(LWF_JP2_OBJ)jp2t_transcoder.$(OBJ) : $(LWF_JP2_SRC)jp2t_transcoder.c $(lwf_jp2_HDRS) $(LWF_JP2_DEP)
- $(LWF_JP2_CC) $(LWF_JP2_O)jp2t_transcoder.$(OBJ) $(C_) $(LWF_JP2_SRC)jp2t_transcoder.c
-
-
-# end of file
diff --git a/base/malloc_.h b/base/malloc_.h
index 0bc61776..dacd7f24 100644
--- a/base/malloc_.h
+++ b/base/malloc_.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/math_.h b/base/math_.h
index 34af3f8d..fd1bcc20 100644
--- a/base/math_.h
+++ b/base/math_.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/memento.c b/base/memento.c
index ff37b492..fddb17fe 100644
--- a/base/memento.c
+++ b/base/memento.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2020 Artifex Software, Inc.
+/* Copyright (C) 2009-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -39,7 +39,11 @@
#include "memory_.h"
int atexit(void (*)(void));
#else
+#ifdef MEMENTO_MUPDF_HACKS
+#include "mupdf/memento.h"
+#else
#include "memento.h"
+#endif
#include <stdio.h>
#endif
#ifndef _MSC_VER
@@ -58,6 +62,19 @@ int atexit(void (*)(void));
#include <stdio.h>
#endif
+/* Workaround VS2012 (and earlier) missing va_copy. */
+#ifdef _MSC_VER
+# if _MSC_VER < 1800 /* Prior to 2013 */
+# ifndef va_copy
+# ifdef __va_copy
+# define va_copy(dst,src) __va_copy(dst,src)
+# else
+# define va_copy(dst,src) memcpy(&dst, &src, sizeof(va_list))
+# endif /* __va_copy */
+# endif /* va_copy */
+# endif
+#endif
+
/* Hacks to portably print large sizes */
#ifdef _MSC_VER
#define FMTZ "%llu"
@@ -190,7 +207,7 @@ windows_fprintf(FILE *file, const char *fmt, ...)
#endif
#endif
-#if defined(__linux__)
+#if defined(__linux__) || defined(__OpenBSD__)
#define MEMENTO_HAS_FORK
#elif defined(__APPLE__) && defined(__MACH__)
#define MEMENTO_HAS_FORK
@@ -271,7 +288,10 @@ enum {
Memento_EventType_deleteArray = 7,
Memento_EventType_takeRef = 8,
Memento_EventType_dropRef = 9,
- Memento_EventType_reference = 10
+ Memento_EventType_reference = 10,
+ Memento_EventType_strdup = 11,
+ Memento_EventType_asprintf = 12,
+ Memento_EventType_vasprintf = 13
};
static const char *eventType[] =
@@ -286,7 +306,10 @@ static const char *eventType[] =
"delete[]",
"takeRef",
"dropRef",
- "reference"
+ "reference",
+ "strdup",
+ "asprintf",
+ "vasprintf"
};
/* When we list leaked blocks at the end of execution, we search for pointers
@@ -430,6 +453,9 @@ static struct {
int nextPattern;
int patternBit;
int leaking;
+ int hideMultipleReallocs;
+ int abortOnLeak;
+ int abortOnCorruption;
size_t maxMemory;
size_t alloc;
size_t peakAlloc;
@@ -509,10 +535,16 @@ static void *current_addr;
static void error2_cb(void *data, const char *msg, int errnum)
{
+ (void)data;
+ (void)msg;
+ (void)errnum;
}
static void syminfo_cb(void *data, uintptr_t pc, const char *symname, uintptr_t symval, uintptr_t symsize)
{
+ (void)data;
+ (void)symval;
+ (void)symsize;
if (sizeof(void *) == 4)
fprintf(stderr, " 0x%08lx %s\n", pc, symname?symname:"?");
else
@@ -521,6 +553,9 @@ static void syminfo_cb(void *data, uintptr_t pc, const char *symname, uintptr_t
static void error_cb(void *data, const char *msg, int errnum)
{
+ (void)data;
+ (void)msg;
+ (void)errnum;
backtrace_syminfo(my_backtrace_state,
(uintptr_t)current_addr,
syminfo_cb,
@@ -530,6 +565,7 @@ static void error_cb(void *data, const char *msg, int errnum)
static int full_cb(void *data, uintptr_t pc, const char *fname, int line, const char *fn)
{
+ (void)data;
if (sizeof(void *) == 4)
fprintf(stderr, " 0x%08lx %s(%s:%d)\n", pc, fn?fn:"?", fname?fname:"?", line);
else
@@ -943,8 +979,8 @@ static void Memento_storeDetails(Memento_BlkHeader *head, int type)
if (count)
memcpy(&details->stack, &stack[skip], count * sizeof(void *));
- details->type = type;
- details->count = count;
+ details->type = (char)type;
+ details->count = (char)count;
details->sequence = memento.sequence;
details->next = NULL;
VALGRIND_MAKE_MEM_DEFINED(&head->details_tail, sizeof(head->details_tail));
@@ -1291,6 +1327,7 @@ static int Memento_appBlock(Memento_Blocks *blks,
Memento_BlkHeader *b)
{
int result;
+ (void)blks;
VALGRIND_MAKE_MEM_DEFINED(b, sizeof(Memento_BlkHeader));
VALGRIND_MAKE_MEM_DEFINED(MEMBLK_TOBLK(b),
b->rawsize + Memento_PostSize);
@@ -1421,12 +1458,14 @@ int Memento_listBlocksNested(void)
/* Now, calculate tree */
for (b = memento.used.head; b; b = b->next) {
char *p = MEMBLK_TOBLK(b);
- int end = (b->rawsize < MEMENTO_PTRSEARCH ? b->rawsize : MEMENTO_PTRSEARCH);
+ size_t end = (b->rawsize < MEMENTO_PTRSEARCH ? b->rawsize : MEMENTO_PTRSEARCH);
+ size_t z;
VALGRIND_MAKE_MEM_DEFINED(p, end);
end -= sizeof(void *)-1;
- for (i = MEMENTO_SEARCH_SKIP; i < end; i += sizeof(void *)) {
- void *q = *(void **)(&p[i]);
+ for (z = MEMENTO_SEARCH_SKIP; z < end; z += sizeof(void *)) {
+ void *q = *(void **)(&p[z]);
void **r;
+
/* Do trivial checks on pointer */
if ((mask & (intptr_t)q) != mask || q < minptr || q > maxptr)
continue;
@@ -1552,18 +1591,24 @@ static int showInfo(Memento_BlkHeader *b, void *arg)
{
Memento_BlkDetails *details;
+ (void)arg;
+
fprintf(stderr, FMTP":(size="FMTZ",num=%d)",
MEMBLK_TOBLK(b), (FMTZ_CAST)b->rawsize, b->sequence);
if (b->label)
fprintf(stderr, " (%s)", b->label);
fprintf(stderr, "\nEvents:\n");
- details = b->details;
- while (details)
+ for (details = b->details; details; details = details->next)
{
+ if (memento.hideMultipleReallocs &&
+ details->type == Memento_EventType_realloc &&
+ details->next &&
+ details->next->type == Memento_EventType_realloc) {
+ continue;
+ }
fprintf(stderr, " Event %d (%s)\n", details->sequence, eventType[(int)details->type]);
Memento_showStacktrace(details->stack, details->count);
- details = details->next;
}
return 0;
}
@@ -1579,6 +1624,25 @@ void Memento_listBlockInfo(void)
#endif
}
+#ifdef MEMENTO_DETAILS
+static int
+showBlockInfo(Memento_BlkHeader *b, void *arg)
+{
+ if (arg < MEMBLK_TOBLK(b) || (void *)MEMBLK_POSTPTR(b) <= arg)
+ return 0;
+ return showInfo(b, NULL);
+}
+#endif
+
+void Memento_blockInfo(void *p)
+{
+#ifdef MEMENTO_DETAILS
+ MEMENTO_LOCK();
+ Memento_appBlocks(&memento.used, showBlockInfo, p);
+ MEMENTO_UNLOCK();
+#endif
+}
+
static int Memento_nonLeakBlocksLeaked(void)
{
Memento_BlkHeader *blk = memento.used.head;
@@ -1630,64 +1694,68 @@ void Memento_fin(void)
fprintf(stderr, "MEMENTO_NEXTFAILAT=%d\n", memento.nextFailAt);
fprintf(stderr, "MEMENTO_NEXTPATTERN=%d\n", memento.nextPattern);
}
+ if (Memento_nonLeakBlocksLeaked() && memento.abortOnLeak) {
+ fprintf(stderr, "Calling abort() because blocks were leaked and MEMENTO_ABORT_ON_LEAK is set.\n");
+ abort();
+ }
}
/* Reads number from <text> using strtol().
-
-Params:
- text:
- text to read.
- out:
- pointer to output value.
- relative:
- *relative set to 1 if <text> starts with '+' or '-', else set to 0.
- end:
- *end is set to point to next unread character after number.
-
-Returns 0 on success, else -1.
-*/
+ *
+ * Params:
+ * text:
+ * text to read.
+ * out:
+ * pointer to output value.
+ * relative:
+ * *relative set to 1 if <text> starts with '+' or '-', else set to 0.
+ * end:
+ * *end is set to point to next unread character after number.
+ *
+ * Returns 0 on success, else -1.
+ */
static int read_number(const char *text, int *out, int *relative, char **end)
{
- if (text[0] == '+' || text[0] == '-') {
+ if (text[0] == '+' || text[0] == '-')
*relative = 1;
- }
- else {
+ else
*relative = 0;
- }
errno = 0;
- *out = strtol(text, end, 0 /*base*/);
- if (errno || *end == text) {
+ *out = (int)strtol(text, end, 0 /*base*/);
+ if (errno || *end == text)
+ {
fprintf(stderr, "Failed to parse number at start of '%s'.\n", text);
return -1;
}
- if (0) fprintf(stderr, "text='%s': *out=%i *relative=%i\n",
- text, *out, *relative);
+ if (0)
+ fprintf(stderr, "text='%s': *out=%i *relative=%i\n",
+ text, *out, *relative);
return 0;
}
/* Reads number plus optional delta value from <text>.
-
-Evaluates <number> or <number>[+|-<delta>]. E.g. text='1234+2' sets *out=1236,
-text='1234-1' sets *out=1233.
-
-Params:
- text:
- text to read.
- out:
- pointer to output value.
- end:
- *end is set to point to next unread character after number.
-
-Returns 0 on success, else -1.
-*/
+ *
+ * Evaluates <number> or <number>[+|-<delta>]. E.g. text='1234+2' sets *out=1236,
+ * text='1234-1' sets *out=1233.
+ *
+ * Params:
+ * text:
+ * text to read.
+ * out:
+ * pointer to output value.
+ * end:
+ * *end is set to point to next unread character after number.
+ *
+ * Returns 0 on success, else -1.
+ */
static int read_number_delta(const char *text, int *out, char **end)
{
int e;
int relative;
+
e = read_number(text, out, &relative, end);
- if (e) {
+ if (e)
return e;
- }
if (relative) {
fprintf(stderr, "Base number should not start with '+' or '-' at start of '%s'.\n",
text);
@@ -1697,57 +1765,53 @@ static int read_number_delta(const char *text, int *out, char **end)
if (**end == '-' || **end == '+') {
int delta;
e = read_number(*end, &delta, &relative, end);
- if (e) {
+ if (e)
return e;
- }
*out += delta;
}
}
- if (0) fprintf(stderr, "text='%s': *out=%i\n", text, *out);
+ if (0) fprintf(stderr, "text='%s': *out=%i\n", text, *out);
+
return 0;
}
/* Reads range.
-
-E.g.:
- text='115867-2' sets *begin=115865 *end=115866.
- text='115867-1..+3' sets *begin=115866 *end=115869.
-
-Supported patterns for text:
- <range>
- <value> - returns *begin=value *end=*begin+1.
- <value1>..<value2> - returns *begin=value1 *end=value2.
- <value>..+<number> - returns *begin=value *end=*begin+number.
- <value>
- <number>
- <number>+<number>
- <number>-<number>
-
- <number>: [0-9]+
-
-If not specified, *end defaults to *begin+1.
-
-Returns 0 on success, else -1, with *string_end pointing to first unused
-character.
-*/
+ *
+ * E.g.:
+ * text='115867-2' sets *begin=115865 *end=115866.
+ * text='115867-1..+3' sets *begin=115866 *end=115869.
+ *
+ * Supported patterns for text:
+ * <range>
+ * <value> - returns *begin=value *end=*begin+1.
+ * <value1>..<value2> - returns *begin=value1 *end=value2.
+ * <value>..+<number> - returns *begin=value *end=*begin+number.
+ * <value>
+ * <number>
+ * <number>+<number>
+ * <number>-<number>
+ *
+ * <number>: [0-9]+
+ *
+ * If not specified, *end defaults to *begin+1.
+ *
+ * Returns 0 on success, else -1, with *string_end pointing to first unused
+ * character.
+ */
static int read_number_range(const char *text, int *begin, int *end, char **string_end)
{
int e;
e = read_number_delta(text, begin, string_end);
- if (e) {
+ if (e)
return e;
- }
if (string_end && (*string_end)[0] == '.' && (*string_end)[1] == '.') {
int relative;
e = read_number((*string_end) + 2, end, &relative, string_end);
- if (e) {
+ if (e)
return e;
- }
- if (relative) {
+ if (relative)
*end += *begin;
- }
- }
- else {
+ } else {
*end = *begin + 1;
}
if (*end < *begin) {
@@ -1755,18 +1819,18 @@ static int read_number_range(const char *text, int *begin, int *end, char **stri
*begin, *end, text);
return -1;
}
- if (0) fprintf(stderr, "text='%s': *begin=%i *end=%i\n", text, *begin, *end);
+ if (0) fprintf(stderr, "text='%s': *begin=%i *end=%i\n", text, *begin, *end);
+
return 0;
}
-/*
-Format: <range>[,<range>]+
-
-For description of <range>, see read_number_range() above.
-
-E.g.:
- MEMENTO_SQUEEZES=1234-2..+4,2345,2350..+2
-*/
+/* Format: <range>[,<range>]+
+ *
+ * For description of <range>, see read_number_range() above.
+ *
+ * E.g.:
+ * MEMENTO_SQUEEZES=1234-2..+4,2345,2350..+2
+ */
static int Memento_add_squeezes(const char *text)
{
int e = 0;
@@ -1774,20 +1838,18 @@ static int Memento_add_squeezes(const char *text)
int begin;
int end;
char *string_end;
- if (!*text) {
+ if (!*text)
break;
- }
e = read_number_range(text, &begin, &end, &string_end);
- if (e) {
+ if (e)
break;
- }
if (*string_end && *string_end != ',') {
fprintf(stderr, "Expecting comma at start of '%s'.\n", string_end);
e = -1;
break;
}
fprintf(stderr, "Adding squeeze range %i..%i.\n",
- begin, end, string_end-text);
+ begin, end);
memento.squeezes_num += 1;
memento.squeezes = MEMENTO_UNDERLYING_REALLOC(
memento.squeezes,
@@ -1802,11 +1864,11 @@ static int Memento_add_squeezes(const char *text)
memento.squeezes[memento.squeezes_num-1].begin = begin;
memento.squeezes[memento.squeezes_num-1].end = end;
- if (*string_end == 0) {
+ if (*string_end == 0)
break;
- }
text = string_end + 1;
}
+
return e;
}
@@ -1842,6 +1904,18 @@ static void Memento_init(void)
env = getenv("MEMENTO_SQUEEZEAT");
memento.squeezeAt = (env ? atoi(env) : 0);
+ env = getenv("MEMENTO_PATTERN");
+ memento.pattern = (env ? atoi(env) : 0);
+
+ env = getenv("MEMENTO_HIDE_MULTIPLE_REALLOCS");
+ memento.hideMultipleReallocs = (env ? atoi(env) : 0);
+
+ env = getenv("MEMENTO_ABORT_ON_LEAK");
+ memento.abortOnLeak = (env ? atoi(env) : 0);
+
+ env = getenv("MEMENTO_ABORT_ON_CORRUPTION");
+ memento.abortOnCorruption = (env ? atoi(env) : 0);
+
env = getenv("MEMENTO_SQUEEZES");
if (env) {
int e;
@@ -1853,9 +1927,6 @@ static void Memento_init(void)
}
}
- env = getenv("MEMENTO_PATTERN");
- memento.pattern = (env ? atoi(env) : 0);
-
env = getenv("MEMENTO_MAXMEMORY");
memento.maxMemory = (env ? atoi(env) : 0);
@@ -1976,7 +2047,9 @@ static int squeeze(void)
for (i = 0; i < OPEN_MAX; i++) {
if (stashed_map[i] == 0) {
int j = dup(i);
- stashed_map[j] = i+1;
+ if (j >= 0) {
+ stashed_map[j] = i+1;
+ }
}
}
@@ -1986,6 +2059,15 @@ static int squeeze(void)
if (pid == 0) {
/* Child */
signal(SIGSEGV, Memento_signal);
+ /* Close the dup-licated fds to avoid them getting corrupted by faulty
+ * code. */
+ for (i = 0; i < OPEN_MAX; i++) {
+ if (stashed_map[i] != 0) {
+ /* We close duplicated fds, just in case child has some bad
+ * code that modifies/closes random fds. */
+ close(i);
+ }
+ }
/* In the child, we always fail the next allocation. */
if (memento.patternBit == 0) {
memento.patternBit = 1;
@@ -1994,7 +2076,7 @@ static int squeeze(void)
memento.squeezing = 1;
/* This is necessary to allow Memento_failThisEventLocked() near the
- end to do 'return squeeze();'. */
+ * end to do 'return squeeze();'. */
memento.squeezes_num = 0;
return 1;
@@ -2011,7 +2093,7 @@ static int squeeze(void)
int timeout = 30 * 1000 * 1000; /* time out in microseconds! */
while (waitpid(pid, &status, WNOHANG) == 0) {
nanosleep(&tm, NULL);
- timeout -= (tm.tv_nsec/1000);
+ timeout -= (int)(tm.tv_nsec/1000);
tm.tv_nsec *= 2;
if (tm.tv_nsec > 999999999)
tm.tv_nsec = 999999999;
@@ -2187,16 +2269,9 @@ static int Memento_failThisEventLocked(void)
if (!memento.squeezing && memento.squeezes_num) {
/* Move to next relevant squeeze region if appropriate. */
- for(;;) {
- if (memento.squeezes_pos == memento.squeezes_num) {
+ for ( ; memento.squeezes_pos != memento.squeezes_num; memento.squeezes_pos++) {
+ if (memento.sequence < memento.squeezes[memento.squeezes_pos].end)
break;
- }
- if (memento.sequence >= memento.squeezes[memento.squeezes_pos].end) {
- memento.squeezes_pos += 1;
- }
- else {
- break;
- }
}
/* See whether memento.sequence is within this squeeze region. */
@@ -2221,12 +2296,8 @@ static int Memento_failThisEventLocked(void)
if ((memento.sequence >= memento.failAt) && (memento.failAt != 0))
Memento_startFailing();
- if (memento.squeezes_num==0
- && (memento.sequence >= memento.squeezeAt)
- && (memento.squeezeAt != 0)
- ) {
+ if ((memento.squeezes_num==0) && (memento.sequence >= memento.squeezeAt) && (memento.squeezeAt != 0))
return squeeze();
- }
if (!memento.failing)
return 0;
@@ -2266,16 +2337,22 @@ static void *do_malloc(size_t s, int eventType)
Memento_BlkHeader *memblk;
size_t smem = MEMBLK_SIZE(s);
- if (Memento_failThisEventLocked())
+ (void)eventType;
+
+ if (Memento_failThisEventLocked()) {
+ errno = ENOMEM;
return NULL;
+ }
if (s == 0)
return NULL;
memento.numMallocs++;
- if (memento.maxMemory != 0 && memento.alloc + s > memento.maxMemory)
+ if (memento.maxMemory != 0 && memento.alloc + s > memento.maxMemory) {
+ errno = ENOMEM;
return NULL;
+ }
memblk = MEMENTO_UNDERLYING_MALLOC(smem);
if (memblk == NULL)
@@ -2298,7 +2375,7 @@ static void *do_malloc(size_t s, int eventType)
#ifdef MEMENTO_DETAILS
memblk->details = NULL;
memblk->details_tail = &memblk->details;
- Memento_storeDetails(memblk, Memento_EventType_malloc);
+ Memento_storeDetails(memblk, eventType);
#endif /* MEMENTO_DETAILS */
Memento_addBlockHead(&memento.used, memblk, 0);
@@ -2308,6 +2385,83 @@ static void *do_malloc(size_t s, int eventType)
return MEMBLK_TOBLK(memblk);
}
+char *Memento_strdup(const char *text)
+{
+ size_t len = strlen(text) + 1;
+ char *ret;
+
+ if (!memento.inited)
+ Memento_init();
+
+ MEMENTO_LOCK();
+ ret = do_malloc(len, Memento_EventType_strdup);
+ MEMENTO_UNLOCK();
+
+ if (ret != NULL)
+ memcpy(ret, text, len);
+
+ return ret;
+}
+
+#if !defined(MEMENTO_GS_HACKS) && !defined(MEMENTO_MUPDF_HACKS)
+int Memento_asprintf(char **ret, const char *format, ...)
+{
+ va_list va;
+ int n;
+ int n2;
+
+ if (!memento.inited)
+ Memento_init();
+
+ va_start(va, format);
+ n = vsnprintf(NULL, 0, format, va);
+ va_end(va);
+ if (n < 0)
+ return n;
+
+ MEMENTO_LOCK();
+ *ret = do_malloc(n+1, Memento_EventType_asprintf);
+ MEMENTO_UNLOCK();
+ if (*ret == NULL)
+ return -1;
+
+ va_start(va, format);
+ n2 = vsnprintf(*ret, n + 1, format, va);
+ va_end(va);
+
+ return n2;
+}
+
+int Memento_vasprintf(char **ret, const char *format, va_list ap)
+{
+ int n;
+ va_list ap2;
+ va_copy(ap2, ap);
+
+ if (!memento.inited)
+ Memento_init();
+
+ n = vsnprintf(NULL, 0, format, ap);
+ if (n < 0) {
+ va_end(ap2);
+ return n;
+ }
+
+ MEMENTO_LOCK();
+ *ret = do_malloc(n+1, Memento_EventType_vasprintf);
+ MEMENTO_UNLOCK();
+ if (*ret == NULL) {
+ va_end(ap2);
+ return -1;
+ }
+
+ n = vsnprintf(*ret, n + 1, format, ap2);
+ va_end(ap2);
+
+ return n;
+}
+#endif
+
void *Memento_malloc(size_t s)
{
void *ret;
@@ -2318,6 +2472,7 @@ void *Memento_malloc(size_t s)
MEMENTO_LOCK();
ret = do_malloc(s, Memento_EventType_malloc);
MEMENTO_UNLOCK();
+
return ret;
}
@@ -2330,9 +2485,10 @@ void *Memento_calloc(size_t n, size_t s)
MEMENTO_LOCK();
block = do_malloc(n*s, Memento_EventType_calloc);
+ MEMENTO_UNLOCK();
if (block)
memset(block, 0, n*s);
- MEMENTO_UNLOCK();
+
return block;
}
@@ -2373,7 +2529,7 @@ int Memento_checkBytePointerOrNull(void *blk)
return 0;
Memento_checkPointerOrNull(blk);
- i = *(unsigned int *)blk;
+ i = *(unsigned char *)blk;
if (i == MEMENTO_PREFILL_UBYTE)
fprintf(stderr, "Prefill value found - buffer underrun?\n");
@@ -2715,6 +2871,8 @@ static void do_free(void *blk, int eventType)
{
Memento_BlkHeader *memblk;
+ (void)eventType;
+
if (Memento_event()) Memento_breakpointLocked();
if (blk == NULL)
@@ -2723,10 +2881,16 @@ static void do_free(void *blk, int eventType)
memblk = MEMBLK_FROMBLK(blk);
VALGRIND_MAKE_MEM_DEFINED(memblk, sizeof(*memblk));
if (checkBlock(memblk, "free"))
+ {
+ if (memento.abortOnCorruption) {
+ fprintf(stderr, "*** memblk corrupted, calling abort()\n");
+ abort();
+ }
return;
+ }
#ifdef MEMENTO_DETAILS
- Memento_storeDetails(memblk, Memento_EventType_free);
+ Memento_storeDetails(memblk, eventType);
#endif
VALGRIND_MAKE_MEM_DEFINED(memblk, sizeof(*memblk));
@@ -2769,13 +2933,17 @@ static void *do_realloc(void *blk, size_t newsize, int type)
size_t newsizemem;
int flags;
- if (Memento_failThisEventLocked())
+ if (Memento_failThisEventLocked()) {
+ errno = ENOMEM;
return NULL;
+ }
memblk = MEMBLK_FROMBLK(blk);
VALGRIND_MAKE_MEM_DEFINED(memblk, sizeof(*memblk));
- if (checkBlock(memblk, "realloc"))
+ if (checkBlock(memblk, "realloc")) {
+ errno = ENOMEM;
return NULL;
+ }
#ifdef MEMENTO_DETAILS
Memento_storeDetails(memblk, type);
@@ -2786,8 +2954,10 @@ static void *do_realloc(void *blk, size_t newsize, int type)
Memento_breakpointLocked();
VALGRIND_MAKE_MEM_DEFINED(memblk, sizeof(*memblk));
- if (memento.maxMemory != 0 && memento.alloc - memblk->rawsize + newsize > memento.maxMemory)
+ if (memento.maxMemory != 0 && memento.alloc - memblk->rawsize + newsize > memento.maxMemory) {
+ errno = ENOMEM;
return NULL;
+ }
newsizemem = MEMBLK_SIZE(newsize);
Memento_removeBlock(&memento.used, memblk);
@@ -2839,6 +3009,7 @@ void *Memento_realloc(void *blk, size_t newsize)
MEMENTO_LOCK();
ret = do_malloc(newsize, Memento_EventType_realloc);
MEMENTO_UNLOCK();
+ if (!ret) errno = ENOMEM;
return ret;
}
if (newsize == 0) {
@@ -2851,6 +3022,7 @@ void *Memento_realloc(void *blk, size_t newsize)
MEMENTO_LOCK();
ret = do_realloc(blk, newsize, Memento_EventType_realloc);
MEMENTO_UNLOCK();
+ if (!ret) errno = ENOMEM;
return ret;
}
@@ -3306,6 +3478,9 @@ void *(Memento_reference)(void *a)
#undef Memento_free
#undef Memento_realloc
#undef Memento_calloc
+#undef Memento_strdup
+#undef Memento_asprintf
+#undef Memento_vasprintf
void *Memento_malloc(size_t size)
{
@@ -3327,6 +3502,70 @@ void *Memento_calloc(size_t n, size_t s)
return MEMENTO_UNDERLYING_CALLOC(n, s);
}
+#if !defined(MEMENTO_GS_HACKS) && !defined(MEMENTO_MUPDF_HACKS)
+/* Avoid calling strdup, in case our compiler doesn't support it.
+ * Yes, I'm looking at you, early Visual Studios. */
+char *Memento_strdup(const char *s)
+{
+ size_t len = strlen(s)+1;
+ char *ret = MEMENTO_UNDERLYING_MALLOC(len);
+ if (ret != NULL)
+ memcpy(ret, s, len);
+ return ret;
+}
+
+/* Avoid calling asprintf, in case our compiler doesn't support it.
+ * Vaguely unhappy about relying on vsnprintf, but... */
+int Memento_asprintf(char **ret, const char *format, ...)
+{
+ va_list va;
+ int n;
+ int n2;
+
+ va_start(va, format);
+ n = vsnprintf(NULL, 0, format, va);
+ va_end(va);
+ if (n < 0)
+ return n;
+
+ *ret = MEMENTO_UNDERLYING_MALLOC(n+1);
+ if (*ret == NULL)
+ return -1;
+
+ va_start(va, format);
+ n2 = vsnprintf(*ret, n + 1, format, va);
+ va_end(va);
+
+ return n2;
+}
+
+/* Avoid calling vasprintf, in case our compiler doesn't support it.
+ * Vaguely unhappy about relying on vsnprintf, but... */
+int Memento_vasprintf(char **ret, const char *format, va_list ap)
+{
+ int n;
+ va_list ap2;
+ va_copy(ap2, ap);
+
+ n = vsnprintf(NULL, 0, format, ap);
+ if (n < 0) {
+ va_end(ap2);
+ return n;
+ }
+
+ *ret = MEMENTO_UNDERLYING_MALLOC(n+1);
+ if (*ret == NULL) {
+ va_end(ap2);
+ return -1;
+ }
+
+ n = vsnprintf(*ret, n + 1, format, ap2);
+ va_end(ap2);
+
+ return n;
+}
+#endif
+
void (Memento_listBlocks)(void)
{
}
@@ -3357,6 +3596,10 @@ void (Memento_listBlockInfo)(void)
{
}
+void (Memento_blockInfo)(void *ptr)
+{
+}
+
void (Memento_startLeaking)(void)
{
}
diff --git a/base/memento.h b/base/memento.h
index d4ff811d..c9994b10 100644
--- a/base/memento.h
+++ b/base/memento.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2020 Artifex Software, Inc.
+/* Copyright (C) 2009-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -185,6 +185,7 @@
#ifndef MEMENTO_H
#include <stdlib.h>
+#include <stdarg.h>
#define MEMENTO_H
@@ -237,9 +238,15 @@ void *Memento_malloc(size_t s);
void *Memento_realloc(void *, size_t s);
void Memento_free(void *);
void *Memento_calloc(size_t, size_t);
+char *Memento_strdup(const char*);
+#if !defined(MEMENTO_GS_HACKS) && !defined(MEMENTO_MUPDF_HACKS)
+int Memento_asprintf(char **ret, const char *format, ...);
+int Memento_vasprintf(char **ret, const char *format, va_list ap);
+#endif
void Memento_info(void *addr);
void Memento_listBlockInfo(void);
+void Memento_blockInfo(void *blk);
void *Memento_takeByteRef(void *blk);
void *Memento_dropByteRef(void *blk);
void *Memento_takeShortRef(void *blk);
@@ -259,8 +266,10 @@ int Memento_checkIntPointerOrNull(void *blk);
void Memento_startLeaking(void);
void Memento_stopLeaking(void);
+/* Returns number of allocation events so far. */
int Memento_sequence(void);
+/* Returns non-zero if our process was forked by Memento squeeze. */
int Memento_squeezing(void);
void Memento_fin(void);
@@ -270,18 +279,28 @@ void Memento_bt(void);
#ifdef MEMENTO
#ifndef COMPILING_MEMENTO_C
-#define malloc Memento_malloc
-#define free Memento_free
-#define realloc Memento_realloc
-#define calloc Memento_calloc
+#define malloc Memento_malloc
+#define free Memento_free
+#define realloc Memento_realloc
+#define calloc Memento_calloc
+#define strdup Memento_strdup
+#if !defined(MEMENTO_GS_HACKS) && !defined(MEMENTO_MUPDF_HACKS)
+#define asprintf Memento_asprintf
+#define vasprintf Memento_vasprintf
+#endif
#endif
#else
-#define Memento_malloc MEMENTO_UNDERLYING_MALLOC
-#define Memento_free MEMENTO_UNDERLYING_FREE
-#define Memento_realloc MEMENTO_UNDERLYING_REALLOC
-#define Memento_calloc MEMENTO_UNDERLYING_CALLOC
+#define Memento_malloc MEMENTO_UNDERLYING_MALLOC
+#define Memento_free MEMENTO_UNDERLYING_FREE
+#define Memento_realloc MEMENTO_UNDERLYING_REALLOC
+#define Memento_calloc MEMENTO_UNDERLYING_CALLOC
+#define Memento_strdup strdup
+#if !defined(MEMENTO_GS_HACKS) && !defined(MEMENTO_MUPDF_HACKS)
+#define Memento_asprintf asprintf
+#define Memento_vasprintf vasprintf
+#endif
#define Memento_checkBlock(A) 0
#define Memento_checkAllMemory() 0
@@ -303,6 +322,7 @@ void Memento_bt(void);
#define Memento_label(A,B) (A)
#define Memento_info(A) do {} while (0)
#define Memento_listBlockInfo() do {} while (0)
+#define Memento_blockInfo(A) do {} while (0)
#define Memento_takeByteRef(A) (A)
#define Memento_dropByteRef(A) (A)
#define Memento_takeShortRef(A) (A)
diff --git a/base/memory_.h b/base/memory_.h
index 7fb6f7ab..4429bb87 100644
--- a/base/memory_.h
+++ b/base/memory_.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/mkromfs.c b/base/mkromfs.c
index 7a04139e..08fbb27d 100644
--- a/base/mkromfs.c
+++ b/base/mkromfs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -159,6 +159,18 @@ int gp_stat_impl(const gs_memory_t *mem, const char *path, struct _stat64 *buf)
(void)buf;
return 0;
}
+#ifdef MEMENTO
+#undef malloc
+#undef free
+void* Memento_malloc(size_t s)
+{
+ return malloc(s);
+}
+void Memento_free(void* blk)
+{
+ free(blk);
+}
+#endif
#endif
int
@@ -200,8 +212,7 @@ int outprintf(const gs_memory_t *mem, const char *fmt, ...)
return count;
}
-#ifndef GS_THREADSAFE
-int errprintf_nomem(const char *fmt, ...)
+int errprintf(const gs_memory_t *mem, const char *fmt, ...)
{
int count;
char buf[PRINTF_BUF_LENGTH];
@@ -218,9 +229,8 @@ int errprintf_nomem(const char *fmt, ...)
va_end(args);
return count;
}
-#endif
-int errprintf(const gs_memory_t *mem, const char *fmt, ...)
+int errprintf_nomem(const char *fmt, ...)
{
int count;
char buf[PRINTF_BUF_LENGTH];
@@ -238,19 +248,18 @@ int errprintf(const gs_memory_t *mem, const char *fmt, ...)
return count;
}
-
#ifndef GS_THREADSAFE
#if __LINE__ /* compiler provides it */
void
lprintf_file_and_line(const char *file, int line)
{
- epf("%s(%d): ", file, line);
+ errprintf(NULL, "%s(%d): ", file, line);
}
#else
void
lprintf_file_only(FILE * f, const char *file)
{
- epf("%s(?): ", file);
+ errprintf(NULL, "%s(?): ", file);
}
#endif
@@ -259,13 +268,13 @@ eprintf_program_ident(const char *program_name,
long revision_number)
{
if (program_name) {
- epf((revision_number ? "%s " : "%s"), program_name);
+ errprintf(NULL, (revision_number ? "%s " : "%s"), program_name);
if (revision_number) {
int fpart = revision_number % 100;
- epf("%d.%02d", (int)(revision_number / 100), fpart);
+ errprintf(NULL, "%d.%02d", (int)(revision_number / 100), fpart);
}
- epf(": ");
+ errprintf(NULL, ": ");
}
}
#endif
@@ -290,9 +299,9 @@ int
gs_log_error(int err, const char *file, int line)
{
if (file == NULL)
- errprintf_nomem("Returning error %d.\n", err);
+ errprintf(NULL, "Returning error %d.\n", err);
else
- errprintf_nomem("%s(%d): Returning error %d.\n",
+ errprintf(NULL, "%s(%d): Returning error %d.\n",
(const char *)file, line, err);
return err;
}
@@ -343,6 +352,22 @@ minimal_free_string(gs_memory_t * mem, byte * data, size_t nbytes, client_name_t
return;
}
+/* Minimal thread functions (needed by gs_next_ids */
+int gp_monitor_enter(gp_monitor *);
+int gp_monitor_leave(gp_monitor *);
+
+int
+gp_monitor_enter(gp_monitor * mon)
+{
+ return 0;
+}
+
+int
+gp_monitor_leave(gp_monitor * mon)
+{
+ return 0;
+}
+
void basic_enum_ptrs(void);
void basic_reloc_ptrs(void);
diff --git a/base/msvccmd.mak b/base/msvccmd.mak
index 7d5980e8..39169e20 100644
--- a/base/msvccmd.mak
+++ b/base/msvccmd.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -220,6 +220,12 @@ MSINCFLAGS=-I"$(INCDIR64A)" -I"$(INCDIR64B)"
MSINCFLAGS=
!endif
+!if "$(SANITIZE)" == "1"
+SANITIZECFLAGS=/fsanitize=address
+!else
+SANITIZECFLAGS=
+!endif
+
# Specify output object name
CCOBJNAME=-Fo
@@ -233,8 +239,8 @@ COMPILE_FOR_CONSOLE_EXE=
GENOPT=$(CP) $(CD) $(CT) $(CS) $(WARNOPT) $(VC8WARN) /nologo $(CMT)
CCFLAGS=$(PLATOPT) $(FPFLAGS) $(CPFLAGS) $(CFLAGS) $(XCFLAGS) $(MSINCFLAGS) $(SBRFLAGS)
-CC=$(COMP) /c $(CCFLAGS) $(COMPILE_FULL_OPTIMIZED) @$(GLGENDIR)\ccf32.tr
-CXX=$(CXX) /c $(CCFLAGS) $(COMPILE_FULL_OPTIMIZED) @$(GLGENDIR)\ccf32.tr
+CC=$(COMP) /c $(CCFLAGS) $(COMPILE_FULL_OPTIMIZED) $(SANITIZECFLAGS) @$(GLGENDIR)\ccf32.tr
+CXX=$(CXX) /c $(CCFLAGS) $(COMPILE_FULL_OPTIMIZED) $(SANITIZECFLAGS) @$(GLGENDIR)\ccf32.tr
CPP=$(COMPCPP) /c $(CCFLAGS) @$(GLGENDIR)\ccf32.tr
!if $(MAKEDLL)
WX=$(COMPILE_FOR_DLL)
diff --git a/base/msvclib.mak b/base/msvclib.mak
index c0396232..dbf49296 100644
--- a/base/msvclib.mak
+++ b/base/msvclib.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -14,7 +14,7 @@
#
# makefile for Microsoft Visual C++ 4.1 or later, Windows NT or Windows 95 LIBRARY.
#
-# All configurable options are surrounded by !ifndef/!endif to allow
+# All configurable options are surrounded by !ifndef/!endif to allow
# preconfiguration from within another makefile.
# If we are building MEMENTO=1, then adjust default debug flags
@@ -387,48 +387,15 @@ TIFFPLATFORM=win32
TIFF_CFLAGS=-DJPEG_SUPPORT -DOJPEG_SUPPORT -DJPEG_LIB_MK1_OR_12BIT=0
!endif
-# Define which jbig2 library to use
-!if !defined(JBIG2_LIB) && (!defined(NO_LURATECH) || "$(NO_LURATECH)" != "1")
-!if exist("luratech\ldf_jb2")
-JBIG2_LIB=luratech
-!endif
-!endif
-
!ifndef JBIG2_LIB
JBIG2_LIB=jbig2dec
!endif
-!if "$(JBIG2_LIB)" == "luratech" || "$(JBIG2_LIB)" == "ldf_jb2"
-# Set defaults for using the Luratech JB2 implementation
-!ifndef JBIG2SRCDIR
-# CSDK source code location
-JBIG2SRCDIR=luratech\ldf_jb2
-!endif
-!ifndef JBIG2_CFLAGS
-# required compiler flags
-!ifdef WIN64
-JBIG2_CFLAGS=-DUSE_LDF_JB2 -DWIN64
-!else
-JBIG2_CFLAGS=-DUSE_LDF_JB2 -DWIN32
-!endif
-!endif
-!else
# Use jbig2dec by default. See jbig2.mak for more information.
!ifndef JBIG2SRCDIR
# location of included jbig2dec library source
JBIG2SRCDIR=jbig2dec
!endif
-!endif
-
-# Alternatively, you can build a separate DLL
-# and define SHARE_JBIG2=1 in src/winlib.mak
-
-# Define which jpeg2k library to use
-!if !defined(JPX_LIB) && (!defined(NO_LURATECH) || "$(NO_LURATECH)" != "1")
-!if exist("luratech\lwf_jp2")
-JPX_LIB=luratech
-!endif
-!endif
# Alternatively, you can build a separate DLL
# and define SHARE_JPX=1 in src/winlib.mak
@@ -612,6 +579,37 @@ MS_TOOLSET_VERSION=14.26.28806
!if "$(_NMAKE_VER)" == "14.27.29111.0"
# VS2019 (Toolset v142)
MSVC_VERSION=16
+MS_TOOLSET_VERSION=14.27.29111
+!endif
+!if "$(_NMAKE_VER)" == "14.27.29112.0"
+# VS2019 (Toolset v142)
+MSVC_VERSION=16
+MS_TOOLSET_VERSION=14.27.29112
+!endif
+!if "$(_NMAKE_VER)" == "14.28.29333.0"
+# VS2019 (Toolset v142)
+MSVC_VERSION=16
+MS_TOOLSET_VERSION=14.28.29333
+!endif
+!if "$(_NMAKE_VER)" == "14.28.29334.0"
+# VS2019 (Toolset v142)
+MSVC_VERSION=16
+MS_TOOLSET_VERSION=14.28.29333
+!endif
+!if "$(_NMAKE_VER)" == "14.28.29335.0"
+# VS2019 (Toolset v142)
+MSVC_VERSION=16
+MS_TOOLSET_VERSION=14.28.29333
+!endif
+!if "$(_NMAKE_VER)" == "14.28.29336.0"
+# VS2019 (Toolset v142)
+MSVC_VERSION=16
+MS_TOOLSET_VERSION=14.28.29333
+!endif
+!if "$(_NMAKE_VER)" == "14.28.29910.0"
+# VS2019 (Toolset v142)
+MSVC_VERSION=16
+MS_TOOLSET_VERSION=14.28.29333
!endif
!endif
@@ -905,20 +903,55 @@ LINKLIBPATH=/LIBPATH:"$(COMPBASE)\lib\amd64" /LIBPATH:"$(COMPBASE)\PlatformSDK\L
!endif
!if $(MSVC_VERSION) == 15
+! ifndef DEVSTUDIO
+DEVSTUDIO=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\$(MS_TOOLSET_VERSION)
+! endif
! if "$(DEVSTUDIO)"==""
COMPBASE=
SHAREDBASE=
! else
-!MESSAGE Compilation is unlikely to work like this. Build from VS solution for now.
+! if $(BUILD_SYSTEM) == 64
+DEVSTUDIO_HOST=Hostx64
+! else
+DEVSTUDIO_HOST=Hostx86
+! endif
+! ifdef WIN64
+DEVSTUDIO_TARGET=x64
+! else
+DEVSTUDIO_TARGET=x86
+! endif
+COMPDIR=$(DEVSTUDIO)\bin\$(DEVSTUDIO_HOST)\$(DEVSTUDIO_TARGET)
+RCDIR=
+LINKLIBPATH=/LIBPATH:"$(DEVSTUDIO)\lib\$(DEVSTUDIO_TARGET)"
! endif
!endif
!if $(MSVC_VERSION) == 16
+! ifndef DEVSTUDIO
+! if exist("C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional")
+DEVSTUDIO_VARIANT=Professional
+! else
+DEVSTUDIO_VARIANT=Community
+! endif
+DEVSTUDIO=C:\Program Files (x86)\Microsoft Visual Studio\2019\$(DEVSTUDIO_VARIANT)\VC\Tools\MSVC\$(MS_TOOLSET_VERSION)
+! endif
! if "$(DEVSTUDIO)"==""
COMPBASE=
SHAREDBASE=
! else
-!MESSAGE Compilation is unlikely to work like this. Build from VS solution for now.
+! if $(BUILD_SYSTEM) == 64
+DEVSTUDIO_HOST=Hostx64
+! else
+DEVSTUDIO_HOST=Hostx86
+! endif
+! ifdef WIN64
+DEVSTUDIO_TARGET=x64
+! else
+DEVSTUDIO_TARGET=x86
+! endif
+COMPDIR=$(DEVSTUDIO)\bin\$(DEVSTUDIO_HOST)\$(DEVSTUDIO_TARGET)
+RCDIR=
+LINKLIBPATH=/LIBPATH:"$(DEVSTUDIO)\lib\$(DEVSTUDIO_TARGET)"
! endif
!endif
@@ -1114,24 +1147,6 @@ JPX_SSE_CFLAGS=
SYNC=winsync
!endif
-# Luratech jp2 flags depend on the compiler version
-#
-!if "$(JPX_LIB)" == "luratech" || "$(JPX_LIB)" == "lwf_jp2"
-# Set defaults for using the Luratech JP2 implementation
-!ifndef JPXSRCDIR
-# CSDK source code location
-JPXSRCDIR=luratech\lwf_jp2
-!endif
-!ifndef JPX_CFLAGS
-# required compiler flags
-!ifdef WIN64
-JPX_CFLAGS=-DUSE_LWF_JP2 -DWIN64 -DNO_ASSEMBLY
-!else
-JPX_CFLAGS=-DUSE_LWF_JP2 -DWIN32 -DNO_ASSEMBLY
-!endif
-!endif
-!endif
-
# OpenJPEG compiler flags
#
!if "$(JPX_LIB)" == "openjpeg"
diff --git a/base/msvctail.mak b/base/msvctail.mak
index 9f6f2c5e..e2d81a9a 100644
--- a/base/msvctail.mak
+++ b/base/msvctail.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
diff --git a/base/ocr.mak b/base/ocr.mak
index 9d58d008..3c9e2787 100644
--- a/base/ocr.mak
+++ b/base/ocr.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -28,7 +28,7 @@ $(GLGEN)libocr.dev : $(LIBOCR_MAK) $(ECHOGS_XE)$(MAKEDIRS)\
# Tesseract veneer.
$(GLGEN)tessocr.$(OBJ) : $(GLSRC)tessocr.cpp $(GLSRC)tessocr.h $(LIBOCR_MAK) \
$(gsmemory_h) $(gxiodev_h) $(stream_h) $(TESSDEPS)
- $(GLCC) $(D_)LEPTONICA_INTERCEPT_MALLOC=1$(_D) $(TESSINCLUDES) $(I_)$(LEPTONICADIR)$(D)src$(_I) $(GLO_)tessocr.$(OBJ) $(C_) $(GLSRC)tessocr.cpp
+ $(TESSCXX) $(D_)LEPTONICA_INTERCEPT_MALLOC=1$(_D) $(I_)$(LEPTONICADIR)$(D)src$(_I) $(GLO_)tessocr.$(OBJ) $(C_) $(D_)TESSDATA="$(TESSDATA)"$(_D) $(GLSRC)tessocr.cpp
# 0 = No version.
diff --git a/base/openjpeg.mak b/base/openjpeg.mak
index bb75f0f9..5d44622c 100644
--- a/base/openjpeg.mak
+++ b/base/openjpeg.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -64,7 +64,7 @@ open_jpeg_OBJS = \
$(OPEN_JPEG_OBJ)$(OPEN_JPEG_PREFIX)thix_manager.$(OBJ) \
$(OPEN_JPEG_OBJ)$(OPEN_JPEG_PREFIX)tpix_manager.$(OBJ) \
$(OPEN_JPEG_OBJ)$(OPEN_JPEG_PREFIX)thread.$(OBJ) \
- $(OPEN_JPEG_OBJ)$(OPEN_JPEG_PREFIX)sparse_array.$(OBJ)
+ $(OPEN_JPEG_OBJ)$(OPEN_JPEG_PREFIX)sparse_array.$(OBJ)
open_jpeg_HDRS = \
$(OPEN_JPEG_SRC)bio.h \
@@ -115,7 +115,9 @@ $(OPEN_JPEG_GEN)openjpeg_0.dev : $(ECHOGS_XE) $(open_jpeg_OBJS) \
$(SETMOD) $(OPEN_JPEG_GEN)openjpeg_0 $(open_jpeg_OBJS)
# define our specific compiler
-OPEN_JPEG_CC=$(CC) $(CFLAGS) $(D_)OPJ_STATIC$(_D) $(I_)$(OPEN_JPEG_GEN)$(_I) $(I_)$(JPX_OPENJPEG_I_)$(_I) $(I_)$(JPX_OPENJPEG_I_)$(D)..$(_I) $(JPXCF_)
+OPEN_JPEG_CC=$(CC) $(D_)OPJ_STATIC$(_D) $(I_)$(OPEN_JPEG_GEN)$(_I) $(I_)$(JPX_OPENJPEG_I_)$(_I) \
+$(I_)$(JPX_OPENJPEG_I_)$(D)..$(_I) $(JPXCF_) $(CCFLAGS)
+
OPEN_JPEG_O=$(O_)$(OPEN_JPEG_OBJ)$(OPEN_JPEG_PREFIX)
OPEN_JPEG_DEP=$(AK) $(OPEN_JPEG_MAK) $(MAKEDIRS)
diff --git a/base/openvms.mak b/base/openvms.mak
index 8152b944..2260033e 100644
--- a/base/openvms.mak
+++ b/base/openvms.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
diff --git a/base/openvms.mmk b/base/openvms.mmk
index 65c2c65f..0b19ff1c 100644
--- a/base/openvms.mmk
+++ b/base/openvms.mmk
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
diff --git a/base/pack_ps.c b/base/pack_ps.c
index 2ab4117c..c506b71a 100644
--- a/base/pack_ps.c
+++ b/base/pack_ps.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -439,7 +439,7 @@ main(int argc, char *argv[])
#endif
/* Display processing statistics. */
- printf(" Processed %d lines of PostScript data.\n", total_code_lines);
+ printf(" Processed %d lines of PostScript data.\n", total_code_lines);
printf(" %d bytes of PostScript data packed down to %d bytes.\n", total_input_length, total_output_length);
#if STRIP_PDFR_DEBUG_CALLS
printf(" %d PDFR_DEBUG calls removed from the code.\n", pdfr_debug_start_count);
diff --git a/base/pcwin.mak b/base/pcwin.mak
index 462db460..f0d1598e 100644
--- a/base/pcwin.mak
+++ b/base/pcwin.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
diff --git a/base/pipe_.h b/base/pipe_.h
index e6dce031..ad8fda55 100644
--- a/base/pipe_.h
+++ b/base/pipe_.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/png.mak b/base/png.mak
index 2d7b3806..31bcb975 100644
--- a/base/png.mak
+++ b/base/png.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -60,7 +60,7 @@ PZGEN=$(ZGENDIR)$(D)
# PI_ and PF_ are defined in gs.mak.
# NB: we can't use the normal $(CC_) here because msvccmd.mak
# adds /Za which conflicts with the libpng 1.5.x source.
-PNGCC=$(CC) $(CFLAGS) $(PNG_CFLAGS) $(I_)$(PI_)$(_I) $(I_)$(PNGGENDIR)$(_I) $(PF_) \
+PNGCC=$(CC) $(I_)$(PI_)$(_I) $(I_)$(PNGGENDIR)$(_I) $(PF_) $(CCFLAGS) $(PNG_CFLAGS) \
$(D_)PNG_NO_ASSEMBLER_CODE$(_D) $(D_)PNG_INTEL_SSE_OPT=0$(_D) \
$(D_)PNG_INTEL_SSE_IMPLEMENTATION=0$(_D) $(D_)PNG_ARM_NEON_IMPLEMENTATION=0$(_D)
diff --git a/base/png_.h b/base/png_.h
index 836f6e83..50a8bafa 100644
--- a/base/png_.h
+++ b/base/png_.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ramfs.c b/base/ramfs.c
index 66893075..88d21552 100644
--- a/base/ramfs.c
+++ b/base/ramfs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ramfs.h b/base/ramfs.h
index 09816ba1..1eaf3174 100644
--- a/base/ramfs.h
+++ b/base/ramfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sa85d.c b/base/sa85d.c
index f9fa57fe..4e51e89a 100644
--- a/base/sa85d.c
+++ b/base/sa85d.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -135,9 +135,9 @@ s_A85D_process(stream_state * st, stream_cursor_read * pr,
* So we allow CR/LF between them. */
/* PDF further relaxes the requirements and accepts bare '~'.
*/
- while ((p[i] == 13 || p[i] == 10) && (p+i <= rlimit))
+ while ((p + i <= rlimit) && (p[i] == 13 || p[i] == 10))
i++;
- if (p[i] != '>') {
+ if (p + i <= rlimit && p[i] != '>') {
if (ss->pdf_rules) {
if (p[i] == 13 || p[i] == 10) {
if (!last)
@@ -146,7 +146,7 @@ s_A85D_process(stream_state * st, stream_cursor_read * pr,
p--;
}
} else {
- if (p+i == rlimit) {
+ if (p + i == rlimit) {
if (last)
status = ERRC;
else
diff --git a/base/sa85d.h b/base/sa85d.h
index 32efeb8d..8b9619dd 100644
--- a/base/sa85d.h
+++ b/base/sa85d.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sa85x.h b/base/sa85x.h
index aec328c1..cf638590 100644
--- a/base/sa85x.h
+++ b/base/sa85x.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/saes.c b/base/saes.c
index c580b849..75e1146c 100644
--- a/base/saes.c
+++ b/base/saes.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/saes.h b/base/saes.h
index 7cf9a5b7..799da357 100644
--- a/base/saes.h
+++ b/base/saes.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sarc4.c b/base/sarc4.c
index 12c9fe59..d2c85e97 100644
--- a/base/sarc4.c
+++ b/base/sarc4.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sarc4.h b/base/sarc4.h
index 75decd14..b1f63b9c 100644
--- a/base/sarc4.h
+++ b/base/sarc4.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sbcp.c b/base/sbcp.c
index f61db1b1..979ae099 100644
--- a/base/sbcp.c
+++ b/base/sbcp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sbcp.h b/base/sbcp.h
index 2c20e1f1..f0e427e5 100644
--- a/base/sbcp.h
+++ b/base/sbcp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sbtx.h b/base/sbtx.h
index 82850766..d9df3f15 100644
--- a/base/sbtx.h
+++ b/base/sbtx.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/scanchar.h b/base/scanchar.h
index ca5ec289..c9f58487 100644
--- a/base/scanchar.h
+++ b/base/scanchar.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/scantab.c b/base/scantab.c
index 7240d736..4a652520 100644
--- a/base/scantab.c
+++ b/base/scantab.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/scf.h b/base/scf.h
index 9ee9fa45..dbcb33d3 100644
--- a/base/scf.h
+++ b/base/scf.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/scfd.c b/base/scfd.c
index 97fa96b6..1ad2b5ad 100644
--- a/base/scfd.c
+++ b/base/scfd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -56,6 +56,9 @@ s_CFD_init(stream_state * st)
ROUND_UP((ss->Columns + 7) >> 3, ss->DecodedByteAlign);
byte white = (ss->BlackIs1 ? 0 : 0xff);
+ if (raster < 0)
+ return ERRC;
+
s_hcd_init_inline(ss);
/* Because skip_white_pixels can look as many as 4 bytes ahead, */
/* we need to allow 4 extra bytes at the end of the row buffers. */
@@ -211,7 +214,7 @@ static inline int invert_data(stream_CFD_state *ss, stream_cursor_read *pr, int
if (q >= ss->lbuf + ss->raster + CFD_BUFFER_SLOP) {
return(-1);
}
-
+
if ( (*rlen) > qbit )
{
if (q + ((*rlen - qbit) >> 3) > ss->lbuf + ss->raster + CFD_BUFFER_SLOP) {
@@ -536,103 +539,105 @@ cf_decode_1d(stream_CFD_state * ss, stream_cursor_read * pr)
cfd_load_state();
if_debug1m('w', ss->memory, "[w1]entry run_color = %d\n", ss->run_color);
- if (ss->run_color > 0)
+ if (run_color > 0)
goto db;
else
goto dw;
#define q_at_stop() (q >= stop && (qbit <= end_bit || q > stop))
- top:run_color = 0;
- if (q_at_stop())
- goto done;
- dw: /* Decode a white run. */
+ while (1)
+ {
+ run_color = 0;
+ if (q_at_stop())
+ goto done;
- cfd_store_state();
- status = get_run(ss, pr, cf_white_decode, cfd_white_initial_bits, cfd_white_min_bits,
- &bcnt, "[w1]white");
- cfd_load_state();
- if (status < 0) {
- goto out0;
- }
+ dw: /* Decode a white run. */
+ do {
+ cfd_store_state();
+ status = get_run(ss, pr, cf_white_decode, cfd_white_initial_bits,
+ cfd_white_min_bits, &bcnt, "[w1]white");
+ cfd_load_state();
+ if (status < 0) {
+ /* We already set run_color to 0 or -1. */
+ status = 0;
+ goto out;
+ }
- if (bcnt < 0) { /* exceptional situation */
- switch (bcnt) {
- case run_uncompressed: /* Uncompressed data. */
- cfd_store_state();
- bcnt = cf_decode_uncompressed(ss, pr);
- if (bcnt < 0)
- return bcnt;
- cfd_load_state();
- if (bcnt)
- goto db;
- else
- goto dw;
- /*case run_error: */
- /*case run_zeros: *//* Premature end-of-line. */
- default:
+ if (bcnt < 0) { /* exceptional situation */
+ switch (bcnt) {
+ case run_uncompressed: /* Uncompressed data. */
+ cfd_store_state();
+ bcnt = cf_decode_uncompressed(ss, pr);
+ if (bcnt < 0)
+ return bcnt;
+ cfd_load_state();
+ if (bcnt)
+ goto db;
+ else
+ continue; /* Restart decoding white */
+ /*case run_error: */
+ /*case run_zeros: *//* Premature end-of-line. */
+ default:
+ status = ERRC;
+ goto out;
+ }
+ }
+
+ cfd_store_state();
+ status = skip_data(ss, pr, bcnt);
+ cfd_load_state();
+ if (status < 0) {
+ /* If we run out of data after a makeup code, */
+ /* note that we are still processing a white run. */
+ run_color = -1;
+ }
+ } while (status < 0);
+
+ if (q_at_stop()) {
+ run_color = 0; /* not inside a run */
+ done:
+ if (q > stop || qbit < end_bit)
status = ERRC;
- goto out;
+ else
+ status = 1;
+ break;
}
- }
+ run_color = 1;
- cfd_store_state();
- status = skip_data(ss, pr, bcnt);
- cfd_load_state();
- if (status < 0) {
- goto dwx;
- }
-
- if (q_at_stop()) {
- run_color = 0; /* not inside a run */
- goto done;
- }
- run_color = 1;
- db: /* Decode a black run. */
+ db: /* Decode a black run. */
+ do {
+ cfd_store_state();
+ status = get_run(ss, pr, cf_black_decode, cfd_black_initial_bits,
+ cfd_black_min_bits, &bcnt, "[w1]black");
+ cfd_load_state();
+ if (status < 0) {
+ /* We already set run_color to 1 or 2. */
+ status = 0;
+ goto out;
+ }
- cfd_store_state();
- status = get_run(ss, pr, cf_black_decode, cfd_black_initial_bits, cfd_black_min_bits,
- &bcnt, "[w1]black");
- cfd_load_state();
- if (status < 0) {
- goto out1;
- }
+ if (bcnt < 0) { /* All exceptional codes are invalid here. */
+ /****** WRONG, uncompressed IS ALLOWED ******/
+ status = ERRC;
+ goto out;
+ }
- if (bcnt < 0) { /* All exceptional codes are invalid here. */
- /****** WRONG, uncompressed IS ALLOWED ******/
- status = ERRC;
- goto out;
+ /* Invert bits designated by black run. */
+ cfd_store_state();
+ status = invert_data(ss, pr, &bcnt, black_byte);
+ cfd_load_state();
+ if (status < 0) {
+ /* If we run out of data after a makeup code, */
+ /* note that we are still processing a black run. */
+ run_color = 2;
+ }
+ } while (status < 0);
}
- /* Invert bits designated by black run. */
+out:
cfd_store_state();
- status = invert_data(ss, pr, &bcnt, black_byte);
- cfd_load_state();
- if (status < 0) {
- goto dbx;
- }
-
- goto top;
- dwx: /* If we run out of data after a makeup code, */
- /* note that we are still processing a white run. */
- run_color = -1;
- goto dw;
- dbx: /* If we run out of data after a makeup code, */
- /* note that we are still processing a black run. */
- run_color = 2;
- goto db;
- done:if (q > stop || qbit < end_bit)
- status = ERRC;
- else
- status = 1;
- out:cfd_store_state();
ss->run_color = run_color;
if_debug1m('w', ss->memory, "[w1]exit run_color = %d\n", run_color);
return status;
- out0: /* We already set run_color to 0 or -1. */
- status = 0;
- goto out;
- out1: /* We already set run_color to 1 or 2. */
- status = 0;
- goto out;
}
/* Decode a 2-D scan line. */
@@ -673,35 +678,45 @@ cf_decode_2d(stream_CFD_state * ss, stream_cursor_read * pr)
goto hbb;
/*case 0: */
}
- top:if (count <= end_count) {
- status = (count < end_count ? ERRC : 1);
- goto out;
- }
- /* If invert == invert_white, white and black have their */
- /* correct meanings; if invert == ~invert_white, */
- /* black and white are interchanged. */
- if_debug1m('W', ss->memory, "[w2]%4d:\n", count);
-#ifdef DEBUG
- /* Check the invariant between q, qbit, and count. */
+
+ /* top of decode loop */
+ while (1)
{
- int pcount = (endptr - q) * 8 + qbit;
+ if (count <= end_count) {
+ status = (count < end_count ? ERRC : 1);
+ goto out;
+ }
+ /* If invert == invert_white, white and black have their */
+ /* correct meanings; if invert == ~invert_white, */
+ /* black and white are interchanged. */
+ if_debug1m('W', ss->memory, "[w2]%4d:\n", count);
+#ifdef DEBUG
+ /* Check the invariant between q, qbit, and count. */
+ {
+ int pcount = (endptr - q) * 8 + qbit;
- if (pcount != count)
- dmlprintf2(ss->memory, "[w2]Error: count=%d pcount=%d\n",
- count, pcount);
- }
+ if (pcount != count)
+ dmlprintf2(ss->memory, "[w2]Error: count=%d pcount=%d\n",
+ count, pcount);
+ }
#endif
- /*
- * We could just use get_run here, but we can do better. However,
- * we must be careful to handle the case where the very last codes
- * in the input stream are 1-bit "vertical 0" codes: we can't just
- * use ensure_bits(3, ...) and go to get more data if it fails.
- */
- ensure_bits(3, out3);
+ /*
+ * We could just use get_run here, but we can do better. However,
+ * we must be careful to handle the case where the very last codes
+ * in the input stream are 1-bit "vertical 0" codes: we can't just
+ * use ensure_bits(3, ...) and go to get more data if it fails.
+ */
+ ensure_bits(3, out3);
#define vertical_0 (countof(cf2_run_vertical) / 2)
- switch (peek_bits(3)) {
+ switch (peek_bits(3)) {
default /*4..7*/ : /* vertical(0) */
-v0: skip_bits(1);
+ if (0) {
+ out3:
+ /* Unless it's a 1-bit "vertical 0" code, exit. */
+ if (!(bits_left > 0 && peek_bits(1)))
+ goto out0;
+ }
+ skip_bits(1);
rlen = vertical_0;
break;
case 2: /* vertical(+1) */
@@ -714,14 +729,111 @@ v0: skip_bits(1);
break;
case 1: /* horizontal */
skip_bits(3);
- if (invert == invert_white)
- goto hww;
- else
- goto hbb;
+ if (invert == invert_white) {
+ /* We handle horizontal decoding here, so that we can
+ * branch back into it if we run out of input data. */
+ /* White, then black. */
+ hww:
+ do {
+ cfd_store_state();
+ status = get_run(ss, pr, cf_white_decode,
+ cfd_white_initial_bits,
+ cfd_white_min_bits, &rlen, " white");
+ cfd_load_state();
+ if (status < 0) {
+ ss->run_color = -2;
+ goto out0;
+ }
+
+ if ((count -= rlen) < end_count) {
+ status = ERRC;
+ goto out;
+ }
+ if (rlen < 0) goto rlen_lt_zero;
+
+ cfd_store_state();
+ status = skip_data(ss, pr, rlen);
+ cfd_load_state();
+ } while (status < 0);
+
+ /* Handle the second half of a white-black horizontal code. */
+ hwb:
+ do {
+ cfd_store_state();
+ status = get_run(ss, pr, cf_black_decode,
+ cfd_black_initial_bits,
+ cfd_black_min_bits, &rlen, " black");
+ cfd_load_state();
+ if (status < 0){
+ ss->run_color = 1;
+ goto out0;
+ }
+
+ if ((count -= rlen) < end_count) {
+ status = ERRC;
+ goto out;
+ }
+ if (rlen < 0) goto rlen_lt_zero;
+
+ cfd_store_state();
+ status = invert_data(ss, pr, &rlen, black_byte);
+ cfd_load_state();
+ } while (status < 0);
+ } else {
+ /* Black, then white. */
+ hbb:
+ do {
+ cfd_store_state();
+ status = get_run(ss, pr, cf_black_decode,
+ cfd_black_initial_bits,
+ cfd_black_min_bits, &rlen, " black");
+ cfd_load_state();
+ if (status < 0) {
+ ss->run_color = 2;
+ goto out0;
+ }
+
+ if ((count -= rlen) < end_count) {
+ status = ERRC;
+ goto out;
+ }
+ if (rlen < 0) goto rlen_lt_zero;
+
+ cfd_store_state();
+ status = invert_data(ss, pr, &rlen, black_byte);
+ cfd_load_state();
+ }
+ while (status < 0);
+
+ /* Handle the second half of a black-white horizontal code. */
+ hbw:
+ do {
+ cfd_store_state();
+ status = get_run(ss, pr, cf_white_decode,
+ cfd_white_initial_bits,
+ cfd_white_min_bits, &rlen, " white");
+ cfd_load_state();
+ if (status < 0) {
+ ss->run_color = -1;
+ goto out0;
+ }
+
+ if ((count -= rlen) < end_count) {
+ status = ERRC;
+ goto out;
+ }
+ if (rlen < 0) goto rlen_lt_zero;
+
+ cfd_store_state();
+ status = skip_data(ss, pr, rlen);
+ cfd_load_state();
+ } while (status < 0);
+ }
+ continue; /* jump back to top of decode loop */
case 0: /* everything else */
cfd_store_state();
- status = get_run(ss, pr, cf_2d_decode, cfd_2d_initial_bits, cfd_2d_min_bits,
- &rlen, "[w2]");
+ status = get_run(ss, pr, cf_2d_decode, cfd_2d_initial_bits,
+ cfd_2d_min_bits, &rlen, "[w2]");
cfd_load_state();
if (status < 0) {
goto out0;
@@ -729,105 +841,102 @@ v0: skip_bits(1);
/* rlen may be run2_pass, run_uncompressed, or */
/* 0..countof(cf2_run_vertical)-1. */
+ if (rlen < 0) {
rlen_lt_zero:
- if (rlen < 0)
switch (rlen) {
- case run2_pass:
- break;
- case run_uncompressed:
- {
- int which;
-
- cfd_store_state();
- which = cf_decode_uncompressed(ss, pr);
- if (which < 0) {
- status = which;
- goto out;
- }
- cfd_load_state();
-/****** ADJUST count ******/
- invert = (which ? ~invert_white : invert_white);
- }
- goto top;
- default: /* run_error, run_zeros */
- status = ERRC;
+ case run2_pass:
+ break;
+ case run_uncompressed:
+ {
+ int which;
+
+ cfd_store_state();
+ which = cf_decode_uncompressed(ss, pr);
+ if (which < 0) {
+ status = which;
goto out;
+ }
+ cfd_load_state();
+/****** ADJUST count ******/
+ invert = (which ? ~invert_white : invert_white);
+ continue; /* jump back to top of decode loop */
}
- }
- /* Interpreting the run requires scanning the */
- /* previous ('reference') line. */
- {
- int prev_count = count;
- byte prev_data;
- int dlen;
- static const byte count_bit[8] =
- {0x80, 1, 2, 4, 8, 0x10, 0x20, 0x40};
- byte *prev_q = prev_q01 + (q - q0);
- int plen;
-
- if (!(count & 7))
- prev_q++; /* because of skip macros */
- prev_data = prev_q[-1] ^ invert;
- /* Find the b1 transition. */
- if ((prev_data & count_bit[prev_count & 7]) &&
- (prev_count < init_count || invert != invert_white)
- ) { /* Look for changing white first. */
- if_debug1m('W', ss->memory, " data=0x%x", prev_data);
- skip_black_pixels(prev_data, prev_q,
- prev_count, invert, plen);
- if (prev_count < end_count) /* overshot */
- prev_count = end_count;
- if_debug1m('W', ss->memory, " b1 other=%d", prev_count);
- }
- if (prev_count != end_count) {
- if_debug1m('W', ss->memory, " data=0x%x", prev_data);
- skip_white_pixels(prev_data, prev_q,
- prev_count, invert, plen);
- if (prev_count < end_count) /* overshot */
- prev_count = end_count;
- if_debug1m('W', ss->memory, " b1 same=%d", prev_count);
+ default: /* run_error, run_zeros */
+ status = ERRC;
+ goto out;
+ }
+ }
}
- /* b1 = prev_count; */
- if (rlen == run2_pass) { /* Pass mode. Find b2. */
- if (prev_count != end_count) {
+ /* Interpreting the run requires scanning the */
+ /* previous ('reference') line. */
+ {
+ int prev_count = count;
+ byte prev_data;
+ int dlen;
+ static const byte count_bit[8] =
+ {0x80, 1, 2, 4, 8, 0x10, 0x20, 0x40};
+ byte *prev_q = prev_q01 + (q - q0);
+ int plen;
+
+ if (!(count & 7))
+ prev_q++; /* because of skip macros */
+ prev_data = prev_q[-1] ^ invert;
+ /* Find the b1 transition. */
+ if ((prev_data & count_bit[prev_count & 7]) &&
+ (prev_count < init_count || invert != invert_white)
+ ) { /* Look for changing white first. */
if_debug1m('W', ss->memory, " data=0x%x", prev_data);
skip_black_pixels(prev_data, prev_q,
prev_count, invert, plen);
- if (prev_count < end_count) /* overshot */
+ if (prev_count < end_count) /* overshot */
prev_count = end_count;
+ if_debug1m('W', ss->memory, " b1 other=%d", prev_count);
}
- /* b2 = prev_count; */
- if_debug2m('W', ss->memory, " b2=%d, pass %d\n",
- prev_count, count - prev_count);
- } else { /* Vertical coding. */
- /* Remember that count counts *down*. */
- prev_count += rlen - vertical_0; /* a1 */
- if_debug2m('W', ss->memory, " vertical %d -> %d\n",
- (int)(rlen - vertical_0), prev_count);
- }
- /* Now either invert or skip from count */
- /* to prev_count, and reset count. */
- if (invert == invert_white) { /* Skip data bits. */
- q = endptr - (prev_count >> 3);
- qbit = prev_count & 7;
- } else { /* Invert data bits. */
- dlen = count - prev_count;
+ if (prev_count != end_count) {
+ if_debug1m('W', ss->memory, " data=0x%x", prev_data);
+ skip_white_pixels(prev_data, prev_q,
+ prev_count, invert, plen);
+ if (prev_count < end_count) /* overshot */
+ prev_count = end_count;
+ if_debug1m('W', ss->memory, " b1 same=%d", prev_count);
+ }
+ /* b1 = prev_count; */
+ if (rlen == run2_pass) { /* Pass mode. Find b2. */
+ if (prev_count != end_count) {
+ if_debug1m('W', ss->memory, " data=0x%x", prev_data);
+ skip_black_pixels(prev_data, prev_q,
+ prev_count, invert, plen);
+ if (prev_count < end_count) /* overshot */
+ prev_count = end_count;
+ }
+ /* b2 = prev_count; */
+ if_debug2m('W', ss->memory, " b2=%d, pass %d\n",
+ prev_count, count - prev_count);
+ } else { /* Vertical coding. */
+ /* Remember that count counts *down*. */
+ prev_count += rlen - vertical_0; /* a1 */
+ if_debug2m('W', ss->memory, " vertical %d -> %d\n",
+ (int)(rlen - vertical_0), prev_count);
+ }
+ /* Now either invert or skip from count */
+ /* to prev_count, and reset count. */
+ if (invert == invert_white) { /* Skip data bits. */
+ q = endptr - (prev_count >> 3);
+ qbit = prev_count & 7;
+ } else { /* Invert data bits. */
+ dlen = count - prev_count;
- cfd_store_state();
- (void)invert_data(ss, pr, &dlen, black_byte);
- cfd_load_state();
+ cfd_store_state();
+ (void)invert_data(ss, pr, &dlen, black_byte);
+ cfd_load_state();
+ }
+ count = prev_count;
+ if (rlen >= 0) /* vertical mode */
+ invert = ~invert; /* polarity changes */
}
- count = prev_count;
- if (rlen >= 0) /* vertical mode */
- invert = ~invert; /* polarity changes */
- }
- goto top;
- out3:
- if (bits_left > 0 && peek_bits(1)) {
- /* This is a 1-bit "vertical 0" code, which we can still process. */
- goto v0;
+ /* jump back to top of decode loop */
}
- /* falls through */
+
out0:status = 0;
/* falls through */
out:cfd_store_state();
@@ -837,116 +946,6 @@ rlen_lt_zero:
if (status == ERRC && ss->Rows > 0 && ss->row > ss->Rows)
status = EOFC;
return status;
- /*
- * We handle horizontal decoding here, so that we can
- * branch back into it if we run out of input data.
- */
- /* White, then black. */
- hww:
-
- cfd_store_state();
- status = get_run(ss, pr, cf_white_decode, cfd_white_initial_bits, cfd_white_min_bits,
- &rlen, " white");
- cfd_load_state();
- if (status < 0) {
- goto outww;
- }
-
- if ((count -= rlen) < end_count) {
- status = ERRC;
- goto out;
- }
- if (rlen < 0) goto rlen_lt_zero;
-
- cfd_store_state();
- status = skip_data(ss, pr, rlen);
- cfd_load_state();
- if (status < 0) {
- goto hww;
- }
-
- /* Handle the second half of a white-black horizontal code. */
- hwb:
-
- cfd_store_state();
- status = get_run(ss, pr, cf_black_decode, cfd_black_initial_bits, cfd_black_min_bits,
- &rlen, " black");
- cfd_load_state();
- if (status < 0){
- goto outwb;
- }
-
- if ((count -= rlen) < end_count) {
- status = ERRC;
- goto out;
- }
- if (rlen < 0) goto rlen_lt_zero;
-
- cfd_store_state();
- status = invert_data(ss, pr, &rlen, black_byte);
- cfd_load_state();
- if (status < 0) {
- goto hwb;
- }
-
- goto top;
- outww:ss->run_color = -2;
- goto out0;
- outwb:ss->run_color = 1;
- goto out0;
- /* Black, then white. */
- hbb:
-
- cfd_store_state();
- status = get_run(ss, pr, cf_black_decode, cfd_black_initial_bits, cfd_black_min_bits,
- &rlen, " black");
- cfd_load_state();
- if (status < 0) {
- goto outbb;
- }
-
- if ((count -= rlen) < end_count) {
- status = ERRC;
- goto out;
- }
- if (rlen < 0) goto rlen_lt_zero;
-
- cfd_store_state();
- status = invert_data(ss, pr, &rlen, black_byte);
- cfd_load_state();
- if (status < 0) {
- goto hbb;
- }
-
- /* Handle the second half of a black-white horizontal code. */
- hbw:
-
- cfd_store_state();
- status = get_run(ss, pr, cf_white_decode, cfd_white_initial_bits, cfd_white_min_bits,
- &rlen, " white");
- cfd_load_state();
- if (status < 0) {
- goto outbw;
- }
-
- if ((count -= rlen) < end_count) {
- status = ERRC;
- goto out;
- }
- if (rlen < 0) goto rlen_lt_zero;
-
- cfd_store_state();
- status = skip_data(ss, pr, rlen);
- cfd_load_state();
- if (status < 0) {
- goto hbw;
- }
-
- goto top;
- outbb:ss->run_color = 2;
- goto out0;
- outbw:ss->run_color = -1;
- goto out0;
}
#if 1 /*************** */
diff --git a/base/scfdgen.c b/base/scfdgen.c
index ff67c6a5..263cf75a 100644
--- a/base/scfdgen.c
+++ b/base/scfdgen.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/scfdtab.c b/base/scfdtab.c
index a3d14d2f..16a11bb0 100644
--- a/base/scfdtab.c
+++ b/base/scfdtab.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/scfe.c b/base/scfe.c
index 43723520..13e56fe7 100644
--- a/base/scfe.c
+++ b/base/scfe.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/scfetab.c b/base/scfetab.c
index d0501030..27a07c5f 100644
--- a/base/scfetab.c
+++ b/base/scfetab.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/scfparam.c b/base/scfparam.c
index 559bbe51..d95ae98d 100644
--- a/base/scfparam.c
+++ b/base/scfparam.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/scfx.h b/base/scfx.h
index 5efd021a..a9e1e741 100644
--- a/base/scfx.h
+++ b/base/scfx.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/scommon.h b/base/scommon.h
index 6e41259b..d8bdda8c 100644
--- a/base/scommon.h
+++ b/base/scommon.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -108,6 +108,43 @@ typedef union stream_cursor_s {
stream_cursor_write w;
} stream_cursor;
+/* The following two inline functions are here to keep the nasty
+ * cursor initialisation (that ptr is initialised to one byte
+ * /before/ the beginning of the buffer) in the one place,
+ * rather than everywhere that uses short lived streams.
+ * This allows localized disabling of the "array bounds" compiler
+ * warning for this one specific case.
+ */
+static inline void
+stream_cursor_read_init(stream_cursor_read *r, const byte *buf, size_t length)
+{
+#ifdef __GNUC__
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Warray-bounds"
+#endif
+ /* starting pos for pointer is always one position back */
+ r->ptr = buf - 1;
+ r->limit = r->ptr + length;
+#ifdef __GNUC__
+# pragma GCC diagnostic pop
+#endif
+}
+
+static inline void
+stream_cursor_write_init(stream_cursor_write *w, const byte *buf, size_t length)
+{
+#ifdef __GNUC__
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Warray-bounds"
+#endif
+ /* starting pos for pointer is always one position back */
+ w->ptr = (byte *)buf - 1;
+ w->limit = (byte *)w->ptr + length;
+#ifdef __GNUC__
+# pragma GCC diagnostic pop
+#endif
+}
+
/*
* Define the prototype for the procedures known to both the generic
* stream code and the stream implementations.
diff --git a/base/sdcparam.c b/base/sdcparam.c
index a4ae9048..18f663e4 100644
--- a/base/sdcparam.c
+++ b/base/sdcparam.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sdcparam.h b/base/sdcparam.h
index 722a9eb2..8786c194 100644
--- a/base/sdcparam.h
+++ b/base/sdcparam.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sdct.h b/base/sdct.h
index 57e9e87a..11a98a31 100644
--- a/base/sdct.h
+++ b/base/sdct.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sdctc.c b/base/sdctc.c
index 5a1679d3..8fe3d401 100644
--- a/base/sdctc.c
+++ b/base/sdctc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -65,6 +65,7 @@ stream_dct_finalize(const gs_memory_t *cmem, void *vptr)
st->templat = &s_DCTE_template;
}
else {
+ stream_dct_end_passthrough(ss->data.decompress);
gs_jpeg_destroy(ss);
if (ss->data.decompress != NULL) {
if (ss->data.decompress->scanline_buffer != NULL) {
@@ -87,10 +88,11 @@ stream_dct_end_passthrough(jpeg_decompress_data *jddp)
{
char EOI[2] = {0xff, 0xD9};
- if (jddp->PassThrough && jddp->PassThroughfn) {
+ if (jddp != NULL && jddp->PassThrough != 0 && jddp->PassThroughfn != NULL) {
(jddp->PassThroughfn)(jddp->device, (byte *)EOI, 2);
(jddp->PassThroughfn)(jddp->device, NULL, 0);
jddp->PassThrough = 0;
jddp->PassThroughfn = NULL;
+ jddp->StartedPassThrough = 0;
}
}
diff --git a/base/sdctd.c b/base/sdctd.c
index ec54a9e2..635aa6fc 100644
--- a/base/sdctd.c
+++ b/base/sdctd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -239,8 +239,10 @@ s_DCTD_process(stream_state * st, stream_cursor_read * pr,
u.c = pr->ptr+1;
update_jpeg_header_height(u.u, src->bytes_in_buffer, ss->data.common->Height);
}
- if ((code = gs_jpeg_read_header(ss, TRUE)) < 0)
- return ERRC;
+ if ((code = gs_jpeg_read_header(ss, TRUE)) < 0) {
+ code = ERRC;
+ goto error_out;
+ }
pr->ptr =
(jddp->faked_eoi ? pr->limit : src->next_input_byte - 1);
switch (code) {
@@ -251,7 +253,7 @@ s_DCTD_process(stream_state * st, stream_cursor_read * pr,
/*case JPEG_HEADER_OK: */
}
- /*
+ /*
* Default the color transform if not set and check for
* the Adobe marker and use Adobe's transform if the
* marker is set.
@@ -262,10 +264,10 @@ s_DCTD_process(stream_state * st, stream_cursor_read * pr,
else
ss->ColorTransform = 0;
}
-
+
if (jddp->dinfo.saw_Adobe_marker)
ss->ColorTransform = jddp->dinfo.Adobe_transform;
-
+
switch (jddp->dinfo.num_components) {
case 3:
jddp->dinfo.jpeg_color_space =
@@ -281,8 +283,10 @@ s_DCTD_process(stream_state * st, stream_cursor_read * pr,
ss->phase = 2;
/* falls through */
case 2: /* start_decompress */
- if ((code = gs_jpeg_start_decompress(ss)) < 0)
- return ERRC;
+ if ((code = gs_jpeg_start_decompress(ss)) < 0) {
+ code = ERRC;
+ goto error_out;
+ }
pr->ptr =
(jddp->faked_eoi ? pr->limit : src->next_input_byte - 1);
if (code == 0) {
@@ -302,8 +306,10 @@ s_DCTD_process(stream_state * st, stream_cursor_read * pr,
gs_alloc_bytes_immovable(gs_memory_stable(jddp->memory),
ss->scan_line_size,
"s_DCTD_process(scanline_buffer)");
- if (jddp->scanline_buffer == NULL)
- return ERRC;
+ if (jddp->scanline_buffer == NULL) {
+ code = ERRC;
+ goto error_out;
+ }
}
jddp->bytes_in_scanline = 0;
ss->phase = 3;
@@ -357,8 +363,10 @@ s_DCTD_process(stream_state * st, stream_cursor_read * pr,
samples = pw->ptr + 1;
}
read = gs_jpeg_read_scanlines(ss, &samples, 1);
- if (read < 0)
- return ERRC;
+ if (read < 0) {
+ code = ERRC;
+ goto error_out;
+ }
if_debug3m('w', ss->memory, "[wdd]read returns %d, used=%u, faked_eoi=%d\n",
read,
(uint) (src->next_input_byte - 1 - pr->ptr),
@@ -380,8 +388,10 @@ s_DCTD_process(stream_state * st, stream_cursor_read * pr,
* buffer can be grown as required. */
if ((src->next_input_byte-1 == pr->ptr) &&
(pr->limit - pr->ptr >= ss->templat->min_in_size) &&
- (compact_jpeg_buffer(pr) == 0))
- return ERRC;
+ (compact_jpeg_buffer(pr) == 0)) {
+ code = ERRC;
+ goto error_out;
+ }
if (jddp->PassThrough && jddp->PassThroughfn) {
(jddp->PassThroughfn)(jddp->device, Buf, pr->ptr - (Buf - 1));
}
@@ -398,8 +408,10 @@ s_DCTD_process(stream_state * st, stream_cursor_read * pr,
case 4: /* end of image; scan for EOI */
if (jddp->PassThrough && jddp->PassThroughfn)
(jddp->PassThroughfn)(jddp->device, Buf, pr->ptr - (Buf - 1));
- if ((code = gs_jpeg_finish_decompress(ss)) < 0)
- return ERRC;
+ if ((code = gs_jpeg_finish_decompress(ss)) < 0) {
+ code = ERRC;
+ goto error_out;
+ }
pr->ptr =
(jddp->faked_eoi ? pr->limit : src->next_input_byte - 1);
if (code == 0)
@@ -411,6 +423,10 @@ s_DCTD_process(stream_state * st, stream_cursor_read * pr,
}
/* Default case can't happen.... */
return ERRC;
+
+error_out:
+ stream_dct_end_passthrough(jddp);
+ return code;
}
/* Stream template */
diff --git a/base/sdcte.c b/base/sdcte.c
index ecbaf655..1fd16a49 100644
--- a/base/sdcte.c
+++ b/base/sdcte.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -25,7 +25,7 @@
#include "sdct.h"
#include "sjpeg.h"
-#define ICC_OVERHEAD 16
+#define ICC_OVERHEAD 16
#define MAX_MARKER_DATA_SIZE (65535 - ICC_OVERHEAD)
public_st_jpeg_compress_data();
@@ -135,9 +135,9 @@ s_DCTE_process(stream_state * st, stream_cursor_read * pr,
dest->free_in_buffer = pw->limit - pw->ptr;
ss->phase = 3;
/* falls through */
- case 3:
+ case 3:
/* If we have it, then write out the ICC profile */
- /* Due to size limitations allowed in APP0 markers, the profile
+ /* Due to size limitations allowed in APP0 markers, the profile
may have to be written in mutiple markers */
if (ss->icc_profile != NULL) {
static const char marker[2] = {0xFF, 0xE2}; /* JPEG_APP0 + 2 */
@@ -156,7 +156,7 @@ s_DCTE_process(stream_state * st, stream_cursor_read * pr,
if (size > MAX_MARKER_DATA_SIZE)
size = MAX_MARKER_DATA_SIZE;
- /* In this case we are just getting started with the
+ /* In this case we are just getting started with the
header of the marker. Write that portion out */
if (ss->icc_position == -1) {
byte length_byte[2];
diff --git a/base/sddparam.c b/base/sddparam.c
index deff93b9..63c07d05 100644
--- a/base/sddparam.c
+++ b/base/sddparam.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sdeparam.c b/base/sdeparam.c
index 5d269028..8eaf44cd 100644
--- a/base/sdeparam.c
+++ b/base/sdeparam.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/seexec.c b/base/seexec.c
index 4f86d554..f3eb4cfe 100644
--- a/base/seexec.c
+++ b/base/seexec.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/setjmp_.h b/base/setjmp_.h
index 4ba2faa9..a61ff07c 100644
--- a/base/setjmp_.h
+++ b/base/setjmp_.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sfilter.h b/base/sfilter.h
index 4ba8dd63..1b42d948 100644
--- a/base/sfilter.h
+++ b/base/sfilter.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sfilter1.c b/base/sfilter1.c
index c6fac79e..68785d2b 100644
--- a/base/sfilter1.c
+++ b/base/sfilter1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sfilter2.c b/base/sfilter2.c
index 86be1d86..2f6c89ac 100644
--- a/base/sfilter2.c
+++ b/base/sfilter2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -83,92 +83,95 @@ s_A85E_process(stream_state * st, stream_cursor_read * pr,
uint v2 = v3 / 85; /* max 85^2 */
uint v1 = v2 / 85; /* max 85 */
-put: if (q + 5 > qn) {
- if (q >= wlimit) {
+ while (1) {
+ /* Put some bytes */
+ while (q + 5 > qn) {
+ if (q >= wlimit) {
+ status = 1;
+ goto end;
+ }
+ *++q = prev = '\n';
+ qn = q + LINE_LIMIT;
+ if_debug1m('w', ss->memory, "[w85]EOL at %d bytes written\n",
+ (int)(q - pw->ptr));
+ }
+ if (wlimit - q < 5) {
status = 1;
- break;
+ goto end;
}
- *++q = prev = '\n';
- qn = q + LINE_LIMIT;
- if_debug1m('w', ss->memory, "[w85]EOL at %d bytes written\n",
- (int)(q - pw->ptr));
- goto put;
- }
- if (wlimit - q < 5) {
- status = 1;
- break;
- }
- q[1] = (byte) v1 + '!';
- q[2] = (byte) (v2 - v1 * 85) + '!';
- q[3] = (byte) ((uint) v3 - v2 * 85) + '!';
- q[4] = (byte) ((uint) v4 - (uint) v3 * 85) + '!';
- q[5] = (byte) ((uint) word - (uint) v4 * 85) + '!';
- /*
- * '%%' or '%!' at the beginning of the line will confuse some
- * document managers: insert (an) EOL(s) if necessary to prevent
- * this.
- */
- if (q[1] == '%') {
- if (prev == '%') {
- if (qn - q == LINE_LIMIT - 1) {
- /* A line would begin with %%. */
- *++q = prev = '\n';
- qn = q + LINE_LIMIT;
- if_debug1m('w', ss->memory,
- "[w85]EOL for %%%% at %d bytes written\n",
- (int)(q - pw->ptr));
- goto put;
- }
- } else if (prev == '\n' && (q[2] == '%' || q[2] == '!')) {
- /*
- * We may have to insert more than one EOL if
- * there are more than two %s in a row.
- */
- int extra =
- (q[2] == '!' ? 1 : /* else q[2] == '%' */
- q[3] == '!' ? 2 :
- q[3] != '%' ? 1 :
- q[4] == '!' ? 3 :
- q[4] != '%' ? 2 :
- q[5] == '!' ? 4 :
- q[5] != '%' ? 3 : 4);
+ q[1] = (byte) v1 + '!';
+ q[2] = (byte) (v2 - v1 * 85) + '!';
+ q[3] = (byte) ((uint) v3 - v2 * 85) + '!';
+ q[4] = (byte) ((uint) v4 - (uint) v3 * 85) + '!';
+ q[5] = (byte) ((uint) word - (uint) v4 * 85) + '!';
+ /*
+ * '%%' or '%!' at the beginning of the line will confuse some
+ * document managers: insert (an) EOL(s) if necessary to prevent
+ * this.
+ */
+ if (q[1] == '%') {
+ if (prev == '%') {
+ if (qn - q == LINE_LIMIT - 1) {
+ /* A line would begin with %%. */
+ *++q = prev = '\n';
+ qn = q + LINE_LIMIT;
+ if_debug1m('w', ss->memory,
+ "[w85]EOL for %%%% at %d bytes written\n",
+ (int)(q - pw->ptr));
+ continue; /* Put some more bytes */
+ }
+ } else if (prev == '\n' && (q[2] == '%' || q[2] == '!')) {
+ /*
+ * We may have to insert more than one EOL if
+ * there are more than two %s in a row.
+ */
+ int extra =
+ (q[2] == '!' ? 1 : /* else q[2] == '%' */
+ q[3] == '!' ? 2 :
+ q[3] != '%' ? 1 :
+ q[4] == '!' ? 3 :
+ q[4] != '%' ? 2 :
+ q[5] == '!' ? 4 :
+ q[5] != '%' ? 3 : 4);
- if (wlimit - q < 5 + extra) {
- status = 1;
- break;
+ if (wlimit - q < 5 + extra) {
+ status = 1;
+ goto end;
+ }
+ if_debug6m('w', ss->memory, "[w]%c%c%c%c%c extra = %d\n",
+ q[1], q[2], q[3], q[4], q[5], extra);
+ switch (extra) {
+ case 4:
+ q[9] = q[5], q[8] = '\n';
+ goto e3;
+ case 3:
+ q[8] = q[5];
+ e3:q[7] = q[4], q[6] = '\n';
+ goto e2;
+ case 2:
+ q[7] = q[5], q[6] = q[4];
+ e2:q[5] = q[3], q[4] = '\n';
+ goto e1;
+ case 1:
+ q[6] = q[5], q[5] = q[4], q[4] = q[3];
+ e1:q[3] = q[2], q[2] = '\n';
+ }
+ if_debug1m('w', ss->memory, "[w85]EOL at %d bytes written\n",
+ (int)(q + 2 * extra - pw->ptr));
+ qn = q + 2 * extra + LINE_LIMIT;
+ q += extra;
}
- if_debug6m('w', ss->memory, "[w]%c%c%c%c%c extra = %d\n",
- q[1], q[2], q[3], q[4], q[5], extra);
- switch (extra) {
- case 4:
- q[9] = q[5], q[8] = '\n';
- goto e3;
- case 3:
- q[8] = q[5];
- e3:q[7] = q[4], q[6] = '\n';
- goto e2;
- case 2:
- q[7] = q[5], q[6] = q[4];
- e2:q[5] = q[3], q[4] = '\n';
- goto e1;
- case 1:
- q[6] = q[5], q[5] = q[4], q[4] = q[3];
- e1:q[3] = q[2], q[2] = '\n';
- }
- if_debug1m('w', ss->memory, "[w85]EOL at %d bytes written\n",
- (int)(q + 2 * extra - pw->ptr));
- qn = q + 2 * extra + LINE_LIMIT;
- q += extra;
+ } else if (q[1] == '!' && prev == '%' &&
+ qn - q == LINE_LIMIT - 1
+ ) {
+ /* A line would begin with %!. */
+ *++q = prev = '\n';
+ qn = q + LINE_LIMIT;
+ if_debug1m('w', ss->memory, "[w85]EOL for %%! at %d bytes written\n",
+ (int)(q - pw->ptr));
+ continue; /* Put some more bytes */
}
- } else if (q[1] == '!' && prev == '%' &&
- qn - q == LINE_LIMIT - 1
- ) {
- /* A line would begin with %!. */
- *++q = prev = '\n';
- qn = q + LINE_LIMIT;
- if_debug1m('w', ss->memory, "[w85]EOL for %%! at %d bytes written\n",
- (int)(q - pw->ptr));
- goto put;
+ break;
}
prev = *(q += 5);
}
diff --git a/base/sfxboth.c b/base/sfxboth.c
index 02982ab3..7b782478 100644
--- a/base/sfxboth.c
+++ b/base/sfxboth.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sfxcommon.c b/base/sfxcommon.c
index bc2285d9..e506bd64 100644
--- a/base/sfxcommon.c
+++ b/base/sfxcommon.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sfxfd.c b/base/sfxfd.c
index 7f9d204c..caa00d09 100644
--- a/base/sfxfd.c
+++ b/base/sfxfd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sfxstdio.c b/base/sfxstdio.c
index 6201ddf9..8fc88256 100644
--- a/base/sfxstdio.c
+++ b/base/sfxstdio.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/shc.c b/base/shc.c
index 60b117dd..2439c831 100644
--- a/base/shc.c
+++ b/base/shc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/shc.h b/base/shc.h
index 36dcf1a0..b7ae66d1 100644
--- a/base/shc.h
+++ b/base/shc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sidscale.c b/base/sidscale.c
index 9415d854..57c2b37c 100644
--- a/base/sidscale.c
+++ b/base/sidscale.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -240,9 +240,9 @@ s_ISpecialDownScale_init(stream_state * st)
ss->sizeofPixelIn = ss->params.BitsPerComponentIn / 8;
ss->sizeofPixelOut = ss->params.BitsPerComponentOut / 8;
- ss->src_size =
+ ss->src_size =
ss->params.WidthIn * ss->sizeofPixelIn * ss->params.spp_interp;
- ss->dst_size =
+ ss->dst_size =
ss->params.WidthOut * ss->sizeofPixelOut * ss->params.spp_interp;
/* Initialize destination DDAs. */
@@ -254,14 +254,14 @@ s_ISpecialDownScale_init(stream_state * st)
dda_init(ss->dda_y, 0, ss->params.HeightOut, ss->params.HeightIn);
/* create intermediate image to hold horizontal zoom */
- ss->tmp =
+ ss->tmp =
gs_alloc_byte_array(mem, (size_t)ss->params.WidthOut * ss->params.spp_interp,
ss->sizeofPixelIn, "image_scale tmp");
/* Allocate buffers for 1 row of source and destination. */
- ss->dst =
+ ss->dst =
gs_alloc_byte_array(mem, (size_t)ss->params.WidthOut * ss->params.spp_interp,
ss->sizeofPixelOut, "image_scale dst");
- ss->src =
+ ss->src =
gs_alloc_byte_array(mem, (size_t)ss->params.WidthIn * ss->params.spp_interp,
ss->sizeofPixelIn, "image_scale src");
if (ss->tmp == 0 || ss->dst == 0 || ss->src == 0) {
diff --git a/base/sidscale.h b/base/sidscale.h
index e74fb399..08b28f81 100644
--- a/base/sidscale.h
+++ b/base/sidscale.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/siinterp.c b/base/siinterp.c
index 591de4c8..1eae896e 100644
--- a/base/siinterp.c
+++ b/base/siinterp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/siinterp.h b/base/siinterp.h
index 84dc76d3..30f95724 100644
--- a/base/siinterp.h
+++ b/base/siinterp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/simscale.c b/base/simscale.c
index e01b352c..4b544b68 100644
--- a/base/simscale.c
+++ b/base/simscale.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/simscale.h b/base/simscale.h
index e6ad7e46..8726a891 100644
--- a/base/simscale.h
+++ b/base/simscale.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/simscale_foo.c b/base/simscale_foo.c
index bae9d5c7..67fda0d8 100644
--- a/base/simscale_foo.c
+++ b/base/simscale_foo.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020 Artifex Software, Inc.
+/* Copyright (C) 2020-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -123,7 +123,7 @@ unsigned int imscale_foo(unsigned int v5x5) {
unsigned int r3 = ( v5x5 >> 20 ) & 0x1f;
unsigned int r4 = ( v5x5 >> 25 ) & 0x1f;
#endif
-
+
switch(v3x3) {
case 0:
case 1:
diff --git a/base/simscale_foo.h b/base/simscale_foo.h
index 8d52a139..471fe4fa 100644
--- a/base/simscale_foo.h
+++ b/base/simscale_foo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020 Artifex Software, Inc.
+/* Copyright (C) 2020-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/siscale.c b/base/siscale.c
index cc575d20..5bf212c1 100644
--- a/base/siscale.c
+++ b/base/siscale.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -930,7 +930,7 @@ do_init(stream_state *st,
ss->sizeofPixelOut = ss->params.BitsPerComponentOut / 8;
ss->src_y = 0;
- ss->src_size =
+ ss->src_size =
ss->params.WidthIn * ss->sizeofPixelIn * ss->params.spp_interp;
ss->src_offset = 0;
ss->dst_y = 0;
@@ -965,10 +965,10 @@ do_init(stream_state *st,
ss->max_support*2,
sizeof(CONTRIB), "image_scale contrib_dst[*]");
/* Allocate buffers for 1 row of source and destination. */
- ss->dst =
+ ss->dst =
gs_alloc_byte_array(mem, (size_t)limited_WidthOut * ss->params.spp_interp,
ss->sizeofPixelOut, "image_scale dst");
- ss->src =
+ ss->src =
gs_alloc_byte_array(mem, (size_t)ss->params.WidthIn * ss->params.spp_interp,
ss->sizeofPixelIn, "image_scale src");
if (ss->tmp == 0 || ss->contrib == 0 || ss->items == 0 ||
diff --git a/base/siscale.h b/base/siscale.h
index 3f691471..c7c33255 100644
--- a/base/siscale.h
+++ b/base/siscale.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/siscale_cal.c b/base/siscale_cal.c
index 0bb68181..39329336 100644
--- a/base/siscale_cal.c
+++ b/base/siscale_cal.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sisparam.h b/base/sisparam.h
index 69713797..b2431918 100644
--- a/base/sisparam.h
+++ b/base/sisparam.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sjbig2.c b/base/sjbig2.c
index 55b39356..915269db 100644
--- a/base/sjbig2.c
+++ b/base/sjbig2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sjbig2.h b/base/sjbig2.h
index 4c6e7032..7c2034bc 100644
--- a/base/sjbig2.h
+++ b/base/sjbig2.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sjbig2_luratech.c b/base/sjbig2_luratech.c
deleted file mode 100644
index 9a3e0c54..00000000
--- a/base/sjbig2_luratech.c
+++ /dev/null
@@ -1,627 +0,0 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
- All Rights Reserved.
-
- This software is provided AS-IS with no warranty, either express or
- implied.
-
- This software is distributed under license and may not be copied,
- modified or distributed except as expressly authorized under the terms
- of the license contained in the file LICENSE in this distribution.
-
- Refer to licensing information at http://www.artifex.com or contact
- Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
- CA 94945, U.S.A., +1(415)492-9861, for further information.
-*/
-
-
-/* jbig2decode filter implementation -- hooks in luratech JBIG2 */
-
-#include "memory_.h"
-#include "malloc_.h" /* should use a gs mem pointer */
-#include "gserrors.h"
-#include "gdebug.h"
-#include "strimpl.h"
-#include "sjbig2_luratech.h"
-
-#include <ldf_jb2.h>
-
-/* JBIG2Decode stream implementation using the Luratech library */
-
-/* if linking against a SDK build that requires a separate license key,
- you can change the following undefs to defines and set them here. */
-/***
-#ifndef JB2_LICENSE_NUM_1
-# undef JB2_LICENSE_NUM_1
-#endif
-#ifndef JB2_LICENSE_NUM_2
-# undef JB2_LICENSE_NUM_2
-#endif
-***/
-
-/* The /JBIG2Decode filter is a fairly memory intensive one to begin with,
- Furthermore, as a PDF 1.4 feature, we can assume a fairly large
- (host-level) machine. We therefore dispense with the normal
- Ghostscript memory discipline and let the library allocate all its
- resources on the heap. The pointers to these are not enumerated and
- so will not be garbage collected. We rely on our release() proc being
- called to deallocate state.
- */
- /* TODO: check allocations for integer overflow */
-
-/* create a gc object for our state, defined in sjbig2_luratech.h */
-private_st_jbig2decode_state();
-
-#define JBIG2_BUFFER_SIZE 4096
-
-/* our implementation of the "parsed" /JBIG2Globals filter parameter */
-typedef struct s_jbig2decode_global_data_s {
- gs_memory_t *mem;
- unsigned char *data;
- unsigned long size;
-} s_jbig2decode_global_data;
-
-/* create a global data struct and copy data into it */
-int
-s_jbig2decode_make_global_data(gs_memory_t *mem, byte *data, uint size, void **result)
-{
- s_jbig2decode_global_data *global = NULL;
-
- global = (s_jbig2decode_global_data *)gs_alloc_bytes(mem, sizeof (*global),
- "s_jbig2decode_make_global_data(global)");
- if (global == NULL) return_error(gs_error_VMerror);
-
- global->mem = mem;
-
- global->data = gs_alloc_bytes(global->mem, size, "s_jbig2decode_make_global_data(global_data)");
- if (global->data == NULL) {
- gs_free_object(global->mem, global, "s_jbig2decode_make_global_data(global)");
- return_error(gs_error_VMerror);
- }
-
- memcpy(global->data, data, size);
- global->size = size;
-
- *result = global;
- return 0;
-}
-
-/* free a global data struct and its data */
-void
-s_jbig2decode_free_global_data(void *data)
-{
- s_jbig2decode_global_data *global = (s_jbig2decode_global_data*)data;
-
- if (global->size && global->data) {
- gs_free_object(global->mem, global->data, "s_jbig2decode_free_global_data(global_data)");
- global->size = 0;
- }
-
- gs_free_object(global->mem, global, "s_jbig2decode_free_global_data(global)");
-}
-
-/* store a global ctx pointer in our state structure.
- * If "gd" is NULL, then this library must free the global context.
- * If not-NULL, then it will be memory managed by caller, for example,
- * garbage collected in the case of the PS interpreter.
- * Currently gpdf will use NULL, and the PDF implemented in the gs interpreter would use
- * the garbage collection.
- */
-int
-s_jbig2decode_set_global_data(stream_state *ss, s_jbig2_global_data_t *gd, void *global_ctx)
-{
- stream_jbig2decode_state *state = (stream_jbig2decode_state*)ss;
- if (state == NULL)
- return_error(gs_error_VMerror);
-
- state->global_struct = gd;
- if (global_ctx != NULL) {
- s_jbig2decode_global_data *global = global_ctx;
- state->global_data = global->data;
- state->global_size = global->size;
- } else {
- state->global_data = NULL;
- state->global_size = 0;
- }
- return 0;
-}
-
-/* invert the bits in a buffer */
-/* jbig2 and postscript have different senses of what pixel
- value is black, so we must invert the image */
-static void
-s_jbig2_invert_buffer(unsigned char *buf, int length)
-{
- int i;
-
- for (i = 0; i < length; i++)
- *buf++ ^= 0xFF;
-}
-
-/** callbacks passed to the luratech library */
-
-/* memory allocator */
-static void * JB2_Callback
-s_jbig2_alloc(unsigned long size, void *userdata)
-{
- gs_memory_t *mem = (gs_memory_t *) userdata;
- return gs_alloc_bytes(mem, size, "s_jbig2_alloc");
-}
-
-/* memory release */
-static JB2_Error JB2_Callback
-s_jbig2_free(void *ptr, void *userdata)
-{
- gs_memory_t *mem = (gs_memory_t *) userdata;
- gs_free_object(mem, ptr, "s_jbig2_free");
- return cJB2_Error_OK;
-}
-
-/* error callback for jbig2 codec */
-static void JB2_Callback
-s_jbig2_message(const char *message, JB2_Message_Level level, void *userdata)
-{
- stream_jbig2decode_state *const state = (stream_jbig2decode_state *) userdata;
- const char *type;
-
- if (message == NULL) return;
- if (message[0] == '\0') return;
-
- switch (level) {
- case cJB2_Message_Information:
- type = "info"; break;;
- case cJB2_Message_Warning:
- type = "WARNING"; break;;
- case cJB2_Message_Error:
- type = "ERROR"; break;;
- default:
- type = "unknown message"; break;;
- }
-
- if (level == cJB2_Message_Error) {
- dmprintf2(state->memory, "Luratech JBIG2 %s %s\n", type, message);
- } else {
- if_debug2m('w', state->memory, "[w]Luratech JBIG2 %s %s\n", type, message);
- }
-
- return;
-}
-
-/* compressed read callback for jbig2 codec */
-static JB2_Size_T JB2_Callback
-s_jbig2_read(unsigned char *buffer,
- JB2_Size_T offset, JB2_Size_T size, void *userdata)
-{
- stream_jbig2decode_state *const state = (stream_jbig2decode_state *) userdata;
- long available;
-
- /* return data from the Globals stream */
- if (offset < state->global_size) {
- available = state->global_size - offset;
- if (available > size) available = size;
- memcpy(buffer, state->global_data + offset, available);
- return available;
- }
-
- /* else return data from the image stream */
- offset -= state->global_size;
- if (state->infill <= offset)
- return 0;
- available = state->infill - offset;
- if (available > size)
- available = size;
-
- memcpy(buffer, state->inbuf + offset, available);
- return available;
-}
-
-/* uncompressed write callback for jbig2 codec */
-static JB2_Error JB2_Callback
-s_jbig2_write(unsigned char *buffer,
- unsigned long row, unsigned long width,
- unsigned long bbp, void *userdata)
-{
- stream_jbig2decode_state *const state = (stream_jbig2decode_state *) userdata;
- unsigned char *line = state->image + row*state->stride;
- long available = ((width - 1) >> 3) + 1;
-
- if (row >= state->height) {
- dmlprintf2(state->memory, "jbig2decode: output for row index %lu of %lu called!\n", row, state->height);
- return cJB2_Error_Invalid_Index;
- }
-
- memcpy(line, buffer, available);
- s_jbig2_invert_buffer(line, available);
-
- return cJB2_Error_OK;
-}
-
-static int
-s_jbig2decode_inbuf(stream_jbig2decode_state *state, stream_cursor_read * pr)
-{
- long in_size = pr->limit - pr->ptr;
-
- /* allocate the input buffer if needed */
- if (state->inbuf == NULL) {
- state->inbuf = malloc(JBIG2_BUFFER_SIZE);
- if (state->inbuf == NULL) return_error(gs_error_VMerror);
- state->insize = JBIG2_BUFFER_SIZE;
- state->infill = 0;
- }
-
- /* grow the input buffer if needed */
- while (state->insize < state->infill + in_size) {
- unsigned char *new;
- unsigned long new_size = state->insize;
-
- while (new_size < state->infill + in_size)
- new_size = new_size << 1;
-
- if_debug1m('s', state->memory, "[s]jbig2decode growing input buffer to %lu bytes\n",
- new_size);
- new = realloc(state->inbuf, new_size);
- if (new == NULL) return_error(gs_error_VMerror);
-
- state->inbuf = new;
- state->insize = new_size;
- }
-
- /* copy the available input into our buffer */
- /* note that the gs stream library uses offset-by-one
- indexing of its buffers while we use zero indexing */
- memcpy(state->inbuf + state->infill, pr->ptr + 1, in_size);
- state->infill += in_size;
- pr->ptr += in_size;
-
- return 0;
-}
-
-/* initialize the steam. */
-static int
-s_jbig2decode_init(stream_state * ss)
-{
- stream_jbig2decode_state *const state = (stream_jbig2decode_state *) ss;
-
- state->doc = NULL;
- state->inbuf = NULL;
- state->insize = 0;
- state->infill = 0;
- state->image = NULL;
- state->width = 0;
- state->height = 0;
- state->row = 0;
- state->stride = 0;
- state->error = 0;
- state->offset = 0;
-
- return 0;
-}
-
-/* process a section of the input and return any decoded data.
- see strimpl.h for return codes.
- */
-static int
-s_jbig2decode_process(stream_state * ss, stream_cursor_read * pr,
- stream_cursor_write * pw, bool last)
-{
- stream_jbig2decode_state *const state = (stream_jbig2decode_state *) ss;
- long in_size = pr->limit - pr->ptr;
- long out_size = pw->limit - pw->ptr;
- long available;
- JB2_Error error;
- JB2_Scaling_Factor scale = {1,1};
- JB2_Rect rect = {0,0,0,0};
- ulong result;
- int status = last;
-
- if (in_size > 0) {
- /* buffer all available input for the decoder */
- result = s_jbig2decode_inbuf(state, pr);
- if (result) return ERRC;
- }
-
- if (last && out_size > 0) {
-
- if (state->doc == NULL) {
-
- /* initialize the codec state and pass our callbacks */
- error = JB2_Document_Start( &(state->doc),
- s_jbig2_alloc, ss->memory->non_gc_memory, /* alloc and its data */
- s_jbig2_free, ss->memory->non_gc_memory, /* free and its data */
- s_jbig2_read, ss, /* read callback and data */
- s_jbig2_message, ss); /* message callback and data */
- if (error != cJB2_Error_OK) return ERRC;
-
-#if defined(JB2_LICENSE_NUM_1) && defined(JB2_LICENSE_NUM_2)
- /* set the license keys if appropriate */
- error = JB2_Document_Set_License(state->doc,
- JB2_LICENSE_NUM_1, JB2_LICENSE_NUM_2);
- if (error != cJB2_Error_OK) return ERRC;
-#endif
- /* decode relevent image parameters */
- error = JB2_Document_Set_Page(state->doc, 0);
- if (error != cJB2_Error_OK) return ERRC;
- error = JB2_Document_Get_Property(state->doc,
- cJB2_Prop_Page_Width, &result);
- state->width = result;
- error = JB2_Document_Get_Property(state->doc,
- cJB2_Prop_Page_Height, &result);
- if (error != cJB2_Error_OK) return ERRC;
- state->height = result;
- state->stride = ((state->width - 1) >> 3) + 1;
- if_debug2m('w', state->memory, "[w]jbig2decode page is %ldx%ld; allocating image\n", state->width, state->height);
- state->image = malloc(state->height*state->stride);
-
- /* start image decode */
- error = JB2_Document_Decompress_Page(state->doc, scale, rect,
- s_jbig2_write, ss);
- if (error != cJB2_Error_OK) return ERRC;
-
- }
-
- /* copy any buffered image data out */
- available = state->stride*state->height - state->offset;
- if (available > 0) {
- out_size = (out_size > available) ? available : out_size;
- memcpy(pw->ptr+1, state->image + state->offset, out_size);
- state->offset += out_size;
- pw->ptr += out_size;
- }
- /* more data to output? */
- available = state->stride*state->height - state->offset;
- if (available > 0) return 1;
- else return EOFC;
- }
-
- /* handle fatal decoding errors reported through our callback */
- if (state->error) return ERRC;
-
- return status;
-}
-
-/* stream release. free all our decoder state. */
-static void
-s_jbig2decode_release(stream_state *ss)
-{
- stream_jbig2decode_state *const state = (stream_jbig2decode_state *) ss;
-
- if (state->doc) {
- JB2_Document_End(&(state->doc));
- if (state->inbuf) free(state->inbuf);
- if (state->image) free(state->image);
- }
- if (state->global_struct != NULL) {
- /* the interpreter calls jbig2decode_free_global_data() separately */
- } else {
- /* We are responsible for freeing global context */
- if (state->global_data) {
- s_jbig2decode_free_global_data(state->global_data);
- state->global_data = NULL;
- state->global_size = 0;
- }
- }
-}
-
-/* stream template */
-const stream_template s_jbig2decode_template = {
- &st_jbig2decode_state,
- s_jbig2decode_init,
- s_jbig2decode_process,
- 1, 1, /* min in and out buffer sizes we can handle --should be ~32k,64k for efficiency? */
- s_jbig2decode_release
-};
-
-/** encode support **/
-
-/* we provide a C-only encode filter for generating embedded JBIG2 image
- data */
-
-/* create a gc object for our state, defined in sjbig2_luratech.h */
-private_st_jbig2encode_state();
-
-/* helper - start up the compression context */
-static int
-s_jbig2encode_start(stream_jbig2encode_state *state)
-{
- JB2_Error err;
-
- /* initialize the compression handle */
- err = JB2_Compress_Start(&(state->cmp),
- s_jbig2_alloc, state->memory, /* alloc and its parameter data */
- s_jbig2_free, state->memory, /* free callback */
- s_jbig2_message, state);/* message callback */
- if (err != cJB2_Error_OK) return err;
-
- /* set the license keys if appropriate */
-#if defined(JB2_LICENSE_NUM_1) && defined(JB2_LICENSE_NUM_2)
- err = JB2_Document_Set_License(state->cmp,
- JB2_LICENSE_NUM_1, JB2_LICENSE_NUM_2);
- if (err != cJB2_Error_OK) return err;
-#endif
-
- /* set the image properties */
- err = JB2_Compress_Set_Property(state->cmp,
- cJB2_Prop_Page_Width, state->width);
-
- err = JB2_Compress_Set_Property(state->cmp,
- cJB2_Prop_Page_Height, state->height);
- if (err != cJB2_Error_OK) return err;
-
- /* we otherwise use the default compression parameters */
-
- return cJB2_Error_OK;
-}
-
-/* callback for compressed data output */
-static JB2_Size_T JB2_Callback
-s_jbig2encode_write(const unsigned char *buffer,
- JB2_Size_T pos, JB2_Size_T size, void *userdata)
-{
- stream_jbig2encode_state *state = (stream_jbig2encode_state *)userdata;
-
- /* allocate the output buffer if necessary */
- if (state->outbuf == NULL) {
- state->outbuf = malloc(JBIG2_BUFFER_SIZE);
- if (state->outbuf == NULL) {
- dmprintf(state->memory, "jbig2encode: failed to allocate output buffer\n");
- return 0; /* can't return an error! */
- }
- state->outsize = JBIG2_BUFFER_SIZE;
- }
-
- /* grow the output buffer if necessary */
- while (pos+size > state->outsize) {
- unsigned char *new_ = realloc(state->outbuf, state->outsize*2);
- if (new_ == NULL) {
- dmprintf1(state->memory, "jbig2encode: failed to resize output buffer"
- " beyond %lu bytes\n", state->outsize);
- return 0; /* can't return an error! */
- }
- state->outbuf = new_;
- state->outsize *= 2;
- }
-
- /* copy data into our buffer; there will now be enough room. */
- memcpy(state->outbuf + pos, buffer, size);
- if (state->outfill < pos + size) state->outfill = pos + size;
-
- return size;
-}
-
-/* initialize the steam. */
-static int
-s_jbig2encode_init(stream_state * ss)
-{
- stream_jbig2encode_state *state = (stream_jbig2encode_state *)ss;
-
- /* null library context handles */
- state->cmp = (JB2_Handle_Compress)NULL;
- state->doc = (JB2_Handle_Document)NULL;
-
- /* width and height are set by the client */
- /* calculate a stride based on those values */
- state->stride = ((state->width - 1) >> 3) + 1;
-
- state->line = malloc(state->stride);
- if (state->line == NULL) return ERRC;
- state->linefill = 0;
-
- /* null output buffer */
- state->outbuf = NULL;
- state->outsize = 0;
- state->outfill = 0;
- state->offset = 0;
- state->jb2_encode = false;
-
- return 0;
-}
-
-/* process a section of the input and return any encoded data.
- see strimpl.h for return codes.
- */
-static int
-s_jbig2encode_process(stream_state * ss, stream_cursor_read * pr,
- stream_cursor_write * pw, bool last)
-{
- stream_jbig2encode_state *state = (stream_jbig2encode_state *)ss;
- long in_size = pr->limit - pr->ptr;
- long out_size = pw->limit - pw->ptr;
- long available, segment;
- JB2_Error err;
- JB2_Export_Format format[] = {cJB2_Export_Format_Stream_For_PDF, cJB2_Export_Format_JB2};
-
- /* Be greedy in filling our internal line buffer so we always
- make read progress on a stream. */
- if (in_size > 0) {
- /* initialize the encoder if necessary */
- if (state->cmp == (JB2_Handle_Compress)NULL)
- s_jbig2encode_start(state);
-
- available = in_size;
-
- /* try to fill the line buffer */
- segment = state->stride - state->linefill;
- if (segment > 0) {
- segment = (segment < available) ? segment : available;
- memcpy(state->line + state->linefill, pr->ptr+1, segment);
- pr->ptr += segment;
- available -= segment;
- state->linefill += segment;
- }
- /* pass a full line buffer to the encoder library */
- if (state->linefill == state->stride) {
- s_jbig2_invert_buffer(state->line, state->stride);
- err = JB2_Compress_Line(state->cmp, state->line);
- state->linefill = 0;
- if (err != cJB2_Error_OK) return ERRC;
- }
- /* pass remaining full lines to the encoder library */
- while (available >= state->stride) {
- memcpy(state->line, pr->ptr+1, state->stride);
- s_jbig2_invert_buffer(state->line, state->stride);
- err = JB2_Compress_Line(state->cmp, state->line);
- pr->ptr += state->stride;
- available = pr->limit - pr->ptr;
- if (err != cJB2_Error_OK) return ERRC;
- }
- /* copy remaining data into the line buffer */
- if (available > 0) {
- /* available is always < stride here */
- memcpy(state->line, pr->ptr+1, available);
- pr->ptr += available;
- state->linefill = available;
- }
- if (!last) return 0; /* request more data */
- }
-
- if (last && state->outbuf == NULL) {
- /* convert the compression context to a document context */
- err = JB2_Compress_End(&(state->cmp), &(state->doc));
- if (err != cJB2_Error_OK) return ERRC;
- /* dump the compressed data out through a callback;
- unfortunately we can't serialize this across process calls */
- err = JB2_Document_Export_Document(state->doc,
- s_jbig2encode_write, state,
- format[state->jb2_encode]);
- if (err != cJB2_Error_OK) return ERRC;
- }
-
- if (state->outbuf != NULL) {
- /* copy available output data */
- available = min(out_size, state->outfill - state->offset);
- memcpy(pw->ptr + 1, state->outbuf + state->offset, available);
- pw->ptr += available;
- state->offset += available;
-
- /* need further output space? */
- if (state->outfill - state->offset > 0) return 1;
- else return EOFC; /* all done */
- }
-
- /* no data. */
- if (in_size == 0 && !last)
- return 0;
-
- /* something went wrong above. */
- return ERRC;
-}
-
-/* stream release. free all our decoder state.
- */
-static void
-s_jbig2encode_release(stream_state *ss)
-{
- stream_jbig2encode_state *state = (stream_jbig2encode_state *)ss;
-
- if (state->outbuf != NULL) free(state->outbuf);
- if (state->line != NULL) free(state->line);
-}
-
-/* stream template */
-const stream_template s_jbig2encode_template = {
- &st_jbig2encode_state,
- s_jbig2encode_init,
- s_jbig2encode_process,
- 1024, 1024, /* min in and out buffer sizes; could be smaller, but
- this is more efficient */
- s_jbig2encode_release
-};
diff --git a/base/sjbig2_luratech.h b/base/sjbig2_luratech.h
deleted file mode 100644
index 0c0bcd2a..00000000
--- a/base/sjbig2_luratech.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
- All Rights Reserved.
-
- This software is provided AS-IS with no warranty, either express or
- implied.
-
- This software is distributed under license and may not be copied,
- modified or distributed except as expressly authorized under the terms
- of the license contained in the file LICENSE in this distribution.
-
- Refer to licensing information at http://www.artifex.com or contact
- Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
- CA 94945, U.S.A., +1(415)492-9861, for further information.
-*/
-
-
-/* Definitions for jbig2decode filter - Luratech version */
-/* Requires scommon.h; strimpl.h if any templates are referenced */
-
-#ifndef sjbig2_luratech_INCLUDED
-# define sjbig2_luratech_INCLUDED
-
-#include "scommon.h"
-#include <ldf_jb2.h>
-
-/* See zfjbig2.c for details. */
-typedef struct s_jbig2_global_data_s {
- void *data;
-} s_jbig2_global_data_t;
-
-/* JBIG2Decode internal stream state */
-typedef struct stream_jbig2decode_state_s
-{
- stream_state_common; /* inherit base object from scommon.h */
- JB2_Handle_Document doc; /* Luratech JBIG2 codec context */
- s_jbig2_global_data_t *global_struct; /* to protect it from freeing by GC */
- unsigned char *global_data;
- unsigned long global_size;
- unsigned char *inbuf; /* compressed image data */
- unsigned long insize, infill;
- unsigned char *image; /* decoded image data */
- unsigned long width, height;
- unsigned long row, stride;
- unsigned long offset; /* next output byte to be returned */
- JB2_Error error;
-}
-stream_jbig2decode_state;
-
-#define private_st_jbig2decode_state() \
- gs_private_st_ptrs1(st_jbig2decode_state, stream_jbig2decode_state,\
- "jbig2decode filter state", jbig2decode_state_enum_ptrs,\
- jbig2decode_state_reloc_ptrs, global_struct)
-extern const stream_template s_jbig2decode_template;
-
-/* call in to process the JBIG2Globals parameter */
-int
-s_jbig2decode_make_global_data(gs_memory_t *mem, byte *data, uint size, void **result);
-int
-s_jbig2decode_set_global_data(stream_state *ss, s_jbig2_global_data_t *gs, void *global_ctx);
-void
-s_jbig2decode_free_global_data(void *data);
-
-/* JBIG2 encoder internal state */
-typedef struct stream_jbig2encode_state_s
-{
- stream_state_common; /* inherit base object from scommon.h */
- JB2_Handle_Compress cmp; /* compression library context */
- JB2_Handle_Document doc;
- unsigned long width, height;
- unsigned long stride; /* line length in bytes */
- unsigned char *line; /* single line working buffer */
- unsigned long linefill; /* bytes in the working buffer */
- unsigned char *outbuf; /* output data buffer */
- unsigned long outsize; /* bytes available in the buffer */
- unsigned long outfill; /* bytes written to the buffer */
- unsigned long offset; /* bytes written from the buffer */
- bool jb2_encode; /* are we writing a jb2 file (true), or a stream for a PDF (false) */
-
-} stream_jbig2encode_state;
-
-#define private_st_jbig2encode_state() \
- gs_private_st_simple(st_jbig2encode_state, stream_jbig2encode_state,\
- "jbig2encode filter state")
-
-extern const stream_template s_jbig2encode_template;
-
-#endif /* sjbig2_luratech_INCLUDED */
diff --git a/base/sjpeg.h b/base/sjpeg.h
index 1a0877f9..d59a1a0c 100644
--- a/base/sjpeg.h
+++ b/base/sjpeg.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sjpegc.c b/base/sjpegc.c
index bea397a3..fa220d75 100644
--- a/base/sjpegc.c
+++ b/base/sjpegc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -173,7 +173,7 @@ static long gs_j_mem_init (j_common_ptr cinfo)
if (gs_memory_chunk_wrap(&(cmem), mem) < 0) {
return (-1);
}
-
+
(void)jpeg_cust_mem_set_private(GET_CUST_MEM_DATA(cinfo), cmem);
return 0;
@@ -229,7 +229,7 @@ gs_jpeg_mem_term(j_common_ptr cinfo)
if (cinfo->client_data) {
jpeg_cust_mem_data *custmptr = (jpeg_cust_mem_data *)cinfo->client_data;
gs_memory_t *mem = (gs_memory_t *)(GET_CUST_MEM_DATA(cinfo)->priv);
-
+
gs_free_object(mem, custmptr, "gs_jpeg_mem_term");
cinfo->client_data = NULL;
}
diff --git a/base/sjpegd.c b/base/sjpegd.c
index 16b71df6..6eb0c648 100644
--- a/base/sjpegd.c
+++ b/base/sjpegd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -39,7 +39,7 @@ gs_jpeg_create_decompress(stream_DCT_state * st)
return_error(gs_jpeg_log_error(st));
jpeg_stream_data_common_init(st->data.decompress);
-
+
if (gs_jpeg_mem_init (st->memory, (j_common_ptr)&st->data.decompress->dinfo) < 0)
return_error(gs_error_VMerror);
diff --git a/base/sjpege.c b/base/sjpege.c
index 9663ca85..a598f762 100644
--- a/base/sjpege.c
+++ b/base/sjpege.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sjpx_luratech.c b/base/sjpx_luratech.c
deleted file mode 100644
index aa0d1131..00000000
--- a/base/sjpx_luratech.c
+++ /dev/null
@@ -1,1096 +0,0 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
- All Rights Reserved.
-
- This software is provided AS-IS with no warranty, either express or
- implied.
-
- This software is distributed under license and may not be copied,
- modified or distributed except as expressly authorized under the terms
- of the license contained in the file LICENSE in this distribution.
-
- Refer to licensing information at http://www.artifex.com or contact
- Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
- CA 94945, U.S.A., +1(415)492-9861, for further information.
-*/
-
-
-/* JPXDecode filter implementation -- hooks in the Luratech JPEG2K CSDK */
-
-#include "memory_.h"
-#include "gserrors.h"
-#include "gdebug.h"
-#include "strimpl.h"
-#include "sjpx_luratech.h"
-
-#include <lwf_jp2.h>
-
-/* JPXDecode stream implementation using the Luratech library */
-
-/* if linking against a SDK build that requires a separate license key,
- you can change the following undefs to defines and set them here. */
-/***
-#ifndef JP2_LICENSE_NUM_1
-# undef JP2_LICENSE_NUM_1
-#endif
-#ifndef JP2_LICENSE_NUM_2
-# undef JP2_LICENSE_NUM_2
-#endif
-***/
-
-private_st_jpxd_state(); /* creates a gc object for our state,
- defined in sjpx.h */
-
-#define JPX_BUFFER_SIZE 1024
-
-/** callback for the codec library */
-
-/* memory allocation */
-static void * JP2_Callback_Conv
-s_jpx_alloc(long size, JP2_Callback_Param param)
-{
- return gs_alloc_byte_array((gs_memory_t *)param, size, 1, "s_jpx_alloc");
-}
-
-/* memory free */
-static JP2_Error JP2_Callback_Conv
-s_jpx_free(void *ptr, JP2_Callback_Param param)
-{
- gs_free_object((gs_memory_t *)param, ptr, "s_jpx_free");
- return cJP2_Error_OK;
-}
-
-/* pass any available input to the library */
-static unsigned long JP2_Callback_Conv
-s_jpxd_read_data(unsigned char *pucData,
- unsigned long ulPos, unsigned long ulSize,
- JP2_Callback_Param param)
-{
- stream_jpxd_state *const state = (stream_jpxd_state *) param;
- unsigned long copy_bytes = min(ulSize, state->inbuf_fill - ulPos);
-
- memcpy(pucData, state->inbuf + ulPos, copy_bytes);
-
- return copy_bytes;
-}
-
-static unsigned long
-jp2_get_value(JP2_Decomp_Handle *handle,
- JP2_Property_Tag tag,
- short comp,
- unsigned long def)
-{
- JP2_Property_Value v;
-
- if (JP2_Decompress_GetProp(handle, tag, &v, -1, comp) != cJP2_Error_OK)
- return def;
-
- return (unsigned long)v;
-}
-
-/* write decompressed data into our image buffer */
-static JP2_Error JP2_Callback_Conv
-s_jpxd_write_data(unsigned char * pucData,
- short sComponent,
- unsigned long ulRow,
- unsigned long ulStart,
- unsigned long ulNum,
- JP2_Callback_Param param)
-{
- stream_jpxd_state *const state = (stream_jpxd_state *) param;
- int comp = state->clut[sComponent];
-
- /* check input */
- if (ulRow >= state->height) return cJP2_Error_Invalid_Height;
- if (ulStart + ulNum >= state->width) ulNum = state->width - ulStart;
-
- /* Here we just copy a byte at a time into an image buffer,
- interleaving with whatever data already exists. For multi-
- component images, it would be more efficient to save rows
- from each call in planar buffers and interleave a tile at
- a time into a stipe buffer for output */
-
- if (state->image_is_indexed && sComponent == 0 && !state->alpha) {
- JP2_Palette_Params *pal;
- JP2_Error err;
- int i, c;
- unsigned char *dst;
-
- err = JP2_Decompress_GetPalette(state->handle, &pal);
- if (err != cJP2_Error_OK)
- return err;
-
- if (state->colorspace != gs_jpx_cs_indexed) {
- dst = &state->image[state->stride * ulRow +
- state->ncomp * ulStart + comp];
- /* expand the data */
- for (i = 0; i < ulNum; i++) {
- unsigned char v = pucData[i];
-
- if (v >= pal->ulEntries)
- return cJP2_Error_Invalid_Colorspace;
-
- for (c = 0; c < state->ncomp; c++)
- *dst++ = (unsigned char)pal->ppulPalette[c][v];
- }
- } else {
- /* copy indexes */
- if (state->bpc == 4) {
- int even = ulNum & ~1;
- dst = &state->image[state->stride * ulRow + ulStart/2];
- for (i = 0; i < even; i += 2)
- *dst++ = pucData[i] << 4 | pucData[i+1];
- if (ulNum & 1)
- *dst++ = pucData[ulNum - 1] << 4;
- } else {
- dst = &state->image[state->stride * ulRow + ulStart + comp];
- memcpy(dst, pucData, ulNum);
- }
- }
- } else if (state->ncomp == 1 && comp == 0) {
- if (state->bpc == 8) {
- memcpy(&state->image[state->stride*ulRow + state->ncomp*ulStart],
- pucData, ulNum);
- } else if (state->bpc > 8) {
- unsigned long i;
- unsigned short *src = (unsigned short *)pucData;
- unsigned char *dst = &state->image[state->stride * ulRow + 2 * ulStart];
- unsigned int shift = 16 - state->bpc;
- for (i = 0; i < ulNum; i++) {
- unsigned short v = *src++ << shift;
- *dst++ = (v >> 8) & 0xff;
- *dst++ = v & 0xff;
- }
- } else if (state->bpc == 4) {
- int i;
- unsigned char *dst = &state->image[state->stride * ulRow + ulStart/2];
- int even = ulNum & ~1;
-
- for (i = 0; i < even; i+=2)
- *dst++ = pucData[i] << 4 | pucData[i+1];
- if (ulNum & 1)
- *dst++ = pucData[ulNum - 1] << 4;
- } else
- {
- unsigned int bt=0; unsigned long i;
- int bit_pos = state->bpc * ulStart; /* starting bit position to fill for this component */
- int bit_cnt; /* bit count for current byte */
- unsigned char *p = &state->image[state->stride * ulRow + bit_pos/8]; /* starting byte to fill */;
- bit_cnt = bit_pos % 8;
- for (i = 0; i < ulNum; i++)
- {
- bt <<= state->bpc;
- bt |= pucData[i];
- bit_cnt += state->bpc;
- if (bit_cnt >= 8)
- {
- *(p++) |= bt >> (bit_cnt-8);
- bit_cnt -= 8;
- bt &= (1<<bit_cnt)-1;
- }
- }
- /* end of row */
- if (bit_cnt > 0)
- {
- *p |= bt<<(8-bit_cnt);
- bt = 0;
- }
- }
- }
- else if (comp >= 0) {
- unsigned long cw, ch, i, hstep, vstep, x, y;
- unsigned char *row;
-
- /* repeat subsampled pixels */
- cw = jp2_get_value(state->handle, cJP2_Prop_Width, comp, state->width);
- ch = jp2_get_value(state->handle, cJP2_Prop_Height, comp, state->height);
- hstep = state->width / cw;
- vstep = state->height / ch;
-
- if (state->bpc == 8) {
- row = &state->image[state->stride * ulRow * vstep +
- state->ncomp * ulStart * hstep + comp];
- for (y = 0; y < vstep; y++) {
- unsigned char *p = row;
- for (i = 0; i < ulNum; i++)
- for (x = 0; x < hstep; x++) {
- *p = pucData[i];
- p += state->ncomp;
- }
- row += state->stride;
- }
- } else if (state->bpc > 8) {
- int shift = 16 - state->bpc;
- unsigned short *src = (unsigned short *)pucData;
- row = &state->image[state->stride * ulRow * vstep +
- 2 * state->ncomp * ulStart * hstep + 2 * comp];
- for (y = 0; y < vstep; y++) {
- unsigned char *p = row;
- for (i = 0; i < ulNum; i++)
- for (x = 0; x < hstep; x++) {
- unsigned short v = *src++ << shift;
- p[0] = (v >> 8) & 0xff;
- p[1] = v & 0xff;
- p += 2 * state->ncomp;
- }
- row += state->stride;
- }
- } else {
- unsigned int bt=0;
- int bit_pos = state->bpc * state->ncomp * ulStart * hstep + state->bpc * comp; /* starting bit position to fill for this component */
- int bit_cnt; /* bit count for current byte */
-
- row = &state->image[state->stride * ulRow * vstep + bit_pos/8]; /* starting byte to fill */
- for (y = 0; y < vstep; y++) {
- unsigned char *p = row;
- bit_cnt = bit_pos % 8;
- for (i = 0; i < ulNum; i++) {
- for (x = 0; x < hstep; x++) {
- bt <<= state->bpc * state->ncomp;
- bt |= pucData[i];
- bit_cnt += state->bpc;
- while (bit_cnt >= 8) {
- *(p++) |= bt >> (bit_cnt-8);
- bit_cnt -= 8;
- bt &= (1<<bit_cnt)-1;
- }
- bit_cnt += state->bpc * (state->ncomp - 1); /* skip other components */
- }
- }
- /* end of row */
- bit_cnt -= state->bpc * (state->ncomp - 1); /* return the last extra count */
- if (bit_cnt > 0) {
- *p |= bt<<(8-bit_cnt);
- bt = 0;
- }
- row += state->stride;
- }
- }
- }
- return cJP2_Error_OK;
-}
-
-/* convert state->image from YCrCb to RGBa */
-static int
-s_jpxd_ycc_to_rgb(stream_jpxd_state *state)
-{
- int i, y, x;
- int is_signed[2]; /* Cr, Cb */
-
- if (state->ncomp != 3)
- return -1;
-
- for (i = 0; i < 2; i++) {
- int comp = state->clut[i + 1]; /* skip Y */
- is_signed[i] = !jp2_get_value(state->handle,
- cJP2_Prop_Signed_Samples, comp, 0);
- }
-
- for (y = 0; y < state->height; y++) {
- unsigned char *row = &state->image[y * state->stride];
-
- for (x = 0; x < state->stride; x += 3) {
- int p[3], q[3];
-
- for (i = 0; i < 3; i++)
- p[i] = (int)row[x + i];
-
- if (is_signed[0])
- p[1] -= 0x80;
- if (is_signed[1])
- p[2] -= 0x80;
-
- /* rotate to RGB */
-#ifdef JPX_USE_IRT
- q[1] = p[0] - ((p[1] + p[2])>>2);
- q[0] = p[1] + q[1];
- q[2] = p[2] + q[1];
-#else
- q[0] = (int)((double)p[0] + 1.402 * p[2]);
- q[1] = (int)((double)p[0] - 0.34413 * p[1] - 0.71414 * p[2]);
- q[2] = (int)((double)p[0] + 1.772 * p[1]);
-#endif
- /* clamp */
- for (i = 0; i < 3; i++){
- if (q[i] < 0) q[i] = 0;
- else if (q[i] > 0xFF) q[i] = 0xFF;
- }
- /* write out the pixel */
- for (i = 0; i < 3; i++)
- row[x + i] = (unsigned char)q[i];
- }
- }
-
- return 0;
-}
-
-static int
-s_jpxd_inbuf(stream_jpxd_state *state, stream_cursor_read * pr)
-{
- long in_size = pr->limit - pr->ptr;
-
- /* allocate the input buffer if needed */
- if (state->inbuf == NULL) {
- state->inbuf = s_jpx_alloc(JPX_BUFFER_SIZE, (JP2_Callback_Param)state->memory->non_gc_memory);
- if (state->inbuf == NULL) return_error(gs_error_VMerror);
- state->inbuf_size = JPX_BUFFER_SIZE;
- state->inbuf_fill = 0;
- }
-
- /* grow the input buffer if needed */
- if (state->inbuf_size < state->inbuf_fill + in_size) {
- unsigned char *new;
- unsigned long new_size = state->inbuf_size;
-
- while (new_size < state->inbuf_fill + in_size)
- new_size = new_size << 1;
-
- if_debug1m('s', state->memory, "[s]jpxd growing input buffer to %lu bytes\n",
- new_size);
-
- new = gs_resize_object(state->memory->non_gc_memory, state->inbuf, new_size, "s_jpxd_inbuf");
- if (new == NULL) return_error(gs_error_VMerror);
-
- state->inbuf = new;
- state->inbuf_size = new_size;
- }
-
- /* copy the available input into our buffer */
- /* note that the gs stream library uses offset-by-one
- indexing of its buffers while we use zero indexing */
- memcpy(state->inbuf + state->inbuf_fill, pr->ptr + 1, in_size);
- state->inbuf_fill += in_size;
- pr->ptr += in_size;
-
- return 0;
-}
-
-/* initialize the steam.
- this involves allocating the stream and image structures, and
- initializing the decoder.
- */
-static int
-s_jpxd_init(stream_state * ss)
-{
- stream_jpxd_state *const state = (stream_jpxd_state *) ss;
-
- state->handle = (JP2_Decomp_Handle)NULL;
- state->inbuf = NULL;
- state->inbuf_size = 0;
- state->inbuf_fill = 0;
-
- state->ncomp = 0;
- state->bpc = 0;
- state->clut = NULL;
- state->width = 0;
- state->height = 0;
- state->stride = 0;
- state->image = NULL;
- state->offset = 0;
-
- return 0;
-}
-
-/* Set the defaults */
-static void
-s_jpxd_set_defaults(stream_state * ss) {
- stream_jpxd_state *const state = (stream_jpxd_state *) ss;
-
- state->alpha = false;
- state->image_is_indexed = false;
- state->colorspace = gs_jpx_cs_rgb;
-}
-
-/* write component mapping into 'clut' and return number of used components
- */
-static int
-map_components(JP2_Channel_Def_Params *chans, int nchans, int alpha, int clut[])
-{
- int i, cnt = 0;
-
- for (i = 0; i < nchans; i++)
- clut[i] = -1;
-
- /* always write the alpha channel as first component */
- if (alpha) {
- for (i = 0; i < nchans; i++) {
- if (chans[i].ulType == cJP2_Channel_Type_Opacity) {
- clut[i] = 0;
- cnt++;
- break;
- }
- }
- } else {
- for (i = 0; i < nchans; i++) {
- if (chans[i].ulType == cJP2_Channel_Type_Color) {
- int assoc = chans[i].ulAssociated -1;
- if (assoc >= nchans)
- return -1;
- clut[i] = assoc;
- cnt++;
- }
- }
- }
- return cnt;
-}
-
-/* process a secton of the input and return any decoded data.
- see strimpl.h for return codes.
- */
-static int
-s_jpxd_process(stream_state * ss, stream_cursor_read * pr,
- stream_cursor_write * pw, bool last)
-{
- stream_jpxd_state *const state = (stream_jpxd_state *) ss;
- JP2_Error err;
- JP2_Property_Value result;
- long in_size = pr->limit - pr->ptr;
- long out_size = pw->limit - pw->ptr;
- JP2_Colorspace image_cs = cJP2_Colorspace_RGBa;
-
- if (in_size > 0) {
- /* buffer available data */
- s_jpxd_inbuf(state, pr);
- }
-
- if (last == 1) {
- /* we have all the data, decode and return */
-
- if (state->handle == (JP2_Decomp_Handle)NULL) {
- int ncomp;
- /* initialize decompressor */
- err = JP2_Decompress_Start(&state->handle,
- /* memory allocator callbacks */
- s_jpx_alloc, (JP2_Callback_Param)state->memory->non_gc_memory,
- s_jpx_free, (JP2_Callback_Param)state->memory->non_gc_memory,
- /* our read callback */
- s_jpxd_read_data, (JP2_Callback_Param)state
- );
- if (err != cJP2_Error_OK) {
- dmlprintf1(state->memory, "Luratech JP2 error %d starting decompression\n", (int)err);
- return ERRC;
- }
-#if defined(JP2_LICENSE_NUM_1) && defined(JP2_LICENSE_NUM_2)
- /* set the license keys if appropriate */
- err = JP2_Decompress_SetLicense(state->handle,
- JP2_LICENSE_NUM_1, JP2_LICENSE_NUM_2);
- if (err != cJP2_Error_OK) {
- dmlprintf1(state->memory, "Luratech JP2 error %d setting license\n", (int)err);
- return ERRC;
- }
-#endif
- /* parse image parameters */
- err = JP2_Decompress_GetProp(state->handle,
- cJP2_Prop_Components, &result, -1, -1);
- if (err != cJP2_Error_OK) {
- dmlprintf1(state->memory, "Luratech JP2 error %d decoding number of image components\n", (int)err);
- return ERRC;
- }
- ncomp = result;
-
- {
- JP2_Channel_Def_Params *chans = NULL;
- unsigned long nchans = 0;
- err = JP2_Decompress_GetChannelDefs(state->handle, &chans, &nchans);
- if (err != cJP2_Error_OK) {
- dmlprintf1(state->memory, "Luratech JP2 error %d reading channel definitions\n", (int)err);
- return ERRC;
- }
- state->clut = s_jpx_alloc(nchans * sizeof(int), (JP2_Callback_Param)state->memory->non_gc_memory);
- state->ncomp = map_components(chans, nchans, state->alpha, state->clut);
- if (state->ncomp < 0) {
- dmlprintf(state->memory, "Luratech JP2 error decoding channel definitions\n");
- return ERRC;
- }
- }
-
- if_debug1m('w', state->memory, "[w]jpxd image has %d components\n", state->ncomp);
-
- state->bpc = 0;
- {
- const char *cspace = "unknown";
- err = JP2_Decompress_GetProp(state->handle,
- cJP2_Prop_Extern_Colorspace, &result, -1, -1);
- if (err != cJP2_Error_OK) {
- dmlprintf1(state->memory, "Luratech JP2 error %d decoding colorspace\n", (int)err);
- return ERRC;
- }
- image_cs = (JP2_Colorspace)result;
- switch (result) {
- case cJP2_Colorspace_Gray:
- cspace = "gray";
- state->colorspace = gs_jpx_cs_gray;
- break;
- case cJP2_Colorspace_RGBa:
- cspace = "sRGB";
- state->colorspace = gs_jpx_cs_rgb;
- break;
- case cJP2_Colorspace_RGB_YCCa:
- cspace = "sRGB YCrCb"; break;
- state->colorspace = gs_jpx_cs_rgb;
- break;
- case cJP2_Colorspace_CIE_LABa:
- cspace = "CIE Lab";
- state->colorspace = gs_jpx_cs_rgb;
- break;
- case cJP2_Colorspace_ICCa:
- cspace = "ICC profile";
- state->colorspace = gs_jpx_cs_rgb;
- break;
- case cJP2_Colorspace_Palette_Gray:
- cspace = "indexed gray";
- state->image_is_indexed = true;
- break;
- case cJP2_Colorspace_Palette_RGBa:
- cspace = "indexed sRGB";
- state->image_is_indexed = true;
- if (state->colorspace != gs_jpx_cs_indexed)
- state->bpc = 8;
- break;
- case cJP2_Colorspace_Palette_RGB_YCCa:
- cspace = "indexed sRGB YCrCb";
- state->image_is_indexed = true;
- break;
- case cJP2_Colorspace_Palette_CIE_LABa:
- cspace = "indexed CIE Lab";
- state->image_is_indexed = true;
- break;
- case cJP2_Colorspace_Palette_ICCa:
- cspace = "indexed with ICC profile";
- state->image_is_indexed = true;
- break;
- case cJP2_Colorspace_CMYKa:
- cspace = "CMYK";
- state->colorspace = gs_jpx_cs_cmyk;
- break;
- case cJP2_Colorspace_Palette_CMYKa:
- cspace = "indexed CMYK";
- state->image_is_indexed = true;
- break;
- }
- if_debug1m('w', state->memory, "[w]jpxd image colorspace is %s\n", cspace);
- }
-
- /* the library doesn't return the overall image dimensions
- or depth, so we take the maximum of the component values */
- state->width = 0;
- state->height = 0;
- {
- int comp;
- int width, height;
- int bits, is_signed;
- for (comp = 0; comp < ncomp; comp++) {
- err= JP2_Decompress_GetProp(state->handle,
- cJP2_Prop_Width, &result, -1, (short)comp);
- if (err != cJP2_Error_OK) {
- dmlprintf2(state->memory, "Luratech JP2 error %d decoding "
- "width for component %d\n", (int)err, comp);
- return ERRC;
- }
- width = result;
- err= JP2_Decompress_GetProp(state->handle,
- cJP2_Prop_Height, &result, -1, (short)comp);
- if (err != cJP2_Error_OK) {
- dmlprintf2(state->memory, "Luratech JP2 error %d decoding "
- "height for component %d\n", (int)err, comp);
- return ERRC;
- }
- height = result;
- err= JP2_Decompress_GetProp(state->handle,
- cJP2_Prop_Bits_Per_Sample, &result, -1, (short)comp);
- if (err != cJP2_Error_OK) {
- dmlprintf2(state->memory, "Luratech JP2 error %d decoding "
- "bits per sample for component %d\n", (int)err, comp);
- return ERRC;
- }
- bits = result;
- err= JP2_Decompress_GetProp(state->handle,
- cJP2_Prop_Signed_Samples, &result, -1, (short)comp);
- if (err != cJP2_Error_OK) {
- dmlprintf2(state->memory, "Luratech JP2 error %d decoding "
- "signedness of component %d\n", (int)err, comp);
- return ERRC;
- }
- is_signed = result;
- if_debug5m('w', state->memory,
- "[w]jpxd image component %d has %dx%d %s %d bit samples\n",
- comp, width, height,
- is_signed ? "signed" : "unsigned", bits);
-
- /* update image maximums */
- if (state->width < width) state->width = width;
- if (state->height < height) state->height = height;
- if (state->bpc < bits) state->bpc = bits;
- }
- }
- if_debug3m('w', state->memory, "[w]jpxd decoding image at %ldx%ld"
- " with %d bits per component\n",
- state->width, state->height, state->bpc);
- }
-
- if (state->handle != (JP2_Decomp_Handle)NULL &&
- state->image == NULL) {
-
- /* allocate our output buffer */
- int real_bpc = state->bpc > 8 ? 16 : state->bpc;
- if (state->image_is_indexed && state->colorspace == gs_jpx_cs_indexed) {
- /* Don't expand indexed color space */
- state->stride = (state->width * real_bpc + 7) / 8;
- state->image = s_jpx_alloc(state->stride*state->height, (JP2_Callback_Param)state->memory->non_gc_memory);
- } else {
- state->stride = (state->width * max(1, state->ncomp) * real_bpc + 7) / 8;
- state->image = s_jpx_alloc(state->stride*state->height, (JP2_Callback_Param)state->memory->non_gc_memory);
- }
- if (state->image == NULL)
- return ERRC;
- if (state->ncomp == 0) /* make fully opaque mask */
- memset(state->image, 255, state->stride*state->height);
-
- /* attach our output callback */
- err = JP2_Decompress_SetProp(state->handle,
- cJP2_Prop_Output_Parameter, (JP2_Property_Value)state);
- if (err != cJP2_Error_OK) {
- dmlprintf1(state->memory, "Luratech JP2 error %d setting output parameter\n", (int)err);
- return ERRC;
- }
- err = JP2_Decompress_SetProp(state->handle,
- cJP2_Prop_Output_Function,
- (JP2_Property_Value)s_jpxd_write_data);
- if (err != cJP2_Error_OK) {
- dmlprintf1(state->memory, "Luratech JP2 error %d setting output function\n", (int)err);
- return ERRC;
- }
-
- /* decompress the image */
- err = JP2_Decompress_Image(state->handle);
- if (err != cJP2_Error_OK) {
- dmlprintf1(state->memory, "Luratech JP2 error %d decoding image data\n", (int)err);
- return ERRC; /* parsing error */
- }
-
- if (image_cs == cJP2_Colorspace_RGB_YCCa) {
- s_jpxd_ycc_to_rgb(state);
- }
- }
-
- /* copy out available data */
- if (state->image != NULL && out_size > 0) {
- /* copy some output data */
- long available = min(out_size,
- state->stride*state->height - state->offset);
- memcpy(pw->ptr + 1, state->image + state->offset, available);
- state->offset += available;
- pw->ptr += available;
- /* more output to deliver? */
- if (state->offset == state->stride*state->height)
- return EOFC;
- else
- return 1;
- }
- }
-
- /* ask for more data */
- return 0;
-}
-
-/* stream release.
- free all our decoder state.
- */
-static void
-s_jpxd_release(stream_state *ss)
-{
- stream_jpxd_state *const state = (stream_jpxd_state *) ss;
-
- if (state) {
- JP2_Decompress_End(state->handle);
- if (state->inbuf)
- gs_free_object(state->memory->non_gc_memory, state->inbuf, "s_jpxd_release.1");
- if (state->image)
- gs_free_object(state->memory->non_gc_memory, state->image, "s_jpxd_release.2");
- if (state->clut)
- gs_free_object(state->memory->non_gc_memory, state->clut, "s_jpxd_release.3");
- }
-}
-
-/* stream template */
-const stream_template s_jpxd_template = {
- &st_jpxd_state,
- s_jpxd_init,
- s_jpxd_process,
- 1024, 1024, /* min in and out buffer sizes we can handle
- should be ~32k,64k for efficiency? */
- s_jpxd_release,
- s_jpxd_set_defaults,
- 0
-};
-
-/*** encode support **/
-
-/* we provide a C-only encode filter for generating JPX image data
- for embedding in PDF. */
-
-/* create a gc object for our state, defined in sjpx_luratech.h */
-private_st_jpxe_state();
-
-/* callback for uncompressed data input */
-static JP2_Error JP2_Callback_Conv
-s_jpxe_read(unsigned char *buffer, short component,
- unsigned long row, unsigned long start,
- unsigned long num, JP2_Callback_Param param)
-{
- stream_jpxe_state *state = (stream_jpxe_state *)param;
- unsigned long available, sentinel;
- unsigned char *p;
- int i;
-
- if (component < 0 || component >= state->components) {
- dmlprintf2(state->memory,
- "Luratech JP2 requested image data for unknown component %d of %u\n",
- (int)component, state->components);
- return cJP2_Error_Invalid_Component_Index;
- }
-
- /* todo: handle subsampled components and bpc != 8 */
-
- /* clip to array bounds */
- sentinel = row*state->stride + (start + num)*state->components;
- available = min(sentinel, state->infill);
- num = min(num, available / state->components);
-
- p = state->inbuf + state->stride*row + state->components*start;
- if (state->components == 1)
- memcpy(buffer, p, num);
- else for (i = 0; i < num; i++) {
- buffer[i] = p[component];
- p += state->components;
- }
-
- if (available < sentinel) return cJP2_Error_Failure_Read;
- else return cJP2_Error_OK;
-}
-
-/* callback for compressed data output */
-static JP2_Error JP2_Callback_Conv
-s_jpxe_write(unsigned char *buffer,
- unsigned long pos, unsigned long size,
- JP2_Callback_Param param)
-{
- stream_jpxe_state *state = (stream_jpxe_state *)param;
-
- /* verify state */
- if (state == NULL) return cJP2_Error_Invalid_Pointer;
-
- /* allocate the output buffer if necessary */
- if (state->outbuf == NULL) {
- state->outbuf = s_jpx_alloc(JPX_BUFFER_SIZE, (JP2_Callback_Param)state->memory->non_gc_memory);
- if (state->outbuf == NULL) {
- dmprintf(state->memory, "jpx encode: failed to allocate output buffer.\n");
- return cJP2_Error_Failure_Malloc;
- }
- state->outsize = JPX_BUFFER_SIZE;
- }
-
- /* grow the output buffer if necessary */
- while (pos+size > state->outsize) {
- unsigned char *new = gs_resize_object(state->memory->non_gc_memory, state->outbuf, state->outsize*2, "s_jpxe_write");
-
- if (new == NULL) {
- dmprintf1(state->memory, "jpx encode: failed to resize output buffer"
- " beyond %lu bytes.\n", state->outsize);
- return cJP2_Error_Failure_Malloc;
- }
- state->outbuf = new;
- state->outsize *= 2;
- if_debug1m('s', state->memory, "[s] jpxe output buffer resized to %lu bytes\n",
- state->outsize);
- }
-
- /* copy data into our buffer; we've assured there is enough room. */
- memcpy(state->outbuf + pos, buffer, size);
- /* update high water mark */
- if (state->outfill < pos + size) state->outfill = pos + size;
-
- return cJP2_Error_OK;
-}
-
-/* set defaults for user-configurable parameters */
-static void
-s_jpxe_set_defaults(stream_state *ss)
-{
- stream_jpxe_state *state = (stream_jpxe_state *)ss;
-
- /* most common default colorspace */
- state->colorspace = gs_jpx_cs_rgb;
-
- /* default to lossy 60% quality */
- state->lossless = 0;
- state->quality = 60;
-}
-
-/* initialize the stream */
-static int
-s_jpxe_init(stream_state *ss)
-{
- stream_jpxe_state *state = (stream_jpxe_state *)ss;
- unsigned long value;
- JP2_Error err;
-
- /* width, height, bpc and colorspace are set by the client,
- calculate the rest */
- switch (state->colorspace) {
- case gs_jpx_cs_gray: state->components = 1; break;
- case gs_jpx_cs_rgb: state->components = 3; break;
- case gs_jpx_cs_cmyk: state->components = 4; break;
- default: state->components = 0; break;
- }
- state->stride = state->width * state->components;
-
- if_debug3m('w', state->memory, "[w] jpxe init %lux%lu image with %d components\n",
- state->width, state->height, state->components);
- if_debug1m('w', state->memory, "[w] jpxe init image is %d bits per component\n", state->bpc);
-
- if (state->lossless) {
- if_debug0m('w', state->memory, "[w] jpxe image using lossless encoding\n");
- state->quality = 100; /* implies lossless */
- } else {
- if_debug1m('w', state->memory, "[w] jpxe image quality level %d\n", state->quality);
- }
-
- /* null the input buffer */
- state->inbuf = NULL;
- state->insize = 0;
- state->infill = 0;
-
- /* null the output buffer */
- state->outbuf = NULL;
- state->outsize = 0;
- state->outfill = 0;
- state->offset = 0;
-
- /* initialize the encoder */
- err = JP2_Compress_Start(&state->handle,
- /* memory allocator callbacks */
- s_jpx_alloc, (JP2_Callback_Param)state->memory->non_gc_memory,
- s_jpx_free, (JP2_Callback_Param)state->memory->non_gc_memory,
- state->components);
- if (err != cJP2_Error_OK) {
- dmlprintf1(state->memory, "Luratech JP2 error %d starting compressor\n", (int)err);
- return ERRC;
- }
-
-#if defined(JP2_LICENSE_NUM_1) && defined(JP2_LICENSE_NUM_2)
- /* set license keys if appropriate */
- err = JP2_Compress_SetLicense(state->handle,
- JP2_LICENSE_NUM_1, JP2_LICENSE_NUM_2);
- if (err != cJP2_Error_OK) {
- dmlprintf1(state->memory, "Luratech JP2 error %d setting license\n", (int)err);
- return ERRC;
- }
-#endif
-
- /* install our callbacks */
- err = JP2_Compress_SetProp(state->handle,
- cJP2_Prop_Input_Parameter, (JP2_Property_Value)state, -1, -1);
- if (err != cJP2_Error_OK) {
- dmlprintf1(state->memory, "Luratech JP2 error %d setting input callback parameter.\n", (int)err);
- return ERRC;
- }
- err = JP2_Compress_SetProp(state->handle,
- cJP2_Prop_Input_Function, (JP2_Property_Value)s_jpxe_read, -1, -1);
- if (err != cJP2_Error_OK) {
- dmlprintf1(state->memory, "Luratech JP2 error %d setting input callback function.\n", (int)err);
- return ERRC;
- }
- err = JP2_Compress_SetProp(state->handle,
- cJP2_Prop_Write_Parameter, (JP2_Property_Value)state, -1, -1);
- if (err != cJP2_Error_OK) {
- dmlprintf1(state->memory, "Luratech JP2 error %d setting compressed output callback parameter.\n", (int)err);
- return ERRC;
- }
- err = JP2_Compress_SetProp(state->handle,
- cJP2_Prop_Write_Function, (JP2_Property_Value)s_jpxe_write, -1, -1);
- if (err != cJP2_Error_OK) {
- dmlprintf1(state->memory, "Luratech JP2 error %d setting compressed output callback function.\n", (int)err);
- return ERRC;
- }
-
- /* set image parameters - the same for all components */
- err = JP2_Compress_SetProp(state->handle,
- cJP2_Prop_Width, state->width, -1, -1);
- if (err != cJP2_Error_OK) {
- dmlprintf1(state->memory, "Luratech JP2 error %d setting width\n", (int)err);
- return ERRC;
- }
- err = JP2_Compress_SetProp(state->handle,
- cJP2_Prop_Height, state->height, -1, -1);
- if (err != cJP2_Error_OK) {
- dmlprintf1(state->memory, "Luratech JP2 error %d setting height\n", (int)err);
- return ERRC;
- }
- err = JP2_Compress_SetProp(state->handle,
- cJP2_Prop_Bits_Per_Sample, state->bpc, -1, -1);
- if (err != cJP2_Error_OK) {
- dmlprintf1(state->memory, "Luratech JP2 error %d setting bits per sample\n", (int)err);
- return ERRC;
- }
-
- switch (state->colorspace) {
- case gs_jpx_cs_gray: value = cJP2_Colorspace_Gray; break;
- case gs_jpx_cs_rgb: value = cJP2_Colorspace_RGBa; break;
- case gs_jpx_cs_cmyk: value = cJP2_Colorspace_CMYKa; break;
- default:
- dmlprintf1(state->memory, "Unknown colorspace %d initializing JP2 encoder\n",
- (int)state->colorspace);
- return ERRC;
- }
- err = JP2_Compress_SetProp(state->handle,
- cJP2_Prop_Extern_Colorspace, value, -1, -1);
- if (err != cJP2_Error_OK) {
- dmlprintf1(state->memory, "Luratech JP2 error %d setting colorspace\n", (int)err);
- return ERRC;
- }
-
- if (state->lossless) {
- /* the default encoding mode is lossless */
- return 0;
- }
-
- /* otherwise, set 9,7 wavelets and quality-target mode */
- err = JP2_Compress_SetProp(state->handle,
- cJP2_Prop_Wavelet_Filter, cJP2_Wavelet_9_7, -1, -1);
- if (err != cJP2_Error_OK) {
- dmlprintf1(state->memory, "Luratech JP2 error %d setting wavelet filter\n", (int)err);
- return ERRC;
- }
- err = JP2_Compress_SetProp(state->handle,
- cJP2_Prop_Rate_Quality, state->quality, -1, -1);
- if (err != cJP2_Error_OK) {
- dmlprintf1(state->memory, "Luratech JP2 error %d setting compression quality\n", (int)err);
- return ERRC;
- }
-
- /* we use the encoder's defaults for all other parameters */
-
- return 0;
-}
-
-/* process input and return any encoded data.
- see strimpl.h for return codes. */
-static int
-s_jpxe_process(stream_state *ss, stream_cursor_read *pr,
- stream_cursor_write *pw, bool last)
-{
- stream_jpxe_state *state = (stream_jpxe_state *)ss;
- long in_size = pr->limit - pr->ptr;
- long out_size = pw->limit - pw->ptr;
- long available;
- JP2_Error err;
-
- /* HACK -- reinstall our callbacks in case the GC has moved our state structure */
- /* this should be done instead from a pointer relocation callback, or initialization
- moved entirely inside the process routine. */
- err = JP2_Compress_SetProp(state->handle,
- cJP2_Prop_Input_Parameter, (JP2_Property_Value)state, -1, -1);
- if (err != cJP2_Error_OK) {
- dmlprintf1(state->memory, "Luratech JP2 error %d setting input callback parameter.\n", (int)err);
- return ERRC;
- }
- err = JP2_Compress_SetProp(state->handle,
- cJP2_Prop_Write_Parameter, (JP2_Property_Value)state, -1, -1);
- if (err != cJP2_Error_OK) {
- dmlprintf1(state->memory, "Luratech JP2 error %d setting compressed output callback parameter.\n", (int)err);
- return ERRC;
- }
-
- if (in_size > 0) {
- /* allocate our input buffer if necessary */
- if (state->inbuf == NULL) {
- state->inbuf = s_jpx_alloc(JPX_BUFFER_SIZE, (JP2_Callback_Param)state->memory->non_gc_memory);
- if (state->inbuf == NULL) {
- dmprintf(state->memory, "jpx encode: failed to allocate input buffer.\n");
- return ERRC;
- }
- state->insize = JPX_BUFFER_SIZE;
- }
-
- /* grow our input buffer if necessary */
- while (state->infill + in_size > state->insize) {
- unsigned char *new = gs_resize_object(state->memory->non_gc_memory, state->inbuf, state->insize*2, "s_jpxe_process");
- if (new == NULL) {
- dmprintf(state->memory, "jpx encode: failed to resize input buffer.\n");
- return ERRC;
- }
- state->inbuf = new;
- state->insize *= 2;
- }
-
- /* copy available input */
- memcpy(state->inbuf + state->infill, pr->ptr + 1, in_size);
- state->infill += in_size;
- pr->ptr += in_size;
- }
-
- if (last && state->outbuf == NULL) {
- /* We have all the data; call the compressor.
- our callback will automatically allocate the output buffer */
- if_debug0m('w', state->memory, "[w] jpxe process compressing image data\n");
- err = JP2_Compress_Image(state->handle);
- if (err != cJP2_Error_OK) {
- dmlprintf1(state->memory, "Luratech JP2 error %d compressing image data.\n", (int)err);
- return ERRC;
- }
- }
-
- if (state->outbuf != NULL) {
- /* copy out any available output data */
- available = min(out_size, state->outfill - state->offset);
- memcpy(pw->ptr + 1, state->outbuf + state->offset, available);
- pw->ptr += available;
- state->offset += available;
-
- /* do we have any more data? */
- if (state->outfill - state->offset > 0) return 1;
- else return EOFC; /* all done */
- }
-
- /* something went wrong above */
- return last;
-}
-
-/* stream release. free all our state. */
-static void
-s_jpxe_release(stream_state *ss)
-{
- stream_jpxe_state *state = (stream_jpxe_state *)ss;
- JP2_Error err;
-
- /* close the library compression context */
- err = JP2_Compress_End(state->handle);
- if (err != cJP2_Error_OK) {
- /* we can't return an error, so only print on debug builds */
- if_debug1m('w', state->memory, "[w]jpxe Luratech JP2 error %d"
- " closing compression context", (int)err);
- }
-
- /* free our own storage */
- gs_free_object(state->memory->non_gc_memory, state->outbuf, "s_jpxe_release(outbuf)");
- gs_free_object(state->memory->non_gc_memory, state->inbuf, "s_jpxe_release(inbuf)");
-}
-
-int sjpxd_create(gs_memory_t *mem)
-{
- return 0;
-}
-
-void sjpxd_destroy(gs_memory_t *mem)
-{
-}
-
-/* encoder stream template */
-const stream_template s_jpxe_template = {
- &st_jpxe_state,
- s_jpxe_init,
- s_jpxe_process,
- 1024, 1024, /* min in and out buffer sizes */
- s_jpxe_release,
- s_jpxe_set_defaults
-};
diff --git a/base/sjpx_luratech.h b/base/sjpx_luratech.h
deleted file mode 100644
index 92c66c49..00000000
--- a/base/sjpx_luratech.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
- All Rights Reserved.
-
- This software is provided AS-IS with no warranty, either express or
- implied.
-
- This software is distributed under license and may not be copied,
- modified or distributed except as expressly authorized under the terms
- of the license contained in the file LICENSE in this distribution.
-
- Refer to licensing information at http://www.artifex.com or contact
- Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
- CA 94945, U.S.A., +1(415)492-9861, for further information.
-*/
-
-
-/* Definitions for JPXDecode filter (JPEG 2000) */
-/* we link to the Luratech CSDK for the actual decoding */
-
-#ifndef sjpx_luratech_INCLUDED
-# define sjpx_luratech_INCLUDED
-
-/* Requires scommon.h; strimpl.h if any templates are referenced */
-
-#include "scommon.h"
-#include <lwf_jp2.h>
-
-/* define colorspace enumeration for the decompressed image data */
-typedef enum {
- gs_jpx_cs_unset, /* colorspace hasn't been set */
- gs_jpx_cs_gray, /* single component grayscale image */
- gs_jpx_cs_rgb, /* three component (s)RGB image */
- gs_jpx_cs_cmyk, /* four component CMYK image */
- gs_jpx_cs_indexed /* PDF image wants raw index values */
-} gs_jpx_cs;
-
-/* Stream state for the Luratech jp2 codec
- * We rely on our finalization call to free the
- * associated handle and pointers.
- */
-typedef struct stream_jpxd_state_s
-{
- stream_state_common; /* a define from scommon.h */
- JP2_Decomp_Handle handle; /* library decoder handle */
- unsigned char *inbuf; /* input data buffer */
- unsigned long inbuf_size;
- unsigned long inbuf_fill;
- gs_jpx_cs colorspace; /* requested output colorspace */
- bool alpha; /* return opacity channel */
- bool image_is_indexed; /* image is indexed, needs decoding */
- /* if colorspace != gs_jpx_cs_indexed */
- int ncomp; /* number of image components */
- int bpc; /* sample bits per component */
- int *clut; /* channel indices */
- unsigned long width, height;
- unsigned long stride;
- unsigned char *image; /* decoded image buffer */
- long offset; /* offset into the image buffer of the next
- byte to be returned */
-}
-stream_jpxd_state;
-
-#define private_st_jpxd_state() \
- gs_private_st_simple(st_jpxd_state, stream_jpxd_state,\
- "JPXDecode filter state")
-extern const stream_template s_jpxd_template;
-
-/* JPX encoder internal state */
-typedef struct stream_jpxe_state_s {
- stream_state_common; /* inherit base object from scommon.h */
- JP2_Comp_Handle handle; /* compression library context */
-
- /* the following members must be set by the caller: */
- unsigned long width, height;/* image dimensions */
- gs_jpx_cs colorspace; /* colorspace of the input image data */
- unsigned int bpc; /* sample depth of each channel in bits */
-
- /* the following members can be optionally set by the caller: */
- unsigned int quality; /* compressed image quality target; 1-100
- leave unset for the default */
- int lossless; /* set to 1 to specify lossless image
- compression; overrides quality */
-
- /* the remainder are handled internally: */
- unsigned int components; /* number of image channels */
- unsigned long stride; /* line length in bytes */
- unsigned char *inbuf; /* input image data buffer */
- unsigned long insize; /* allocated size of buffer */
- unsigned long infill; /* bytes written to the buffer */
-
- unsigned char *outbuf; /* output data buffer */
- unsigned long outsize; /* size of the data buffer in bytes */
- unsigned long outfill; /* bytes written to the buffer */
- unsigned long offset; /* bytes written from the buffer */
-} stream_jpxe_state;
-
-#define private_st_jpxe_state() \
- gs_private_st_simple(st_jpxe_state, stream_jpxe_state, \
- "jpx encode filter state")
-
-extern const stream_template s_jpxe_template;
-
-#endif /* sjpx_luratech_INCLUDED */
diff --git a/base/sjpx_none.c b/base/sjpx_none.c
index 38767618..a0758990 100644
--- a/base/sjpx_none.c
+++ b/base/sjpx_none.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sjpx_openjpeg.c b/base/sjpx_openjpeg.c
index f0db34e1..bac505dd 100644
--- a/base/sjpx_openjpeg.c
+++ b/base/sjpx_openjpeg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -435,25 +435,43 @@ static int decode_image(stream_jpxd_state * const state)
{
case OPJ_CLRSPC_GRAY:
state->colorspace = gs_jpx_cs_gray;
+ if (numprimcomp > 1) {
+ dmprintf1(state->memory, "openjpeg warning: Ignoring extra components for %d component Gray data.\n", numprimcomp);
+ numprimcomp = 1;
+ }
break;
- case OPJ_CLRSPC_UNKNOWN: /* make the best guess based on number of channels */
- {
- if (numprimcomp < 3)
- {
- state->colorspace = gs_jpx_cs_gray;
+ case OPJ_CLRSPC_SRGB:
+ case OPJ_CLRSPC_SYCC:
+ case OPJ_CLRSPC_EYCC:
+ state->colorspace = gs_jpx_cs_rgb;
+ if (numprimcomp > 3) {
+ dmprintf1(state->memory, "openjpeg warning: Ignoring extra components for %d component RGB data.\n", numprimcomp);
+ numprimcomp = 3;
}
- else if (numprimcomp == 4)
- {
+ break;
+ case OPJ_CLRSPC_CMYK:
+ state->colorspace = gs_jpx_cs_cmyk;
+ if (numprimcomp > 4) {
+ dmprintf1(state->memory, "openjpeg warning: Ignoring extra components for %d component CMYK data.\n", numprimcomp);
+ numprimcomp = 4;
+ }
+ break;
+ default:
+ case OPJ_CLRSPC_UNSPECIFIED:
+ case OPJ_CLRSPC_UNKNOWN:
+ if (numprimcomp == 1) {
+ dmprintf1(state->memory, "openjpeg warning: unspec CS. %d component so assuming gray.\n", numprimcomp);
+ state->colorspace = gs_jpx_cs_gray;
+ } else if (numprimcomp == 4) {
+ dmprintf1(state->memory, "openjpeg warning: unspec CS. %d components so assuming CMYK.\n", numprimcomp);
state->colorspace = gs_jpx_cs_cmyk;
- }
- else
- {
+ } else {
+ /* Note, numprimcomp > 4 possible here. Bug 694909.
+ Trust that it is RGB though. Do not set numprimcomp */
+ dmprintf1(state->memory, "openjpeg warning: unspec CS. %d components. Assuming data RGB.\n", numprimcomp);
state->colorspace = gs_jpx_cs_rgb;
}
break;
- }
- default: /* OPJ_CLRSPC_SRGB, OPJ_CLRSPC_SYCC, OPJ_CLRSPC_EYCC */
- state->colorspace = gs_jpx_cs_rgb;
}
state->alpha_comp = -1;
@@ -560,12 +578,12 @@ static int process_one_trunk(stream_jpxd_state * const state, stream_cursor_writ
for (b=0; b<bytepp1; b++)
*row++ = (((*(state->pdata[compno]) << shift_bit) >> (8*(bytepp1-b-1))))
+ (b==0 ? state->sign_comps[compno] : 0); /* split and shift input int to output bytes */
- state->pdata[compno]++;
+ state->pdata[compno]++;
}
}
}
else
- {
+ {
/* shift_bit = 0, bpp < 8 */
int bt=0;
int bit_pos = 0;
@@ -678,7 +696,7 @@ s_opjd_process(stream_state * ss, stream_cursor_read * pr,
int locked = 0;
int code;
- if (in_size > 0)
+ if (in_size > 0)
{
/* buffer available data */
code = opj_lock(ss->memory);
@@ -703,7 +721,7 @@ s_opjd_process(stream_state * ss, stream_cursor_read * pr,
}
}
- if (last == 1)
+ if (last == 1)
{
if (state->image == NULL)
{
@@ -774,11 +792,11 @@ s_opjd_release(stream_state *ss)
/* free image data structure */
if (state->image)
opj_image_destroy(state->image);
-
+
/* free stream */
if (state->stream)
opj_stream_destroy(state->stream);
-
+
/* free decoder handle */
if (state->codec)
opj_destroy_codec(state->codec);
diff --git a/base/sjpx_openjpeg.h b/base/sjpx_openjpeg.h
index be129983..0ee57b64 100644
--- a/base/sjpx_openjpeg.h
+++ b/base/sjpx_openjpeg.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -72,4 +72,4 @@ typedef struct stream_jpxd_state_s
extern const stream_template s_jpxd_template;
-#endif
+#endif
diff --git a/base/slzwc.c b/base/slzwc.c
index 91b2ec5c..c3d4c9a0 100644
--- a/base/slzwc.c
+++ b/base/slzwc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/slzwd.c b/base/slzwd.c
index 25ffd0dc..c5c49a21 100644
--- a/base/slzwd.c
+++ b/base/slzwd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -167,225 +167,231 @@ s_LZWD_process(stream_state * st, stream_cursor_read * pr,
}
goto add;
}
- top:if (code_size > bits_left) {
- if (bytes_left == 0) {
- if (p == rlimit)
- goto out;
- bytes_left = *++p;
- if_debug1m('W', ss->memory, "[W]block count %d\n", bytes_left);
+ while (1) /* Loop while we have data to handle */
+ {
+ if (code_size > bits_left) {
if (bytes_left == 0) {
- status = EOFC;
- goto out;
- }
- goto top;
- }
- if (low_order)
- code = bits >> (8 - bits_left);
- else
- code = (uint) bits << (code_size - bits_left);
- if (bits_left + 8 < code_size) { /* Need 2 more data bytes */
- if (bytes_left == 1) {
- if (rlimit - p < 3)
+ if (p == rlimit)
goto out;
- bytes_left = p[2];
- if_debug1m('W', ss->memory, "[W]block count %d\n",
- bytes_left);
+ bytes_left = *++p;
+ if_debug1m('W', ss->memory, "[W]block count %d\n", bytes_left);
if (bytes_left == 0) {
status = EOFC;
goto out;
}
- bytes_left++;
- bits = p[1];
- p++;
+ continue;
+ }
+ if (low_order)
+ code = bits >> (8 - bits_left);
+ else
+ code = (uint) bits << (code_size - bits_left);
+ if (bits_left + 8 < code_size) { /* Need 2 more data bytes */
+ if (bytes_left == 1) {
+ if (rlimit - p < 3)
+ goto out;
+ bytes_left = p[2];
+ if_debug1m('W', ss->memory, "[W]block count %d\n",
+ bytes_left);
+ if (bytes_left == 0) {
+ status = EOFC;
+ goto out;
+ }
+ bytes_left++;
+ bits = p[1];
+ p++;
+ } else {
+ if (rlimit - p < 2)
+ goto out;
+ bits = p[1];
+ }
+ if (low_order)
+ code += (uint) bits << bits_left;
+ else
+ code += (uint) bits << (code_size - 8 - bits_left);
+ bits_left += 8;
+ bits = p[2];
+ p += 2;
+ bytes_left -= 2;
} else {
- if (rlimit - p < 2)
+ if (p == rlimit)
goto out;
- bits = p[1];
+ bits = *++p;
+ bytes_left--;
}
if (low_order)
- code += (uint) bits << bits_left;
+ code += (uint) bits << bits_left,
+ bits_left += 8 - code_size;
else
- code += (uint) bits << (code_size - 8 - bits_left);
- bits_left += 8;
- bits = p[2];
- p += 2;
- bytes_left -= 2;
+ bits_left += 8 - code_size,
+ code += bits >> bits_left;
} else {
- if (p == rlimit)
- goto out;
- bits = *++p;
- bytes_left--;
+ if (low_order)
+ code = bits >> (8 - bits_left),
+ bits_left -= code_size;
+ else
+ bits_left -= code_size,
+ code = bits >> bits_left;
}
- if (low_order)
- code += (uint) bits << bits_left,
- bits_left += 8 - code_size;
- else
- bits_left += 8 - code_size,
- code += bits >> bits_left;
- } else {
- if (low_order)
- code = bits >> (8 - bits_left),
- bits_left -= code_size;
- else
- bits_left -= code_size,
- code = bits >> bits_left;
- }
- code &= code_mask;
- if_debug2m('W', ss->memory, "[W]reading 0x%x,%d\n", code, code_size);
- /*
- * There is an anomalous case where a code S is followed
- * immediately by another occurrence of the S string.
- * In this case, the next available code will be defined as
- * S followed by the first character of S, and will be
- * emitted immediately after the code S. We have to
- * recognize this case specially, by noting that the code is
- * equal to next_code.
- */
- if (code >= next_code) {
- if ((code > next_code) || (prev_code < 0)) {
+ code &= code_mask;
+ if_debug2m('W', ss->memory, "[W]reading 0x%x,%d\n", code, code_size);
+ /*
+ * There is an anomalous case where a code S is followed
+ * immediately by another occurrence of the S string.
+ * In this case, the next available code will be defined as
+ * S followed by the first character of S, and will be
+ * emitted immediately after the code S. We have to
+ * recognize this case specially, by noting that the code is
+ * equal to next_code.
+ */
+ if (code >= next_code) {
+ if ((code > next_code) || (prev_code < 0)) {
#ifdef DEBUG
- mlprintf3(ss->memory, "[W]code = %d > next_code = %d or prev_code = %d < 0\n",
- code, next_code, prev_code);
+ mlprintf3(ss->memory, "[W]code = %d > next_code = %d or prev_code = %d < 0\n",
+ code, next_code, prev_code);
#endif
- status = ERRC;
- goto out;
- }
- /* Fabricate the entry for the code. It will be */
- /* overwritten immediately, of course. */
- for (c = prev_code; c != eod; c = table[c].prefix)
- dc_next->datum = c;
- len = prev_len + 1;
- dc_next->len = min(len, 255);
- dc_next->prefix = prev_code;
- if_debug3m('w', ss->memory, "[w]decoding anomalous 0x%x=0x%x+%c\n",
- next_code, prev_code, dc_next->datum);
- }
- /* See if there is enough room for the code. */
-reset:
- len = table[code].len;
- if (len == 255) { /* Check for special code (reset or end). */
- /* We set their lengths to 255 to avoid doing */
- /* an extra check in the normal case. */
- if (code == code_reset) {
- if_debug1m('w', ss->memory, "[w]reset: next_code was %d\n",
- next_code);
- next_code = code_0;
- dc_next = table + code_0;
- code_size = ss->InitialCodeLength + 1;
- set_code_size();
- prev_code = -1;
- goto top;
- } else if (code == eod) {
- status = EOFC;
- goto out;
+ status = ERRC;
+ goto out;
+ }
+ /* Fabricate the entry for the code. It will be */
+ /* overwritten immediately, of course. */
+ for (c = prev_code; c != eod; c = table[c].prefix)
+ dc_next->datum = c;
+ len = prev_len + 1;
+ dc_next->len = min(len, 255);
+ dc_next->prefix = prev_code;
+ if_debug3m('w', ss->memory, "[w]decoding anomalous 0x%x=0x%x+%c\n",
+ next_code, prev_code, dc_next->datum);
}
- /* The code length won't fit in a byte, */
- /* compute it the hard way. */
- for (c = code, len = 0; c != eod; len++)
- c = table[c].prefix;
- if_debug2m('w', ss->memory, "[w]long code %d, length=%d\n", code, len);
- }
- if (wlimit - q < len) {
- ss->copy_code = code;
- ss->copy_left = ss->copy_len = len;
- status = 1;
- goto out;
- }
- /* Copy the string to the buffer (back to front). */
- /* Optimize for short codes, which are the most frequent. */
- dc = &table[code];
- switch (len) {
- default:
- {
- byte *q1 = q += len;
+ /* See if there is enough room for the code. */
+ while (1) /* Loop while we have codes to handle */
+ {
+ len = table[code].len;
+ if (len == 255) { /* Check for special code (reset or end). */
+ /* We set their lengths to 255 to avoid doing */
+ /* an extra check in the normal case. */
+ if (code == code_reset) {
+ if_debug1m('w', ss->memory, "[w]reset: next_code was %d\n",
+ next_code);
+ next_code = code_0;
+ dc_next = table + code_0;
+ code_size = ss->InitialCodeLength + 1;
+ set_code_size();
+ prev_code = -1;
+ goto loop;
+ } else if (code == eod) {
+ status = EOFC;
+ goto out;
+ }
+ /* The code length won't fit in a byte, */
+ /* compute it the hard way. */
+ for (c = code, len = 0; c != eod; len++)
+ c = table[c].prefix;
+ if_debug2m('w', ss->memory, "[w]long code %d, length=%d\n", code, len);
+ }
+ if (wlimit - q < len) {
+ ss->copy_code = code;
+ ss->copy_left = ss->copy_len = len;
+ status = 1;
+ goto out;
+ }
+ /* Copy the string to the buffer (back to front). */
+ /* Optimize for short codes, which are the most frequent. */
+ dc = &table[code];
+ switch (len) {
+ default:
+ {
+ byte *q1 = q += len;
- c = code;
- do {
- *q1-- = (dc = &table[c])->datum;
+ c = code;
+ do {
+ *q1-- = (dc = &table[c])->datum;
+ }
+ while ((c = dc->prefix) != eod);
+ b = q1[1];
+ break;
}
- while ((c = dc->prefix) != eod);
- b = q1[1];
+ case 3:
+ q[3] = dc->datum;
+ dc = &table[dc->prefix];
+ case 2:
+ q[2] = dc->datum;
+ dc = &table[dc->prefix];
+ case 1:
+ q[1] = b = dc->datum;
+ q += len;
}
- break;
- case 3:
- q[3] = dc->datum;
- dc = &table[dc->prefix];
- case 2:
- q[2] = dc->datum;
- dc = &table[dc->prefix];
- case 1:
- q[1] = b = dc->datum;
- q += len;
- }
add: /* Add a new entry to the table */
- if (prev_code >= 0) {
- /*
- * Unfortunately, we have to check for next_code ==
- * lzw_decode_max every time: just checking at power
- * of 2 boundaries stops us one code too soon.
- */
- if (!old_tiff && next_code == lzw_decode_max) {
- /*
- * A few anomalous files have one data item too many before the
- * reset code. We think this is a bug in the application that
- * produced the files, but Acrobat accepts the files, so we do
- * too.
- */
- if (!ss->BlockData) { /* don't do this for GIF */
- if (bits_left < 8 && p >= rlimit && last) {
- /* We're at EOD. */
- goto out;
- }
- if (bits_left + ((rlimit - p) << 3) < code_size) {
+ if (prev_code >= 0) {
+ /*
+ * Unfortunately, we have to check for next_code ==
+ * lzw_decode_max every time: just checking at power
+ * of 2 boundaries stops us one code too soon.
+ */
+ if (!old_tiff && next_code == lzw_decode_max) {
/*
- * We need more data to decide whether a reset is next.
- * Return an error if we cannot get more.
+ * A few anomalous files have one data item too many before the
+ * reset code. We think this is a bug in the application that
+ * produced the files, but Acrobat accepts the files, so we do
+ * too.
*/
- if (last)
- status = ERRC;
+ if (!ss->BlockData) { /* don't do this for GIF */
+ if (bits_left < 8 && p >= rlimit && last) {
+ /* We're at EOD. */
+ goto out;
+ }
+ if (bits_left + ((rlimit - p) << 3) < code_size) {
+ /*
+ * We need more data to decide whether a reset is next.
+ * Return an error if we cannot get more.
+ */
+ if (last)
+ status = ERRC;
+ goto out;
+ }
+ if (low_order) {
+ code = bits >> (8 - bits_left);
+ code += (bits = *++p) << bits_left;
+ if (bits_left + 8 < code_size)
+ code += (bits = *++p) << (bits_left + 8);
+ } else {
+ code = bits & ((1 << bits_left) - 1);
+ code = (code << 8) + (bits = *++p);
+ if (bits_left + 8 < code_size)
+ code = (code << 8) + (bits = *++p);
+ code >>= (bits_left - code_size) & 7;
+ }
+ bits_left = (bits_left - code_size) & 7;
+ if (code == code_reset)
+ continue; /* Loop back to handle the reset */
+ }
+ status = ERRC;
goto out;
}
- if (low_order) {
- code = bits >> (8 - bits_left);
- code += (bits = *++p) << bits_left;
- if (bits_left + 8 < code_size)
- code += (bits = *++p) << (bits_left + 8);
- } else {
- code = bits & ((1 << bits_left) - 1);
- code = (code << 8) + (bits = *++p);
- if (bits_left + 8 < code_size)
- code = (code << 8) + (bits = *++p);
- code >>= (bits_left - code_size) & 7;
+ if (next_code < lzw_decode_max) {
+ dc_next->datum = b; /* added char of string */
+ dc_next->len = min(prev_len, 254) + 1;
+ dc_next->prefix = prev_code;
+ dc_next++;
+ if_debug4m('W', ss->memory, "[W]adding 0x%x=0x%x+%c(%d)\n",
+ next_code, prev_code, b, min(len, 255));
+ }
+ if (++next_code == switch_code) { /* Crossed a power of 2. */
+ /* We have to make a strange special check for */
+ /* reaching the end of the code space. */
+ if (next_code < lzw_decode_max - 1) {
+ code_size++;
+ set_code_size();
+ if_debug2m('w', ss->memory, "[w]crossed power of 2: new code_size=%d, next_code=%d\n",
+ code_size, next_code);
+ }
}
- bits_left = (bits_left - code_size) & 7;
- if (code == code_reset)
- goto reset;
- }
- status = ERRC;
- goto out;
- }
- if (next_code < lzw_decode_max) {
- dc_next->datum = b; /* added char of string */
- dc_next->len = min(prev_len, 254) + 1;
- dc_next->prefix = prev_code;
- dc_next++;
- if_debug4m('W', ss->memory, "[W]adding 0x%x=0x%x+%c(%d)\n",
- next_code, prev_code, b, min(len, 255));
- }
- if (++next_code == switch_code) { /* Crossed a power of 2. */
- /* We have to make a strange special check for */
- /* reaching the end of the code space. */
- if (next_code < lzw_decode_max - 1) {
- code_size++;
- set_code_size();
- if_debug2m('w', ss->memory, "[w]crossed power of 2: new code_size=%d, next_code=%d\n",
- code_size, next_code);
}
+ break; /* No more codes to handle */
}
- }
- prev_code = code;
- prev_len = len;
- goto top;
+ prev_code = code;
+ prev_len = len;
+ loop: {}
+ } /* Loop back to the top */
out:pr->ptr = p;
pw->ptr = q;
ss->code_size = code_size;
diff --git a/base/slzwe.c b/base/slzwe.c
index aab5091d..b01803ab 100644
--- a/base/slzwe.c
+++ b/base/slzwe.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/slzwx.h b/base/slzwx.h
index 889950d3..d073dd92 100644
--- a/base/slzwx.h
+++ b/base/slzwx.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/smd5.c b/base/smd5.c
index a4f70572..acf0251b 100644
--- a/base/smd5.c
+++ b/base/smd5.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/smd5.h b/base/smd5.h
index a7df7463..de2bdcfb 100644
--- a/base/smd5.h
+++ b/base/smd5.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/smtf.h b/base/smtf.h
index 83074a3d..40484933 100644
--- a/base/smtf.h
+++ b/base/smtf.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/spdiff.c b/base/spdiff.c
index 7ffc8aa9..c5df1bf0 100644
--- a/base/spdiff.c
+++ b/base/spdiff.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/spdiffx.h b/base/spdiffx.h
index fa3c59d4..a53df06c 100644
--- a/base/spdiffx.h
+++ b/base/spdiffx.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/spngp.c b/base/spngp.c
index bc0d73ad..90fe7be8 100644
--- a/base/spngp.c
+++ b/base/spngp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/spngpx.h b/base/spngpx.h
index ae75d0e3..f8733177 100644
--- a/base/spngpx.h
+++ b/base/spngpx.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/spprint.c b/base/spprint.c
index a72a0c30..c44e8bba 100644
--- a/base/spprint.c
+++ b/base/spprint.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/spprint.h b/base/spprint.h
index a6ee7605..fb2efd44 100644
--- a/base/spprint.h
+++ b/base/spprint.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/spsdf.c b/base/spsdf.c
index 9751fa3f..0993637a 100644
--- a/base/spsdf.c
+++ b/base/spsdf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -94,12 +94,10 @@ s_write_ps_string(stream * s, const byte * str, uint size, int print_ok)
stream_cursor_write w;
int status;
- r.ptr = str - 1;
- r.limit = r.ptr + size;
- w.limit = buf + sizeof(buf) - 1;
+ stream_cursor_read_init(&r, str, size);
do {
- /* One picky compiler complains if we initialize to buf - 1. */
- w.ptr = buf; w.ptr--;
+ stream_cursor_write_init(&w, buf, sizeof(buf));
+
status = (*templat->process) (st, &r, &w, true);
stream_write(s, buf, (uint) (w.ptr + 1 - buf));
}
diff --git a/base/spsdf.h b/base/spsdf.h
index 421155f1..a78ac6d7 100644
--- a/base/spsdf.h
+++ b/base/spsdf.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/spwgd.c b/base/spwgd.c
index cb04cb72..10d77ad4 100644
--- a/base/spwgd.c
+++ b/base/spwgd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2017-2018 Artifex Software, Inc.
+/* Copyright (C) 2017-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/spwgx.h b/base/spwgx.h
index 50d355d1..347c7375 100644
--- a/base/spwgx.h
+++ b/base/spwgx.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2017-2018 Artifex Software, Inc.
+/* Copyright (C) 2017-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/srdline.h b/base/srdline.h
index d9229267..9473eae7 100644
--- a/base/srdline.h
+++ b/base/srdline.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/srld.c b/base/srld.c
index f2aea0d3..6a60d0b3 100644
--- a/base/srld.c
+++ b/base/srld.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/srle.c b/base/srle.c
index c54be127..39ca8189 100644
--- a/base/srle.c
+++ b/base/srle.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/srlx.h b/base/srlx.h
index d015d073..27e3755e 100644
--- a/base/srlx.h
+++ b/base/srlx.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ssha2.c b/base/ssha2.c
index 896f44e7..29830cfd 100644
--- a/base/ssha2.c
+++ b/base/ssha2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ssha2.h b/base/ssha2.h
index 7495c565..fcd88a50 100644
--- a/base/ssha2.h
+++ b/base/ssha2.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/sstring.c b/base/sstring.c
index 8edcc235..b638f9b9 100644
--- a/base/sstring.c
+++ b/base/sstring.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -52,7 +52,7 @@ s_AXE_process(stream_state * st, stream_cursor_read * pr,
if (last && ss->EndOfData)
wcount--; /* leave room for '>' */
- wcount -= (wcount + pos * 2) / 65; /* leave room for \n */
+ wcount -= (wcount + pos * 2) / 64; /* leave room for \n */
wcount >>= 1; /* 2 chars per input byte */
count = (wcount < rcount ? (status = 1, wcount) : rcount);
while (--count >= 0) {
@@ -389,72 +389,85 @@ s_hex_process(stream_cursor_read * pr, stream_cursor_write * pw,
return 1;
if (val1 <= 0xf)
goto d2;
- d1:if ((rcount = (rlimit - p) >> 1) == 0)
- goto x1;
- /* Set up a fast end-of-loop check, so we don't have to test */
- /* both p and q against their respective limits. */
- flimit = (rcount < wlimit - q ? q + rcount : wlimit);
- f1:if ((val1 = decoder[p[1]]) <= 0xf &&
- (val2 = decoder[p[2]]) <= 0xf
- ) {
- p += 2;
- *++q = (val1 << 4) + val2;
- if (q < flimit)
- goto f1;
- if (q >= wlimit)
- goto px;
- }
- x1:if (p >= rlimit)
- goto end1;
- if ((val1 = decoder[*++p]) > 0xf) {
- if (val1 == ctype_space) {
- switch (syntax) {
- case hex_ignore_garbage:
- case hex_ignore_whitespace:
- goto x1;
- case hex_ignore_leading_whitespace:
- if (q == q0 && *odd_digit < 0)
- goto x1;
- /* pass through */
- case hex_break_on_whitespace:
- --p;
- code = 2;
- goto end1;
+ do {
+ /* No digits read */
+ if ((rcount = (rlimit - p) >> 1) != 0)
+ {
+ /* Set up a fast end-of-loop check, so we don't have to test */
+ /* both p and q against their respective limits. */
+ flimit = (rcount < wlimit - q ? q + rcount : wlimit);
+ while (1) {
+ if ((val1 = decoder[p[1]]) <= 0xf &&
+ (val2 = decoder[p[2]]) <= 0xf) {
+ p += 2;
+ *++q = (val1 << 4) + val2;
+ if (q < flimit)
+ continue;
+ if (q >= wlimit)
+ goto px;
+ }
+ break;
}
- } else if (syntax == hex_ignore_garbage)
- goto x1;
- code = ERRC;
- goto end1;
- }
- d2:if (p >= rlimit) {
- *odd_digit = val1;
- goto ended;
- }
- if ((val2 = decoder[*++p]) > 0xf) {
- if (val2 == ctype_space)
- switch (syntax) {
- case hex_ignore_garbage:
- case hex_ignore_whitespace:
- goto d2;
- case hex_ignore_leading_whitespace:
- if (q == q0)
- goto d2;
- /* pass through */
- case hex_break_on_whitespace:
- --p;
- *odd_digit = val1;
- code = 2;
- goto ended;
+ }
+ /* About to read the first digit */
+ while (1) {
+ if (p >= rlimit)
+ goto end1;
+ if ((val1 = decoder[*++p]) > 0xf) {
+ if (val1 == ctype_space) {
+ switch (syntax) {
+ case hex_ignore_garbage:
+ case hex_ignore_whitespace:
+ continue;
+ case hex_ignore_leading_whitespace:
+ if (q == q0 && *odd_digit < 0)
+ continue;
+ /* pass through */
+ case hex_break_on_whitespace:
+ --p;
+ code = 2;
+ goto end1;
+ }
+ } else if (syntax == hex_ignore_garbage)
+ continue;
+ code = ERRC;
+ goto end1;
}
- if (syntax == hex_ignore_garbage)
- goto d2;
- *odd_digit = val1;
- code = ERRC;
- goto ended;
- }
- *++q = (val1 << 4) + val2;
- if (q < wlimit)
- goto d1;
+ break;
+ }
+ d2:
+ /* About to read the second hex digit of a pair */
+ while (1) {
+ if (p >= rlimit) {
+ *odd_digit = val1;
+ goto ended;
+ }
+ if ((val2 = decoder[*++p]) > 0xf) {
+ if (val2 == ctype_space)
+ switch (syntax) {
+ case hex_ignore_garbage:
+ case hex_ignore_whitespace:
+ continue;
+ case hex_ignore_leading_whitespace:
+ if (q == q0)
+ continue;
+ /* pass through */
+ case hex_break_on_whitespace:
+ --p;
+ *odd_digit = val1;
+ code = 2;
+ goto ended;
+ }
+ if (syntax == hex_ignore_garbage)
+ continue;
+ *odd_digit = val1;
+ code = ERRC;
+ goto ended;
+ }
+ break;
+ }
+ *++q = (val1 << 4) + val2;
+ } while (q < wlimit);
px:code = 1;
end1:*odd_digit = -1;
ended:pr->ptr = p;
diff --git a/base/sstring.h b/base/sstring.h
index 28e5eae7..83cf319e 100644
--- a/base/sstring.h
+++ b/base/sstring.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/stat_.h b/base/stat_.h
index 5389e0d0..631294de 100644
--- a/base/stat_.h
+++ b/base/stat_.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/std.h b/base/std.h
index aec4b42c..36025ba5 100644
--- a/base/std.h
+++ b/base/std.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/stdint_.h b/base/stdint_.h
index 537824bd..fd425b44 100644
--- a/base/stdint_.h
+++ b/base/stdint_.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/stdio_.h b/base/stdio_.h
index 034d56ad..45c42926 100644
--- a/base/stdio_.h
+++ b/base/stdio_.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/stdpre.h b/base/stdpre.h
index 84b4e40e..f2a2cf93 100644
--- a/base/stdpre.h
+++ b/base/stdpre.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/stream.c b/base/stream.c
index 30648bd5..2073a12a 100644
--- a/base/stream.c
+++ b/base/stream.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -159,8 +159,13 @@ s_std_init(register stream * s, byte * ptr, uint len, const stream_procs * pp,
{
s->templat = &s_no_template;
s->cbuf = ptr;
- s->cursor.r.ptr = s->cursor.r.limit = s->cursor.w.ptr = ptr - 1;
- s->cursor.w.limit = ptr - 1 + len;
+
+ /* IMPORTANT: "read" MUST come before "write" - see comment in scommon.h about
+ * the layout of read/write cursor structures.
+ */
+ stream_cursor_read_init(&s->cursor.r, ptr, 0);
+ stream_cursor_write_init(&s->cursor.w, ptr, len);
+
s->end_status = 0;
s->foreign = 0;
s->modes = modes;
diff --git a/base/stream.h b/base/stream.h
index a9fcf100..04ef117d 100644
--- a/base/stream.h
+++ b/base/stream.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/strimpl.h b/base/strimpl.h
index 166bccf4..1f51407a 100644
--- a/base/strimpl.h
+++ b/base/strimpl.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/string_.h b/base/string_.h
index c4d56599..94698338 100644
--- a/base/string_.h
+++ b/base/string_.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/strmio.c b/base/strmio.c
index aed84fb2..6f9aa77e 100644
--- a/base/strmio.c
+++ b/base/strmio.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/strmio.h b/base/strmio.h
index 5b43e00a..f61381cf 100644
--- a/base/strmio.h
+++ b/base/strmio.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/stub.mak b/base/stub.mak
index b09a30fa..b61fd12a 100644
--- a/base/stub.mak
+++ b/base/stub.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
diff --git a/base/szlibc.c b/base/szlibc.c
index ee123fa1..0be33384 100644
--- a/base/szlibc.c
+++ b/base/szlibc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/szlibd.c b/base/szlibd.c
index b0f15a4c..e53b2266 100644
--- a/base/szlibd.c
+++ b/base/szlibd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/szlibe.c b/base/szlibe.c
index 028ed5e6..448b88f1 100644
--- a/base/szlibe.c
+++ b/base/szlibe.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/szlibx.h b/base/szlibx.h
index 76a5aef0..f60b3dd1 100644
--- a/base/szlibx.h
+++ b/base/szlibx.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/szlibxx.h b/base/szlibxx.h
index eae78b9f..fefb7440 100644
--- a/base/szlibxx.h
+++ b/base/szlibxx.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/tesseract.mak b/base/tesseract.mak
index 3dcc3ff0..9971c87b 100644
--- a/base/tesseract.mak
+++ b/base/tesseract.mak
@@ -24,7 +24,8 @@ TESSINCLUDES=\
# add -DDISABLED_LEGACY_ENGINE to TESSCXX
# empty TESSERACT_LEGACY
-TESSCXX = $(CXX) $(TESSINCLUDES) $(TESSCXXFLAGS) $(CCFLAGS) -DTESSERACT_IMAGEDATA_AS_PIX -DTESSERACT_DISABLE_DEBUG_FONTS -DGRAPHICS_DISABLED -DDISABLED_LEGACY_ENGINE
+TESSCXX = $(CXX) $(TESSINCLUDES) $(TESSCXXFLAGS) $(CCFLAGS) -DTESSERACT_IMAGEDATA_AS_PIX -DTESSERACT_DISABLE_DEBUG_FONTS -DGRAPHICS_DISABLED
+#-DDISABLED_LEGACY_ENGINE
TESSOBJ = $(GLOBJDIR)$(D)tesseract_
TESSO_ = $(O_)$(TESSOBJ)
@@ -32,21 +33,15 @@ TESSDEPS=\
$(arch_h)\
$(GLSRCDIR)/tesseract.mak\
$(GLGENDIR)/tesseract/version.h\
- $(TESSERACTDIR)/include/tesseract/apitypes.h\
$(TESSERACTDIR)/include/tesseract/baseapi.h\
$(TESSERACTDIR)/include/tesseract/capi.h\
- $(TESSERACTDIR)/include/tesseract/genericvector.h\
- $(TESSERACTDIR)/include/tesseract/helpers.h\
$(TESSERACTDIR)/include/tesseract/ltrresultiterator.h\
$(TESSERACTDIR)/include/tesseract/ocrclass.h\
$(TESSERACTDIR)/include/tesseract/osdetect.h\
$(TESSERACTDIR)/include/tesseract/pageiterator.h\
- $(TESSERACTDIR)/include/tesseract/platform.h\
$(TESSERACTDIR)/include/tesseract/publictypes.h\
$(TESSERACTDIR)/include/tesseract/renderer.h\
$(TESSERACTDIR)/include/tesseract/resultiterator.h\
- $(TESSERACTDIR)/include/tesseract/serialis.h\
- $(TESSERACTDIR)/include/tesseract/strngs.h\
$(TESSERACTDIR)/include/tesseract/thresholder.h\
$(TESSERACTDIR)/include/tesseract/unichar.h\
$(TESSERACTDIR)/src/arch/dotproduct.h\
@@ -108,13 +103,11 @@ TESSDEPS=\
$(TESSERACTDIR)/src/ccutil/bitvector.h\
$(TESSERACTDIR)/src/ccutil/ccutil.h\
$(TESSERACTDIR)/src/ccutil/clst.h\
- $(TESSERACTDIR)/src/ccutil/doubleptr.h\
$(TESSERACTDIR)/src/ccutil/elst.h\
$(TESSERACTDIR)/src/ccutil/elst2.h\
$(TESSERACTDIR)/src/ccutil/errcode.h\
$(TESSERACTDIR)/src/ccutil/fileerr.h\
$(TESSERACTDIR)/src/ccutil/genericheap.h\
- $(TESSERACTDIR)/src/ccutil/globaloc.h\
$(TESSERACTDIR)/src/ccutil/host.h\
$(TESSERACTDIR)/src/ccutil/indexmapbidi.h\
$(TESSERACTDIR)/src/ccutil/kdpair.h\
@@ -130,7 +123,6 @@ TESSDEPS=\
$(TESSERACTDIR)/src/ccutil/unicharmap.h\
$(TESSERACTDIR)/src/ccutil/unicharset.h\
$(TESSERACTDIR)/src/ccutil/unicity_table.h\
- $(TESSERACTDIR)/src/ccutil/unicodes.h\
$(TESSERACTDIR)/src/ccutil/universalambigs.h\
$(TESSERACTDIR)/src/classify/adaptive.h\
$(TESSERACTDIR)/src/classify/blobclass.h\
@@ -160,7 +152,6 @@ TESSDEPS=\
$(TESSERACTDIR)/src/classify/tessclassifier.h\
$(TESSERACTDIR)/src/classify/trainingsample.h\
$(TESSERACTDIR)/src/cutil/bitvec.h\
- $(TESSERACTDIR)/src/cutil/emalloc.h\
$(TESSERACTDIR)/src/cutil/oldlist.h\
$(TESSERACTDIR)/src/dict/dawg.h\
$(TESSERACTDIR)/src/dict/dawg_cache.h\
@@ -805,9 +796,6 @@ $(TESSOBJ)ccutil_elst.$(OBJ) : $(TESSERACTDIR)/src/ccutil/elst.cpp $(TESSDEPS)
$(TESSOBJ)ccutil_errcode.$(OBJ) : $(TESSERACTDIR)/src/ccutil/errcode.cpp $(TESSDEPS)
$(TESSCXX) $(TESSO_)ccutil_errcode.$(OBJ) $(C_) $(TESSERACTDIR)/src/ccutil/errcode.cpp
-$(TESSOBJ)ccutil_globaloc.$(OBJ) : $(TESSERACTDIR)/src/ccutil/globaloc.cpp $(TESSDEPS)
- $(TESSCXX) $(TESSO_)ccutil_globaloc.$(OBJ) $(C_) $(TESSERACTDIR)/src/ccutil/globaloc.cpp
-
$(TESSOBJ)ccutil_mainblk.$(OBJ) : $(TESSERACTDIR)/src/ccutil/mainblk.cpp $(TESSDEPS)
$(TESSCXX) $(TESSO_)ccutil_mainblk.$(OBJ) $(C_) $(TESSERACTDIR)/src/ccutil/mainblk.cpp
@@ -838,9 +826,6 @@ $(TESSOBJ)ccutil_unicharmap.$(OBJ) : $(TESSERACTDIR)/src/ccutil/unicharmap.cpp $
$(TESSOBJ)ccutil_unicharset.$(OBJ) : $(TESSERACTDIR)/src/ccutil/unicharset.cpp $(TESSDEPS)
$(TESSCXX) $(TESSO_)ccutil_unicharset.$(OBJ) $(C_) $(TESSERACTDIR)/src/ccutil/unicharset.cpp
-$(TESSOBJ)ccutil_unicodes.$(OBJ) : $(TESSERACTDIR)/src/ccutil/unicodes.cpp $(TESSDEPS)
- $(TESSCXX) $(TESSO_)ccutil_unicodes.$(OBJ) $(C_) $(TESSERACTDIR)/src/ccutil/unicodes.cpp
-
$(TESSOBJ)ccutil_params.$(OBJ) : $(TESSERACTDIR)/src/ccutil/params.cpp $(TESSDEPS)
$(TESSCXX) $(TESSO_)ccutil_params.$(OBJ) $(C_) $(TESSERACTDIR)/src/ccutil/params.cpp
@@ -1057,7 +1042,6 @@ TESSERACT_OBJS_4=\
$(TESSOBJ)ccutil_elst2.$(OBJ)\
$(TESSOBJ)ccutil_elst.$(OBJ)\
$(TESSOBJ)ccutil_errcode.$(OBJ)\
- $(TESSOBJ)ccutil_globaloc.$(OBJ)\
$(TESSOBJ)ccutil_mainblk.$(OBJ)\
$(TESSOBJ)ccutil_serialis.$(OBJ)\
$(TESSOBJ)ccutil_strngs.$(OBJ)\
@@ -1068,7 +1052,6 @@ TESSERACT_OBJS_4=\
$(TESSOBJ)ccutil_unicharcompress.$(OBJ)\
$(TESSOBJ)ccutil_unicharmap.$(OBJ)\
$(TESSOBJ)ccutil_unicharset.$(OBJ)\
- $(TESSOBJ)ccutil_unicodes.$(OBJ)\
$(TESSOBJ)ccutil_params.$(OBJ)\
$(TESSOBJ)lstm_convolve.$(OBJ)\
$(TESSOBJ)lstm_fullyconnected.$(OBJ)\
@@ -1143,7 +1126,6 @@ TESSERACT_LEGACY_OBJS=\
$(TESSOBJ)classify_shapetable.$(OBJ)\
$(TESSOBJ)classify_tessclassifier.$(OBJ)\
$(TESSOBJ)classify_trainingsample.$(OBJ)\
- $(TESSOBJ)cutil_emalloc.$(OBJ)\
$(TESSOBJ)cutil_oldlist.$(OBJ)\
$(TESSOBJ)dict_hyphen.$(OBJ)\
$(TESSOBJ)textord_equationdetectbase.$(OBJ)\
@@ -1166,8 +1148,8 @@ TESSERACT_LEGACY_OBJS=\
$(TESSOBJ)wordrec_wordclass.$(OBJ)
-#TESSERACT_LEGACY=$(TESSERACT_LEGACY_OBJS)
-TESSERACT_LEGACY=
+TESSERACT_LEGACY=$(TESSERACT_LEGACY_OBJS)
+#TESSERACT_LEGACY=
TESS_ROMFS_ARGS=\
- -c -d Resource/ -P .$(D)Resource$(D) Tesseract$(D)*
+ -c -P $(GLSRCDIR)$(D)..$(D) tessdata$(D)*
diff --git a/base/tessocr.cpp b/base/tessocr.cpp
index 26e5432c..fec5979d 100644
--- a/base/tessocr.cpp
+++ b/base/tessocr.cpp
@@ -1,6 +1,4 @@
#include "tesseract/baseapi.h"
-#include "tesseract/genericvector.h"
-#include "tesseract/serialis.h"
extern "C"
{
@@ -13,6 +11,7 @@ extern "C"
#include "gssprintf.h"
#include "gxiodev.h"
#include "stream.h"
+#include <climits>
#ifndef PATH_MAX
#define PATH_MAX 4096
@@ -24,6 +23,19 @@ extern "C"
static int event = 0;
#endif
+/* Hackily define prototypes for alloc routines for leptonica. */
+extern "C" void *leptonica_malloc(size_t blocksize);
+extern "C" void *leptonica_calloc(size_t numelm, size_t elemsize);
+extern "C" void *leptonica_realloc(void *ptr, size_t blocksize);
+extern "C" void leptonica_free(void *ptr);
+
+typedef struct
+{
+ gs_memory_t *mem;
+ tesseract::TessBaseAPI *api;
+} wrapped_api;
+
+
void *leptonica_malloc(size_t blocksize)
{
void *ret = malloc(blocksize);
@@ -108,43 +120,104 @@ static void my_leptonica_free(void *ptr)
}
static bool
-load_file(const char* filename, GenericVector<char>* data) {
+load_file(const char* filename, std::vector<char>* data) {
bool result = false;
- gp_file *fp = gp_fopen(leptonica_mem, filename, "rb");
+ gp_file *fp;
+ int code;
+ int size;
+
+ code = gs_add_control_path(leptonica_mem, gs_permit_file_reading, filename);
+ if (code < 0)
+ return false;
+
+ fp = gp_fopen(leptonica_mem, filename, "rb");
if (fp == NULL)
- return false;
+ goto fail;
gp_fseek(fp, 0, SEEK_END);
- int size = (int)gp_ftell(fp);
+ size = (int)gp_ftell(fp);
gp_fseek(fp, 0, SEEK_SET);
// Trying to open a directory on Linux sets size to LONG_MAX. Catch it here.
if (size > 0 && size < LONG_MAX) {
// reserve an extra byte in case caller wants to append a '\0' character
data->reserve(size + 1);
- data->resize_no_init(size);
+ data->resize(size);
result = static_cast<long>(gp_fread(&(*data)[0], 1, size, fp)) == size;
}
gp_fclose(fp);
+
+fail:
+ (void)gs_remove_control_path(leptonica_mem, gs_permit_file_reading, filename);
+
return result;
}
static bool
-tess_file_reader(const char *fname, GenericVector<char> *out)
+load_file_from_path(const char *path, const char *file, std::vector<char> *out)
+{
+ const char *sep = gp_file_name_directory_separator();
+ size_t seplen = strlen(sep);
+ size_t bufsize = strlen(path) + seplen + strlen(file) + 1;
+ const char *s, *e;
+ bool ret = 0;
+ char *buf = (char *)gs_alloc_bytes(leptonica_mem, bufsize, "load_file_from_path");
+ if (buf == NULL)
+ return 0;
+
+ s = path;
+ do {
+ e = path;
+ while (*e && *e != gp_file_name_list_separator)
+ e++;
+ memcpy(buf, s, e-s);
+ memcpy(&buf[e-s], sep, seplen);
+ strcpy(&buf[e-s+seplen], file);
+ ret = load_file(buf, out);
+ if (ret)
+ break;
+ s = e;
+ while (*s == gp_file_name_list_separator)
+ s++;
+ } while (*s != 0);
+
+ gs_free_object(leptonica_mem, buf, "load_file_from_path");
+
+ return ret;
+}
+
+#ifndef TESSDATA
+#define TESSDATA tessdata
+#endif
+#define STRINGIFY2(S) #S
+#define STRINGIFY(S) STRINGIFY2(S)
+static char *tessdata_prefix = STRINGIFY(TESSDATA);
+
+static bool
+tess_file_reader(const char *fname, std::vector<char> *out)
{
const char *file = fname;
const char *s;
char text[PATH_MAX];
int code = 0;
+ bool found;
stream *ps;
gx_io_device *iodev;
+ /* fname, as supplied to us by Tesseract has TESSDATA_PREFIX prepended
+ * to it. Check that first. */
+ found = load_file(fname, out);
+ if (found)
+ return found;
+
+ /* Find file, fname with any prefix removed, and use that in
+ * the rest of the searches. */
for (s = fname; *s; s++)
if (*s == '\\' || *s == '/')
file = s+1;
- /* FIXME: Try loading 'file' from gs specific paths */
+ /* Next look in romfs in the tessdata directory. */
iodev = gs_findiodevice(leptonica_mem, (const byte *)"%rom", 4);
- gs_snprintf(text, sizeof(text), "Resource/Tesseract/%s", file);
+ gs_snprintf(text, sizeof(text), "tessdata/%s", file);
if (iodev) {
long size;
long i;
@@ -155,7 +228,7 @@ tess_file_reader(const char *fname, GenericVector<char> *out)
size = (long)romfs_file_len(leptonica_mem, text);
if (size >= 0) {
out->reserve(size + 1);
- out->resize_no_init(size);
+ out->resize(size);
code = iodev->procs.open_file(iodev, text, strlen(text), "rb", &ps, leptonica_mem);
if (code < 0)
return code;
@@ -177,60 +250,105 @@ tess_file_reader(const char *fname, GenericVector<char> *out)
}
}
- /* Fall back to gp_file access, first under Resource/Tesseract */
- if (load_file(text, out))
- return true;
+ /* Fall back to gp_file access under our configured tessdata path. */
+ found = load_file_from_path(tessdata_prefix, file, out);
+ if (found)
+ return found;
- /* Then under TESSDATA */
- return load_file(fname, out);
+ /* If all else fails, look in the current directory. */
+ return load_file(file, out);
}
int
-ocr_init_api(gs_memory_t *mem, const char *language, void **state)
+ocr_init_api(gs_memory_t *mem, const char *language, int engine, void **state)
{
- tesseract::TessBaseAPI *api;
+ enum tesseract::OcrEngineMode mode;
+ wrapped_api *wrapped;
+ int code = 0;
+
+ if (mem->non_gc_memory != mem) {
+ dlprintf("ocr_init_api must not be called with gc controlled memory!\n");
+ return_error(gs_error_unknownerror);
+ }
+
+ wrapped = (wrapped_api *)(void *)gs_alloc_bytes(mem, sizeof(*wrapped), "ocr_init_api");
+ if (wrapped == NULL)
+ return gs_error_VMerror;
- leptonica_mem = mem->non_gc_memory;
+ leptonica_mem = mem;
setPixMemoryManager(my_leptonica_malloc, my_leptonica_free);
- api = new tesseract::TessBaseAPI();
+
+ wrapped->mem = mem;
+ wrapped->api = new tesseract::TessBaseAPI();
*state = NULL;
- if (api == NULL) {
- leptonica_mem = NULL;
- setPixMemoryManager(malloc, free);
- return_error(gs_error_VMerror);
+ if (wrapped->api == NULL) {
+ code = gs_error_VMerror;
+ goto fail;
+ }
+
+ if (language == NULL || language[0] == 0) {
+ language = "eng";
+ }
+
+ switch (engine)
+ {
+ case OCR_ENGINE_DEFAULT:
+ mode = tesseract::OcrEngineMode::OEM_DEFAULT;
+ break;
+ case OCR_ENGINE_LSTM:
+ mode = tesseract::OcrEngineMode::OEM_LSTM_ONLY;
+ break;
+ case OCR_ENGINE_LEGACY:
+ mode = tesseract::OcrEngineMode::OEM_TESSERACT_ONLY;
+ break;
+ case OCR_ENGINE_BOTH:
+ mode = tesseract::OcrEngineMode::OEM_TESSERACT_LSTM_COMBINED;
+ break;
+ default:
+ code = gs_error_rangecheck;
+ goto fail;
}
// Initialize tesseract-ocr with English, without specifying tessdata path
- if (api->Init(NULL, 0, /* data, data_size */
- language,
- tesseract::OcrEngineMode::OEM_DEFAULT,
- NULL, 0, /* configs, configs_size */
- NULL, NULL, /* vars_vec */
- false, /* set_only_non_debug_params */
- &tess_file_reader)) {
- delete api;
- leptonica_mem = NULL;
- setPixMemoryManager(malloc, free);
- return_error(gs_error_unknownerror);
+ if (wrapped->api->Init(NULL, 0, /* data, data_size */
+ language,
+ mode,
+ NULL, 0, /* configs, configs_size */
+ NULL, NULL, /* vars_vec */
+ false, /* set_only_non_debug_params */
+ &tess_file_reader)) {
+ code = gs_error_unknownerror;
+ goto fail;
}
- *state = (void *)api;
+ *state = (void *)wrapped;
return 0;
+fail:
+ if (wrapped->api) {
+ delete wrapped->api;
+ }
+ leptonica_mem = NULL;
+ setPixMemoryManager(malloc, free);
+ gs_free_object(wrapped->mem, wrapped, "ocr_init_api");
+ return_error(code);
}
void
ocr_fin_api(gs_memory_t *mem, void *api_)
{
- tesseract::TessBaseAPI *api = (tesseract::TessBaseAPI *)api_;
+ wrapped_api *wrapped = (wrapped_api *)api_;
- if (api == NULL)
+ if (wrapped == NULL)
return;
- api->End();
- delete api;
+ if (wrapped->api) {
+ wrapped->api->End();
+ delete wrapped->api;
+ }
+ gs_free_object(wrapped->mem, wrapped, "ocr_fin_api");
leptonica_mem = NULL;
setPixMemoryManager(malloc, free);
}
@@ -261,46 +379,37 @@ ocr_clear_image(Pix *image)
}
static int
-do_ocr_image(gs_memory_t *mem,
+do_ocr_image(wrapped_api *wrapped,
int w, int h, int bpp, int raster,
int xres, int yres, void *data, int restore,
int hocr, int pagecount,
- const char *language,
char **out)
{
char *outText;
- tesseract::TessBaseAPI *api;
int code;
Pix *image;
*out = NULL;
- if (language == NULL || *language == 0)
- language = "eng";
- code = ocr_init_api(mem, language, (void **)&api);
- if (code < 0)
- return code;
-
if (bpp == 8)
w = convert2pix((l_uint32 *)data, w, h, raster);
- image = ocr_set_image(api, w, h, data, xres, yres);
+ image = ocr_set_image(wrapped->api, w, h, data, xres, yres);
if (image == NULL) {
if (restore && bpp == 8)
convert2pix((l_uint32 *)data, w, h, raster);
- ocr_fin_api(mem, api);
return_error(gs_error_VMerror);
}
// Get OCR result
//pixWrite("test.pnm", image, IFF_PNM);
if (hocr) {
- api->SetVariable("hocr_font_info", "true");
- api->SetVariable("hocr_char_boxes", "true");
- outText = api->GetHOCRText(pagecount);
+ wrapped->api->SetVariable("hocr_font_info", "true");
+ wrapped->api->SetVariable("hocr_char_boxes", "true");
+ outText = wrapped->api->GetHOCRText(pagecount);
}
else
- outText = api->GetUTF8Text();
+ outText = wrapped->api->GetUTF8Text();
ocr_clear_image(image);
@@ -312,35 +421,34 @@ do_ocr_image(gs_memory_t *mem,
if (outText)
{
size_t len = strlen(outText)+1;
- *out = (char *)(void *)gs_alloc_bytes(mem, len, "ocr_to_utf8");
+ *out = (char *)(void *)gs_alloc_bytes(wrapped->mem, len, "ocr_to_utf8");
if (*out)
memcpy(*out, outText, len);
}
delete [] outText;
- // Destroy used object and release memory
- ocr_fin_api(mem, api);
-
return 0;
}
-int ocr_image_to_hocr(gs_memory_t *mem,
+int ocr_image_to_hocr(void *api,
int w, int h, int bpp, int raster,
int xres, int yres, void *data, int restore,
- int pagecount, const char *language, char **out)
+ int pagecount, char **out)
{
- return do_ocr_image(mem, w, h, bpp, raster, xres, yres, data,
- restore, 1, pagecount, language, out);
+ return do_ocr_image((wrapped_api *)api,
+ w, h, bpp, raster, xres, yres, data,
+ restore, 1, pagecount, out);
}
-int ocr_image_to_utf8(gs_memory_t *mem,
+int ocr_image_to_utf8(void *api,
int w, int h, int bpp, int raster,
int xres, int yres, void *data, int restore,
- const char *language, char **out)
+ char **out)
{
- return do_ocr_image(mem, w, h, bpp, raster, xres, yres, data,
- restore, 0, 0, language, out);
+ return do_ocr_image((wrapped_api *)api,
+ w, h, bpp, raster, xres, yres, data,
+ restore, 0, 0, out);
}
int
@@ -349,7 +457,7 @@ ocr_recognise(void *api_, int w, int h, void *data,
int (*callback)(void *, const char *, const int *, const int *, const int *, int),
void *arg)
{
- tesseract::TessBaseAPI *api = (tesseract::TessBaseAPI *)api_;
+ wrapped_api *wrapped = (wrapped_api *)api_;
Pix *image;
int code;
int word_bbox[4];
@@ -359,17 +467,17 @@ ocr_recognise(void *api_, int w, int h, void *data,
int pointsize, font_id;
const char* font_name;
- if (api == NULL)
+ if (wrapped == NULL || wrapped->api == NULL)
return 0;
- image = ocr_set_image(api, w, h, data, xres, yres);
+ image = ocr_set_image(wrapped->api, w, h, data, xres, yres);
if (image == NULL)
return_error(gs_error_VMerror);
- code = api->Recognize(NULL);
+ code = wrapped->api->Recognize(NULL);
if (code >= 0) {
/* Bingo! */
- tesseract::ResultIterator *res_it = api->GetIterator();
+ tesseract::ResultIterator *res_it = wrapped->api->GetIterator();
while (!res_it->Empty(tesseract::RIL_BLOCK)) {
if (res_it->Empty(tesseract::RIL_WORD)) {
@@ -417,6 +525,148 @@ ocr_recognise(void *api_, int w, int h, void *data,
return code;
}
+static Pix *
+ocr_set_bitmap(wrapped_api *wrapped,
+ int w, int h,
+ const unsigned char *data, int data_x, int raster,
+ int xres, int yres)
+{
+ /* Tesseract prefers a border around things, so we add an 8 pixel
+ * border all around. */
+#define BORDER_SIZE 8
+ int r = (w+BORDER_SIZE*2+3)&~3;
+ Pix *image = pixCreateHeader(r, h+BORDER_SIZE*2, 8);
+ unsigned char *pdata, *d;
+ const unsigned char *s;
+ int x, y;
+
+ if (image == NULL)
+ return NULL;
+
+ pdata = gs_alloc_bytes(wrapped->mem, r * (h+BORDER_SIZE*2), "ocr_set_bitmap");
+ if (pdata == NULL) {
+ pixDestroy(&image);
+ return NULL;
+ }
+ pixSetData(image, (l_uint32 *)pdata);
+ pixSetPadBits(image, 1);
+ pixSetXRes(image, xres);
+ pixSetYRes(image, yres);
+
+ s = &data[data_x>>3] + raster*(h-1);
+ d = pdata;
+ memset(d, 255, r * (h+BORDER_SIZE*2));
+ d += r*BORDER_SIZE + BORDER_SIZE;
+ for (y = 0; y < h; y++) {
+ int b = 128>>(data_x & 7);
+ for (x = 0; x < w; x++) {
+ if (s[x>>3] & b)
+ d[x^3] = 0;
+ else
+ d[x^3] = 255;
+ b >>= 1;
+ if (b == 0)
+ b = 128;
+ }
+ s -= raster;
+ d += r;
+ }
+
+ wrapped->api->SetImage(image);
+// pixWrite("test.pnm", image, IFF_PNM);
+
+ return image;
+}
+
+static void
+ocr_clear_bitmap(wrapped_api *wrapped, Pix *image)
+{
+ gs_free_object(wrapped->mem, pixGetData(image), "ocr_clear_bitmap");
+ pixSetData(image, NULL);
+ pixDestroy(&image);
+}
+
+int ocr_bitmap_to_unicodes(void *state,
+ const void *data, int data_x,
+ int w, int h, int raster,
+ int xres, int yres, int *unicode, int *char_count)
+{
+ wrapped_api *wrapped = (wrapped_api *)state;
+ Pix *image;
+ int code, max_chars = *char_count, count = 0;
+
+ if (wrapped == NULL || wrapped->api == NULL)
+ return 0;
+
+ image = ocr_set_bitmap(wrapped, w, h, (const unsigned char *)data,
+ data_x, raster, xres, yres);
+ if (image == NULL)
+ return_error(gs_error_VMerror);
+
+ code = wrapped->api->Recognize(NULL);
+ if (code >= 0) {
+ /* Bingo! */
+ tesseract::ResultIterator *res_it = wrapped->api->GetIterator();
+
+ while (!res_it->Empty(tesseract::RIL_BLOCK)) {
+ if (res_it->Empty(tesseract::RIL_WORD)) {
+ res_it->Next(tesseract::RIL_WORD);
+ continue;
+ }
+
+ do {
+#if FUTURE_DEVELOPMENT
+ int word_bbox[4];
+ int char_bbox[4];
+ int line_bbox[4];
+#endif
+
+ const unsigned char *graph = (unsigned char *)res_it->GetUTF8Text(tesseract::RIL_SYMBOL);
+ if (graph && graph[0] != 0) {
+ /* Quick and nasty conversion from UTF8 to unicode. */
+ if (graph[0] < 0x80)
+ unicode[count] = graph[0];
+ else {
+ unicode[count] = graph[1] & 0x3f;
+ if (graph[0] < 0xE0)
+ unicode[count] += (graph[0] & 0x1f)<<6;
+ else {
+ unicode[count] = (graph[2] & 0x3f) | (*unicode << 6);
+ if (graph[0] < 0xF0) {
+ unicode[count] += (graph[0] & 0x0F)<<6;
+ } else {
+ unicode[count] = (graph[3] & 0x3f) | (*unicode<<6);
+ unicode[count] += (graph[0] & 0x7);
+ }
+ }
+ }
+ count++;
+#if FUTURE_DEVELOPMENT
+ res_it->BoundingBox(tesseract::RIL_TEXTLINE,
+ line_bbox,line_bbox + 1,
+ line_bbox + 2,line_bbox + 3);
+ res_it->BoundingBox(tesseract::RIL_WORD,
+ word_bbox,word_bbox + 1,
+ word_bbox + 2,word_bbox + 3);
+ res_it->BoundingBox(tesseract::RIL_SYMBOL,
+ char_bbox,char_bbox + 1,
+ char_bbox + 2,char_bbox + 3);
+#endif
+ }
+ res_it->Next(tesseract::RIL_SYMBOL);
+ } while (!res_it->Empty(tesseract::RIL_BLOCK) &&
+ !res_it->IsAtBeginningOf(tesseract::RIL_WORD) && count < max_chars);
+ }
+ delete res_it;
+ code = code;
+ }
+
+ ocr_clear_bitmap(wrapped, image);
+ *char_count = count;
+
+ return code;
+}
+
};
/* Currently tesseract is the only C++ lib we have.
diff --git a/base/tessocr.h b/base/tessocr.h
index c5e7967b..5685cd3e 100644
--- a/base/tessocr.h
+++ b/base/tessocr.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020 Artifex Software, Inc.
+/* Copyright (C) 2020-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -21,25 +21,63 @@
#include "gsmemory.h"
-int ocr_image_to_utf8(gs_memory_t *mem,
- int w, int h, int bpp, int raster,
- int xres, int yres,
- void *data, int restore_data,
- const char *language, char **out);
+enum
+{
+ OCR_ENGINE_DEFAULT = 0,
+ OCR_ENGINE_LSTM = 1,
+ OCR_ENGINE_LEGACY = 2,
+ OCR_ENGINE_BOTH = 3
+};
-int ocr_image_to_hocr(gs_memory_t *mem,
- int w, int h, int bpp, int raster,
- int xres, int yres, void *data, int restore,
- int pagecount, const char *language, char **out);
+int ocr_init_api(gs_memory_t *mem,
+ const char *language,
+ int engine,
+ void **state);
-int ocr_init_api(gs_memory_t *mem, const char *language, void **state);
+void ocr_fin_api(gs_memory_t *mem,
+ void *state);
-void ocr_fin_api(gs_memory_t *mem, void *api_);
-
-int ocr_recognise(void *api_, int w, int h, void *data,
- int xres, int yres,
+int ocr_recognise(void *state,
+ int w,
+ int h,
+ void *data,
+ int xres,
+ int yres,
int (*callback)(void *, const char *, const int *, const int *, const int *, int),
void *arg);
-#endif
+int ocr_bitmap_to_unicodes(void *state,
+ const void *data,
+ int data_x,
+ int w,
+ int h,
+ int raster,
+ int xres,
+ int yres,
+ int *unicode,
+ int *char_count);
+
+int ocr_image_to_utf8(void *state,
+ int w,
+ int h,
+ int bpp,
+ int raster,
+ int xres,
+ int yres,
+ void *data,
+ int restore_data,
+ char **out);
+int ocr_image_to_hocr(void *state,
+ int w,
+ int h,
+ int bpp,
+ int raster,
+ int xres,
+ int yres,
+ void *data,
+ int restore,
+ int pagecount,
+ char **out);
+
+#endif
diff --git a/base/tiff.mak b/base/tiff.mak
index 8345d818..6f1aecf0 100644
--- a/base/tiff.mak
+++ b/base/tiff.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -33,7 +33,7 @@ TIFFCONF_H=$(TIFFCONF)libtiff$(D)tiffconf$(TIFFCONFIG_SUFFIX).h
# Define the name of this makefile.
LIBTIFF_MAK=$(GLSRC)tiff.mak $(TOP_MAKEFILES)
-TIFFCC=$(CC_) $(TIFF_CFLAGS) $(I_)$(TI_) $(II)$(JI_)$(_I) $(PF_)
+TIFFCC=$(CC) $(I_)$(TI_) $(II)$(JI_)$(_I) $(PF_) $(CCFLAGS) $(TIFF_CFLAGS)
TIFFDEP = $(AK) $(TIFFGEN)tif_config.h $(TIFFGEN)tiffconf.h $(LIBTIFF_MAK) $(MAKEDIRS)
gstiffio_h=$(GLSRC)gstiffio.h
@@ -203,10 +203,10 @@ $(TIFFOBJ)gstiffio.$(OBJ) : $(TIFFOBJ)gstiffio_$(SHARE_LIBTIFF).$(OBJ) $(LIBTIFF
$(TIFFGEN)tif_config.h: $(TIFFCONFIG_H) $(LIBTIFF_MAK) $(MAKEDIRS)
$(CP_) $(TIFFCONFIG_H) $(TIFFGEN)tif_config.h
-
+
$(TIFFGEN)tiffconf.h: $(TIFFCONF_H) $(LIBTIFF_MAK) $(MAKEDIRS)
$(CP_) $(TIFFCONF_H) $(TIFFGEN)tiffconf.h
-
+
# Define the version of libtiff.dev that we are actually using.
$(TIFFGEN)libtiff.dev : $(TIFFGEN)libtiff_$(SHARE_LIBTIFF).dev $(LIBTIFF_MAK) $(MAKEDIRS)
$(CP_) $(TIFFGEN)libtiff_$(SHARE_LIBTIFF).dev $(TIFFGEN)libtiff.dev
diff --git a/base/time_.h b/base/time_.h
index 25466c5e..856e4d0f 100644
--- a/base/time_.h
+++ b/base/time_.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ttcalc.c b/base/ttcalc.c
index a8f805a1..844fc274 100644
--- a/base/ttcalc.c
+++ b/base/ttcalc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ttcalc.h b/base/ttcalc.h
index f70b983f..d7184917 100644
--- a/base/ttcalc.h
+++ b/base/ttcalc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ttcommon.h b/base/ttcommon.h
index 7bef167a..58433dd0 100644
--- a/base/ttcommon.h
+++ b/base/ttcommon.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ttconf.h b/base/ttconf.h
index 7dcd60aa..f07a429a 100644
--- a/base/ttconf.h
+++ b/base/ttconf.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ttconfig.h b/base/ttconfig.h
index 44744097..b23d5937 100644
--- a/base/ttconfig.h
+++ b/base/ttconfig.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ttfinp.c b/base/ttfinp.c
index 5052bb92..128057f4 100644
--- a/base/ttfinp.c
+++ b/base/ttfinp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ttfinp.h b/base/ttfinp.h
index 0a1a5e9e..d8cf6141 100644
--- a/base/ttfinp.h
+++ b/base/ttfinp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ttfmain.c b/base/ttfmain.c
index 2fbcacc1..4ee5dfd8 100644
--- a/base/ttfmain.c
+++ b/base/ttfmain.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ttfmemd.c b/base/ttfmemd.c
index 04e63075..e72b7a98 100644
--- a/base/ttfmemd.c
+++ b/base/ttfmemd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ttfmemd.h b/base/ttfmemd.h
index bde57a47..aaabd371 100644
--- a/base/ttfmemd.h
+++ b/base/ttfmemd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ttfoutl.h b/base/ttfoutl.h
index 507b2720..32dd8d22 100644
--- a/base/ttfoutl.h
+++ b/base/ttfoutl.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ttfsfnt.h b/base/ttfsfnt.h
index 78c02646..05122ada 100644
--- a/base/ttfsfnt.h
+++ b/base/ttfsfnt.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ttinterp.c b/base/ttinterp.c
index 125dc582..2ac1783b 100644
--- a/base/ttinterp.c
+++ b/base/ttinterp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ttinterp.h b/base/ttinterp.h
index c1c8efaf..a33acb43 100644
--- a/base/ttinterp.h
+++ b/base/ttinterp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ttload.c b/base/ttload.c
index 42c71973..e56a5e4c 100644
--- a/base/ttload.c
+++ b/base/ttload.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ttload.h b/base/ttload.h
index 76799b32..f6100073 100644
--- a/base/ttload.h
+++ b/base/ttload.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ttmisc.h b/base/ttmisc.h
index c26450d9..9d560731 100644
--- a/base/ttmisc.h
+++ b/base/ttmisc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ttobjs.c b/base/ttobjs.c
index e01b99b1..75eacb9c 100644
--- a/base/ttobjs.c
+++ b/base/ttobjs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ttobjs.h b/base/ttobjs.h
index fa7dd09f..2703f58f 100644
--- a/base/ttobjs.h
+++ b/base/ttobjs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/tttables.h b/base/tttables.h
index 2ceeb2f6..818588ba 100644
--- a/base/tttables.h
+++ b/base/tttables.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/tttype.h b/base/tttype.h
index 80c5036e..91aac7d7 100644
--- a/base/tttype.h
+++ b/base/tttype.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/tttypes.h b/base/tttypes.h
index aa26d20e..91e36ce8 100644
--- a/base/tttypes.h
+++ b/base/tttypes.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/ugcclib.mak b/base/ugcclib.mak
index 423903bb..8b408061 100644
--- a/base/ugcclib.mak
+++ b/base/ugcclib.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
diff --git a/base/unistd_.h b/base/unistd_.h
index a1bdbc0a..0ac355c4 100644
--- a/base/unistd_.h
+++ b/base/unistd_.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/unix-aux.mak b/base/unix-aux.mak
index 3532091e..bf99697b 100644
--- a/base/unix-aux.mak
+++ b/base/unix-aux.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
diff --git a/base/unix-dll.mak b/base/unix-dll.mak
index 64b7ca09..cae247ff 100644
--- a/base/unix-dll.mak
+++ b/base/unix-dll.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -253,7 +253,7 @@ so-only:
$(PCL_TARGET)-so-links-subtarget \
$(XPS_TARGET)-so-links-subtarget \
$(GPDL_TARGET)-so-links-subtarget BUILDDIRPREFIX=$(SODIRPREFIX)
-
+
so-only-stripped:
$(MAKE) $(SUB_MAKE_OPTION) so-only-stripped-subtarget BUILDDIRPREFIX=$(SODIRPREFIX)
@@ -295,7 +295,28 @@ so-subtarget: so-only-subtarget
CFLAGS='$(CFLAGS_STANDARD) $(GCFLAGS) $(AC_CFLAGS) $(XCFLAGS)' prefix=$(prefix)\
$(GSSOC_XE) $(GSSOX_XE) $(PCL_TARGET)-so-loader $(XPS_TARGET)-so-loader $(GPDL_TARGET)-so-loader
-install-so:
+install-so-gs:
+ $(MAKE) $(SUB_MAKE_OPTION) install-so-subtarget BUILDDIRPREFIX=$(SODIRPREFIX)
+
+install-so-gpcl6:
+ $(MAKE) $(SUB_MAKE_OPTION) install-so-subtarget-pcl BUILDDIRPREFIX=$(SODIRPREFIX)
+
+install-so-no_gpcl6:
+ $(NO_OP)
+
+install-so-gxps:
+ $(MAKE) $(SUB_MAKE_OPTION) install-so-subtarget-xps BUILDDIRPREFIX=$(SODIRPREFIX)
+
+install-so-no_gxps:
+ $(NO_OP)
+
+install-so-gpdl:
+ $(MAKE) $(SUB_MAKE_OPTION) install-so-subtarget-gpdl BUILDDIRPREFIX=$(SODIRPREFIX)
+
+install-so-no_gpdl:
+ $(NO_OP)
+
+install-so: install-so-$(PCL_SO_BASE) install-so-$(XPS_SO_BASE) install-so-$(GPDL_SO_BASE)
$(MAKE) $(SUB_MAKE_OPTION) install-so-subtarget BUILDDIRPREFIX=$(SODIRPREFIX)
install-sodebug:
@@ -321,6 +342,51 @@ install-so-subtarget: so-subtarget
$(INSTALL_DATA) $(GLSRC)gserrors.h $(DESTDIR)$(gsincludedir)gserrors.h
$(INSTALL_DATA) $(DEVSRC)gdevdsp.h $(DESTDIR)$(gsincludedir)gdevdsp.h
+install-so-subtarget-pcl: so-subtarget
+ -mkdir -p $(DESTDIR)$(prefix)
+ -mkdir -p $(DESTDIR)$(bindir)
+ -mkdir -p $(DESTDIR)$(libdir)
+ -mkdir -p $(DESTDIR)$(gsincludedir)
+ $(INSTALL_PROGRAM) $(PCLSOC) $(DESTDIR)$(bindir)/$(PCLSOC_XENAME)
+ $(INSTALL_PROGRAM) $(BINDIR)/$(PCL_SONAME_MAJOR_MINOR) $(DESTDIR)$(libdir)/$(PCL_SONAME_MAJOR_MINOR)
+ $(RM_) $(DESTDIR)$(libdir)/$(PCL_SONAME)
+ ln -s $(PCL_SONAME_MAJOR_MINOR) $(DESTDIR)$(libdir)/$(PCL_SONAME)
+ $(RM_) $(DESTDIR)$(libdir)/$(PCL_SONAME_MAJOR)
+ ln -s $(PCL_SONAME_MAJOR_MINOR) $(DESTDIR)$(libdir)/$(PCL_SONAME_MAJOR)
+ $(INSTALL_DATA) $(PLSRC)plapi.h $(DESTDIR)$(gsincludedir)plapi.h
+ $(INSTALL_DATA) $(GLSRC)gserrors.h $(DESTDIR)$(gsincludedir)gserrors.h
+ $(INSTALL_DATA) $(DEVSRC)gdevdsp.h $(DESTDIR)$(gsincludedir)gdevdsp.h
+
+install-so-subtarget-xps: so-subtarget
+ -mkdir -p $(DESTDIR)$(prefix)
+ -mkdir -p $(DESTDIR)$(bindir)
+ -mkdir -p $(DESTDIR)$(libdir)
+ -mkdir -p $(DESTDIR)$(gsincludedir)
+ $(INSTALL_PROGRAM) $(XPSSOC) $(DESTDIR)$(bindir)/$(XPSSOC_XENAME)
+ $(INSTALL_PROGRAM) $(BINDIR)/$(XPS_SONAME_MAJOR_MINOR) $(DESTDIR)$(libdir)/$(XPS_SONAME_MAJOR_MINOR)
+ $(RM_) $(DESTDIR)$(libdir)/$(XPS_SONAME)
+ ln -s $(XPS_SONAME_MAJOR_MINOR) $(DESTDIR)$(libdir)/$(XPS_SONAME)
+ $(RM_) $(DESTDIR)$(libdir)/$(XPS_SONAME_MAJOR)
+ ln -s $(XPS_SONAME_MAJOR_MINOR) $(DESTDIR)$(libdir)/$(XPS_SONAME_MAJOR)
+ $(INSTALL_DATA) $(PLSRC)plapi.h $(DESTDIR)$(gsincludedir)plapi.h
+ $(INSTALL_DATA) $(GLSRC)gserrors.h $(DESTDIR)$(gsincludedir)gserrors.h
+ $(INSTALL_DATA) $(DEVSRC)gdevdsp.h $(DESTDIR)$(gsincludedir)gdevdsp.h
+
+install-so-subtarget-gpdl: so-subtarget
+ -mkdir -p $(DESTDIR)$(prefix)
+ -mkdir -p $(DESTDIR)$(bindir)
+ -mkdir -p $(DESTDIR)$(libdir)
+ -mkdir -p $(DESTDIR)$(gsincludedir)
+ $(INSTALL_PROGRAM) $(GPDLSOC) $(DESTDIR)$(bindir)/$(GPDLSOC_XENAME)
+ $(INSTALL_PROGRAM) $(BINDIR)/$(GPDL_SONAME_MAJOR_MINOR) $(DESTDIR)$(libdir)/$(GPDL_SONAME_MAJOR_MINOR)
+ $(RM_) $(DESTDIR)$(libdir)/$(GPDL_SONAME)
+ ln -s $(GPDL_SONAME_MAJOR_MINOR) $(DESTDIR)$(libdir)/$(GPDL_SONAME)
+ $(RM_) $(DESTDIR)$(libdir)/$(GPDL_SONAME_MAJOR)
+ ln -s $(GPDL_SONAME_MAJOR_MINOR) $(DESTDIR)$(libdir)/$(GPDL_SONAME_MAJOR)
+ $(INSTALL_DATA) $(PLSRC)plapi.h $(DESTDIR)$(gsincludedir)plapi.h
+ $(INSTALL_DATA) $(GLSRC)gserrors.h $(DESTDIR)$(gsincludedir)gserrors.h
+ $(INSTALL_DATA) $(DEVSRC)gdevdsp.h $(DESTDIR)$(gsincludedir)gdevdsp.h
+
soinstall:
$(MAKE) $(SUB_MAKE_OPTION) soinstall-subtarget BUILDDIRPREFIX=$(SODIRPREFIX)
diff --git a/base/unix-end.mak b/base/unix-end.mak
index 011ed2d4..d837d9ea 100644
--- a/base/unix-end.mak
+++ b/base/unix-end.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
diff --git a/base/unix-gcc.mak b/base/unix-gcc.mak
index 39685d2a..c8bc0659 100644
--- a/base/unix-gcc.mak
+++ b/base/unix-gcc.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -265,15 +265,6 @@ SHARE_JBIG2=0
JBIG2SRCDIR=./jbig2dec
JBIG2_CFLAGS=-DHAVE_STDINT_H=1
-# uncomment the following three lines and one of the last two to
-# compile in the Luratech ldf_jb2 codec
-#JBIG2_LIB=luratech
-#SHARE_JBIG2=0
-#JBIG2SRCDIR=ldf_jb2
-#JBIG2_CFLAGS=-DUSE_LDF_JB2 -DLINUX
-#JBIG2_CFLAGS=-DUSE_LDF_JB2 -DMAC -DMAC_OS_X_BUILD
-
-
# Choose the library to use for (JPXDecode support)
# whether to link to an external build or compile in from source
# and source location and configuration flags for compiling in
@@ -282,14 +273,6 @@ SHARE_JPX=0
JPXSRCDIR=./openjpeg
JPX_CFLAGS= -DUSE_JPIP -DUSE_OPENJPEG_JP2 -DOPJ_HAVE_STDINT_H=1 -DOPJ_HAVE_INTTYPES_H=1 -DOPJ_HAVE_FSEEKO=1
-# uncomment the following three lines and one of the last two to
-# compile in the Luratech lwf_jp2 codec
-#JPX_LIB=luratech
-#SHARE_JPX=0
-#JPXSRCDIR=lwf_jp2
-#JPX_CFLAGS=-DUSE_LWF_JP2 -DLINUX
-#JPX_CFLAGS=-DUSE_LWF_JP2 -DMAC -DMAC_OS_X_BUILD
-
# Uncomment the following 4 lines to to compile in OpenJPEG codec
#JPX_LIB=openjpeg
#SHARE_JPX=0
@@ -663,8 +646,6 @@ include $(GLSRCDIR)/zlib.mak
include $(GLSRCDIR)/png.mak
include $(GLSRCDIR)/tiff.mak
include $(GLSRCDIR)/jbig2.mak
-include $(GLSRCDIR)/ldf_jb2.mak
-include $(GLSRCDIR)/lwf_jp2.mak
include $(GLSRCDIR)/openjpeg.mak
include $(GLSRCDIR)/cal.mak
include $(GLSRCDIR)/ocr.mak
diff --git a/base/unixansi.mak b/base/unixansi.mak
index 093e617e..d8e11380 100644
--- a/base/unixansi.mak
+++ b/base/unixansi.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
diff --git a/base/unixhead.mak b/base/unixhead.mak
index adb430f1..adc94350 100644
--- a/base/unixhead.mak
+++ b/base/unixhead.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
diff --git a/base/unixinst.mak b/base/unixinst.mak
index 74bff55d..24483c93 100644
--- a/base/unixinst.mak
+++ b/base/unixinst.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -83,7 +83,7 @@ install-data: install-libdata install-resdata$(COMPILE_INITS) install-iccdata$(C
# There's no point in providing a complete dependency list: we include
# one file from each subdirectory just as a sanity check.
-install-libdata:
+install-libdata:
-mkdir -p $(DESTDIR)$(datadir)
-mkdir -p $(DESTDIR)$(gsdir)
-mkdir -p $(DESTDIR)$(gsdatadir)
@@ -117,7 +117,7 @@ pdf2dsc.ps ;\
# install the default resource files
# copy in every category (directory) but CVS
-RES_CATEGORIES=`ls $(PSRESDIR) | grep -v CVS`
+RES_CATEGORIES=`ls $(PSRESDIR) | grep -v CVS`
install-resdata0 : $(PSRESDIR)/Decoding/Unicode
-mkdir -p $(DESTDIR)$(datadir)
-mkdir -p $(DESTDIR)$(gsdir)
diff --git a/base/unixlink.mak b/base/unixlink.mak
index 3f11e3a3..4c65229e 100644
--- a/base/unixlink.mak
+++ b/base/unixlink.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
diff --git a/base/valgrind.h b/base/valgrind.h
index 387e4855..0dc7d859 100644
--- a/base/valgrind.h
+++ b/base/valgrind.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/version.mak b/base/version.mak
index f2198432..88ea1634 100644
--- a/base/version.mak
+++ b/base/version.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -14,10 +14,10 @@
# Major, minor and patch version numbers.
GS_VERSION_MAJOR=9
-GS_VERSION_MINOR=53
-GS_VERSION_PATCH=1
+GS_VERSION_MINOR=54
+GS_VERSION_PATCH=0
# Revision date: year x 10000 + month x 100 + day.
-GS_REVISIONDATE=20200914
+GS_REVISIONDATE=20210330
# Derived values
GS_VERSION=$(GS_VERSION_MAJOR)$(GS_VERSION_MINOR)$(GS_VERSION_PATCH)
GS_DOT_VERSION=$(GS_VERSION_MAJOR).$(GS_VERSION_MINOR).$(GS_VERSION_PATCH)
diff --git a/base/vms_x_fix.h b/base/vms_x_fix.h
index 2cacff54..472b5cb6 100644
--- a/base/vms_x_fix.h
+++ b/base/vms_x_fix.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/vmsmath.h b/base/vmsmath.h
index a8744d49..fea5d783 100644
--- a/base/vmsmath.h
+++ b/base/vmsmath.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/windows_.h b/base/windows_.h
index c1f25578..5655b48c 100644
--- a/base/windows_.h
+++ b/base/windows_.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/winlib.mak b/base/winlib.mak
index ece84f2d..5664a61b 100644
--- a/base/winlib.mak
+++ b/base/winlib.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -44,14 +44,14 @@ SHARE_LCUPS=0
LCUPS_NAME=
LCUPSSRCDIR=cups
LCUPSBUILDTYPE=win
-CUPS_CC=$(CC) $(CFLAGS) -DWIN32
+CUPS_CC=$(CC) $(CFLAGS) -DWIN32
!endif
!ifndef LCUPSISRCDIR
SHARE_LCUPSI=0
LCUPSI_NAME=
LCUPSISRCDIR=cups
-CUPS_CC=$(CC) $(CFLAGS) -DWIN32
+CUPS_CC=$(CC) $(CFLAGS) -DWIN32
!endif
# Define the platform name.
@@ -64,7 +64,7 @@ GSPLATFORM=mswin32_
!endif
!endif
-# Define the auxiliary program dependency. We use this to
+# Define the auxiliary program dependency. We use this to
# preconstruct ccf32.tr to get around the limit on the maximum
# length of a command line.
@@ -152,8 +152,6 @@ BEGINFILES=$(GLGENDIR)\ccf32.tr\
!include $(GLSRCDIR)\png.mak
!include $(GLSRCDIR)\tiff.mak
!include $(GLSRCDIR)\jbig2.mak
-!include $(GLSRCDIR)\ldf_jb2.mak
-!include $(GLSRCDIR)\lwf_jp2.mak
!include $(GLSRCDIR)\openjpeg.mak
!include $(GLSRCDIR)\cal.mak
!include $(GLSRCDIR)\ocr.mak
@@ -165,6 +163,7 @@ BEGINFILES=$(GLGENDIR)\ccf32.tr\
!include $(GLSRCDIR)\ijs.mak
!include $(GLSRCDIR)\lcups.mak
!include $(GLSRCDIR)\lcupsi.mak
+!include $(DEVSRCDIR)\extract.mak
!include $(DEVSRCDIR)\devs.mak
!include $(DEVSRCDIR)\dcontrib.mak
!include $(CONTRIBDIR)\contrib.mak
diff --git a/base/winplat.mak b/base/winplat.mak
index 4c42a53b..b53a5ec7 100644
--- a/base/winplat.mak
+++ b/base/winplat.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -34,7 +34,7 @@ $(GLD)winplat1.dev : $(WINPLAT_MAK) $(ECHOGS_XE) $(winplatxpsprint_) $(WINPLAT_M
$(SETMOD) $(GLD)winplat1 $(winplatxpsprint_)
$(GLD)winplat.dev : $(GLD)winplat$(XPSPRINT).dev
- $(CP_) $(GLD)winplat$(XPSPRINT).dev $(GLD)winplat.dev
+ $(CP_) $(GLD)winplat$(XPSPRINT).dev $(GLD)winplat.dev
$(GLOBJ)gp_ntfs.$(OBJ): $(GLSRC)gp_ntfs.c $(AK)\
$(dos__h) $(memory__h) $(stdio__h) $(string__h) $(windows__h)\
diff --git a/base/winrtsup.cpp b/base/winrtsup.cpp
index c5104e52..ee22891d 100644
--- a/base/winrtsup.cpp
+++ b/base/winrtsup.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/winrtsup.h b/base/winrtsup.h
index 80a3169f..c3ee6ea0 100644
--- a/base/winrtsup.h
+++ b/base/winrtsup.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/wrfont.c b/base/wrfont.c
index d117e75a..6be5d0da 100644
--- a/base/wrfont.c
+++ b/base/wrfont.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/wrfont.h b/base/wrfont.h
index d8c2a06c..d1503a85 100644
--- a/base/wrfont.h
+++ b/base/wrfont.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/write_t1.c b/base/write_t1.c
index ae0d6eea..52902bea 100644
--- a/base/write_t1.c
+++ b/base/write_t1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/write_t1.h b/base/write_t1.h
index 0b16c387..c6fc5a3c 100644
--- a/base/write_t1.h
+++ b/base/write_t1.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/write_t2.c b/base/write_t2.c
index 9cf3883c..e56423d4 100644
--- a/base/write_t2.c
+++ b/base/write_t2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -332,16 +332,15 @@ write_gsubrs_index(gs_fapi_font * a_fapi_font, WRF_output * a_output)
for (i = 0; i < count; i++) {
long buffer_size = a_output->m_limit - a_output->m_count < 0 ? 0 : a_output->m_limit - a_output->m_count;
- int length = a_fapi_font->get_gsubr(a_fapi_font, i, a_output->m_pos,
- (ushort) (buffer_size > 65535 ? 65535 : buffer_size));
+ int length = a_fapi_font->get_gsubr(a_fapi_font, i, a_output->m_pos, buffer_size);
if (length < 0)
return length;
if (a_output->m_pos)
- WRF_wtext(a_fapi_font->memory, a_output, a_output->m_pos, length);
- else
- a_output->m_count += length;
+ a_output->m_pos += length;
+
+ a_output->m_count += length;
if (cur_offset) {
long pos = a_output->m_pos - data_start + 1;
@@ -387,16 +386,15 @@ write_subrs_index(gs_fapi_font * a_fapi_font, WRF_output * a_output)
for (i = 0; i < count; i++) {
long buffer_size = a_output->m_limit - a_output->m_count;
- int length = a_fapi_font->get_subr(a_fapi_font, i, a_output->m_pos,
- (ushort) buffer_size);
+ int length = a_fapi_font->get_subr(a_fapi_font, i, a_output->m_pos, buffer_size);
if (length < 0)
return length;
if (a_output->m_pos)
- WRF_wtext(a_fapi_font->memory, a_output, a_output->m_pos, length);
- else
- a_output->m_count += length;
+ a_output->m_pos += length;
+
+ a_output->m_count += length;
if (cur_offset) {
long pos = a_output->m_pos - data_start + 1;
diff --git a/base/write_t2.h b/base/write_t2.h
index d3e4a30a..6c4d5a61 100644
--- a/base/write_t2.h
+++ b/base/write_t2.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/x_.h b/base/x_.h
index 4d02d7a0..7ced6046 100644
--- a/base/x_.h
+++ b/base/x_.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/zlib.mak b/base/zlib.mak
index f697fdcc..5e66f922 100644
--- a/base/zlib.mak
+++ b/base/zlib.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -53,9 +53,10 @@ ZAO_=$(O_)$(ZAUX)
# syntax from other compilers.
# ZI_ and ZF_ are defined in gs.mak.
ZCCFLAGS=$(ZLIB_CFLAGS) $(I_)$(ZI_)$(_I) $(ZF_) $(D_)verbose$(_D_)-1$(_D)
-ZCC=$(CC_) $(ZCCFLAGS)
+ZCC=$(CC) $(ZCCFLAGS) $(CCFLAGS)
+
ZCCAUXFLAGS=$(ZLIB_CFLAGS) $(I_)$(ZI_)$(_I) $(ZF_) $(D_)verbose$(_D_)-1$(_D)
-ZCCAUX=$(CCAUX_) $(ZCCAUXFLAGS)
+ZCCAUX=$(CCAUX) $(ZCCAUXFLAGS) $(CCFLAGSAUX)
# Define the name of this makefile.
ZLIB_MAK=$(GLSRC)zlib.mak $(TOP_MAKEFILES)