Adding a new spot adjust editing mode in rtengine / preview window

This commit is contained in:
Hombre
2019-08-04 16:07:35 +02:00
parent 4d43dd7e09
commit 7d310e688c
13 changed files with 198 additions and 99 deletions

View File

@@ -618,6 +618,12 @@ void Crop::update(int todo)
parent->imgsrc->getImage(parent->currWB, tr, origCrop, pp, params.toneCurve, params.raw);
}
if ((todo & M_SPOT) && params.spot.enabled && !params.spot.entries.empty()) {
PreviewProps pp(trafx, trafy, trafw * skip, trafh * skip, skip);
//parent->imgsrc->getImage(parent->currWB, tr, origCrop, pp, params.toneCurve, params.raw);
parent->ipf.removeSpots(origCrop, params.spot.entries, pp);
}
DirPyrDenoiseParams denoiseParams = params.dirpyrDenoise;
if (params.dirpyrDenoise.Lmethod == "CUR") {
@@ -692,6 +698,33 @@ void Crop::update(int todo)
// has to be called after setCropSizes! Tools prior to this point can't handle the Edit mechanism, but that shouldn't be a problem.
createBuffer(cropw, croph);
if ((todo & M_SPOT_ADJUST) && params.spot.enabled && !params.spot.entries.empty()) {
PreviewProps pp(trafx, trafy, trafw * skip, trafh * skip, skip);
parent->ipf.removeSpots(origCrop, params.spot.entries, pp);
}
// Apply Spot removal
if (todo & (M_SPOT|M_SPOT_ADJUST)) {
if (params.spot.enabled && !params.spot.entries.empty()) {
if(!spotCrop) {
spotCrop = new Imagefloat (cropw, croph);
}
baseCrop->copyData (spotCrop);
PreviewProps pp (trafx, trafy, trafw * skip, trafh * skip, skip);
//parent->imgsrc->getImage(parent->currWB, tr, origCrop, pp, params.toneCurve, params.raw);
parent->ipf.removeSpots (spotCrop, params.spot.entries, pp);
} else {
if (spotCrop) {
delete spotCrop;
spotCrop = nullptr;
}
}
}
if (spotCrop) {
baseCrop = spotCrop;
}
std::unique_ptr<Imagefloat> fattalCrop;
if ((todo & M_HDR) && (params.fattal.enabled || params.dehaze.enabled)) {
@@ -747,29 +780,6 @@ void Crop::update(int todo)
parent->ipf.ToneMapFattal02(f);
}
// Apply Spot removal
if (params.spot.enabled) {
if (todo & M_SPOT) {
if(!spotCrop) {
spotCrop = new Imagefloat (cropw, croph);
}
baseCrop->copyData (spotCrop);
PreviewProps pp (cropx, cropy, cropw, croph, skip);
parent->ipf.removeSpots (spotCrop, params.spot.entries, pp);
}
} else {
if (spotCrop) {
delete spotCrop;
}
spotCrop = NULL;
}
if (spotCrop) {
baseCrop = spotCrop;
}
// crop back to the size expected by the rest of the pipeline
if (need_cropping) {
Imagefloat *c = origCrop;