79static char THIS_FILE[]=__FILE__;
125 unsigned int nBPS,
unsigned int nPhoto,
unsigned int nSamples,
126 float fXRes,
float fYRes,
bool bCompress,
bool bSep)
138 m_nPlanar = bSep ? PLANARCONFIG_SEPARATE : PLANARCONFIG_CONTIG;
139 m_nCompress = bCompress ? COMPRESSION_LZW : COMPRESSION_NONE;
165 m_hTif = TIFFOpen(szFname,
"w");
167 TIFFError(szFname,
"Can not open output image");
177 TIFFSetField(
m_hTif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_IEEEFP);
180 TIFFSetField(
m_hTif, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
181 TIFFSetField(
m_hTif, TIFFTAG_XRESOLUTION, fXRes);
182 TIFFSetField(
m_hTif, TIFFTAG_YRESOLUTION, fYRes);
185 TIFFSetField(
m_hTif, TIFFTAG_PREDICTOR, PREDICTOR_FLOATINGPOINT);
188 TIFFSetField(
m_hTif, TIFFTAG_PREDICTOR, PREDICTOR_HORIZONTAL);
233 m_hTif = TIFFOpen(szFname,
"r");
235 TIFFError(szFname,
"Can not open input image");
250 TIFFGetField(
m_hTif, TIFFTAG_SAMPLEFORMAT, &nSampleFormat);
252 TIFFGetField(
m_hTif, TIFFTAG_ORIENTATION, &nOrientation);
260 nOrientation != ORIENTATION_TOPLEFT) {
316 unsigned int nStripOffset = 0;
331 unsigned char *src, *dst;
336 unsigned char *pos = src;
360 unsigned char *src, *dst;
363 unsigned int w, s, offset;
365 unsigned char *pos = dst;
393 if (
m_nPhoto==PHOTOMETRIC_MINISBLACK ||
397 else if (
m_nPhoto==PHOTOMETRIC_MINISWHITE ||
401 else if (
m_nPhoto==PHOTOMETRIC_CIELAB)
403 else if (
m_nPhoto==PHOTOMETRIC_ICCLAB)
415 TIFFGetField(
m_hTif, TIFFTAG_ICCPROFILE, &nLen, &pProfile);
417 return pProfile!=NULL && nLen>0;
422 TIFFSetField(
m_hTif, TIFFTAG_ICCPROFILE, nLen, pProfile);
bool Open(const char *szFname)
unsigned int m_nStripsPerSample
icUInt16Number m_nExtraSamples
unsigned int m_nRowsPerStrip
icUInt16Number m_nCompress
unsigned int m_nStripSamples
icUInt16Number m_nSamples
bool Create(const char *szFname, unsigned int nWidth, unsigned int nHeight, unsigned int nBPS, unsigned int nPhoto, unsigned int nSamples, float fXRes, float fYRes, bool bCompress=true, bool bSep=false)
bool WriteLine(unsigned char *pBuf)
unsigned int m_nStripSize
bool ReadLine(unsigned char *pBuf)
bool SetIccProfile(unsigned char *pProfile, unsigned int nLen)
bool GetIccProfile(unsigned char *&pProfile, unsigned int &nLen)
unsigned char * m_pStripBuf
unsigned int m_nBytesPerLine
icUInt16Number m_nBitsPerSample
icUInt16Number m_nBytesPerSample
unsigned int m_nBytesPerStripLine