capture sharpening: allow negative corner boost

This commit is contained in:
Ingo Weyrich
2019-09-24 18:59:02 +02:00
parent 74b26d953b
commit 79b3ff8e6e
2 changed files with 11 additions and 8 deletions

View File

@@ -581,14 +581,17 @@ BENCHFUN
gauss5x5mult(tmpThr, tmpIThr, fullTileSize, fullTileSize, kernel5);
}
} else {
if (sigmaCornerOffset > 0.0) {
float lkernel7[7][7];
if (sigmaCornerOffset != 0.0) {
const float distance = sqrt(rtengine::SQR(i + tileSize / 2 - H / 2) + rtengine::SQR(j + tileSize / 2 - W / 2));
compute7x7kernel(sigma + distanceFactor * distance, lkernel7);
for (int k = 0; k < iterations - 1; ++k) {
// apply 7x7 gaussian blur and divide luminance by result of gaussian blur
gauss7x7div(tmpIThr, tmpThr, lumThr, fullTileSize, fullTileSize, lkernel7);
gauss7x7mult(tmpThr, tmpIThr, fullTileSize, fullTileSize, lkernel7);
const float sigmaTile = sigma + distanceFactor * distance;
if (sigmaTile >= 0.4f) {
float lkernel7[7][7];
compute7x7kernel(sigma + distanceFactor * distance, lkernel7);
for (int k = 0; k < iterations - 1; ++k) {
// apply 7x7 gaussian blur and divide luminance by result of gaussian blur
gauss7x7div(tmpIThr, tmpThr, lumThr, fullTileSize, fullTileSize, lkernel7);
gauss7x7mult(tmpThr, tmpIThr, fullTileSize, fullTileSize, lkernel7);
}
}
} else {
for (int k = 0; k < iterations; ++k) {