Merge branch 'dev' into multiframe-handling

This commit is contained in:
Hombre57 2017-09-18 22:59:57 +02:00
commit 97afbdc5c5
6 changed files with 49 additions and 33 deletions

View File

@ -450,7 +450,17 @@ include(CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_INCLUDES ${LENSFUN_INCLUDE_DIRS}) set(CMAKE_REQUIRED_INCLUDES ${LENSFUN_INCLUDE_DIRS})
set(CMAKE_REQUIRED_LIBRARIES) set(CMAKE_REQUIRED_LIBRARIES)
foreach(l ${LENSFUN_LIBRARIES}) foreach(l ${LENSFUN_LIBRARIES})
find_library(_l ${l} PATHS ${LENSFUN_LIBRARY_DIRS} NO_DEFAULT_PATH) if(LENSFUN_LIBRARY_DIRS)
# the NO_DEFAULT_PATH is to make sure we find the lensfun version we
# want, and not the system's one (e.g. if we have a custom version
# installed in a non-standard location)
find_library(_l ${l} PATHS ${LENSFUN_LIBRARY_DIRS} NO_DEFAULT_PATH)
else()
# LENSFUN_LIBRARY_DIRS can be empty if lensfun is installed in the
# default path. In this case, adding NO_DEFAULT_PATH would make
# find_library fail...
find_library(_l ${l})
endif()
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${_l}) set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${_l})
endforeach() endforeach()
check_cxx_source_compiles( check_cxx_source_compiles(

View File

@ -203,7 +203,7 @@ public:
ImProcFunctions (const ProcParams* iparams, bool imultiThread = true) ImProcFunctions (const ProcParams* iparams, bool imultiThread = true)
: monitorTransform (nullptr), lab2outputTransform (nullptr), output2monitorTransform (nullptr), params (iparams), scale (1), multiThread (imultiThread), lumimul{} {} : monitorTransform (nullptr), lab2outputTransform (nullptr), output2monitorTransform (nullptr), params (iparams), scale (1), multiThread (imultiThread), lumimul{} {}
~ImProcFunctions (); ~ImProcFunctions ();
bool needsLuminanceOnly() { return !(needsCA() || needsDistortion() || needsRotation() || needsPerspective() || needsLCP() || needsLensfun()) && (needsVignetting() || needsPCVignetting() || needsGradient());}
void setScale (double iscale); void setScale (double iscale);
bool needsTransform (); bool needsTransform ();

View File

@ -52,7 +52,7 @@ const int br = (int) options.rtSettings.bot_right;
const int tl = (int) options.rtSettings.top_left; const int tl = (int) options.rtSettings.top_left;
const int bl = (int) options.rtSettings.bot_left; const int bl = (int) options.rtSettings.bot_left;
const char *LensProfParams::methodstring[static_cast<size_t>(LensProfParams::eLcMode::LC_LCP) + 1u] = {"none", "lfauto", "lfmanual", "lcp"}; const char *LensProfParams::methodstring[static_cast<size_t>(LensProfParams::LcMode::LCP) + 1u] = {"none", "lfauto", "lfmanual", "lcp"};
const char *RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::numMethods] = {"amaze", "igv", "lmmse", "eahd", "hphd", "vng4", "dcb", "ahd", "fast", "mono", "none", "pixelshift" }; const char *RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::numMethods] = {"amaze", "igv", "lmmse", "eahd", "hphd", "vng4", "dcb", "ahd", "fast", "mono", "none", "pixelshift" };
const char *RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::numMethods] = {"3-pass (best)", "1-pass (medium)", "fast", "mono", "none" }; const char *RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::numMethods] = {"3-pass (best)", "1-pass (medium)", "fast", "mono", "none" };
@ -920,7 +920,7 @@ void ToneCurveParams::setDefaults()
void LensProfParams::setDefaults() void LensProfParams::setDefaults()
{ {
lcMode = eLcMode::LC_NOCORRECTION; lcMode = LcMode::NONE;
lcpFile = ""; lcpFile = "";
useDist = useVign = true; useDist = useVign = true;
useCA = false; useCA = false;
@ -5836,7 +5836,7 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited)
} }
if(ppVersion < 327 && !lensProf.lcpFile.empty()) { if(ppVersion < 327 && !lensProf.lcpFile.empty()) {
lensProf.lcMode = LensProfParams::eLcMode::LC_LCP; lensProf.lcMode = LensProfParams::LcMode::LCP;
} }
} }

View File

