Merge branch 'dev' of https://github.com/Beep6581/RawTherapee into histogram-scaling

This commit is contained in:
Thanatomanic
2018-07-04 23:53:02 +02:00
42 changed files with 1175 additions and 807 deletions

View File

@@ -490,6 +490,7 @@ void FileCatalog::exifInfoButtonToggled()
}
fileBrowser->refreshThumbImages ();
refreshHeight();
}
void FileCatalog::on_realize()
@@ -1211,6 +1212,7 @@ void FileCatalog::developRequested (std::vector<FileBrowserEntry*> tbe, bool fas
params.resize.appliesTo = options.fastexport_resize_appliesTo;
params.resize.method = options.fastexport_resize_method;
params.resize.dataspec = options.fastexport_resize_dataspec;
params.resize.allowUpscaling = false;
}
rtengine::ProcessingJob* pjob = rtengine::ProcessingJob::create (fbe->filename, th->getType() == FT_Raw, params, fastmode && options.fastexport_use_fast_pipeline);

View File

@@ -377,6 +377,7 @@ void ParamsEdited::set (bool v)
resize.width = v;
resize.height = v;
resize.enabled = v;
resize.allowUpscaling = v;
icm.input = v;
icm.toneCurve = v;
icm.applyLookTable = v;
@@ -931,6 +932,7 @@ void ParamsEdited::initFrom (const std::vector<rtengine::procparams::ProcParams>
resize.width = resize.width && p.resize.width == other.resize.width;
resize.height = resize.height && p.resize.height == other.resize.height;
resize.enabled = resize.enabled && p.resize.enabled == other.resize.enabled;
resize.allowUpscaling = resize.allowUpscaling && p.resize.allowUpscaling == other.resize.allowUpscaling;
icm.input = icm.input && p.icm.input == other.icm.input;
icm.toneCurve = icm.toneCurve && p.icm.toneCurve == other.icm.toneCurve;
icm.applyLookTable = icm.applyLookTable && p.icm.applyLookTable == other.icm.applyLookTable;
@@ -2406,6 +2408,10 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
toEdit.resize.enabled = mods.resize.enabled;
}
if (resize.allowUpscaling) {
toEdit.resize.allowUpscaling = mods.resize.allowUpscaling;
}
if (icm.input) {
toEdit.icm.input = mods.icm.input;
}

View File

@@ -569,6 +569,7 @@ public:
bool width;
bool height;
bool enabled;
bool allowUpscaling;
};
class ColorManagementParamsEdited

View File

@@ -1,11 +1,13 @@
#pragma once
// This number has to be incremented whenever the PP3 file format is modified or the behaviour of a tool changes
#define PPVERSION 338
#define PPVERSION 339
#define PPVERSION_AEXP 301 //value of PPVERSION when auto exposure algorithm was modified
/*
Log of version changes
339 2018-07-04
added allowUpscaling to ResizeParams
338 2018-06-15
increased precision for the channel mixer
337 2018-06-13

View File

@@ -18,12 +18,15 @@
*/
#include "resize.h"
#include "guiutils.h"
#include "eventmapper.h"
using namespace rtengine;
using namespace rtengine::procparams;
Resize::Resize () : FoldableToolPanel(this, "resize", M("TP_RESIZE_LABEL"), false, true), maxw(100000), maxh(100000)
{
auto m = ProcEventMapper::getInstance();
EvResizeAllowUpscaling = m->newEvent(RESIZE, "HISTORY_MSG_RESIZE_ALLOW_UPSCALING");
cropw = 0;
croph = 0;
@@ -88,6 +91,11 @@ Resize::Resize () : FoldableToolPanel(this, "resize", M("TP_RESIZE_LABEL"), fals
sbox->pack_start (*hbox);
sizeBox->pack_start (*sbox, Gtk::PACK_SHRINK, 0);
allowUpscaling = Gtk::manage(new Gtk::CheckButton(M("TP_RESIZE_ALLOW_UPSCALING")));
sizeBox->pack_start(*allowUpscaling);
allowUpscaling->signal_toggled().connect(sigc::mem_fun(*this, &Resize::allowUpscalingChanged));
sizeBox->show_all ();
sizeBox->reference ();
@@ -137,6 +145,7 @@ void Resize::read (const ProcParams* pp, const ParamsEdited* pedited)
h->set_value (pp->resize.height);
setEnabled (pp->resize.enabled);
spec->set_active (pp->resize.dataspec);
allowUpscaling->set_active(pp->resize.allowUpscaling);
updateGUI();
appliesTo->set_active (0);
@@ -175,6 +184,7 @@ void Resize::read (const ProcParams* pp, const ParamsEdited* pedited)
spec->set_active (4);
}
allowUpscaling->set_inconsistent(!pedited->resize.allowUpscaling);
set_inconsistent (multiImage && !pedited->resize.enabled);
}
@@ -214,6 +224,8 @@ void Resize::write (ProcParams* pp, ParamsEdited* pedited)
pp->resize.enabled = getEnabled ();
//printf(" L:%d H:%d\n", pp->resize.width, pp->resize.height);
pp->resize.allowUpscaling = allowUpscaling->get_active();
if (pedited) {
pedited->resize.enabled = !get_inconsistent();
pedited->resize.dataspec = dataSpec != MAX_SCALE;
@@ -229,6 +241,7 @@ void Resize::write (ProcParams* pp, ParamsEdited* pedited)
pedited->resize.width = false;
pedited->resize.height = false;
}
pedited->resize.allowUpscaling = !allowUpscaling->get_inconsistent();
}
}
@@ -620,6 +633,22 @@ void Resize::enabledChanged ()
}
}
void Resize::allowUpscalingChanged()
{
if (listener) {
if (allowUpscaling->get_inconsistent()) {
listener->panelChanged(EvResizeAllowUpscaling, M("GENERAL_UNCHANGED"));
} else if (allowUpscaling->get_active()) {
listener->panelChanged(EvResizeAllowUpscaling, M("GENERAL_ENABLED"));
} else {
listener->panelChanged(EvResizeAllowUpscaling, M("GENERAL_DISABLED"));
}
}
}
void Resize::setAdjusterBehavior (bool scaleadd)
{

View File

@@ -66,7 +66,9 @@ private:
int getComputedHeight ();
void notifyBBox ();
void updateGUI ();
void allowUpscalingChanged();
rtengine::ProcEvent EvResizeAllowUpscaling;
Adjuster* scale;
Gtk::VBox* sizeBox;
MyComboBoxText* appliesTo;
@@ -74,6 +76,7 @@ private:
MyComboBoxText* spec;
MySpinButton* w;
MySpinButton* h;
Gtk::CheckButton *allowUpscaling;
int maxw, maxh;
int cropw, croph;
sigc::connection sconn, aconn, wconn, hconn;

View File

@@ -501,8 +501,8 @@ void ThumbBrowserBase::configScrollBars ()
vscroll.get_adjustment()->set_upper (inH);
hscroll.get_adjustment()->set_lower (0);
vscroll.get_adjustment()->set_lower (0);
hscroll.get_adjustment()->set_step_increment (32);
vscroll.get_adjustment()->set_step_increment (32);
hscroll.get_adjustment()->set_step_increment (!fd.empty() ? fd[0]->getEffectiveHeight() : 0);
vscroll.get_adjustment()->set_step_increment (!fd.empty() ? fd[0]->getEffectiveHeight() : 0);
hscroll.get_adjustment()->set_page_increment (iw);
vscroll.get_adjustment()->set_page_increment (ih);
hscroll.get_adjustment()->set_page_size (iw);
@@ -567,7 +567,7 @@ void ThumbBrowserBase::arrangeFiles()
MYREADERLOCK_RELEASE(l);
// This will require a Writer access
resizeThumbnailArea(currx, rowHeight);
resizeThumbnailArea(currx, !fd.empty() ? fd[0]->getEffectiveHeight() : rowHeight);
} else {
const int availWidth = internal.get_width();