merge with dev

This commit is contained in:
Desmis
2019-09-24 19:32:29 +02:00
2 changed files with 14 additions and 11 deletions

View File

@@ -532,9 +532,9 @@ BENCHFUN
constexpr int tileSize = 194; constexpr int tileSize = 194;
constexpr int border = 5; constexpr int border = 5;
constexpr int fullTileSize = tileSize + 2 * border; constexpr int fullTileSize = tileSize + 2 * border;
const float maxRadius = std::min<float>(1.15f, sigma + sigmaCornerOffset); const float cornerRadius = std::min<float>(1.15f, sigma + sigmaCornerOffset);
const float maxDistance = sqrt(rtengine::SQR(W * 0.5f) + rtengine::SQR(H * 0.5f)); const float cornerDistance = sqrt(rtengine::SQR(W * 0.5f) + rtengine::SQR(H * 0.5f));
const float distanceFactor = (maxRadius - sigma) / maxDistance; const float distanceFactor = (cornerRadius - sigma) / cornerDistance;
double progress = startVal; double progress = startVal;
const double progressStep = (endVal - startVal) * rtengine::SQR(tileSize) / (W * H); const double progressStep = (endVal - startVal) * rtengine::SQR(tileSize) / (W * H);
@@ -581,15 +581,18 @@ BENCHFUN
gauss5x5mult(tmpThr, tmpIThr, fullTileSize, fullTileSize, kernel5); gauss5x5mult(tmpThr, tmpIThr, fullTileSize, fullTileSize, kernel5);
} }
} else { } else {
if (sigmaCornerOffset > 0.0) { if (sigmaCornerOffset != 0.0) {
float lkernel7[7][7];
const float distance = sqrt(rtengine::SQR(i + tileSize / 2 - H / 2) + rtengine::SQR(j + tileSize / 2 - W / 2)); const float distance = sqrt(rtengine::SQR(i + tileSize / 2 - H / 2) + rtengine::SQR(j + tileSize / 2 - W / 2));
const float sigmaTile = sigma + distanceFactor * distance;
if (sigmaTile >= 0.4f) {
float lkernel7[7][7];
compute7x7kernel(sigma + distanceFactor * distance, lkernel7); compute7x7kernel(sigma + distanceFactor * distance, lkernel7);
for (int k = 0; k < iterations - 1; ++k) { for (int k = 0; k < iterations - 1; ++k) {
// apply 7x7 gaussian blur and divide luminance by result of gaussian blur // apply 7x7 gaussian blur and divide luminance by result of gaussian blur
gauss7x7div(tmpIThr, tmpThr, lumThr, fullTileSize, fullTileSize, lkernel7); gauss7x7div(tmpIThr, tmpThr, lumThr, fullTileSize, fullTileSize, lkernel7);
gauss7x7mult(tmpThr, tmpIThr, fullTileSize, fullTileSize, lkernel7); gauss7x7mult(tmpThr, tmpIThr, fullTileSize, fullTileSize, lkernel7);
} }
}
} else { } else {
for (int k = 0; k < iterations; ++k) { for (int k = 0; k < iterations; ++k) {
// apply 7x7 gaussian blur and divide luminance by result of gaussian blur // apply 7x7 gaussian blur and divide luminance by result of gaussian blur

View File

@@ -61,7 +61,7 @@ PdSharpening::PdSharpening() :
dradius = Gtk::manage(new Adjuster(M("TP_SHARPENING_RADIUS"), 0.4, 1.15, 0.01, 0.75)); dradius = Gtk::manage(new Adjuster(M("TP_SHARPENING_RADIUS"), 0.4, 1.15, 0.01, 0.75));
dradius->addAutoButton(); dradius->addAutoButton();
dradius->setAutoValue(true); dradius->setAutoValue(true);
dradiusOffset = Gtk::manage(new Adjuster(M("TP_SHARPENING_RADIUS_BOOST"), 0.0, 0.5, 0.01, 0.0)); dradiusOffset = Gtk::manage(new Adjuster(M("TP_SHARPENING_RADIUS_BOOST"), -0.5, 0.5, 0.01, 0.0));
diter = Gtk::manage(new Adjuster(M("TP_SHARPENING_RLD_ITERATIONS"), 1, 100, 1, 20)); diter = Gtk::manage(new Adjuster(M("TP_SHARPENING_RLD_ITERATIONS"), 1, 100, 1, 20));
rld->pack_start(*gamma); rld->pack_start(*gamma);
rld->pack_start(*dradius); rld->pack_start(*dradius);