disable the selection of lensfun auto mode if no match is found in the db

This commit is contained in:
Alberto Griggio
2017-09-07 18:04:55 +02:00
parent 9bfd2d60d3
commit c8d9573606
3 changed files with 22 additions and 3 deletions

View File

@@ -1654,7 +1654,7 @@ TP_LABCURVE_RSTPRO_TOOLTIP;Works on the Chromaticity slider and the CC curve.
TP_LENSGEOM_AUTOCROP;Auto-Crop
TP_LENSGEOM_FILL;Auto-fill
TP_LENSGEOM_LABEL;Lens / Geometry
TP_LENSPROFILE_LABEL;Lens Correction Profile
TP_LENSPROFILE_LABEL;Profiled Lens Correction
TP_LENSPROFILE_USECA;Chromatic aberration correction
TP_LENSPROFILE_USEDIST;Distortion correction
TP_LENSPROFILE_USEVIGN;Vignetting correction
@@ -2152,3 +2152,7 @@ ZOOMPANEL_ZOOMFITCROPSCREEN;Fit crop to screen\nShortcut: <b>Alt</b>-<b>f</b>
ZOOMPANEL_ZOOMFITSCREEN;Fit whole image to screen\nShortcut: <b>f</b>
ZOOMPANEL_ZOOMIN;Zoom In\nShortcut: <b>+</b>
ZOOMPANEL_ZOOMOUT;Zoom Out\nShortcut: <b>-</b>
LENSPROFILE_CORRECTION_OFF;None
LENSPROFILE_CORRECTION_AUTOMATCH;Auto-matched correction parameters
LENSPROFILE_CORRECTION_MANUAL;Manual correction parameters
LENSPROFILE_CORRECTION_LCPFILE;LCP File

View File

@@ -36,6 +36,7 @@ LensProfilePanel::LensProfilePanel () :
useVignChanged(false),
useCAChanged(false),
isRaw(true),
metadata(nullptr),
lensgeomLcpFill(nullptr),
useLensfunChanged(false),
lensfunAutoChanged(false),
@@ -64,14 +65,14 @@ LensProfilePanel::LensProfilePanel () :
lensfunLenses->pack_start(lensfunModelLens.lens);
Gtk::HBox *hb = Gtk::manage(new Gtk::HBox());
hb->pack_start(*Gtk::manage(new Gtk::Label(M("LENSFUN_CAMERA"))), Gtk::PACK_SHRINK, 4);
hb->pack_start(*Gtk::manage(new Gtk::Label(M("EXIFFILTER_CAMERA"))), Gtk::PACK_SHRINK, 4);
hb->pack_start(*lensfunCameras);
pack_start(*hb);
fillLensfunCameras();
hb = Gtk::manage(new Gtk::HBox());
hb->pack_start(*Gtk::manage(new Gtk::Label(M("LENSFUN_LENS"))), Gtk::PACK_SHRINK, 4);
hb->pack_start(*Gtk::manage(new Gtk::Label(M("EXIFFILTER_LENS"))), Gtk::PACK_SHRINK, 4);
hb->pack_start(*lensfunLenses);
pack_start(*hb);
@@ -140,6 +141,8 @@ void LensProfilePanel::read(const rtengine::procparams::ProcParams* pp, const Pa
disableListener ();
conUseDist.block(true);
corrLensfunAuto->set_sensitive(true);
if (pp->lensProf.useLensfun) {
if (pp->lensProf.lfAutoMatch) {
corrLensfunAuto->set_active(true);
@@ -214,6 +217,16 @@ void LensProfilePanel::read(const rtengine::procparams::ProcParams* pp, const Pa
lcpFileChanged = useDistChanged = useVignChanged = useCAChanged = false;
useLensfunChanged = lensfunAutoChanged = lensfunCameraChanged = lensfunLensChanged = false;
if (!batchMode && metadata && pp->lensProf.useLensfun) {
std::unique_ptr<LFModifier> mod(LFDatabase::findModifier(pp->lensProf, metadata, 100, 100, pp->coarse, -1));
if (!mod) {
corrOff->set_active(true);
if (pp->lensProf.lfAutoMatch) {
corrLensfunAuto->set_sensitive(false);
}
}
}
enableListener ();
conUseDist.block(false);
}
@@ -232,6 +245,7 @@ void LensProfilePanel::setRawMeta(bool raw, const rtengine::ImageMetaData* pMeta
}
isRaw = raw;
metadata = pMeta;
}
void LensProfilePanel::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedited)

View File

@@ -39,6 +39,7 @@ protected:
void updateDisabled(bool enable);
bool allowFocusDep;
bool isRaw;
const rtengine::ImageMetaData* metadata;
LensGeometry *lensgeomLcpFill;
Gtk::RadioButton::Group corrGroup;