本文整理汇总了C++中TiffEntry::getIntArray方法的典型用法代码示例。如果您正苦于以下问题:C++ TiffEntry::getIntArray方法的具体用法?C++ TiffEntry::getIntArray怎么用?C++ TiffEntry::getIntArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TiffEntry
的用法示例。
在下文中一共展示了TiffEntry::getIntArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: decodeRawInternal
RawImage KdcDecoder::decodeRawInternal() {
int compression = mRootIFD->getEntryRecursive(COMPRESSION)->getInt();
if (7 != compression)
ThrowRDE("KDC Decoder: Unsupported compression %d", compression);
TiffEntry *ex = mRootIFD->getEntryRecursive(PIXELXDIMENSION);
TiffEntry *ey = mRootIFD->getEntryRecursive(PIXELYDIMENSION);
if (NULL == ex || NULL == ey)
ThrowRDE("KDC Decoder: Unable to retrieve image size");
uint32 width = ex->getInt();
uint32 height = ey->getInt();
TiffEntry *offset = mRootIFD->getEntryRecursive(KODAK_KDC_OFFSET);
if (!offset || offset->count < 13)
ThrowRDE("KDC Decoder: Couldn't find the KDC offset");
const uint32 *offsetarray = offset->getIntArray();
uint32 off = offsetarray[4] + offsetarray[12];
mRaw->dim = iPoint2D(width, height);
mRaw->createData();
ByteStream input(mFile->getData(off), mFile->getSize()-off);
Decode12BitRawBE(input, width, height);
return mRaw;
}
示例2: decodeMetaDataInternal
void KdcDecoder::decodeMetaDataInternal(CameraMetaData *meta) {
vector<TiffIFD*> data = mRootIFD->getIFDsWithTag(MODEL);
if (data.empty())
ThrowRDE("KDC Decoder: Model name found");
if (!data[0]->hasEntry(MAKE))
ThrowRDE("KDC Decoder: Make name not found");
string make = data[0]->getEntry(MAKE)->getString();
string model = data[0]->getEntry(MODEL)->getString();
setMetaData(meta, make, model, "", 0);
// Try the kodak hidden IFD for WB
if (mRootIFD->hasEntryRecursive(KODAK_IFD2)) {
TiffEntry *ifdoffset = mRootIFD->getEntryRecursive(KODAK_IFD2);
TiffIFD *kodakifd = NULL;
try {
if (mRootIFD->endian == getHostEndianness())
kodakifd = new TiffIFD(mFile, ifdoffset->getInt());
else
kodakifd = new TiffIFDBE(mFile, ifdoffset->getInt());
if (kodakifd && kodakifd->hasEntryRecursive(KODAK_KDC_WB)) {
TiffEntry *wb = kodakifd->getEntryRecursive(KODAK_KDC_WB);
if (wb->count == 3) {
const uint32 *tmp = wb->getIntArray();
mRaw->metadata.wbCoeffs[0] = (float)tmp[0];
mRaw->metadata.wbCoeffs[1] = (float)tmp[1];
mRaw->metadata.wbCoeffs[2] = (float)tmp[2];
}
}
} catch(TiffParserException e) {
mRaw->setError(e.what());
}
if (kodakifd)
delete kodakifd;
}
// Use the normal WB if available
if (mRootIFD->hasEntryRecursive(KODAKWB)) {
TiffEntry *wb = mRootIFD->getEntryRecursive(KODAKWB);
if (wb->count == 734 || wb->count == 1502) {
const uchar8 *tmp = wb->getData();
mRaw->metadata.wbCoeffs[0] = (float)((((ushort16) tmp[148])<<8)|tmp[149])/256.0f;
mRaw->metadata.wbCoeffs[1] = 1.0f;
mRaw->metadata.wbCoeffs[2] = (float)((((ushort16) tmp[150])<<8)|tmp[151])/256.0f;
}
}
}
示例3: decodeRawInternal
RawImage KdcDecoder::decodeRawInternal() {
if (!mRootIFD->hasEntryRecursive(COMPRESSION))
ThrowRDE("KDC Decoder: Couldn't find compression setting");
int compression = mRootIFD->getEntryRecursive(COMPRESSION)->getInt();
if (7 != compression)
ThrowRDE("KDC Decoder: Unsupported compression %d", compression);
uint32 width = 0;
uint32 height = 0;
TiffEntry *ew = mRootIFD->getEntryRecursive(KODAK_KDC_WIDTH);
TiffEntry *eh = mRootIFD->getEntryRecursive(KODAK_KDC_HEIGHT);
if (ew && eh) {
width = ew->getInt()+80;
height = eh->getInt()+70;
} else
ThrowRDE("KDC Decoder: Unable to retrieve image size");
TiffEntry *offset = mRootIFD->getEntryRecursive(KODAK_KDC_OFFSET);
if (!offset || offset->count < 13)
ThrowRDE("KDC Decoder: Couldn't find the KDC offset");
const uint32 *offsetarray = offset->getIntArray();
uint32 off = offsetarray[4] + offsetarray[12];
// Offset hardcoding gotten from dcraw
if (hints.find("easyshare_offset_hack") != hints.end())
off = off < 0x15000 ? 0x15000 : 0x17000;
if (off > mFile->getSize())
ThrowRDE("KDC Decoder: offset is out of bounds");
mRaw->dim = iPoint2D(width, height);
mRaw->createData();
ByteStream input(mFile, off);
Decode12BitRawBE(input, width, height);
return mRaw;
}