MCPcopy Create free account
hub / github.com/darktable-org/rawspeed / decodeMetaDataInternal

Method decodeMetaDataInternal

src/librawspeed/decoders/SrwDecoder.cpp:159–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159void SrwDecoder::decodeMetaDataInternal(const CameraMetaData* meta) {
160 int iso = 0;
161 if (mRootIFD->hasEntryRecursive(ISOSPEEDRATINGS))
162 iso = mRootIFD->getEntryRecursive(ISOSPEEDRATINGS)->getU32();
163
164 auto id = mRootIFD->getID();
165 std::string mode = getMode();
166 if (meta->hasCamera(id.make, id.model, mode))
167 setMetaData(meta, id, mode, iso);
168 else
169 setMetaData(meta, id, "", iso);
170
171 // Set the whitebalance
172 if (mRootIFD->hasEntryRecursive(SAMSUNG_WB_RGGBLEVELSUNCORRECTED) &&
173 mRootIFD->hasEntryRecursive(SAMSUNG_WB_RGGBLEVELSBLACK)) {
174 TiffEntry *wb_levels = mRootIFD->getEntryRecursive(SAMSUNG_WB_RGGBLEVELSUNCORRECTED);
175 TiffEntry *wb_black = mRootIFD->getEntryRecursive(SAMSUNG_WB_RGGBLEVELSBLACK);
176 if (wb_levels->count == 4 && wb_black->count == 4) {
177 mRaw->metadata.wbCoeffs[0] = wb_levels->getFloat(0) - wb_black->getFloat(0);
178 mRaw->metadata.wbCoeffs[1] = wb_levels->getFloat(1) - wb_black->getFloat(1);
179 mRaw->metadata.wbCoeffs[2] = wb_levels->getFloat(3) - wb_black->getFloat(3);
180 }
181 }
182}
183
184} // namespace rawspeed

Callers

nothing calls this directly

Calls 6

getIDMethod · 0.80
hasCameraMethod · 0.80
hasEntryRecursiveMethod · 0.45
getU32Method · 0.45
getEntryRecursiveMethod · 0.45
getFloatMethod · 0.45

Tested by

no test coverage detected