35 static int gtTileContig(
TIFFRGBAImage*, uint32*, uint32, uint32);
36 static int gtTileSeparate(
TIFFRGBAImage*, uint32*, uint32, uint32);
37 static int gtStripContig(
TIFFRGBAImage*, uint32*, uint32, uint32);
38 static int gtStripSeparate(
TIFFRGBAImage*, uint32*, uint32, uint32);
41 static const char photoTag[] =
"PhotometricInterpretation";
46 #define FLIP_VERTICALLY 0x01 47 #define FLIP_HORIZONTALLY 0x02 55 { 3.2410F, -1.5374F, -0.4986F },
56 { -0.9692F, 1.8760F, 0.0416F },
57 { 0.0556F, -0.2040F, 1.0570F }
59 100.0F, 100.0F, 100.0F,
79 sprintf(emsg,
"Sorry, requested compression method is not configured");
90 sprintf(emsg,
"Sorry, can not handle images with %d-bit samples",
96 switch (colorchannels) {
104 sprintf(emsg,
"Missing needed %s tag", photoTag);
108 switch (photometric) {
116 "Sorry, can not handle contiguous data with %s=%d, " 117 "and %s=%d and Bits/Sample=%d",
118 photoTag, photometric,
138 if (colorchannels < 3) {
139 sprintf(emsg,
"Sorry, can not handle RGB image with %s=%d",
140 "Color channels", colorchannels);
150 "Sorry, can not handle separated image with %s=%d",
156 "Sorry, can not handle separated image with %s=%d",
164 sprintf(emsg,
"Sorry, LogL data must have %s=%d",
172 sprintf(emsg,
"Sorry, LogLuv data must have %s=%d or %d",
177 sprintf(emsg,
"Sorry, can not handle LogLuv images with %s=%d",
185 sprintf(emsg,
"Sorry, can not handle image with %s=%d",
186 photoTag, photometric);
213 isCCITTCompression(
TIFF* tif)
231 uint16 *red_orig, *green_orig, *blue_orig;
253 sprintf(emsg,
"Sorry, can not handle images with %d-bit samples",
260 &extrasamples, &sampleinfo);
261 if (extrasamples >= 1)
263 switch (sampleinfo[0]) {
270 img->
alpha = sampleinfo[0];
275 #ifdef DEFAULT_EXTRASAMPLE_AS_ALPHA 279 if( extrasamples == 0
292 switch (colorchannels) {
294 if (isCCITTCompression(tif))
303 sprintf(emsg,
"Missing needed %s tag", photoTag);
310 &red_orig, &green_orig, &blue_orig)) {
311 sprintf(emsg,
"Missing required \"Colormap\" tag");
321 sprintf(emsg,
"Out of memory for colormap copy");
336 "Sorry, can not handle contiguous data with %s=%d, " 337 "and %s=%d and Bits/Sample=%d",
371 if (colorchannels < 3) {
372 sprintf(emsg,
"Sorry, can not handle RGB image with %s=%d",
373 "Color channels", colorchannels);
382 sprintf(emsg,
"Sorry, can not handle separated image with %s=%d",
387 sprintf(emsg,
"Sorry, can not handle separated image with %s=%d",
395 sprintf(emsg,
"Sorry, LogL data must have %s=%d",
405 sprintf(emsg,
"Sorry, LogLuv data must have %s=%d or %d",
410 sprintf(emsg,
"Sorry, can not handle LogLuv images with %s=%d",
411 "Planarconfiguration", planarconfig);
421 sprintf(emsg,
"Sorry, can not handle image with %s=%d",
436 if (!PickContigCase(img)) {
437 sprintf(emsg,
"Sorry, can not handle image");
441 if (!PickSeparateCase(img)) {
442 sprintf(emsg,
"Sorry, can not handle image");
452 if (img->
get == NULL) {
456 if (img->
put.
any == NULL) {
458 "No \"put\" routine setupl; probably can not handle image format");
461 return (*img->
get)(img, raster, w, h);
470 uint32 rwidth, uint32 rheight, uint32* raster,
471 int orientation,
int stop)
473 char emsg[1024] =
"";
496 uint32 rwidth, uint32 rheight, uint32* raster,
int stop)
570 gtTileContig(
TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
574 uint32 col, row, y, rowstoread;
578 int32 fromskew, toskew;
591 flip = setorientation(img);
594 toskew = -(int32)(tw + w);
598 toskew = -(int32)(tw - w);
601 for (row = 0; row < h; row += nrow)
603 rowstoread = th - (row + img->
row_offset) % th;
604 nrow = (row + rowstoread > h ? h - row : rowstoread);
605 for (col = 0; col < w; col += tw)
622 uint32 npix = w - col;
623 fromskew = tw - npix;
624 (*put)(img, raster+y*w+col, col, y,
625 npix, nrow, fromskew, toskew + fromskew, buf + pos);
629 (*put)(img, raster+y*w+col, col, y, tw, nrow, 0, toskew, buf + pos);
633 y += (flip & FLIP_VERTICALLY ? -(int32) nrow : (int32) nrow);
640 for (line = 0; line < h; line++) {
641 uint32 *left = raster + (line * w);
642 uint32 *right = left + w - 1;
644 while ( left < right ) {
663 gtTileSeparate(
TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
667 uint32 col, row, y, rowstoread;
676 int32 fromskew, toskew;
677 int alpha = img->
alpha;
682 buf = (
unsigned char*)
_TIFFmalloc((alpha?4:3)*tilesize);
691 pa = (alpha?(p2+tilesize):NULL);
695 flip = setorientation(img);
698 toskew = -(int32)(tw + w);
702 toskew = -(int32)(tw - w);
705 for (row = 0; row < h; row += nrow)
707 rowstoread = th - (row + img->
row_offset) % th;
708 nrow = (row + rowstoread > h ? h - row : rowstoread);
709 for (col = 0; col < w; col += tw)
747 uint32 npix = w - col;
748 fromskew = tw - npix;
749 (*put)(img, raster+y*w+col, col, y,
750 npix, nrow, fromskew, toskew + fromskew,
751 p0 + pos, p1 + pos, p2 + pos, (alpha?(pa+pos):NULL));
753 (*put)(img, raster+y*w+col, col, y,
754 tw, nrow, 0, toskew, p0 + pos, p1 + pos, p2 + pos, (alpha?(pa+pos):NULL));
758 y += (flip & FLIP_VERTICALLY ?-(int32) nrow : (int32) nrow);
764 for (line = 0; line < h; line++) {
765 uint32 *left = raster + (line * w);
766 uint32 *right = left + w - 1;
768 while ( left < right ) {
788 gtStripContig(
TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
792 uint32 row, y, nrow, nrowsub, rowstoread;
796 uint16 subsamplinghor,subsamplingver;
797 uint32 imagewidth = img->
width;
799 int32 fromskew, toskew;
809 flip = setorientation(img);
812 toskew = -(int32)(w + w);
815 toskew = -(int32)(w - w);
821 fromskew = (w < imagewidth ? imagewidth - w : 0);
822 for (row = 0; row < h; row += nrow)
824 rowstoread = rowsperstrip - (row + img->
row_offset) % rowsperstrip;
825 nrow = (row + rowstoread > h ? h - row : rowstoread);
827 if ((nrowsub%subsamplingver)!=0)
828 nrowsub+=subsamplingver-nrowsub%subsamplingver;
832 ((row + img->
row_offset)%rowsperstrip + nrowsub) * scanline) < 0
839 pos = ((row + img->
row_offset) % rowsperstrip) * scanline;
840 (*put)(img, raster+y*w, 0, y, w, nrow, fromskew, toskew, buf + pos);
841 y += (flip & FLIP_VERTICALLY ? -(int32) nrow : (int32) nrow);
847 for (line = 0; line < h; line++) {
848 uint32 *left = raster + (line * w);
849 uint32 *right = left + w - 1;
851 while ( left < right ) {
871 gtStripSeparate(
TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
876 unsigned char *p0, *p1, *p2, *pa;
877 uint32 row, y, nrow, rowstoread;
880 uint32 rowsperstrip, offset_row;
881 uint32 imagewidth = img->
width;
883 int32 fromskew, toskew;
884 int alpha = img->
alpha;
888 p0 = buf = (
unsigned char *)
_TIFFmalloc((alpha?4:3)*stripsize);
896 pa = (alpha?(p2+stripsize):NULL);
898 flip = setorientation(img);
901 toskew = -(int32)(w + w);
905 toskew = -(int32)(w - w);
910 fromskew = (w < imagewidth ? imagewidth - w : 0);
911 for (row = 0; row < h; row += nrow)
913 rowstoread = rowsperstrip - (row + img->
row_offset) % rowsperstrip;
914 nrow = (row + rowstoread > h ? h - row : rowstoread);
917 p0, ((row + img->
row_offset)%rowsperstrip + nrow) * scanline) < 0
924 p1, ((row + img->
row_offset)%rowsperstrip + nrow) * scanline) < 0
931 p2, ((row + img->
row_offset)%rowsperstrip + nrow) * scanline) < 0
940 pa, ((row + img->
row_offset)%rowsperstrip + nrow) * scanline) < 0
948 pos = ((row + img->
row_offset) % rowsperstrip) * scanline;
949 (*put)(img, raster+y*w, 0, y, w, nrow, fromskew, toskew, p0 + pos, p1 + pos,
950 p2 + pos, (alpha?(pa+pos):NULL));
951 y += (flip & FLIP_VERTICALLY ? -(int32) nrow : (int32) nrow);
957 for (line = 0; line < h; line++) {
958 uint32 *left = raster + (line * w);
959 uint32 *right = left + w - 1;
961 while ( left < right ) {
984 #define REPEAT8(op) REPEAT4(op); REPEAT4(op) 985 #define REPEAT4(op) REPEAT2(op); REPEAT2(op) 986 #define REPEAT2(op) op; op 987 #define CASE8(x,op) \ 989 case 7: op; case 6: op; case 5: op; \ 990 case 4: op; case 3: op; case 2: op; \ 993 #define CASE4(x,op) switch (x) { case 3: op; case 2: op; case 1: op; } 996 #define UNROLL8(w, op1, op2) { \ 998 for (_x = w; _x >= 8; _x -= 8) { \ 1007 #define UNROLL4(w, op1, op2) { \ 1009 for (_x = w; _x >= 4; _x -= 4) { \ 1018 #define UNROLL2(w, op1, op2) { \ 1020 for (_x = w; _x >= 2; _x -= 2) { \ 1030 #define SKEW(r,g,b,skew) { r += skew; g += skew; b += skew; } 1031 #define SKEW4(r,g,b,a,skew) { r += skew; g += skew; b += skew; a+= skew; } 1033 #define A1 (((uint32)0xffL)<<24) 1034 #define PACK(r,g,b) \ 1035 ((uint32)(r)|((uint32)(g)<<8)|((uint32)(b)<<16)|A1) 1036 #define PACK4(r,g,b,a) \ 1037 ((uint32)(r)|((uint32)(g)<<8)|((uint32)(b)<<16)|((uint32)(a)<<24)) 1038 #define W2B(v) (((v)>>8)&0xff) 1039 #define PACKW(r,g,b) \ 1040 ((uint32)W2B(r)|((uint32)W2B(g)<<8)|((uint32)W2B(b)<<16)|A1) 1041 #define PACKW4(r,g,b,a) \ 1042 ((uint32)W2B(r)|((uint32)W2B(g)<<8)|((uint32)W2B(b)<<16)|((uint32)W2B(a)<<24)) 1044 #define DECLAREContigPutFunc(name) \ 1046 TIFFRGBAImage* img, \ 1048 uint32 x, uint32 y, \ 1049 uint32 w, uint32 h, \ 1050 int32 fromskew, int32 toskew, \ 1059 uint32** PALmap = img->
PALmap;
1064 for (x = w; x-- > 0;)
1066 *cp++ = PALmap[*pp][0];
1067 pp += samplesperpixel;
1079 uint32** PALmap = img->
PALmap;
1085 UNROLL2(w, bw = PALmap[*pp++], *cp++ = *bw++);
1096 uint32** PALmap = img->
PALmap;
1102 UNROLL4(w, bw = PALmap[*pp++], *cp++ = *bw++);
1113 uint32** PALmap = img->
PALmap;
1119 UNROLL8(w, bw = PALmap[*pp++], *cp++ = *bw++);
1131 uint32** BWmap = img->
BWmap;
1135 for (x = w; x-- > 0;)
1137 *cp++ = BWmap[*pp][0];
1138 pp += samplesperpixel;
1151 uint32** BWmap = img->
BWmap;
1157 for (x = w; x-- > 0;)
1161 *cp++ = BWmap[*wp >> 8][0];
1162 pp += 2 * samplesperpixel;
1163 wp += samplesperpixel;
1175 uint32** BWmap = img->
BWmap;
1181 UNROLL8(w, bw = BWmap[*pp++], *cp++ = *bw++);
1192 uint32** BWmap = img->
BWmap;
1198 UNROLL4(w, bw = BWmap[*pp++], *cp++ = *bw++);
1209 uint32** BWmap = img->
BWmap;
1215 UNROLL2(w, bw = BWmap[*pp++], *cp++ = *bw++);
1229 fromskew *= samplesperpixel;
1232 *cp++ =
PACK(pp[0], pp[1], pp[2]);
1233 pp += samplesperpixel);
1248 fromskew *= samplesperpixel;
1251 *cp++ =
PACK4(pp[0], pp[1], pp[2], pp[3]);
1252 pp += samplesperpixel);
1266 fromskew *= samplesperpixel;
1269 for (x = w; x-- > 0;) {
1271 r = (a*pp[0] + 127) / 255;
1272 g = (a*pp[1] + 127) / 255;
1273 b = (a*pp[2] + 127) / 255;
1274 *cp++ =
PACK4(r,g,b,a);
1275 pp += samplesperpixel;
1290 fromskew *= samplesperpixel;
1292 for (x = w; x-- > 0;) {
1293 *cp++ =
PACKW(wp[0],wp[1],wp[2]);
1294 wp += samplesperpixel;
1310 fromskew *= samplesperpixel;
1312 for (x = w; x-- > 0;) {
1313 *cp++ =
PACKW4(wp[0],wp[1],wp[2],wp[3]);
1314 wp += samplesperpixel;
1330 fromskew *= samplesperpixel;
1333 for (x = w; x-- > 0;) {
1335 r = (a*
W2B(wp[0]) + 127) / 255;
1336 g = (a*
W2B(wp[1]) + 127) / 255;
1337 b = (a*
W2B(wp[2]) + 127) / 255;
1338 *cp++ =
PACK4(r,g,b,a);
1339 wp += samplesperpixel;
1357 fromskew *= samplesperpixel;
1361 r = (k*(255-pp[0]))/255;
1362 g = (k*(255-pp[1]))/255;
1363 b = (k*(255-pp[2]))/255;
1364 *cp++ =
PACK(r, g, b);
1365 pp += samplesperpixel);
1383 fromskew *= samplesperpixel;
1385 for (x = w; x-- > 0;) {
1387 r = (k*(255-pp[0]))/255;
1388 g = (k*(255-pp[1]))/255;
1389 b = (k*(255-pp[2]))/255;
1390 *cp++ =
PACK(Map[r], Map[g], Map[b]);
1391 pp += samplesperpixel;
1398 #define DECLARESepPutFunc(name) \ 1400 TIFFRGBAImage* img,\ 1402 uint32 x, uint32 y, \ 1403 uint32 w, uint32 h,\ 1404 int32 fromskew, int32 toskew,\ 1405 unsigned char* r, unsigned char* g, unsigned char* b, unsigned char* a\ 1413 (void) img; (void) x; (void) y; (void) a;
1416 SKEW(r, g,
b, fromskew);
1426 (void) img; (void) x; (void) y;
1429 SKEW4(r, g,
b, a, fromskew);
1439 (void) img; (void) y;
1441 uint32 rv, gv, bv, av;
1442 for (x = w; x-- > 0;) {
1444 rv = (av* *r++ + 127) / 255;
1445 gv = (av* *g++ + 127) / 255;
1446 bv = (av* *
b++ + 127) / 255;
1447 *cp++ =
PACK4(rv,gv,bv,av);
1449 SKEW4(r, g,
b, a, fromskew);
1462 (void) img; (void) y; (void) a;
1464 for (x = 0; x < w; x++)
1465 *cp++ =
PACKW(*wr++,*wg++,*wb++);
1466 SKEW(wr, wg, wb, fromskew);
1480 (void) img; (void) y;
1482 for (x = 0; x < w; x++)
1483 *cp++ =
PACKW4(*wr++,*wg++,*wb++,*wa++);
1484 SKEW4(wr, wg, wb, wa, fromskew);
1498 (void) img; (void) y;
1501 for (x = w; x-- > 0;) {
1503 r = (a*
W2B(*wr++) + 127) / 255;
1504 g = (a*
W2B(*wg++) + 127) / 255;
1505 b = (a*
W2B(*wb++) + 127) / 255;
1506 *cp++ =
PACK4(r,g,b,a);
1508 SKEW4(wr, wg, wb, wa, fromskew);
1523 for (x = w; x-- > 0;) {
1525 (
unsigned char)pp[0],
1530 *cp++ =
PACK(r, g, b);
1542 #define YCbCrtoRGB(dst, Y) { \ 1544 TIFFYCbCrtoRGB(img->ycbcr, (Y), Cb, Cr, &r, &g, &b); \ 1545 dst = PACK(r, g, b); \ 1557 static void putcontig8bitYCbCrGenericTile(
1562 int32 fromskew, int32 toskew,
1568 uint32* cp1 = cp+w+toskew;
1569 uint32* cp2 = cp1+w+toskew;
1570 uint32* cp3 = cp2+w+toskew;
1571 int32 incr = 3*w+4*toskew;
1573 int group_size = v_group * h_group + 2;
1576 fromskew = (fromskew * group_size) / h_group;
1578 for( yy = 0; yy < h; yy++ )
1580 unsigned char *pp_line;
1581 int y_line_group = yy / v_group;
1582 int y_remainder = yy - y_line_group * v_group;
1584 pp_line = pp + v_line_group *
1587 for( xx = 0; xx < w; xx++ )
1592 for (; h >= 4; h -= 4) {
1615 cp += 4, cp1 += 4, cp2 += 4, cp3 += 4;
1618 cp += incr, cp1 += incr, cp2 += incr, cp3 += incr;
1629 uint32* cp1 = cp+w+toskew;
1630 uint32* cp2 = cp1+w+toskew;
1631 uint32* cp3 = cp2+w+toskew;
1632 int32 incr = 3*w+4*toskew;
1636 fromskew = (fromskew * 18) / 4;
1637 if ((h & 3) == 0 && (w & 3) == 0) {
1638 for (; h >= 4; h -= 4) {
1661 cp += 4, cp1 += 4, cp2 += 4, cp3 += 4;
1664 cp += incr, cp1 += incr, cp2 += incr, cp3 += incr;
1669 for (x = w; x > 0;) {
1703 cp += x; cp1 += x; cp2 += x; cp3 += x;
1707 cp += 4; cp1 += 4; cp2 += 4; cp3 += 4;
1715 cp += incr, cp1 += incr, cp2 += incr, cp3 += incr;
1726 uint32* cp1 = cp+w+toskew;
1727 int32 incr = 2*toskew+w;
1730 fromskew = (fromskew * 10) / 4;
1731 if ((h & 3) == 0 && (w & 1) == 0) {
1732 for (; h >= 2; h -= 2) {
1750 cp += incr, cp1 += incr;
1755 for (x = w; x > 0;) {
1793 cp += incr, cp1 += incr;
1850 fromskew = (fromskew / 2) * 6;
1906 fromskew = (fromskew * 4) / 2;
1943 fromskew = (fromskew / 2) * 4;
2008 *cp++ =
PACK(dr,dg,db);
2010 SKEW(r, g,
b, fromskew);
2019 static char module[] =
"initYCbCrConversion";
2021 float *luma, *refBlackWhite;
2023 if (img->
ycbcr == NULL) {
2027 + 2*256*
sizeof (
int)
2028 + 3*256*
sizeof (int32)
2030 if (img->
ycbcr == NULL) {
2032 "No space for YCbCr->RGB conversion state");
2048 static char module[] =
"initCIELabConversion";
2058 "No space for CIE L*a*b*->RGB conversion state.");
2064 refWhite[1] = 100.0F;
2065 refWhite[0] = whitePoint[0] / whitePoint[1] * refWhite[1];
2066 refWhite[2] = (1.0F - whitePoint[0] - whitePoint[1])
2067 / whitePoint[1] * refWhite[1];
2070 "Failed to initialize CIE L*a*b*->RGB conversion state.");
2075 return putcontig8bitCIELab;
2090 int nsamples = 8 / bitspersample;
2098 256*
sizeof (uint32 *)+(256*nsamples*
sizeof(uint32)));
2099 if (img->
BWmap == NULL) {
2103 p = (uint32*)(img->
BWmap + 256);
2104 for (i = 0; i < 256; i++) {
2107 switch (bitspersample) {
2108 #define GREY(x) c = Map[x]; *p++ = PACK(c,c,c); 2153 range = (int32) 255;
2156 if (img->
Map == NULL) {
2158 "No space for photometric conversion table");
2162 for (x = 0; x <= range; x++)
2165 for (x = 0; x <= range; x++)
2175 if (!makebwmap(img))
2192 if (*r++ >= 256 || *g++ >= 256 || *b++ >= 256)
2206 #define CVT(x) ((uint16)((x)>>8)) 2225 int nsamples = 8 / bitspersample;
2233 256*
sizeof (uint32 *)+(256*nsamples*
sizeof(uint32)));
2234 if (img->
PALmap == NULL) {
2238 p = (uint32*)(img->
PALmap + 256);
2239 for (i = 0; i < 256; i++) {
2242 #define CMAP(x) c = (TIFFRGBValue) x; *p++ = PACK(r[c]&0xff, g[c]&0xff, b[c]&0xff); 2243 switch (bitspersample) {
2297 if (checkcmap(img) == 16)
2325 img->
put.
contig = putRGBAAcontig8bittile;
2328 img->
put.
contig = putRGBUAcontig8bittile;
2336 img->
put.
contig = putRGBAAcontig16bittile;
2340 img->
put.
contig = putRGBUAcontig16bittile;
2344 img->
put.
contig = putRGBcontig16bittile;
2350 if (buildMap(img)) {
2353 img->
put.
contig = putRGBcontig8bitCMYKtile;
2355 img->
put.
contig = putRGBcontig8bitCMYKMaptile;
2360 if (buildMap(img)) {
2379 if (buildMap(img)) {
2402 if (initYCbCrConversion(img)!=0)
2416 switch ((SubsamplingHor<<4)|SubsamplingVer) {
2418 img->
put.
contig = putcontig8bitYCbCr44tile;
2421 img->
put.
contig = putcontig8bitYCbCr42tile;
2424 img->
put.
contig = putcontig8bitYCbCr41tile;
2427 img->
put.
contig = putcontig8bitYCbCr22tile;
2430 img->
put.
contig = putcontig8bitYCbCr21tile;
2433 img->
put.
contig = putcontig8bitYCbCr12tile;
2436 img->
put.
contig = putcontig8bitYCbCr11tile;
2443 if (buildMap(img)) {
2445 img->
put.
contig = initCIELabConversion(img);
2495 if (initYCbCrConversion(img)!=0)
2499 switch ((hs<<4)|vs) {
2524 char emsg[1024] =
"";
2527 uint32 rowsperstrip, rows_to_read;
2532 "Can't use TIFFReadRGBAStrip() with tiled file.");
2537 if( (row % rowsperstrip) != 0 )
2540 "Row passed to TIFFReadRGBAStrip() must be first in a strip.");
2549 if( row + rowsperstrip > img.
height )
2550 rows_to_read = img.
height - row;
2552 rows_to_read = rowsperstrip;
2575 char emsg[1024] =
"";
2578 uint32 tile_xsize, tile_ysize;
2579 uint32 read_xsize, read_ysize;
2590 "Can't use TIFFReadRGBATile() with stripped file.");
2596 if( (col % tile_xsize) != 0 || (row % tile_ysize) != 0 )
2599 "Row/col passed to TIFFReadRGBATile() must be top" 2600 "left corner of a tile.");
2621 if( row + tile_ysize > img.
height )
2622 read_ysize = img.
height - row;
2624 read_ysize = tile_ysize;
2626 if( col + tile_xsize > img.
width )
2627 read_xsize = img.
width - col;
2629 read_xsize = tile_xsize;
2650 if( read_xsize == tile_xsize && read_ysize == tile_ysize )
2653 for( i_row = 0; i_row < read_ysize; i_row++ ) {
2654 memmove( raster + (tile_ysize - i_row - 1) * tile_xsize,
2655 raster + (read_ysize - i_row - 1) * read_xsize,
2656 read_xsize *
sizeof(uint32) );
2657 _TIFFmemset( raster + (tile_ysize - i_row - 1) * tile_xsize+read_xsize,
2658 0,
sizeof(uint32) * (tile_xsize - read_xsize) );
2661 for( i_row = read_ysize; i_row < tile_ysize; i_row++ ) {
2662 _TIFFmemset( raster + (tile_ysize - i_row - 1) * tile_xsize,
2663 0,
sizeof(uint32) * tile_xsize );
#define DECLARESepPutFunc(name)
tsize_t TIFFTileRowSize(TIFF *tif)
#define SKEW(r, g, b, skew)
#define DECLAREContigPutFunc(name)
void TIFFXYZToRGB(TIFFCIELabToRGB *cielab, float X, float Y, float Z, uint32 *r, uint32 *g, uint32 *b)
#define PACKW4(r, g, b, a)
#define PHOTOMETRIC_YCBCR
#define UNROLL8(w, op1, op2)
#define TIFFTAG_BITSPERSAMPLE
void TIFFWarningExt(thandle_t fd, const char *module, const char *fmt,...)
#define UNROLL2(w, op1, op2)
#define TIFFTAG_ROWSPERSTRIP
#define PHOTOMETRIC_SEPARATED
#define TIFFTAG_EXTRASAMPLES
#define TIFFTAG_ORIENTATION
#define PHOTOMETRIC_CIELAB
#define TIFFTAG_IMAGEWIDTH
#define COMPRESSION_CCITTFAX3
#define COMPRESSION_SGILOG24
int TIFFCIELabToRGBInit(TIFFCIELabToRGB *cielab, TIFFDisplay *display, float *refWhite)
#define TIFFTAG_SGILOGDATAFMT
tsize_t TIFFScanlineSize(TIFF *tif)
#define PHOTOMETRIC_LOGLUV
#define ORIENTATION_RIGHTTOP
#define COMPRESSION_CCITTRLE
#define TIFFTAG_YCBCRSUBSAMPLING
unsigned char TIFFRGBValue
#define TIFFTAG_REFERENCEBLACKWHITE
#define TIFFTAG_PLANARCONFIG
#define ORIENTATION_TOPLEFT
void(* tileContigRoutine)(TIFFRGBAImage *, uint32 *, uint32, uint32, uint32, uint32, int32, int32, unsigned char *)
#define TIFFTAG_JPEGCOLORMODE
int TIFFReadRGBATile(TIFF *tif, uint32 col, uint32 row, uint32 *raster)
#define TIFFTAG_YCBCRCOEFFICIENTS
int TIFFRGBAImageBegin(TIFFRGBAImage *img, TIFF *tif, int stop, char emsg[1024])
void _TIFFmemcpy(tdata_t d, const tdata_t s, tsize_t c)
#define JPEGCOLORMODE_RGB
#define ORIENTATION_RIGHTBOT
#define FLIP_HORIZONTALLY
#define TIFFTAG_TILEWIDTH
#define COMPRESSION_CCITTFAX4
#define TIFFTAG_TILELENGTH
#define PHOTOMETRIC_MINISWHITE
#define SKEW4(r, g, b, a, skew)
#define TIFFTAG_IMAGELENGTH
#define TIFFTAG_SAMPLESPERPIXEL
#define PHOTOMETRIC_PALETTE
#define ORIENTATION_LEFTTOP
void TIFFRGBAImageEnd(TIFFRGBAImage *img)
#define PHOTOMETRIC_MINISBLACK
#define COMPRESSION_CCITTRLEW
tstrip_t TIFFComputeStrip(TIFF *tif, uint32 row, tsample_t sample)
void TIFFCIELabToXYZ(TIFFCIELabToRGB *cielab, uint32 l, int32 a, int32 b, float *X, float *Y, float *Z)
int TIFFRGBAImageGet(TIFFRGBAImage *img, uint32 *raster, uint32 w, uint32 h)
union _TIFFRGBAImage::@12 put
#define UNROLL4(w, op1, op2)
int TIFFGetFieldDefaulted(TIFF *tif, ttag_t tag,...)
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
#define TIFFTAG_PHOTOMETRIC
#define EXTRASAMPLE_UNASSALPHA
#define TIFFroundup(x, y)
int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB *ycbcr, float *luma, float *refBlackWhite)
#define TIFFTAG_WHITEPOINT
#define ORIENTATION_TOPRIGHT
#define COMPRESSION_SGILOG
#define TIFFTAG_COMPRESSION
#define PLANARCONFIG_SEPARATE
tsize_t TIFFNewScanlineSize(TIFF *tif)
void _TIFFmemset(tdata_t p, int v, tsize_t c)
int(* get)(TIFFRGBAImage *, uint32 *, uint32, uint32)
#define SGILOGDATAFMT_8BIT
int TIFFRGBAImageOK(TIFF *tif, char emsg[1024])
void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *ycbcr, uint32 Y, int32 Cb, int32 Cr, uint32 *r, uint32 *g, uint32 *b)
uint16 td_samplesperpixel
int TIFFReadRGBAImage(TIFF *tif, uint32 rwidth, uint32 rheight, uint32 *raster, int stop)
int TIFFReadRGBAImageOriented(TIFF *tif, uint32 rwidth, uint32 rheight, uint32 *raster, int orientation, int stop)
int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
tsize_t TIFFTileSize(TIFF *tif)
tileSeparateRoutine separate
#define EXTRASAMPLE_UNSPECIFIED
#define YCbCrtoRGB(dst, Y)
tsize_t TIFFReadEncodedStrip(TIFF *tif, tstrip_t strip, tdata_t buf, tsize_t size)
const char * TIFFFileName(TIFF *tif)
int TIFFSetField(TIFF *tif, ttag_t tag,...)
void * _TIFFmalloc(tsize_t s)
tsize_t TIFFStripSize(TIFF *tif)
void(* tileSeparateRoutine)(TIFFRGBAImage *, uint32 *, uint32, uint32, uint32, uint32, int32, int32, unsigned char *, unsigned char *, unsigned char *, unsigned char *)
int TIFFIsTiled(TIFF *tif)
#define PACK4(r, g, b, a)
int TIFFGetField(TIFF *tif, ttag_t tag,...)
void _TIFFfree(tdata_t p)
#define EXTRASAMPLE_ASSOCALPHA
void(* any)(TIFFRGBAImage *)
#define ORIENTATION_LEFTBOT
#define ORIENTATION_BOTLEFT
#define ORIENTATION_BOTRIGHT
tsize_t TIFFReadTile(TIFF *tif, tdata_t buf, uint32 x, uint32 y, uint32 z, tsample_t s)
int TIFFReadRGBAStrip(TIFF *tif, uint32 row, uint32 *raster)
#define PLANARCONFIG_CONTIG