Merge with dev
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "improcfun.h"
|
||||
@@ -158,7 +158,7 @@ namespace rtengine
|
||||
|
||||
extern const Settings* settings;
|
||||
|
||||
void ImProcFunctions::deconvsharpening (float** luminance, float** tmp, int W, int H, const SharpeningParams &sharpenParam)
|
||||
void ImProcFunctions::deconvsharpening (float** luminance, float** tmp, const float * const * blend, int W, int H, const SharpeningParams &sharpenParam, double Scale)
|
||||
{
|
||||
if (sharpenParam.deconvamount == 0 && sharpenParam.blurradius < 0.25f) {
|
||||
return;
|
||||
@@ -175,10 +175,6 @@ BENCHFUN
|
||||
}
|
||||
}
|
||||
|
||||
// calculate contrast based blend factors to reduce sharpening in regions with low contrast
|
||||
JaggedArray<float> blend(W, H);
|
||||
float contrast = sharpenParam.contrast / 100.f;
|
||||
buildBlendMask(luminance, blend, W, H, contrast, 1.f);
|
||||
JaggedArray<float>* blurbuffer = nullptr;
|
||||
|
||||
if (sharpenParam.blurradius >= 0.25f) {
|
||||
@@ -201,7 +197,7 @@ BENCHFUN
|
||||
}
|
||||
const float damping = sharpenParam.deconvdamping / 5.0;
|
||||
const bool needdamp = sharpenParam.deconvdamping > 0;
|
||||
const double sigma = sharpenParam.deconvradius / scale;
|
||||
const double sigma = sharpenParam.deconvradius / Scale;
|
||||
const float amount = sharpenParam.deconvamount / 100.f;
|
||||
|
||||
#ifdef _OPENMP
|
||||
@@ -357,11 +353,12 @@ void ImProcFunctions::sharpening (LabImage* lab, const SharpeningParams &sharpen
|
||||
|
||||
int W = lab->W, H = lab->H;
|
||||
|
||||
// calculate contrast based blend factors to reduce sharpening in regions with low contrast
|
||||
JaggedArray<float> blend(W, H);
|
||||
float contrast = sharpenParam.contrast / 100.f;
|
||||
buildBlendMask(lab->L, blend, W, H, contrast, 1.f);
|
||||
|
||||
if(showMask) {
|
||||
// calculate contrast based blend factors to reduce sharpening in regions with low contrast
|
||||
JaggedArray<float> blend(W, H);
|
||||
float contrast = sharpenParam.contrast / 100.f;
|
||||
buildBlendMask(lab->L, blend, W, H, contrast, 1.f);
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel for
|
||||
#endif
|
||||
@@ -377,7 +374,7 @@ void ImProcFunctions::sharpening (LabImage* lab, const SharpeningParams &sharpen
|
||||
JaggedArray<float> b2(W, H);
|
||||
|
||||
if (sharpenParam.method == "rld") {
|
||||
deconvsharpening (lab->L, b2, lab->W, lab->H, sharpenParam);
|
||||
deconvsharpening (lab->L, b2, blend, lab->W, lab->H, sharpenParam, scale);
|
||||
return;
|
||||
}
|
||||
BENCHFUN
|
||||
@@ -393,11 +390,6 @@ BENCHFUN
|
||||
}
|
||||
}
|
||||
|
||||
// calculate contrast based blend factors to reduce sharpening in regions with low contrast
|
||||
JaggedArray<float> blend(W, H);
|
||||
float contrast = sharpenParam.contrast / 100.f;
|
||||
buildBlendMask(lab->L, blend, W, H, contrast);
|
||||
|
||||
JaggedArray<float> blur(W, H);
|
||||
|
||||
if (sharpenParam.blurradius >= 0.25f) {
|
||||
@@ -989,11 +981,11 @@ void ImProcFunctions::sharpeningcam (CieImage* ncie, float** b2, bool showMask)
|
||||
|
||||
int W = ncie->W, H = ncie->H;
|
||||
|
||||
// calculate contrast based blend factors to reduce sharpening in regions with low contrast
|
||||
JaggedArray<float> blend(W, H);
|
||||
float contrast = params->sharpening.contrast / 100.f;
|
||||
buildBlendMask(ncie->sh_p, blend, W, H, contrast);
|
||||
if(showMask) {
|
||||
// calculate contrast based blend factors to reduce sharpening in regions with low contrast
|
||||
JaggedArray<float> blend(W, H);
|
||||
float contrast = params->sharpening.contrast / 100.f;
|
||||
buildBlendMask(ncie->sh_p, blend, W, H, contrast);
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel for
|
||||
#endif
|
||||
@@ -1006,9 +998,8 @@ void ImProcFunctions::sharpeningcam (CieImage* ncie, float** b2, bool showMask)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (params->sharpening.method == "rld") {
|
||||
deconvsharpening (ncie->sh_p, b2, ncie->W, ncie->H, params->sharpening);
|
||||
deconvsharpening (ncie->sh_p, b2, blend, ncie->W, ncie->H, params->sharpening, scale);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1024,11 +1015,6 @@ void ImProcFunctions::sharpeningcam (CieImage* ncie, float** b2, bool showMask)
|
||||
}
|
||||
}
|
||||
|
||||
// calculate contrast based blend factors to reduce sharpening in regions with low contrast
|
||||
JaggedArray<float> blend(W, H);
|
||||
float contrast = params->sharpening.contrast / 100.f;
|
||||
buildBlendMask(ncie->sh_p, blend, W, H, contrast);
|
||||
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user