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

Method decodeRawInternal

src/librawspeed/decoders/OrfDecoder.cpp:102–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102RawImage OrfDecoder::decodeRawInternal() {
103 const auto* raw = mRootIFD->getIFDWithTag(STRIPOFFSETS);
104
105 int compression = raw->getEntry(COMPRESSION)->getU32();
106 if (1 != compression)
107 ThrowRDE("Unsupported compression");
108
109 uint32_t width = raw->getEntry(IMAGEWIDTH)->getU32();
110 uint32_t height = raw->getEntry(IMAGELENGTH)->getU32();
111
112 if (!width || !height || width % 2 != 0 || width > 10400 || height > 7796)
113 ThrowRDE("Unexpected image dimensions found: (%u; %u)", width, height);
114
115 mRaw->dim = iPoint2D(width, height);
116
117 ByteStream input(handleSlices());
118
119 if (decodeUncompressed(input, width, height, input.getSize()))
120 return mRaw;
121
122 if (raw->getEntry(STRIPOFFSETS)->count != 1)
123 ThrowRDE("%u stripes, and not uncompressed. Unsupported.",
124 raw->getEntry(STRIPOFFSETS)->count);
125
126 OlympusDecompressor o(mRaw);
127 mRaw->createData();
128 o.decompress(std::move(input));
129
130 return mRaw;
131}
132
133bool OrfDecoder::decodeUncompressed(const ByteStream& s, uint32_t w, uint32_t h,
134 uint32_t size) {

Callers

nothing calls this directly

Calls 7

getIFDWithTagMethod · 0.80
createDataMethod · 0.80
iPoint2DClass · 0.70
getU32Method · 0.45
getEntryMethod · 0.45
getSizeMethod · 0.45
decompressMethod · 0.45

Tested by

no test coverage detected