28 #ifdef PACKBITS_SUPPORT 54 PackBitsPostEncode(
TIFF* tif)
74 unsigned char* bp = (
unsigned char*) buf;
78 enum {
BASE, LITERAL, RUN, LITERAL_RUN } state;
89 b = *bp++, cc--, n = 1;
90 for (; cc > 0 && b == *bp; cc--, bp++)
100 if (state == LITERAL || state == LITERAL_RUN) {
101 slop = op - lastliteral;
107 *op++ = *lastliteral++;
147 if (++(*lastliteral) == 127)
176 if (n == 1 && op[-2] == (tidata) -1 &&
177 *lastliteral < 126) {
178 state = (((*lastliteral) += 2) == 127 ?
203 while ((
long)cc > 0) {
209 if (PackBitsEncode(tif, bp, chunk, s) < 0)
228 while (cc > 0 && (
long)occ > 0) {
229 n = (
long) *bp++, cc--;
243 "PackBitsDecode: discarding %d bytes " 244 "to avoid buffer overrun",
256 "PackBitsDecode: discarding %d bytes " 257 "to avoid buffer overrun",
270 "PackBitsDecode: Not enough data for scanline %ld",
TIFFCodeMethod tif_decoderow
tsize_t TIFFTileRowSize(TIFF *tif)
void TIFFWarningExt(thandle_t fd, const char *module, const char *fmt,...)
TIFFCodeMethod tif_encodestrip
TIFFCodeMethod tif_encoderow
tsize_t TIFFScanlineSize(TIFF *tif)
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
GLboolean GLboolean GLboolean b
void _TIFFmemcpy(tdata_t d, const tdata_t s, tsize_t c)
GLenum GLuint GLenum GLsizei const GLchar * buf
TIFFCodeMethod tif_decodestrip
TIFFCodeMethod tif_encodetile
TIFFPreMethod tif_preencode
TIFFBoolMethod tif_postencode
typedef long(ZCALLBACK *tell_file_func) OF((voidpf opaque
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
TIFFCodeMethod tif_decodetile
int TIFFInitPackBits(TIFF *tif, int scheme)
unsigned char tidataval_t
void * _TIFFmalloc(tsize_t s)
void _TIFFfree(tdata_t p)
int TIFFFlushData1(TIFF *tif)