Пример #1
0
RawImage CrwDecoder::decodeRawInternal() {
    CiffEntry *sensorInfo = mRootIFD->getEntryRecursive(CIFF_SENSORINFO);

    if (!sensorInfo || sensorInfo->count < 6 || sensorInfo->type != CIFF_SHORT)
        ThrowRDE("CRW: Couldn't find image sensor info");

    uint32 width = sensorInfo->getShort(1);
    uint32 height = sensorInfo->getShort(2);

    CiffEntry *decTable = mRootIFD->getEntryRecursive(CIFF_DECODERTABLE);
    if (!decTable || decTable->type != CIFF_LONG)
        ThrowRDE("CRW: Couldn't find decoder table");

    uint32 dec_table = decTable->getInt();
    if (dec_table > 2)
        ThrowRDE("CRW: Unknown decoder table %d", dec_table);

    mRaw->dim = iPoint2D(width, height);
    mRaw->createData();

    bool lowbits = hints.find("no_decompressed_lowbits") == hints.end();
    decodeRaw(lowbits, dec_table, width, height);

    return mRaw;
}
Пример #2
0
CiffEntry* CiffIFD::getEntryRecursiveWhere(CiffTag tag, uint32 isValue) {
  if (mEntry.find(tag) != mEntry.end()) {
    CiffEntry* entry = mEntry[tag];
    if (entry->isInt() && entry->getInt() == isValue)
      return entry;
  }
  for (vector<CiffIFD*>::iterator i = mSubIFD.begin(); i != mSubIFD.end(); ++i) {
    CiffEntry* entry = (*i)->getEntryRecursive(tag);
    if (entry)
      return entry;
  }
  return NULL;
}
Пример #3
0
vector<CiffIFD*> CiffIFD::getIFDsWithTagWhere(CiffTag tag, uint32 isValue) {
  vector<CiffIFD*> matchingIFDs;
  if (mEntry.find(tag) != mEntry.end()) {
    CiffEntry* entry = mEntry[tag];
    if (entry->isInt() && entry->getInt() == isValue)
      matchingIFDs.push_back(this);
  }
  for (vector<CiffIFD*>::iterator i = mSubIFD.begin(); i != mSubIFD.end(); ++i) {
    vector<CiffIFD*> t = (*i)->getIFDsWithTag(tag);
    for (uint32 j = 0; j < t.size(); j++) {
      matchingIFDs.push_back(t[j]);
    }
  }
  return matchingIFDs;
}