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

Method getSubSampling

src/librawspeed/decoders/Cr2Decoder.cpp:292–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292iPoint2D Cr2Decoder::getSubSampling() const {
293 TiffEntry* CCS = mRootIFD->getEntryRecursive(CANON_CAMERA_SETTINGS);
294 if (!CCS)
295 ThrowRDE("CanonCameraSettings entry not found.");
296
297 if (CCS->type != TIFF_SHORT)
298 ThrowRDE("Unexpected CanonCameraSettings entry type encountered ");
299
300 if (CCS->count < 47)
301 return {1, 1};
302
303 switch (uint16_t qual = CCS->getU16(46)) {
304 case 0:
305 return {1, 1};
306 case 1:
307 return {2, 2};
308 case 2:
309 return {2, 1};
310 default:
311 ThrowRDE("Unexpected SRAWQuality value found: %u", qual);
312 }
313}
314
315int Cr2Decoder::getHue() {
316 if (hints.has("old_sraw_hue"))

Callers

nothing calls this directly

Calls 2

getEntryRecursiveMethod · 0.45
getU16Method · 0.45

Tested by

no test coverage detected