Wavelet equalizer: added buttons C+,N,C-; some small fixes
This commit is contained in:
@@ -528,6 +528,9 @@ TP_DISTORTION_LABEL;Distortion
|
|||||||
TP_EQUALIZER_LABEL;Wavelet equalizer
|
TP_EQUALIZER_LABEL;Wavelet equalizer
|
||||||
TP_EQUALIZER_FINEST;finest
|
TP_EQUALIZER_FINEST;finest
|
||||||
TP_EQUALIZER_LARGEST;coarsest
|
TP_EQUALIZER_LARGEST;coarsest
|
||||||
|
TP_EQUALIZER_NEUTRAL;Neutral
|
||||||
|
TP_EQUALIZER_CONTRAST_PLUS;Contrast+
|
||||||
|
TP_EQUALIZER_CONTRAST_MINUS;Contrast-
|
||||||
TP_EXPOSURE_AUTOLEVELS;Auto Levels
|
TP_EXPOSURE_AUTOLEVELS;Auto Levels
|
||||||
TP_EXPOSURE_BLACKLEVEL;Black
|
TP_EXPOSURE_BLACKLEVEL;Black
|
||||||
TP_EXPOSURE_BRIGHTNESS;Brightness
|
TP_EXPOSURE_BRIGHTNESS;Brightness
|
||||||
|
@@ -530,6 +530,9 @@ TP_DISTORTION_LABEL;Distortion
|
|||||||
TP_EQUALIZER_LABEL;Wavelet equalizer
|
TP_EQUALIZER_LABEL;Wavelet equalizer
|
||||||
TP_EQUALIZER_FINEST;finest
|
TP_EQUALIZER_FINEST;finest
|
||||||
TP_EQUALIZER_LARGEST;coarsest
|
TP_EQUALIZER_LARGEST;coarsest
|
||||||
|
TP_EQUALIZER_NEUTRAL;Neutral
|
||||||
|
TP_EQUALIZER_CONTRAST_PLUS;Contrast+
|
||||||
|
TP_EQUALIZER_CONTRAST_MINUS;Contrast-
|
||||||
TP_EXPOSURE_AUTOLEVELS;Auto Levels
|
TP_EXPOSURE_AUTOLEVELS;Auto Levels
|
||||||
TP_EXPOSURE_BLACKLEVEL;Black
|
TP_EXPOSURE_BLACKLEVEL;Black
|
||||||
TP_EXPOSURE_BRIGHTNESS;Brightness
|
TP_EXPOSURE_BRIGHTNESS;Brightness
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include <wavelet_dec.h>
|
#include <wavelet_dec.h>
|
||||||
|
|
||||||
#include <iostream>
|
//#include <iostream>
|
||||||
|
|
||||||
namespace rtengine {
|
namespace rtengine {
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ void ImProcFunctions :: waveletEqualizer (LabImage * image, bool luminance, bool
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
clock_t start = clock();
|
//clock_t start = clock();
|
||||||
|
|
||||||
if (luminance) {
|
if (luminance) {
|
||||||
limiter<wavelet_decomposition::internal_type> l1(0, 65535);
|
limiter<wavelet_decomposition::internal_type> l1(0, 65535);
|
||||||
@@ -70,7 +70,7 @@ void ImProcFunctions :: waveletEqualizer (LabImage * image, bool luminance, bool
|
|||||||
b.reconstruct(image->b, params->equalizer.c, l2);
|
b.reconstruct(image->b, params->equalizer.c, l2);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "Wavelets done in " << (double)(clock() - start) / CLOCKS_PER_SEC << std::endl;
|
//std::cout << "Wavelets done in " << (double)(clock() - start) / CLOCKS_PER_SEC << std::endl;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -157,7 +157,7 @@ void wavelet_level<T>::dwt_2d(size_t w, size_t h)
|
|||||||
dwt_53(&m_coeffs[0][i], m_pitch, buffer, h);
|
dwt_53(&m_coeffs[0][i], m_pitch, buffer, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete buffer;
|
delete[] buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
@@ -177,7 +177,7 @@ void wavelet_level<T>::idwt_2d(size_t w, size_t h, int alpha)
|
|||||||
idwt_53(&m_coeffs[0][i], m_pitch, buffer, h, alpha);
|
idwt_53(&m_coeffs[0][i], m_pitch, buffer, h, alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete buffer;
|
delete[] buffer;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -20,8 +20,8 @@
|
|||||||
#define _COLORBOOST_H_
|
#define _COLORBOOST_H_
|
||||||
|
|
||||||
#include <gtkmm.h>
|
#include <gtkmm.h>
|
||||||
#include "adjuster.h"
|
#include <adjuster.h>
|
||||||
#include "toolpanel.h"
|
#include <toolpanel.h>
|
||||||
|
|
||||||
class ColorBoost : public Gtk::VBox, public AdjusterListener, public ToolPanel {
|
class ColorBoost : public Gtk::VBox, public AdjusterListener, public ToolPanel {
|
||||||
|
|
||||||
|
@@ -27,11 +27,30 @@ Equalizer::Equalizer () : ToolPanel() {
|
|||||||
enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED")));
|
enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED")));
|
||||||
enabled->set_active (true);
|
enabled->set_active (true);
|
||||||
pack_start(*enabled);
|
pack_start(*enabled);
|
||||||
enabled->show();
|
enaConn = enabled->signal_toggled().connect( sigc::mem_fun(*this, &Equalizer::enabledToggled) );
|
||||||
enaConn = enabled->signal_toggled().connect( sigc::mem_fun(*this, &Equalizer::enabled_toggled) );
|
|
||||||
|
|
||||||
Gtk::HSeparator *separator = Gtk::manage (new Gtk::HSeparator());
|
Gtk::HSeparator *separator1 = Gtk::manage (new Gtk::HSeparator());
|
||||||
pack_start(*separator, Gtk::PACK_SHRINK, 2);
|
pack_start(*separator1, Gtk::PACK_SHRINK, 2);
|
||||||
|
|
||||||
|
Gtk::HBox * buttonBox = Gtk::manage (new Gtk::HBox());
|
||||||
|
pack_start(*buttonBox, Gtk::PACK_SHRINK, 2);
|
||||||
|
|
||||||
|
Gtk::Button * contrastMinusButton = Gtk::manage (new Gtk::Button(M("TP_EQUALIZER_CONTRAST_MINUS")));
|
||||||
|
buttonBox->pack_start(*contrastMinusButton, Gtk::PACK_SHRINK, 2);
|
||||||
|
contrastMinusPressedConn = contrastMinusButton->signal_pressed().connect( sigc::mem_fun(*this, &Equalizer::contrastMinusPressed));
|
||||||
|
|
||||||
|
Gtk::Button * neutralButton = Gtk::manage (new Gtk::Button(M("TP_EQUALIZER_NEUTRAL")));
|
||||||
|
buttonBox->pack_start(*neutralButton, Gtk::PACK_SHRINK, 2);
|
||||||
|
neutralPressedConn = neutralButton->signal_pressed().connect( sigc::mem_fun(*this, &Equalizer::neutralPressed));
|
||||||
|
|
||||||
|
Gtk::Button * contrastPlusButton = Gtk::manage (new Gtk::Button(M("TP_EQUALIZER_CONTRAST_PLUS")));
|
||||||
|
buttonBox->pack_start(*contrastPlusButton, Gtk::PACK_SHRINK, 2);
|
||||||
|
contrastPlusPressedConn = contrastPlusButton->signal_pressed().connect( sigc::mem_fun(*this, &Equalizer::contrastPlusPressed));
|
||||||
|
|
||||||
|
buttonBox->show_all_children();
|
||||||
|
|
||||||
|
Gtk::HSeparator *separator2 = Gtk::manage (new Gtk::HSeparator());
|
||||||
|
pack_start(*separator2, Gtk::PACK_SHRINK, 2);
|
||||||
|
|
||||||
for(int i = 0; i < 8; i++)
|
for(int i = 0; i < 8; i++)
|
||||||
{
|
{
|
||||||
@@ -141,7 +160,7 @@ void Equalizer::adjusterChanged (Adjuster* a, double newval) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Equalizer::enabled_toggled () {
|
void Equalizer::enabledToggled () {
|
||||||
|
|
||||||
if (batchMode) {
|
if (batchMode) {
|
||||||
if (enabled->get_inconsistent()) {
|
if (enabled->get_inconsistent()) {
|
||||||
@@ -165,3 +184,31 @@ void Equalizer::enabled_toggled () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Equalizer::neutralPressed () {
|
||||||
|
|
||||||
|
for (int i = 0; i < 8; i++) {
|
||||||
|
correction[i]->setValue(0);
|
||||||
|
adjusterChanged(correction[i], 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Equalizer::contrastPlusPressed () {
|
||||||
|
|
||||||
|
for (int i = 0; i < 8; i++) {
|
||||||
|
int inc = 1 * (8 - i);
|
||||||
|
correction[i]->setValue(correction[i]->getValue() + inc);
|
||||||
|
adjusterChanged(correction[i], correction[i]->getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Equalizer::contrastMinusPressed () {
|
||||||
|
|
||||||
|
for (int i = 0; i < 8; i++) {
|
||||||
|
int inc = -1 * (8 - i);
|
||||||
|
correction[i]->setValue(correction[i]->getValue() + inc);
|
||||||
|
adjusterChanged(correction[i], correction[i]->getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -17,8 +17,8 @@
|
|||||||
* 2010 Ilya Popov <ilia_popov@rambler.ru>
|
* 2010 Ilya Popov <ilia_popov@rambler.ru>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef EQUALIZE_H_INCLUDED
|
#ifndef EQUALIZER_H_INCLUDED
|
||||||
#define EQUALIZE_H_INCLUDED
|
#define EQUALIZER_H_INCLUDED
|
||||||
|
|
||||||
#include <gtkmm.h>
|
#include <gtkmm.h>
|
||||||
#include <adjuster.h>
|
#include <adjuster.h>
|
||||||
@@ -33,6 +33,9 @@ protected:
|
|||||||
Adjuster* correction[8];
|
Adjuster* correction[8];
|
||||||
|
|
||||||
sigc::connection enaConn;
|
sigc::connection enaConn;
|
||||||
|
sigc::connection neutralPressedConn;
|
||||||
|
sigc::connection contrastPlusPressedConn;
|
||||||
|
sigc::connection contrastMinusPressedConn;
|
||||||
|
|
||||||
bool lastEnabled;
|
bool lastEnabled;
|
||||||
|
|
||||||
@@ -47,7 +50,10 @@ public:
|
|||||||
void setBatchMode (bool batchMode);
|
void setBatchMode (bool batchMode);
|
||||||
|
|
||||||
void adjusterChanged (Adjuster* a, double newval);
|
void adjusterChanged (Adjuster* a, double newval);
|
||||||
void enabled_toggled ();
|
void enabledToggled ();
|
||||||
|
void neutralPressed ();
|
||||||
|
void contrastPlusPressed ();
|
||||||
|
void contrastMinusPressed ();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user