entangledstate-isbn 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -1
- data/Rakefile +0 -18
- data/VERSION +1 -0
- data/isbn.gemspec +290 -7
- data/lib/isbn.rb +6 -6
- data/src/gocr-0.48/.cvsignore +6 -0
- data/src/gocr-0.48/AUTHORS +7 -0
- data/src/gocr-0.48/BUGS +55 -0
- data/src/gocr-0.48/CREDITS +17 -0
- data/src/gocr-0.48/HISTORY +243 -0
- data/src/gocr-0.48/INSTALL +83 -0
- data/src/gocr-0.48/Makefile +193 -0
- data/src/gocr-0.48/Makefile.in +193 -0
- data/src/gocr-0.48/README +165 -0
- data/src/gocr-0.48/READMEde.txt +80 -0
- data/src/gocr-0.48/REMARK.txt +18 -0
- data/src/gocr-0.48/REVIEW +538 -0
- data/src/gocr-0.48/TODO +65 -0
- data/src/gocr-0.48/bin/.cvsignore +2 -0
- data/src/gocr-0.48/bin/create_db +38 -0
- data/src/gocr-0.48/bin/gocr.tcl +527 -0
- data/src/gocr-0.48/bin/gocr_chk.sh +44 -0
- data/src/gocr-0.48/configure +4689 -0
- data/src/gocr-0.48/configure.in +71 -0
- data/src/gocr-0.48/doc/.#Makefile.1.6 +39 -0
- data/src/gocr-0.48/doc/.cvsignore +2 -0
- data/src/gocr-0.48/doc/Makefile +39 -0
- data/src/gocr-0.48/doc/Makefile.in +39 -0
- data/src/gocr-0.48/doc/example.dtd +53 -0
- data/src/gocr-0.48/doc/example.xml +21 -0
- data/src/gocr-0.48/doc/examples.txt +67 -0
- data/src/gocr-0.48/doc/gocr.html +578 -0
- data/src/gocr-0.48/doc/unicode.txt +57 -0
- data/src/gocr-0.48/examples/.#Makefile.1.22 +166 -0
- data/src/gocr-0.48/examples/4x6.png +0 -0
- data/src/gocr-0.48/examples/4x6.txt +2 -0
- data/src/gocr-0.48/examples/5x7.png +0 -0
- data/src/gocr-0.48/examples/5x7.png.txt +2 -0
- data/src/gocr-0.48/examples/5x8.png +0 -0
- data/src/gocr-0.48/examples/5x8.png.txt +2 -0
- data/src/gocr-0.48/examples/Makefile +166 -0
- data/src/gocr-0.48/examples/color.fig +20 -0
- data/src/gocr-0.48/examples/ex.fig +16 -0
- data/src/gocr-0.48/examples/font.tex +22 -0
- data/src/gocr-0.48/examples/font1.tex +46 -0
- data/src/gocr-0.48/examples/font2.fig +27 -0
- data/src/gocr-0.48/examples/font_nw.tex +24 -0
- data/src/gocr-0.48/examples/handwrt1.jpg +0 -0
- data/src/gocr-0.48/examples/handwrt1.txt +10 -0
- data/src/gocr-0.48/examples/inverse.fig +20 -0
- data/src/gocr-0.48/examples/matrix.jpg +0 -0
- data/src/gocr-0.48/examples/ocr-a-subset.png +0 -0
- data/src/gocr-0.48/examples/ocr-a-subset.png.txt +4 -0
- data/src/gocr-0.48/examples/ocr-a.png +0 -0
- data/src/gocr-0.48/examples/ocr-a.txt +6 -0
- data/src/gocr-0.48/examples/ocr-b.png +0 -0
- data/src/gocr-0.48/examples/ocr-b.png.txt +4 -0
- data/src/gocr-0.48/examples/polish.tex +28 -0
- data/src/gocr-0.48/examples/rotate45.fig +14 -0
- data/src/gocr-0.48/examples/score +36 -0
- data/src/gocr-0.48/examples/text.tex +28 -0
- data/src/gocr-0.48/gocr.spec +143 -0
- data/src/gocr-0.48/gpl.html +537 -0
- data/src/gocr-0.48/include/.cvsignore +2 -0
- data/src/gocr-0.48/include/config.h +36 -0
- data/src/gocr-0.48/include/config.h.in +36 -0
- data/src/gocr-0.48/include/version.h +2 -0
- data/src/gocr-0.48/install-sh +3 -0
- data/src/gocr-0.48/make.bat +57 -0
- data/src/gocr-0.48/man/.cvsignore +2 -0
- data/src/gocr-0.48/man/Makefile +29 -0
- data/src/gocr-0.48/man/Makefile.in +29 -0
- data/src/gocr-0.48/man/man1/gocr.1 +166 -0
- data/src/gocr-0.48/src/.cvsignore +4 -0
- data/src/gocr-0.48/src/Makefile +132 -0
- data/src/gocr-0.48/src/Makefile.in +132 -0
- data/src/gocr-0.48/src/amiga.h +31 -0
- data/src/gocr-0.48/src/barcode.c +846 -0
- data/src/gocr-0.48/src/barcode.c.orig +593 -0
- data/src/gocr-0.48/src/barcode.h +11 -0
- data/src/gocr-0.48/src/box.c +372 -0
- data/src/gocr-0.48/src/database.c +462 -0
- data/src/gocr-0.48/src/detect.c +943 -0
- data/src/gocr-0.48/src/gocr.c +373 -0
- data/src/gocr-0.48/src/gocr.h +288 -0
- data/src/gocr-0.48/src/jconv.c +168 -0
- data/src/gocr-0.48/src/job.c +84 -0
- data/src/gocr-0.48/src/lines.c +350 -0
- data/src/gocr-0.48/src/list.c +334 -0
- data/src/gocr-0.48/src/list.h +90 -0
- data/src/gocr-0.48/src/ocr0.c +6756 -0
- data/src/gocr-0.48/src/ocr0.h +63 -0
- data/src/gocr-0.48/src/ocr0n.c +1475 -0
- data/src/gocr-0.48/src/ocr1.c +85 -0
- data/src/gocr-0.48/src/ocr1.h +3 -0
- data/src/gocr-0.48/src/otsu.c +289 -0
- data/src/gocr-0.48/src/otsu.h +23 -0
- data/src/gocr-0.48/src/output.c +289 -0
- data/src/gocr-0.48/src/output.h +37 -0
- data/src/gocr-0.48/src/pcx.c +153 -0
- data/src/gocr-0.48/src/pcx.h +9 -0
- data/src/gocr-0.48/src/pgm2asc.c +2893 -0
- data/src/gocr-0.48/src/pgm2asc.h +105 -0
- data/src/gocr-0.48/src/pixel.c +537 -0
- data/src/gocr-0.48/src/pnm.c +533 -0
- data/src/gocr-0.48/src/pnm.h +35 -0
- data/src/gocr-0.48/src/progress.c +87 -0
- data/src/gocr-0.48/src/progress.h +42 -0
- data/src/gocr-0.48/src/remove.c +703 -0
- data/src/gocr-0.48/src/tga.c +87 -0
- data/src/gocr-0.48/src/tga.h +6 -0
- data/src/gocr-0.48/src/unicode.c +1314 -0
- data/src/gocr-0.48/src/unicode.h +1257 -0
- data/src/jpeg-7/Makefile.am +133 -0
- data/src/jpeg-7/Makefile.in +1089 -0
- data/src/jpeg-7/README +322 -0
- data/src/jpeg-7/aclocal.m4 +8990 -0
- data/src/jpeg-7/ansi2knr.1 +36 -0
- data/src/jpeg-7/ansi2knr.c +739 -0
- data/src/jpeg-7/cderror.h +132 -0
- data/src/jpeg-7/cdjpeg.c +181 -0
- data/src/jpeg-7/cdjpeg.h +187 -0
- data/src/jpeg-7/change.log +270 -0
- data/src/jpeg-7/cjpeg.1 +325 -0
- data/src/jpeg-7/cjpeg.c +616 -0
- data/src/jpeg-7/ckconfig.c +402 -0
- data/src/jpeg-7/coderules.txt +118 -0
- data/src/jpeg-7/config.guess +1561 -0
- data/src/jpeg-7/config.sub +1686 -0
- data/src/jpeg-7/configure +17139 -0
- data/src/jpeg-7/configure.ac +317 -0
- data/src/jpeg-7/depcomp +630 -0
- data/src/jpeg-7/djpeg.1 +251 -0
- data/src/jpeg-7/djpeg.c +617 -0
- data/src/jpeg-7/example.c +433 -0
- data/src/jpeg-7/filelist.txt +215 -0
- data/src/jpeg-7/install-sh +520 -0
- data/src/jpeg-7/install.txt +1097 -0
- data/src/jpeg-7/jaricom.c +148 -0
- data/src/jpeg-7/jcapimin.c +282 -0
- data/src/jpeg-7/jcapistd.c +161 -0
- data/src/jpeg-7/jcarith.c +921 -0
- data/src/jpeg-7/jccoefct.c +453 -0
- data/src/jpeg-7/jccolor.c +459 -0
- data/src/jpeg-7/jcdctmgr.c +482 -0
- data/src/jpeg-7/jchuff.c +1612 -0
- data/src/jpeg-7/jcinit.c +65 -0
- data/src/jpeg-7/jcmainct.c +293 -0
- data/src/jpeg-7/jcmarker.c +667 -0
- data/src/jpeg-7/jcmaster.c +770 -0
- data/src/jpeg-7/jcomapi.c +106 -0
- data/src/jpeg-7/jconfig.bcc +48 -0
- data/src/jpeg-7/jconfig.cfg +45 -0
- data/src/jpeg-7/jconfig.dj +38 -0
- data/src/jpeg-7/jconfig.mac +43 -0
- data/src/jpeg-7/jconfig.manx +43 -0
- data/src/jpeg-7/jconfig.mc6 +52 -0
- data/src/jpeg-7/jconfig.sas +43 -0
- data/src/jpeg-7/jconfig.st +42 -0
- data/src/jpeg-7/jconfig.txt +155 -0
- data/src/jpeg-7/jconfig.vc +45 -0
- data/src/jpeg-7/jconfig.vms +37 -0
- data/src/jpeg-7/jconfig.wat +38 -0
- data/src/jpeg-7/jcparam.c +632 -0
- data/src/jpeg-7/jcprepct.c +358 -0
- data/src/jpeg-7/jcsample.c +545 -0
- data/src/jpeg-7/jctrans.c +381 -0
- data/src/jpeg-7/jdapimin.c +396 -0
- data/src/jpeg-7/jdapistd.c +275 -0
- data/src/jpeg-7/jdarith.c +762 -0
- data/src/jpeg-7/jdatadst.c +151 -0
- data/src/jpeg-7/jdatasrc.c +212 -0
- data/src/jpeg-7/jdcoefct.c +736 -0
- data/src/jpeg-7/jdcolor.c +396 -0
- data/src/jpeg-7/jdct.h +393 -0
- data/src/jpeg-7/jddctmgr.c +382 -0
- data/src/jpeg-7/jdhuff.c +1309 -0
- data/src/jpeg-7/jdinput.c +384 -0
- data/src/jpeg-7/jdmainct.c +512 -0
- data/src/jpeg-7/jdmarker.c +1360 -0
- data/src/jpeg-7/jdmaster.c +663 -0
- data/src/jpeg-7/jdmerge.c +400 -0
- data/src/jpeg-7/jdpostct.c +290 -0
- data/src/jpeg-7/jdsample.c +361 -0
- data/src/jpeg-7/jdtrans.c +136 -0
- data/src/jpeg-7/jerror.c +252 -0
- data/src/jpeg-7/jerror.h +304 -0
- data/src/jpeg-7/jfdctflt.c +174 -0
- data/src/jpeg-7/jfdctfst.c +230 -0
- data/src/jpeg-7/jfdctint.c +4348 -0
- data/src/jpeg-7/jidctflt.c +242 -0
- data/src/jpeg-7/jidctfst.c +368 -0
- data/src/jpeg-7/jidctint.c +5137 -0
- data/src/jpeg-7/jinclude.h +91 -0
- data/src/jpeg-7/jmemansi.c +167 -0
- data/src/jpeg-7/jmemdos.c +638 -0
- data/src/jpeg-7/jmemdosa.asm +379 -0
- data/src/jpeg-7/jmemmac.c +289 -0
- data/src/jpeg-7/jmemmgr.c +1118 -0
- data/src/jpeg-7/jmemname.c +276 -0
- data/src/jpeg-7/jmemnobs.c +109 -0
- data/src/jpeg-7/jmemsys.h +198 -0
- data/src/jpeg-7/jmorecfg.h +369 -0
- data/src/jpeg-7/jpegint.h +395 -0
- data/src/jpeg-7/jpeglib.h +1135 -0
- data/src/jpeg-7/jpegtran.1 +272 -0
- data/src/jpeg-7/jpegtran.c +546 -0
- data/src/jpeg-7/jquant1.c +856 -0
- data/src/jpeg-7/jquant2.c +1310 -0
- data/src/jpeg-7/jutils.c +179 -0
- data/src/jpeg-7/jversion.h +14 -0
- data/src/jpeg-7/libjpeg.map +4 -0
- data/src/jpeg-7/libjpeg.txt +3067 -0
- data/src/jpeg-7/ltmain.sh +8406 -0
- data/src/jpeg-7/makcjpeg.st +36 -0
- data/src/jpeg-7/makdjpeg.st +36 -0
- data/src/jpeg-7/makeadsw.vc6 +77 -0
- data/src/jpeg-7/makeasln.vc9 +33 -0
- data/src/jpeg-7/makecdep.vc6 +82 -0
- data/src/jpeg-7/makecdsp.vc6 +130 -0
- data/src/jpeg-7/makecmak.vc6 +159 -0
- data/src/jpeg-7/makecvcp.vc9 +186 -0
- data/src/jpeg-7/makeddep.vc6 +82 -0
- data/src/jpeg-7/makeddsp.vc6 +130 -0
- data/src/jpeg-7/makedmak.vc6 +159 -0
- data/src/jpeg-7/makedvcp.vc9 +186 -0
- data/src/jpeg-7/makefile.ansi +220 -0
- data/src/jpeg-7/makefile.bcc +291 -0
- data/src/jpeg-7/makefile.dj +226 -0
- data/src/jpeg-7/makefile.manx +220 -0
- data/src/jpeg-7/makefile.mc6 +255 -0
- data/src/jpeg-7/makefile.mms +224 -0
- data/src/jpeg-7/makefile.sas +258 -0
- data/src/jpeg-7/makefile.unix +234 -0
- data/src/jpeg-7/makefile.vc +217 -0
- data/src/jpeg-7/makefile.vms +142 -0
- data/src/jpeg-7/makefile.wat +239 -0
- data/src/jpeg-7/makejdep.vc6 +423 -0
- data/src/jpeg-7/makejdsp.vc6 +285 -0
- data/src/jpeg-7/makejdsw.vc6 +29 -0
- data/src/jpeg-7/makejmak.vc6 +425 -0
- data/src/jpeg-7/makejsln.vc9 +17 -0
- data/src/jpeg-7/makejvcp.vc9 +328 -0
- data/src/jpeg-7/makeproj.mac +213 -0
- data/src/jpeg-7/makerdep.vc6 +6 -0
- data/src/jpeg-7/makerdsp.vc6 +78 -0
- data/src/jpeg-7/makermak.vc6 +110 -0
- data/src/jpeg-7/makervcp.vc9 +133 -0
- data/src/jpeg-7/maketdep.vc6 +43 -0
- data/src/jpeg-7/maketdsp.vc6 +122 -0
- data/src/jpeg-7/maketmak.vc6 +131 -0
- data/src/jpeg-7/maketvcp.vc9 +178 -0
- data/src/jpeg-7/makewdep.vc6 +6 -0
- data/src/jpeg-7/makewdsp.vc6 +78 -0
- data/src/jpeg-7/makewmak.vc6 +110 -0
- data/src/jpeg-7/makewvcp.vc9 +133 -0
- data/src/jpeg-7/makljpeg.st +68 -0
- data/src/jpeg-7/maktjpeg.st +30 -0
- data/src/jpeg-7/makvms.opt +4 -0
- data/src/jpeg-7/missing +376 -0
- data/src/jpeg-7/rdbmp.c +439 -0
- data/src/jpeg-7/rdcolmap.c +253 -0
- data/src/jpeg-7/rdgif.c +38 -0
- data/src/jpeg-7/rdjpgcom.1 +63 -0
- data/src/jpeg-7/rdjpgcom.c +515 -0
- data/src/jpeg-7/rdppm.c +459 -0
- data/src/jpeg-7/rdrle.c +387 -0
- data/src/jpeg-7/rdswitch.c +365 -0
- data/src/jpeg-7/rdtarga.c +500 -0
- data/src/jpeg-7/structure.txt +945 -0
- data/src/jpeg-7/testimg.bmp +0 -0
- data/src/jpeg-7/testimg.jpg +0 -0
- data/src/jpeg-7/testimg.ppm +4 -0
- data/src/jpeg-7/testimgp.jpg +0 -0
- data/src/jpeg-7/testorig.jpg +0 -0
- data/src/jpeg-7/testprog.jpg +0 -0
- data/src/jpeg-7/transupp.c +1533 -0
- data/src/jpeg-7/transupp.h +205 -0
- data/src/jpeg-7/usage.txt +605 -0
- data/src/jpeg-7/wizard.txt +211 -0
- data/src/jpeg-7/wrbmp.c +442 -0
- data/src/jpeg-7/wrgif.c +399 -0
- data/src/jpeg-7/wrjpgcom.1 +103 -0
- data/src/jpeg-7/wrjpgcom.c +583 -0
- data/src/jpeg-7/wrppm.c +269 -0
- data/src/jpeg-7/wrrle.c +305 -0
- data/src/jpeg-7/wrtarga.c +253 -0
- metadata +287 -6
- data/LICENSE +0 -20
- data/VERSION.yml +0 -4
@@ -0,0 +1,132 @@
|
|
1
|
+
/*
|
2
|
+
* cderror.h
|
3
|
+
*
|
4
|
+
* Copyright (C) 1994-1997, Thomas G. Lane.
|
5
|
+
* This file is part of the Independent JPEG Group's software.
|
6
|
+
* For conditions of distribution and use, see the accompanying README file.
|
7
|
+
*
|
8
|
+
* This file defines the error and message codes for the cjpeg/djpeg
|
9
|
+
* applications. These strings are not needed as part of the JPEG library
|
10
|
+
* proper.
|
11
|
+
* Edit this file to add new codes, or to translate the message strings to
|
12
|
+
* some other language.
|
13
|
+
*/
|
14
|
+
|
15
|
+
/*
|
16
|
+
* To define the enum list of message codes, include this file without
|
17
|
+
* defining macro JMESSAGE. To create a message string table, include it
|
18
|
+
* again with a suitable JMESSAGE definition (see jerror.c for an example).
|
19
|
+
*/
|
20
|
+
#ifndef JMESSAGE
|
21
|
+
#ifndef CDERROR_H
|
22
|
+
#define CDERROR_H
|
23
|
+
/* First time through, define the enum list */
|
24
|
+
#define JMAKE_ENUM_LIST
|
25
|
+
#else
|
26
|
+
/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */
|
27
|
+
#define JMESSAGE(code,string)
|
28
|
+
#endif /* CDERROR_H */
|
29
|
+
#endif /* JMESSAGE */
|
30
|
+
|
31
|
+
#ifdef JMAKE_ENUM_LIST
|
32
|
+
|
33
|
+
typedef enum {
|
34
|
+
|
35
|
+
#define JMESSAGE(code,string) code ,
|
36
|
+
|
37
|
+
#endif /* JMAKE_ENUM_LIST */
|
38
|
+
|
39
|
+
JMESSAGE(JMSG_FIRSTADDONCODE=1000, NULL) /* Must be first entry! */
|
40
|
+
|
41
|
+
#ifdef BMP_SUPPORTED
|
42
|
+
JMESSAGE(JERR_BMP_BADCMAP, "Unsupported BMP colormap format")
|
43
|
+
JMESSAGE(JERR_BMP_BADDEPTH, "Only 8- and 24-bit BMP files are supported")
|
44
|
+
JMESSAGE(JERR_BMP_BADHEADER, "Invalid BMP file: bad header length")
|
45
|
+
JMESSAGE(JERR_BMP_BADPLANES, "Invalid BMP file: biPlanes not equal to 1")
|
46
|
+
JMESSAGE(JERR_BMP_COLORSPACE, "BMP output must be grayscale or RGB")
|
47
|
+
JMESSAGE(JERR_BMP_COMPRESSED, "Sorry, compressed BMPs not yet supported")
|
48
|
+
JMESSAGE(JERR_BMP_NOT, "Not a BMP file - does not start with BM")
|
49
|
+
JMESSAGE(JTRC_BMP, "%ux%u 24-bit BMP image")
|
50
|
+
JMESSAGE(JTRC_BMP_MAPPED, "%ux%u 8-bit colormapped BMP image")
|
51
|
+
JMESSAGE(JTRC_BMP_OS2, "%ux%u 24-bit OS2 BMP image")
|
52
|
+
JMESSAGE(JTRC_BMP_OS2_MAPPED, "%ux%u 8-bit colormapped OS2 BMP image")
|
53
|
+
#endif /* BMP_SUPPORTED */
|
54
|
+
|
55
|
+
#ifdef GIF_SUPPORTED
|
56
|
+
JMESSAGE(JERR_GIF_BUG, "GIF output got confused")
|
57
|
+
JMESSAGE(JERR_GIF_CODESIZE, "Bogus GIF codesize %d")
|
58
|
+
JMESSAGE(JERR_GIF_COLORSPACE, "GIF output must be grayscale or RGB")
|
59
|
+
JMESSAGE(JERR_GIF_IMAGENOTFOUND, "Too few images in GIF file")
|
60
|
+
JMESSAGE(JERR_GIF_NOT, "Not a GIF file")
|
61
|
+
JMESSAGE(JTRC_GIF, "%ux%ux%d GIF image")
|
62
|
+
JMESSAGE(JTRC_GIF_BADVERSION,
|
63
|
+
"Warning: unexpected GIF version number '%c%c%c'")
|
64
|
+
JMESSAGE(JTRC_GIF_EXTENSION, "Ignoring GIF extension block of type 0x%02x")
|
65
|
+
JMESSAGE(JTRC_GIF_NONSQUARE, "Caution: nonsquare pixels in input")
|
66
|
+
JMESSAGE(JWRN_GIF_BADDATA, "Corrupt data in GIF file")
|
67
|
+
JMESSAGE(JWRN_GIF_CHAR, "Bogus char 0x%02x in GIF file, ignoring")
|
68
|
+
JMESSAGE(JWRN_GIF_ENDCODE, "Premature end of GIF image")
|
69
|
+
JMESSAGE(JWRN_GIF_NOMOREDATA, "Ran out of GIF bits")
|
70
|
+
#endif /* GIF_SUPPORTED */
|
71
|
+
|
72
|
+
#ifdef PPM_SUPPORTED
|
73
|
+
JMESSAGE(JERR_PPM_COLORSPACE, "PPM output must be grayscale or RGB")
|
74
|
+
JMESSAGE(JERR_PPM_NONNUMERIC, "Nonnumeric data in PPM file")
|
75
|
+
JMESSAGE(JERR_PPM_NOT, "Not a PPM/PGM file")
|
76
|
+
JMESSAGE(JTRC_PGM, "%ux%u PGM image")
|
77
|
+
JMESSAGE(JTRC_PGM_TEXT, "%ux%u text PGM image")
|
78
|
+
JMESSAGE(JTRC_PPM, "%ux%u PPM image")
|
79
|
+
JMESSAGE(JTRC_PPM_TEXT, "%ux%u text PPM image")
|
80
|
+
#endif /* PPM_SUPPORTED */
|
81
|
+
|
82
|
+
#ifdef RLE_SUPPORTED
|
83
|
+
JMESSAGE(JERR_RLE_BADERROR, "Bogus error code from RLE library")
|
84
|
+
JMESSAGE(JERR_RLE_COLORSPACE, "RLE output must be grayscale or RGB")
|
85
|
+
JMESSAGE(JERR_RLE_DIMENSIONS, "Image dimensions (%ux%u) too large for RLE")
|
86
|
+
JMESSAGE(JERR_RLE_EMPTY, "Empty RLE file")
|
87
|
+
JMESSAGE(JERR_RLE_EOF, "Premature EOF in RLE header")
|
88
|
+
JMESSAGE(JERR_RLE_MEM, "Insufficient memory for RLE header")
|
89
|
+
JMESSAGE(JERR_RLE_NOT, "Not an RLE file")
|
90
|
+
JMESSAGE(JERR_RLE_TOOMANYCHANNELS, "Cannot handle %d output channels for RLE")
|
91
|
+
JMESSAGE(JERR_RLE_UNSUPPORTED, "Cannot handle this RLE setup")
|
92
|
+
JMESSAGE(JTRC_RLE, "%ux%u full-color RLE file")
|
93
|
+
JMESSAGE(JTRC_RLE_FULLMAP, "%ux%u full-color RLE file with map of length %d")
|
94
|
+
JMESSAGE(JTRC_RLE_GRAY, "%ux%u grayscale RLE file")
|
95
|
+
JMESSAGE(JTRC_RLE_MAPGRAY, "%ux%u grayscale RLE file with map of length %d")
|
96
|
+
JMESSAGE(JTRC_RLE_MAPPED, "%ux%u colormapped RLE file with map of length %d")
|
97
|
+
#endif /* RLE_SUPPORTED */
|
98
|
+
|
99
|
+
#ifdef TARGA_SUPPORTED
|
100
|
+
JMESSAGE(JERR_TGA_BADCMAP, "Unsupported Targa colormap format")
|
101
|
+
JMESSAGE(JERR_TGA_BADPARMS, "Invalid or unsupported Targa file")
|
102
|
+
JMESSAGE(JERR_TGA_COLORSPACE, "Targa output must be grayscale or RGB")
|
103
|
+
JMESSAGE(JTRC_TGA, "%ux%u RGB Targa image")
|
104
|
+
JMESSAGE(JTRC_TGA_GRAY, "%ux%u grayscale Targa image")
|
105
|
+
JMESSAGE(JTRC_TGA_MAPPED, "%ux%u colormapped Targa image")
|
106
|
+
#else
|
107
|
+
JMESSAGE(JERR_TGA_NOTCOMP, "Targa support was not compiled")
|
108
|
+
#endif /* TARGA_SUPPORTED */
|
109
|
+
|
110
|
+
JMESSAGE(JERR_BAD_CMAP_FILE,
|
111
|
+
"Color map file is invalid or of unsupported format")
|
112
|
+
JMESSAGE(JERR_TOO_MANY_COLORS,
|
113
|
+
"Output file format cannot handle %d colormap entries")
|
114
|
+
JMESSAGE(JERR_UNGETC_FAILED, "ungetc failed")
|
115
|
+
#ifdef TARGA_SUPPORTED
|
116
|
+
JMESSAGE(JERR_UNKNOWN_FORMAT,
|
117
|
+
"Unrecognized input file format --- perhaps you need -targa")
|
118
|
+
#else
|
119
|
+
JMESSAGE(JERR_UNKNOWN_FORMAT, "Unrecognized input file format")
|
120
|
+
#endif
|
121
|
+
JMESSAGE(JERR_UNSUPPORTED_FORMAT, "Unsupported output file format")
|
122
|
+
|
123
|
+
#ifdef JMAKE_ENUM_LIST
|
124
|
+
|
125
|
+
JMSG_LASTADDONCODE
|
126
|
+
} ADDON_MESSAGE_CODE;
|
127
|
+
|
128
|
+
#undef JMAKE_ENUM_LIST
|
129
|
+
#endif /* JMAKE_ENUM_LIST */
|
130
|
+
|
131
|
+
/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
|
132
|
+
#undef JMESSAGE
|
data/src/jpeg-7/cdjpeg.c
ADDED
@@ -0,0 +1,181 @@
|
|
1
|
+
/*
|
2
|
+
* cdjpeg.c
|
3
|
+
*
|
4
|
+
* Copyright (C) 1991-1997, Thomas G. Lane.
|
5
|
+
* This file is part of the Independent JPEG Group's software.
|
6
|
+
* For conditions of distribution and use, see the accompanying README file.
|
7
|
+
*
|
8
|
+
* This file contains common support routines used by the IJG application
|
9
|
+
* programs (cjpeg, djpeg, jpegtran).
|
10
|
+
*/
|
11
|
+
|
12
|
+
#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
|
13
|
+
#include <ctype.h> /* to declare isupper(), tolower() */
|
14
|
+
#ifdef NEED_SIGNAL_CATCHER
|
15
|
+
#include <signal.h> /* to declare signal() */
|
16
|
+
#endif
|
17
|
+
#ifdef USE_SETMODE
|
18
|
+
#include <fcntl.h> /* to declare setmode()'s parameter macros */
|
19
|
+
/* If you have setmode() but not <io.h>, just delete this line: */
|
20
|
+
#include <io.h> /* to declare setmode() */
|
21
|
+
#endif
|
22
|
+
|
23
|
+
|
24
|
+
/*
|
25
|
+
* Signal catcher to ensure that temporary files are removed before aborting.
|
26
|
+
* NB: for Amiga Manx C this is actually a global routine named _abort();
|
27
|
+
* we put "#define signal_catcher _abort" in jconfig.h. Talk about bogus...
|
28
|
+
*/
|
29
|
+
|
30
|
+
#ifdef NEED_SIGNAL_CATCHER
|
31
|
+
|
32
|
+
static j_common_ptr sig_cinfo;
|
33
|
+
|
34
|
+
void /* must be global for Manx C */
|
35
|
+
signal_catcher (int signum)
|
36
|
+
{
|
37
|
+
if (sig_cinfo != NULL) {
|
38
|
+
if (sig_cinfo->err != NULL) /* turn off trace output */
|
39
|
+
sig_cinfo->err->trace_level = 0;
|
40
|
+
jpeg_destroy(sig_cinfo); /* clean up memory allocation & temp files */
|
41
|
+
}
|
42
|
+
exit(EXIT_FAILURE);
|
43
|
+
}
|
44
|
+
|
45
|
+
|
46
|
+
GLOBAL(void)
|
47
|
+
enable_signal_catcher (j_common_ptr cinfo)
|
48
|
+
{
|
49
|
+
sig_cinfo = cinfo;
|
50
|
+
#ifdef SIGINT /* not all systems have SIGINT */
|
51
|
+
signal(SIGINT, signal_catcher);
|
52
|
+
#endif
|
53
|
+
#ifdef SIGTERM /* not all systems have SIGTERM */
|
54
|
+
signal(SIGTERM, signal_catcher);
|
55
|
+
#endif
|
56
|
+
}
|
57
|
+
|
58
|
+
#endif
|
59
|
+
|
60
|
+
|
61
|
+
/*
|
62
|
+
* Optional progress monitor: display a percent-done figure on stderr.
|
63
|
+
*/
|
64
|
+
|
65
|
+
#ifdef PROGRESS_REPORT
|
66
|
+
|
67
|
+
METHODDEF(void)
|
68
|
+
progress_monitor (j_common_ptr cinfo)
|
69
|
+
{
|
70
|
+
cd_progress_ptr prog = (cd_progress_ptr) cinfo->progress;
|
71
|
+
int total_passes = prog->pub.total_passes + prog->total_extra_passes;
|
72
|
+
int percent_done = (int) (prog->pub.pass_counter*100L/prog->pub.pass_limit);
|
73
|
+
|
74
|
+
if (percent_done != prog->percent_done) {
|
75
|
+
prog->percent_done = percent_done;
|
76
|
+
if (total_passes > 1) {
|
77
|
+
fprintf(stderr, "\rPass %d/%d: %3d%% ",
|
78
|
+
prog->pub.completed_passes + prog->completed_extra_passes + 1,
|
79
|
+
total_passes, percent_done);
|
80
|
+
} else {
|
81
|
+
fprintf(stderr, "\r %3d%% ", percent_done);
|
82
|
+
}
|
83
|
+
fflush(stderr);
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
87
|
+
|
88
|
+
GLOBAL(void)
|
89
|
+
start_progress_monitor (j_common_ptr cinfo, cd_progress_ptr progress)
|
90
|
+
{
|
91
|
+
/* Enable progress display, unless trace output is on */
|
92
|
+
if (cinfo->err->trace_level == 0) {
|
93
|
+
progress->pub.progress_monitor = progress_monitor;
|
94
|
+
progress->completed_extra_passes = 0;
|
95
|
+
progress->total_extra_passes = 0;
|
96
|
+
progress->percent_done = -1;
|
97
|
+
cinfo->progress = &progress->pub;
|
98
|
+
}
|
99
|
+
}
|
100
|
+
|
101
|
+
|
102
|
+
GLOBAL(void)
|
103
|
+
end_progress_monitor (j_common_ptr cinfo)
|
104
|
+
{
|
105
|
+
/* Clear away progress display */
|
106
|
+
if (cinfo->err->trace_level == 0) {
|
107
|
+
fprintf(stderr, "\r \r");
|
108
|
+
fflush(stderr);
|
109
|
+
}
|
110
|
+
}
|
111
|
+
|
112
|
+
#endif
|
113
|
+
|
114
|
+
|
115
|
+
/*
|
116
|
+
* Case-insensitive matching of possibly-abbreviated keyword switches.
|
117
|
+
* keyword is the constant keyword (must be lower case already),
|
118
|
+
* minchars is length of minimum legal abbreviation.
|
119
|
+
*/
|
120
|
+
|
121
|
+
GLOBAL(boolean)
|
122
|
+
keymatch (char * arg, const char * keyword, int minchars)
|
123
|
+
{
|
124
|
+
register int ca, ck;
|
125
|
+
register int nmatched = 0;
|
126
|
+
|
127
|
+
while ((ca = *arg++) != '\0') {
|
128
|
+
if ((ck = *keyword++) == '\0')
|
129
|
+
return FALSE; /* arg longer than keyword, no good */
|
130
|
+
if (isupper(ca)) /* force arg to lcase (assume ck is already) */
|
131
|
+
ca = tolower(ca);
|
132
|
+
if (ca != ck)
|
133
|
+
return FALSE; /* no good */
|
134
|
+
nmatched++; /* count matched characters */
|
135
|
+
}
|
136
|
+
/* reached end of argument; fail if it's too short for unique abbrev */
|
137
|
+
if (nmatched < minchars)
|
138
|
+
return FALSE;
|
139
|
+
return TRUE; /* A-OK */
|
140
|
+
}
|
141
|
+
|
142
|
+
|
143
|
+
/*
|
144
|
+
* Routines to establish binary I/O mode for stdin and stdout.
|
145
|
+
* Non-Unix systems often require some hacking to get out of text mode.
|
146
|
+
*/
|
147
|
+
|
148
|
+
GLOBAL(FILE *)
|
149
|
+
read_stdin (void)
|
150
|
+
{
|
151
|
+
FILE * input_file = stdin;
|
152
|
+
|
153
|
+
#ifdef USE_SETMODE /* need to hack file mode? */
|
154
|
+
setmode(fileno(stdin), O_BINARY);
|
155
|
+
#endif
|
156
|
+
#ifdef USE_FDOPEN /* need to re-open in binary mode? */
|
157
|
+
if ((input_file = fdopen(fileno(stdin), READ_BINARY)) == NULL) {
|
158
|
+
fprintf(stderr, "Cannot reopen stdin\n");
|
159
|
+
exit(EXIT_FAILURE);
|
160
|
+
}
|
161
|
+
#endif
|
162
|
+
return input_file;
|
163
|
+
}
|
164
|
+
|
165
|
+
|
166
|
+
GLOBAL(FILE *)
|
167
|
+
write_stdout (void)
|
168
|
+
{
|
169
|
+
FILE * output_file = stdout;
|
170
|
+
|
171
|
+
#ifdef USE_SETMODE /* need to hack file mode? */
|
172
|
+
setmode(fileno(stdout), O_BINARY);
|
173
|
+
#endif
|
174
|
+
#ifdef USE_FDOPEN /* need to re-open in binary mode? */
|
175
|
+
if ((output_file = fdopen(fileno(stdout), WRITE_BINARY)) == NULL) {
|
176
|
+
fprintf(stderr, "Cannot reopen stdout\n");
|
177
|
+
exit(EXIT_FAILURE);
|
178
|
+
}
|
179
|
+
#endif
|
180
|
+
return output_file;
|
181
|
+
}
|
data/src/jpeg-7/cdjpeg.h
ADDED
@@ -0,0 +1,187 @@
|
|
1
|
+
/*
|
2
|
+
* cdjpeg.h
|
3
|
+
*
|
4
|
+
* Copyright (C) 1994-1997, Thomas G. Lane.
|
5
|
+
* This file is part of the Independent JPEG Group's software.
|
6
|
+
* For conditions of distribution and use, see the accompanying README file.
|
7
|
+
*
|
8
|
+
* This file contains common declarations for the sample applications
|
9
|
+
* cjpeg and djpeg. It is NOT used by the core JPEG library.
|
10
|
+
*/
|
11
|
+
|
12
|
+
#define JPEG_CJPEG_DJPEG /* define proper options in jconfig.h */
|
13
|
+
#define JPEG_INTERNAL_OPTIONS /* cjpeg.c,djpeg.c need to see xxx_SUPPORTED */
|
14
|
+
#include "jinclude.h"
|
15
|
+
#include "jpeglib.h"
|
16
|
+
#include "jerror.h" /* get library error codes too */
|
17
|
+
#include "cderror.h" /* get application-specific error codes */
|
18
|
+
|
19
|
+
|
20
|
+
/*
|
21
|
+
* Object interface for cjpeg's source file decoding modules
|
22
|
+
*/
|
23
|
+
|
24
|
+
typedef struct cjpeg_source_struct * cjpeg_source_ptr;
|
25
|
+
|
26
|
+
struct cjpeg_source_struct {
|
27
|
+
JMETHOD(void, start_input, (j_compress_ptr cinfo,
|
28
|
+
cjpeg_source_ptr sinfo));
|
29
|
+
JMETHOD(JDIMENSION, get_pixel_rows, (j_compress_ptr cinfo,
|
30
|
+
cjpeg_source_ptr sinfo));
|
31
|
+
JMETHOD(void, finish_input, (j_compress_ptr cinfo,
|
32
|
+
cjpeg_source_ptr sinfo));
|
33
|
+
|
34
|
+
FILE *input_file;
|
35
|
+
|
36
|
+
JSAMPARRAY buffer;
|
37
|
+
JDIMENSION buffer_height;
|
38
|
+
};
|
39
|
+
|
40
|
+
|
41
|
+
/*
|
42
|
+
* Object interface for djpeg's output file encoding modules
|
43
|
+
*/
|
44
|
+
|
45
|
+
typedef struct djpeg_dest_struct * djpeg_dest_ptr;
|
46
|
+
|
47
|
+
struct djpeg_dest_struct {
|
48
|
+
/* start_output is called after jpeg_start_decompress finishes.
|
49
|
+
* The color map will be ready at this time, if one is needed.
|
50
|
+
*/
|
51
|
+
JMETHOD(void, start_output, (j_decompress_ptr cinfo,
|
52
|
+
djpeg_dest_ptr dinfo));
|
53
|
+
/* Emit the specified number of pixel rows from the buffer. */
|
54
|
+
JMETHOD(void, put_pixel_rows, (j_decompress_ptr cinfo,
|
55
|
+
djpeg_dest_ptr dinfo,
|
56
|
+
JDIMENSION rows_supplied));
|
57
|
+
/* Finish up at the end of the image. */
|
58
|
+
JMETHOD(void, finish_output, (j_decompress_ptr cinfo,
|
59
|
+
djpeg_dest_ptr dinfo));
|
60
|
+
|
61
|
+
/* Target file spec; filled in by djpeg.c after object is created. */
|
62
|
+
FILE * output_file;
|
63
|
+
|
64
|
+
/* Output pixel-row buffer. Created by module init or start_output.
|
65
|
+
* Width is cinfo->output_width * cinfo->output_components;
|
66
|
+
* height is buffer_height.
|
67
|
+
*/
|
68
|
+
JSAMPARRAY buffer;
|
69
|
+
JDIMENSION buffer_height;
|
70
|
+
};
|
71
|
+
|
72
|
+
|
73
|
+
/*
|
74
|
+
* cjpeg/djpeg may need to perform extra passes to convert to or from
|
75
|
+
* the source/destination file format. The JPEG library does not know
|
76
|
+
* about these passes, but we'd like them to be counted by the progress
|
77
|
+
* monitor. We use an expanded progress monitor object to hold the
|
78
|
+
* additional pass count.
|
79
|
+
*/
|
80
|
+
|
81
|
+
struct cdjpeg_progress_mgr {
|
82
|
+
struct jpeg_progress_mgr pub; /* fields known to JPEG library */
|
83
|
+
int completed_extra_passes; /* extra passes completed */
|
84
|
+
int total_extra_passes; /* total extra */
|
85
|
+
/* last printed percentage stored here to avoid multiple printouts */
|
86
|
+
int percent_done;
|
87
|
+
};
|
88
|
+
|
89
|
+
typedef struct cdjpeg_progress_mgr * cd_progress_ptr;
|
90
|
+
|
91
|
+
|
92
|
+
/* Short forms of external names for systems with brain-damaged linkers. */
|
93
|
+
|
94
|
+
#ifdef NEED_SHORT_EXTERNAL_NAMES
|
95
|
+
#define jinit_read_bmp jIRdBMP
|
96
|
+
#define jinit_write_bmp jIWrBMP
|
97
|
+
#define jinit_read_gif jIRdGIF
|
98
|
+
#define jinit_write_gif jIWrGIF
|
99
|
+
#define jinit_read_ppm jIRdPPM
|
100
|
+
#define jinit_write_ppm jIWrPPM
|
101
|
+
#define jinit_read_rle jIRdRLE
|
102
|
+
#define jinit_write_rle jIWrRLE
|
103
|
+
#define jinit_read_targa jIRdTarga
|
104
|
+
#define jinit_write_targa jIWrTarga
|
105
|
+
#define read_quant_tables RdQTables
|
106
|
+
#define read_scan_script RdScnScript
|
107
|
+
#define set_quality_ratings SetQRates
|
108
|
+
#define set_quant_slots SetQSlots
|
109
|
+
#define set_sample_factors SetSFacts
|
110
|
+
#define read_color_map RdCMap
|
111
|
+
#define enable_signal_catcher EnSigCatcher
|
112
|
+
#define start_progress_monitor StProgMon
|
113
|
+
#define end_progress_monitor EnProgMon
|
114
|
+
#define read_stdin RdStdin
|
115
|
+
#define write_stdout WrStdout
|
116
|
+
#endif /* NEED_SHORT_EXTERNAL_NAMES */
|
117
|
+
|
118
|
+
/* Module selection routines for I/O modules. */
|
119
|
+
|
120
|
+
EXTERN(cjpeg_source_ptr) jinit_read_bmp JPP((j_compress_ptr cinfo));
|
121
|
+
EXTERN(djpeg_dest_ptr) jinit_write_bmp JPP((j_decompress_ptr cinfo,
|
122
|
+
boolean is_os2));
|
123
|
+
EXTERN(cjpeg_source_ptr) jinit_read_gif JPP((j_compress_ptr cinfo));
|
124
|
+
EXTERN(djpeg_dest_ptr) jinit_write_gif JPP((j_decompress_ptr cinfo));
|
125
|
+
EXTERN(cjpeg_source_ptr) jinit_read_ppm JPP((j_compress_ptr cinfo));
|
126
|
+
EXTERN(djpeg_dest_ptr) jinit_write_ppm JPP((j_decompress_ptr cinfo));
|
127
|
+
EXTERN(cjpeg_source_ptr) jinit_read_rle JPP((j_compress_ptr cinfo));
|
128
|
+
EXTERN(djpeg_dest_ptr) jinit_write_rle JPP((j_decompress_ptr cinfo));
|
129
|
+
EXTERN(cjpeg_source_ptr) jinit_read_targa JPP((j_compress_ptr cinfo));
|
130
|
+
EXTERN(djpeg_dest_ptr) jinit_write_targa JPP((j_decompress_ptr cinfo));
|
131
|
+
|
132
|
+
/* cjpeg support routines (in rdswitch.c) */
|
133
|
+
|
134
|
+
EXTERN(boolean) read_quant_tables JPP((j_compress_ptr cinfo, char * filename,
|
135
|
+
boolean force_baseline));
|
136
|
+
EXTERN(boolean) read_scan_script JPP((j_compress_ptr cinfo, char * filename));
|
137
|
+
EXTERN(boolean) set_quality_ratings JPP((j_compress_ptr cinfo, char *arg,
|
138
|
+
boolean force_baseline));
|
139
|
+
EXTERN(boolean) set_quant_slots JPP((j_compress_ptr cinfo, char *arg));
|
140
|
+
EXTERN(boolean) set_sample_factors JPP((j_compress_ptr cinfo, char *arg));
|
141
|
+
|
142
|
+
/* djpeg support routines (in rdcolmap.c) */
|
143
|
+
|
144
|
+
EXTERN(void) read_color_map JPP((j_decompress_ptr cinfo, FILE * infile));
|
145
|
+
|
146
|
+
/* common support routines (in cdjpeg.c) */
|
147
|
+
|
148
|
+
EXTERN(void) enable_signal_catcher JPP((j_common_ptr cinfo));
|
149
|
+
EXTERN(void) start_progress_monitor JPP((j_common_ptr cinfo,
|
150
|
+
cd_progress_ptr progress));
|
151
|
+
EXTERN(void) end_progress_monitor JPP((j_common_ptr cinfo));
|
152
|
+
EXTERN(boolean) keymatch JPP((char * arg, const char * keyword, int minchars));
|
153
|
+
EXTERN(FILE *) read_stdin JPP((void));
|
154
|
+
EXTERN(FILE *) write_stdout JPP((void));
|
155
|
+
|
156
|
+
/* miscellaneous useful macros */
|
157
|
+
|
158
|
+
#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */
|
159
|
+
#define READ_BINARY "r"
|
160
|
+
#define WRITE_BINARY "w"
|
161
|
+
#else
|
162
|
+
#ifdef VMS /* VMS is very nonstandard */
|
163
|
+
#define READ_BINARY "rb", "ctx=stm"
|
164
|
+
#define WRITE_BINARY "wb", "ctx=stm"
|
165
|
+
#else /* standard ANSI-compliant case */
|
166
|
+
#define READ_BINARY "rb"
|
167
|
+
#define WRITE_BINARY "wb"
|
168
|
+
#endif
|
169
|
+
#endif
|
170
|
+
|
171
|
+
#ifndef EXIT_FAILURE /* define exit() codes if not provided */
|
172
|
+
#define EXIT_FAILURE 1
|
173
|
+
#endif
|
174
|
+
#ifndef EXIT_SUCCESS
|
175
|
+
#ifdef VMS
|
176
|
+
#define EXIT_SUCCESS 1 /* VMS is very nonstandard */
|
177
|
+
#else
|
178
|
+
#define EXIT_SUCCESS 0
|
179
|
+
#endif
|
180
|
+
#endif
|
181
|
+
#ifndef EXIT_WARNING
|
182
|
+
#ifdef VMS
|
183
|
+
#define EXIT_WARNING 1 /* VMS is very nonstandard */
|
184
|
+
#else
|
185
|
+
#define EXIT_WARNING 2
|
186
|
+
#endif
|
187
|
+
#endif
|