pdf2json 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +9 -0
- data/bin/.gitkeep +0 -0
- data/ext/extconf.rb +30 -0
- data/lib/pdf2json.rb +8 -0
- data/pdf2json-0.52-source/AUTHORS +24 -0
- data/pdf2json-0.52-source/CHANGES +11 -0
- data/pdf2json-0.52-source/Makefile +84 -0
- data/pdf2json-0.52-source/Makefile.in +84 -0
- data/pdf2json-0.52-source/aclocal.m4 +274 -0
- data/pdf2json-0.52-source/aconf-win32.h +86 -0
- data/pdf2json-0.52-source/aconf.h +42 -0
- data/pdf2json-0.52-source/aconf.h.in +41 -0
- data/pdf2json-0.52-source/autom4te.cache/output.0 +6908 -0
- data/pdf2json-0.52-source/autom4te.cache/requests +76 -0
- data/pdf2json-0.52-source/autom4te.cache/traces.0 +466 -0
- data/pdf2json-0.52-source/config.log +1259 -0
- data/pdf2json-0.52-source/config.status +1050 -0
- data/pdf2json-0.52-source/configure +6908 -0
- data/pdf2json-0.52-source/configure.ac +93 -0
- data/pdf2json-0.52-source/doc/pdffonts.1 +130 -0
- data/pdf2json-0.52-source/doc/pdffonts.cat +107 -0
- data/pdf2json-0.52-source/doc/pdffonts.hlp +117 -0
- data/pdf2json-0.52-source/doc/pdfimages.1 +102 -0
- data/pdf2json-0.52-source/doc/pdfimages.cat +92 -0
- data/pdf2json-0.52-source/doc/pdfimages.hlp +101 -0
- data/pdf2json-0.52-source/doc/pdfinfo.1 +158 -0
- data/pdf2json-0.52-source/doc/pdfinfo.cat +119 -0
- data/pdf2json-0.52-source/doc/pdfinfo.hlp +129 -0
- data/pdf2json-0.52-source/doc/pdftoppm.1 +115 -0
- data/pdf2json-0.52-source/doc/pdftoppm.cat +105 -0
- data/pdf2json-0.52-source/doc/pdftoppm.hlp +114 -0
- data/pdf2json-0.52-source/doc/pdftops.1 +229 -0
- data/pdf2json-0.52-source/doc/pdftops.cat +221 -0
- data/pdf2json-0.52-source/doc/pdftops.hlp +231 -0
- data/pdf2json-0.52-source/doc/pdftotext.1 +137 -0
- data/pdf2json-0.52-source/doc/pdftotext.cat +120 -0
- data/pdf2json-0.52-source/doc/pdftotext.hlp +133 -0
- data/pdf2json-0.52-source/doc/sample-xpdfrc +91 -0
- data/pdf2json-0.52-source/doc/xpdf.1 +513 -0
- data/pdf2json-0.52-source/doc/xpdf.cat +476 -0
- data/pdf2json-0.52-source/doc/xpdf.hlp +489 -0
- data/pdf2json-0.52-source/doc/xpdfrc.5 +480 -0
- data/pdf2json-0.52-source/doc/xpdfrc.cat +474 -0
- data/pdf2json-0.52-source/doc/xpdfrc.hlp +479 -0
- data/pdf2json-0.52-source/fofi/.DS_Store +0 -0
- data/pdf2json-0.52-source/fofi/FoFiBase.cc +156 -0
- data/pdf2json-0.52-source/fofi/FoFiBase.h +57 -0
- data/pdf2json-0.52-source/fofi/FoFiBase.o +0 -0
- data/pdf2json-0.52-source/fofi/FoFiEncodings.cc +994 -0
- data/pdf2json-0.52-source/fofi/FoFiEncodings.h +36 -0
- data/pdf2json-0.52-source/fofi/FoFiEncodings.o +0 -0
- data/pdf2json-0.52-source/fofi/FoFiTrueType.cc +2027 -0
- data/pdf2json-0.52-source/fofi/FoFiTrueType.h +174 -0
- data/pdf2json-0.52-source/fofi/FoFiTrueType.o +0 -0
- data/pdf2json-0.52-source/fofi/FoFiType1.cc +252 -0
- data/pdf2json-0.52-source/fofi/FoFiType1.h +59 -0
- data/pdf2json-0.52-source/fofi/FoFiType1.o +0 -0
- data/pdf2json-0.52-source/fofi/FoFiType1C.cc +2603 -0
- data/pdf2json-0.52-source/fofi/FoFiType1C.h +233 -0
- data/pdf2json-0.52-source/fofi/FoFiType1C.o +0 -0
- data/pdf2json-0.52-source/fofi/Makefile +70 -0
- data/pdf2json-0.52-source/fofi/Makefile.dep +0 -0
- data/pdf2json-0.52-source/fofi/Makefile.in +70 -0
- data/pdf2json-0.52-source/fofi/libfofi.a +0 -0
- data/pdf2json-0.52-source/fofi/vms_make.com +0 -0
- data/pdf2json-0.52-source/freetype.win32/.DS_Store +0 -0
- data/pdf2json-0.52-source/freetype.win32/include/.DS_Store +0 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/config/ftconfig.h +528 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/config/ftheader.h +780 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/config/ftmodule.h +32 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/config/ftoption.h +733 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/config/ftstdlib.h +173 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/freetype.h +3919 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftadvanc.h +179 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftbbox.h +94 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftbdf.h +209 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftbitmap.h +227 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftcache.h +1128 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftchapters.h +103 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftcid.h +166 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/fterrdef.h +244 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/fterrors.h +206 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftgasp.h +120 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftglyph.h +613 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftgxval.h +358 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftgzip.h +102 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftimage.h +1313 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftincrem.h +353 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftlcdfil.h +213 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftlist.h +277 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftlzw.h +99 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftmac.h +274 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftmm.h +378 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftmodapi.h +483 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftmoderr.h +155 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftotval.h +203 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftoutln.h +537 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftpfr.h +172 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftrender.h +230 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftsizes.h +159 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftsnames.h +200 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftstroke.h +716 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftsynth.h +80 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftsystem.h +347 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/fttrigon.h +350 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/fttypes.h +588 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftwinfnt.h +274 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftxf86.h +83 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/autohint.h +231 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/ftcalc.h +179 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/ftdebug.h +250 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/ftdriver.h +422 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/ftgloadr.h +168 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/ftmemory.h +380 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/ftobjs.h +1428 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/ftpic.h +67 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/ftrfork.h +196 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/ftserv.h +620 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/ftstream.h +539 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/fttrace.h +139 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/ftvalid.h +150 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/internal.h +51 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/pcftypes.h +56 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/psaux.h +873 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/pshints.h +712 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svbdf.h +77 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svcid.h +83 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svgldict.h +82 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svgxval.h +72 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svkern.h +51 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svmm.h +104 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svotval.h +55 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svpfr.h +66 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svpostnm.h +79 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svpscmap.h +164 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svpsinfo.h +92 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svsfnt.h +102 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svttcmap.h +106 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svtteng.h +53 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svttglyf.h +67 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svwinfnt.h +50 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svxf86nm.h +55 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/sfnt.h +897 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/t1types.h +270 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/tttypes.h +1543 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/t1tables.h +504 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ttnameid.h +1247 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/tttables.h +759 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/tttags.h +107 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ttunpat.h +59 -0
- data/pdf2json-0.52-source/freetype.win32/include/ft2build.h +39 -0
- data/pdf2json-0.52-source/freetype.win32/lib/freetype_a.lib +0 -0
- data/pdf2json-0.52-source/goo/.DS_Store +0 -0
- data/pdf2json-0.52-source/goo/FixedPoint.cc +118 -0
- data/pdf2json-0.52-source/goo/FixedPoint.h +155 -0
- data/pdf2json-0.52-source/goo/FixedPoint.o +0 -0
- data/pdf2json-0.52-source/goo/GHash.cc +380 -0
- data/pdf2json-0.52-source/goo/GHash.h +78 -0
- data/pdf2json-0.52-source/goo/GHash.o +0 -0
- data/pdf2json-0.52-source/goo/GList.cc +97 -0
- data/pdf2json-0.52-source/goo/GList.h +96 -0
- data/pdf2json-0.52-source/goo/GList.o +0 -0
- data/pdf2json-0.52-source/goo/GMutex.h +49 -0
- data/pdf2json-0.52-source/goo/GString.cc +724 -0
- data/pdf2json-0.52-source/goo/GString.cc.fixed +718 -0
- data/pdf2json-0.52-source/goo/GString.h +136 -0
- data/pdf2json-0.52-source/goo/GString.o +0 -0
- data/pdf2json-0.52-source/goo/ImgWriter.o +0 -0
- data/pdf2json-0.52-source/goo/JpegWriter.o +0 -0
- data/pdf2json-0.52-source/goo/Makefile +72 -0
- data/pdf2json-0.52-source/goo/Makefile.dep +0 -0
- data/pdf2json-0.52-source/goo/Makefile.in +72 -0
- data/pdf2json-0.52-source/goo/PNGWriter.o +0 -0
- data/pdf2json-0.52-source/goo/gfile.cc +731 -0
- data/pdf2json-0.52-source/goo/gfile.h +138 -0
- data/pdf2json-0.52-source/goo/gfile.o +0 -0
- data/pdf2json-0.52-source/goo/gmem.cc +264 -0
- data/pdf2json-0.52-source/goo/gmem.h +79 -0
- data/pdf2json-0.52-source/goo/gmem.o +0 -0
- data/pdf2json-0.52-source/goo/gmempp.cc +32 -0
- data/pdf2json-0.52-source/goo/gmempp.o +0 -0
- data/pdf2json-0.52-source/goo/gtypes.h +29 -0
- data/pdf2json-0.52-source/goo/libGoo.a +0 -0
- data/pdf2json-0.52-source/goo/parseargs.c +190 -0
- data/pdf2json-0.52-source/goo/parseargs.h +71 -0
- data/pdf2json-0.52-source/goo/parseargs.o +0 -0
- data/pdf2json-0.52-source/goo/vms_directory.c +214 -0
- data/pdf2json-0.52-source/goo/vms_dirent.h +67 -0
- data/pdf2json-0.52-source/goo/vms_make.com +82 -0
- data/pdf2json-0.52-source/goo/vms_sys_dirent.h +54 -0
- data/pdf2json-0.52-source/goo/vms_unix_time.h +102 -0
- data/pdf2json-0.52-source/goo/vms_unix_times.c +42 -0
- data/pdf2json-0.52-source/goo/vms_unlink.c +22 -0
- data/pdf2json-0.52-source/ms_make.bat +199 -0
- data/pdf2json-0.52-source/splash/.DS_Store +0 -0
- data/pdf2json-0.52-source/splash/Makefile +103 -0
- data/pdf2json-0.52-source/splash/Makefile.dep +0 -0
- data/pdf2json-0.52-source/splash/Makefile.in +103 -0
- data/pdf2json-0.52-source/splash/Splash.cc +3310 -0
- data/pdf2json-0.52-source/splash/Splash.h +293 -0
- data/pdf2json-0.52-source/splash/Splash.o +0 -0
- data/pdf2json-0.52-source/splash/SplashBitmap.cc +188 -0
- data/pdf2json-0.52-source/splash/SplashBitmap.h +64 -0
- data/pdf2json-0.52-source/splash/SplashBitmap.o +0 -0
- data/pdf2json-0.52-source/splash/SplashClip.cc +382 -0
- data/pdf2json-0.52-source/splash/SplashClip.h +107 -0
- data/pdf2json-0.52-source/splash/SplashClip.o +0 -0
- data/pdf2json-0.52-source/splash/SplashErrorCodes.h +32 -0
- data/pdf2json-0.52-source/splash/SplashFTFont.cc +357 -0
- data/pdf2json-0.52-source/splash/SplashFTFont.h +58 -0
- data/pdf2json-0.52-source/splash/SplashFTFont.o +0 -0
- data/pdf2json-0.52-source/splash/SplashFTFontEngine.cc +179 -0
- data/pdf2json-0.52-source/splash/SplashFTFontEngine.h +65 -0
- data/pdf2json-0.52-source/splash/SplashFTFontEngine.o +0 -0
- data/pdf2json-0.52-source/splash/SplashFTFontFile.cc +114 -0
- data/pdf2json-0.52-source/splash/SplashFTFontFile.h +73 -0
- data/pdf2json-0.52-source/splash/SplashFTFontFile.o +0 -0
- data/pdf2json-0.52-source/splash/SplashFont.cc +176 -0
- data/pdf2json-0.52-source/splash/SplashFont.h +104 -0
- data/pdf2json-0.52-source/splash/SplashFont.o +0 -0
- data/pdf2json-0.52-source/splash/SplashFontEngine.cc +317 -0
- data/pdf2json-0.52-source/splash/SplashFontEngine.h +91 -0
- data/pdf2json-0.52-source/splash/SplashFontEngine.o +0 -0
- data/pdf2json-0.52-source/splash/SplashFontFile.cc +55 -0
- data/pdf2json-0.52-source/splash/SplashFontFile.h +60 -0
- data/pdf2json-0.52-source/splash/SplashFontFile.o +0 -0
- data/pdf2json-0.52-source/splash/SplashFontFileID.cc +23 -0
- data/pdf2json-0.52-source/splash/SplashFontFileID.h +30 -0
- data/pdf2json-0.52-source/splash/SplashFontFileID.o +0 -0
- data/pdf2json-0.52-source/splash/SplashGlyphBitmap.h +26 -0
- data/pdf2json-0.52-source/splash/SplashMath.h +89 -0
- data/pdf2json-0.52-source/splash/SplashPath.cc +184 -0
- data/pdf2json-0.52-source/splash/SplashPath.h +121 -0
- data/pdf2json-0.52-source/splash/SplashPath.o +0 -0
- data/pdf2json-0.52-source/splash/SplashPattern.cc +40 -0
- data/pdf2json-0.52-source/splash/SplashPattern.h +65 -0
- data/pdf2json-0.52-source/splash/SplashPattern.o +0 -0
- data/pdf2json-0.52-source/splash/SplashScreen.cc +383 -0
- data/pdf2json-0.52-source/splash/SplashScreen.h +56 -0
- data/pdf2json-0.52-source/splash/SplashScreen.o +0 -0
- data/pdf2json-0.52-source/splash/SplashState.cc +165 -0
- data/pdf2json-0.52-source/splash/SplashState.h +103 -0
- data/pdf2json-0.52-source/splash/SplashState.o +0 -0
- data/pdf2json-0.52-source/splash/SplashT1Font.cc +287 -0
- data/pdf2json-0.52-source/splash/SplashT1Font.h +57 -0
- data/pdf2json-0.52-source/splash/SplashT1Font.o +0 -0
- data/pdf2json-0.52-source/splash/SplashT1FontEngine.cc +124 -0
- data/pdf2json-0.52-source/splash/SplashT1FontEngine.h +53 -0
- data/pdf2json-0.52-source/splash/SplashT1FontEngine.o +0 -0
- data/pdf2json-0.52-source/splash/SplashT1FontFile.cc +97 -0
- data/pdf2json-0.52-source/splash/SplashT1FontFile.h +58 -0
- data/pdf2json-0.52-source/splash/SplashT1FontFile.o +0 -0
- data/pdf2json-0.52-source/splash/SplashTypes.h +132 -0
- data/pdf2json-0.52-source/splash/SplashXPath.cc +438 -0
- data/pdf2json-0.52-source/splash/SplashXPath.h +100 -0
- data/pdf2json-0.52-source/splash/SplashXPath.o +0 -0
- data/pdf2json-0.52-source/splash/SplashXPathScanner.cc +428 -0
- data/pdf2json-0.52-source/splash/SplashXPathScanner.h +87 -0
- data/pdf2json-0.52-source/splash/SplashXPathScanner.o +0 -0
- data/pdf2json-0.52-source/splash/libsplash.a +0 -0
- data/pdf2json-0.52-source/splash/vms_make.com +0 -0
- data/pdf2json-0.52-source/src/.DS_Store +0 -0
- data/pdf2json-0.52-source/src/GVector.h +101 -0
- data/pdf2json-0.52-source/src/ImgOutputDev.cc +1243 -0
- data/pdf2json-0.52-source/src/ImgOutputDev.h +307 -0
- data/pdf2json-0.52-source/src/ImgOutputDev.o +0 -0
- data/pdf2json-0.52-source/src/Makefile +68 -0
- data/pdf2json-0.52-source/src/Makefile.in +68 -0
- data/pdf2json-0.52-source/src/XmlFonts.cc +367 -0
- data/pdf2json-0.52-source/src/XmlFonts.h +91 -0
- data/pdf2json-0.52-source/src/XmlFonts.o +0 -0
- data/pdf2json-0.52-source/src/XmlLinks.cc +101 -0
- data/pdf2json-0.52-source/src/XmlLinks.h +54 -0
- data/pdf2json-0.52-source/src/XmlLinks.o +0 -0
- data/pdf2json-0.52-source/src/pdf2json +0 -0
- data/pdf2json-0.52-source/src/pdf2json.cc +343 -0
- data/pdf2json-0.52-source/src/pdf2json.o +0 -0
- data/pdf2json-0.52-source/src/pdf2xml.dtd +22 -0
- data/pdf2json-0.52-source/src/pdf2xmljson.dtd +9 -0
- data/pdf2json-0.52-source/xpdf/.DS_Store +0 -0
- data/pdf2json-0.52-source/xpdf/Annot.cc +1556 -0
- data/pdf2json-0.52-source/xpdf/Annot.h +142 -0
- data/pdf2json-0.52-source/xpdf/Annot.o +0 -0
- data/pdf2json-0.52-source/xpdf/Array.cc +73 -0
- data/pdf2json-0.52-source/xpdf/Array.h +58 -0
- data/pdf2json-0.52-source/xpdf/Array.o +0 -0
- data/pdf2json-0.52-source/xpdf/BuiltinFont.cc +65 -0
- data/pdf2json-0.52-source/xpdf/BuiltinFont.h +57 -0
- data/pdf2json-0.52-source/xpdf/BuiltinFont.o +0 -0
- data/pdf2json-0.52-source/xpdf/BuiltinFontTables.cc +4284 -0
- data/pdf2json-0.52-source/xpdf/BuiltinFontTables.h +23 -0
- data/pdf2json-0.52-source/xpdf/BuiltinFontTables.o +0 -0
- data/pdf2json-0.52-source/xpdf/CMap.cc +408 -0
- data/pdf2json-0.52-source/xpdf/CMap.h +102 -0
- data/pdf2json-0.52-source/xpdf/CMap.o +0 -0
- data/pdf2json-0.52-source/xpdf/Catalog.cc +374 -0
- data/pdf2json-0.52-source/xpdf/Catalog.h +97 -0
- data/pdf2json-0.52-source/xpdf/Catalog.o +0 -0
- data/pdf2json-0.52-source/xpdf/CharCodeToUnicode.cc +540 -0
- data/pdf2json-0.52-source/xpdf/CharCodeToUnicode.h +117 -0
- data/pdf2json-0.52-source/xpdf/CharCodeToUnicode.o +0 -0
- data/pdf2json-0.52-source/xpdf/CharTypes.h +24 -0
- data/pdf2json-0.52-source/xpdf/CompactFontTables.h +464 -0
- data/pdf2json-0.52-source/xpdf/CoreOutputDev.cc +61 -0
- data/pdf2json-0.52-source/xpdf/CoreOutputDev.h +61 -0
- data/pdf2json-0.52-source/xpdf/Decrypt.cc +776 -0
- data/pdf2json-0.52-source/xpdf/Decrypt.h +95 -0
- data/pdf2json-0.52-source/xpdf/Decrypt.o +0 -0
- data/pdf2json-0.52-source/xpdf/Dict.cc +95 -0
- data/pdf2json-0.52-source/xpdf/Dict.h +77 -0
- data/pdf2json-0.52-source/xpdf/Dict.o +0 -0
- data/pdf2json-0.52-source/xpdf/Error.cc +38 -0
- data/pdf2json-0.52-source/xpdf/Error.h +23 -0
- data/pdf2json-0.52-source/xpdf/Error.o +0 -0
- data/pdf2json-0.52-source/xpdf/ErrorCodes.h +36 -0
- data/pdf2json-0.52-source/xpdf/FontEncodingTables.cc +1824 -0
- data/pdf2json-0.52-source/xpdf/FontEncodingTables.h +20 -0
- data/pdf2json-0.52-source/xpdf/FontEncodingTables.o +0 -0
- data/pdf2json-0.52-source/xpdf/Function.cc +1573 -0
- data/pdf2json-0.52-source/xpdf/Function.h +229 -0
- data/pdf2json-0.52-source/xpdf/Function.o +0 -0
- data/pdf2json-0.52-source/xpdf/Gfx.cc +4187 -0
- data/pdf2json-0.52-source/xpdf/Gfx.h +312 -0
- data/pdf2json-0.52-source/xpdf/Gfx.o +0 -0
- data/pdf2json-0.52-source/xpdf/GfxFont.cc +1568 -0
- data/pdf2json-0.52-source/xpdf/GfxFont.h +320 -0
- data/pdf2json-0.52-source/xpdf/GfxFont.o +0 -0
- data/pdf2json-0.52-source/xpdf/GfxState.cc +4137 -0
- data/pdf2json-0.52-source/xpdf/GfxState.h +1244 -0
- data/pdf2json-0.52-source/xpdf/GfxState.o +0 -0
- data/pdf2json-0.52-source/xpdf/GlobalParams.cc +2924 -0
- data/pdf2json-0.52-source/xpdf/GlobalParams.cc.old +2908 -0
- data/pdf2json-0.52-source/xpdf/GlobalParams.h +466 -0
- data/pdf2json-0.52-source/xpdf/GlobalParams.h.old +463 -0
- data/pdf2json-0.52-source/xpdf/GlobalParams.o +0 -0
- data/pdf2json-0.52-source/xpdf/ImageOutputDev.cc +195 -0
- data/pdf2json-0.52-source/xpdf/ImageOutputDev.h +76 -0
- data/pdf2json-0.52-source/xpdf/ImageOutputDev.o +0 -0
- data/pdf2json-0.52-source/xpdf/JArithmeticDecoder.cc +322 -0
- data/pdf2json-0.52-source/xpdf/JArithmeticDecoder.h +109 -0
- data/pdf2json-0.52-source/xpdf/JArithmeticDecoder.o +0 -0
- data/pdf2json-0.52-source/xpdf/JBIG2Stream.cc +3413 -0
- data/pdf2json-0.52-source/xpdf/JBIG2Stream.h +145 -0
- data/pdf2json-0.52-source/xpdf/JBIG2Stream.o +0 -0
- data/pdf2json-0.52-source/xpdf/JPXStream.cc +3144 -0
- data/pdf2json-0.52-source/xpdf/JPXStream.h +351 -0
- data/pdf2json-0.52-source/xpdf/JPXStream.o +0 -0
- data/pdf2json-0.52-source/xpdf/Lexer.cc +485 -0
- data/pdf2json-0.52-source/xpdf/Lexer.h +80 -0
- data/pdf2json-0.52-source/xpdf/Lexer.o +0 -0
- data/pdf2json-0.52-source/xpdf/Link.cc +806 -0
- data/pdf2json-0.52-source/xpdf/Link.cc.old +784 -0
- data/pdf2json-0.52-source/xpdf/Link.h +415 -0
- data/pdf2json-0.52-source/xpdf/Link.h.old +369 -0
- data/pdf2json-0.52-source/xpdf/Link.o +0 -0
- data/pdf2json-0.52-source/xpdf/Makefile +232 -0
- data/pdf2json-0.52-source/xpdf/Makefile.dep +0 -0
- data/pdf2json-0.52-source/xpdf/Makefile.in +232 -0
- data/pdf2json-0.52-source/xpdf/NameToCharCode.cc +116 -0
- data/pdf2json-0.52-source/xpdf/NameToCharCode.h +42 -0
- data/pdf2json-0.52-source/xpdf/NameToCharCode.o +0 -0
- data/pdf2json-0.52-source/xpdf/NameToUnicodeTable.h +1097 -0
- data/pdf2json-0.52-source/xpdf/Object.cc +231 -0
- data/pdf2json-0.52-source/xpdf/Object.h +303 -0
- data/pdf2json-0.52-source/xpdf/Object.o +0 -0
- data/pdf2json-0.52-source/xpdf/Outline.cc +151 -0
- data/pdf2json-0.52-source/xpdf/Outline.h +76 -0
- data/pdf2json-0.52-source/xpdf/Outline.o +0 -0
- data/pdf2json-0.52-source/xpdf/OutputDev.cc +131 -0
- data/pdf2json-0.52-source/xpdf/OutputDev.h +253 -0
- data/pdf2json-0.52-source/xpdf/OutputDev.o +0 -0
- data/pdf2json-0.52-source/xpdf/PDFCore.cc +2044 -0
- data/pdf2json-0.52-source/xpdf/PDFCore.h +321 -0
- data/pdf2json-0.52-source/xpdf/PDFDoc.cc +404 -0
- data/pdf2json-0.52-source/xpdf/PDFDoc.h +183 -0
- data/pdf2json-0.52-source/xpdf/PDFDoc.o +0 -0
- data/pdf2json-0.52-source/xpdf/PDFDocEncoding.cc +44 -0
- data/pdf2json-0.52-source/xpdf/PDFDocEncoding.h +16 -0
- data/pdf2json-0.52-source/xpdf/PDFDocEncoding.o +0 -0
- data/pdf2json-0.52-source/xpdf/PSOutputDev.cc +6224 -0
- data/pdf2json-0.52-source/xpdf/PSOutputDev.h +395 -0
- data/pdf2json-0.52-source/xpdf/PSOutputDev.o +0 -0
- data/pdf2json-0.52-source/xpdf/PSTokenizer.cc +135 -0
- data/pdf2json-0.52-source/xpdf/PSTokenizer.h +41 -0
- data/pdf2json-0.52-source/xpdf/PSTokenizer.o +0 -0
- data/pdf2json-0.52-source/xpdf/Page.cc +454 -0
- data/pdf2json-0.52-source/xpdf/Page.h +187 -0
- data/pdf2json-0.52-source/xpdf/Page.o +0 -0
- data/pdf2json-0.52-source/xpdf/Parser.cc +227 -0
- data/pdf2json-0.52-source/xpdf/Parser.h +59 -0
- data/pdf2json-0.52-source/xpdf/Parser.o +0 -0
- data/pdf2json-0.52-source/xpdf/PreScanOutputDev.cc +257 -0
- data/pdf2json-0.52-source/xpdf/PreScanOutputDev.h +130 -0
- data/pdf2json-0.52-source/xpdf/PreScanOutputDev.o +0 -0
- data/pdf2json-0.52-source/xpdf/SecurityHandler.cc +390 -0
- data/pdf2json-0.52-source/xpdf/SecurityHandler.h +160 -0
- data/pdf2json-0.52-source/xpdf/SecurityHandler.o +0 -0
- data/pdf2json-0.52-source/xpdf/SplashOutputDev.cc +2845 -0
- data/pdf2json-0.52-source/xpdf/SplashOutputDev.h +247 -0
- data/pdf2json-0.52-source/xpdf/SplashOutputDev.o +0 -0
- data/pdf2json-0.52-source/xpdf/Stream-CCITT.h +459 -0
- data/pdf2json-0.52-source/xpdf/Stream.cc +4627 -0
- data/pdf2json-0.52-source/xpdf/Stream.h +858 -0
- data/pdf2json-0.52-source/xpdf/Stream.o +0 -0
- data/pdf2json-0.52-source/xpdf/TextOutputDev.cc +4090 -0
- data/pdf2json-0.52-source/xpdf/TextOutputDev.h +661 -0
- data/pdf2json-0.52-source/xpdf/TextOutputDev.o +0 -0
- data/pdf2json-0.52-source/xpdf/UTF8.h +56 -0
- data/pdf2json-0.52-source/xpdf/UnicodeMap.cc +302 -0
- data/pdf2json-0.52-source/xpdf/UnicodeMap.cc.old +293 -0
- data/pdf2json-0.52-source/xpdf/UnicodeMap.h +135 -0
- data/pdf2json-0.52-source/xpdf/UnicodeMap.h.old +123 -0
- data/pdf2json-0.52-source/xpdf/UnicodeMap.o +0 -0
- data/pdf2json-0.52-source/xpdf/UnicodeMapTables.h +361 -0
- data/pdf2json-0.52-source/xpdf/UnicodeTypeTable.cc +949 -0
- data/pdf2json-0.52-source/xpdf/UnicodeTypeTable.h +20 -0
- data/pdf2json-0.52-source/xpdf/UnicodeTypeTable.o +0 -0
- data/pdf2json-0.52-source/xpdf/XPDFApp.cc +447 -0
- data/pdf2json-0.52-source/xpdf/XPDFApp.h +114 -0
- data/pdf2json-0.52-source/xpdf/XPDFCore.cc +1655 -0
- data/pdf2json-0.52-source/xpdf/XPDFCore.h +251 -0
- data/pdf2json-0.52-source/xpdf/XPDFTree.cc +931 -0
- data/pdf2json-0.52-source/xpdf/XPDFTree.h +45 -0
- data/pdf2json-0.52-source/xpdf/XPDFTreeP.h +87 -0
- data/pdf2json-0.52-source/xpdf/XPDFViewer.cc +3488 -0
- data/pdf2json-0.52-source/xpdf/XPDFViewer.h +352 -0
- data/pdf2json-0.52-source/xpdf/XRef.cc +896 -0
- data/pdf2json-0.52-source/xpdf/XRef.h +133 -0
- data/pdf2json-0.52-source/xpdf/XRef.o +0 -0
- data/pdf2json-0.52-source/xpdf/XpdfPluginAPI.cc +262 -0
- data/pdf2json-0.52-source/xpdf/XpdfPluginAPI.h +341 -0
- data/pdf2json-0.52-source/xpdf/XpdfPluginAPI.o +0 -0
- data/pdf2json-0.52-source/xpdf/about-text.h +48 -0
- data/pdf2json-0.52-source/xpdf/about.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/backArrow.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/backArrowDis.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/config.h +112 -0
- data/pdf2json-0.52-source/xpdf/dblLeftArrow.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/dblLeftArrowDis.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/dblRightArrow.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/dblRightArrowDis.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/find.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/findDis.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/forwardArrow.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/forwardArrowDis.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/leftArrow.xbm +5 -0
- data/pdf2json-0.52-source/xpdf/leftArrowDis.xbm +5 -0
- data/pdf2json-0.52-source/xpdf/libXpdf.a +0 -0
- data/pdf2json-0.52-source/xpdf/pdffonts +0 -0
- data/pdf2json-0.52-source/xpdf/pdffonts.cc +298 -0
- data/pdf2json-0.52-source/xpdf/pdffonts.o +0 -0
- data/pdf2json-0.52-source/xpdf/pdfimages +0 -0
- data/pdf2json-0.52-source/xpdf/pdfimages.cc +155 -0
- data/pdf2json-0.52-source/xpdf/pdfimages.o +0 -0
- data/pdf2json-0.52-source/xpdf/pdfinfo +0 -0
- data/pdf2json-0.52-source/xpdf/pdfinfo.cc +387 -0
- data/pdf2json-0.52-source/xpdf/pdfinfo.o +0 -0
- data/pdf2json-0.52-source/xpdf/pdftoppm.cc +203 -0
- data/pdf2json-0.52-source/xpdf/pdftops +0 -0
- data/pdf2json-0.52-source/xpdf/pdftops.cc +344 -0
- data/pdf2json-0.52-source/xpdf/pdftops.o +0 -0
- data/pdf2json-0.52-source/xpdf/pdftotext +0 -0
- data/pdf2json-0.52-source/xpdf/pdftotext.cc +333 -0
- data/pdf2json-0.52-source/xpdf/pdftotext.o +0 -0
- data/pdf2json-0.52-source/xpdf/print.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/printDis.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/rightArrow.xbm +5 -0
- data/pdf2json-0.52-source/xpdf/rightArrowDis.xbm +5 -0
- data/pdf2json-0.52-source/xpdf/vms_make.com +129 -0
- data/pdf2json-0.52-source/xpdf/xpdf.cc +344 -0
- data/pdf2json-0.52-source/xpdf/xpdfIcon.xpm +62 -0
- data/pdf2json.gemspec +29 -0
- metadata +518 -0
@@ -0,0 +1,121 @@
|
|
1
|
+
//========================================================================
|
2
|
+
//
|
3
|
+
// SplashPath.h
|
4
|
+
//
|
5
|
+
//========================================================================
|
6
|
+
|
7
|
+
#ifndef SPLASHPATH_H
|
8
|
+
#define SPLASHPATH_H
|
9
|
+
|
10
|
+
#include <aconf.h>
|
11
|
+
|
12
|
+
#ifdef USE_GCC_PRAGMAS
|
13
|
+
#pragma interface
|
14
|
+
#endif
|
15
|
+
|
16
|
+
#include "SplashTypes.h"
|
17
|
+
|
18
|
+
//------------------------------------------------------------------------
|
19
|
+
// SplashPathPoint
|
20
|
+
//------------------------------------------------------------------------
|
21
|
+
|
22
|
+
struct SplashPathPoint {
|
23
|
+
SplashCoord x, y;
|
24
|
+
};
|
25
|
+
|
26
|
+
//------------------------------------------------------------------------
|
27
|
+
// SplashPath.flags
|
28
|
+
//------------------------------------------------------------------------
|
29
|
+
|
30
|
+
// first point on each subpath sets this flag
|
31
|
+
#define splashPathFirst 0x01
|
32
|
+
|
33
|
+
// last point on each subpath sets this flag
|
34
|
+
#define splashPathLast 0x02
|
35
|
+
|
36
|
+
// if the subpath is closed, its first and last points must be
|
37
|
+
// identical, and must set this flag
|
38
|
+
#define splashPathClosed 0x04
|
39
|
+
|
40
|
+
// curve control points set this flag
|
41
|
+
#define splashPathCurve 0x08
|
42
|
+
|
43
|
+
//------------------------------------------------------------------------
|
44
|
+
// SplashPathHint
|
45
|
+
//------------------------------------------------------------------------
|
46
|
+
|
47
|
+
struct SplashPathHint {
|
48
|
+
int ctrl0, ctrl1;
|
49
|
+
int firstPt, lastPt;
|
50
|
+
};
|
51
|
+
|
52
|
+
//------------------------------------------------------------------------
|
53
|
+
// SplashPath
|
54
|
+
//------------------------------------------------------------------------
|
55
|
+
|
56
|
+
class SplashPath {
|
57
|
+
public:
|
58
|
+
|
59
|
+
// Create an empty path.
|
60
|
+
SplashPath();
|
61
|
+
|
62
|
+
// Copy a path.
|
63
|
+
SplashPath *copy() { return new SplashPath(this); }
|
64
|
+
|
65
|
+
~SplashPath();
|
66
|
+
|
67
|
+
// Append <path> to <this>.
|
68
|
+
void append(SplashPath *path);
|
69
|
+
|
70
|
+
// Start a new subpath.
|
71
|
+
SplashError moveTo(SplashCoord x, SplashCoord y);
|
72
|
+
|
73
|
+
// Add a line segment to the last subpath.
|
74
|
+
SplashError lineTo(SplashCoord x, SplashCoord y);
|
75
|
+
|
76
|
+
// Add a third-order (cubic) Bezier curve segment to the last
|
77
|
+
// subpath.
|
78
|
+
SplashError curveTo(SplashCoord x1, SplashCoord y1,
|
79
|
+
SplashCoord x2, SplashCoord y2,
|
80
|
+
SplashCoord x3, SplashCoord y3);
|
81
|
+
|
82
|
+
// Close the last subpath, adding a line segment if necessary.
|
83
|
+
SplashError close();
|
84
|
+
|
85
|
+
// Add a stroke adjustment hint. The controlling segments are
|
86
|
+
// <ctrl0> and <ctrl1> (where segments are identified by their first
|
87
|
+
// point), and the points to be adjusted are <firstPt> .. <lastPt>.
|
88
|
+
void addStrokeAdjustHint(int ctrl0, int ctrl1, int firstPt, int lastPt);
|
89
|
+
|
90
|
+
// Add (<dx>, <dy>) to every point on this path.
|
91
|
+
void offset(SplashCoord dx, SplashCoord dy);
|
92
|
+
|
93
|
+
// Get the points on the path.
|
94
|
+
int getLength() { return length; }
|
95
|
+
void getPoint(int i, double *x, double *y, Guchar *f)
|
96
|
+
{ *x = pts[i].x; *y = pts[i].y; *f = flags[i]; }
|
97
|
+
|
98
|
+
// Get the current point.
|
99
|
+
GBool getCurPt(SplashCoord *x, SplashCoord *y);
|
100
|
+
|
101
|
+
private:
|
102
|
+
|
103
|
+
SplashPath(SplashPath *path);
|
104
|
+
void grow(int nPts);
|
105
|
+
GBool noCurrentPoint() { return curSubpath == length; }
|
106
|
+
GBool onePointSubpath() { return curSubpath == length - 1; }
|
107
|
+
GBool openSubpath() { return curSubpath < length - 1; }
|
108
|
+
|
109
|
+
SplashPathPoint *pts; // array of points
|
110
|
+
Guchar *flags; // array of flags
|
111
|
+
int length, size; // length/size of the pts and flags arrays
|
112
|
+
int curSubpath; // index of first point in last subpath
|
113
|
+
|
114
|
+
SplashPathHint *hints; // list of hints
|
115
|
+
int hintsLength, hintsSize;
|
116
|
+
|
117
|
+
friend class SplashXPath;
|
118
|
+
friend class Splash;
|
119
|
+
};
|
120
|
+
|
121
|
+
#endif
|
Binary file
|
@@ -0,0 +1,40 @@
|
|
1
|
+
//========================================================================
|
2
|
+
//
|
3
|
+
// SplashPattern.cc
|
4
|
+
//
|
5
|
+
//========================================================================
|
6
|
+
|
7
|
+
#include <aconf.h>
|
8
|
+
|
9
|
+
#ifdef USE_GCC_PRAGMAS
|
10
|
+
#pragma implementation
|
11
|
+
#endif
|
12
|
+
|
13
|
+
#include "SplashMath.h"
|
14
|
+
#include "SplashScreen.h"
|
15
|
+
#include "SplashPattern.h"
|
16
|
+
|
17
|
+
//------------------------------------------------------------------------
|
18
|
+
// SplashPattern
|
19
|
+
//------------------------------------------------------------------------
|
20
|
+
|
21
|
+
SplashPattern::SplashPattern() {
|
22
|
+
}
|
23
|
+
|
24
|
+
SplashPattern::~SplashPattern() {
|
25
|
+
}
|
26
|
+
|
27
|
+
//------------------------------------------------------------------------
|
28
|
+
// SplashSolidColor
|
29
|
+
//------------------------------------------------------------------------
|
30
|
+
|
31
|
+
SplashSolidColor::SplashSolidColor(SplashColorPtr colorA) {
|
32
|
+
splashColorCopy(color, colorA);
|
33
|
+
}
|
34
|
+
|
35
|
+
SplashSolidColor::~SplashSolidColor() {
|
36
|
+
}
|
37
|
+
|
38
|
+
void SplashSolidColor::getColor(int x, int y, SplashColorPtr c) {
|
39
|
+
splashColorCopy(c, color);
|
40
|
+
}
|
@@ -0,0 +1,65 @@
|
|
1
|
+
//========================================================================
|
2
|
+
//
|
3
|
+
// SplashPattern.h
|
4
|
+
//
|
5
|
+
//========================================================================
|
6
|
+
|
7
|
+
#ifndef SPLASHPATTERN_H
|
8
|
+
#define SPLASHPATTERN_H
|
9
|
+
|
10
|
+
#include <aconf.h>
|
11
|
+
|
12
|
+
#ifdef USE_GCC_PRAGMAS
|
13
|
+
#pragma interface
|
14
|
+
#endif
|
15
|
+
|
16
|
+
#include "SplashTypes.h"
|
17
|
+
|
18
|
+
class SplashScreen;
|
19
|
+
|
20
|
+
//------------------------------------------------------------------------
|
21
|
+
// SplashPattern
|
22
|
+
//------------------------------------------------------------------------
|
23
|
+
|
24
|
+
class SplashPattern {
|
25
|
+
public:
|
26
|
+
|
27
|
+
SplashPattern();
|
28
|
+
|
29
|
+
virtual SplashPattern *copy() = 0;
|
30
|
+
|
31
|
+
virtual ~SplashPattern();
|
32
|
+
|
33
|
+
// Return the color value for a specific pixel.
|
34
|
+
virtual void getColor(int x, int y, SplashColorPtr c) = 0;
|
35
|
+
|
36
|
+
// Returns true if this pattern object will return the same color
|
37
|
+
// value for all pixels.
|
38
|
+
virtual GBool isStatic() = 0;
|
39
|
+
|
40
|
+
private:
|
41
|
+
};
|
42
|
+
|
43
|
+
//------------------------------------------------------------------------
|
44
|
+
// SplashSolidColor
|
45
|
+
//------------------------------------------------------------------------
|
46
|
+
|
47
|
+
class SplashSolidColor: public SplashPattern {
|
48
|
+
public:
|
49
|
+
|
50
|
+
SplashSolidColor(SplashColorPtr colorA);
|
51
|
+
|
52
|
+
virtual SplashPattern *copy() { return new SplashSolidColor(color); }
|
53
|
+
|
54
|
+
virtual ~SplashSolidColor();
|
55
|
+
|
56
|
+
virtual void getColor(int x, int y, SplashColorPtr c);
|
57
|
+
|
58
|
+
virtual GBool isStatic() { return gTrue; }
|
59
|
+
|
60
|
+
private:
|
61
|
+
|
62
|
+
SplashColor color;
|
63
|
+
};
|
64
|
+
|
65
|
+
#endif
|
Binary file
|
@@ -0,0 +1,383 @@
|
|
1
|
+
//========================================================================
|
2
|
+
//
|
3
|
+
// SplashScreen.cc
|
4
|
+
//
|
5
|
+
//========================================================================
|
6
|
+
|
7
|
+
#include <aconf.h>
|
8
|
+
|
9
|
+
#ifdef USE_GCC_PRAGMAS
|
10
|
+
#pragma implementation
|
11
|
+
#endif
|
12
|
+
|
13
|
+
#include <stdlib.h>
|
14
|
+
#include <string.h>
|
15
|
+
#include "gmem.h"
|
16
|
+
#include "SplashMath.h"
|
17
|
+
#include "SplashScreen.h"
|
18
|
+
|
19
|
+
//------------------------------------------------------------------------
|
20
|
+
|
21
|
+
static SplashScreenParams defaultParams = {
|
22
|
+
splashScreenDispersed, // type
|
23
|
+
2, // size
|
24
|
+
2, // dotRadius
|
25
|
+
1.0, // gamma
|
26
|
+
0.0, // blackThreshold
|
27
|
+
1.0 // whiteThreshold
|
28
|
+
};
|
29
|
+
|
30
|
+
//------------------------------------------------------------------------
|
31
|
+
|
32
|
+
struct SplashScreenPoint {
|
33
|
+
int x, y;
|
34
|
+
int dist;
|
35
|
+
};
|
36
|
+
|
37
|
+
static int cmpDistances(const void *p0, const void *p1) {
|
38
|
+
return ((SplashScreenPoint *)p0)->dist - ((SplashScreenPoint *)p1)->dist;
|
39
|
+
}
|
40
|
+
|
41
|
+
//------------------------------------------------------------------------
|
42
|
+
// SplashScreen
|
43
|
+
//------------------------------------------------------------------------
|
44
|
+
|
45
|
+
// If <clustered> is true, this generates a 45 degree screen using a
|
46
|
+
// circular dot spot function. DPI = resolution / ((size / 2) *
|
47
|
+
// sqrt(2)). If <clustered> is false, this generates an optimal
|
48
|
+
// threshold matrix using recursive tesselation. Gamma correction
|
49
|
+
// (gamma = 1 / 1.33) is also computed here.
|
50
|
+
SplashScreen::SplashScreen(SplashScreenParams *params) {
|
51
|
+
Guchar u, black, white;
|
52
|
+
int i;
|
53
|
+
|
54
|
+
if (!params) {
|
55
|
+
params = &defaultParams;
|
56
|
+
}
|
57
|
+
|
58
|
+
switch (params->type) {
|
59
|
+
|
60
|
+
case splashScreenDispersed:
|
61
|
+
// size must be a power of 2
|
62
|
+
for (size = 1; size < params->size; size <<= 1) ;
|
63
|
+
mat = (Guchar *)gmallocn(size * size, sizeof(Guchar));
|
64
|
+
buildDispersedMatrix(size/2, size/2, 1, size/2, 1);
|
65
|
+
break;
|
66
|
+
|
67
|
+
case splashScreenClustered:
|
68
|
+
// size must be even
|
69
|
+
size = (params->size >> 1) << 1;
|
70
|
+
if (size < 2) {
|
71
|
+
size = 2;
|
72
|
+
}
|
73
|
+
mat = (Guchar *)gmallocn(size * size, sizeof(Guchar));
|
74
|
+
buildClusteredMatrix();
|
75
|
+
break;
|
76
|
+
|
77
|
+
case splashScreenStochasticClustered:
|
78
|
+
// size must be at least 2*r
|
79
|
+
if (params->size < 2 * params->dotRadius) {
|
80
|
+
size = 2 * params->dotRadius;
|
81
|
+
} else {
|
82
|
+
size = params->size;
|
83
|
+
}
|
84
|
+
mat = (Guchar *)gmallocn(size * size, sizeof(Guchar));
|
85
|
+
buildSCDMatrix(params->dotRadius);
|
86
|
+
break;
|
87
|
+
}
|
88
|
+
|
89
|
+
// do gamma correction and compute minVal/maxVal
|
90
|
+
minVal = 255;
|
91
|
+
maxVal = 0;
|
92
|
+
black = splashRound((SplashCoord)255.0 * params->blackThreshold);
|
93
|
+
if (black < 1) {
|
94
|
+
black = 1;
|
95
|
+
}
|
96
|
+
white = splashRound((SplashCoord)255.0 * params->whiteThreshold);
|
97
|
+
if (white > 255) {
|
98
|
+
white = 255;
|
99
|
+
}
|
100
|
+
for (i = 0; i < size * size; ++i) {
|
101
|
+
u = splashRound((SplashCoord)255.0 *
|
102
|
+
splashPow((SplashCoord)mat[i] / 255.0, params->gamma));
|
103
|
+
if (u < black) {
|
104
|
+
u = black;
|
105
|
+
} else if (u >= white) {
|
106
|
+
u = white;
|
107
|
+
}
|
108
|
+
mat[i] = u;
|
109
|
+
if (u < minVal) {
|
110
|
+
minVal = u;
|
111
|
+
} else if (u > maxVal) {
|
112
|
+
maxVal = u;
|
113
|
+
}
|
114
|
+
}
|
115
|
+
}
|
116
|
+
|
117
|
+
void SplashScreen::buildDispersedMatrix(int i, int j, int val,
|
118
|
+
int delta, int offset) {
|
119
|
+
if (delta == 0) {
|
120
|
+
// map values in [1, size^2] --> [1, 255]
|
121
|
+
mat[i * size + j] = 1 + (254 * (val - 1)) / (size * size - 1);
|
122
|
+
} else {
|
123
|
+
buildDispersedMatrix(i, j,
|
124
|
+
val, delta / 2, 4*offset);
|
125
|
+
buildDispersedMatrix((i + delta) % size, (j + delta) % size,
|
126
|
+
val + offset, delta / 2, 4*offset);
|
127
|
+
buildDispersedMatrix((i + delta) % size, j,
|
128
|
+
val + 2*offset, delta / 2, 4*offset);
|
129
|
+
buildDispersedMatrix((i + 2*delta) % size, (j + delta) % size,
|
130
|
+
val + 3*offset, delta / 2, 4*offset);
|
131
|
+
}
|
132
|
+
}
|
133
|
+
|
134
|
+
void SplashScreen::buildClusteredMatrix() {
|
135
|
+
SplashCoord *dist;
|
136
|
+
SplashCoord u, v, d;
|
137
|
+
Guchar val;
|
138
|
+
int size2, x, y, x1, y1, i;
|
139
|
+
|
140
|
+
size2 = size >> 1;
|
141
|
+
|
142
|
+
// initialize the threshold matrix
|
143
|
+
for (y = 0; y < size; ++y) {
|
144
|
+
for (x = 0; x < size; ++x) {
|
145
|
+
mat[y * size + x] = 0;
|
146
|
+
}
|
147
|
+
}
|
148
|
+
|
149
|
+
// build the distance matrix
|
150
|
+
dist = (SplashCoord *)gmallocn(size * size2, sizeof(SplashCoord));
|
151
|
+
for (y = 0; y < size2; ++y) {
|
152
|
+
for (x = 0; x < size2; ++x) {
|
153
|
+
if (x + y < size2 - 1) {
|
154
|
+
u = (SplashCoord)x + 0.5 - 0;
|
155
|
+
v = (SplashCoord)y + 0.5 - 0;
|
156
|
+
} else {
|
157
|
+
u = (SplashCoord)x + 0.5 - (SplashCoord)size2;
|
158
|
+
v = (SplashCoord)y + 0.5 - (SplashCoord)size2;
|
159
|
+
}
|
160
|
+
dist[y * size2 + x] = u*u + v*v;
|
161
|
+
}
|
162
|
+
}
|
163
|
+
for (y = 0; y < size2; ++y) {
|
164
|
+
for (x = 0; x < size2; ++x) {
|
165
|
+
if (x < y) {
|
166
|
+
u = (SplashCoord)x + 0.5 - 0;
|
167
|
+
v = (SplashCoord)y + 0.5 - (SplashCoord)size2;
|
168
|
+
} else {
|
169
|
+
u = (SplashCoord)x + 0.5 - (SplashCoord)size2;
|
170
|
+
v = (SplashCoord)y + 0.5 - 0;
|
171
|
+
}
|
172
|
+
dist[(size2 + y) * size2 + x] = u*u + v*v;
|
173
|
+
}
|
174
|
+
}
|
175
|
+
|
176
|
+
// build the threshold matrix
|
177
|
+
minVal = 1;
|
178
|
+
maxVal = 0;
|
179
|
+
x1 = y1 = 0; // make gcc happy
|
180
|
+
for (i = 0; i < size * size2; ++i) {
|
181
|
+
d = -1;
|
182
|
+
for (y = 0; y < size; ++y) {
|
183
|
+
for (x = 0; x < size2; ++x) {
|
184
|
+
if (mat[y * size + x] == 0 &&
|
185
|
+
dist[y * size2 + x] > d) {
|
186
|
+
x1 = x;
|
187
|
+
y1 = y;
|
188
|
+
d = dist[y1 * size2 + x1];
|
189
|
+
}
|
190
|
+
}
|
191
|
+
}
|
192
|
+
// map values in [0, 2*size*size2-1] --> [1, 255]
|
193
|
+
val = 1 + (254 * (2*i)) / (2*size*size2 - 1);
|
194
|
+
mat[y1 * size + x1] = val;
|
195
|
+
val = 1 + (254 * (2*i+1)) / (2*size*size2 - 1);
|
196
|
+
if (y1 < size2) {
|
197
|
+
mat[(y1 + size2) * size + x1 + size2] = val;
|
198
|
+
} else {
|
199
|
+
mat[(y1 - size2) * size + x1 + size2] = val;
|
200
|
+
}
|
201
|
+
}
|
202
|
+
|
203
|
+
gfree(dist);
|
204
|
+
}
|
205
|
+
|
206
|
+
// Compute the distance between two points on a toroid.
|
207
|
+
int SplashScreen::distance(int x0, int y0, int x1, int y1) {
|
208
|
+
int dx0, dx1, dx, dy0, dy1, dy;
|
209
|
+
|
210
|
+
dx0 = abs(x0 - x1);
|
211
|
+
dx1 = size - dx0;
|
212
|
+
dx = dx0 < dx1 ? dx0 : dx1;
|
213
|
+
dy0 = abs(y0 - y1);
|
214
|
+
dy1 = size - dy0;
|
215
|
+
dy = dy0 < dy1 ? dy0 : dy1;
|
216
|
+
return dx * dx + dy * dy;
|
217
|
+
}
|
218
|
+
|
219
|
+
// Algorithm taken from:
|
220
|
+
// Victor Ostromoukhov and Roger D. Hersch, "Stochastic Clustered-Dot
|
221
|
+
// Dithering" in Color Imaging: Device-Independent Color, Color
|
222
|
+
// Hardcopy, and Graphic Arts IV, SPIE Vol. 3648, pp. 496-505, 1999.
|
223
|
+
void SplashScreen::buildSCDMatrix(int r) {
|
224
|
+
SplashScreenPoint *dots, *pts;
|
225
|
+
int dotsLen, dotsSize;
|
226
|
+
char *tmpl;
|
227
|
+
char *grid;
|
228
|
+
int *region, *dist;
|
229
|
+
int x, y, xx, yy, x0, x1, y0, y1, i, j, d, iMin, dMin, n;
|
230
|
+
|
231
|
+
//~ this should probably happen somewhere else
|
232
|
+
srand(123);
|
233
|
+
|
234
|
+
// generate the random space-filling curve
|
235
|
+
pts = (SplashScreenPoint *)gmallocn(size * size, sizeof(SplashScreenPoint));
|
236
|
+
i = 0;
|
237
|
+
for (y = 0; y < size; ++y) {
|
238
|
+
for (x = 0; x < size; ++x) {
|
239
|
+
pts[i].x = x;
|
240
|
+
pts[i].y = y;
|
241
|
+
++i;
|
242
|
+
}
|
243
|
+
}
|
244
|
+
for (i = 0; i < size * size; ++i) {
|
245
|
+
j = i + (int)((double)(size * size - i) *
|
246
|
+
(double)rand() / ((double)RAND_MAX + 1.0));
|
247
|
+
x = pts[i].x;
|
248
|
+
y = pts[i].y;
|
249
|
+
pts[i].x = pts[j].x;
|
250
|
+
pts[i].y = pts[j].y;
|
251
|
+
pts[j].x = x;
|
252
|
+
pts[j].y = y;
|
253
|
+
}
|
254
|
+
|
255
|
+
// construct the circle template
|
256
|
+
tmpl = (char *)gmallocn((r+1)*(r+1), sizeof(char));
|
257
|
+
for (y = 0; y <= r; ++y) {
|
258
|
+
for (x = 0; x <= r; ++x) {
|
259
|
+
tmpl[y*(r+1) + x] = (x * y <= r * r) ? 1 : 0;
|
260
|
+
}
|
261
|
+
}
|
262
|
+
|
263
|
+
// mark all grid cells as free
|
264
|
+
grid = (char *)gmallocn(size * size, sizeof(char));
|
265
|
+
for (y = 0; y < size; ++y) {
|
266
|
+
for (x = 0; x < size; ++x) {
|
267
|
+
grid[y*size + x] = 0;
|
268
|
+
}
|
269
|
+
}
|
270
|
+
|
271
|
+
// walk the space-filling curve, adding dots
|
272
|
+
dotsLen = 0;
|
273
|
+
dotsSize = 32;
|
274
|
+
dots = (SplashScreenPoint *)gmallocn(dotsSize, sizeof(SplashScreenPoint));
|
275
|
+
for (i = 0; i < size * size; ++i) {
|
276
|
+
x = pts[i].x;
|
277
|
+
y = pts[i].y;
|
278
|
+
if (!grid[y*size + x]) {
|
279
|
+
if (dotsLen == dotsSize) {
|
280
|
+
dotsSize *= 2;
|
281
|
+
dots = (SplashScreenPoint *)greallocn(dots, dotsSize,
|
282
|
+
sizeof(SplashScreenPoint));
|
283
|
+
}
|
284
|
+
dots[dotsLen++] = pts[i];
|
285
|
+
for (yy = 0; yy <= r; ++yy) {
|
286
|
+
y0 = (y + yy) % size;
|
287
|
+
y1 = (y - yy + size) % size;
|
288
|
+
for (xx = 0; xx <= r; ++xx) {
|
289
|
+
if (tmpl[yy*(r+1) + xx]) {
|
290
|
+
x0 = (x + xx) % size;
|
291
|
+
x1 = (x - xx + size) % size;
|
292
|
+
grid[y0*size + x0] = 1;
|
293
|
+
grid[y0*size + x1] = 1;
|
294
|
+
grid[y1*size + x0] = 1;
|
295
|
+
grid[y1*size + x1] = 1;
|
296
|
+
}
|
297
|
+
}
|
298
|
+
}
|
299
|
+
}
|
300
|
+
}
|
301
|
+
|
302
|
+
gfree(tmpl);
|
303
|
+
gfree(grid);
|
304
|
+
|
305
|
+
// assign each cell to a dot, compute distance to center of dot
|
306
|
+
region = (int *)gmallocn(size * size, sizeof(int));
|
307
|
+
dist = (int *)gmallocn(size * size, sizeof(int));
|
308
|
+
for (y = 0; y < size; ++y) {
|
309
|
+
for (x = 0; x < size; ++x) {
|
310
|
+
iMin = 0;
|
311
|
+
dMin = distance(dots[0].x, dots[0].y, x, y);
|
312
|
+
for (i = 1; i < dotsLen; ++i) {
|
313
|
+
d = distance(dots[i].x, dots[i].y, x, y);
|
314
|
+
if (d < dMin) {
|
315
|
+
iMin = i;
|
316
|
+
dMin = d;
|
317
|
+
}
|
318
|
+
}
|
319
|
+
region[y*size + x] = iMin;
|
320
|
+
dist[y*size + x] = dMin;
|
321
|
+
}
|
322
|
+
}
|
323
|
+
|
324
|
+
// compute threshold values
|
325
|
+
for (i = 0; i < dotsLen; ++i) {
|
326
|
+
n = 0;
|
327
|
+
for (y = 0; y < size; ++y) {
|
328
|
+
for (x = 0; x < size; ++x) {
|
329
|
+
if (region[y*size + x] == i) {
|
330
|
+
pts[n].x = x;
|
331
|
+
pts[n].y = y;
|
332
|
+
pts[n].dist = distance(dots[i].x, dots[i].y, x, y);
|
333
|
+
++n;
|
334
|
+
}
|
335
|
+
}
|
336
|
+
}
|
337
|
+
qsort(pts, n, sizeof(SplashScreenPoint), &cmpDistances);
|
338
|
+
for (j = 0; j < n; ++j) {
|
339
|
+
// map values in [0 .. n-1] --> [255 .. 1]
|
340
|
+
mat[pts[j].y * size + pts[j].x] = 255 - (254 * j) / (n - 1);
|
341
|
+
}
|
342
|
+
}
|
343
|
+
|
344
|
+
gfree(pts);
|
345
|
+
gfree(region);
|
346
|
+
gfree(dist);
|
347
|
+
|
348
|
+
gfree(dots);
|
349
|
+
}
|
350
|
+
|
351
|
+
SplashScreen::SplashScreen(SplashScreen *screen) {
|
352
|
+
size = screen->size;
|
353
|
+
mat = (Guchar *)gmallocn(size * size, sizeof(Guchar));
|
354
|
+
memcpy(mat, screen->mat, size * size * sizeof(Guchar));
|
355
|
+
minVal = screen->minVal;
|
356
|
+
maxVal = screen->maxVal;
|
357
|
+
}
|
358
|
+
|
359
|
+
SplashScreen::~SplashScreen() {
|
360
|
+
gfree(mat);
|
361
|
+
}
|
362
|
+
|
363
|
+
int SplashScreen::test(int x, int y, Guchar value) {
|
364
|
+
int xx, yy;
|
365
|
+
|
366
|
+
if (value < minVal) {
|
367
|
+
return 0;
|
368
|
+
}
|
369
|
+
if (value >= maxVal) {
|
370
|
+
return 1;
|
371
|
+
}
|
372
|
+
if ((xx = x % size) < 0) {
|
373
|
+
xx = -xx;
|
374
|
+
}
|
375
|
+
if ((yy = y % size) < 0) {
|
376
|
+
yy = -yy;
|
377
|
+
}
|
378
|
+
return value < mat[yy * size + xx] ? 0 : 1;
|
379
|
+
}
|
380
|
+
|
381
|
+
GBool SplashScreen::isStatic(Guchar value) {
|
382
|
+
return value < minVal || value >= maxVal;
|
383
|
+
}
|