Sharpening: Blur contrast blend mask to get smoother transitions.

This commit is contained in:
heckflosse
2018-05-23 23:49:11 +02:00
parent e1643418cb
commit fcfd813714
5 changed files with 48 additions and 85 deletions

View File

@@ -42,7 +42,7 @@ extern const Settings* settings;
Crop::Crop (ImProcCoordinator* parent, EditDataProvider *editDataProvider, bool isDetailWindow)
: PipetteBuffer (editDataProvider), origCrop (nullptr), laboCrop (nullptr), labnCrop (nullptr),
cropImg (nullptr), cbuf_real (nullptr), transCrop (nullptr), cieCrop (nullptr), cbuffer (nullptr),
cropImg (nullptr), transCrop (nullptr), cieCrop (nullptr),
updating (false), newUpdatePending (false), skip (10),
cropx (0), cropy (0), cropw (-1), croph (-1),
trafx (0), trafy (0), trafw (-1), trafh (-1),
@@ -865,7 +865,7 @@ void Crop::update (int todo)
if ((params.colorappearance.enabled && !settings->autocielab) || (!params.colorappearance.enabled)) {
parent->ipf.MLmicrocontrast (labnCrop);
parent->ipf.sharpening (labnCrop, (float**)cbuffer, params.sharpening);
parent->ipf.sharpening (labnCrop, params.sharpening);
}
}
@@ -1082,16 +1082,6 @@ void Crop::freeAll ()
cieCrop = nullptr;
}
if (cbuf_real) {
delete [] cbuf_real;
cbuf_real = nullptr;
}
if (cbuffer ) {
delete [] cbuffer;
cbuffer = nullptr;
}
PipetteBuffer::flush();
}
@@ -1269,21 +1259,6 @@ bool Crop::setCropSizes (int rcx, int rcy, int rcw, int rch, int skip, bool inte
cieCrop = nullptr;
}
if (cbuffer ) {
delete [] cbuffer;
}
if (cbuf_real) {
delete [] cbuf_real;
}
cbuffer = new float*[croph];
cbuf_real = new float[ (croph + 2)*cropw];
for (int i = 0; i < croph; i++) {
cbuffer[i] = cbuf_real + cropw * i + cropw;
}
if (editType == ET_PIPETTE) {
PipetteBuffer::resize (cropw, croph);
} else if (PipetteBuffer::bufferCreated()) {