| 257 | } |
| 258 | |
| 259 | void 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 | |
| 286 | void Camera::parseCameraChild(const xml_node &cur) { |
| 287 | if (name(cur) == "CFA" || name(cur) == "CFA2") { |
nothing calls this directly
no test coverage detected