Enhancement to Auto Levels on behalf of Emil;

Replacements of the packaged profiles.
(see issue 940)
This commit is contained in:
michael
2011-11-18 17:28:44 -05:00
parent aed48b2d2f
commit b22a8a8e0e
25 changed files with 584 additions and 1182 deletions

View File

@@ -2,6 +2,7 @@
#define _PPVERSION_
// This number have to be incremented whenever the PP3 file format is modified
#define PPVERSION 300
#define PPVERSION 301
#define PPVERSION_AEXP 301 //value of PPVERSION when auto exposure algorithm was modified
#endif

View File

@@ -20,6 +20,7 @@
#include <adjuster.h>
#include <sigc++/class_slot.h>
#include <iomanip>
#include "ppversion.h"
using namespace rtengine;
using namespace rtengine::procparams;
@@ -207,7 +208,7 @@ void ToneCurve::curveChanged () {
void ToneCurve::adjusterChanged (Adjuster* a, double newval) {
// Switch off auto exposure if user changes sliders manually
if (autolevels->get_active() && (a==expcomp || a==black)) {
if (autolevels->get_active() && (a==expcomp || a==brightness || a==contrast || a==black || a==hlcompr || a==hlcomprthresh)) {
autolevels->set_active (false);
autolevels->set_inconsistent (false);
}
@@ -264,11 +265,23 @@ void ToneCurve::autolevels_toggled () {
if (batchMode) {
expcomp->setEditedState (UnEdited);
brightness->setEditedState (UnEdited);
contrast->setEditedState (UnEdited);
black->setEditedState (UnEdited);
hlcompr->setEditedState (UnEdited);
hlcomprthresh->setEditedState (UnEdited);
if (expcomp->getAddMode())
expcomp->setValue (0);
if (black->getAddMode())
if (brightness->getAddMode())
brightness->setValue (0);
if (contrast->getAddMode())
contrast->setValue (0);
if (black->getAddMode())
black->setValue (0);
if (hlcompr->getAddMode())
hlcompr->setValue (0);
if (hlcomprthresh->getAddMode())
hlcomprthresh->setValue (0);
listener->panelChanged (EvAutoExp, M("GENERAL_ENABLED"));
}
}
@@ -295,6 +308,7 @@ void ToneCurve::waitForAutoExp () {
sclip->set_sensitive (false);
expcomp->setEnabled (false);
brightness->setEnabled (false);
contrast->setEnabled (false);
black->setEnabled (false);
hlcompr->setEnabled (false);
hlcomprthresh->setEnabled (false);
@@ -309,10 +323,14 @@ int autoExpChangedUI (void* data) {
return 0;
}
void ToneCurve::autoExpChanged (double expcomp, int black) {
void ToneCurve::autoExpChanged (double expcomp, int bright, int contr, int black, int hlcompr, int hlcomprthresh) {
nextBlack = black;
nextExpcomp = expcomp;
nextBrightness = bright;
nextContrast = contr;
nextHlcompr = hlcompr;
nextHlcomprthresh = hlcomprthresh;
g_idle_add (autoExpChangedUI, this);
// Glib::signal_idle().connect (sigc::mem_fun(*this, &ToneCurve::autoExpComputed_));
@@ -337,7 +355,11 @@ bool ToneCurve::autoExpComputed_ () {
disableListener ();
enableAll ();
expcomp->setValue (nextExpcomp);
brightness->setValue (nextBrightness);
contrast->setValue (nextContrast);
black->setValue (nextBlack);
hlcompr->setValue (nextHlcompr);
hlcomprthresh->setValue (nextHlcomprthresh);
if (!black->getAddMode()) shcompr->set_sensitive(!((int)black->getValue ()==0)); //at black=0 shcompr value has no effect
enableListener ();

View File

@@ -49,7 +49,11 @@ class ToneCurve : public Gtk::VBox, public AdjusterListener, public FoldableTool
// used temporarily in eventing
double nextExpcomp;
int nextBrightness;
int nextContrast;
int nextBlack;
int nextHlcompr;
int nextHlcomprthresh;
public:
@@ -68,7 +72,7 @@ class ToneCurve : public Gtk::VBox, public AdjusterListener, public FoldableTool
void clip_changed ();
bool clip_changed_ ();
void waitForAutoExp ();
void autoExpChanged (double br, int bl);
void autoExpChanged (double expcomp, int bright, int contr, int black, int hlcompr, int hlcomprthresh);
bool autoExpComputed_ ();
void enableAll ();
void curveChanged ();