|
|
@ -245,7 +245,7 @@ bool TiffDecoder::readHeader() |
|
|
|
if (!tif) |
|
|
|
if (!tif) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// TIFFOpen() mode flags are different to fopen(). A 'b' in mode "rb" has no effect when reading.
|
|
|
|
// TIFFOpen() mode flags are different to fopen(). A 'b' in mode "rb" has no effect when reading.
|
|
|
|
// http://www.remotesensing.org/libtiff/man/TIFFOpen.3tiff.html
|
|
|
|
// http://www.simplesystems.org/libtiff/functions/TIFFOpen.html
|
|
|
|
if ( !m_buf.empty() ) |
|
|
|
if ( !m_buf.empty() ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
m_buf_pos = 0; |
|
|
|
m_buf_pos = 0; |
|
|
@ -1118,7 +1118,7 @@ public: |
|
|
|
TIFF* open () |
|
|
|
TIFF* open () |
|
|
|
{ |
|
|
|
{ |
|
|
|
// do NOT put "wb" as the mode, because the b means "big endian" mode, not "binary" mode.
|
|
|
|
// do NOT put "wb" as the mode, because the b means "big endian" mode, not "binary" mode.
|
|
|
|
// http://www.remotesensing.org/libtiff/man/TIFFOpen.3tiff.html
|
|
|
|
// http://www.simplesystems.org/libtiff/functions/TIFFOpen.html
|
|
|
|
return TIFFClientOpen( "", "w", reinterpret_cast<thandle_t>(this), &TiffEncoderBufHelper::read, |
|
|
|
return TIFFClientOpen( "", "w", reinterpret_cast<thandle_t>(this), &TiffEncoderBufHelper::read, |
|
|
|
&TiffEncoderBufHelper::write, &TiffEncoderBufHelper::seek, |
|
|
|
&TiffEncoderBufHelper::write, &TiffEncoderBufHelper::seek, |
|
|
|
&TiffEncoderBufHelper::close, &TiffEncoderBufHelper::size, |
|
|
|
&TiffEncoderBufHelper::close, &TiffEncoderBufHelper::size, |
|
|
@ -1200,7 +1200,7 @@ static bool readParam(const std::vector<int>& params, int key, int& value) |
|
|
|
bool TiffEncoder::writeLibTiff( const std::vector<Mat>& img_vec, const std::vector<int>& params) |
|
|
|
bool TiffEncoder::writeLibTiff( const std::vector<Mat>& img_vec, const std::vector<int>& params) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// do NOT put "wb" as the mode, because the b means "big endian" mode, not "binary" mode.
|
|
|
|
// do NOT put "wb" as the mode, because the b means "big endian" mode, not "binary" mode.
|
|
|
|
// http://www.remotesensing.org/libtiff/man/TIFFOpen.3tiff.html
|
|
|
|
// http://www.simplesystems.org/libtiff/functions/TIFFOpen.html
|
|
|
|
TIFF* tif = NULL; |
|
|
|
TIFF* tif = NULL; |
|
|
|
|
|
|
|
|
|
|
|
TiffEncoderBufHelper buf_helper(m_buf); |
|
|
|
TiffEncoderBufHelper buf_helper(m_buf); |
|
|
|