35 summarize(
TIFF* tif,
size_t summand1,
size_t summand2,
const char* where)
41 uint32 bytes = summand1 + summand2;
43 if (bytes - summand1 != summand2) {
52 multiply(
TIFF* tif,
size_t nmemb,
size_t elem_size,
const char* where)
54 uint32 bytes = nmemb * elem_size;
56 if (elem_size && bytes / elem_size != nmemb) {
77 "%lu: Sample out of range, max %lu",
99 "TIFFNumberOfStrips");
124 uint16 ycbcrsubsampling[2];
128 ycbcrsubsampling + 0,
129 ycbcrsubsampling + 1 );
131 samplingarea = ycbcrsubsampling[0]*ycbcrsubsampling[1];
132 if (samplingarea == 0) {
134 "Invalid YCbCr subsampling");
143 scanline = multiply(tif, nrows, scanline,
"TIFFVStripSize");
145 summarize(tif, scanline,
146 multiply(tif, 2, scanline / samplingarea,
147 "TIFFVStripSize"),
"TIFFVStripSize"));
163 if (bytecount <= 0) {
165 "%lu: Invalid strip byte count, strip %lu",
166 (
unsigned long) bytecount, (
unsigned long) strip);
235 uint16 ycbcrsubsampling[2];
238 ycbcrsubsampling + 0,
239 ycbcrsubsampling + 1);
241 if (ycbcrsubsampling[0] == 0) {
243 "Invalid YCbCr subsampling");
248 ycbcrsubsampling[0]);
251 "TIFFScanlineSize"));
253 summarize(tif, scanline,
255 scanline / ycbcrsubsampling[0],
267 "TIFFScanlineSize")));
283 "TIFFRasterScanlineSize");
286 "TIFFRasterScanlineSize");
291 "TIFFRasterScanlineSize"));
#define PHOTOMETRIC_YCBCR
#define STRIP_SIZE_DEFAULT
#define TIFFhowmany(x, y)
tsize_t TIFFScanlineSize(TIFF *tif)
#define TIFFTAG_YCBCRSUBSAMPLING
uint32 TIFFDefaultStripSize(TIFF *tif, uint32 request)
tsize_t TIFFRasterScanlineSize(TIFF *tif)
GLenum GLenum GLvoid * row
tsize_t TIFFVStripSize(TIFF *tif, uint32 nrows)
uint32 _TIFFDefaultStripSize(TIFF *tif, uint32 s)
tstrip_t TIFFComputeStrip(TIFF *tif, uint32 row, tsample_t sample)
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
#define TIFFroundup(x, y)
#define PLANARCONFIG_SEPARATE
tstrip_t TIFFNumberOfStrips(TIFF *tif)
uint16 td_samplesperpixel
GLubyte GLubyte GLubyte GLubyte w
tsize_t TIFFRawStripSize(TIFF *tif, tstrip_t strip)
tstrip_t td_stripsperimage
tsize_t TIFFStripSize(TIFF *tif)
int TIFFGetField(TIFF *tif, ttag_t tag,...)
TIFFStripMethod tif_defstripsize
#define PLANARCONFIG_CONTIG
uint32 * td_stripbytecount