• Home
  • Raw
  • Download

Lines Matching refs:tif

65 #define	Fax3State(tif)		((Fax3BaseState*) (tif)->tif_data)  argument
89 #define DecoderState(tif) ((Fax3CodecState*) Fax3State(tif)) argument
90 #define EncoderState(tif) ((Fax3CodecState*) Fax3State(tif)) argument
103 #define DECLARE_STATE(tif, sp, mod) \ argument
105 Fax3CodecState* sp = DecoderState(tif); \
118 #define DECLARE_STATE_2D(tif, sp, mod) \ argument
119 DECLARE_STATE(tif, sp, mod); \
125 #define CACHE_STATE(tif, sp) do { \ argument
129 cp = (unsigned char*) tif->tif_rawcp; \
130 ep = cp + tif->tif_rawcc; \
135 #define UNCACHE_STATE(tif, sp) do { \ argument
139 tif->tif_rawcc -= (tmsize_t)((uint8*) cp - tif->tif_rawcp); \
140 tif->tif_rawcp = (uint8*) cp; \
147 Fax3PreDecode(TIFF* tif, uint16 s) in Fax3PreDecode() argument
149 Fax3CodecState* sp = DecoderState(tif); in Fax3PreDecode()
164 TIFFGetBitRevTable(tif->tif_dir.td_fillorder != FILLORDER_LSB2MSB); in Fax3PreDecode()
180 Fax3Unexpected(const char* module, TIFF* tif, uint32 line, uint32 a0) in Fax3Unexpected() argument
182 TIFFErrorExt(tif->tif_clientdata, module, "Bad code word at line %u of %s %u (x %u)", in Fax3Unexpected()
183 line, isTiled(tif) ? "tile" : "strip", in Fax3Unexpected()
184 (isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip), in Fax3Unexpected()
187 #define unexpected(table, a0) Fax3Unexpected(module, tif, sp->line, a0)
190 Fax3Extension(const char* module, TIFF* tif, uint32 line, uint32 a0) in Fax3Extension() argument
192 TIFFErrorExt(tif->tif_clientdata, module, in Fax3Extension()
194 line, isTiled(tif) ? "tile" : "strip", in Fax3Extension()
195 (isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip), in Fax3Extension()
198 #define extension(a0) Fax3Extension(module, tif, sp->line, a0)
201 Fax3BadLength(const char* module, TIFF* tif, uint32 line, uint32 a0, uint32 lastx) in Fax3BadLength() argument
203 TIFFWarningExt(tif->tif_clientdata, module, "%s at line %u of %s %u (got %u, expected %u)", in Fax3BadLength()
205 line, isTiled(tif) ? "tile" : "strip", in Fax3BadLength()
206 (isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip), in Fax3BadLength()
209 #define badlength(a0,lastx) Fax3BadLength(module, tif, sp->line, a0, lastx)
212 Fax3PrematureEOF(const char* module, TIFF* tif, uint32 line, uint32 a0) in Fax3PrematureEOF() argument
214 TIFFWarningExt(tif->tif_clientdata, module, "Premature EOF at line %u of %s %u (x %u)", in Fax3PrematureEOF()
215 line, isTiled(tif) ? "tile" : "strip", in Fax3PrematureEOF()
216 (isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip), in Fax3PrematureEOF()
219 #define prematureEOF(a0) Fax3PrematureEOF(module, tif, sp->line, a0)
227 Fax3Decode1D(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s) in Fax3Decode1D() argument
229 DECLARE_STATE(tif, sp, "Fax3Decode1D"); in Fax3Decode1D()
233 TIFFErrorExt(tif->tif_clientdata, module, "Fractional scanlines cannot be read"); in Fax3Decode1D()
236 CACHE_STATE(tif, sp); in Fax3Decode1D()
244 printf("-------------------- %d\n", tif->tif_row); in Fax3Decode1D()
258 UNCACHE_STATE(tif, sp); in Fax3Decode1D()
261 UNCACHE_STATE(tif, sp); in Fax3Decode1D()
270 Fax3Decode2D(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s) in Fax3Decode2D() argument
272 DECLARE_STATE_2D(tif, sp, "Fax3Decode2D"); in Fax3Decode2D()
277 TIFFErrorExt(tif->tif_clientdata, module, "Fractional scanlines cannot be read"); in Fax3Decode2D()
280 CACHE_STATE(tif, sp); in Fax3Decode2D()
295 is1D ? "1D" : "2D", tif->tif_row); in Fax3Decode2D()
315 UNCACHE_STATE(tif, sp); in Fax3Decode2D()
318 UNCACHE_STATE(tif, sp); in Fax3Decode2D()
459 Fax3FixupTags(TIFF* tif) in Fax3FixupTags() argument
461 (void) tif; in Fax3FixupTags()
473 Fax3SetupState(TIFF* tif) in Fax3SetupState() argument
476 TIFFDirectory* td = &tif->tif_dir; in Fax3SetupState()
477 Fax3BaseState* sp = Fax3State(tif); in Fax3SetupState()
479 Fax3CodecState* dsp = (Fax3CodecState*) Fax3State(tif); in Fax3SetupState()
484 TIFFErrorExt(tif->tif_clientdata, module, in Fax3SetupState()
491 if (isTiled(tif)) { in Fax3SetupState()
492 rowbytes = TIFFTileRowSize(tif); in Fax3SetupState()
495 rowbytes = TIFFScanlineSize(tif); in Fax3SetupState()
519 TIFFErrorExt(tif->tif_clientdata, tif->tif_name, in Fax3SetupState()
524 dsp->runs = (uint32*) _TIFFCheckMalloc(tif, in Fax3SetupState()
538 tif->tif_decoderow = Fax3Decode2D; in Fax3SetupState()
539 tif->tif_decodestrip = Fax3Decode2D; in Fax3SetupState()
540 tif->tif_decodetile = Fax3Decode2D; in Fax3SetupState()
544 Fax3CodecState* esp = EncoderState(tif); in Fax3SetupState()
554 TIFFErrorExt(tif->tif_clientdata, module, in Fax3SetupState()
559 EncoderState(tif)->refline = NULL; in Fax3SetupState()
568 #define Fax3FlushBits(tif, sp) { \ argument
569 if ((tif)->tif_rawcc >= (tif)->tif_rawdatasize) \
570 (void) TIFFFlushData1(tif); \
571 *(tif)->tif_rawcp++ = (uint8) (sp)->data; \
572 (tif)->tif_rawcc++; \
575 #define _FlushBits(tif) { \ argument
576 if ((tif)->tif_rawcc >= (tif)->tif_rawdatasize) \
577 (void) TIFFFlushData1(tif); \
578 *(tif)->tif_rawcp++ = (uint8) data; \
579 (tif)->tif_rawcc++; \
584 #define _PutBits(tif, bits, length) { \ argument
588 _FlushBits(tif); \
594 _FlushBits(tif); \
603 Fax3PutBits(TIFF* tif, unsigned int bits, unsigned int length) in Fax3PutBits() argument
605 Fax3CodecState* sp = EncoderState(tif); in Fax3PutBits()
609 _PutBits(tif, bits, length); in Fax3PutBits()
618 #define putcode(tif, te) Fax3PutBits(tif, (te)->code, (te)->length) argument
638 putspan(TIFF* tif, int32 span, const tableentry* tab) in putspan() argument
640 Fax3CodecState* sp = EncoderState(tif); in putspan()
651 _PutBits(tif, code, length); in putspan()
661 _PutBits(tif, code, length); in putspan()
668 _PutBits(tif, code, length); in putspan()
681 Fax3PutEOL(TIFF* tif) in Fax3PutEOL() argument
683 Fax3CodecState* sp = EncoderState(tif); in Fax3PutEOL()
702 _PutBits(tif, 0, tparm); in Fax3PutEOL()
708 _PutBits(tif, code, length); in Fax3PutEOL()
718 Fax3PreEncode(TIFF* tif, uint16 s) in Fax3PreEncode() argument
720 Fax3CodecState* sp = EncoderState(tif); in Fax3PreEncode()
735 float res = tif->tif_dir.td_yresolution; in Fax3PreEncode()
746 if (tif->tif_dir.td_resolutionunit == RESUNIT_CENTIMETER) in Fax3PreEncode()
947 Fax3Encode1DRow(TIFF* tif, unsigned char* bp, uint32 bits) in Fax3Encode1DRow() argument
949 Fax3CodecState* sp = EncoderState(tif); in Fax3Encode1DRow()
955 putspan(tif, span, TIFFFaxWhiteCodes); in Fax3Encode1DRow()
960 putspan(tif, span, TIFFFaxBlackCodes); in Fax3Encode1DRow()
967 Fax3FlushBits(tif, sp); in Fax3Encode1DRow()
969 !isAligned(tif->tif_rawcp, uint16)) in Fax3Encode1DRow()
970 Fax3FlushBits(tif, sp); in Fax3Encode1DRow()
994 Fax3Encode2DRow(TIFF* tif, unsigned char* bp, unsigned char* rp, uint32 bits) in Fax3Encode2DRow() argument
1008 putcode(tif, &horizcode); in Fax3Encode2DRow()
1010 putspan(tif, a1-a0, TIFFFaxWhiteCodes); in Fax3Encode2DRow()
1011 putspan(tif, a2-a1, TIFFFaxBlackCodes); in Fax3Encode2DRow()
1013 putspan(tif, a1-a0, TIFFFaxBlackCodes); in Fax3Encode2DRow()
1014 putspan(tif, a2-a1, TIFFFaxWhiteCodes); in Fax3Encode2DRow()
1018 putcode(tif, &vcodes[d+3]); in Fax3Encode2DRow()
1022 putcode(tif, &passcode); in Fax3Encode2DRow()
1039 Fax3Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) in Fax3Encode() argument
1042 Fax3CodecState* sp = EncoderState(tif); in Fax3Encode()
1046 TIFFErrorExt(tif->tif_clientdata, module, "Fractional scanlines cannot be written"); in Fax3Encode()
1051 Fax3PutEOL(tif); in Fax3Encode()
1054 if (!Fax3Encode1DRow(tif, bp, sp->b.rowpixels)) in Fax3Encode()
1058 if (!Fax3Encode2DRow(tif, bp, sp->refline, in Fax3Encode()
1069 if (!Fax3Encode1DRow(tif, bp, sp->b.rowpixels)) in Fax3Encode()
1079 Fax3PostEncode(TIFF* tif) in Fax3PostEncode() argument
1081 Fax3CodecState* sp = EncoderState(tif); in Fax3PostEncode()
1084 Fax3FlushBits(tif, sp); in Fax3PostEncode()
1089 Fax3Close(TIFF* tif) in Fax3Close() argument
1091 if ((Fax3State(tif)->mode & FAXMODE_NORTC) == 0) { in Fax3Close()
1092 Fax3CodecState* sp = EncoderState(tif); in Fax3Close()
1100 Fax3PutBits(tif, code, length); in Fax3Close()
1101 Fax3FlushBits(tif, sp); in Fax3Close()
1106 Fax3Cleanup(TIFF* tif) in Fax3Cleanup() argument
1108 Fax3CodecState* sp = DecoderState(tif); in Fax3Cleanup()
1112 tif->tif_tagmethods.vgetfield = sp->b.vgetparent; in Fax3Cleanup()
1113 tif->tif_tagmethods.vsetfield = sp->b.vsetparent; in Fax3Cleanup()
1114 tif->tif_tagmethods.printdir = sp->b.printdir; in Fax3Cleanup()
1121 _TIFFfree(tif->tif_data); in Fax3Cleanup()
1122 tif->tif_data = NULL; in Fax3Cleanup()
1124 _TIFFSetDefaultCompressionState(tif); in Fax3Cleanup()
1147 Fax3VSetField(TIFF* tif, uint32 tag, va_list ap) in Fax3VSetField() argument
1149 Fax3BaseState* sp = Fax3State(tif); in Fax3VSetField()
1160 DecoderState(tif)->fill = va_arg(ap, TIFFFaxFillFunc); in Fax3VSetField()
1164 if (tif->tif_dir.td_compression == COMPRESSION_CCITTFAX3) in Fax3VSetField()
1169 if (tif->tif_dir.td_compression == COMPRESSION_CCITTFAX4) in Fax3VSetField()
1182 return (*sp->vsetparent)(tif, tag, ap); in Fax3VSetField()
1185 if ((fip = TIFFFieldWithTag(tif, tag))) in Fax3VSetField()
1186 TIFFSetFieldBit(tif, fip->field_bit); in Fax3VSetField()
1190 tif->tif_flags |= TIFF_DIRTYDIRECT; in Fax3VSetField()
1195 Fax3VGetField(TIFF* tif, uint32 tag, va_list ap) in Fax3VGetField() argument
1197 Fax3BaseState* sp = Fax3State(tif); in Fax3VGetField()
1206 *va_arg(ap, TIFFFaxFillFunc*) = DecoderState(tif)->fill; in Fax3VGetField()
1222 return (*sp->vgetparent)(tif, tag, ap); in Fax3VGetField()
1228 Fax3PrintDir(TIFF* tif, FILE* fd, long flags) in Fax3PrintDir() argument
1230 Fax3BaseState* sp = Fax3State(tif); in Fax3PrintDir()
1235 if (TIFFFieldSet(tif,FIELD_OPTIONS)) { in Fax3PrintDir()
1237 if (tif->tif_dir.td_compression == COMPRESSION_CCITTFAX4) { in Fax3PrintDir()
1255 if (TIFFFieldSet(tif,FIELD_CLEANFAXDATA)) { in Fax3PrintDir()
1271 if (TIFFFieldSet(tif,FIELD_BADFAXLINES)) in Fax3PrintDir()
1274 if (TIFFFieldSet(tif,FIELD_BADFAXRUN)) in Fax3PrintDir()
1278 (*sp->printdir)(tif, fd, flags); in Fax3PrintDir()
1282 InitCCITTFax3(TIFF* tif) in InitCCITTFax3() argument
1290 if (!_TIFFMergeFields(tif, faxFields, TIFFArrayCount(faxFields))) { in InitCCITTFax3()
1291 TIFFErrorExt(tif->tif_clientdata, "InitCCITTFax3", in InitCCITTFax3()
1299 tif->tif_data = (uint8*) in InitCCITTFax3()
1302 if (tif->tif_data == NULL) { in InitCCITTFax3()
1303 TIFFErrorExt(tif->tif_clientdata, module, in InitCCITTFax3()
1308 sp = Fax3State(tif); in InitCCITTFax3()
1309 sp->rw_mode = tif->tif_mode; in InitCCITTFax3()
1314 sp->vgetparent = tif->tif_tagmethods.vgetfield; in InitCCITTFax3()
1315 tif->tif_tagmethods.vgetfield = Fax3VGetField; /* hook for codec tags */ in InitCCITTFax3()
1316 sp->vsetparent = tif->tif_tagmethods.vsetfield; in InitCCITTFax3()
1317 tif->tif_tagmethods.vsetfield = Fax3VSetField; /* hook for codec tags */ in InitCCITTFax3()
1318 sp->printdir = tif->tif_tagmethods.printdir; in InitCCITTFax3()
1319 tif->tif_tagmethods.printdir = Fax3PrintDir; /* hook for codec tags */ in InitCCITTFax3()
1323 tif->tif_flags |= TIFF_NOBITREV; /* decoder does bit reversal */ in InitCCITTFax3()
1324 DecoderState(tif)->runs = NULL; in InitCCITTFax3()
1325 TIFFSetField(tif, TIFFTAG_FAXFILLFUNC, _TIFFFax3fillruns); in InitCCITTFax3()
1326 EncoderState(tif)->refline = NULL; in InitCCITTFax3()
1331 tif->tif_fixuptags = Fax3FixupTags; in InitCCITTFax3()
1332 tif->tif_setupdecode = Fax3SetupState; in InitCCITTFax3()
1333 tif->tif_predecode = Fax3PreDecode; in InitCCITTFax3()
1334 tif->tif_decoderow = Fax3Decode1D; in InitCCITTFax3()
1335 tif->tif_decodestrip = Fax3Decode1D; in InitCCITTFax3()
1336 tif->tif_decodetile = Fax3Decode1D; in InitCCITTFax3()
1337 tif->tif_setupencode = Fax3SetupState; in InitCCITTFax3()
1338 tif->tif_preencode = Fax3PreEncode; in InitCCITTFax3()
1339 tif->tif_postencode = Fax3PostEncode; in InitCCITTFax3()
1340 tif->tif_encoderow = Fax3Encode; in InitCCITTFax3()
1341 tif->tif_encodestrip = Fax3Encode; in InitCCITTFax3()
1342 tif->tif_encodetile = Fax3Encode; in InitCCITTFax3()
1343 tif->tif_close = Fax3Close; in InitCCITTFax3()
1344 tif->tif_cleanup = Fax3Cleanup; in InitCCITTFax3()
1350 TIFFInitCCITTFax3(TIFF* tif, int scheme) in TIFFInitCCITTFax3() argument
1353 if (InitCCITTFax3(tif)) { in TIFFInitCCITTFax3()
1357 if (!_TIFFMergeFields(tif, fax3Fields, in TIFFInitCCITTFax3()
1359 TIFFErrorExt(tif->tif_clientdata, "TIFFInitCCITTFax3", in TIFFInitCCITTFax3()
1367 return TIFFSetField(tif, TIFFTAG_FAXMODE, FAXMODE_CLASSF); in TIFFInitCCITTFax3()
1382 Fax4Decode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s) in Fax4Decode() argument
1384 DECLARE_STATE_2D(tif, sp, "Fax4Decode"); in Fax4Decode()
1388 TIFFErrorExt(tif->tif_clientdata, module, "Fractional scanlines cannot be read"); in Fax4Decode()
1391 CACHE_STATE(tif, sp); in Fax4Decode()
1400 printf("-------------------- %d\n", tif->tif_row); in Fax4Decode()
1422 UNCACHE_STATE(tif, sp); in Fax4Decode()
1425 UNCACHE_STATE(tif, sp); in Fax4Decode()
1434 Fax4Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) in Fax4Encode() argument
1437 Fax3CodecState *sp = EncoderState(tif); in Fax4Encode()
1441 TIFFErrorExt(tif->tif_clientdata, module, "Fractional scanlines cannot be written"); in Fax4Encode()
1445 if (!Fax3Encode2DRow(tif, bp, sp->refline, sp->b.rowpixels)) in Fax4Encode()
1455 Fax4PostEncode(TIFF* tif) in Fax4PostEncode() argument
1457 Fax3CodecState *sp = EncoderState(tif); in Fax4PostEncode()
1460 Fax3PutBits(tif, EOL, 12); in Fax4PostEncode()
1461 Fax3PutBits(tif, EOL, 12); in Fax4PostEncode()
1463 Fax3FlushBits(tif, sp); in Fax4PostEncode()
1468 TIFFInitCCITTFax4(TIFF* tif, int scheme) in TIFFInitCCITTFax4() argument
1471 if (InitCCITTFax3(tif)) { /* reuse G3 support */ in TIFFInitCCITTFax4()
1475 if (!_TIFFMergeFields(tif, fax4Fields, in TIFFInitCCITTFax4()
1477 TIFFErrorExt(tif->tif_clientdata, "TIFFInitCCITTFax4", in TIFFInitCCITTFax4()
1482 tif->tif_decoderow = Fax4Decode; in TIFFInitCCITTFax4()
1483 tif->tif_decodestrip = Fax4Decode; in TIFFInitCCITTFax4()
1484 tif->tif_decodetile = Fax4Decode; in TIFFInitCCITTFax4()
1485 tif->tif_encoderow = Fax4Encode; in TIFFInitCCITTFax4()
1486 tif->tif_encodestrip = Fax4Encode; in TIFFInitCCITTFax4()
1487 tif->tif_encodetile = Fax4Encode; in TIFFInitCCITTFax4()
1488 tif->tif_postencode = Fax4PostEncode; in TIFFInitCCITTFax4()
1492 return TIFFSetField(tif, TIFFTAG_FAXMODE, FAXMODE_NORTC); in TIFFInitCCITTFax4()
1506 Fax3DecodeRLE(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s) in Fax3DecodeRLE() argument
1508 DECLARE_STATE(tif, sp, "Fax3DecodeRLE"); in Fax3DecodeRLE()
1513 TIFFErrorExt(tif->tif_clientdata, module, "Fractional scanlines cannot be read"); in Fax3DecodeRLE()
1516 CACHE_STATE(tif, sp); in Fax3DecodeRLE()
1524 printf("-------------------- %d\n", tif->tif_row); in Fax3DecodeRLE()
1547 UNCACHE_STATE(tif, sp); in Fax3DecodeRLE()
1550 UNCACHE_STATE(tif, sp); in Fax3DecodeRLE()
1555 TIFFInitCCITTRLE(TIFF* tif, int scheme) in TIFFInitCCITTRLE() argument
1558 if (InitCCITTFax3(tif)) { /* reuse G3 support */ in TIFFInitCCITTRLE()
1559 tif->tif_decoderow = Fax3DecodeRLE; in TIFFInitCCITTRLE()
1560 tif->tif_decodestrip = Fax3DecodeRLE; in TIFFInitCCITTRLE()
1561 tif->tif_decodetile = Fax3DecodeRLE; in TIFFInitCCITTRLE()
1565 return TIFFSetField(tif, TIFFTAG_FAXMODE, in TIFFInitCCITTRLE()
1572 TIFFInitCCITTRLEW(TIFF* tif, int scheme) in TIFFInitCCITTRLEW() argument
1575 if (InitCCITTFax3(tif)) { /* reuse G3 support */ in TIFFInitCCITTRLEW()
1576 tif->tif_decoderow = Fax3DecodeRLE; in TIFFInitCCITTRLEW()
1577 tif->tif_decodestrip = Fax3DecodeRLE; in TIFFInitCCITTRLEW()
1578 tif->tif_decodetile = Fax3DecodeRLE; in TIFFInitCCITTRLEW()
1582 return TIFFSetField(tif, TIFFTAG_FAXMODE, in TIFFInitCCITTRLEW()