Reduce searches for lensfun data if there is no entry for the combo of camera and lens
This commit is contained in:
parent
200d746465
commit
b8dcd93a6a
@ -24,7 +24,6 @@
|
|||||||
#include "procparams.h"
|
#include "procparams.h"
|
||||||
#include "rtlensfun.h"
|
#include "rtlensfun.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
namespace rtengine
|
namespace rtengine
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -500,6 +499,7 @@ std::unique_ptr<LFModifier> LFDatabase::getModifier(const LFCamera &camera, cons
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Glib::ustring LFDatabase::lastKey;
|
||||||
|
|
||||||
std::unique_ptr<LFModifier> LFDatabase::findModifier(const procparams::LensProfParams &lensProf, const FramesMetaData *idata, int width, int height, const procparams::CoarseTransformParams &coarse, int rawRotationDeg)
|
std::unique_ptr<LFModifier> LFDatabase::findModifier(const procparams::LensProfParams &lensProf, const FramesMetaData *idata, int width, int height, const procparams::CoarseTransformParams &coarse, int rawRotationDeg)
|
||||||
{
|
{
|
||||||
@ -521,6 +521,11 @@ std::unique_ptr<LFModifier> LFDatabase::findModifier(const procparams::LensProfP
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Glib::ustring temp = make + model + lens;
|
||||||
|
if (lastKey == temp) {
|
||||||
|
// This combination was not found in last search => do not search again
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
const LFDatabase *db = getInstance();
|
const LFDatabase *db = getInstance();
|
||||||
LFCamera c = db->findCamera(make, model);
|
LFCamera c = db->findCamera(make, model);
|
||||||
LFLens l = db->findLens(lensProf.lfAutoMatch() ? c : LFCamera(), lens);
|
LFLens l = db->findLens(lensProf.lfAutoMatch() ? c : LFCamera(), lens);
|
||||||
@ -549,6 +554,10 @@ std::unique_ptr<LFModifier> LFDatabase::findModifier(const procparams::LensProfP
|
|||||||
<< (ret ? ret->getDisplayString() : "NONE") << std::endl;
|
<< (ret ? ret->getDisplayString() : "NONE") << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ret) {
|
||||||
|
lastKey = temp;
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,6 +135,7 @@ private:
|
|||||||
mutable MyMutex lfDBMutex;
|
mutable MyMutex lfDBMutex;
|
||||||
static LFDatabase instance_;
|
static LFDatabase instance_;
|
||||||
lfDatabase *data_;
|
lfDatabase *data_;
|
||||||
|
static Glib::ustring lastKey;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rtengine
|
} // namespace rtengine
|
||||||
|
Loading…
x
Reference in New Issue
Block a user