Commit 5d43d3ca authored by Stuart Cunningham's avatar Stuart Cunningham

Fix Windows build of grfmt_tiff.cpp by using libtiff's integer types.

parent 8bbce0a2
...@@ -117,15 +117,15 @@ bool TiffDecoder::readHeader() ...@@ -117,15 +117,15 @@ bool TiffDecoder::readHeader()
if( tif ) if( tif )
{ {
uint wdth = 0, hght = 0; uint32 wdth = 0, hght = 0;
ushort photometric = 0; uint16 photometric = 0;
m_tif = tif; m_tif = tif;
if( TIFFGetField( tif, TIFFTAG_IMAGEWIDTH, &wdth ) && if( TIFFGetField( tif, TIFFTAG_IMAGEWIDTH, &wdth ) &&
TIFFGetField( tif, TIFFTAG_IMAGELENGTH, &hght ) && TIFFGetField( tif, TIFFTAG_IMAGELENGTH, &hght ) &&
TIFFGetField( tif, TIFFTAG_PHOTOMETRIC, &photometric )) TIFFGetField( tif, TIFFTAG_PHOTOMETRIC, &photometric ))
{ {
ushort bpp=8, ncn = photometric > 1 ? 3 : 1; uint16 bpp=8, ncn = photometric > 1 ? 3 : 1;
TIFFGetField( tif, TIFFTAG_BITSPERSAMPLE, &bpp ); TIFFGetField( tif, TIFFTAG_BITSPERSAMPLE, &bpp );
TIFFGetField( tif, TIFFTAG_SAMPLESPERPIXEL, &ncn ); TIFFGetField( tif, TIFFTAG_SAMPLESPERPIXEL, &ncn );
...@@ -178,12 +178,12 @@ bool TiffDecoder::readData( Mat& img ) ...@@ -178,12 +178,12 @@ bool TiffDecoder::readData( Mat& img )
if( m_tif && m_width && m_height ) if( m_tif && m_width && m_height )
{ {
TIFF* tif = (TIFF*)m_tif; TIFF* tif = (TIFF*)m_tif;
uint tile_width0 = m_width, tile_height0 = 0; uint32 tile_width0 = m_width, tile_height0 = 0;
int x, y, i; int x, y, i;
int is_tiled = TIFFIsTiled(tif); int is_tiled = TIFFIsTiled(tif);
ushort photometric; uint16 photometric;
TIFFGetField( tif, TIFFTAG_PHOTOMETRIC, &photometric ); TIFFGetField( tif, TIFFTAG_PHOTOMETRIC, &photometric );
ushort bpp = 8, ncn = photometric > 1 ? 3 : 1; uint16 bpp = 8, ncn = photometric > 1 ? 3 : 1;
TIFFGetField( tif, TIFFTAG_BITSPERSAMPLE, &bpp ); TIFFGetField( tif, TIFFTAG_BITSPERSAMPLE, &bpp );
TIFFGetField( tif, TIFFTAG_SAMPLESPERPIXEL, &ncn ); TIFFGetField( tif, TIFFTAG_SAMPLESPERPIXEL, &ncn );
const int bitsPerByte = 8; const int bitsPerByte = 8;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment