Speedup and reduced memory usage for 'Defringe', 'Cbdl reduce Artifacts' and 'Ciecam02 Hot/bad pixel filter'
This commit is contained in:
@@ -1486,21 +1486,10 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int pW, int pwb, L
|
||||
//if(params->dirpyrequalizer.enabled) if(execsharp) {
|
||||
if (params->dirpyrequalizer.enabled) {
|
||||
if (params->dirpyrequalizer.gamutlab /*&& execsharp*/) {
|
||||
float artifact = (float) settings->artifact_cbdl;
|
||||
|
||||
if (artifact > 6.f) {
|
||||
artifact = 6.f;
|
||||
}
|
||||
|
||||
if (artifact < 0.f) {
|
||||
artifact = 1.f;
|
||||
}
|
||||
|
||||
float chrom = 50.f;
|
||||
{
|
||||
int hotbad = 0;
|
||||
ImProcFunctions::badpixcam (ncie, artifact, 5, 2, params->dirpyrequalizer.skinprotect, chrom, hotbad); //enabled remove artifacts for cbDL
|
||||
}
|
||||
constexpr float artifact = 4.f;
|
||||
constexpr float chrom = 50.f;
|
||||
constexpr int hotbad = 0;
|
||||
ImProcFunctions::badpixcam (ncie, artifact, 5, 2, params->dirpyrequalizer.skinprotect, chrom, hotbad); //enabled remove artifacts for cbDL
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2917,18 +2906,10 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw
|
||||
//if(params->dirpyrequalizer.enabled) if(execsharp) {
|
||||
if (params->dirpyrequalizer.enabled) {
|
||||
if (params->dirpyrequalizer.gamutlab /*&& execsharp*/) { //remove artifacts by gaussian blur - skin control
|
||||
float artifact = (float) settings->artifact_cbdl;
|
||||
constexpr float artifact = 4.f;
|
||||
constexpr int hotbad = 0;
|
||||
constexpr float chrom = 50.f;
|
||||
|
||||
if (artifact > 6.f) {
|
||||
artifact = 6.f;
|
||||
}
|
||||
|
||||
if (artifact < 0.f) {
|
||||
artifact = 1.f;
|
||||
}
|
||||
|
||||
int hotbad = 0;
|
||||
float chrom = 50.f;
|
||||
lab->deleteLab();
|
||||
ImProcFunctions::badpixcam (ncie, artifact, 5, 2, params->dirpyrequalizer.skinprotect, chrom, hotbad); //enabled remove artifacts for cbDL
|
||||
lab->reallocLab();
|
||||
@@ -6290,52 +6271,43 @@ void ImProcFunctions::defringe (LabImage* lab)
|
||||
if (params->defringe.enabled && lab->W >= 8 && lab->H >= 8)
|
||||
|
||||
{
|
||||
PF_correct_RT (lab, lab, params->defringe.radius, params->defringe.threshold);
|
||||
PF_correct_RT (lab, params->defringe.radius, params->defringe.threshold);
|
||||
}
|
||||
}
|
||||
|
||||
void ImProcFunctions::defringecam (CieImage* ncie)
|
||||
{
|
||||
if (params->defringe.enabled && ncie->W >= 8 && ncie->H >= 8) {
|
||||
PF_correct_RTcam (ncie, ncie, params->defringe.radius, params->defringe.threshold);
|
||||
PF_correct_RTcam (ncie, params->defringe.radius, params->defringe.threshold);
|
||||
}
|
||||
}
|
||||
|
||||
void ImProcFunctions::badpixcam (CieImage* ncie, double rad, int thr, int mode, float skinprot, float chrom, int hotbad)
|
||||
{
|
||||
if (ncie->W >= 8 && ncie->H >= 8) {
|
||||
Badpixelscam (ncie, ncie, rad, thr, mode, skinprot, chrom, hotbad);
|
||||
Badpixelscam (ncie, rad, thr, mode, skinprot, chrom, hotbad);
|
||||
}
|
||||
}
|
||||
|
||||
void ImProcFunctions::badpixlab (LabImage* lab, double rad, int thr, int mode, float skinprot, float chrom)
|
||||
{
|
||||
if (lab->W >= 8 && lab->H >= 8) {
|
||||
BadpixelsLab (lab, lab, rad, thr, mode, skinprot, chrom);
|
||||
BadpixelsLab (lab, rad, thr, mode, chrom);
|
||||
}
|
||||
}
|
||||
|
||||
void ImProcFunctions::dirpyrequalizer (LabImage* lab, int scale)
|
||||
{
|
||||
if (params->dirpyrequalizer.enabled && lab->W >= 8 && lab->H >= 8) {
|
||||
float b_l = static_cast<float> (params->dirpyrequalizer.hueskin.getBottomLeft()) / 100.0f;
|
||||
float t_l = static_cast<float> (params->dirpyrequalizer.hueskin.getTopLeft()) / 100.0f;
|
||||
float t_r = static_cast<float> (params->dirpyrequalizer.hueskin.getTopRight()) / 100.0f;
|
||||
float b_l = static_cast<float> (params->dirpyrequalizer.hueskin.getBottomLeft()) / 100.f;
|
||||
float t_l = static_cast<float> (params->dirpyrequalizer.hueskin.getTopLeft()) / 100.f;
|
||||
float t_r = static_cast<float> (params->dirpyrequalizer.hueskin.getTopRight()) / 100.f;
|
||||
// if (params->dirpyrequalizer.algo=="FI") choice=0;
|
||||
// else if(params->dirpyrequalizer.algo=="LA") choice=1;
|
||||
float artifact = (float) settings->artifact_cbdl;
|
||||
constexpr float artifact = 4.f;
|
||||
|
||||
if (artifact > 6.f) {
|
||||
artifact = 6.f;
|
||||
}
|
||||
|
||||
if (artifact < 0.f) {
|
||||
artifact = 1.f;
|
||||
}
|
||||
|
||||
float chrom = 50.f;
|
||||
|
||||
if (params->dirpyrequalizer.gamutlab) {
|
||||
if (params->dirpyrequalizer.gamutlab && params->dirpyrequalizer.skinprotect != 0) {
|
||||
constexpr float chrom = 50.f;
|
||||
ImProcFunctions::badpixlab (lab, artifact, 5, 3, params->dirpyrequalizer.skinprotect, chrom); //for artifacts
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user