| 131 | } |
| 132 | |
| 133 | bool 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 | |
| 175 | void OrfDecoder::parseCFA() { |
| 176 | if (!mRootIFD->hasEntryRecursive(EXIFCFAPATTERN)) |
nothing calls this directly
no test coverage detected