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

Method decodeUncompressed

src/librawspeed/decoders/OrfDecoder.cpp:133–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133bool OrfDecoder::decodeUncompressed(const ByteStream& s, uint32_t w, uint32_t h,
134 uint32_t size) {
135 UncompressedDecompressor u(s, mRaw);
136 // FIXME: most of this logic should be in UncompressedDecompressor,
137 // one way or another.
138
139 if (size == h * ((w * 12 / 8) + ((w + 2) / 10))) {
140 // 12-bit packed 'with control' raw
141 mRaw->createData();
142 u.decode12BitRaw<Endianness::little, false, true>(w, h);
143 return true;
144 }
145
146 if (size == w * h * 12 / 8) { // We're in a 12-bit packed raw
147 iPoint2D dimensions(w, h);
148 iPoint2D pos(0, 0);
149 mRaw->createData();
150 u.readUncompressedRaw(dimensions, pos, w * 12 / 8, 12, BitOrder_MSB32);
151 return true;
152 }
153
154 if (size == w * h * 2) { // We're in an unpacked raw
155 mRaw->createData();
156 // FIXME: seems fishy
157 if (s.getByteOrder() == getHostEndianness())
158 u.decodeRawUnpacked<12, Endianness::little>(w, h);
159 else
160 u.decode12BitRawUnpackedLeftAligned<Endianness::big>(w, h);
161 return true;
162 }
163
164 if (size >
165 w * h * 3 / 2) { // We're in one of those weird interlaced packed raws
166 mRaw->createData();
167 u.decode12BitRaw<Endianness::big, true>(w, h);
168 return true;
169 }
170
171 // Does not appear to be uncomporessed. Maybe it's compressed?
172 return false;
173}
174
175void OrfDecoder::parseCFA() {
176 if (!mRootIFD->hasEntryRecursive(EXIFCFAPATTERN))

Callers

nothing calls this directly

Calls 4

getHostEndiannessFunction · 0.85
createDataMethod · 0.80
readUncompressedRawMethod · 0.80
getByteOrderMethod · 0.80

Tested by

no test coverage detected