Speedup and reduced memory usage for 'Defringe', 'Cbdl reduce Artifacts' and 'Ciecam02 Hot/bad pixel filter'
This commit is contained in:
parent
18c90efe25
commit
63f14dda7e
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
}
|
||||
|
||||
|
@ -339,10 +339,10 @@ public:
|
||||
void badpixcam (CieImage* ncie, double rad, int thr, int mode, float skinprot, float chrom, int hotbad);
|
||||
void badpixlab (LabImage* lab, double rad, int thr, int mode, float skinprot, float chrom);
|
||||
|
||||
void PF_correct_RT (LabImage * src, LabImage * dst, double radius, int thresh);
|
||||
void PF_correct_RTcam (CieImage * src, CieImage * dst, double radius, int thresh);
|
||||
void Badpixelscam (CieImage * src, CieImage * dst, double radius, int thresh, int mode, float skinprot, float chrom, int hotbad);
|
||||
void BadpixelsLab (LabImage * src, LabImage * dst, double radius, int thresh, int mode, float skinprot, float chrom);
|
||||
void PF_correct_RT (LabImage * src, double radius, int thresh);
|
||||
void PF_correct_RTcam (CieImage * src, double radius, int thresh);
|
||||
void Badpixelscam (CieImage * src, double radius, int thresh, int mode, float skinprot, float chrom, int hotbad);
|
||||
void BadpixelsLab (LabImage * src, double radius, int thresh, int mode, float chrom);
|
||||
|
||||
void ToneMapFattal02(Imagefloat *rgb);
|
||||
void localContrast(LabImage *lab);
|
||||
|
@ -80,7 +80,6 @@ public:
|
||||
// double colortoningab; //
|
||||
// double decaction;
|
||||
// bool bw_complementary;
|
||||
double artifact_cbdl;
|
||||
double level0_cbdl;
|
||||
double level123_cbdl;
|
||||
Glib::ustring lensfunDbDirectory; ///< The directory containing the lensfun database. If empty, the system defaults will be used (as described in http://lensfun.sourceforge.net/manual/dbsearch.html)
|
||||
|
@ -557,7 +557,6 @@ void Options::setDefaults ()
|
||||
rtSettings.gamutICC = true;
|
||||
rtSettings.gamutLch = true;
|
||||
rtSettings.amchroma = 40;//between 20 and 140 low values increase effect..and also artefacts, high values reduces
|
||||
rtSettings.artifact_cbdl = 4.;
|
||||
rtSettings.level0_cbdl = 0;
|
||||
rtSettings.level123_cbdl = 30;
|
||||
|
||||
@ -1411,9 +1410,6 @@ void Options::readFromFile (Glib::ustring fname)
|
||||
rtSettings.viewinggreySc = keyFile.get_integer ("Color Management", "greySc");
|
||||
}
|
||||
*/
|
||||
if (keyFile.has_key ("Color Management", "CBDLArtif")) {
|
||||
rtSettings.artifact_cbdl = keyFile.get_double ("Color Management", "CBDLArtif");
|
||||
}
|
||||
|
||||
if (keyFile.has_key ("Color Management", "CBDLlevel0")) {
|
||||
rtSettings.level0_cbdl = keyFile.get_double ("Color Management", "CBDLlevel0");
|
||||
@ -2006,7 +2002,6 @@ void Options::saveToFile (Glib::ustring fname)
|
||||
keyFile.set_integer ("Color Management", "CRI", rtSettings.CRI_color);
|
||||
keyFile.set_integer ("Color Management", "DenoiseLabgamma", rtSettings.denoiselabgamma);
|
||||
//keyFile.set_boolean ("Color Management", "Ciebadpixgauss", rtSettings.ciebadpixgauss);
|
||||
keyFile.set_double ("Color Management", "CBDLArtif", rtSettings.artifact_cbdl);
|
||||
keyFile.set_double ("Color Management", "CBDLlevel0", rtSettings.level0_cbdl);
|
||||
keyFile.set_double ("Color Management", "CBDLlevel123", rtSettings.level123_cbdl);
|
||||
//keyFile.set_double ("Color Management", "Colortoningab", rtSettings.colortoningab);
|
||||
|
Loading…
x
Reference in New Issue
Block a user