Restored color boost tool; fixed bug in simpleprocess.cc for saving output.

This commit is contained in:
Emil Martinec 2010-10-18 13:39:23 -05:00
parent adbb1ee7ab
commit af4a6534ef
5 changed files with 250 additions and 249 deletions

View File

@ -129,7 +129,7 @@ class CurveFactory {
public: public:
// static void updateCurve3 (int* curve, int* ohistogram, const std::vector<double>& cpoints, double defmul, double ecomp, int black, double hlcompr, double shcompr, double br, double contr, double gamma_, bool igamma, int skip=1); // static void updateCurve3 (int* curve, int* ohistogram, const std::vector<double>& cpoints, double defmul, double ecomp, int black, double hlcompr, double shcompr, double br, double contr, double gamma_, bool igamma, int skip=1);
static void complexCurve (double ecomp, double black, double hlcompr, double shcompr, double br, double contr, double defmul, double gamma_, bool igamma, const std::vector<double>& curvePoints, unsigned int* histogram, int* outCurve, unsigned int* outBeforeCCurveHistogram, int skip=1); static void complexCurve (double ecomp, double black, double hlcompr, double shcompr, double br, double contr, double defmul, double gamma_, bool igamma, const std::vector<double>& curvePoints, unsigned int* histogram, int* outCurve, unsigned int* outBeforeCCurveHistogram, int skip=1);
static void complexsgnCurve (double satclip, double satcompr, double saturation, double colormult, const std::vector<double>& curvePoints, int* outCurve, int skip); static void complexsgnCurve (double satclip, double satcompr, double saturation, double colormult, const std::vector<double>& curvePoints, int* outCurve, int skip=1);
}; };

View File