@ -829,15 +829,15 @@ class LensProfParams
{ {
public: public:
enum class eLcMode { enum class LcMode {
LC_NOCORRECTION, // No lens correction NONE, // No lens correction
LC_LENSFUNAUTOMATCH, // Lens correction using auto matched lensfun database entry LENSFUNAUTOMATCH, // Lens correction using auto matched lensfun database entry
LC_LENSFUNMANUAL, // Lens correction using manually selected lensfun database entry LENSFUNMANUAL, // Lens correction using manually selected lensfun database entry
LC_LCP // Lens correction using lcp file LCP // Lens correction using lcp file
}; };
static const char *methodstring[static_cast<size_t>(eLcMode::LC_LCP) + 1u]; static const char *methodstring[static_cast<size_t>(LcMode::LCP) + 1u];
eLcMode lcMode; LcMode lcMode;
Glib::ustring lcpFile; Glib::ustring lcpFile;
bool useDist, useVign, useCA; bool useDist, useVign, useCA;
Glib::ustring lfCameraMake; Glib::ustring lfCameraMake;
@ -852,37 +852,37 @@ public:
bool useLensfun() const bool useLensfun() const
{ {
return lcMode == eLcMode::LC_LENSFUNAUTOMATCH || lcMode == eLcMode::LC_LENSFUNMANUAL; return lcMode == LcMode::LENSFUNAUTOMATCH || lcMode == LcMode::LENSFUNMANUAL;
} }
bool lfAutoMatch() const bool lfAutoMatch() const
{ {
return lcMode == eLcMode::LC_LENSFUNAUTOMATCH; return lcMode == LcMode::LENSFUNAUTOMATCH;
} }
bool useLcp() const bool useLcp() const
{ {
return lcMode == eLcMode::LC_LCP && lcpFile.length() > 0; return lcMode == LcMode::LCP && lcpFile.length() > 0;
} }
bool lfManual() const bool lfManual() const
{ {
return lcMode == eLcMode::LC_LENSFUNMANUAL; return lcMode == LcMode::LENSFUNMANUAL;
} }
Glib::ustring getMethodString(eLcMode mode) const Glib::ustring getMethodString(LcMode mode) const
{ {
return methodstring[static_cast<size_t>(mode)]; return methodstring[static_cast<size_t>(mode)];
} }
eLcMode getMethodNumber(const Glib::ustring &mode) const LcMode getMethodNumber(const Glib::ustring &mode) const
{ {
for(size_t i = 0; i < static_cast<size_t>(eLcMode::LC_LCP); ++i) { for(size_t i = 0; i <= static_cast<size_t>(LcMode::LCP); ++i) {
if(methodstring[i] == mode) { if(methodstring[i] == mode) {
return static_cast<eLcMode>(i); return static_cast<LcMode>(i);
} }
} }
return eLcMode::LC_NOCORRECTION; return LcMode::NONE;
} }
}; };

View File

@ -812,11 +812,17 @@ private:
// perform transform (excepted resizing) // perform transform (excepted resizing)
if (ipf.needsTransform()) { if (ipf.needsTransform()) {
Imagefloat* trImg = new Imagefloat (fw, fh); Imagefloat* trImg = nullptr;
ipf.transform (baseImg, trImg, 0, 0, 0, 0, fw, fh, fw, fh, if (ipf.needsLuminanceOnly()) {
trImg = baseImg;
} else {
trImg = new Imagefloat (fw, fh);
} ipf.transform (baseImg, trImg, 0, 0, 0, 0, fw, fh, fw, fh,
imgsrc->getMetaData(), imgsrc->getRotateDegree(), true); imgsrc->getMetaData(), imgsrc->getRotateDegree(), true);
delete baseImg; if(trImg != baseImg) {
baseImg = trImg; delete baseImg;
baseImg = trImg;
}
} }
} }

View File

@ -161,16 +161,16 @@ 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::eLcMode::LC_LCP : case procparams::LensProfParams::LcMode::LCP :
corrLcpFile->set_active(true); corrLcpFile->set_active(true);
break; break;
case procparams::LensProfParams::eLcMode::LC_LENSFUNAUTOMATCH : case procparams::LensProfParams::LcMode::LENSFUNAUTOMATCH :
corrLensfunAuto->set_active(true); corrLensfunAuto->set_active(true);
break; break;
case procparams::LensProfParams::eLcMode::LC_LENSFUNMANUAL : case procparams::LensProfParams::LcMode::LENSFUNMANUAL :
corrLensfunManual->set_active(true); corrLensfunManual->set_active(true);
break; break;
case procparams::LensProfParams::eLcMode::LC_NOCORRECTION : case procparams::LensProfParams::LcMode::NONE :
corrOff->set_active(true); corrOff->set_active(true);
} }
@ -274,13 +274,13 @@ void LensProfilePanel::setRawMeta(bool raw, const rtengine::FramesMetaData* pMet
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::eLcMode::LC_LCP; pp->lensProf.lcMode = procparams::LensProfParams::LcMode::LCP;
} else if(corrLensfunManual->get_active()) { } else if(corrLensfunManual->get_active()) {
pp->lensProf.lcMode = procparams::LensProfParams::eLcMode::LC_LENSFUNMANUAL; pp->lensProf.lcMode = procparams::LensProfParams::LcMode::LENSFUNMANUAL;
} else if(corrLensfunAuto->get_active()) { } else if(corrLensfunAuto->get_active()) {
pp->lensProf.lcMode = procparams::LensProfParams::eLcMode::LC_LENSFUNAUTOMATCH; pp->lensProf.lcMode = procparams::LensProfParams::LcMode::LENSFUNAUTOMATCH;
} else if(corrOff->get_active()) { } else if(corrOff->get_active()) {
pp->lensProf.lcMode = procparams::LensProfParams::eLcMode::LC_NOCORRECTION; pp->lensProf.lcMode = procparams::LensProfParams::LcMode::NONE;
} }
if (LCPStore::getInstance()->isValidLCPFileName(fcbLCPFile->get_filename())) { if (LCPStore::getInstance()->isValidLCPFileName(fcbLCPFile->get_filename())) {