Lines Matching refs:strip
34 int TIFFFillStrip(TIFF* tif, uint32 strip);
36 static int TIFFStartStrip(TIFF* tif, uint32 strip);
40 TIFFReadRawStrip1(TIFF* tif, uint32 strip, void* buf, tmsize_t size,const char* module);
46 TIFFFillStripPartial( TIFF *tif, int strip, tmsize_t read_ahead, int restart )
60 * strip coming from file (perhaps should set upper
64 bytecountm=(tmsize_t) td->td_stripbytecount[strip];
71 "Data buffer too small to hold part of strip %lu",
72 (unsigned long) strip);
103 read_offset = td->td_stripoffset[strip]
108 "Seek error at scanline %lu, strip %lu",
109 (unsigned long) tif->tif_row, (unsigned long) strip);
117 if( (uint64) to_read > td->td_stripbytecount[strip]
120 to_read = td->td_stripbytecount[strip]
156 ** When starting a strip from the beginning we need to
160 return TIFFStartStrip(tif, strip);
169 * strip organized files. We do some tricky stuff to try
177 uint32 strip;
182 ** Establish what strip we are working from.
198 strip = (uint32)sample*td->td_stripsperimage + row/td->td_rowsperstrip;
200 strip = row / td->td_rowsperstrip;
203 * Do we want to treat this strip as one whole chunk or
209 whole_strip = tif->tif_dir.td_stripbytecount[strip] < 10
221 * If we haven't loaded this strip, do so now, possibly
224 if (strip != tif->tif_curstrip) { /* different strip, refill */
228 if (!TIFFFillStrip(tif, strip))
233 if( !TIFFFillStripPartial(tif,strip,read_ahead,1) )
244 && (uint64) tif->tif_rawdataoff+tif->tif_rawdataloaded < td->td_stripbytecount[strip] )
246 if( !TIFFFillStripPartial(tif,strip,read_ahead,0) )
253 * Moving backwards within the same strip: backup
257 * strip, it's better to just read and decode the entire
258 * strip, and then access the decoded data in a random fashion.
263 if( !TIFFFillStripPartial(tif,strip,read_ahead,1) )
268 if (!TIFFStartStrip(tif, strip))
313 * Read a strip of data and decompress the specified
317 TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size)
329 if (strip>=td->td_nstrips)
332 "%lu: Strip out of range, max %lu",(unsigned long)strip,
337 * Calculate the strip size according to the number of
338 * rows in the strip (check for truncated last strip on any
345 stripinplane=(strip%stripsperplane);
346 plane=(strip/stripsperplane);
355 if (!TIFFFillStrip(tif,strip))
364 TIFFReadRawStrip1(TIFF* tif, uint32 strip, void* buf, tmsize_t size,
376 if (!SeekOK(tif, td->td_stripoffset[strip])) {
378 "Seek error at scanline %lu, strip %lu",
379 (unsigned long) tif->tif_row, (unsigned long) strip);
402 ma=(tmsize_t)td->td_stripoffset[strip];
404 if (((uint64)ma!=td->td_stripoffset[strip])||(ma>tif->tif_size))
413 "Read error at scanline %lu, strip %lu; got %I64u bytes, expected %I64u",
415 (unsigned long) strip,
420 "Read error at scanline %lu, strip %lu; got %llu bytes, expected %llu",
422 (unsigned long) strip,
435 * Read a strip of data from the file.
438 TIFFReadRawStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size)
447 if (strip >= td->td_nstrips) {
449 "%lu: Strip out of range, max %lu",
450 (unsigned long) strip,
460 bytecount = td->td_stripbytecount[strip];
464 "%I64u: Invalid strip byte count, strip %lu",
466 (unsigned long) strip);
469 "%llu: Invalid strip byte count, strip %lu",
471 (unsigned long) strip);
482 return (TIFFReadRawStrip1(tif, strip, buf, bytecountm, module));
486 * Read the specified strip and setup for decoding. The data buffer is
487 * expanded, as necessary, to hold the strip's data.
490 TIFFFillStrip(TIFF* tif, uint32 strip)
500 uint64 bytecount = td->td_stripbytecount[strip];
504 "Invalid strip byte count %I64u, strip %lu",
506 (unsigned long) strip);
509 "Invalid strip byte count %llu, strip %lu",
511 (unsigned long) strip);
539 * td->td_stripoffset[strip]+bytecount > tif->tif_size
545 td->td_stripoffset[strip] > (uint64)tif->tif_size - bytecount) {
554 "Read error on strip %lu; "
556 (unsigned long) strip,
557 (unsigned __int64) tif->tif_size - td->td_stripoffset[strip],
562 "Read error on strip %lu; "
564 (unsigned long) strip,
565 (unsigned long long) tif->tif_size - td->td_stripoffset[strip],
572 tif->tif_rawdata = tif->tif_base + (tmsize_t)td->td_stripoffset[strip];
586 * strip coming from file (perhaps should set upper
600 "Data buffer too small to hold strip %lu",
601 (unsigned long) strip);
612 if (TIFFReadRawStrip1(tif, strip, tif->tif_rawdata,
624 return (TIFFStartStrip(tif, strip));
906 * reading a strip of raw data. If the buffer
910 strip of
950 * strip has just been read in.
953 TIFFStartStrip(TIFF* tif, uint32 strip)
965 tif->tif_curstrip = strip;
966 tif->tif_row = (strip % td->td_stripsperimage) * td->td_rowsperstrip;
977 tif->tif_rawcc = (tmsize_t)td->td_stripbytecount[strip];
980 (uint16)(strip / td->td_stripsperimage)));