Lines Matching refs:tif

51 #define GetJBIGState(tif) ((JBIGState*)(tif)->tif_data)
66 static int JBIGSetupDecode(TIFF* tif)
68 if (TIFFNumberOfStrips(tif) != 1)
77 static int JBIGDecode(TIFF* tif, tidata_t buffer, tsize_t size, tsample_t s)
84 if (isFillOrder(tif, tif->tif_dir.td_fillorder))
86 TIFFReverseBits(tif->tif_rawdata, tif->tif_rawdatasize);
92 jbg_newlen(tif->tif_rawdata, tif->tif_rawdatasize);
105 decodeStatus = jbg_dec_in(&decoder, tif->tif_rawdata,
106 tif->tif_rawdatasize, NULL);
130 static int JBIGSetupEncode(TIFF* tif)
132 if (TIFFNumberOfStrips(tif) != 1)
141 static int JBIGCopyEncodedData(TIFF* tif, tidata_t pp, tsize_t cc, tsample_t s)
148 if (tif->tif_rawcc + n > tif->tif_rawdatasize)
150 n = tif->tif_rawdatasize - tif->tif_rawcc;
154 _TIFFmemcpy(tif->tif_rawcp, pp, n);
155 tif->tif_rawcp += n;
156 tif->tif_rawcc += n;
159 if (tif->tif_rawcc >= tif->tif_rawdatasize &&
160 !TIFFFlushData1(tif))
171 TIFF* tif = (TIFF*)userData;
173 if (isFillOrder(tif, tif->tif_dir.td_fillorder))
178 JBIGCopyEncodedData(tif, buffer, len, 0);
181 static int JBIGEncode(TIFF* tif, tidata_t buffer, tsize_t size, tsample_t s)
183 TIFFDirectory* dir = &tif->tif_dir;
194 tif);
205 static void JBIGCleanup(TIFF* tif)
207 JBIGState *sp = GetJBIGState(tif);
211 tif->tif_tagmethods.vgetfield = sp->vgetparent;
212 tif->tif_tagmethods.vsetfield = sp->vsetparent;
214 _TIFFfree(tif->tif_data);
215 tif->tif_data = NULL;
217 _TIFFSetDefaultCompressionState(tif);
220 static void JBIGPrintDir(TIFF* tif, FILE* fd, long flags)
222 JBIGState* codec = GetJBIGState(tif);
225 if (TIFFFieldSet(tif, FIELD_RECVPARAMS))
232 if (TIFFFieldSet(tif, FIELD_SUBADDRESS))
239 if (TIFFFieldSet(tif, FIELD_RECVTIME))
246 if (TIFFFieldSet(tif, FIELD_FAXDCS))
254 static int JBIGVGetField(TIFF* tif, ttag_t tag, va_list ap)
256 JBIGState* codec = GetJBIGState(tif);
277 return (*codec->vgetparent)(tif, tag, ap);
283 static int JBIGVSetField(TIFF* tif, ttag_t tag, va_list ap)
285 JBIGState* codec = GetJBIGState(tif);
306 return (*codec->vsetparent)(tif, tag, ap);
309 TIFFSetFieldBit(tif, _TIFFFieldWithTag(tif, tag)->field_bit);
310 tif->tif_flags |= TIFF_DIRTYDIRECT;
314 int TIFFInitJBIG(TIFF* tif, int scheme)
323 if (!_TIFFMergeFieldInfo(tif, jbigFieldInfo,
325 TIFFErrorExt(tif->tif_clientdata, "TIFFInitJBIG",
331 tif->tif_data = (tdata_t)_TIFFmalloc(sizeof(JBIGState));
332 if (tif->tif_data == NULL)
337 _TIFFmemset(tif->tif_data, 0, sizeof(JBIGState));
338 codec = GetJBIGState(tif);
349 codec->vgetparent = tif->tif_tagmethods.vgetfield;
350 codec->vsetparent = tif->tif_tagmethods.vsetfield;
351 tif->tif_tagmethods.vgetfield = JBIGVGetField;
352 tif->tif_tagmethods.vsetfield = JBIGVSetField;
353 tif->tif_tagmethods.printdir = JBIGPrintDir;
360 tif->tif_flags |= TIFF_NOBITREV;
361 tif->tif_flags &= ~TIFF_MAPPED;
364 tif->tif_setupdecode = JBIGSetupDecode;
365 tif->tif_decodestrip = JBIGDecode;
367 tif->tif_setupencode = JBIGSetupEncode;
368 tif->tif_encodestrip = JBIGEncode;
370 tif->tif_cleanup = JBIGCleanup;