@ -167,7 +167,7 @@ void Crop::update (int todo, bool internal) {
parent->ipf.chrominanceCurve (laboCrop, labnCrop, 0, parent->chroma_acurve, 0, croph); parent->ipf.chrominanceCurve (laboCrop, labnCrop, 0, parent->chroma_acurve, 0, croph);
parent->ipf.chrominanceCurve (laboCrop, labnCrop, 1, parent->chroma_bcurve, 0, croph); parent->ipf.chrominanceCurve (laboCrop, labnCrop, 1, parent->chroma_bcurve, 0, croph);
//parent->ipf.colorCurve (laboCrop, labnCrop); parent->ipf.colorCurve (laboCrop, labnCrop);
if (skip==1) { if (skip==1) {
parent->ipf.impulsedenoise (labnCrop); parent->ipf.impulsedenoise (labnCrop);

View File

@ -216,9 +216,9 @@ void ImProcCoordinator::updatePreviewImage (int todo) {
readyphase++; readyphase++;
progress ("Applying Color Boost...",100*readyphase/numofphases); progress ("Applying Color Boost...",100*readyphase/numofphases);
//ipf.colorCurve (oprevl, nprevl);
ipf.chrominanceCurve (oprevl, nprevl, 0, chroma_acurve, 0, pH); ipf.chrominanceCurve (oprevl, nprevl, 0, chroma_acurve, 0, pH);
ipf.chrominanceCurve (oprevl, nprevl, 1, chroma_bcurve, 0, pH); ipf.chrominanceCurve (oprevl, nprevl, 1, chroma_bcurve, 0, pH);
ipf.colorCurve (nprevl, nprevl);
readyphase++; readyphase++;
if (scale==1) { if (scale==1) {

View File

@ -152,9 +152,9 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p
// luminance processing // luminance processing
CurveFactory::complexCurve (0.0, 0.0, 0.0, 0.0, params.labCurve.brightness, params.labCurve.contrast, 0.0, 0.0, false, params.labCurve.lcurve, hist16, curve, NULL); CurveFactory::complexCurve (0.0, 0.0, 0.0, 0.0, params.labCurve.brightness, params.labCurve.contrast, 0.0, 0.0, false, params.labCurve.lcurve, hist16, curve, NULL);
ipf.luminanceCurve (labView, labView, curve, 0, fh); ipf.luminanceCurve (labView, labView, curve, 0, fh);
CurveFactory::complexsgnCurve (0.0, 100.0, params.labCurve.saturation, 1.0, params.labCurve.acurve, curve, NULL); CurveFactory::complexsgnCurve (0.0, 100.0, params.labCurve.saturation, 1.0, params.labCurve.acurve, curve, 1);
ipf.chrominanceCurve (labView, labView, 0, curve, 0, fh); ipf.chrominanceCurve (labView, labView, 0, curve, 0, fh);
CurveFactory::complexsgnCurve (0.0, 100.0, params.labCurve.saturation, 1.0, params.labCurve.bcurve, curve, NULL); CurveFactory::complexsgnCurve (0.0, 100.0, params.labCurve.saturation, 1.0, params.labCurve.bcurve, curve, 1);
ipf.chrominanceCurve (labView, labView, 1, curve, 0, fh); ipf.chrominanceCurve (labView, labView, 1, curve, 0, fh);
ipf.impulsedenoise (labView); ipf.impulsedenoise (labView);

View File

@ -1,244 +1,245 @@
/*
* This file is part of RawTherapee. /*
* * This file is part of RawTherapee.
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com> *
* * Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
* RawTherapee is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * RawTherapee is free software: you can redistribute it and/or modify
* the Free Software Foundation, either version 3 of the License, or * it under the terms of the GNU General Public License as published by
* (at your option) any later version. * the Free Software Foundation, either version 3 of the License, or
* * (at your option) any later version.
* RawTherapee is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of * RawTherapee is distributed in the hope that it will be useful,
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * but WITHOUT ANY WARRANTY; without even the implied warranty of
* GNU General Public License for more details. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
* You should have received a copy of the GNU General Public License *
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>. * You should have received a copy of the GNU General Public License
*/ * along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
#include <filepanel.h> */
#include <rtwindow.h> #include <filepanel.h>
#include <rtwindow.h>
int fbinit (void* data) {
int fbinit (void* data) {
gdk_threads_enter ();
((FilePanel*)data)->init (); gdk_threads_enter ();
gdk_threads_leave (); ((FilePanel*)data)->init ();
gdk_threads_leave ();
return 0;
} return 0;
}
FilePanel::FilePanel () : parent(NULL) {
FilePanel::FilePanel () : parent(NULL) {
isloading = false;
dirpaned = new Gtk::HPaned (); isloading = false;
dirpaned->set_position (options.dirBrowserWidth); dirpaned = new Gtk::HPaned ();
dirpaned->set_position (options.dirBrowserWidth);
dirBrowser = new DirBrowser ();
placesBrowser = new PlacesBrowser (); dirBrowser = new DirBrowser ();
recentBrowser = new RecentBrowser (); placesBrowser = new PlacesBrowser ();
recentBrowser = new RecentBrowser ();
placespaned = new Gtk::VPaned ();
placespaned->set_size_request(50,100); placespaned = new Gtk::VPaned ();
placespaned->set_position (options.dirBrowserHeight); placespaned->set_size_request(50,100);
placespaned->set_position (options.dirBrowserHeight);
Gtk::VBox* obox = Gtk::manage (new Gtk::VBox ());
obox->pack_start (*recentBrowser, Gtk::PACK_SHRINK, 4); Gtk::VBox* obox = Gtk::manage (new Gtk::VBox ());
obox->pack_start (*dirBrowser); obox->pack_start (*recentBrowser, Gtk::PACK_SHRINK, 4);
obox->pack_start (*dirBrowser);
placespaned->pack1 (*placesBrowser, false, true);
placespaned->pack2 (*obox, true, true); placespaned->pack1 (*placesBrowser, false, true);
placespaned->pack2 (*obox, true, true);
dirpaned->pack1 (*placespaned, false, true);
dirpaned->pack1 (*placespaned, false, true);
tpc = new BatchToolPanelCoordinator (this);
fileCatalog = new FileCatalog (tpc->coarse, tpc->getToolBar()); tpc = new BatchToolPanelCoordinator (this);
ribbonPane = new Gtk::Paned(); fileCatalog = new FileCatalog (tpc->coarse, tpc->getToolBar());
ribbonPane->add(*fileCatalog); ribbonPane = new Gtk::Paned();
ribbonPane->set_size_request(50,150); ribbonPane->add(*fileCatalog);
dirpaned->pack2 (*ribbonPane, true, true); ribbonPane->set_size_request(50,150);
dirpaned->pack2 (*ribbonPane, true, true);
placesBrowser->setDirBrowserRemoteInterface (dirBrowser);
recentBrowser->setDirBrowserRemoteInterface (dirBrowser); placesBrowser->setDirBrowserRemoteInterface (dirBrowser);
dirBrowser->addDirSelectionListener (fileCatalog); recentBrowser->setDirBrowserRemoteInterface (dirBrowser);
dirBrowser->addDirSelectionListener (recentBrowser); dirBrowser->addDirSelectionListener (fileCatalog);
dirBrowser->addDirSelectionListener (placesBrowser); dirBrowser->addDirSelectionListener (recentBrowser);
fileCatalog->setFileSelectionListener (this); dirBrowser->addDirSelectionListener (placesBrowser);
fileCatalog->setFileSelectionListener (this);
rightBox = new Gtk::HBox ();
rightBox->set_size_request(50,100); rightBox = new Gtk::HBox ();
rightNotebook = new Gtk::Notebook (); rightBox->set_size_request(50,100);
Gtk::VBox* taggingBox = new Gtk::VBox (); rightNotebook = new Gtk::Notebook ();
Gtk::VBox* taggingBox = new Gtk::VBox ();
history = new History (false);
history = new History (false);
tpc->addPParamsChangeListener (history);
history->setProfileChangeListener (tpc); tpc->addPParamsChangeListener (history);
history->setProfileChangeListener (tpc);
Gtk::ScrolledWindow* sFilterPanel = new Gtk::ScrolledWindow();
filterPanel = new FilterPanel (); Gtk::ScrolledWindow* sFilterPanel = new Gtk::ScrolledWindow();
sFilterPanel->add (*filterPanel); filterPanel = new FilterPanel ();
sFilterPanel->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); sFilterPanel->add (*filterPanel);
sFilterPanel->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
fileCatalog->setFilterPanel (filterPanel);
fileCatalog->setImageAreaToolListener (tpc); fileCatalog->setFilterPanel (filterPanel);
fileCatalog->setImageAreaToolListener (tpc);
//------------------
//------------------
rightNotebook->set_tab_pos (Gtk::POS_LEFT);
rightNotebook->set_tab_pos (Gtk::POS_LEFT);
Gtk::Label* devLab = new Gtk::Label (M("MAIN_TAB_DEVELOP"));
devLab->set_angle (90); Gtk::Label* devLab = new Gtk::Label (M("MAIN_TAB_DEVELOP"));
Gtk::Label* filtLab = new Gtk::Label (M("MAIN_TAB_FILTER")); devLab->set_angle (90);
filtLab->set_angle (90); Gtk::Label* filtLab = new Gtk::Label (M("MAIN_TAB_FILTER"));
Gtk::Label* tagLab = new Gtk::Label (M("MAIN_TAB_TAGGING")); filtLab->set_angle (90);
tagLab->set_angle (90); Gtk::Label* tagLab = new Gtk::Label (M("MAIN_TAB_TAGGING"));
tagLab->set_angle (90);
tpcPaned = new Gtk::VPaned ();
tpcPaned->pack1 (*tpc->toolPanelNotebook, false, true); tpcPaned = new Gtk::VPaned ();
tpcPaned->pack2 (*history, true, true); tpcPaned->pack1 (*tpc->toolPanelNotebook, false, true);
tpcPaned->pack2 (*history, true, true);
rightNotebook->append_page (*tpcPaned, *devLab);
rightNotebook->append_page (*sFilterPanel, *filtLab); rightNotebook->append_page (*tpcPaned, *devLab);
rightNotebook->append_page (*taggingBox, *tagLab); rightNotebook->append_page (*sFilterPanel, *filtLab);
rightNotebook->append_page (*taggingBox, *tagLab);
rightBox->pack_start (*rightNotebook);
rightBox->pack_start (*rightNotebook);
pack1(*dirpaned, true, true);
pack2(*rightBox, false, true); pack1(*dirpaned, true, true);
pack2(*rightBox, false, true);
fileCatalog->setFileSelectionChangeListener (tpc);
fileCatalog->setFileSelectionChangeListener (tpc);
fileCatalog->setFileSelectionListener (this);
g_idle_add (fbinit, this); fileCatalog->setFileSelectionListener (this);
g_idle_add (fbinit, this);
show_all ();
} show_all ();
}
void FilePanel::setAspect () {
int winW, winH; void FilePanel::setAspect () {
parent->get_size(winW, winH); int winW, winH;
placespaned->set_position(options.dirBrowserHeight); parent->get_size(winW, winH);
dirpaned->set_position(options.dirBrowserWidth); placespaned->set_position(options.dirBrowserHeight);
tpcPaned->set_position(options.browserToolPanelHeight); dirpaned->set_position(options.dirBrowserWidth);
set_position(winW - options.browserToolPanelWidth); tpcPaned->set_position(options.browserToolPanelHeight);
} set_position(winW - options.browserToolPanelWidth);
}
void FilePanel::init () {
void FilePanel::init () {
dirBrowser->fillDirTree ();
placesBrowser->refreshPlacesList (); dirBrowser->fillDirTree ();
placesBrowser->refreshPlacesList ();
if (argv1!="")
dirBrowser->open (argv1); if (argv1!="")
else { dirBrowser->open (argv1);
if (options.startupDir==STARTUPDIR_HOME) else {
dirBrowser->open (Glib::get_home_dir()); if (options.startupDir==STARTUPDIR_HOME)
else if (options.startupDir==STARTUPDIR_CURRENT) dirBrowser->open (Glib::get_home_dir());
dirBrowser->open (argv0); else if (options.startupDir==STARTUPDIR_CURRENT)
else if (options.startupDir==STARTUPDIR_CUSTOM || options.startupDir==STARTUPDIR_LAST) dirBrowser->open (argv0);
dirBrowser->open (options.startupPath); else if (options.startupDir==STARTUPDIR_CUSTOM || options.startupDir==STARTUPDIR_LAST)
} dirBrowser->open (options.startupPath);
} }
}
bool FilePanel::fileSelected (Thumbnail* thm) {
bool FilePanel::fileSelected (Thumbnail* thm) {
if (!parent)
return false; if (!parent)
return false;
// try to open the file
// fileCatalog->setEnabled (false); // try to open the file
if (isloading) // fileCatalog->setEnabled (false);
return false; if (isloading)
return false;
isloading = true;
ProgressConnector<rtengine::InitialImage*> *ld = new ProgressConnector<rtengine::InitialImage*>(); isloading = true;
ld->startFunc (sigc::bind(sigc::ptr_fun(&rtengine::InitialImage::load), thm->getFileName (), thm->getType()==FT_Raw, &error, parent->getProgressListener()), ProgressConnector<rtengine::InitialImage*> *ld = new ProgressConnector<rtengine::InitialImage*>();
sigc::bind(sigc::mem_fun(*this,&FilePanel::imageLoaded), thm, ld) ); ld->startFunc (sigc::bind(sigc::ptr_fun(&rtengine::InitialImage::load), thm->getFileName (), thm->getType()==FT_Raw, &error, parent->getProgressListener()),
return true; sigc::bind(sigc::mem_fun(*this,&FilePanel::imageLoaded), thm, ld) );
} return true;
bool FilePanel::imageLoaded( Thumbnail* thm, ProgressConnector<rtengine::InitialImage*> *pc ){ }
bool FilePanel::imageLoaded( Thumbnail* thm, ProgressConnector<rtengine::InitialImage*> *pc ){
if (pc->returnValue() && thm) {
if (pc->returnValue() && thm) {
if (options.tabbedUI){
EditorPanel* epanel = Gtk::manage (new EditorPanel ()); if (options.tabbedUI){
parent->addEditorPanel (epanel,Glib::path_get_basename (thm->getFileName())); EditorPanel* epanel = Gtk::manage (new EditorPanel ());
epanel->open(thm, pc->returnValue() ); parent->addEditorPanel (epanel,Glib::path_get_basename (thm->getFileName()));
} epanel->open(thm, pc->returnValue() );
else{ }
parent->SetEditorCurrent(); else{
parent->epanel->open(thm, pc->returnValue() ); parent->SetEditorCurrent();
} parent->epanel->open(thm, pc->returnValue() );
}
}else {
Glib::ustring msg_ = Glib::ustring("<b>") + M("MAIN_MSG_CANNOTLOAD") + " \"" + thm->getFileName() + "\" .\n</b>"; }else {
Gtk::MessageDialog msgd (msg_, true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); Glib::ustring msg_ = Glib::ustring("<b>") + M("MAIN_MSG_CANNOTLOAD") + " \"" + thm->getFileName() + "\" .\n</b>";
msgd.run (); Gtk::MessageDialog msgd (msg_, true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
} msgd.run ();
delete pc; }
delete pc;
parent->setProgress(0.);
parent->setProgressStr(""); parent->setProgress(0.);
isloading = false; parent->setProgressStr("");
isloading = false;
return false; // MUST return false from idle function
} return false; // MUST return false from idle function
}
void FilePanel::saveOptions () {
void FilePanel::saveOptions () {
int winW, winH;
parent->get_size(winW, winH); int winW, winH;
options.dirBrowserWidth = dirpaned->get_position (); parent->get_size(winW, winH);
options.dirBrowserHeight = placespaned->get_position (); options.dirBrowserWidth = dirpaned->get_position ();
options.browserToolPanelWidth = winW - get_position(); options.dirBrowserHeight = placespaned->get_position ();
options.browserToolPanelHeight = tpcPaned->get_position (); options.browserToolPanelWidth = winW - get_position();
if (options.startupDir==STARTUPDIR_LAST && fileCatalog->lastSelectedDir ()!="") options.browserToolPanelHeight = tpcPaned->get_position ();
options.startupPath = fileCatalog->lastSelectedDir (); if (options.startupDir==STARTUPDIR_LAST && fileCatalog->lastSelectedDir ()!="")
fileCatalog->closeDir (); options.startupPath = fileCatalog->lastSelectedDir ();
} fileCatalog->closeDir ();
}
void FilePanel::open (const Glib::ustring& d) {
void FilePanel::open (const Glib::ustring& d) {
if (Glib::file_test (d, Glib::FILE_TEST_IS_DIR))
dirBrowser->open (d.c_str()); if (Glib::file_test (d, Glib::FILE_TEST_IS_DIR))
else if (Glib::file_test (d, Glib::FILE_TEST_EXISTS)) dirBrowser->open (d.c_str());
dirBrowser->open (Glib::path_get_dirname(d), Glib::path_get_basename(d)); else if (Glib::file_test (d, Glib::FILE_TEST_EXISTS))
} dirBrowser->open (Glib::path_get_dirname(d), Glib::path_get_basename(d));
}
bool FilePanel::addBatchQueueJob (BatchQueueEntry* bqe) {
bool FilePanel::addBatchQueueJob (BatchQueueEntry* bqe) {
if (parent)
parent->addBatchQueueJob (bqe); if (parent)
return true; parent->addBatchQueueJob (bqe);
} return true;
}
void FilePanel::optionsChanged () {
void FilePanel::optionsChanged () {
tpc->optionsChanged ();
fileCatalog->refreshAll (); tpc->optionsChanged ();
} fileCatalog->refreshAll ();
}
bool FilePanel::handleShortcutKey (GdkEventKey* event) {
bool FilePanel::handleShortcutKey (GdkEventKey* event) {
bool ctrl = event->state & GDK_CONTROL_MASK;
bool shift = event->state & GDK_SHIFT_MASK; bool ctrl = event->state & GDK_CONTROL_MASK;
bool shift = event->state & GDK_SHIFT_MASK;
if (!ctrl) {
switch(event->keyval) { if (!ctrl) {
} switch(event->keyval) {
} }
else { }
switch (event->keyval) { else {
} switch (event->keyval) {
} }
}
if(tpc->getToolBar()->handleShortcutKey(event))
return true; if(tpc->getToolBar()->handleShortcutKey(event))
return true;
if(fileCatalog->handleShortcutKey(event))
return true; if(fileCatalog->handleShortcutKey(event))
return true;
return false;
} return false;
}