| 121 | } |
| 122 | |
| 123 | std::unique_ptr<RawDecoder> FiffParser::getDecoder(const CameraMetaData* meta) { |
| 124 | if (!rootIFD) |
| 125 | parseData(); |
| 126 | |
| 127 | // WARNING: do *NOT* fallback to ordinary TIFF parser here! |
| 128 | // All the FIFF raws are '.RAF' (Fujifilm). Do use RafDecoder directly. |
| 129 | |
| 130 | try { |
| 131 | if (!RafDecoder::isAppropriateDecoder(rootIFD.get(), mInput)) |
| 132 | ThrowFPE("Not a FUJIFILM RAF FIFF."); |
| 133 | |
| 134 | return std::make_unique<RafDecoder>(std::move(rootIFD), mInput); |
| 135 | } catch (TiffParserException&) { |
| 136 | ThrowFPE("No decoder found. Sorry."); |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | } // namespace rawspeed |