| 395 | } |
| 396 | |
| 397 | string NefDecoder::getMode() { |
| 398 | ostringstream mode; |
| 399 | const auto* raw = getIFDWithLargestImage(CFAPATTERN); |
| 400 | int compression = raw->getEntry(COMPRESSION)->getU32(); |
| 401 | uint32_t bitPerPixel = raw->getEntry(BITSPERSAMPLE)->getU32(); |
| 402 | |
| 403 | if (NEFIsUncompressedRGB(raw)) |
| 404 | mode << "sNEF-uncompressed"; |
| 405 | else { |
| 406 | if (1 == compression || NEFIsUncompressed(raw)) |
| 407 | mode << bitPerPixel << "bit-uncompressed"; |
| 408 | else |
| 409 | mode << bitPerPixel << "bit-compressed"; |
| 410 | } |
| 411 | return mode.str(); |
| 412 | } |
| 413 | |
| 414 | string NefDecoder::getExtendedMode(const string &mode) { |
| 415 | ostringstream extended_mode; |