LCP cleanup (#4062)

- Removed `using namespace`
- Use real `Cache`
- Use `std::shared_ptr<LCPProfile>`
- Moved `LCPPersModel` to .cc

More could be done...
This commit is contained in:
Flössie
2017-09-09 20:19:11 +02:00
parent 5656d16e64
commit d442f7a85b
8 changed files with 1013 additions and 796 deletions

View File

@@ -313,7 +313,7 @@ void ImProcFunctions::transform (Imagefloat* original, Imagefloat* transformed,
LCPMapper *pLCPMap = nullptr;
if (needsLCP()) { // don't check focal length to allow distortion correction for lenses without chip
LCPProfile *pLCPProf = lcpStore->getProfile (params->lensProf.lcpFile);
const std::shared_ptr<LCPProfile> pLCPProf = LCPStore::getInstance()->getProfile (params->lensProf.lcpFile);
if (pLCPProf) {
pLCPMap = new LCPMapper (pLCPProf, focalLen, focalLen35mm,
@@ -784,7 +784,7 @@ void ImProcFunctions::transformHighQuality (Imagefloat* original, Imagefloat* tr
double ascale = params->commonTrans.autofill ? getTransformAutoFill (oW, oH, true /*fullImage*/ ? pLCPMap : nullptr) : 1.0;
// smaller crop images are a problem, so only when processing fully
bool enableLCPCA = pLCPMap && params->lensProf.useCA && fullImage && pLCPMap->enableCA;
bool enableLCPCA = pLCPMap && params->lensProf.useCA && fullImage && pLCPMap->isCACorrectionAvailable();
bool enableLCPDist = pLCPMap && params->lensProf.useDist; // && fullImage;
if (enableLCPCA) {