better (local) caching of fattal results in dcrop

Use new M_HDR todo code instead of using M_RGBCURVE for fattal
(ported from Hombre's commit a9d02a7dca0b5dcd31f642046d94e1663b17c9ff)
This commit is contained in:
Alberto Griggio
2017-11-17 17:46:13 +01:00
parent 1467b858c5
commit 6212d6e0c6
4 changed files with 40 additions and 46 deletions

View File

@@ -280,7 +280,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
}
}
if (todo & (M_INIT | M_LINDENOISE)) {
if (todo & (M_INIT | M_LINDENOISE | M_HDR)) {
MyMutex::MyLock initLock (minit); // Also used in crop window
imgsrc->HLRecovery_Global ( params.toneCurve); // this handles Color HLRecovery
@@ -385,16 +385,13 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
readyphase++;
if ((todo & (M_TRANSFORM | M_RGBCURVE)) && params.fattal.enabled) {
Imagefloat *fattalprev = orig_prev->copy();
ipf.ToneMapFattal02(fattalprev);
if ((todo & M_HDR) && params.fattal.enabled) {
ipf.ToneMapFattal02(orig_prev);
if (oprevi != orig_prev) {
delete oprevi;
}
oprevi = fattalprev;
} else {
oprevi = orig_prev;
}
oprevi = orig_prev;
progress ("Rotate / Distortion...", 100 * readyphase / numofphases);
// Remove transformation if unneeded