44#ifndef EOF_REACHED_COUNT_THRESHOLD
49#define EOF_REACHED_COUNT_THRESHOLD 8192
72#define Fax3State(tif) ((Fax3BaseState *)(tif)->tif_data)
84 const unsigned char *
bitmap;
92 int unexpectedReachedCount;
102 unsigned char *refline;
108#define DecoderState(tif) ((Fax3CodecState *)Fax3State(tif))
109#define EncoderState(tif) ((Fax3CodecState *)Fax3State(tif))
111#define is2DEncoding(sp) (sp->b.groupoptions & GROUP3OPT_2DENCODING)
112#define isAligned(p, t) ((((size_t)(p)) & (sizeof(t) - 1)) == 0)
122#define DECLARE_STATE(tif, sp, mod) \
123 static const char module[] = mod; \
124 Fax3CodecState *sp = DecoderState(tif); \
126 int lastx = sp->b.rowpixels; \
135 const unsigned char *bitmap = sp->bitmap; \
136 const TIFFFaxTabEnt *TabEnt
138#define DECLARE_STATE_2D(tif, sp, mod) \
139 DECLARE_STATE(tif, sp, mod); \
146#define CACHE_STATE(tif, sp) \
150 BitsAvail = sp->bit; \
151 EOLcnt = sp->EOLcnt; \
152 cp = (unsigned char *)tif->tif_rawcp; \
153 ep = cp + tif->tif_rawcc; \
158#define UNCACHE_STATE(tif, sp) \
161 sp->bit = BitsAvail; \
163 sp->EOLcnt = EOLcnt; \
164 tif->tif_rawcc -= (tmsize_t)((uint8_t *)cp - tif->tif_rawcp); \
165 tif->tif_rawcp = (uint8_t *)cp; \
173 Fax3CodecState *
sp = DecoderState(tif);
180 sp->eofReachedCount = 0;
181 sp->eolReachedCount = 0;
182 sp->unexpectedReachedCount = 0;
192 sp->curruns =
sp->runs;
195 sp->refruns =
sp->runs +
sp->nruns;
218#define unexpected(table, a0) \
221 Fax3Unexpected(module, tif, sp->line, a0); \
222 ++sp->unexpectedReachedCount; \
229 "Uncompressed data (not supported) at line %" PRIu32
234#define extension(a0) Fax3Extension(module, tif, sp->line, a0)
241 ", expected %" PRIu32 ")",
242 a0 < lastx ?
"Premature EOL" :
"Line length mismatch",
line,
243 isTiled(tif) ?
"tile" :
"strip",
247#define badlength(a0, lastx) \
250 Fax3BadLength(module, tif, sp->line, a0, lastx); \
251 ++sp->eolReachedCount; \
263#define prematureEOF(a0) \
266 Fax3PrematureEOF(module, tif, sp->line, a0); \
267 ++sp->eofReachedCount; \
275 "Try to decode (read) fax Group 3 data without EOL at line %" PRIu32
276 " of %s %" PRIu32 " (x %" PRIu32 "). Please check result",
280#define tryG3WithoutEOL(a0) \
283 Fax3TryG3WithoutEOL(module, tif, sp->line, a0); \
288static int CheckReachedCounters(
TIFF *tif,
const char *
module,
291 if (
sp->eofReachedCount >= EOF_REACHED_COUNT_THRESHOLD)
294 "End of file (EOF) has already been reached %d times "
296 sp->eofReachedCount,
isTiled(tif) ?
"tile" :
"strip");
299 if (
sp->eolReachedCount >= EOF_REACHED_COUNT_THRESHOLD)
302 "Bad line length (EOL) has already been reached %d times "
304 sp->eolReachedCount,
isTiled(tif) ?
"tile" :
"strip");
307 if (
sp->unexpectedReachedCount >= EOF_REACHED_COUNT_THRESHOLD)
310 "Bad code word (unexpected) has already been reached %d "
311 "times within that %s",
312 sp->unexpectedReachedCount,
313 isTiled(tif) ?
"tile" :
"strip");
328 DECLARE_STATE(tif,
sp,
"Fax3Decode1D");
330 if (occ %
sp->b.rowbytes)
335 if (CheckReachedCounters(tif,
module,
sp))
338 CACHE_STATE(tif,
sp);
339 thisrun =
sp->curruns;
346 printf(
"\nBitAcc=%08" PRIX32 ", BitsAvail = %d\n", BitAcc, BitsAvail);
350 SYNC_EOL(EOF1D, RETRY_WITHOUT_EOL_1D);
352 (*
sp->fill)(
buf, thisrun,
pa, lastx);
353 buf +=
sp->b.rowbytes;
354 occ -=
sp->b.rowbytes;
360 (*
sp->fill)(
buf, thisrun,
pa, lastx);
361 UNCACHE_STATE(tif,
sp);
364 UNCACHE_STATE(tif,
sp);
368#define SWAP(t, a, b) \
380 DECLARE_STATE_2D(tif,
sp,
"Fax3Decode2D");
383 if (occ %
sp->b.rowbytes)
388 if (CheckReachedCounters(tif,
module,
sp))
391 CACHE_STATE(tif,
sp);
396 pa = thisrun =
sp->curruns;
398 printf(
"\nBitAcc=%08" PRIX32 ", BitsAvail = %d EOLcnt = %d", BitAcc,
401 SYNC_EOL(EOF2D, RETRY_WITHOUT_EOL_2D);
406 printf(
" %s\n-------------------- %" PRIu32 "\n", is1D ?
"1D" :
"2D",
416 (*
sp->fill)(
buf, thisrun,
pa, lastx);
417 if (pa < thisrun + sp->nruns)
422 buf +=
sp->b.rowbytes;
423 occ -=
sp->b.rowbytes;
429 (*
sp->fill)(
buf, thisrun,
pa, lastx);
430 UNCACHE_STATE(tif,
sp);
433 UNCACHE_STATE(tif,
sp);
439 for (int32_t ifill = 0; ifill < (n); ++ifill) \
441 (cp)[ifill] = 0xff; \
446 for (int32_t izero = 0; izero < (n); ++izero) \
459 static const unsigned char _fillmasks[] = {0x00, 0x80, 0xc0, 0xe0, 0xf0,
460 0xf8, 0xfc, 0xfe, 0xff};
466 if ((erun - runs) & 1)
469 for (; runs < erun; runs += 2)
472 if (
x + run > lastx || run > lastx)
482 *
cp++ &= 0xff << (8 - bx);
485 if ((
n = run >> 3) != 0)
501 cp = (
unsigned char *)lp;
507 cp[0] &= 0xff >> run;
510 cp[0] &= ~(_fillmasks[run] >> bx);
514 if (
x + run > lastx || run > lastx)
515 run = runs[1] = lastx -
x;
527 if ((
n = run >> 3) != 0)
543 cp = (
unsigned char *)lp;
550 cp[0] = (
unsigned char)((
cp[0] | (0xff00 >> run)) & 0xff);
553 cp[0] |= _fillmasks[run] >> bx;
562static int Fax3FixupTags(
TIFF *tif)
575static int Fax3SetupState(
TIFF *tif)
577 static const char module[] =
"Fax3SetupState";
579 Fax3BaseState *
sp = Fax3State(tif);
581 Fax3CodecState *dsp = (Fax3CodecState *)Fax3State(tif);
588 "Bits/sample must be 1 for Group 3/4 encoding/decoding");
596 "Samples/pixel shall be 1 for Group 3/4 encoding/decoding, "
597 "or PlanarConfiguration must be set to Separate.");
616 "Inconsistent number of bytes per row : rowbytes=%" PRId64
621 sp->rowbytes = rowbytes;
622 sp->rowpixels = rowpixels;
634 if (dsp->runs !=
NULL)
647 "Row pixels integer overflow (rowpixels %" PRIu32 ")",
653 "for Group 3/4 run arrays");
654 if (dsp->runs ==
NULL)
658 dsp->curruns = dsp->runs;
660 dsp->refruns = dsp->runs + dsp->nruns;
672 Fax3CodecState *esp = EncoderState(tif);
680 if (esp->refline !=
NULL)
685 if (esp->refline ==
NULL)
692 EncoderState(tif)->refline =
NULL;
701#define Fax3FlushBits(tif, sp) \
703 if ((tif)->tif_rawcc >= (tif)->tif_rawdatasize) \
705 if (!TIFFFlushData1(tif)) \
708 *(tif)->tif_rawcp++ = (uint8_t)(sp)->data; \
709 (tif)->tif_rawcc++; \
710 (sp)->data = 0, (sp)->bit = 8; \
712#define _FlushBits(tif) \
714 if ((tif)->tif_rawcc >= (tif)->tif_rawdatasize) \
716 if (!TIFFFlushData1(tif)) \
719 *(tif)->tif_rawcp++ = (uint8_t)data; \
720 (tif)->tif_rawcc++; \
723static const int _msbmask[9] = {0x00, 0x01, 0x03, 0x07, 0x0f,
724 0x1f, 0x3f, 0x7f, 0xff};
725#define _PutBits(tif, bits, length) \
727 while (length > bit) \
729 data |= bits >> (length - bit); \
733 assert(length < 9); \
734 data |= (bits & _msbmask[length]) << (bit - length); \
745static int Fax3PutBits(
TIFF *tif,
unsigned int bits,
unsigned int length)
747 Fax3CodecState *
sp = EncoderState(tif);
748 unsigned int bit =
sp->bit;
761#define putcode(tif, te) Fax3PutBits(tif, (te)->code, (te)->length)
764#define DEBUG_COLOR(w) (tab == TIFFFaxWhiteCodes ? w "W" : w "B")
765#define DEBUG_PRINT(what, len) \
768 printf("%08" PRIX32 "/%-2d: %s%5d\t", data, bit, DEBUG_COLOR(what), \
770 for (t = length - 1; t >= 0; t--) \
771 putchar(code & (1 << t) ? '1' : '0'); \
784 Fax3CodecState *
sp = EncoderState(tif);
785 unsigned int bit =
sp->bit;
795 DEBUG_PRINT(
"MakeUp", te->
runlen);
807 DEBUG_PRINT(
"MakeUp", te->
runlen);
815 DEBUG_PRINT(
" Term",
tab[
span].runlen);
831static int Fax3PutEOL(
TIFF *tif)
833 Fax3CodecState *
sp = EncoderState(tif);
834 unsigned int bit =
sp->bit;
853 _PutBits(tif, 0, tparm);
858 if (is2DEncoding(
sp))
876 Fax3CodecState *
sp = EncoderState(tif);
890 if (is2DEncoding(
sp))
905 sp->maxk = (
res > 150 ? 4 : 2);
906 sp->k =
sp->maxk - 1;
909 sp->k =
sp->maxk = 0;
914static const unsigned char zeroruns[256] = {
915 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
916 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
917 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
918 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
919 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
920 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
921 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
922 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
923 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
924 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
925 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
926 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
927 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
928 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
929 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
930 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
932static const unsigned char oneruns[256] = {
933 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
934 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
935 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
936 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
937 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
938 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
939 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
940 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
941 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
942 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
943 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
944 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
945 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
946 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
947 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
948 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 8,
965 if (
bits > 0 && (
n = (
bs & 7)) != 0)
967 span = zeroruns[(*bp <<
n) & 0xff];
985 while (!isAligned(bp,
int64_t))
988 return (
span + zeroruns[*bp]);
1000 bp = (
unsigned char *)lp;
1008 return (
span + zeroruns[*bp]);
1033 if (
bits > 0 && (
n = (
bs & 7)) != 0)
1035 span = oneruns[(*bp <<
n) & 0xff];
1053 while (!isAligned(bp,
int64_t))
1056 return (
span + oneruns[*bp]);
1069 bp = (
unsigned char *)lp;
1077 return (
span + oneruns[*bp]);
1099#define finddiff(_cp, _bs, _be, _color) \
1100 (_bs + (_color ? find1span(_cp, _bs, _be) : find0span(_cp, _bs, _be)))
1105#define finddiff2(_cp, _bs, _be, _color) \
1106 (_bs < _be ? finddiff(_cp, _bs, _be, _color) : _be)
1115 Fax3CodecState *
sp = EncoderState(tif);
1137 Fax3FlushBits(tif,
sp);
1140 Fax3FlushBits(tif,
sp);
1145static const tableentry horizcode = {3, 0x1, 0};
1146static const tableentry passcode = {4, 0x1, 0};
1161static int Fax3Encode2DRow(
TIFF *tif,
unsigned char *bp,
unsigned char *rp,
1164#define PIXEL(buf, ix) ((((buf)[(ix) >> 3]) >> (7 - ((ix)&7))) & 1)
1166 uint32_t a1 = (PIXEL(bp, 0) != 0 ? 0 : finddiff(bp, 0,
bits, 0));
1167 uint32_t b1 = (PIXEL(rp, 0) != 0 ? 0 : finddiff(rp, 0,
bits, 0));
1183 if (!(-3 <=
d &&
d <= 3))
1186 if (!putcode(tif, &horizcode))
1188 if (a0 +
a1 == 0 || PIXEL(bp, a0) == 0)
1206 if (!putcode(tif, &vcodes[
d + 3]))
1213 if (!putcode(tif, &passcode))
1219 a1 = finddiff(bp, a0,
bits, PIXEL(bp, a0));
1220 b1 = finddiff(rp, a0,
bits, !PIXEL(bp, a0));
1221 b1 = finddiff(rp,
b1,
bits, PIXEL(bp, a0));
1232 static const char module[] =
"Fax3Encode";
1233 Fax3CodecState *
sp = EncoderState(tif);
1235 if (
cc %
sp->b.rowbytes)
1244 if (!Fax3PutEOL(tif))
1247 if (is2DEncoding(
sp))
1249 if (
sp->tag == G3_1D)
1251 if (!Fax3Encode1DRow(tif, bp,
sp->b.rowpixels))
1257 if (!Fax3Encode2DRow(tif, bp,
sp->refline,
sp->b.rowpixels))
1264 sp->k =
sp->maxk - 1;
1271 if (!Fax3Encode1DRow(tif, bp,
sp->b.rowpixels))
1274 bp +=
sp->b.rowbytes;
1275 cc -=
sp->b.rowbytes;
1280static int Fax3PostEncode(
TIFF *tif)
1282 Fax3CodecState *
sp = EncoderState(tif);
1285 Fax3FlushBits(tif,
sp);
1289static int _Fax3Close(
TIFF *tif)
1293 Fax3CodecState *
sp = EncoderState(tif);
1295 unsigned int length = 12;
1298 if (is2DEncoding(
sp))
1303 for (
i = 0;
i < 6;
i++)
1305 Fax3FlushBits(tif,
sp);
1310static void Fax3Close(
TIFF *tif) { _Fax3Close(tif); }
1312static void Fax3Cleanup(
TIFF *tif)
1314 Fax3CodecState *
sp = DecoderState(tif);
1333#define FIELD_BADFAXLINES (FIELD_CODEC + 0)
1334#define FIELD_CLEANFAXDATA (FIELD_CODEC + 1)
1335#define FIELD_BADFAXRUN (FIELD_CODEC + 2)
1337#define FIELD_OPTIONS (FIELD_CODEC + 7)
1349 FIELD_BADFAXRUN,
TRUE,
FALSE,
"ConsecutiveBadFaxLines",
NULL}};
1361 Fax3BaseState *
sp = Fax3State(tif);
1395 return (*
sp->vsetparent)(tif,
tag,
ap);
1409 Fax3BaseState *
sp = Fax3State(tif);
1435 return (*
sp->vgetparent)(tif,
tag,
ap);
1442 Fax3BaseState *
sp = Fax3State(tif);
1449 const char *sep =
" ";
1454 fprintf(
fd,
"%suncompressed data", sep);
1471 fprintf(
fd,
"%suncompressed data", sep);
1479 switch (
sp->cleanfaxdata)
1503static int InitCCITTFax3(
TIFF *tif)
1505 static const char module[] =
"InitCCITTFax3";
1514 "Merging common CCITT Fax codec-specific tags failed");
1530 sp = Fax3State(tif);
1542 sp->groupoptions = 0;
1546 DecoderState(tif)->runs =
NULL;
1548 EncoderState(tif)->refline =
NULL;
1574 if (InitCCITTFax3(tif))
1582 "Merging CCITT Fax 3 codec-specific tags failed");
1600#define SWAP(t, a, b) \
1612 DECLARE_STATE_2D(tif,
sp,
"Fax4Decode");
1614 if (occ %
sp->b.rowbytes)
1619 if (CheckReachedCounters(tif,
module,
sp))
1621 CACHE_STATE(tif,
sp);
1627 pa = thisrun =
sp->curruns;
1631 printf(
"\nBitAcc=%08" PRIX32 ", BitsAvail = %d\n", BitAcc, BitsAvail);
1638 if (((lastx + 7) >> 3) > (
int)occ)
1642 " bytes available, %d bits needed",
1646 (*
sp->fill)(
buf, thisrun,
pa, lastx);
1649 buf +=
sp->b.rowbytes;
1650 occ -=
sp->b.rowbytes;
1661 if (((lastx + 7) >> 3) > (
int)occ)
1665 " bytes available, %d bits needed",
1669 (*
sp->fill)(
buf, thisrun,
pa, lastx);
1670 UNCACHE_STATE(tif,
sp);
1675 UNCACHE_STATE(tif,
sp);
1685 static const char module[] =
"Fax4Encode";
1686 Fax3CodecState *
sp = EncoderState(tif);
1688 if (
cc %
sp->b.rowbytes)
1695 if (!Fax3Encode2DRow(tif, bp,
sp->refline,
sp->b.rowpixels))
1698 bp +=
sp->b.rowbytes;
1699 cc -=
sp->b.rowbytes;
1704static int Fax4PostEncode(
TIFF *tif)
1706 Fax3CodecState *
sp = EncoderState(tif);
1709 Fax3PutBits(tif,
EOL, 12);
1710 Fax3PutBits(tif,
EOL, 12);
1712 Fax3FlushBits(tif,
sp);
1719 if (InitCCITTFax3(tif))
1727 "Merging CCITT Fax 4 codec-specific tags failed");
1757 DECLARE_STATE(tif,
sp,
"Fax3DecodeRLE");
1760 if (occ %
sp->b.rowbytes)
1765 if (CheckReachedCounters(tif,
module,
sp))
1767 CACHE_STATE(tif,
sp);
1768 thisrun =
sp->curruns;
1775 printf(
"\nBitAcc=%08" PRIX32 ", BitsAvail = %d\n", BitAcc, BitsAvail);
1780 (*
sp->fill)(
buf, thisrun,
pa, lastx);
1786 int n = BitsAvail - (BitsAvail & ~7);
1791 int n = BitsAvail - (BitsAvail & ~15);
1793 if (BitsAvail == 0 && !isAligned(
cp,
uint16_t))
1796 buf +=
sp->b.rowbytes;
1797 occ -=
sp->b.rowbytes;
1801 (*
sp->fill)(
buf, thisrun,
pa, lastx);
1802 UNCACHE_STATE(tif,
sp);
1805 UNCACHE_STATE(tif,
sp);
1812 if (InitCCITTFax3(tif))
1830 if (InitCCITTFax3(tif))
_STLP_MOVE_TO_STD_NAMESPACE void fill(_ForwardIter __first, _ForwardIter __last, const _Tp &__val)
int WINAPIV fprintf(FILE *file, const char *format,...)
int CDECL fputs(const char *s, FILE *file)
int CDECL fflush(FILE *file)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
int align(int length, int align)
GLint GLint GLint GLint GLint x
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLenum GLvoid GLvoid GLvoid * span
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
GLuint GLsizei GLsizei * length
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static struct msdos_boot_sector bs
static const struct update_accum a1
static const struct update_accum a2
static CRYPT_DATA_BLOB b2[]
static CRYPT_DATA_BLOB b1[]
uint16_t td_bitspersample
uint16_t td_resolutionunit
uint16_t td_samplesperpixel
TIFFCodeMethod tif_encodestrip
TIFFCodeMethod tif_encodetile
TIFFTagMethods tif_tagmethods
TIFFPreMethod tif_preencode
TIFFBoolMethod tif_fixuptags
TIFFPreMethod tif_predecode
TIFFCodeMethod tif_decodestrip
TIFFCodeMethod tif_decoderow
TIFFBoolMethod tif_setupencode
TIFFBoolMethod tif_postencode
TIFFCodeMethod tif_encoderow
TIFFVoidMethod tif_cleanup
TIFFBoolMethod tif_setupdecode
TIFFCodeMethod tif_decodetile
const tableentry TIFFFaxWhiteCodes[]
const tableentry TIFFFaxBlackCodes[]
void * _TIFFCheckMalloc(TIFF *tif, tmsize_t nmemb, tmsize_t elem_size, const char *what)
#define TIFFInitCCITTRLEW
#define TIFFInitCCITTFax4
#define TIFFInitCCITTFax3
void _TIFFSetDefaultCompressionState(TIFF *tif)
#define TIFF_SSIZE_FORMAT
int TIFFSetField(TIFF *tif, uint32_t tag,...)
#define TIFFFieldSet(tif, field)
#define TIFFSetFieldBit(tif, field)
const TIFFField * TIFFFieldWithTag(TIFF *tif, uint32_t tag)
int _TIFFMergeFields(TIFF *tif, const TIFFField info[], uint32_t n)
void TIFFErrorExtR(TIFF *tif, const char *module, const char *fmt,...)
void(* TIFFFaxFillFunc)(unsigned char *, uint32_t *, uint32_t *, uint32_t)
#define SYNC_EOL(eoflab, retrywithouteol)
#define NeedBits16(n, eoflab)
void _TIFFFax3fillruns(unsigned char *, uint32_t *, uint32_t *, uint32_t)
#define NeedBits8(n, eoflab)
void _TIFFfreeExt(TIFF *tif, void *p)
void * _TIFFmallocExt(TIFF *tif, tmsize_t s)
tmsize_t TIFFScanlineSize(TIFF *tif)
const unsigned char * TIFFGetBitRevTable(int reversed)
tmsize_t TIFFTileRowSize(TIFF *tif)
void _TIFFmemset(void *p, int v, tmsize_t c)
void _TIFFmemcpy(void *d, const void *s, tmsize_t c)
void TIFFWarningExtR(TIFF *tif, const char *module, const char *fmt,...)
#define PLANARCONFIG_SEPARATE
#define COMPRESSION_CCITTFAX3
#define RESUNIT_CENTIMETER
#define GROUP3OPT_2DENCODING
#define TIFFTAG_GROUP3OPTIONS
#define TIFFTAG_FAXFILLFUNC
#define TIFFTAG_GROUP4OPTIONS
#define CLEANFAXDATA_REGENERATED
#define TIFFTAG_CONSECUTIVEBADFAXLINES
#define FAXMODE_BYTEALIGN
#define GROUP3OPT_UNCOMPRESSED
#define FILLORDER_LSB2MSB
#define CLEANFAXDATA_CLEAN
#define CLEANFAXDATA_UNCLEAN
#define GROUP3OPT_FILLBITS
#define TIFFTAG_CLEANFAXDATA
#define TIFFTAG_BADFAXLINES
#define COMPRESSION_CCITTFAX4
#define GROUP4OPT_UNCOMPRESSED
#define FAXMODE_WORDALIGN
void(* TIFFPrintMethod)(TIFF *, FILE *, long)
int(* TIFFVSetMethod)(TIFF *, uint32_t, va_list)
int(* TIFFVGetMethod)(TIFF *, uint32_t, va_list)
#define TIFFSafeMultiply(t, v, m)
#define TIFFroundup_32(x, y)
#define TIFFArrayCount(a)
static struct wctab tab[]
void int int ULONGLONG int va_list * ap