~ubuntu-branches/ubuntu/saucy/darktable/saucy

« back to all changes in this revision

Viewing changes to src/external/rawspeed/RawSpeed/Camera.cpp

  • Committer: Package Import Robot
  • Author(s): David Bremner
  • Date: 2012-07-27 06:59:38 UTC
  • mfrom: (8.1.6 sid)
  • Revision ID: package-import@ubuntu.com-20120727065938-8691rjluecif4nyy
* New upstream release
  - Update to RawSpeed r438
  - Update to LibRaw 0.14.7
  - White balance presets for Nikon Coolpix P7100 and Panasonic GF3
  - White balance preset updates for Canon EOS 7D, Canon EOS 350D
  - Standard Color Matrices for Canon EOS 650D, Canon EOS 5D Mark III,
    Canon EOS 1D X, Canon PowerShot G1 X, Canon PowerShot SX220, Nikon
    D3200, Nikon D4, Nikon D800, Olympus E-M5, Panasonic GF5, Sony
    SLT-A37/A57, Leica X1/X2, Sony DSC-RX100
* Build with libtiff5 (Closes: #682588).
* Switch to debhelper compat 9, for hardening support

Show diffs side-by-side

added added

removed removed

Lines of Context:
232
232
  return i;
233
233
}
234
234
 
 
235
vector<int> Camera::MultipleStringToInt(const xmlChar *in, const xmlChar *tag, const char* attribute) {
 
236
  int i;
 
237
  vector<int> ret;
 
238
  vector<string> v = split_string(string((const char*)in), ' ');
 
239
 
 
240
  for (uint32 j = 0; j < v.size(); j++) {
 
241
#if defined(__unix__) || defined(__APPLE__) || defined(__MINGW32__)
 
242
    if (EOF == sscanf(v[j].c_str(), "%d", &i))
 
243
#else
 
244
    if (EOF == sscanf_s(v[j].c_str(), "%d", &i))
 
245
#endif
 
246
      ThrowCME("Error parsing attribute %s in tag %s, in camera %s %s.", attribute, tag, make.c_str(), model.c_str());
 
247
    ret.push_back(i);
 
248
  }
 
249
  return ret;
 
250
}
 
251
 
235
252
 
236
253
int Camera::getAttributeAsInt(xmlNodePtr cur , const xmlChar *tag, const char* attribute) {
237
254
  xmlChar *key = xmlGetProp(cur, (const xmlChar *)attribute);
307
324
    max_iso = StringToInt(key, cur->name, "iso_max");
308
325
    xmlFree(key);
309
326
  }
310
 
  sensorInfo.push_back(CameraSensorInfo(black, white, min_iso, max_iso));
 
327
  key = xmlGetProp(cur, (const xmlChar *)"iso_list");
 
328
  if (key) {
 
329
    vector<int> values = MultipleStringToInt(key, cur->name, "iso_list");
 
330
    xmlFree(key);
 
331
    if (!values.empty()) {
 
332
      for (uint32 i = 0; i < values.size(); i++) {
 
333
        sensorInfo.push_back(CameraSensorInfo(black, white, values[i], values[i]));
 
334
      }      
 
335
    }
 
336
  } else {
 
337
    sensorInfo.push_back(CameraSensorInfo(black, white, min_iso, max_iso));
 
338
  }
 
339
 
311
340
}
312
341
 
313
342
const CameraSensorInfo* Camera::getSensorInfo( int iso )