Improve mask preview and avoid reprocessing when switching spot

Changes:
- Mask preview has been improved. It only applies on detailed image now
("dcrop" pipeline) which corrects unexpected behavior on navigator
image. Mask preview now only applies on selected spot: when switching
between spots, mask preview is deactivated on newly selected spot.
- Image reprocessing is now avoided when switching between spots (except
if mask preview was previously activated). Mask background update
remains functionnal.

Bugfixe:
- AStyle runned on several modified files
This commit is contained in:
Pandagrapher
2019-08-21 13:40:28 +02:00
parent 53eeffbebf
commit 2080f65197
13 changed files with 273 additions and 147 deletions

View File

@@ -21,7 +21,6 @@
#include "locallabtools.h"
#include "options.h"
#include "multilangmgr.h"
#include "../rtengine/procparams.h"
#include "locallab.h"
@@ -207,7 +206,7 @@ void LocallabTool::resetMaskView()
}
}
void LocallabTool::refChanged(double huer, double lumar, double chromar)
void LocallabTool::refChanged(const double huer, const double lumar, const double chromar)
{
if (useMask) {
// Hue reference normalization (between 0 and 1)
@@ -507,6 +506,18 @@ LocallabColor::~LocallabColor()
delete HCurveEditorG;
}
void LocallabColor::setListener(ToolPanelListener* tpl)
{
LocallabTool::setListener(tpl);
labgrid->setListener(tpl);
}
void LocallabColor::getMaskView(int &colorMask, int &expMask, int &shMask, int &softMask, int &tmMask, int &retiMask, int &cbMask)
{
colorMask = showMaskMethod->get_active_row_number();
}
void LocallabColor::colorForValue(double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller)
{
LocallabTool::colorForValue(valX, valY, elemType, callerId, caller); // Mask curves
@@ -528,13 +539,6 @@ void LocallabColor::colorForValue(double valX, double valY, enum ColorCaller::El
}
}
void LocallabColor::setListener(ToolPanelListener* tpl)
{
LocallabTool::setListener(tpl);
labgrid->setListener(tpl);
}
void LocallabColor::disableListener()
{
LocallabTool::disableListener();
@@ -895,7 +899,7 @@ void LocallabColor::showMaskMethodChanged()
}
if (listener) {
listener->panelChanged(EvlocallabshowmaskcolMethod, ""); // TODO Use generic event for mask preview
listener->panelChanged(EvlocallabshowmaskMethod, "");
}
}
@@ -1109,6 +1113,11 @@ LocallabExposure::~LocallabExposure()
delete curveEditorG;
}
void LocallabExposure::getMaskView(int &colorMask, int &expMask, int &shMask, int &softMask, int &tmMask, int &retiMask, int &cbMask)
{
expMask = showMaskMethod->get_active_row_number();
}
void LocallabExposure::disableListener()
{
LocallabTool::disableListener();
@@ -1485,7 +1494,7 @@ void LocallabExposure::showMaskMethodChanged()
}
if (listener) {
listener->panelChanged(EvlocallabshowmaskexpMethod, ""); // TODO Use generic event for mask preview
listener->panelChanged(EvlocallabshowmaskMethod, "");
}
}
@@ -1612,6 +1621,11 @@ LocallabShadow::LocallabShadow():
pack_start(*inverssh);
}
void LocallabShadow::getMaskView(int &colorMask, int &expMask, int &shMask, int &softMask, int &tmMask, int &retiMask, int &cbMask)
{
shMask = showMaskMethod->get_active_row_number();
}
void LocallabShadow::disableListener()
{
LocallabTool::disableListener();
@@ -1872,7 +1886,7 @@ void LocallabShadow::showMaskMethodChanged()
}
if (listener) {
listener->panelChanged(EvlocallabshowmaskSHMethod, ""); // TODO Use generic event for mask preview
listener->panelChanged(EvlocallabshowmaskMethod, "");
}
}
@@ -2296,6 +2310,11 @@ LocallabSoft::LocallabSoft():
pack_start(*sensisf);
}
void LocallabSoft::getMaskView(int &colorMask, int &expMask, int &shMask, int &softMask, int &tmMask, int &retiMask, int &cbMask)
{
softMask = showmasksoftMethod->get_active_row_number();
}
void LocallabSoft::disableListener()
{
LocallabTool::disableListener();
@@ -2451,7 +2470,7 @@ void LocallabSoft::showmasksoftMethodChanged()
}
if (listener) {
listener->panelChanged(EvlocallabshowmasksoftMethod, ""); // TODO Use generic event for mask preview
listener->panelChanged(EvlocallabshowmaskMethod, "");
}
}