isbn 2.0.4 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/{README → README.md} +5 -11
- data/Rakefile +20 -14
- data/isbn.gemspec +23 -0
- data/lib/isbn.rb +2 -0
- data/test/isbn_spec.rb +1 -1
- metadata +29 -316
- data/VERSION +0 -1
- data/src/gocr-0.48/.cvsignore +0 -6
- data/src/gocr-0.48/AUTHORS +0 -7
- data/src/gocr-0.48/BUGS +0 -55
- data/src/gocr-0.48/CREDITS +0 -17
- data/src/gocr-0.48/HISTORY +0 -243
- data/src/gocr-0.48/INSTALL +0 -83
- data/src/gocr-0.48/Makefile +0 -193
- data/src/gocr-0.48/Makefile.in +0 -193
- data/src/gocr-0.48/README +0 -165
- data/src/gocr-0.48/READMEde.txt +0 -80
- data/src/gocr-0.48/REMARK.txt +0 -18
- data/src/gocr-0.48/REVIEW +0 -538
- data/src/gocr-0.48/TODO +0 -65
- data/src/gocr-0.48/bin/.cvsignore +0 -2
- data/src/gocr-0.48/bin/create_db +0 -38
- data/src/gocr-0.48/bin/gocr.tcl +0 -527
- data/src/gocr-0.48/bin/gocr_chk.sh +0 -44
- data/src/gocr-0.48/configure +0 -4689
- data/src/gocr-0.48/configure.in +0 -71
- data/src/gocr-0.48/doc/.#Makefile.1.6 +0 -39
- data/src/gocr-0.48/doc/.cvsignore +0 -2
- data/src/gocr-0.48/doc/Makefile +0 -39
- data/src/gocr-0.48/doc/Makefile.in +0 -39
- data/src/gocr-0.48/doc/example.dtd +0 -53
- data/src/gocr-0.48/doc/example.xml +0 -21
- data/src/gocr-0.48/doc/examples.txt +0 -67
- data/src/gocr-0.48/doc/gocr.html +0 -578
- data/src/gocr-0.48/doc/unicode.txt +0 -57
- data/src/gocr-0.48/examples/.#Makefile.1.22 +0 -166
- data/src/gocr-0.48/examples/4x6.png +0 -0
- data/src/gocr-0.48/examples/4x6.txt +0 -2
- data/src/gocr-0.48/examples/5x7.png +0 -0
- data/src/gocr-0.48/examples/5x7.png.txt +0 -2
- data/src/gocr-0.48/examples/5x8.png +0 -0
- data/src/gocr-0.48/examples/5x8.png.txt +0 -2
- data/src/gocr-0.48/examples/Makefile +0 -166
- data/src/gocr-0.48/examples/color.fig +0 -20
- data/src/gocr-0.48/examples/ex.fig +0 -16
- data/src/gocr-0.48/examples/font.tex +0 -22
- data/src/gocr-0.48/examples/font1.tex +0 -46
- data/src/gocr-0.48/examples/font2.fig +0 -27
- data/src/gocr-0.48/examples/font_nw.tex +0 -24
- data/src/gocr-0.48/examples/handwrt1.jpg +0 -0
- data/src/gocr-0.48/examples/handwrt1.txt +0 -10
- data/src/gocr-0.48/examples/inverse.fig +0 -20
- 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 +0 -4
- data/src/gocr-0.48/examples/ocr-a.png +0 -0
- data/src/gocr-0.48/examples/ocr-a.txt +0 -6
- data/src/gocr-0.48/examples/ocr-b.png +0 -0
- data/src/gocr-0.48/examples/ocr-b.png.txt +0 -4
- data/src/gocr-0.48/examples/polish.tex +0 -28
- data/src/gocr-0.48/examples/rotate45.fig +0 -14
- data/src/gocr-0.48/examples/score +0 -36
- data/src/gocr-0.48/examples/text.tex +0 -28
- data/src/gocr-0.48/gpl.html +0 -537
- data/src/gocr-0.48/include/.cvsignore +0 -2
- data/src/gocr-0.48/include/config.h +0 -36
- data/src/gocr-0.48/include/config.h.in +0 -36
- data/src/gocr-0.48/include/version.h +0 -2
- data/src/gocr-0.48/install-sh +0 -3
- data/src/gocr-0.48/make.bat +0 -57
- data/src/gocr-0.48/man/.cvsignore +0 -2
- data/src/gocr-0.48/man/Makefile +0 -29
- data/src/gocr-0.48/man/Makefile.in +0 -29
- data/src/gocr-0.48/man/man1/gocr.1 +0 -166
- data/src/gocr-0.48/src/.cvsignore +0 -4
- data/src/gocr-0.48/src/Makefile +0 -132
- data/src/gocr-0.48/src/Makefile.in +0 -132
- data/src/gocr-0.48/src/amiga.h +0 -31
- data/src/gocr-0.48/src/barcode.c +0 -846
- data/src/gocr-0.48/src/barcode.c.orig +0 -593
- data/src/gocr-0.48/src/barcode.h +0 -11
- data/src/gocr-0.48/src/box.c +0 -372
- data/src/gocr-0.48/src/database.c +0 -462
- data/src/gocr-0.48/src/detect.c +0 -943
- data/src/gocr-0.48/src/gocr.c +0 -373
- data/src/gocr-0.48/src/gocr.h +0 -288
- data/src/gocr-0.48/src/jconv.c +0 -168
- data/src/gocr-0.48/src/job.c +0 -84
- data/src/gocr-0.48/src/lines.c +0 -350
- data/src/gocr-0.48/src/list.c +0 -334
- data/src/gocr-0.48/src/list.h +0 -90
- data/src/gocr-0.48/src/ocr0.c +0 -6756
- data/src/gocr-0.48/src/ocr0.h +0 -63
- data/src/gocr-0.48/src/ocr0n.c +0 -1475
- data/src/gocr-0.48/src/ocr1.c +0 -85
- data/src/gocr-0.48/src/ocr1.h +0 -3
- data/src/gocr-0.48/src/otsu.c +0 -289
- data/src/gocr-0.48/src/otsu.h +0 -23
- data/src/gocr-0.48/src/output.c +0 -289
- data/src/gocr-0.48/src/output.h +0 -37
- data/src/gocr-0.48/src/pcx.c +0 -153
- data/src/gocr-0.48/src/pcx.h +0 -9
- data/src/gocr-0.48/src/pgm2asc.c +0 -2893
- data/src/gocr-0.48/src/pgm2asc.h +0 -105
- data/src/gocr-0.48/src/pixel.c +0 -537
- data/src/gocr-0.48/src/pnm.c +0 -533
- data/src/gocr-0.48/src/pnm.h +0 -35
- data/src/gocr-0.48/src/progress.c +0 -87
- data/src/gocr-0.48/src/progress.h +0 -42
- data/src/gocr-0.48/src/remove.c +0 -703
- data/src/gocr-0.48/src/tga.c +0 -87
- data/src/gocr-0.48/src/tga.h +0 -6
- data/src/gocr-0.48/src/unicode.c +0 -1314
- data/src/gocr-0.48/src/unicode.h +0 -1257
- data/src/jpeg-7/Makefile.am +0 -133
- data/src/jpeg-7/Makefile.in +0 -1089
- data/src/jpeg-7/README +0 -322
- data/src/jpeg-7/aclocal.m4 +0 -8990
- data/src/jpeg-7/ansi2knr.1 +0 -36
- data/src/jpeg-7/ansi2knr.c +0 -739
- data/src/jpeg-7/cderror.h +0 -132
- data/src/jpeg-7/cdjpeg.c +0 -181
- data/src/jpeg-7/cdjpeg.h +0 -187
- data/src/jpeg-7/change.log +0 -270
- data/src/jpeg-7/cjpeg.1 +0 -325
- data/src/jpeg-7/cjpeg.c +0 -616
- data/src/jpeg-7/ckconfig.c +0 -402
- data/src/jpeg-7/coderules.txt +0 -118
- data/src/jpeg-7/config.guess +0 -1561
- data/src/jpeg-7/config.sub +0 -1686
- data/src/jpeg-7/configure +0 -17139
- data/src/jpeg-7/configure.ac +0 -317
- data/src/jpeg-7/depcomp +0 -630
- data/src/jpeg-7/djpeg.1 +0 -251
- data/src/jpeg-7/djpeg.c +0 -617
- data/src/jpeg-7/example.c +0 -433
- data/src/jpeg-7/filelist.txt +0 -215
- data/src/jpeg-7/install-sh +0 -520
- data/src/jpeg-7/install.txt +0 -1097
- data/src/jpeg-7/jaricom.c +0 -148
- data/src/jpeg-7/jcapimin.c +0 -282
- data/src/jpeg-7/jcapistd.c +0 -161
- data/src/jpeg-7/jcarith.c +0 -921
- data/src/jpeg-7/jccoefct.c +0 -453
- data/src/jpeg-7/jccolor.c +0 -459
- data/src/jpeg-7/jcdctmgr.c +0 -482
- data/src/jpeg-7/jchuff.c +0 -1612
- data/src/jpeg-7/jcinit.c +0 -65
- data/src/jpeg-7/jcmainct.c +0 -293
- data/src/jpeg-7/jcmarker.c +0 -667
- data/src/jpeg-7/jcmaster.c +0 -770
- data/src/jpeg-7/jcomapi.c +0 -106
- data/src/jpeg-7/jconfig.bcc +0 -48
- data/src/jpeg-7/jconfig.cfg +0 -45
- data/src/jpeg-7/jconfig.dj +0 -38
- data/src/jpeg-7/jconfig.mac +0 -43
- data/src/jpeg-7/jconfig.manx +0 -43
- data/src/jpeg-7/jconfig.mc6 +0 -52
- data/src/jpeg-7/jconfig.sas +0 -43
- data/src/jpeg-7/jconfig.st +0 -42
- data/src/jpeg-7/jconfig.txt +0 -155
- data/src/jpeg-7/jconfig.vc +0 -45
- data/src/jpeg-7/jconfig.vms +0 -37
- data/src/jpeg-7/jconfig.wat +0 -38
- data/src/jpeg-7/jcparam.c +0 -632
- data/src/jpeg-7/jcprepct.c +0 -358
- data/src/jpeg-7/jcsample.c +0 -545
- data/src/jpeg-7/jctrans.c +0 -381
- data/src/jpeg-7/jdapimin.c +0 -396
- data/src/jpeg-7/jdapistd.c +0 -275
- data/src/jpeg-7/jdarith.c +0 -762
- data/src/jpeg-7/jdatadst.c +0 -151
- data/src/jpeg-7/jdatasrc.c +0 -212
- data/src/jpeg-7/jdcoefct.c +0 -736
- data/src/jpeg-7/jdcolor.c +0 -396
- data/src/jpeg-7/jdct.h +0 -393
- data/src/jpeg-7/jddctmgr.c +0 -382
- data/src/jpeg-7/jdhuff.c +0 -1309
- data/src/jpeg-7/jdinput.c +0 -384
- data/src/jpeg-7/jdmainct.c +0 -512
- data/src/jpeg-7/jdmarker.c +0 -1360
- data/src/jpeg-7/jdmaster.c +0 -663
- data/src/jpeg-7/jdmerge.c +0 -400
- data/src/jpeg-7/jdpostct.c +0 -290
- data/src/jpeg-7/jdsample.c +0 -361
- data/src/jpeg-7/jdtrans.c +0 -136
- data/src/jpeg-7/jerror.c +0 -252
- data/src/jpeg-7/jerror.h +0 -304
- data/src/jpeg-7/jfdctflt.c +0 -174
- data/src/jpeg-7/jfdctfst.c +0 -230
- data/src/jpeg-7/jfdctint.c +0 -4348
- data/src/jpeg-7/jidctflt.c +0 -242
- data/src/jpeg-7/jidctfst.c +0 -368
- data/src/jpeg-7/jidctint.c +0 -5137
- data/src/jpeg-7/jinclude.h +0 -91
- data/src/jpeg-7/jmemansi.c +0 -167
- data/src/jpeg-7/jmemdos.c +0 -638
- data/src/jpeg-7/jmemdosa.asm +0 -379
- data/src/jpeg-7/jmemmac.c +0 -289
- data/src/jpeg-7/jmemmgr.c +0 -1118
- data/src/jpeg-7/jmemname.c +0 -276
- data/src/jpeg-7/jmemnobs.c +0 -109
- data/src/jpeg-7/jmemsys.h +0 -198
- data/src/jpeg-7/jmorecfg.h +0 -369
- data/src/jpeg-7/jpegint.h +0 -395
- data/src/jpeg-7/jpeglib.h +0 -1135
- data/src/jpeg-7/jpegtran.1 +0 -272
- data/src/jpeg-7/jpegtran.c +0 -546
- data/src/jpeg-7/jquant1.c +0 -856
- data/src/jpeg-7/jquant2.c +0 -1310
- data/src/jpeg-7/jutils.c +0 -179
- data/src/jpeg-7/jversion.h +0 -14
- data/src/jpeg-7/libjpeg.map +0 -4
- data/src/jpeg-7/libjpeg.txt +0 -3067
- data/src/jpeg-7/ltmain.sh +0 -8406
- data/src/jpeg-7/makcjpeg.st +0 -36
- data/src/jpeg-7/makdjpeg.st +0 -36
- data/src/jpeg-7/makeadsw.vc6 +0 -77
- data/src/jpeg-7/makeasln.vc9 +0 -33
- data/src/jpeg-7/makecdep.vc6 +0 -82
- data/src/jpeg-7/makecdsp.vc6 +0 -130
- data/src/jpeg-7/makecmak.vc6 +0 -159
- data/src/jpeg-7/makecvcp.vc9 +0 -186
- data/src/jpeg-7/makeddep.vc6 +0 -82
- data/src/jpeg-7/makeddsp.vc6 +0 -130
- data/src/jpeg-7/makedmak.vc6 +0 -159
- data/src/jpeg-7/makedvcp.vc9 +0 -186
- data/src/jpeg-7/makefile.ansi +0 -220
- data/src/jpeg-7/makefile.bcc +0 -291
- data/src/jpeg-7/makefile.dj +0 -226
- data/src/jpeg-7/makefile.manx +0 -220
- data/src/jpeg-7/makefile.mc6 +0 -255
- data/src/jpeg-7/makefile.mms +0 -224
- data/src/jpeg-7/makefile.sas +0 -258
- data/src/jpeg-7/makefile.unix +0 -234
- data/src/jpeg-7/makefile.vc +0 -217
- data/src/jpeg-7/makefile.vms +0 -142
- data/src/jpeg-7/makefile.wat +0 -239
- data/src/jpeg-7/makejdep.vc6 +0 -423
- data/src/jpeg-7/makejdsp.vc6 +0 -285
- data/src/jpeg-7/makejdsw.vc6 +0 -29
- data/src/jpeg-7/makejmak.vc6 +0 -425
- data/src/jpeg-7/makejsln.vc9 +0 -17
- data/src/jpeg-7/makejvcp.vc9 +0 -328
- data/src/jpeg-7/makeproj.mac +0 -213
- data/src/jpeg-7/makerdep.vc6 +0 -6
- data/src/jpeg-7/makerdsp.vc6 +0 -78
- data/src/jpeg-7/makermak.vc6 +0 -110
- data/src/jpeg-7/makervcp.vc9 +0 -133
- data/src/jpeg-7/maketdep.vc6 +0 -43
- data/src/jpeg-7/maketdsp.vc6 +0 -122
- data/src/jpeg-7/maketmak.vc6 +0 -131
- data/src/jpeg-7/maketvcp.vc9 +0 -178
- data/src/jpeg-7/makewdep.vc6 +0 -6
- data/src/jpeg-7/makewdsp.vc6 +0 -78
- data/src/jpeg-7/makewmak.vc6 +0 -110
- data/src/jpeg-7/makewvcp.vc9 +0 -133
- data/src/jpeg-7/makljpeg.st +0 -68
- data/src/jpeg-7/maktjpeg.st +0 -30
- data/src/jpeg-7/makvms.opt +0 -4
- data/src/jpeg-7/missing +0 -376
- data/src/jpeg-7/rdbmp.c +0 -439
- data/src/jpeg-7/rdcolmap.c +0 -253
- data/src/jpeg-7/rdgif.c +0 -38
- data/src/jpeg-7/rdjpgcom.1 +0 -63
- data/src/jpeg-7/rdjpgcom.c +0 -515
- data/src/jpeg-7/rdppm.c +0 -459
- data/src/jpeg-7/rdrle.c +0 -387
- data/src/jpeg-7/rdswitch.c +0 -365
- data/src/jpeg-7/rdtarga.c +0 -500
- data/src/jpeg-7/structure.txt +0 -945
- data/src/jpeg-7/testimg.bmp +0 -0
- data/src/jpeg-7/testimg.jpg +0 -0
- data/src/jpeg-7/testimg.ppm +0 -4
- 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 +0 -1533
- data/src/jpeg-7/transupp.h +0 -205
- data/src/jpeg-7/usage.txt +0 -605
- data/src/jpeg-7/wizard.txt +0 -211
- data/src/jpeg-7/wrbmp.c +0 -442
- data/src/jpeg-7/wrgif.c +0 -399
- data/src/jpeg-7/wrjpgcom.1 +0 -103
- data/src/jpeg-7/wrjpgcom.c +0 -583
- data/src/jpeg-7/wrppm.c +0 -269
- data/src/jpeg-7/wrrle.c +0 -305
- data/src/jpeg-7/wrtarga.c +0 -253
data/src/jpeg-7/jaricom.c
DELETED
@@ -1,148 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* jaricom.c
|
3
|
-
*
|
4
|
-
* Developed 1997 by Guido Vollbeding.
|
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 probability estimation tables for common use in
|
9
|
-
* arithmetic entropy encoding and decoding routines.
|
10
|
-
*
|
11
|
-
* This data represents Table D.2 in the JPEG spec (ISO/IEC IS 10918-1
|
12
|
-
* and CCITT Recommendation ITU-T T.81) and Table 24 in the JBIG spec
|
13
|
-
* (ISO/IEC IS 11544 and CCITT Recommendation ITU-T T.82).
|
14
|
-
*/
|
15
|
-
|
16
|
-
#define JPEG_INTERNALS
|
17
|
-
#include "jinclude.h"
|
18
|
-
#include "jpeglib.h"
|
19
|
-
|
20
|
-
/* The following #define specifies the packing of the four components
|
21
|
-
* into the compact INT32 representation.
|
22
|
-
* Note that this formula must match the actual arithmetic encoder
|
23
|
-
* and decoder implementation. The implementation has to be changed
|
24
|
-
* if this formula is changed.
|
25
|
-
* The current organization is leaned on Markus Kuhn's JBIG
|
26
|
-
* implementation (jbig_tab.c).
|
27
|
-
*/
|
28
|
-
|
29
|
-
#define V(a,b,c,d) (((INT32)a << 16) | ((INT32)c << 8) | ((INT32)d << 7) | b)
|
30
|
-
|
31
|
-
const INT32 jaritab[113] = {
|
32
|
-
/*
|
33
|
-
* Index, Qe_Value, Next_Index_LPS, Next_Index_MPS, Switch_MPS
|
34
|
-
*/
|
35
|
-
/* 0 */ V( 0x5a1d, 1, 1, 1 ),
|
36
|
-
/* 1 */ V( 0x2586, 14, 2, 0 ),
|
37
|
-
/* 2 */ V( 0x1114, 16, 3, 0 ),
|
38
|
-
/* 3 */ V( 0x080b, 18, 4, 0 ),
|
39
|
-
/* 4 */ V( 0x03d8, 20, 5, 0 ),
|
40
|
-
/* 5 */ V( 0x01da, 23, 6, 0 ),
|
41
|
-
/* 6 */ V( 0x00e5, 25, 7, 0 ),
|
42
|
-
/* 7 */ V( 0x006f, 28, 8, 0 ),
|
43
|
-
/* 8 */ V( 0x0036, 30, 9, 0 ),
|
44
|
-
/* 9 */ V( 0x001a, 33, 10, 0 ),
|
45
|
-
/* 10 */ V( 0x000d, 35, 11, 0 ),
|
46
|
-
/* 11 */ V( 0x0006, 9, 12, 0 ),
|
47
|
-
/* 12 */ V( 0x0003, 10, 13, 0 ),
|
48
|
-
/* 13 */ V( 0x0001, 12, 13, 0 ),
|
49
|
-
/* 14 */ V( 0x5a7f, 15, 15, 1 ),
|
50
|
-
/* 15 */ V( 0x3f25, 36, 16, 0 ),
|
51
|
-
/* 16 */ V( 0x2cf2, 38, 17, 0 ),
|
52
|
-
/* 17 */ V( 0x207c, 39, 18, 0 ),
|
53
|
-
/* 18 */ V( 0x17b9, 40, 19, 0 ),
|
54
|
-
/* 19 */ V( 0x1182, 42, 20, 0 ),
|
55
|
-
/* 20 */ V( 0x0cef, 43, 21, 0 ),
|
56
|
-
/* 21 */ V( 0x09a1, 45, 22, 0 ),
|
57
|
-
/* 22 */ V( 0x072f, 46, 23, 0 ),
|
58
|
-
/* 23 */ V( 0x055c, 48, 24, 0 ),
|
59
|
-
/* 24 */ V( 0x0406, 49, 25, 0 ),
|
60
|
-
/* 25 */ V( 0x0303, 51, 26, 0 ),
|
61
|
-
/* 26 */ V( 0x0240, 52, 27, 0 ),
|
62
|
-
/* 27 */ V( 0x01b1, 54, 28, 0 ),
|
63
|
-
/* 28 */ V( 0x0144, 56, 29, 0 ),
|
64
|
-
/* 29 */ V( 0x00f5, 57, 30, 0 ),
|
65
|
-
/* 30 */ V( 0x00b7, 59, 31, 0 ),
|
66
|
-
/* 31 */ V( 0x008a, 60, 32, 0 ),
|
67
|
-
/* 32 */ V( 0x0068, 62, 33, 0 ),
|
68
|
-
/* 33 */ V( 0x004e, 63, 34, 0 ),
|
69
|
-
/* 34 */ V( 0x003b, 32, 35, 0 ),
|
70
|
-
/* 35 */ V( 0x002c, 33, 9, 0 ),
|
71
|
-
/* 36 */ V( 0x5ae1, 37, 37, 1 ),
|
72
|
-
/* 37 */ V( 0x484c, 64, 38, 0 ),
|
73
|
-
/* 38 */ V( 0x3a0d, 65, 39, 0 ),
|
74
|
-
/* 39 */ V( 0x2ef1, 67, 40, 0 ),
|
75
|
-
/* 40 */ V( 0x261f, 68, 41, 0 ),
|
76
|
-
/* 41 */ V( 0x1f33, 69, 42, 0 ),
|
77
|
-
/* 42 */ V( 0x19a8, 70, 43, 0 ),
|
78
|
-
/* 43 */ V( 0x1518, 72, 44, 0 ),
|
79
|
-
/* 44 */ V( 0x1177, 73, 45, 0 ),
|
80
|
-
/* 45 */ V( 0x0e74, 74, 46, 0 ),
|
81
|
-
/* 46 */ V( 0x0bfb, 75, 47, 0 ),
|
82
|
-
/* 47 */ V( 0x09f8, 77, 48, 0 ),
|
83
|
-
/* 48 */ V( 0x0861, 78, 49, 0 ),
|
84
|
-
/* 49 */ V( 0x0706, 79, 50, 0 ),
|
85
|
-
/* 50 */ V( 0x05cd, 48, 51, 0 ),
|
86
|
-
/* 51 */ V( 0x04de, 50, 52, 0 ),
|
87
|
-
/* 52 */ V( 0x040f, 50, 53, 0 ),
|
88
|
-
/* 53 */ V( 0x0363, 51, 54, 0 ),
|
89
|
-
/* 54 */ V( 0x02d4, 52, 55, 0 ),
|
90
|
-
/* 55 */ V( 0x025c, 53, 56, 0 ),
|
91
|
-
/* 56 */ V( 0x01f8, 54, 57, 0 ),
|
92
|
-
/* 57 */ V( 0x01a4, 55, 58, 0 ),
|
93
|
-
/* 58 */ V( 0x0160, 56, 59, 0 ),
|
94
|
-
/* 59 */ V( 0x0125, 57, 60, 0 ),
|
95
|
-
/* 60 */ V( 0x00f6, 58, 61, 0 ),
|
96
|
-
/* 61 */ V( 0x00cb, 59, 62, 0 ),
|
97
|
-
/* 62 */ V( 0x00ab, 61, 63, 0 ),
|
98
|
-
/* 63 */ V( 0x008f, 61, 32, 0 ),
|
99
|
-
/* 64 */ V( 0x5b12, 65, 65, 1 ),
|
100
|
-
/* 65 */ V( 0x4d04, 80, 66, 0 ),
|
101
|
-
/* 66 */ V( 0x412c, 81, 67, 0 ),
|
102
|
-
/* 67 */ V( 0x37d8, 82, 68, 0 ),
|
103
|
-
/* 68 */ V( 0x2fe8, 83, 69, 0 ),
|
104
|
-
/* 69 */ V( 0x293c, 84, 70, 0 ),
|
105
|
-
/* 70 */ V( 0x2379, 86, 71, 0 ),
|
106
|
-
/* 71 */ V( 0x1edf, 87, 72, 0 ),
|
107
|
-
/* 72 */ V( 0x1aa9, 87, 73, 0 ),
|
108
|
-
/* 73 */ V( 0x174e, 72, 74, 0 ),
|
109
|
-
/* 74 */ V( 0x1424, 72, 75, 0 ),
|
110
|
-
/* 75 */ V( 0x119c, 74, 76, 0 ),
|
111
|
-
/* 76 */ V( 0x0f6b, 74, 77, 0 ),
|
112
|
-
/* 77 */ V( 0x0d51, 75, 78, 0 ),
|
113
|
-
/* 78 */ V( 0x0bb6, 77, 79, 0 ),
|
114
|
-
/* 79 */ V( 0x0a40, 77, 48, 0 ),
|
115
|
-
/* 80 */ V( 0x5832, 80, 81, 1 ),
|
116
|
-
/* 81 */ V( 0x4d1c, 88, 82, 0 ),
|
117
|
-
/* 82 */ V( 0x438e, 89, 83, 0 ),
|
118
|
-
/* 83 */ V( 0x3bdd, 90, 84, 0 ),
|
119
|
-
/* 84 */ V( 0x34ee, 91, 85, 0 ),
|
120
|
-
/* 85 */ V( 0x2eae, 92, 86, 0 ),
|
121
|
-
/* 86 */ V( 0x299a, 93, 87, 0 ),
|
122
|
-
/* 87 */ V( 0x2516, 86, 71, 0 ),
|
123
|
-
/* 88 */ V( 0x5570, 88, 89, 1 ),
|
124
|
-
/* 89 */ V( 0x4ca9, 95, 90, 0 ),
|
125
|
-
/* 90 */ V( 0x44d9, 96, 91, 0 ),
|
126
|
-
/* 91 */ V( 0x3e22, 97, 92, 0 ),
|
127
|
-
/* 92 */ V( 0x3824, 99, 93, 0 ),
|
128
|
-
/* 93 */ V( 0x32b4, 99, 94, 0 ),
|
129
|
-
/* 94 */ V( 0x2e17, 93, 86, 0 ),
|
130
|
-
/* 95 */ V( 0x56a8, 95, 96, 1 ),
|
131
|
-
/* 96 */ V( 0x4f46, 101, 97, 0 ),
|
132
|
-
/* 97 */ V( 0x47e5, 102, 98, 0 ),
|
133
|
-
/* 98 */ V( 0x41cf, 103, 99, 0 ),
|
134
|
-
/* 99 */ V( 0x3c3d, 104, 100, 0 ),
|
135
|
-
/* 100 */ V( 0x375e, 99, 93, 0 ),
|
136
|
-
/* 101 */ V( 0x5231, 105, 102, 0 ),
|
137
|
-
/* 102 */ V( 0x4c0f, 106, 103, 0 ),
|
138
|
-
/* 103 */ V( 0x4639, 107, 104, 0 ),
|
139
|
-
/* 104 */ V( 0x415e, 103, 99, 0 ),
|
140
|
-
/* 105 */ V( 0x5627, 105, 106, 1 ),
|
141
|
-
/* 106 */ V( 0x50e7, 108, 107, 0 ),
|
142
|
-
/* 107 */ V( 0x4b85, 109, 103, 0 ),
|
143
|
-
/* 108 */ V( 0x5597, 110, 109, 0 ),
|
144
|
-
/* 109 */ V( 0x504f, 111, 107, 0 ),
|
145
|
-
/* 110 */ V( 0x5a10, 110, 111, 1 ),
|
146
|
-
/* 111 */ V( 0x5522, 112, 109, 0 ),
|
147
|
-
/* 112 */ V( 0x59eb, 112, 111, 1 )
|
148
|
-
};
|
data/src/jpeg-7/jcapimin.c
DELETED
@@ -1,282 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* jcapimin.c
|
3
|
-
*
|
4
|
-
* Copyright (C) 1994-1998, 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 application interface code for the compression half
|
9
|
-
* of the JPEG library. These are the "minimum" API routines that may be
|
10
|
-
* needed in either the normal full-compression case or the transcoding-only
|
11
|
-
* case.
|
12
|
-
*
|
13
|
-
* Most of the routines intended to be called directly by an application
|
14
|
-
* are in this file or in jcapistd.c. But also see jcparam.c for
|
15
|
-
* parameter-setup helper routines, jcomapi.c for routines shared by
|
16
|
-
* compression and decompression, and jctrans.c for the transcoding case.
|
17
|
-
*/
|
18
|
-
|
19
|
-
#define JPEG_INTERNALS
|
20
|
-
#include "jinclude.h"
|
21
|
-
#include "jpeglib.h"
|
22
|
-
|
23
|
-
|
24
|
-
/*
|
25
|
-
* Initialization of a JPEG compression object.
|
26
|
-
* The error manager must already be set up (in case memory manager fails).
|
27
|
-
*/
|
28
|
-
|
29
|
-
GLOBAL(void)
|
30
|
-
jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize)
|
31
|
-
{
|
32
|
-
int i;
|
33
|
-
|
34
|
-
/* Guard against version mismatches between library and caller. */
|
35
|
-
cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */
|
36
|
-
if (version != JPEG_LIB_VERSION)
|
37
|
-
ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
|
38
|
-
if (structsize != SIZEOF(struct jpeg_compress_struct))
|
39
|
-
ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,
|
40
|
-
(int) SIZEOF(struct jpeg_compress_struct), (int) structsize);
|
41
|
-
|
42
|
-
/* For debugging purposes, we zero the whole master structure.
|
43
|
-
* But the application has already set the err pointer, and may have set
|
44
|
-
* client_data, so we have to save and restore those fields.
|
45
|
-
* Note: if application hasn't set client_data, tools like Purify may
|
46
|
-
* complain here.
|
47
|
-
*/
|
48
|
-
{
|
49
|
-
struct jpeg_error_mgr * err = cinfo->err;
|
50
|
-
void * client_data = cinfo->client_data; /* ignore Purify complaint here */
|
51
|
-
MEMZERO(cinfo, SIZEOF(struct jpeg_compress_struct));
|
52
|
-
cinfo->err = err;
|
53
|
-
cinfo->client_data = client_data;
|
54
|
-
}
|
55
|
-
cinfo->is_decompressor = FALSE;
|
56
|
-
|
57
|
-
/* Initialize a memory manager instance for this object */
|
58
|
-
jinit_memory_mgr((j_common_ptr) cinfo);
|
59
|
-
|
60
|
-
/* Zero out pointers to permanent structures. */
|
61
|
-
cinfo->progress = NULL;
|
62
|
-
cinfo->dest = NULL;
|
63
|
-
|
64
|
-
cinfo->comp_info = NULL;
|
65
|
-
|
66
|
-
for (i = 0; i < NUM_QUANT_TBLS; i++) {
|
67
|
-
cinfo->quant_tbl_ptrs[i] = NULL;
|
68
|
-
cinfo->q_scale_factor[i] = 100;
|
69
|
-
}
|
70
|
-
|
71
|
-
for (i = 0; i < NUM_HUFF_TBLS; i++) {
|
72
|
-
cinfo->dc_huff_tbl_ptrs[i] = NULL;
|
73
|
-
cinfo->ac_huff_tbl_ptrs[i] = NULL;
|
74
|
-
}
|
75
|
-
|
76
|
-
cinfo->script_space = NULL;
|
77
|
-
|
78
|
-
cinfo->input_gamma = 1.0; /* in case application forgets */
|
79
|
-
|
80
|
-
/* OK, I'm ready */
|
81
|
-
cinfo->global_state = CSTATE_START;
|
82
|
-
}
|
83
|
-
|
84
|
-
|
85
|
-
/*
|
86
|
-
* Destruction of a JPEG compression object
|
87
|
-
*/
|
88
|
-
|
89
|
-
GLOBAL(void)
|
90
|
-
jpeg_destroy_compress (j_compress_ptr cinfo)
|
91
|
-
{
|
92
|
-
jpeg_destroy((j_common_ptr) cinfo); /* use common routine */
|
93
|
-
}
|
94
|
-
|
95
|
-
|
96
|
-
/*
|
97
|
-
* Abort processing of a JPEG compression operation,
|
98
|
-
* but don't destroy the object itself.
|
99
|
-
*/
|
100
|
-
|
101
|
-
GLOBAL(void)
|
102
|
-
jpeg_abort_compress (j_compress_ptr cinfo)
|
103
|
-
{
|
104
|
-
jpeg_abort((j_common_ptr) cinfo); /* use common routine */
|
105
|
-
}
|
106
|
-
|
107
|
-
|
108
|
-
/*
|
109
|
-
* Forcibly suppress or un-suppress all quantization and Huffman tables.
|
110
|
-
* Marks all currently defined tables as already written (if suppress)
|
111
|
-
* or not written (if !suppress). This will control whether they get emitted
|
112
|
-
* by a subsequent jpeg_start_compress call.
|
113
|
-
*
|
114
|
-
* This routine is exported for use by applications that want to produce
|
115
|
-
* abbreviated JPEG datastreams. It logically belongs in jcparam.c, but
|
116
|
-
* since it is called by jpeg_start_compress, we put it here --- otherwise
|
117
|
-
* jcparam.o would be linked whether the application used it or not.
|
118
|
-
*/
|
119
|
-
|
120
|
-
GLOBAL(void)
|
121
|
-
jpeg_suppress_tables (j_compress_ptr cinfo, boolean suppress)
|
122
|
-
{
|
123
|
-
int i;
|
124
|
-
JQUANT_TBL * qtbl;
|
125
|
-
JHUFF_TBL * htbl;
|
126
|
-
|
127
|
-
for (i = 0; i < NUM_QUANT_TBLS; i++) {
|
128
|
-
if ((qtbl = cinfo->quant_tbl_ptrs[i]) != NULL)
|
129
|
-
qtbl->sent_table = suppress;
|
130
|
-
}
|
131
|
-
|
132
|
-
for (i = 0; i < NUM_HUFF_TBLS; i++) {
|
133
|
-
if ((htbl = cinfo->dc_huff_tbl_ptrs[i]) != NULL)
|
134
|
-
htbl->sent_table = suppress;
|
135
|
-
if ((htbl = cinfo->ac_huff_tbl_ptrs[i]) != NULL)
|
136
|
-
htbl->sent_table = suppress;
|
137
|
-
}
|
138
|
-
}
|
139
|
-
|
140
|
-
|
141
|
-
/*
|
142
|
-
* Finish JPEG compression.
|
143
|
-
*
|
144
|
-
* If a multipass operating mode was selected, this may do a great deal of
|
145
|
-
* work including most of the actual output.
|
146
|
-
*/
|
147
|
-
|
148
|
-
GLOBAL(void)
|
149
|
-
jpeg_finish_compress (j_compress_ptr cinfo)
|
150
|
-
{
|
151
|
-
JDIMENSION iMCU_row;
|
152
|
-
|
153
|
-
if (cinfo->global_state == CSTATE_SCANNING ||
|
154
|
-
cinfo->global_state == CSTATE_RAW_OK) {
|
155
|
-
/* Terminate first pass */
|
156
|
-
if (cinfo->next_scanline < cinfo->image_height)
|
157
|
-
ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);
|
158
|
-
(*cinfo->master->finish_pass) (cinfo);
|
159
|
-
} else if (cinfo->global_state != CSTATE_WRCOEFS)
|
160
|
-
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
161
|
-
/* Perform any remaining passes */
|
162
|
-
while (! cinfo->master->is_last_pass) {
|
163
|
-
(*cinfo->master->prepare_for_pass) (cinfo);
|
164
|
-
for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++) {
|
165
|
-
if (cinfo->progress != NULL) {
|
166
|
-
cinfo->progress->pass_counter = (long) iMCU_row;
|
167
|
-
cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows;
|
168
|
-
(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
|
169
|
-
}
|
170
|
-
/* We bypass the main controller and invoke coef controller directly;
|
171
|
-
* all work is being done from the coefficient buffer.
|
172
|
-
*/
|
173
|
-
if (! (*cinfo->coef->compress_data) (cinfo, (JSAMPIMAGE) NULL))
|
174
|
-
ERREXIT(cinfo, JERR_CANT_SUSPEND);
|
175
|
-
}
|
176
|
-
(*cinfo->master->finish_pass) (cinfo);
|
177
|
-
}
|
178
|
-
/* Write EOI, do final cleanup */
|
179
|
-
(*cinfo->marker->write_file_trailer) (cinfo);
|
180
|
-
(*cinfo->dest->term_destination) (cinfo);
|
181
|
-
/* We can use jpeg_abort to release memory and reset global_state */
|
182
|
-
jpeg_abort((j_common_ptr) cinfo);
|
183
|
-
}
|
184
|
-
|
185
|
-
|
186
|
-
/*
|
187
|
-
* Write a special marker.
|
188
|
-
* This is only recommended for writing COM or APPn markers.
|
189
|
-
* Must be called after jpeg_start_compress() and before
|
190
|
-
* first call to jpeg_write_scanlines() or jpeg_write_raw_data().
|
191
|
-
*/
|
192
|
-
|
193
|
-
GLOBAL(void)
|
194
|
-
jpeg_write_marker (j_compress_ptr cinfo, int marker,
|
195
|
-
const JOCTET *dataptr, unsigned int datalen)
|
196
|
-
{
|
197
|
-
JMETHOD(void, write_marker_byte, (j_compress_ptr info, int val));
|
198
|
-
|
199
|
-
if (cinfo->next_scanline != 0 ||
|
200
|
-
(cinfo->global_state != CSTATE_SCANNING &&
|
201
|
-
cinfo->global_state != CSTATE_RAW_OK &&
|
202
|
-
cinfo->global_state != CSTATE_WRCOEFS))
|
203
|
-
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
204
|
-
|
205
|
-
(*cinfo->marker->write_marker_header) (cinfo, marker, datalen);
|
206
|
-
write_marker_byte = cinfo->marker->write_marker_byte; /* copy for speed */
|
207
|
-
while (datalen--) {
|
208
|
-
(*write_marker_byte) (cinfo, *dataptr);
|
209
|
-
dataptr++;
|
210
|
-
}
|
211
|
-
}
|
212
|
-
|
213
|
-
/* Same, but piecemeal. */
|
214
|
-
|
215
|
-
GLOBAL(void)
|
216
|
-
jpeg_write_m_header (j_compress_ptr cinfo, int marker, unsigned int datalen)
|
217
|
-
{
|
218
|
-
if (cinfo->next_scanline != 0 ||
|
219
|
-
(cinfo->global_state != CSTATE_SCANNING &&
|
220
|
-
cinfo->global_state != CSTATE_RAW_OK &&
|
221
|
-
cinfo->global_state != CSTATE_WRCOEFS))
|
222
|
-
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
223
|
-
|
224
|
-
(*cinfo->marker->write_marker_header) (cinfo, marker, datalen);
|
225
|
-
}
|
226
|
-
|
227
|
-
GLOBAL(void)
|
228
|
-
jpeg_write_m_byte (j_compress_ptr cinfo, int val)
|
229
|
-
{
|
230
|
-
(*cinfo->marker->write_marker_byte) (cinfo, val);
|
231
|
-
}
|
232
|
-
|
233
|
-
|
234
|
-
/*
|
235
|
-
* Alternate compression function: just write an abbreviated table file.
|
236
|
-
* Before calling this, all parameters and a data destination must be set up.
|
237
|
-
*
|
238
|
-
* To produce a pair of files containing abbreviated tables and abbreviated
|
239
|
-
* image data, one would proceed as follows:
|
240
|
-
*
|
241
|
-
* initialize JPEG object
|
242
|
-
* set JPEG parameters
|
243
|
-
* set destination to table file
|
244
|
-
* jpeg_write_tables(cinfo);
|
245
|
-
* set destination to image file
|
246
|
-
* jpeg_start_compress(cinfo, FALSE);
|
247
|
-
* write data...
|
248
|
-
* jpeg_finish_compress(cinfo);
|
249
|
-
*
|
250
|
-
* jpeg_write_tables has the side effect of marking all tables written
|
251
|
-
* (same as jpeg_suppress_tables(..., TRUE)). Thus a subsequent start_compress
|
252
|
-
* will not re-emit the tables unless it is passed write_all_tables=TRUE.
|
253
|
-
*/
|
254
|
-
|
255
|
-
GLOBAL(void)
|
256
|
-
jpeg_write_tables (j_compress_ptr cinfo)
|
257
|
-
{
|
258
|
-
if (cinfo->global_state != CSTATE_START)
|
259
|
-
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
260
|
-
|
261
|
-
/* (Re)initialize error mgr and destination modules */
|
262
|
-
(*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
|
263
|
-
(*cinfo->dest->init_destination) (cinfo);
|
264
|
-
/* Initialize the marker writer ... bit of a crock to do it here. */
|
265
|
-
jinit_marker_writer(cinfo);
|
266
|
-
/* Write them tables! */
|
267
|
-
(*cinfo->marker->write_tables_only) (cinfo);
|
268
|
-
/* And clean up. */
|
269
|
-
(*cinfo->dest->term_destination) (cinfo);
|
270
|
-
/*
|
271
|
-
* In library releases up through v6a, we called jpeg_abort() here to free
|
272
|
-
* any working memory allocated by the destination manager and marker
|
273
|
-
* writer. Some applications had a problem with that: they allocated space
|
274
|
-
* of their own from the library memory manager, and didn't want it to go
|
275
|
-
* away during write_tables. So now we do nothing. This will cause a
|
276
|
-
* memory leak if an app calls write_tables repeatedly without doing a full
|
277
|
-
* compression cycle or otherwise resetting the JPEG object. However, that
|
278
|
-
* seems less bad than unexpectedly freeing memory in the normal case.
|
279
|
-
* An app that prefers the old behavior can call jpeg_abort for itself after
|
280
|
-
* each call to jpeg_write_tables().
|
281
|
-
*/
|
282
|
-
}
|
data/src/jpeg-7/jcapistd.c
DELETED
@@ -1,161 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* jcapistd.c
|
3
|
-
*
|
4
|
-
* Copyright (C) 1994-1996, 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 application interface code for the compression half
|
9
|
-
* of the JPEG library. These are the "standard" API routines that are
|
10
|
-
* used in the normal full-compression case. They are not used by a
|
11
|
-
* transcoding-only application. Note that if an application links in
|
12
|
-
* jpeg_start_compress, it will end up linking in the entire compressor.
|
13
|
-
* We thus must separate this file from jcapimin.c to avoid linking the
|
14
|
-
* whole compression library into a transcoder.
|
15
|
-
*/
|
16
|
-
|
17
|
-
#define JPEG_INTERNALS
|
18
|
-
#include "jinclude.h"
|
19
|
-
#include "jpeglib.h"
|
20
|
-
|
21
|
-
|
22
|
-
/*
|
23
|
-
* Compression initialization.
|
24
|
-
* Before calling this, all parameters and a data destination must be set up.
|
25
|
-
*
|
26
|
-
* We require a write_all_tables parameter as a failsafe check when writing
|
27
|
-
* multiple datastreams from the same compression object. Since prior runs
|
28
|
-
* will have left all the tables marked sent_table=TRUE, a subsequent run
|
29
|
-
* would emit an abbreviated stream (no tables) by default. This may be what
|
30
|
-
* is wanted, but for safety's sake it should not be the default behavior:
|
31
|
-
* programmers should have to make a deliberate choice to emit abbreviated
|
32
|
-
* images. Therefore the documentation and examples should encourage people
|
33
|
-
* to pass write_all_tables=TRUE; then it will take active thought to do the
|
34
|
-
* wrong thing.
|
35
|
-
*/
|
36
|
-
|
37
|
-
GLOBAL(void)
|
38
|
-
jpeg_start_compress (j_compress_ptr cinfo, boolean write_all_tables)
|
39
|
-
{
|
40
|
-
if (cinfo->global_state != CSTATE_START)
|
41
|
-
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
42
|
-
|
43
|
-
if (write_all_tables)
|
44
|
-
jpeg_suppress_tables(cinfo, FALSE); /* mark all tables to be written */
|
45
|
-
|
46
|
-
/* (Re)initialize error mgr and destination modules */
|
47
|
-
(*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
|
48
|
-
(*cinfo->dest->init_destination) (cinfo);
|
49
|
-
/* Perform master selection of active modules */
|
50
|
-
jinit_compress_master(cinfo);
|
51
|
-
/* Set up for the first pass */
|
52
|
-
(*cinfo->master->prepare_for_pass) (cinfo);
|
53
|
-
/* Ready for application to drive first pass through jpeg_write_scanlines
|
54
|
-
* or jpeg_write_raw_data.
|
55
|
-
*/
|
56
|
-
cinfo->next_scanline = 0;
|
57
|
-
cinfo->global_state = (cinfo->raw_data_in ? CSTATE_RAW_OK : CSTATE_SCANNING);
|
58
|
-
}
|
59
|
-
|
60
|
-
|
61
|
-
/*
|
62
|
-
* Write some scanlines of data to the JPEG compressor.
|
63
|
-
*
|
64
|
-
* The return value will be the number of lines actually written.
|
65
|
-
* This should be less than the supplied num_lines only in case that
|
66
|
-
* the data destination module has requested suspension of the compressor,
|
67
|
-
* or if more than image_height scanlines are passed in.
|
68
|
-
*
|
69
|
-
* Note: we warn about excess calls to jpeg_write_scanlines() since
|
70
|
-
* this likely signals an application programmer error. However,
|
71
|
-
* excess scanlines passed in the last valid call are *silently* ignored,
|
72
|
-
* so that the application need not adjust num_lines for end-of-image
|
73
|
-
* when using a multiple-scanline buffer.
|
74
|
-
*/
|
75
|
-
|
76
|
-
GLOBAL(JDIMENSION)
|
77
|
-
jpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines,
|
78
|
-
JDIMENSION num_lines)
|
79
|
-
{
|
80
|
-
JDIMENSION row_ctr, rows_left;
|
81
|
-
|
82
|
-
if (cinfo->global_state != CSTATE_SCANNING)
|
83
|
-
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
84
|
-
if (cinfo->next_scanline >= cinfo->image_height)
|
85
|
-
WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
|
86
|
-
|
87
|
-
/* Call progress monitor hook if present */
|
88
|
-
if (cinfo->progress != NULL) {
|
89
|
-
cinfo->progress->pass_counter = (long) cinfo->next_scanline;
|
90
|
-
cinfo->progress->pass_limit = (long) cinfo->image_height;
|
91
|
-
(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
|
92
|
-
}
|
93
|
-
|
94
|
-
/* Give master control module another chance if this is first call to
|
95
|
-
* jpeg_write_scanlines. This lets output of the frame/scan headers be
|
96
|
-
* delayed so that application can write COM, etc, markers between
|
97
|
-
* jpeg_start_compress and jpeg_write_scanlines.
|
98
|
-
*/
|
99
|
-
if (cinfo->master->call_pass_startup)
|
100
|
-
(*cinfo->master->pass_startup) (cinfo);
|
101
|
-
|
102
|
-
/* Ignore any extra scanlines at bottom of image. */
|
103
|
-
rows_left = cinfo->image_height - cinfo->next_scanline;
|
104
|
-
if (num_lines > rows_left)
|
105
|
-
num_lines = rows_left;
|
106
|
-
|
107
|
-
row_ctr = 0;
|
108
|
-
(*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, num_lines);
|
109
|
-
cinfo->next_scanline += row_ctr;
|
110
|
-
return row_ctr;
|
111
|
-
}
|
112
|
-
|
113
|
-
|
114
|
-
/*
|
115
|
-
* Alternate entry point to write raw data.
|
116
|
-
* Processes exactly one iMCU row per call, unless suspended.
|
117
|
-
*/
|
118
|
-
|
119
|
-
GLOBAL(JDIMENSION)
|
120
|
-
jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data,
|
121
|
-
JDIMENSION num_lines)
|
122
|
-
{
|
123
|
-
JDIMENSION lines_per_iMCU_row;
|
124
|
-
|
125
|
-
if (cinfo->global_state != CSTATE_RAW_OK)
|
126
|
-
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
127
|
-
if (cinfo->next_scanline >= cinfo->image_height) {
|
128
|
-
WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
|
129
|
-
return 0;
|
130
|
-
}
|
131
|
-
|
132
|
-
/* Call progress monitor hook if present */
|
133
|
-
if (cinfo->progress != NULL) {
|
134
|
-
cinfo->progress->pass_counter = (long) cinfo->next_scanline;
|
135
|
-
cinfo->progress->pass_limit = (long) cinfo->image_height;
|
136
|
-
(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
|
137
|
-
}
|
138
|
-
|
139
|
-
/* Give master control module another chance if this is first call to
|
140
|
-
* jpeg_write_raw_data. This lets output of the frame/scan headers be
|
141
|
-
* delayed so that application can write COM, etc, markers between
|
142
|
-
* jpeg_start_compress and jpeg_write_raw_data.
|
143
|
-
*/
|
144
|
-
if (cinfo->master->call_pass_startup)
|
145
|
-
(*cinfo->master->pass_startup) (cinfo);
|
146
|
-
|
147
|
-
/* Verify that at least one iMCU row has been passed. */
|
148
|
-
lines_per_iMCU_row = cinfo->max_v_samp_factor * DCTSIZE;
|
149
|
-
if (num_lines < lines_per_iMCU_row)
|
150
|
-
ERREXIT(cinfo, JERR_BUFFER_SIZE);
|
151
|
-
|
152
|
-
/* Directly compress the row. */
|
153
|
-
if (! (*cinfo->coef->compress_data) (cinfo, data)) {
|
154
|
-
/* If compressor did not consume the whole row, suspend processing. */
|
155
|
-
return 0;
|
156
|
-
}
|
157
|
-
|
158
|
-
/* OK, we processed one iMCU row. */
|
159
|
-
cinfo->next_scanline += lines_per_iMCU_row;
|
160
|
-
return lines_per_iMCU_row;
|
161
|
-
}
|