summaryrefslogtreecommitdiff
path: root/libtiff
diff options
context:
space:
mode:
authorFrank Warmerdam <warmerdam@pobox.com>2008-12-21 16:35:19 +0000
committerFrank Warmerdam <warmerdam@pobox.com>2008-12-21 16:35:19 +0000
commit35d21f7970c6a9e53385efcbda9772a448d45a7d (patch)
tree4a16dffd73019f3cb505f99e655c8e2bb810e200 /libtiff
parent8b19ed3c86784c4e23b3a0506291fdf56e956b7a (diff)
downloadlibtiff-git-35d21f7970c6a9e53385efcbda9772a448d45a7d.tar.gz
Removed SubsamplingHor/Ver from TIFFRGBAImage structure to avoid ABI changes (#1980)
Diffstat (limited to 'libtiff')
-rw-r--r--libtiff/tif_getimage.c16
-rw-r--r--libtiff/tiffio.h4
2 files changed, 10 insertions, 10 deletions
diff --git a/libtiff/tif_getimage.c b/libtiff/tif_getimage.c
index 0e92a0de..84f744e4 100644
--- a/libtiff/tif_getimage.c
+++ b/libtiff/tif_getimage.c
@@ -1,4 +1,4 @@
-/* $Id: tif_getimage.c,v 1.63.2.1 2008-12-18 21:51:43 fwarmerdam Exp $ */
+/* $Id: tif_getimage.c,v 1.63.2.2 2008-12-21 16:35:19 fwarmerdam Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
@@ -422,8 +422,6 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024])
photoTag, img->photometric);
return (0);
}
- img->SubsamplingHor = 1;
- img->SubsamplingVer = 1;
img->Map = NULL;
img->BWmap = NULL;
img->PALmap = NULL;
@@ -795,6 +793,7 @@ gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
uint32 pos;
unsigned char* buf;
uint32 rowsperstrip;
+ uint16 subsamplinghor,subsamplingver;
uint32 imagewidth = img->width;
tsize_t scanline;
int32 fromskew, toskew;
@@ -817,6 +816,7 @@ gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
}
TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
+ TIFFGetFieldDefaulted(tif, TIFFTAG_YCBCRSUBSAMPLING, &subsamplinghor, &subsamplingver);
scanline = TIFFNewScanlineSize(tif);
fromskew = (w < imagewidth ? imagewidth - w : 0);
for (row = 0; row < h; row += nrow)
@@ -824,8 +824,8 @@ gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
rowstoread = rowsperstrip - (row + img->row_offset) % rowsperstrip;
nrow = (row + rowstoread > h ? h - row : rowstoread);
nrowsub = nrow;
- if ((nrowsub%(img->SubsamplingVer))!=0)
- nrowsub+=img->SubsamplingVer-nrowsub%(img->SubsamplingVer);
+ if ((nrowsub%subsamplingver)!=0)
+ nrowsub+=subsamplingver-nrowsub%subsamplingver;
if (TIFFReadEncodedStrip(tif,
TIFFComputeStrip(tif,row+img->row_offset, 0),
buf,
@@ -2410,8 +2410,10 @@ PickContigCase(TIFFRGBAImage* img)
* Joris: added support for the [1,2] case, nonetheless, to accomodate
* some OJPEG files
*/
- TIFFGetFieldDefaulted(img->tif, TIFFTAG_YCBCRSUBSAMPLING, &img->SubsamplingHor, &img->SubsamplingVer);
- switch ((img->SubsamplingHor<<4)|img->SubsamplingVer) {
+ uint16 SubsamplingHor;
+ uint16 SubsamplingVer;
+ TIFFGetFieldDefaulted(img->tif, TIFFTAG_YCBCRSUBSAMPLING, &SubsamplingHor, &SubsamplingVer);
+ switch ((SubsamplingHor<<4)|SubsamplingVer) {
case 0x44:
img->put.contig = putcontig8bitYCbCr44tile;
break;
diff --git a/libtiff/tiffio.h b/libtiff/tiffio.h
index 29c99f1d..9f23baa7 100644
--- a/libtiff/tiffio.h
+++ b/libtiff/tiffio.h
@@ -1,4 +1,4 @@
-/* $Id: tiffio.h,v 1.56.2.1 2008-12-18 21:51:43 fwarmerdam Exp $ */
+/* $Id: tiffio.h,v 1.56.2.2 2008-12-21 16:35:19 fwarmerdam Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -194,8 +194,6 @@ struct _TIFFRGBAImage {
int alpha; /* type of alpha data present */
uint32 width; /* image width */
uint32 height; /* image height */
- uint16 SubsamplingHor; /* subsampling factors */
- uint16 SubsamplingVer;
uint16 bitspersample; /* image bits/sample */
uint16 samplesperpixel; /* image samples/pixel */
uint16 orientation; /* image orientation */