@@ -48,6 +48,7 @@
Loading
48 48
  int getDecoderVersion() const override { return 3; }
49 49
50 50
private:
51 +
  void parseCFA();
51 52
  std::string guessMode();
52 53
};
53 54

@@ -161,8 +161,36 @@
Loading
161 161
    checkCameraSupported(meta, id, "");
162 162
}
163 163
164 +
void Rw2Decoder::parseCFA() {
165 +
  if (!mRootIFD->hasEntryRecursive(PANASONIC_CFAPATTERN))
166 +
    ThrowRDE("No PANASONIC_CFAPATTERN entry found!");
167 +
168 +
  TiffEntry* CFA = mRootIFD->getEntryRecursive(PANASONIC_CFAPATTERN);
169 +
  if (CFA->type != TiffDataType::TIFF_SHORT || CFA->count != 1) {
170 +
    ThrowRDE("Bad PANASONIC_CFAPATTERN entry (type %u, count %u).", CFA->type,
171 +
             CFA->count);
172 +
  }
173 +
174 +
  switch (auto i = CFA->getU16()) {
175 +
  case 1:
176 +
    mRaw->cfa.setCFA(iPoint2D(2, 2), CFA_RED, CFA_GREEN, CFA_GREEN, CFA_BLUE);
177 +
    break;
178 +
  case 2:
179 +
    mRaw->cfa.setCFA(iPoint2D(2, 2), CFA_GREEN, CFA_RED, CFA_BLUE, CFA_GREEN);
180 +
    break;
181 +
  case 3:
182 +
    mRaw->cfa.setCFA(iPoint2D(2, 2), CFA_GREEN, CFA_BLUE, CFA_RED, CFA_GREEN);
183 +
    break;
184 +
  case 4:
185 +
    mRaw->cfa.setCFA(iPoint2D(2, 2), CFA_BLUE, CFA_GREEN, CFA_GREEN, CFA_RED);
186 +
    break;
187 +
  default:
188 +
    ThrowRDE("Unexpected CFA pattern: %u", i);
189 +
  }
190 +
}
191 +
164 192
void Rw2Decoder::decodeMetaDataInternal(const CameraMetaData* meta) {
165 -
  mRaw->cfa.setCFA(iPoint2D(2,2), CFA_BLUE, CFA_GREEN, CFA_GREEN, CFA_RED);
193 +
  parseCFA();
166 194
167 195
  auto id = mRootIFD->getID();
168 196
  string mode = guessMode();
Files Coverage
fuzz 1.92%
src 56.39%
test/librawspeed 97.18%
Project Totals (235 files) 60.43%
linux.GNU.Coverage.Unittests
Build #493821882 -
CXX=GNU
ARCH=x86_64
OS=linux
unittests
macos-latest.XCode.Coverage.Unittests
Build #493821882 -
CXX=AppleXcode
ARCH=x86_64
OS=macOS
unittests
windows-latest.MINGW64.GNU.Coverage.Unittests
Build #493821882 -
CXX=GNU
ARCH=x86_64
OS=windows
unittests
linux.GNU.Coverage.Integration
Build #493821882 -
CXX=GNU
ARCH=x86_64
OS=linux
integration rpu_u
windows-latest.MINGW32.GNU.Coverage.Unittests
Build #493821882 -
CXX=GNU
ARCH=i686
OS=windows
unittests
1
codecov:
2
  notify:
3
    require_ci_to_pass: true
4
coverage:
5
  precision: 2
6
  range: "0...100"
7
  round: down
8
  status:
9
    changes: false
10
    patch: false
11
    project: false
12
  ignore:
13
    - test/.*
14
  notify:
15
    irc:
16
      default:
17
        server: "chat.freenode.net"
18
        channel: "#rawspeed"
19
parsers:
20
  gcov:
21
    branch_detection:
22
      conditional: true
23
      loop: true
24
      macro: false
25
      method: false
26
comment:
27
  behavior: default
28
  layout: header, diff
29
  require_changes: false
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading