allow translation of demosaic methods; hide Sub-Image selector for files with onyl 1 raw file; ...

This commit is contained in:
heckflosse
2017-03-22 14:13:51 +01:00
parent a7511f754e
commit 9bb5164cce
18 changed files with 149 additions and 56 deletions

View File

@@ -30,7 +30,7 @@ BayerProcess::BayerProcess () : FoldableToolPanel(this, "bayerprocess", M("TP_RA
method = Gtk::manage (new MyComboBoxText ());
for( size_t i = 0; i < procparams::RAWParams::BayerSensor::numMethods; i++) {
method->append(procparams::RAWParams::BayerSensor::methodstring[i]);
method->append(M("TP_RAW_" + Glib::ustring(procparams::RAWParams::BayerSensor::methodstring[i]).uppercase()));
}
method->set_active(0);
@@ -397,7 +397,7 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params
pixelShiftNonGreenCross2->setValue (pp->raw.bayersensor.pixelShiftNonGreenCross2);
pixelShiftNonGreenAmaze->setValue (pp->raw.bayersensor.pixelShiftNonGreenAmaze);
pixelShiftMotion->setValue (pp->raw.bayersensor.pixelShiftMotion);
pixelShiftMotionCorrection->setValue ((int)pp->raw.bayersensor.pixelShiftMotionCorrection);
pixelShiftMotionCorrection->set_active ((int)pp->raw.bayersensor.pixelShiftMotionCorrection);
if (!batchMode) {
pixelShiftHoleFill->set_sensitive (pixelShiftAutomatic->getValue () != CheckValue::off && pixelShiftMotionCorrection->get_active_row_number() == 5);
pixelShiftBlur->set_sensitive(pixelShiftAutomatic->getValue () != CheckValue::off && pixelShiftMotionCorrection->get_active_row_number() == 5);
@@ -850,7 +850,7 @@ void BayerProcess::checkBoxToggled (CheckBox* c, CheckValue newval)
#ifdef PIXELSHIFTDEV
else if (c == pixelShiftAutomatic) {
if (!batchMode) {
pixelShiftMotion->set_sensitive(!newval != CheckValue::off);
pixelShiftMotion->set_sensitive(newval != CheckValue::off);
pixelShiftEperIso->set_sensitive(newval != CheckValue::off);
pixelShiftNreadIso->set_sensitive(newval != CheckValue::off);
pixelShiftPrnu->set_sensitive(newval != CheckValue::off);
@@ -925,3 +925,24 @@ void BayerProcess::pixelShiftMotionMethodChanged ()
listener->panelChanged (EvPixelShiftMotionMethod, pixelShiftMotionMethod->get_active_text());
}
}
void BayerProcess::FrameCountChanged(int n, int frameNum)
{
GThreadLock lock;
imageNumber->block (true);
imageNumber->remove_all();
imageNumber->append("1");
for(int i = 2; i <= std::min(n, 4); ++i) {
std::ostringstream entry;
entry << i;
imageNumber->append(entry.str());
}
imageNumber->set_active(std::min(frameNum, n - 1));
if(n == 1) {
imageNumberBox->hide();
} else {
imageNumberBox->show();
}
imageNumber->block (false);
}

View File

@@ -25,8 +25,7 @@
#include "guiutils.h"
#include "toolpanel.h"
class BayerProcess : public ToolParamBlock, public AdjusterListener, public CheckBoxListener, public FoldableToolPanel
class BayerProcess : public ToolParamBlock, public AdjusterListener, public CheckBoxListener, public FoldableToolPanel, public rtengine::FrameCountListener
{
protected:
@@ -88,6 +87,7 @@ public:
void adjusterChanged (Adjuster* a, double newval);
void checkBoxToggled (CheckBox* c, CheckValue newval);
void pixelShiftMotionMethodChanged();
void FrameCountChanged(int n, int frameNum);
#ifdef PIXELSHIFTDEV
void psMotionCorrectionChanged ();
#endif

View File

@@ -58,7 +58,6 @@ Defringe::Defringe () : FoldableToolPanel(this, "defringe", M("TP_DEFRINGE_LABEL
pack_start (*curveEditorPF, Gtk::PACK_SHRINK, 4);
show ();
}
Defringe::~Defringe ()

View File

@@ -48,8 +48,6 @@ SharpenEdge::SharpenEdge () : FoldableToolPanel(this, "sharpenedge", M("TP_SHARP
pack_start( *amount, Gtk::PACK_SHRINK, 0);//amount
pack_start( *threechannels, Gtk::PACK_SHRINK, 0);//one or 3 channels Lab
show ();
chanthreeconn = threechannels->signal_toggled().connect( sigc::mem_fun(*this, &SharpenEdge::chanthree_toggled) );
}

View File

@@ -53,8 +53,6 @@ SharpenMicro::SharpenMicro () : FoldableToolPanel(this, "sharpenmicro", M("TP_SH
pack_start( *amount, Gtk::PACK_SHRINK, 0);
pack_start( *uniformity, Gtk::PACK_SHRINK, 0);
show ();
matrixconn = matrix->signal_toggled().connect( sigc::mem_fun(*this, &SharpenMicro::matrix_toggled) );
}

View File

@@ -160,6 +160,18 @@ public:
exp->set_expanded( expanded );
}
}
void hide() {
if (exp && !batchMode) { // conditional hide
exp->hide();
}
}
void show() {
if (exp) { // always show
exp->show();
}
}
bool getExpanded ()
{
if (exp) {

View File

@@ -309,6 +309,25 @@ ToolPanelCoordinator::~ToolPanelCoordinator ()
delete toolBar;
}
void ToolPanelCoordinator::imageTypeChanged(bool isRaw, bool isBayer, bool isXtrans)
{
if(isRaw) {
rawPanelSW->set_sensitive(true);
if (isBayer) {
sensorxtrans->FoldableToolPanel::hide();
sensorbayer->FoldableToolPanel::show();
} else if (isXtrans) {
sensorxtrans->FoldableToolPanel::show();
sensorbayer->FoldableToolPanel::hide();
}
} else {
rawPanelSW->set_sensitive(false);
}
}
void ToolPanelCoordinator::panelChanged (rtengine::ProcEvent event, const Glib::ustring& descr)
{
@@ -488,14 +507,15 @@ void ToolPanelCoordinator::initImage (rtengine::StagedImageProcessor* ipc_, bool
ipc->setAutoExpListener (toneCurve);
ipc->setAutoCamListener (colorappearance);
ipc->setAutoBWListener (blackwhite);
ipc->setFrameCountListener (bayerprocess);
ipc->setAutoWBListener (whitebalance);
ipc->setAutoColorTonListener (colortoning);
ipc->setAutoChromaListener (dirpyrdenoise);
ipc->setWaveletListener (wavelet);
ipc->setRetinexListener (retinex);
ipc->setSizeListener (crop);
ipc->setSizeListener (resize);
ipc->setImageTypeListener (this);
}
flatfield->setShortcutPath(Glib::path_get_dirname(ipc->getInitialImage()->getFileName()));

View File

@@ -92,7 +92,8 @@ class ToolPanelCoordinator : public ToolPanelListener,
public SpotWBListener,
public CropPanelListener,
public ICMPanelListener,
public ImageAreaToolListener
public ImageAreaToolListener,
public rtengine::ImageTypeListener
{
protected:
@@ -229,6 +230,7 @@ public:
// toolpanellistener interface
void panelChanged (rtengine::ProcEvent event, const Glib::ustring& descr);
void imageTypeChanged(bool isRaw, bool isBayer, bool isXtrans);
// profilechangelistener interface
void profileChange (const rtengine::procparams::PartialProfile* nparams, rtengine::ProcEvent event, const Glib::ustring& descr, const ParamsEdited* paramsEdited = nullptr);
void setDefaults (rtengine::procparams::ProcParams* defparams);

View File

@@ -77,8 +77,6 @@ Vibrance::Vibrance () : FoldableToolPanel(this, "vibrance", M("TP_VIBRANCE_LABEL
pack_start (*curveEditorGG, Gtk::PACK_SHRINK, 4);
show ();
pskinsconn = protectSkins->signal_toggled().connect( sigc::mem_fun(*this, &Vibrance::protectskins_toggled) );
ashiftconn = avoidColorShift->signal_toggled().connect( sigc::mem_fun(*this, &Vibrance::avoidcolorshift_toggled) );
pastsattogconn = pastSatTog->signal_toggled().connect( sigc::mem_fun(*this, &Vibrance::pastsattog_toggled) );