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

Method parseSensor

src/librawspeed/metadata/Camera.cpp:259–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257}
258
259void Camera::parseSensor(const xml_node &cur) {
260 if (name(cur) != "Sensor")
261 ThrowCME("Not an Sensor node!");
262
263 auto stringToListOfInts = [&cur](const char* attribute) {
264 vector<int> ret;
265 for (const string& s : splitString(cur.attribute(attribute).as_string()))
266 ret.push_back(stoi(s));
267 return ret;
268 };
269
270 int min_iso = cur.attribute("iso_min").as_int(0);
271 int max_iso = cur.attribute("iso_max").as_int(0);
272 int black = cur.attribute("black").as_int(-1);
273 int white = cur.attribute("white").as_int(65536);
274
275 vector<int> black_colors = stringToListOfInts("black_colors");
276 vector<int> iso_list = stringToListOfInts("iso_list");
277 if (!iso_list.empty()) {
278 for (int iso : iso_list) {
279 sensorInfo.emplace_back(black, white, iso, iso, black_colors);
280 }
281 } else {
282 sensorInfo.emplace_back(black, white, min_iso, max_iso, black_colors);
283 }
284}
285
286void Camera::parseCameraChild(const xml_node &cur) {
287 if (name(cur) == "CFA" || name(cur) == "CFA2") {

Callers

nothing calls this directly

Calls 3

nameFunction · 0.85
splitStringFunction · 0.85
emptyMethod · 0.80

Tested by

no test coverage detected