38 static int TIFFCheckRead(
TIFF*,
int);
40 #define NOSTRIP ((tstrip_t) -1) 41 #define NOTILE ((ttile_t) -1) 54 "%lu: Row out of range, max %lu",
62 "%lu: Sample out of range, max %lu",
72 }
else if (row < tif->tif_row) {
81 if (!TIFFStartStrip(tif, strip))
100 if (!TIFFCheckRead(tif, 0))
102 if( (e = TIFFSeek(tif, row, sample)) != 0) {
116 return (e > 0 ? 1 : -1);
131 if (!TIFFCheckRead(tif, 0))
135 "%ld: Strip out of range, max %ld",
150 sep_strip = strip % strips_per_sep;
152 if (sep_strip != strips_per_sep-1 ||
159 else if (size > stripsize)
171 TIFFReadRawStrip1(
TIFF* tif,
182 "%s: Seek error at scanline %lu, strip %lu",
184 (
unsigned long) tif->
tif_row, (
unsigned long) strip);
190 "%s: Read error at scanline %lu; got %lu bytes, expected %lu",
194 (
unsigned long) size);
200 "%s: Read error at scanline %lu, strip %lu; got %lu bytes, expected %lu",
203 (
unsigned long) strip,
205 (
unsigned long) size);
220 static const char module[] =
"TIFFReadRawStrip";
230 if (!TIFFCheckRead(tif, 0))
234 "%lu: Strip out of range, max %lu",
235 (
unsigned long) strip,
242 "Compression scheme does not support access to raw uncompressed data");
246 if (bytecount <= 0) {
248 "%lu: Invalid strip byte count, strip %lu",
249 (
unsigned long) bytecount, (
unsigned long) strip);
252 if (size != (
tsize_t)-1 && (uint32)size < bytecount)
254 return (TIFFReadRawStrip1(tif, strip, buf, bytecount, module));
264 static const char module[] =
"TIFFFillStrip";
276 if (bytecount <= 0) {
278 "%s: Invalid strip byte count %lu, strip %lu",
279 tif->
tif_name, (
unsigned long) bytecount,
280 (
unsigned long) strip);
318 "%s: Read error on strip %lu; " 319 "got %lu bytes, expected %lu",
320 tif->
tif_name, (
unsigned long) strip,
322 (
unsigned long) bytecount);
339 "%s: Data buffer too small to hold strip %lu",
341 (
unsigned long) strip);
348 if ((uint32)TIFFReadRawStrip1(tif, strip,
350 bytecount, module) != bytecount)
357 return (TIFFStartStrip(tif, strip));
373 if (!TIFFCheckRead(tif, 1) || !
TIFFCheckTile(tif, x, y, z, s))
389 if (!TIFFCheckRead(tif, 1))
393 "%ld: Tile out of range, max %ld",
399 else if (size > tilesize)
410 TIFFReadRawTile1(
TIFF* tif,
421 "%s: Seek error at row %ld, col %ld, tile %ld",
431 "%s: Read error at row %ld, col %ld; got %lu bytes, expected %lu",
436 (
unsigned long) size);
442 "%s: Read error at row %ld, col %ld, tile %ld; got %lu bytes, expected %lu",
448 (
unsigned long) size);
462 static const char module[] =
"TIFFReadRawTile";
472 if (!TIFFCheckRead(tif, 1))
476 "%lu: Tile out of range, max %lu",
477 (
unsigned long) tile, (
unsigned long) td->
td_nstrips);
483 "Compression scheme does not support access to raw uncompressed data");
487 if (size != (
tsize_t) -1 && (uint32)size < bytecount)
489 return (TIFFReadRawTile1(tif, tile, buf, bytecount, module));
499 static const char module[] =
"TIFFFillTile";
511 if (bytecount <= 0) {
513 "%lu: Invalid tile byte count, tile %lu",
514 (
unsigned long) bytecount, (
unsigned long) tile);
562 "%s: Data buffer too small to hold tile %ld",
571 if ((uint32)TIFFReadRawTile1(tif, tile,
573 bytecount, module) != bytecount)
580 return (TIFFStartTile(tif, tile));
595 static const char module[] =
"TIFFReadBufferSetup";
616 "%s: No space for data buffer at scanline %ld",
690 TIFFCheckRead(
TIFF* tif,
int tiles)
698 "Can not read tiles from a stripped image" :
699 "Can not read scanlines from a tiled image");
708 (void) tif; (void) buf; (void) cc;
715 assert((cc & 1) == 0);
723 assert((cc % 3) == 0);
731 assert((cc & 3) == 0);
739 assert((cc & 7) == 0);
TIFFCodeMethod tif_decoderow
void TIFFReverseBits(register unsigned char *cp, register unsigned long n)
int TIFFCheckTile(TIFF *tif, uint32 x, uint32 y, uint32 z, tsample_t s)
tsize_t TIFFReadRawStrip(TIFF *tif, tstrip_t strip, tdata_t buf, tsize_t size)
tstrile_t td_stripsperimage
TIFFPreMethod tif_predecode
#define TIFFhowmany(x, y)
int TIFFFillStrip(TIFF *, tstrip_t)
int TIFFReadScanline(TIFF *tif, tdata_t buf, uint32 row, tsample_t sample)
void _TIFFSwab32BitData(TIFF *tif, tidata_t buf, tsize_t cc)
void TIFFSwabArrayOfShort(uint16 *wp, register unsigned long n)
void _TIFFmemcpy(tdata_t d, const tdata_t s, tsize_t c)
TIFFCodeMethod tif_decodestrip
tsize_t TIFFReadRawTile(TIFF *tif, ttile_t tile, tdata_t buf, tsize_t size)
tsize_t TIFFVStripSize(TIFF *tif, uint32 nrows)
void TIFFSwabArrayOfTriples(uint8 *tp, unsigned long n)
TIFFPostMethod tif_postdecode
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
int TIFFFillTile(TIFF *, ttile_t)
void TIFFSwabArrayOfLong(register uint32 *lp, register unsigned long n)
#define TIFFroundup(x, y)
ttile_t TIFFComputeTile(TIFF *tif, uint32 x, uint32 y, uint32 z, tsample_t s)
TIFFCodeMethod tif_decodetile
tsize_t TIFFReadEncodedTile(TIFF *tif, ttile_t tile, tdata_t buf, tsize_t size)
#define PLANARCONFIG_SEPARATE
void _TIFFNoPostDecode(TIFF *tif, tidata_t buf, tsize_t cc)
uint16 td_samplesperpixel
void _TIFFSwab24BitData(TIFF *tif, tidata_t buf, tsize_t cc)
void TIFFSwabArrayOfDouble(double *dp, register unsigned long n)
void _TIFFSwab16BitData(TIFF *tif, tidata_t buf, tsize_t cc)
void _TIFFSwab64BitData(TIFF *tif, tidata_t buf, tsize_t cc)
int TIFFReadBufferSetup(TIFF *tif, tdata_t bp, tsize_t size)
#define isFillOrder(tif, o)
tsize_t TIFFReadEncodedStrip(TIFF *tif, tstrip_t strip, tdata_t buf, tsize_t size)
void * _TIFFmalloc(tsize_t s)
toff_t * td_stripbytecount
void _TIFFfree(tdata_t p)
#define TIFFReadFile(tif, buf, size)
tsize_t TIFFReadTile(TIFF *tif, tdata_t buf, uint32 x, uint32 y, uint32 z, tsample_t s)
TIFFBoolMethod tif_setupdecode