Formatted lensprofile.*
This commit is contained in:
@@ -31,7 +31,7 @@ using namespace rtengine::procparams;
|
|||||||
|
|
||||||
LensProfilePanel::LFDbHelper *LensProfilePanel::lf(nullptr);
|
LensProfilePanel::LFDbHelper *LensProfilePanel::lf(nullptr);
|
||||||
|
|
||||||
LensProfilePanel::LensProfilePanel () :
|
LensProfilePanel::LensProfilePanel() :
|
||||||
FoldableToolPanel(this, "lensprof", M("TP_LENSPROFILE_LABEL")),
|
FoldableToolPanel(this, "lensprof", M("TP_LENSPROFILE_LABEL")),
|
||||||
lcModeChanged(false),
|
lcModeChanged(false),
|
||||||
lcpFileChanged(false),
|
lcpFileChanged(false),
|
||||||
@@ -119,23 +119,24 @@ LensProfilePanel::LensProfilePanel () :
|
|||||||
} else if (!options.lastLensProfileDir.empty()) {
|
} else if (!options.lastLensProfileDir.empty()) {
|
||||||
fcbLCPFile->set_current_folder(options.lastLensProfileDir);
|
fcbLCPFile->set_current_folder(options.lastLensProfileDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
bindCurrentFolder(*fcbLCPFile, options.lastLensProfileDir);
|
bindCurrentFolder(*fcbLCPFile, options.lastLensProfileDir);
|
||||||
|
|
||||||
hbLCPFile->pack_start(*fcbLCPFile);
|
hbLCPFile->pack_start(*fcbLCPFile);
|
||||||
|
|
||||||
pack_start(*hbLCPFile, Gtk::PACK_SHRINK, 4);
|
pack_start(*hbLCPFile, Gtk::PACK_SHRINK, 4);
|
||||||
|
|
||||||
ckbUseDist = Gtk::manage (new Gtk::CheckButton (M("TP_LENSPROFILE_USEDIST")));
|
ckbUseDist = Gtk::manage(new Gtk::CheckButton(M("TP_LENSPROFILE_USEDIST")));
|
||||||
pack_start (*ckbUseDist, Gtk::PACK_SHRINK, 4);
|
pack_start(*ckbUseDist, Gtk::PACK_SHRINK, 4);
|
||||||
ckbUseVign = Gtk::manage (new Gtk::CheckButton (M("TP_LENSPROFILE_USEVIGN")));
|
ckbUseVign = Gtk::manage(new Gtk::CheckButton(M("TP_LENSPROFILE_USEVIGN")));
|
||||||
pack_start (*ckbUseVign, Gtk::PACK_SHRINK, 4);
|
pack_start(*ckbUseVign, Gtk::PACK_SHRINK, 4);
|
||||||
ckbUseCA = Gtk::manage (new Gtk::CheckButton (M("TP_LENSPROFILE_USECA")));
|
ckbUseCA = Gtk::manage(new Gtk::CheckButton(M("TP_LENSPROFILE_USECA")));
|
||||||
pack_start (*ckbUseCA, Gtk::PACK_SHRINK, 4);
|
pack_start(*ckbUseCA, Gtk::PACK_SHRINK, 4);
|
||||||
|
|
||||||
conLCPFile = fcbLCPFile->signal_file_set().connect( sigc::mem_fun(*this, &LensProfilePanel::onLCPFileChanged)); //, true);
|
conLCPFile = fcbLCPFile->signal_file_set().connect(sigc::mem_fun(*this, &LensProfilePanel::onLCPFileChanged)); //, true);
|
||||||
conUseDist = ckbUseDist->signal_toggled().connect( sigc::mem_fun(*this, &LensProfilePanel::onUseDistChanged) );
|
conUseDist = ckbUseDist->signal_toggled().connect(sigc::mem_fun(*this, &LensProfilePanel::onUseDistChanged));
|
||||||
ckbUseVign->signal_toggled().connect( sigc::mem_fun(*this, &LensProfilePanel::onUseVignChanged) );
|
ckbUseVign->signal_toggled().connect(sigc::mem_fun(*this, &LensProfilePanel::onUseVignChanged));
|
||||||
ckbUseCA->signal_toggled().connect( sigc::mem_fun(*this, &LensProfilePanel::onUseCAChanged) );
|
ckbUseCA->signal_toggled().connect(sigc::mem_fun(*this, &LensProfilePanel::onUseCAChanged));
|
||||||
|
|
||||||
lensfunCameras->signal_changed().connect(sigc::mem_fun(*this, &LensProfilePanel::onLensfunCameraChanged));
|
lensfunCameras->signal_changed().connect(sigc::mem_fun(*this, &LensProfilePanel::onLensfunCameraChanged));
|
||||||
lensfunLenses->signal_changed().connect(sigc::mem_fun(*this, &LensProfilePanel::onLensfunLensChanged));
|
lensfunLenses->signal_changed().connect(sigc::mem_fun(*this, &LensProfilePanel::onLensfunLensChanged));
|
||||||
@@ -151,7 +152,7 @@ LensProfilePanel::LensProfilePanel () :
|
|||||||
|
|
||||||
void LensProfilePanel::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited)
|
void LensProfilePanel::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited)
|
||||||
{
|
{
|
||||||
disableListener ();
|
disableListener();
|
||||||
conUseDist.block(true);
|
conUseDist.block(true);
|
||||||
|
|
||||||
if (!batchMode) {
|
if (!batchMode) {
|
||||||
@@ -160,16 +161,19 @@ void LensProfilePanel::read(const rtengine::procparams::ProcParams* pp, const Pa
|
|||||||
|
|
||||||
corrLensfunAuto->set_sensitive(true);
|
corrLensfunAuto->set_sensitive(true);
|
||||||
|
|
||||||
switch(pp->lensProf.lcMode) {
|
switch (pp->lensProf.lcMode) {
|
||||||
case procparams::LensProfParams::LcMode::LCP :
|
case procparams::LensProfParams::LcMode::LCP :
|
||||||
corrLcpFile->set_active(true);
|
corrLcpFile->set_active(true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case procparams::LensProfParams::LcMode::LENSFUNAUTOMATCH :
|
case procparams::LensProfParams::LcMode::LENSFUNAUTOMATCH :
|
||||||
corrLensfunAuto->set_active(true);
|
corrLensfunAuto->set_active(true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case procparams::LensProfParams::LcMode::LENSFUNMANUAL :
|
case procparams::LensProfParams::LcMode::LENSFUNMANUAL :
|
||||||
corrLensfunManual->set_active(true);
|
corrLensfunManual->set_active(true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case procparams::LensProfParams::LcMode::NONE :
|
case procparams::LensProfParams::LcMode::NONE :
|
||||||
corrOff->set_active(true);
|
corrOff->set_active(true);
|
||||||
}
|
}
|
||||||
@@ -181,8 +185,9 @@ void LensProfilePanel::read(const rtengine::procparams::ProcParams* pp, const Pa
|
|||||||
bindCurrentFolder(*fcbLCPFile, options.lastLensProfileDir);
|
bindCurrentFolder(*fcbLCPFile, options.lastLensProfileDir);
|
||||||
updateDisabled(false);
|
updateDisabled(false);
|
||||||
} else if (LCPStore::getInstance()->isValidLCPFileName(pp->lensProf.lcpFile)) {
|
} else if (LCPStore::getInstance()->isValidLCPFileName(pp->lensProf.lcpFile)) {
|
||||||
fcbLCPFile->set_filename (pp->lensProf.lcpFile);
|
fcbLCPFile->set_filename(pp->lensProf.lcpFile);
|
||||||
if(corrLcpFile->get_active()) {
|
|
||||||
|
if (corrLcpFile->get_active()) {
|
||||||
updateDisabled(true);
|
updateDisabled(true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -199,6 +204,7 @@ void LensProfilePanel::read(const rtengine::procparams::ProcParams* pp, const Pa
|
|||||||
setLensfunCamera(c.getMake(), c.getModel());
|
setLensfunCamera(c.getMake(), c.getModel());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!setLensfunLens(pp->lensProf.lfLens) && !pp->lensProf.lfManual()) {
|
if (!setLensfunLens(pp->lensProf.lfLens) && !pp->lensProf.lfManual()) {
|
||||||
if (metadata) {
|
if (metadata) {
|
||||||
LFLens l = db->findLens(c, metadata->getLens());
|
LFLens l = db->findLens(c, metadata->getLens());
|
||||||
@@ -213,6 +219,7 @@ void LensProfilePanel::read(const rtengine::procparams::ProcParams* pp, const Pa
|
|||||||
if (corrLensfunAuto->get_active()) {
|
if (corrLensfunAuto->get_active()) {
|
||||||
corrOff->set_active(true);
|
corrOff->set_active(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
corrLensfunAuto->set_sensitive(false);
|
corrLensfunAuto->set_sensitive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,11 +229,11 @@ void LensProfilePanel::read(const rtengine::procparams::ProcParams* pp, const Pa
|
|||||||
|
|
||||||
updateLensfunWarning();
|
updateLensfunWarning();
|
||||||
|
|
||||||
ckbUseDist->set_active (pp->lensProf.useDist);
|
ckbUseDist->set_active(pp->lensProf.useDist);
|
||||||
ckbUseVign->set_active (pp->lensProf.useVign && isRaw);
|
ckbUseVign->set_active(pp->lensProf.useVign && isRaw);
|
||||||
ckbUseCA->set_active(pp->lensProf.useCA && isRaw && ckbUseCA->get_sensitive());
|
ckbUseCA->set_active(pp->lensProf.useCA && isRaw && ckbUseCA->get_sensitive());
|
||||||
|
|
||||||
enableListener ();
|
enableListener();
|
||||||
conUseDist.block(false);
|
conUseDist.block(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,33 +241,43 @@ void LensProfilePanel::read(const rtengine::procparams::ProcParams* pp, const Pa
|
|||||||
void LensProfilePanel::updateLensfunWarning()
|
void LensProfilePanel::updateLensfunWarning()
|
||||||
{
|
{
|
||||||
warning->hide();
|
warning->hide();
|
||||||
|
|
||||||
if (corrLensfunManual->get_active() || corrLensfunAuto->get_active()) {
|
if (corrLensfunManual->get_active() || corrLensfunAuto->get_active()) {
|
||||||
const LFDatabase *db = LFDatabase::getInstance();
|
const LFDatabase *db = LFDatabase::getInstance();
|
||||||
|
|
||||||
auto itc = lensfunCameras->get_active();
|
auto itc = lensfunCameras->get_active();
|
||||||
|
|
||||||
if (!itc) {
|
if (!itc) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LFCamera c = db->findCamera((*itc)[lf->lensfunModelCam.make], (*itc)[lf->lensfunModelCam.model]);
|
LFCamera c = db->findCamera((*itc)[lf->lensfunModelCam.make], (*itc)[lf->lensfunModelCam.model]);
|
||||||
auto itl = lensfunLenses->get_active();
|
auto itl = lensfunLenses->get_active();
|
||||||
|
|
||||||
if (!itl) {
|
if (!itl) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LFLens l = db->findLens(LFCamera(), (*itl)[lf->lensfunModelLens.lens]);
|
LFLens l = db->findLens(LFCamera(), (*itl)[lf->lensfunModelLens.lens]);
|
||||||
float lenscrop = l.getCropFactor();
|
float lenscrop = l.getCropFactor();
|
||||||
float camcrop = c.getCropFactor();
|
float camcrop = c.getCropFactor();
|
||||||
|
|
||||||
if (lenscrop <= 0 || camcrop <= 0 || lenscrop / camcrop >= 1.01f) {
|
if (lenscrop <= 0 || camcrop <= 0 || lenscrop / camcrop >= 1.01f) {
|
||||||
warning->show();
|
warning->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
ckbUseVign->set_sensitive(l.hasVignettingCorrection());
|
ckbUseVign->set_sensitive(l.hasVignettingCorrection());
|
||||||
ckbUseDist->set_sensitive(l.hasDistortionCorrection());
|
ckbUseDist->set_sensitive(l.hasDistortionCorrection());
|
||||||
ckbUseCA->set_sensitive(l.hasCACorrection());
|
ckbUseCA->set_sensitive(l.hasCACorrection());
|
||||||
|
|
||||||
if (!isRaw || !l.hasVignettingCorrection()) {
|
if (!isRaw || !l.hasVignettingCorrection()) {
|
||||||
ckbUseVign->set_active(false);
|
ckbUseVign->set_active(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!l.hasDistortionCorrection()) {
|
if (!l.hasDistortionCorrection()) {
|
||||||
ckbUseDist->set_active(false);
|
ckbUseDist->set_active(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!l.hasCACorrection()) {
|
if (!l.hasCACorrection()) {
|
||||||
ckbUseCA->set_active(false);
|
ckbUseCA->set_active(false);
|
||||||
}
|
}
|
||||||
@@ -284,15 +301,15 @@ void LensProfilePanel::setRawMeta(bool raw, const rtengine::FramesMetaData* pMet
|
|||||||
metadata = pMeta;
|
metadata = pMeta;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LensProfilePanel::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedited)
|
void LensProfilePanel::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited)
|
||||||
{
|
{
|
||||||
if (corrLcpFile->get_active()) {
|
if (corrLcpFile->get_active()) {
|
||||||
pp->lensProf.lcMode = procparams::LensProfParams::LcMode::LCP;
|
pp->lensProf.lcMode = procparams::LensProfParams::LcMode::LCP;
|
||||||
} else if(corrLensfunManual->get_active()) {
|
} else if (corrLensfunManual->get_active()) {
|
||||||
pp->lensProf.lcMode = procparams::LensProfParams::LcMode::LENSFUNMANUAL;
|
pp->lensProf.lcMode = procparams::LensProfParams::LcMode::LENSFUNMANUAL;
|
||||||
} else if(corrLensfunAuto->get_active()) {
|
} else if (corrLensfunAuto->get_active()) {
|
||||||
pp->lensProf.lcMode = procparams::LensProfParams::LcMode::LENSFUNAUTOMATCH;
|
pp->lensProf.lcMode = procparams::LensProfParams::LcMode::LENSFUNAUTOMATCH;
|
||||||
} else if(corrOff->get_active()) {
|
} else if (corrOff->get_active()) {
|
||||||
pp->lensProf.lcMode = procparams::LensProfParams::LcMode::NONE;
|
pp->lensProf.lcMode = procparams::LensProfParams::LcMode::NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,6 +324,7 @@ void LensProfilePanel::write( rtengine::procparams::ProcParams* pp, ParamsEdited
|
|||||||
pp->lensProf.useCA = ckbUseCA->get_active();
|
pp->lensProf.useCA = ckbUseCA->get_active();
|
||||||
|
|
||||||
auto itc = lensfunCameras->get_active();
|
auto itc = lensfunCameras->get_active();
|
||||||
|
|
||||||
if (itc) {
|
if (itc) {
|
||||||
pp->lensProf.lfCameraMake = (*itc)[lf->lensfunModelCam.make];
|
pp->lensProf.lfCameraMake = (*itc)[lf->lensfunModelCam.make];
|
||||||
pp->lensProf.lfCameraModel = (*itc)[lf->lensfunModelCam.model];
|
pp->lensProf.lfCameraModel = (*itc)[lf->lensfunModelCam.model];
|
||||||
@@ -314,7 +332,9 @@ void LensProfilePanel::write( rtengine::procparams::ProcParams* pp, ParamsEdited
|
|||||||
pp->lensProf.lfCameraMake = "";
|
pp->lensProf.lfCameraMake = "";
|
||||||
pp->lensProf.lfCameraModel = "";
|
pp->lensProf.lfCameraModel = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
auto itl = lensfunLenses->get_active();
|
auto itl = lensfunLenses->get_active();
|
||||||
|
|
||||||
if (itl) {
|
if (itl) {
|
||||||
pp->lensProf.lfLens = (*itl)[lf->lensfunModelLens.lens];
|
pp->lensProf.lfLens = (*itl)[lf->lensfunModelLens.lens];
|
||||||
} else {
|
} else {
|
||||||
@@ -347,7 +367,8 @@ void LensProfilePanel::onLCPFileChanged()
|
|||||||
corrLcpFile->set_active(true);
|
corrLcpFile->set_active(true);
|
||||||
enableListener();
|
enableListener();
|
||||||
}
|
}
|
||||||
listener->panelChanged (EvLCPFile, Glib::path_get_basename(fcbLCPFile->get_filename()));
|
|
||||||
|
listener->panelChanged(EvLCPFile, Glib::path_get_basename(fcbLCPFile->get_filename()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -356,7 +377,7 @@ void LensProfilePanel::onUseDistChanged()
|
|||||||
useDistChanged = true;
|
useDistChanged = true;
|
||||||
|
|
||||||
if (listener) {
|
if (listener) {
|
||||||
listener->panelChanged (EvLCPUseDist, ckbUseDist->get_active() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"));
|
listener->panelChanged(EvLCPUseDist, ckbUseDist->get_active() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void LensProfilePanel::onUseVignChanged()
|
void LensProfilePanel::onUseVignChanged()
|
||||||
@@ -364,7 +385,7 @@ void LensProfilePanel::onUseVignChanged()
|
|||||||
useVignChanged = true;
|
useVignChanged = true;
|
||||||
|
|
||||||
if (listener) {
|
if (listener) {
|
||||||
listener->panelChanged (EvLCPUseVign, ckbUseVign->get_active() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"));
|
listener->panelChanged(EvLCPUseVign, ckbUseVign->get_active() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void LensProfilePanel::onUseCAChanged()
|
void LensProfilePanel::onUseCAChanged()
|
||||||
@@ -372,7 +393,7 @@ void LensProfilePanel::onUseCAChanged()
|
|||||||
useCAChanged = true;
|
useCAChanged = true;
|
||||||
|
|
||||||
if (listener) {
|
if (listener) {
|
||||||
listener->panelChanged (EvLCPUseCA, ckbUseCA->get_active() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"));
|
listener->panelChanged(EvLCPUseCA, ckbUseCA->get_active() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -386,6 +407,7 @@ void LensProfilePanel::updateDisabled(bool enable)
|
|||||||
void LensProfilePanel::setBatchMode(bool yes)
|
void LensProfilePanel::setBatchMode(bool yes)
|
||||||
{
|
{
|
||||||
FoldableToolPanel::setBatchMode(yes);
|
FoldableToolPanel::setBatchMode(yes);
|
||||||
|
|
||||||
if (yes) {
|
if (yes) {
|
||||||
corrUnchanged->show();
|
corrUnchanged->show();
|
||||||
corrUnchanged->set_active(true);
|
corrUnchanged->set_active(true);
|
||||||
@@ -399,6 +421,7 @@ bool LensProfilePanel::setLensfunCamera(const Glib::ustring &make, const Glib::u
|
|||||||
{
|
{
|
||||||
if (!make.empty() && !model.empty()) {
|
if (!make.empty() && !model.empty()) {
|
||||||
auto it = lensfunCameras->get_active();
|
auto it = lensfunCameras->get_active();
|
||||||
|
|
||||||
if (it && (*it)[lf->lensfunModelCam.make] == make && (*it)[lf->lensfunModelCam.model] == model) {
|
if (it && (*it)[lf->lensfunModelCam.make] == make && (*it)[lf->lensfunModelCam.model] == model) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -407,17 +430,21 @@ bool LensProfilePanel::setLensfunCamera(const Glib::ustring &make, const Glib::u
|
|||||||
for (auto row : lf->lensfunCameraModel->children()) {
|
for (auto row : lf->lensfunCameraModel->children()) {
|
||||||
if (row[lf->lensfunModelCam.make] == make) {
|
if (row[lf->lensfunModelCam.make] == make) {
|
||||||
auto &c = row.children();
|
auto &c = row.children();
|
||||||
|
|
||||||
for (auto it = c.begin(), end = c.end(); it != end; ++it) {
|
for (auto it = c.begin(), end = c.end(); it != end; ++it) {
|
||||||
auto &childrow = *it;
|
auto &childrow = *it;
|
||||||
|
|
||||||
if (childrow[lf->lensfunModelCam.model] == model) {
|
if (childrow[lf->lensfunModelCam.model] == model) {
|
||||||
lensfunCameras->set_active(it);
|
lensfunCameras->set_active(it);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lensfunCameras->set_active(-1);
|
lensfunCameras->set_active(-1);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -427,21 +454,26 @@ bool LensProfilePanel::setLensfunLens(const Glib::ustring &lens)
|
|||||||
{
|
{
|
||||||
if (!lens.empty()) {
|
if (!lens.empty()) {
|
||||||
auto it = lensfunLenses->get_active();
|
auto it = lensfunLenses->get_active();
|
||||||
|
|
||||||
if (it && (*it)[lf->lensfunModelLens.lens] == lens) {
|
if (it && (*it)[lf->lensfunModelLens.lens] == lens) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool first_maker_found = false;
|
bool first_maker_found = false;
|
||||||
|
|
||||||
for (auto row : lf->lensfunLensModel->children()) {
|
for (auto row : lf->lensfunLensModel->children()) {
|
||||||
if (lens.find(row[lf->lensfunModelLens.lens]) == 0) {
|
if (lens.find(row[lf->lensfunModelLens.lens]) == 0) {
|
||||||
auto &c = row.children();
|
auto &c = row.children();
|
||||||
|
|
||||||
for (auto it = c.begin(), end = c.end(); it != end; ++it) {
|
for (auto it = c.begin(), end = c.end(); it != end; ++it) {
|
||||||
auto &childrow = *it;
|
auto &childrow = *it;
|
||||||
|
|
||||||
if (childrow[lf->lensfunModelLens.lens] == lens) {
|
if (childrow[lf->lensfunModelLens.lens] == lens) {
|
||||||
lensfunLenses->set_active(it);
|
lensfunLenses->set_active(it);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// we do not break immediately here, because there might be multiple makers
|
// we do not break immediately here, because there might be multiple makers
|
||||||
// sharing the same prefix (e.g. "Leica" and "Leica Camera AG").
|
// sharing the same prefix (e.g. "Leica" and "Leica Camera AG").
|
||||||
// therefore, we break below when the lens doesn't match any of them
|
// therefore, we break below when the lens doesn't match any of them
|
||||||
@@ -451,6 +483,7 @@ bool LensProfilePanel::setLensfunLens(const Glib::ustring &lens)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lensfunLenses->set_active(-1);
|
lensfunLenses->set_active(-1);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -533,6 +566,7 @@ void LensProfilePanel::onCorrModeChanged(const Gtk::RadioButton *rbChanged)
|
|||||||
LFLens l = db->findLens(c, metadata->getLens());
|
LFLens l = db->findLens(c, metadata->getLens());
|
||||||
setLensfunCamera(c.getMake(), c.getModel());
|
setLensfunCamera(c.getMake(), c.getModel());
|
||||||
setLensfunLens(l.getLens());
|
setLensfunLens(l.getLens());
|
||||||
|
|
||||||
if (b) {
|
if (b) {
|
||||||
enableListener();
|
enableListener();
|
||||||
}
|
}
|
||||||
@@ -590,6 +624,7 @@ bool LensProfilePanel::checkLensfunCanCorrect(bool automatch)
|
|||||||
if (!metadata) {
|
if (!metadata) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
rtengine::procparams::ProcParams lpp;
|
rtengine::procparams::ProcParams lpp;
|
||||||
write(&lpp);
|
write(&lpp);
|
||||||
std::unique_ptr<LFModifier> mod(LFDatabase::findModifier(lpp.lensProf, metadata, 100, 100, lpp.coarse, -1));
|
std::unique_ptr<LFModifier> mod(LFDatabase::findModifier(lpp.lensProf, metadata, 100, 100, lpp.coarse, -1));
|
||||||
@@ -604,24 +639,24 @@ bool LensProfilePanel::checkLensfunCanCorrect(bool automatch)
|
|||||||
LensProfilePanel::LFDbHelper::LFDbHelper()
|
LensProfilePanel::LFDbHelper::LFDbHelper()
|
||||||
{
|
{
|
||||||
#ifdef _OPENMP
|
#ifdef _OPENMP
|
||||||
#pragma omp parallel sections if (!options.rtSettings.verbose)
|
#pragma omp parallel sections if (!options.rtSettings.verbose)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef _OPENMP
|
#ifdef _OPENMP
|
||||||
#pragma omp section
|
#pragma omp section
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
lensfunCameraModel = Gtk::TreeStore::create(lensfunModelCam);
|
lensfunCameraModel = Gtk::TreeStore::create(lensfunModelCam);
|
||||||
fillLensfunCameras();
|
fillLensfunCameras();
|
||||||
}
|
}
|
||||||
#ifdef _OPENMP
|
#ifdef _OPENMP
|
||||||
#pragma omp section
|
#pragma omp section
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
lensfunLensModel = Gtk::TreeStore::create(lensfunModelLens);
|
lensfunLensModel = Gtk::TreeStore::create(lensfunModelLens);
|
||||||
fillLensfunLenses();
|
fillLensfunLenses();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LensProfilePanel::LFDbHelper::fillLensfunCameras()
|
void LensProfilePanel::LFDbHelper::fillLensfunCameras()
|
||||||
@@ -629,8 +664,10 @@ void LensProfilePanel::LFDbHelper::fillLensfunCameras()
|
|||||||
if (options.rtSettings.verbose) {
|
if (options.rtSettings.verbose) {
|
||||||
std::cout << "LENSFUN, scanning cameras:" << std::endl;
|
std::cout << "LENSFUN, scanning cameras:" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<Glib::ustring, std::set<Glib::ustring>> camnames;
|
std::map<Glib::ustring, std::set<Glib::ustring>> camnames;
|
||||||
auto camlist = LFDatabase::getInstance()->getCameras();
|
auto camlist = LFDatabase::getInstance()->getCameras();
|
||||||
|
|
||||||
for (auto &c : camlist) {
|
for (auto &c : camlist) {
|
||||||
camnames[c.getMake()].insert(c.getModel());
|
camnames[c.getMake()].insert(c.getModel());
|
||||||
|
|
||||||
@@ -638,10 +675,12 @@ void LensProfilePanel::LFDbHelper::fillLensfunCameras()
|
|||||||
std::cout << " found: " << c.getDisplayString().c_str() << std::endl;
|
std::cout << " found: " << c.getDisplayString().c_str() << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto &p : camnames) {
|
for (auto &p : camnames) {
|
||||||
Gtk::TreeModel::Row row = *(lensfunCameraModel->append());
|
Gtk::TreeModel::Row row = *(lensfunCameraModel->append());
|
||||||
row[lensfunModelCam.make] = p.first;
|
row[lensfunModelCam.make] = p.first;
|
||||||
row[lensfunModelCam.model] = p.first;
|
row[lensfunModelCam.model] = p.first;
|
||||||
|
|
||||||
for (auto &c : p.second) {
|
for (auto &c : p.second) {
|
||||||
Gtk::TreeModel::Row child = *(lensfunCameraModel->append(row.children()));
|
Gtk::TreeModel::Row child = *(lensfunCameraModel->append(row.children()));
|
||||||
child[lensfunModelCam.make] = p.first;
|
child[lensfunModelCam.make] = p.first;
|
||||||
@@ -656,8 +695,10 @@ void LensProfilePanel::LFDbHelper::fillLensfunLenses()
|
|||||||
if (options.rtSettings.verbose) {
|
if (options.rtSettings.verbose) {
|
||||||
std::cout << "LENSFUN, scanning lenses:" << std::endl;
|
std::cout << "LENSFUN, scanning lenses:" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<Glib::ustring, std::set<Glib::ustring>> lenses;
|
std::map<Glib::ustring, std::set<Glib::ustring>> lenses;
|
||||||
auto lenslist = LFDatabase::getInstance()->getLenses();
|
auto lenslist = LFDatabase::getInstance()->getLenses();
|
||||||
|
|
||||||
for (auto &l : lenslist) {
|
for (auto &l : lenslist) {
|
||||||
auto name = l.getLens();
|
auto name = l.getLens();
|
||||||
auto make = l.getMake();
|
auto make = l.getMake();
|
||||||
@@ -667,15 +708,18 @@ void LensProfilePanel::LFDbHelper::fillLensfunLenses()
|
|||||||
std::cout << " found: " << l.getDisplayString().c_str() << std::endl;
|
std::cout << " found: " << l.getDisplayString().c_str() << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto &p : lenses) {
|
for (auto &p : lenses) {
|
||||||
Gtk::TreeModel::Row row = *(lensfunLensModel->append());
|
Gtk::TreeModel::Row row = *(lensfunLensModel->append());
|
||||||
row[lensfunModelLens.lens] = p.first;
|
row[lensfunModelLens.lens] = p.first;
|
||||||
row[lensfunModelLens.prettylens] = p.first;
|
row[lensfunModelLens.prettylens] = p.first;
|
||||||
|
|
||||||
for (auto &c : p.second) {
|
for (auto &c : p.second) {
|
||||||
Gtk::TreeModel::Row child = *(lensfunLensModel->append(row.children()));
|
Gtk::TreeModel::Row child = *(lensfunLensModel->append(row.children()));
|
||||||
child[lensfunModelLens.lens] = c;
|
child[lensfunModelLens.lens] = c;
|
||||||
if (c.find(p.first, p.first.size()+1) == p.first.size()+1) {
|
|
||||||
child[lensfunModelLens.prettylens] = c.substr(p.first.size()+1);
|
if (c.find(p.first, p.first.size() + 1) == p.first.size() + 1) {
|
||||||
|
child[lensfunModelLens.prettylens] = c.substr(p.first.size() + 1);
|
||||||
} else {
|
} else {
|
||||||
child[lensfunModelLens.prettylens] = c;
|
child[lensfunModelLens.prettylens] = c;
|
||||||
}
|
}
|
||||||
|
@@ -50,18 +50,29 @@ protected:
|
|||||||
MyComboBox *lensfunLenses;
|
MyComboBox *lensfunLenses;
|
||||||
Gtk::Image *warning;
|
Gtk::Image *warning;
|
||||||
|
|
||||||
class LFDbHelper {
|
class LFDbHelper
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
class LFModelCam: public Gtk::TreeModel::ColumnRecord {
|
class LFModelCam: public Gtk::TreeModel::ColumnRecord
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
LFModelCam() { add(make); add(model); }
|
LFModelCam()
|
||||||
|
{
|
||||||
|
add(make);
|
||||||
|
add(model);
|
||||||
|
}
|
||||||
Gtk::TreeModelColumn<Glib::ustring> make;
|
Gtk::TreeModelColumn<Glib::ustring> make;
|
||||||
Gtk::TreeModelColumn<Glib::ustring> model;
|
Gtk::TreeModelColumn<Glib::ustring> model;
|
||||||
};
|
};
|
||||||
|
|
||||||
class LFModelLens: public Gtk::TreeModel::ColumnRecord {
|
class LFModelLens: public Gtk::TreeModel::ColumnRecord
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
LFModelLens() { add(lens); add(prettylens); }
|
LFModelLens()
|
||||||
|
{
|
||||||
|
add(lens);
|
||||||
|
add(prettylens);
|
||||||
|
}
|
||||||
Gtk::TreeModelColumn<Glib::ustring> lens;
|
Gtk::TreeModelColumn<Glib::ustring> lens;
|
||||||
Gtk::TreeModelColumn<Glib::ustring> prettylens;
|
Gtk::TreeModelColumn<Glib::ustring> prettylens;
|
||||||
};
|
};
|
||||||
@@ -90,13 +101,13 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
LensProfilePanel ();
|
LensProfilePanel();
|
||||||
|
|
||||||
void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr);
|
void read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr);
|
||||||
void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr);
|
void write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr);
|
||||||
void setRawMeta (bool raw, const rtengine::FramesMetaData* pMeta);
|
void setRawMeta(bool raw, const rtengine::FramesMetaData* pMeta);
|
||||||
|
|
||||||
void onLCPFileChanged ();
|
void onLCPFileChanged();
|
||||||
void onUseDistChanged();
|
void onUseDistChanged();
|
||||||
void onUseVignChanged();
|
void onUseVignChanged();
|
||||||
void onUseCAChanged();
|
void onUseCAChanged();
|
||||||
|
Reference in New Issue
Block a user