37 #define WRITECHECKSTRIPS(tif, module) \ 38 (((tif)->tif_flags&TIFF_BEENWRITING) || TIFFWriteCheck((tif),0,module)) 39 #define WRITECHECKTILES(tif, module) \ 40 (((tif)->tif_flags&TIFF_BEENWRITING) || TIFFWriteCheck((tif),1,module)) 41 #define BUFFERCHECK(tif) \ 42 ((((tif)->tif_flags & TIFF_BUFFERSETUP) && tif->tif_rawdata) || \ 43 TIFFWriteBufferSetup((tif), NULL, (tsize_t) -1)) 45 static int TIFFGrowStrips(
TIFF*,
int,
const char*);
51 static const char module[] =
"TIFFWriteScanline";
53 int status, imagegrew = 0;
73 "Can not change \"ImageLength\" when using separate planes");
85 "%d: Sample out of range, max %d",
99 if (strip >= td->
td_nstrips && !TIFFGrowStrips(tif, 1, module))
146 if (row < tif->tif_row) {
184 static const char module[] =
"TIFFWriteEncodedStrip";
202 "Can not grow image by strips when using separate planes");
205 if (!TIFFGrowStrips(tif, 1, module))
266 static const char module[] =
"TIFFWriteRawStrip";
283 "Can not grow image by strips when using separate planes");
294 if (!TIFFGrowStrips(tif, 1, module))
299 return (TIFFAppendToStrip(tif, strip, (
tidata_t) data, cc) ?
338 static const char module[] =
"TIFFWriteEncodedTile";
405 if (tif->
tif_rawcc > 0 && !TIFFAppendToStrip(tif, tile,
425 static const char module[] =
"TIFFWriteRawTile";
431 tif->
tif_name, (
unsigned long) tile,
435 return (TIFFAppendToStrip(tif, tile, (
tidata_t) data, cc) ?
439 #define isUnspecified(tif, f) \ 440 (TIFFFieldSet(tif,f) && (tif)->tif_dir.td_imagelength == 0) 492 "Can not write tiles to a stripped image" :
493 "Can not write scanlines to a tiled image");
509 "%s: Must set \"ImageWidth\" before writing data",
525 "%s: Must set \"PlanarConfiguration\" before writing data",
548 static const char module[] =
"TIFFWriteBufferSetup";
589 TIFFGrowStrips(
TIFF* tif,
int delta,
const char* module)
592 uint32 *new_stripoffset, *new_stripbytecount;
599 if (new_stripoffset == NULL || new_stripbytecount == NULL) {
602 if (new_stripbytecount)
612 0, delta*sizeof (uint32));
614 0, delta*sizeof (uint32));
625 static const char module[] =
"TIFFAppendToStrip";
644 "Seek error at scanline %lu",
689 if (!TIFFAppendToStrip(tif,
void TIFFReverseBits(register unsigned char *cp, register unsigned long n)
int TIFFCheckTile(TIFF *tif, uint32 x, uint32 y, uint32 z, tsample_t s)
tstrile_t td_stripsperimage
tsize_t TIFFWriteEncodedTile(TIFF *tif, ttile_t tile, tdata_t data, tsize_t cc)
int TIFFSetupStrips(TIFF *tif)
#define FIELD_STRIPOFFSETS
TIFFCodeMethod tif_encodestrip
#define WriteOK(tif, buf, size)
#define FIELD_IMAGEDIMENSIONS
#define TIFFhowmany(x, y)
#define TIFFSeekFile(tif, off, whence)
tsize_t TIFFWriteRawStrip(TIFF *tif, tstrip_t strip, tdata_t data, tsize_t cc)
TIFFCodeMethod tif_encoderow
tsize_t TIFFScanlineSize(TIFF *tif)
#define WRITECHECKSTRIPS(tif, module)
int TIFFWriteBufferSetup(TIFF *tif, tdata_t bp, tsize_t size)
tsize_t TIFFWriteEncodedStrip(TIFF *tif, tstrip_t strip, tdata_t data, tsize_t cc)
#define TIFFSetFieldBit(tif, field)
#define FIELD_STRIPBYTECOUNTS
int TIFFFlushData(TIFF *tif)
#define FIELD_PLANARCONFIG
TIFFCodeMethod tif_encodetile
TIFFPreMethod tif_preencode
TIFFBoolMethod tif_postencode
ttile_t TIFFNumberOfTiles(TIFF *tif)
TIFFPostMethod tif_postdecode
void * _TIFFrealloc(tdata_t p, tsize_t s)
int TIFFWriteScanline(TIFF *tif, tdata_t buf, uint32 row, tsample_t sample)
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
#define TIFFFieldSet(tif, field)
#define FIELD_ROWSPERSTRIP
ttile_t TIFFComputeTile(TIFF *tif, uint32 x, uint32 y, uint32 z, tsample_t s)
#define PLANARCONFIG_SEPARATE
void _TIFFmemset(tdata_t p, int v, tsize_t c)
tstrip_t TIFFNumberOfStrips(TIFF *tif)
uint16 td_samplesperpixel
int TIFFWriteCheck(TIFF *tif, int tiles, const char *module)
void TIFFSetWriteOffset(TIFF *tif, toff_t off)
tsize_t TIFFTileSize(TIFF *tif)
#define isFillOrder(tif, o)
#define FIELD_TILEDIMENSIONS
void * _TIFFmalloc(tsize_t s)
tsize_t TIFFWriteRawTile(TIFF *tif, ttile_t tile, tdata_t data, tsize_t cc)
tsize_t TIFFStripSize(TIFF *tif)
toff_t * td_stripbytecount
void _TIFFfree(tdata_t p)
#define isUnspecified(tif, f)
TIFFBoolMethod tif_setupencode
int TIFFFlushData1(TIFF *tif)
#define WRITECHECKTILES(tif, module)
#define PLANARCONFIG_CONTIG
tsize_t TIFFWriteTile(TIFF *tif, tdata_t buf, uint32 x, uint32 y, uint32 z, tsample_t s)