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

Method addCamera

src/librawspeed/metadata/CameraMetaData.cpp:121–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121const Camera* CameraMetaData::addCamera(std::unique_ptr<Camera> cam) {
122 auto id = getId(cam->make, cam->model, cam->mode);
123 if (cameras.end() != cameras.find(id)) {
124 writeLog(
125 DEBUG_PRIO_WARNING,
126 "CameraMetaData: Duplicate entry found for camera: %s %s, Skipping!",
127 cam->make.c_str(), cam->model.c_str());
128 return nullptr;
129 }
130 cameras[id] = std::move(cam);
131
132 if (string::npos != cameras[id]->mode.find("chdk")) {
133 auto filesize_hint = cameras[id]->hints.get("filesize", string());
134 if (filesize_hint.empty()) {
135 writeLog(DEBUG_PRIO_WARNING,
136 "CameraMetaData: CHDK camera: %s %s, no \"filesize\" hint set!",
137 cameras[id]->make.c_str(), cameras[id]->model.c_str());
138 } else {
139 chdkCameras[stoi(filesize_hint)] = cameras[id].get();
140 // writeLog(DEBUG_PRIO_WARNING, "CHDK camera: %s %s size:%u",
141 // cameras[id]->make.c_str(), cameras[id]->model.c_str(), size);
142 }
143 }
144 return cameras[id].get();
145}
146
147void CameraMetaData::disableMake(const string &make) {
148 for (const auto& cam : cameras) {

Callers

nothing calls this directly

Calls 5

getIdFunction · 0.85
writeLogFunction · 0.85
emptyMethod · 0.80
endMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected