merge with dev

This commit is contained in:
Desmis
2019-12-01 06:53:23 +01:00
116 changed files with 4040 additions and 562 deletions

View File

@@ -231,9 +231,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
MyMutex::MyLock processingLock(mProcessing);
constexpr int numofphases = 14;
int readyphase = 0;
bool highDetailNeeded = options.prevdemo == PD_Sidecar ? true : (todo & M_HIGHQUAL);
// Check if any detail crops need high detail. If not, take a fast path short cut
@@ -274,8 +271,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
//rp.deadPixelFilter = rp.hotPixelFilter = false;
}
progress("Applying white balance, color correction & sRGB conversion...", 100 * readyphase / numofphases);
if (frameCountListener) {
frameCountListener->FrameCountChanged(imgsrc->getFrameCount(), params->raw.bayersensor.imageNum);
}
@@ -539,8 +534,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
ipf.firstAnalysis(orig_prev, *params, vhist16);
}
readyphase++;
if ((todo & M_HDR) && (params->fattal.enabled || params->dehaze.enabled)) {
if (fattal_11_dcrop_cache) {
delete fattal_11_dcrop_cache;
@@ -557,7 +550,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
oprevi = orig_prev;
progress("Rotate / Distortion...", 100 * readyphase / numofphases);
// Remove transformation if unneeded
bool needstransform = ipf.needsTransform();
@@ -583,11 +575,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
ipf.lab2rgb(labcbdl, *oprevi, params->icm.workingProfile);
}
readyphase++;
progress("Preparing shadow/highlight map...", 100 * readyphase / numofphases);
readyphase++;
if (todo & M_AUTOEXP) {
if (params->toneCurve.autoexp) {
LUTu aehist;
@@ -624,8 +611,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
}
}
progress("Exposure curve & CIELAB conversion...", 100 * readyphase / numofphases);
if (todo & (M_AUTOEXP | M_RGBCURVE)) {
if (params->icm.workingTRC == "Custom") { //exec TRC IN free
if (oprevi == orig_prev) {
@@ -777,8 +762,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
params->crop.mapToResized(pW, pH, scale, x1, x2, y1, y2);
}
readyphase++;
if (todo & (M_LUMACURVE | M_CROP)) {
LUTu lhist16(32768);
lhist16.clear();
@@ -821,8 +804,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
if (todo & (M_LUMINANCE + M_COLOR)) {
nprevl->CopyFrom(oprevl);
progress("Applying Color Boost...", 100 * readyphase / numofphases);
histCCurve.clear();
histLCurve.clear();
ipf.chromiLuminanceCurve(nullptr, pW, nprevl, nprevl, chroma_acurve, chroma_bcurve, satcurve, lhskcurve, clcurve, lumacurve, utili, autili, butili, ccutili, cclutili, clcutili, histCCurve, histLCurve);
@@ -833,68 +814,20 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
ipf.EPDToneMap(nprevl, 0, scale);
}
// for all treatments Defringe, Sharpening, Contrast detail , Microcontrast they are activated if "CIECAM" function are disabled
readyphase++;
/* Issue 2785, disabled some 1:1 tools
if (scale==1) {
if((params->colorappearance.enabled && !settings->autocielab) || (!params->colorappearance.enabled)){
progress ("Denoising luminance impulse...",100*readyphase/numofphases);
ipf.impulsedenoise (nprevl);
readyphase++;
}
if((params->colorappearance.enabled && !settings->autocielab) || (!params->colorappearance.enabled)){
progress ("Defringing...",100*readyphase/numofphases);
ipf.defringe (nprevl);
readyphase++;
}
if (params->sharpenEdge.enabled) {
progress ("Edge sharpening...",100*readyphase/numofphases);
ipf.MLsharpen (nprevl);
readyphase++;
}
if (params->sharpenMicro.enabled) {
if(( params->colorappearance.enabled && !settings->autocielab) || (!params->colorappearance.enabled)){
progress ("Microcontrast...",100*readyphase/numofphases);
ipf.MLmicrocontrast (nprevl);
readyphase++;
}
}
if(((params->colorappearance.enabled && !settings->autocielab) || (!params->colorappearance.enabled)) && params->sharpening.enabled) {
progress ("Sharpening...",100*readyphase/numofphases);
float **buffer = new float*[pH];
for (int i=0; i<pH; i++)
buffer[i] = new float[pW];
ipf.sharpening (nprevl, (float**)buffer);
for (int i=0; i<pH; i++)
delete [] buffer[i];
delete [] buffer;
readyphase++;
}
}
*/
if (params->dirpyrequalizer.cbdlMethod == "aft") {
if (((params->colorappearance.enabled && !settings->autocielab) || (!params->colorappearance.enabled))) {
progress("Pyramid wavelet...", 100 * readyphase / numofphases);
ipf.dirpyrequalizer(nprevl, scale);
//ipf.Lanczoslab (ip_wavelet(LabImage * lab, LabImage * dst, const procparams::EqualizerParams & eqparams), nprevl, 1.f/scale);
readyphase++;
}
}
wavcontlutili = false;
//CurveFactory::curveWavContL ( wavcontlutili,params->wavelet.lcurve, wavclCurve, LUTu & histogramwavcl, LUTu & outBeforeWavCLurveHistogram,int skip);
CurveFactory::curveWavContL(wavcontlutili, params->wavelet.wavclCurve, wavclCurve, scale == 1 ? 1 : 16);
if ((params->wavelet.enabled)) {
WaveletParams WaveParams = params->wavelet;
WaveParams.getCurves(wavCLVCurve, waOpacityCurveRG, waOpacityCurveBY, waOpacityCurveW, waOpacityCurveWL);
int kall = 0;
progress("Wavelet...", 100 * readyphase / numofphases);
LabImage *unshar = nullptr;
Glib::ustring provis;
LabImage *provradius = nullptr;
@@ -1109,7 +1042,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
ipf.softLight(nprevl);
if (params->colorappearance.enabled) {
//L histo and Chroma histo for ciecam
// L histo and Chroma histo for ciecam
// histogram well be for Lab (Lch) values, because very difficult to do with J,Q, M, s, C
int x1, y1, x2, y2;
params->crop.mapToResized(pW, pH, scale, x1, x2, y1, y2);
@@ -1190,8 +1123,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
if (params->colorappearance.autoybscen && acListener && params->colorappearance.enabled) {
acListener->ybCamChanged((int) yb); //real value Yb scene
}
readyphase++;
} else {
// CIECAM is disabled, we free up its image buffer to save some space
if (ncie) {
@@ -1226,8 +1157,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
}
if (panningRelatedChange || (todo & M_MONITOR)) {
progress("Conversion to RGB...", 100 * readyphase / numofphases);
if ((todo != CROP && todo != MINUPDATE) || (todo & M_MONITOR)) {
MyMutex::MyLock prevImgLock(previmg->getMutex());
@@ -1239,7 +1168,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
delete workimg;
workimg = ipf.lab2rgb(nprevl, 0, 0, pW, pH, params->icm);
} catch (char * str) {
progress("Error converting file...", 0);
return;
}
}
@@ -1258,8 +1186,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
imageListener->imageReady(params->crop);
}
readyphase++;
if (hListener) {
updateLRGBHistograms();
hListener->histogramChanged(histRed, histGreen, histBlue, histLuma, histToneCurve, histLCurve, histCCurve, /*histCLurve, histLLCurve,*/ histLCAM, histCCAM, histRedRaw, histGreenRaw, histBlueRaw, histChroma, histLRETI);
@@ -1423,15 +1349,6 @@ void ImProcCoordinator::updateLRGBHistograms()
}
void ImProcCoordinator::progress(Glib::ustring str, int pr)
{
/* if (plistener) {
plistener->setProgressStr (str);
plistener->setProgress ((double)pr / 100.0);
}*/
}
bool ImProcCoordinator::getAutoWB(double& temp, double& green, double equal, double tempBias)
{