Haze removal: Allow blend between normal and luminance mode, #5972
This commit is contained in:
parent
aae90a0ad3
commit
31a9cf3fe0
@ -1191,7 +1191,7 @@ HISTORY_MSG_COMPLEX;Wavelet complexity
|
|||||||
HISTORY_MSG_COMPLEXRETI;Retinex complexity
|
HISTORY_MSG_COMPLEXRETI;Retinex complexity
|
||||||
HISTORY_MSG_DEHAZE_DEPTH;Dehaze - Depth
|
HISTORY_MSG_DEHAZE_DEPTH;Dehaze - Depth
|
||||||
HISTORY_MSG_DEHAZE_ENABLED;Haze Removal
|
HISTORY_MSG_DEHAZE_ENABLED;Haze Removal
|
||||||
HISTORY_MSG_DEHAZE_LUMINANCE;Dehaze - Luminance only
|
HISTORY_MSG_DEHAZE_SATURATION;Dehaze - Saturation
|
||||||
HISTORY_MSG_DEHAZE_SHOW_DEPTH_MAP;Dehaze - Show depth map
|
HISTORY_MSG_DEHAZE_SHOW_DEPTH_MAP;Dehaze - Show depth map
|
||||||
HISTORY_MSG_DEHAZE_STRENGTH;Dehaze - Strength
|
HISTORY_MSG_DEHAZE_STRENGTH;Dehaze - Strength
|
||||||
HISTORY_MSG_DUALDEMOSAIC_AUTO_CONTRAST;Dual demosaic - Auto threshold
|
HISTORY_MSG_DUALDEMOSAIC_AUTO_CONTRAST;Dual demosaic - Auto threshold
|
||||||
@ -2080,7 +2080,7 @@ TP_DEFRINGE_RADIUS;Radius
|
|||||||
TP_DEFRINGE_THRESHOLD;Threshold
|
TP_DEFRINGE_THRESHOLD;Threshold
|
||||||
TP_DEHAZE_DEPTH;Depth
|
TP_DEHAZE_DEPTH;Depth
|
||||||
TP_DEHAZE_LABEL;Haze Removal
|
TP_DEHAZE_LABEL;Haze Removal
|
||||||
TP_DEHAZE_LUMINANCE;Luminance only
|
TP_DEHAZE_SATURATION;Saturation
|
||||||
TP_DEHAZE_SHOW_DEPTH_MAP;Show depth map
|
TP_DEHAZE_SHOW_DEPTH_MAP;Show depth map
|
||||||
TP_DEHAZE_STRENGTH;Strength
|
TP_DEHAZE_STRENGTH;Strength
|
||||||
TP_DIRPYRDENOISE_CHROMINANCE_AMZ;Auto multi-zones
|
TP_DIRPYRDENOISE_CHROMINANCE_AMZ;Auto multi-zones
|
||||||
|
@ -386,7 +386,7 @@ void ImProcFunctions::dehaze(Imagefloat *img, const DehazeParams &dehazeParams)
|
|||||||
const float t0 = max(1e-3f, std::exp(depth * maxDistance));
|
const float t0 = max(1e-3f, std::exp(depth * maxDistance));
|
||||||
const float teps = 1e-3f;
|
const float teps = 1e-3f;
|
||||||
|
|
||||||
const bool luminance = dehazeParams.luminance;
|
const float satBlend = dehazeParams.saturation / 100.f;
|
||||||
const TMatrix ws = ICCStore::getInstance()->workingSpaceMatrix(params->icm.workingProfile);
|
const TMatrix ws = ICCStore::getInstance()->workingSpaceMatrix(params->icm.workingProfile);
|
||||||
#ifdef __SSE2__
|
#ifdef __SSE2__
|
||||||
const vfloat wsv[3] = {F2V(ws[1][0]), F2V(ws[1][1]),F2V(ws[1][2])};
|
const vfloat wsv[3] = {F2V(ws[1][0]), F2V(ws[1][1]),F2V(ws[1][2])};
|
||||||
@ -407,6 +407,7 @@ void ImProcFunctions::dehaze(Imagefloat *img, const DehazeParams &dehazeParams)
|
|||||||
const vfloat t0v = F2V(t0);
|
const vfloat t0v = F2V(t0);
|
||||||
const vfloat tepsv = F2V(teps);
|
const vfloat tepsv = F2V(teps);
|
||||||
const vfloat cmaxChannelv = F2V(maxChannel);
|
const vfloat cmaxChannelv = F2V(maxChannel);
|
||||||
|
const vfloat satBlendv = F2V(satBlend);
|
||||||
for (; x < W - 3; x += 4) {
|
for (; x < W - 3; x += 4) {
|
||||||
// ensure that the transmission is such that to avoid clipping...
|
// ensure that the transmission is such that to avoid clipping...
|
||||||
const vfloat r = LVFU(img->r(y, x));
|
const vfloat r = LVFU(img->r(y, x));
|
||||||
@ -420,17 +421,13 @@ void ImProcFunctions::dehaze(Imagefloat *img, const DehazeParams &dehazeParams)
|
|||||||
STVFU(img->r(y, x), valv);
|
STVFU(img->r(y, x), valv);
|
||||||
STVFU(img->g(y, x), valv);
|
STVFU(img->g(y, x), valv);
|
||||||
STVFU(img->b(y, x), valv);
|
STVFU(img->b(y, x), valv);
|
||||||
} else if (luminance) {
|
} else {
|
||||||
const vfloat Yv = Color::rgbLuminance(r, g, b, wsv);
|
const vfloat Yv = Color::rgbLuminance(r, g, b, wsv);
|
||||||
const vfloat YYv = (Yv - ambientYv) / mtv + ambientYv;
|
const vfloat YYv = (Yv - ambientYv) / mtv + ambientYv;
|
||||||
const vfloat fv = vself(vmaskf_gt(Yv, epsYv), cmaxChannelv * YYv / Yv, cmaxChannelv);
|
const vfloat fv = vself(vmaskf_gt(Yv, epsYv), cmaxChannelv * YYv / Yv, cmaxChannelv);
|
||||||
STVFU(img->r(y, x), r * fv);
|
STVFU(img->r(y, x), vintpf(satBlendv, ((r - ambient0v) / mtv + ambient0v) * cmaxChannelv, r * fv));
|
||||||
STVFU(img->g(y, x), g * fv);
|
STVFU(img->g(y, x), vintpf(satBlendv, ((g - ambient1v) / mtv + ambient1v) * cmaxChannelv, g * fv));
|
||||||
STVFU(img->b(y, x), b * fv);
|
STVFU(img->b(y, x), vintpf(satBlendv, ((b - ambient2v) / mtv + ambient2v) * cmaxChannelv, b * fv));
|
||||||
} else {
|
|
||||||
STVFU(img->r(y, x), ((r - ambient0v) / mtv + ambient0v) * cmaxChannelv);
|
|
||||||
STVFU(img->g(y, x), ((g - ambient1v) / mtv + ambient1v) * cmaxChannelv);
|
|
||||||
STVFU(img->b(y, x), ((b - ambient2v) / mtv + ambient2v) * cmaxChannelv);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -444,17 +441,13 @@ void ImProcFunctions::dehaze(Imagefloat *img, const DehazeParams &dehazeParams)
|
|||||||
const float mt = max(dark[y][x], t0, tl + teps);
|
const float mt = max(dark[y][x], t0, tl + teps);
|
||||||
if (dehazeParams.showDepthMap) {
|
if (dehazeParams.showDepthMap) {
|
||||||
img->r(y, x) = img->g(y, x) = img->b(y, x) = LIM01(1.f - mt) * maxChannel;
|
img->r(y, x) = img->g(y, x) = img->b(y, x) = LIM01(1.f - mt) * maxChannel;
|
||||||
} else if (luminance) {
|
} else {
|
||||||
const float Y = Color::rgbLuminance(img->r(y, x), img->g(y, x), img->b(y, x), ws);
|
const float Y = Color::rgbLuminance(img->r(y, x), img->g(y, x), img->b(y, x), ws);
|
||||||
const float YY = (Y - ambientY) / mt + ambientY;
|
const float YY = (Y - ambientY) / mt + ambientY;
|
||||||
const float f = Y > 1e-5f ? maxChannel * YY / Y : maxChannel;
|
const float f = Y > 1e-5f ? maxChannel * YY / Y : maxChannel;
|
||||||
img->r(y, x) *= f;
|
img->r(y, x) = intp(satBlend, ((r - ambient[0]) / mt + ambient[0]) * maxChannel, r * f);
|
||||||
img->g(y, x) *= f;
|
img->g(y, x) = intp(satBlend, ((g - ambient[1]) / mt + ambient[1]) * maxChannel, g * f);
|
||||||
img->b(y, x) *= f;
|
img->b(y, x) = intp(satBlend, ((b - ambient[2]) / mt + ambient[2]) * maxChannel, b * f);
|
||||||
} else {
|
|
||||||
img->r(y, x) = ((r - ambient[0]) / mt + ambient[0]) * maxChannel;
|
|
||||||
img->g(y, x) = ((g - ambient[1]) / mt + ambient[1]) * maxChannel;
|
|
||||||
img->b(y, x) = ((b - ambient[2]) / mt + ambient[2]) * maxChannel;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -556,7 +549,8 @@ void ImProcFunctions::dehazeloc(Imagefloat *img, const DehazeParams &dehazeParam
|
|||||||
const float teps = 1e-6f;
|
const float teps = 1e-6f;
|
||||||
const float t0 = max(teps, std::exp(depth * maxDistance));
|
const float t0 = max(teps, std::exp(depth * maxDistance));
|
||||||
|
|
||||||
const bool luminance = dehazeParams.luminance;
|
// const bool luminance = dehazeParams.luminance;
|
||||||
|
const bool luminance = true;
|
||||||
const TMatrix ws = ICCStore::getInstance()->workingSpaceMatrix(params->icm.workingProfile);
|
const TMatrix ws = ICCStore::getInstance()->workingSpaceMatrix(params->icm.workingProfile);
|
||||||
|
|
||||||
const float ambientY = Color::rgbLuminance(ambient[0], ambient[1], ambient[2], ws);
|
const float ambientY = Color::rgbLuminance(ambient[0], ambient[1], ambient[2], ws);
|
||||||
|
@ -11964,7 +11964,7 @@ void ImProcFunctions::Lab_Local(
|
|||||||
dehazeParams.strength = lp.dehaze;
|
dehazeParams.strength = lp.dehaze;
|
||||||
dehazeParams.showDepthMap = false;
|
dehazeParams.showDepthMap = false;
|
||||||
dehazeParams.depth = lp.depth;
|
dehazeParams.depth = lp.depth;
|
||||||
dehazeParams.luminance = params->locallab.spots.at(sp).lumonly;
|
// dehazeParams.luminance = true;
|
||||||
lab2rgb(*bufexpfin, *tmpImage.get(), params->icm.workingProfile);
|
lab2rgb(*bufexpfin, *tmpImage.get(), params->icm.workingProfile);
|
||||||
dehazeloc(tmpImage.get(), dehazeParams);
|
dehazeloc(tmpImage.get(), dehazeParams);
|
||||||
rgb2lab(*tmpImage.get(), *bufexpfin, params->icm.workingProfile);
|
rgb2lab(*tmpImage.get(), *bufexpfin, params->icm.workingProfile);
|
||||||
|
@ -4598,9 +4598,9 @@ bool SoftLightParams::operator !=(const SoftLightParams& other) const
|
|||||||
DehazeParams::DehazeParams() :
|
DehazeParams::DehazeParams() :
|
||||||
enabled(false),
|
enabled(false),
|
||||||
strength(50),
|
strength(50),
|
||||||
|
saturation(50),
|
||||||
showDepthMap(false),
|
showDepthMap(false),
|
||||||
depth(25),
|
depth(25)
|
||||||
luminance(false)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4611,7 +4611,7 @@ bool DehazeParams::operator ==(const DehazeParams& other) const
|
|||||||
&& strength == other.strength
|
&& strength == other.strength
|
||||||
&& showDepthMap == other.showDepthMap
|
&& showDepthMap == other.showDepthMap
|
||||||
&& depth == other.depth
|
&& depth == other.depth
|
||||||
&& luminance == other.luminance;
|
&& saturation == other.saturation;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DehazeParams::operator !=(const DehazeParams& other) const
|
bool DehazeParams::operator !=(const DehazeParams& other) const
|
||||||
@ -5354,7 +5354,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
|
|||||||
saveToKeyfile(!pedited || pedited->dehaze.strength, "Dehaze", "Strength", dehaze.strength, keyFile);
|
saveToKeyfile(!pedited || pedited->dehaze.strength, "Dehaze", "Strength", dehaze.strength, keyFile);
|
||||||
saveToKeyfile(!pedited || pedited->dehaze.showDepthMap, "Dehaze", "ShowDepthMap", dehaze.showDepthMap, keyFile);
|
saveToKeyfile(!pedited || pedited->dehaze.showDepthMap, "Dehaze", "ShowDepthMap", dehaze.showDepthMap, keyFile);
|
||||||
saveToKeyfile(!pedited || pedited->dehaze.depth, "Dehaze", "Depth", dehaze.depth, keyFile);
|
saveToKeyfile(!pedited || pedited->dehaze.depth, "Dehaze", "Depth", dehaze.depth, keyFile);
|
||||||
saveToKeyfile(!pedited || pedited->dehaze.depth, "Dehaze", "Luminance", dehaze.luminance, keyFile);
|
saveToKeyfile(!pedited || pedited->dehaze.depth, "Dehaze", "Saturation", dehaze.saturation, keyFile);
|
||||||
|
|
||||||
// Directional pyramid denoising
|
// Directional pyramid denoising
|
||||||
saveToKeyfile(!pedited || pedited->dirpyrDenoise.enabled, "Directional Pyramid Denoising", "Enabled", dirpyrDenoise.enabled, keyFile);
|
saveToKeyfile(!pedited || pedited->dirpyrDenoise.enabled, "Directional Pyramid Denoising", "Enabled", dirpyrDenoise.enabled, keyFile);
|
||||||
@ -8324,7 +8324,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
|
|||||||
assignFromKeyfile(keyFile, "Dehaze", "Strength", pedited, dehaze.strength, pedited->dehaze.strength);
|
assignFromKeyfile(keyFile, "Dehaze", "Strength", pedited, dehaze.strength, pedited->dehaze.strength);
|
||||||
assignFromKeyfile(keyFile, "Dehaze", "ShowDepthMap", pedited, dehaze.showDepthMap, pedited->dehaze.showDepthMap);
|
assignFromKeyfile(keyFile, "Dehaze", "ShowDepthMap", pedited, dehaze.showDepthMap, pedited->dehaze.showDepthMap);
|
||||||
assignFromKeyfile(keyFile, "Dehaze", "Depth", pedited, dehaze.depth, pedited->dehaze.depth);
|
assignFromKeyfile(keyFile, "Dehaze", "Depth", pedited, dehaze.depth, pedited->dehaze.depth);
|
||||||
assignFromKeyfile(keyFile, "Dehaze", "Luminance", pedited, dehaze.luminance, pedited->dehaze.luminance);
|
assignFromKeyfile(keyFile, "Dehaze", "Saturation", pedited, dehaze.saturation, pedited->dehaze.saturation);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (keyFile.has_group("Film Simulation")) {
|
if (keyFile.has_group("Film Simulation")) {
|
||||||
|
@ -1955,9 +1955,9 @@ struct SoftLightParams {
|
|||||||
struct DehazeParams {
|
struct DehazeParams {
|
||||||
bool enabled;
|
bool enabled;
|
||||||
int strength;
|
int strength;
|
||||||
|
int saturation;
|
||||||
bool showDepthMap;
|
bool showDepthMap;
|
||||||
int depth;
|
int depth;
|
||||||
bool luminance;
|
|
||||||
|
|
||||||
DehazeParams();
|
DehazeParams();
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ Dehaze::Dehaze(): FoldableToolPanel(this, "dehaze", M("TP_DEHAZE_LABEL"), false,
|
|||||||
EvDehazeStrength = m->newEvent(HDR, "HISTORY_MSG_DEHAZE_STRENGTH");
|
EvDehazeStrength = m->newEvent(HDR, "HISTORY_MSG_DEHAZE_STRENGTH");
|
||||||
EvDehazeShowDepthMap = m->newEvent(HDR, "HISTORY_MSG_DEHAZE_SHOW_DEPTH_MAP");
|
EvDehazeShowDepthMap = m->newEvent(HDR, "HISTORY_MSG_DEHAZE_SHOW_DEPTH_MAP");
|
||||||
EvDehazeDepth = m->newEvent(HDR, "HISTORY_MSG_DEHAZE_DEPTH");
|
EvDehazeDepth = m->newEvent(HDR, "HISTORY_MSG_DEHAZE_DEPTH");
|
||||||
EvDehazeLuminance = m->newEvent(HDR, "HISTORY_MSG_DEHAZE_LUMINANCE");
|
EvDehazeSaturation = m->newEvent(HDR, "HISTORY_MSG_DEHAZE_SATURATION");
|
||||||
|
|
||||||
strength = Gtk::manage(new Adjuster(M("TP_DEHAZE_STRENGTH"), 0., 100., 1., 50.));
|
strength = Gtk::manage(new Adjuster(M("TP_DEHAZE_STRENGTH"), 0., 100., 1., 50.));
|
||||||
strength->setAdjusterListener(this);
|
strength->setAdjusterListener(this);
|
||||||
@ -46,9 +46,9 @@ Dehaze::Dehaze(): FoldableToolPanel(this, "dehaze", M("TP_DEHAZE_LABEL"), false,
|
|||||||
depth->setAdjusterListener(this);
|
depth->setAdjusterListener(this);
|
||||||
depth->show();
|
depth->show();
|
||||||
|
|
||||||
luminance = Gtk::manage(new Gtk::CheckButton(M("TP_DEHAZE_LUMINANCE")));
|
saturation = Gtk::manage(new Adjuster(M("TP_DEHAZE_SATURATION"), 0., 100., 1., 50.));
|
||||||
luminance->signal_toggled().connect(sigc::mem_fun(*this, &Dehaze::luminanceChanged));
|
saturation->setAdjusterListener(this);
|
||||||
luminance->show();
|
saturation->show();
|
||||||
|
|
||||||
showDepthMap = Gtk::manage(new Gtk::CheckButton(M("TP_DEHAZE_SHOW_DEPTH_MAP")));
|
showDepthMap = Gtk::manage(new Gtk::CheckButton(M("TP_DEHAZE_SHOW_DEPTH_MAP")));
|
||||||
showDepthMap->signal_toggled().connect(sigc::mem_fun(*this, &Dehaze::showDepthMapChanged));
|
showDepthMap->signal_toggled().connect(sigc::mem_fun(*this, &Dehaze::showDepthMapChanged));
|
||||||
@ -56,65 +56,65 @@ Dehaze::Dehaze(): FoldableToolPanel(this, "dehaze", M("TP_DEHAZE_LABEL"), false,
|
|||||||
|
|
||||||
pack_start(*strength);
|
pack_start(*strength);
|
||||||
pack_start(*depth);
|
pack_start(*depth);
|
||||||
pack_start(*luminance);
|
pack_start(*saturation);
|
||||||
pack_start(*showDepthMap);
|
pack_start(*showDepthMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Dehaze::read(const ProcParams *pp, const ParamsEdited *pedited)
|
void Dehaze::read(const ProcParams *pp, const ParamsEdited *pedited)
|
||||||
{
|
{
|
||||||
disableListener();
|
disableListener();
|
||||||
|
|
||||||
if (pedited) {
|
if (pedited) {
|
||||||
strength->setEditedState(pedited->dehaze.strength ? Edited : UnEdited);
|
strength->setEditedState(pedited->dehaze.strength ? Edited : UnEdited);
|
||||||
|
saturation->setEditedState(pedited->dehaze.saturation ? Edited : UnEdited);
|
||||||
depth->setEditedState(pedited->dehaze.depth ? Edited : UnEdited);
|
depth->setEditedState(pedited->dehaze.depth ? Edited : UnEdited);
|
||||||
set_inconsistent(multiImage && !pedited->dehaze.enabled);
|
set_inconsistent(multiImage && !pedited->dehaze.enabled);
|
||||||
showDepthMap->set_inconsistent(!pedited->dehaze.showDepthMap);
|
showDepthMap->set_inconsistent(!pedited->dehaze.showDepthMap);
|
||||||
luminance->set_inconsistent(!pedited->dehaze.luminance);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setEnabled(pp->dehaze.enabled);
|
setEnabled(pp->dehaze.enabled);
|
||||||
strength->setValue(pp->dehaze.strength);
|
strength->setValue(pp->dehaze.strength);
|
||||||
|
saturation->setValue(pp->dehaze.saturation);
|
||||||
depth->setValue(pp->dehaze.depth);
|
depth->setValue(pp->dehaze.depth);
|
||||||
showDepthMap->set_active(pp->dehaze.showDepthMap);
|
showDepthMap->set_active(pp->dehaze.showDepthMap);
|
||||||
luminance->set_active(pp->dehaze.luminance);
|
|
||||||
|
|
||||||
enableListener();
|
enableListener();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Dehaze::write(ProcParams *pp, ParamsEdited *pedited)
|
void Dehaze::write(ProcParams *pp, ParamsEdited *pedited)
|
||||||
{
|
{
|
||||||
pp->dehaze.strength = strength->getValue();
|
pp->dehaze.strength = strength->getValue();
|
||||||
|
pp->dehaze.saturation = saturation->getValue();
|
||||||
pp->dehaze.depth = depth->getValue();
|
pp->dehaze.depth = depth->getValue();
|
||||||
pp->dehaze.enabled = getEnabled();
|
pp->dehaze.enabled = getEnabled();
|
||||||
pp->dehaze.showDepthMap = showDepthMap->get_active();
|
pp->dehaze.showDepthMap = showDepthMap->get_active();
|
||||||
pp->dehaze.luminance = luminance->get_active();
|
|
||||||
|
|
||||||
if (pedited) {
|
if (pedited) {
|
||||||
pedited->dehaze.strength = strength->getEditedState();
|
pedited->dehaze.strength = strength->getEditedState();
|
||||||
|
pedited->dehaze.saturation = saturation->getEditedState();
|
||||||
pedited->dehaze.depth = depth->getEditedState();
|
pedited->dehaze.depth = depth->getEditedState();
|
||||||
pedited->dehaze.enabled = !get_inconsistent();
|
pedited->dehaze.enabled = !get_inconsistent();
|
||||||
pedited->dehaze.showDepthMap = !showDepthMap->get_inconsistent();
|
pedited->dehaze.showDepthMap = !showDepthMap->get_inconsistent();
|
||||||
pedited->dehaze.luminance = !luminance->get_inconsistent();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Dehaze::setDefaults(const ProcParams *defParams, const ParamsEdited *pedited)
|
void Dehaze::setDefaults(const ProcParams *defParams, const ParamsEdited *pedited)
|
||||||
{
|
{
|
||||||
strength->setDefault(defParams->dehaze.strength);
|
strength->setDefault(defParams->dehaze.strength);
|
||||||
|
saturation->setDefault(defParams->dehaze.saturation);
|
||||||
depth->setDefault(defParams->dehaze.depth);
|
depth->setDefault(defParams->dehaze.depth);
|
||||||
|
|
||||||
if (pedited) {
|
if (pedited) {
|
||||||
|
saturation->setDefaultEditedState(pedited->dehaze.saturation ? Edited : UnEdited);
|
||||||
strength->setDefaultEditedState(pedited->dehaze.strength ? Edited : UnEdited);
|
strength->setDefaultEditedState(pedited->dehaze.strength ? Edited : UnEdited);
|
||||||
depth->setDefaultEditedState(pedited->dehaze.depth ? Edited : UnEdited);
|
depth->setDefaultEditedState(pedited->dehaze.depth ? Edited : UnEdited);
|
||||||
} else {
|
} else {
|
||||||
|
saturation->setDefaultEditedState(Irrelevant);
|
||||||
strength->setDefaultEditedState(Irrelevant);
|
strength->setDefaultEditedState(Irrelevant);
|
||||||
depth->setDefaultEditedState(Irrelevant);
|
depth->setDefaultEditedState(Irrelevant);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Dehaze::adjusterChanged(Adjuster* a, double newval)
|
void Dehaze::adjusterChanged(Adjuster* a, double newval)
|
||||||
{
|
{
|
||||||
if (listener && getEnabled()) {
|
if (listener && getEnabled()) {
|
||||||
@ -122,11 +122,12 @@ void Dehaze::adjusterChanged(Adjuster* a, double newval)
|
|||||||
listener->panelChanged(EvDehazeStrength, a->getTextValue());
|
listener->panelChanged(EvDehazeStrength, a->getTextValue());
|
||||||
} else if (a == depth) {
|
} else if (a == depth) {
|
||||||
listener->panelChanged(EvDehazeDepth, a->getTextValue());
|
listener->panelChanged(EvDehazeDepth, a->getTextValue());
|
||||||
|
} else if (a == saturation) {
|
||||||
|
listener->panelChanged(EvDehazeSaturation, a->getTextValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Dehaze::enabledChanged ()
|
void Dehaze::enabledChanged ()
|
||||||
{
|
{
|
||||||
if (listener) {
|
if (listener) {
|
||||||
@ -140,7 +141,6 @@ void Dehaze::enabledChanged ()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Dehaze::showDepthMapChanged()
|
void Dehaze::showDepthMapChanged()
|
||||||
{
|
{
|
||||||
if (listener) {
|
if (listener) {
|
||||||
@ -148,13 +148,6 @@ void Dehaze::showDepthMapChanged()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Dehaze::luminanceChanged()
|
|
||||||
{
|
|
||||||
if (listener) {
|
|
||||||
listener->panelChanged(EvDehazeLuminance, luminance->get_active() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Dehaze::setBatchMode(bool batchMode)
|
void Dehaze::setBatchMode(bool batchMode)
|
||||||
{
|
{
|
||||||
ToolPanel::setBatchMode(batchMode);
|
ToolPanel::setBatchMode(batchMode);
|
||||||
@ -163,9 +156,7 @@ void Dehaze::setBatchMode(bool batchMode)
|
|||||||
depth->showEditedCB();
|
depth->showEditedCB();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Dehaze::setAdjusterBehavior(bool strengthAdd)
|
void Dehaze::setAdjusterBehavior(bool strengthAdd)
|
||||||
{
|
{
|
||||||
strength->setAddMode(strengthAdd);
|
strength->setAddMode(strengthAdd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,14 +28,15 @@ class Dehaze final : public ToolParamBlock, public AdjusterListener, public Fold
|
|||||||
private:
|
private:
|
||||||
Adjuster *strength;
|
Adjuster *strength;
|
||||||
Adjuster *depth;
|
Adjuster *depth;
|
||||||
|
Adjuster *saturation;
|
||||||
Gtk::CheckButton *showDepthMap;
|
Gtk::CheckButton *showDepthMap;
|
||||||
Gtk::CheckButton *luminance;
|
// Gtk::CheckButton *luminance;
|
||||||
|
|
||||||
rtengine::ProcEvent EvDehazeEnabled;
|
rtengine::ProcEvent EvDehazeEnabled;
|
||||||
rtengine::ProcEvent EvDehazeStrength;
|
rtengine::ProcEvent EvDehazeStrength;
|
||||||
rtengine::ProcEvent EvDehazeDepth;
|
rtengine::ProcEvent EvDehazeDepth;
|
||||||
rtengine::ProcEvent EvDehazeShowDepthMap;
|
rtengine::ProcEvent EvDehazeShowDepthMap;
|
||||||
rtengine::ProcEvent EvDehazeLuminance;
|
rtengine::ProcEvent EvDehazeSaturation;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -49,7 +50,7 @@ public:
|
|||||||
void adjusterChanged(Adjuster *a, double newval) override;
|
void adjusterChanged(Adjuster *a, double newval) override;
|
||||||
void enabledChanged() override;
|
void enabledChanged() override;
|
||||||
void showDepthMapChanged();
|
void showDepthMapChanged();
|
||||||
void luminanceChanged();
|
// void luminanceChanged();
|
||||||
void setAdjusterBehavior(bool strengthAdd);
|
void setAdjusterBehavior(bool strengthAdd);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -670,7 +670,7 @@ void ParamsEdited::set(bool v)
|
|||||||
dehaze.strength = v;
|
dehaze.strength = v;
|
||||||
dehaze.showDepthMap = v;
|
dehaze.showDepthMap = v;
|
||||||
dehaze.depth = v;
|
dehaze.depth = v;
|
||||||
dehaze.luminance = v;
|
dehaze.saturation = v;
|
||||||
metadata.mode = v;
|
metadata.mode = v;
|
||||||
filmNegative.enabled = v;
|
filmNegative.enabled = v;
|
||||||
filmNegative.redRatio = v;
|
filmNegative.redRatio = v;
|
||||||
@ -1834,7 +1834,7 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
|
|||||||
dehaze.strength = dehaze.strength && p.dehaze.strength == other.dehaze.strength;
|
dehaze.strength = dehaze.strength && p.dehaze.strength == other.dehaze.strength;
|
||||||
dehaze.showDepthMap = dehaze.showDepthMap && p.dehaze.showDepthMap == other.dehaze.showDepthMap;
|
dehaze.showDepthMap = dehaze.showDepthMap && p.dehaze.showDepthMap == other.dehaze.showDepthMap;
|
||||||
dehaze.depth = dehaze.depth && p.dehaze.depth == other.dehaze.depth;
|
dehaze.depth = dehaze.depth && p.dehaze.depth == other.dehaze.depth;
|
||||||
dehaze.luminance = dehaze.luminance && p.dehaze.luminance == other.dehaze.luminance;
|
dehaze.saturation = dehaze.saturation && p.dehaze.saturation == other.dehaze.saturation;
|
||||||
metadata.mode = metadata.mode && p.metadata.mode == other.metadata.mode;
|
metadata.mode = metadata.mode && p.metadata.mode == other.metadata.mode;
|
||||||
filmNegative.enabled = filmNegative.enabled && p.filmNegative.enabled == other.filmNegative.enabled;
|
filmNegative.enabled = filmNegative.enabled && p.filmNegative.enabled == other.filmNegative.enabled;
|
||||||
filmNegative.redRatio = filmNegative.redRatio && p.filmNegative.redRatio == other.filmNegative.redRatio;
|
filmNegative.redRatio = filmNegative.redRatio && p.filmNegative.redRatio == other.filmNegative.redRatio;
|
||||||
@ -6113,8 +6113,8 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
|
|||||||
toEdit.dehaze.showDepthMap = mods.dehaze.showDepthMap;
|
toEdit.dehaze.showDepthMap = mods.dehaze.showDepthMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dehaze.luminance) {
|
if (dehaze.saturation) {
|
||||||
toEdit.dehaze.luminance = mods.dehaze.luminance;
|
toEdit.dehaze.saturation = mods.dehaze.saturation;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (metadata.mode) {
|
if (metadata.mode) {
|
||||||
|
@ -1183,7 +1183,7 @@ struct DehazeParamsEdited {
|
|||||||
bool strength;
|
bool strength;
|
||||||
bool showDepthMap;
|
bool showDepthMap;
|
||||||
bool depth;
|
bool depth;
|
||||||
bool luminance;
|
bool saturation;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RAWParamsEdited {
|
struct RAWParamsEdited {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user