From 3077b2492e99bbef558bbf750d39a3efc95f4d9b Mon Sep 17 00:00:00 2001 From: Oliver Duis Date: Thu, 21 Apr 2011 20:22:08 +0200 Subject: [PATCH] Naming cleanups. (No functional changes, prep for patch) --- rtengine/improccoordinator.cc | 44 +++++++++++++++++------------------ rtengine/improccoordinator.h | 2 +- rtengine/rtengine.h | 11 +++++---- rtgui/batchtoolpanelcoord.cc | 2 +- rtgui/editorpanel.cc | 6 ++--- rtgui/editorpanel.h | 2 +- rtgui/histogrampanel.h | 2 +- rtgui/toolpanelcoord.cc | 25 +++++++------------- rtgui/toolpanelcoord.h | 4 ++-- 9 files changed, 45 insertions(+), 53 deletions(-) diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index d1f2bd382..6a53b02c0 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -46,12 +46,12 @@ ImProcCoordinator::ImProcCoordinator () vhist16(65536); lhist16(65536); - rhist(65536); - ghist(65536); - bhist(256); - Lhist(256); - bcrgbhist(256); - bcLhist(256); + histRed(65536); + histGreen(65536); + histBlue(256); + histLuma(256); + histToneCurve(256); + histLCurve(256); bcabhist(256); } @@ -108,13 +108,16 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) { //rp.hotdeadpix_filt = false; rp.ccSteps = 0; } + progress ("Applying white balance, color correction & sRBG conversion...",100*readyphase/numofphases); if ( todo & M_PREPROC) imgsrc->preprocess( rp ); + if( todo & M_RAW){ fineDetailsProcessed = highDetailNeeded; imgsrc->demosaic( rp ); } + if (todo & M_INIT) { Glib::Mutex::Lock lock(minit); @@ -187,7 +190,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) { params.toneCurve.hlcompr, params.toneCurve.hlcomprthresh, \ params.toneCurve.shcompr, params.toneCurve.brightness, params.toneCurve.contrast, \ imgsrc->getGamma(), true, params.toneCurve.curve, \ - vhist16, hltonecurve, shtonecurve, tonecurve, bcrgbhist, scale==1 ? 1 : 1); + vhist16, hltonecurve, shtonecurve, tonecurve, histToneCurve, scale==1 ? 1 : 1); ipf.rgbProc (oprevi, oprevl, hltonecurve, shtonecurve, tonecurve, shmap, params.toneCurve.saturation); // compute L channel histogram @@ -199,12 +202,11 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) { readyphase++; if (todo & M_LUMACURVE) { - CurveFactory::complexLCurve (params.labCurve.brightness, params.labCurve.contrast, params.labCurve.lcurve, lhist16, lumacurve, bcLhist, scale==1 ? 1 : 16); + CurveFactory::complexLCurve (params.labCurve.brightness, params.labCurve.contrast, params.labCurve.lcurve, lhist16, lumacurve, histLCurve, scale==1 ? 1 : 16); CurveFactory::complexsgnCurve (params.labCurve.saturation, params.labCurve.enable_saturationlimiter, params.labCurve.saturationlimit, \ params.labCurve.acurve, params.labCurve.bcurve, chroma_acurve, chroma_bcurve, satcurve, scale==1 ? 1 : 16); } - if (todo & (M_LUMINANCE+M_COLOR) ) { progress ("Applying Luminance Curve...",100*readyphase/numofphases); ipf.luminanceCurve (oprevl, nprevl, lumacurve); @@ -235,8 +237,6 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) { //progress ("Wavelet...",100*readyphase/numofphases); //ipf.waveletEqualizer (nprevl, true, true); } - - } // process crop, if needed @@ -280,8 +280,8 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) { hx2 = MIN(pW,MAX(0,(params.crop.x+params.crop.w) / scale)); hy2 = MIN(pH,MAX(0,(params.crop.y+params.crop.h) / scale)); } - updateHistograms (hx1, hy1, hx2, hy2); - hListener->histogramChanged (rhist, ghist, bhist, Lhist, bcrgbhist, bcLhist); + updateHistograms (hx1, hy1, hx2, hy2); // just RGBL, not the tone curves + hListener->histogramChanged (histRed, histGreen, histBlue, histLuma, histToneCurve, histLCurve); } progress ("Ready",100*readyphase/numofphases); @@ -370,10 +370,9 @@ if (settings->verbose) printf ("setscale before lock\n"); void ImProcCoordinator::updateHistograms (int x1, int y1, int x2, int y2) { - rhist.clear(); - ghist.clear(); - bhist.clear(); - //memset (bcrgbhist, 0, 256*sizeof(int)); + histRed.clear(); + histGreen.clear(); + histBlue.clear(); for (int i=y1; idata[ofs++]; int b=workimg->data[ofs++]; - //bcrgbhist[(int)(0.299*r + 0.587*g + 0.114*b)]++; - rhist[r]++; - ghist[g]++; - bhist[b]++; + histRed[r]++; + histGreen[g]++; + histBlue[b]++; } } - Lhist.clear(); + histLuma.clear(); for (int i=y1; iL[i][j]/128)]++; + histLuma[(int)(nprevl->L[i][j]/128)]++; } /*for (int i=0; i<256; i++) { diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index a5f594039..5f1ef3c15 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -79,7 +79,7 @@ class ImProcCoordinator : public StagedImageProcessor { LUTu vhist16; LUTu lhist16; - LUTu rhist, ghist, bhist, Lhist, bcrgbhist, bcLhist, bcabhist; + LUTu histRed, histGreen, histBlue, histLuma, histToneCurve, histLCurve, bcabhist; int fw, fh, tr, fullw, fullh; int pW, pH; diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index 52fca7fd7..90dfd9d27 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -200,11 +200,12 @@ namespace rtengine { class HistogramListener { public: /** This member function is called when the histogram of the final image has changed. - * @param redh is the array of size 256 containing the histogram of the red channel - * @param greenh is the array of size 256 containing the histogram of the green channel - * @param blueh is the array of size 256 containing the histogram of the blue channel - * @param lumah is the array of size 256 containing the histogram of the luminance channel */ - virtual void histogramChanged (LUTu & redh, LUTu & greenh, LUTu & blueh, LUTu & lumah,LUTu & bcrgbhist,LUTu & bcLhist) {} + * @param histRed is the array of size 256 containing the histogram of the red channel + * @param histGreen is the array of size 256 containing the histogram of the green channel + * @param histBlue is the array of size 256 containing the histogram of the blue channel + * @param histLuma is the array of size 256 containing the histogram of the luminance channel + * other for curves backgrounds */ + virtual void histogramChanged (LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histToneCurve,LUTu & histLCurve) {} }; /** This listener is used when the auto exposure has been recomputed (e.g. when the clipping ratio changed). */ diff --git a/rtgui/batchtoolpanelcoord.cc b/rtgui/batchtoolpanelcoord.cc index d61d51532..48054e0a0 100644 --- a/rtgui/batchtoolpanelcoord.cc +++ b/rtgui/batchtoolpanelcoord.cc @@ -120,7 +120,7 @@ void BatchToolPanelCoordinator::initSession () { pparams = selected[0]->getProcParams (); coarse->initBatchBehavior (); - curve->setAdjusterBehavior (options.baBehav[ADDSET_TC_EXPCOMP], options.baBehav[ADDSET_TC_HLCOMPAMOUNT],options.baBehav[ADDSET_TC_HLCOMPTHRESH], options.baBehav[ADDSET_TC_BRIGHTNESS], options.baBehav[ADDSET_TC_BLACKLEVEL],options.baBehav[ADDSET_TC_SHCOMP], options.baBehav[ADDSET_TC_CONTRAST], options.baBehav[ADDSET_TC_SATURATION]); + toneCurve->setAdjusterBehavior (options.baBehav[ADDSET_TC_EXPCOMP], options.baBehav[ADDSET_TC_HLCOMPAMOUNT],options.baBehav[ADDSET_TC_HLCOMPTHRESH], options.baBehav[ADDSET_TC_BRIGHTNESS], options.baBehav[ADDSET_TC_BLACKLEVEL],options.baBehav[ADDSET_TC_SHCOMP], options.baBehav[ADDSET_TC_CONTRAST], options.baBehav[ADDSET_TC_SATURATION]); lcurve->setAdjusterBehavior (options.baBehav[ADDSET_LC_BRIGHTNESS], options.baBehav[ADDSET_LC_CONTRAST], options.baBehav[ADDSET_LC_SATURATION]); whitebalance->setAdjusterBehavior (options.baBehav[ADDSET_WB_TEMPERATURE], options.baBehav[ADDSET_WB_GREEN]); vignetting->setAdjusterBehavior (options.baBehav[ADDSET_VIGN_AMOUNT]); diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 5bbc7fdf4..aae885c0e 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -1287,10 +1287,10 @@ void EditorPanel::beforeAfterToggled () { } } -void EditorPanel::histogramChanged (LUTu & rh, LUTu & gh, LUTu & bh, LUTu & lh, LUTu & bcrgb, LUTu & bcl) { +void EditorPanel::histogramChanged (LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histToneCurve, LUTu & histLCurve) { - histogramPanel->histogramChanged (rh, gh, bh, lh); - tpc->updateCurveBackgroundHistogram (bcrgb, bcl); + histogramPanel->histogramChanged (histRed, histGreen, histBlue, histLuma); + tpc->updateCurveBackgroundHistogram (histToneCurve, histLCurve); } bool EditorPanel::CheckSidePanelsVisibility(){ diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index 270b004f0..e691d8a08 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -149,7 +149,7 @@ class EditorPanel : public Gtk::VBox, void historyBeforeLineChanged (const rtengine::procparams::ProcParams& params); // HistogramListener - void histogramChanged (LUTu & rh, LUTu & gh, LUTu & bh, LUTu & lh, LUTu & bcrgb, LUTu & bcl); + void histogramChanged (LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histToneCurve, LUTu & histLCurve); // event handlers void info_toggled (); diff --git a/rtgui/histogrampanel.h b/rtgui/histogrampanel.h index 467088542..befdb4671 100644 --- a/rtgui/histogrampanel.h +++ b/rtgui/histogrampanel.h @@ -95,7 +95,7 @@ class HistogramPanel : public Gtk::HBox { HistogramPanel (); - void histogramChanged (LUTu &rh, LUTu &gh, LUTu &bh, LUTu &lh) { histogramArea->update (rh, gh, bh, lh); } + void histogramChanged (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma) { histogramArea->update (histRed, histGreen, histBlue, histLuma); } void rgbv_toggled (); void resized (Gtk::Allocation& req); }; diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index 57ad8fd61..eb425083b 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -36,7 +36,7 @@ ToolPanelCoordinator::ToolPanelCoordinator () : ipc(NULL) { rawPanel = Gtk::manage (new Gtk::VBox ()); coarse = Gtk::manage (new CoarsePanel ()); - curve = Gtk::manage (new ToneCurve ()); + toneCurve = Gtk::manage (new ToneCurve ()); shadowshighlights = Gtk::manage (new ShadowsHighlights ()); lumadenoise = Gtk::manage (new LumaDenoise ()); colordenoise = Gtk::manage (new ColorDenoise ()); @@ -72,7 +72,7 @@ ToolPanelCoordinator::ToolPanelCoordinator () : ipc(NULL) { rawexposure = Gtk::manage (new RAWExposure ()); addPanel (colorPanel, whitebalance, M("TP_WBALANCE_LABEL")); toolPanels.push_back (whitebalance); - addPanel (exposurePanel, curve, M("TP_EXPOSURE_LABEL")); toolPanels.push_back (curve); + addPanel (exposurePanel, toneCurve, M("TP_EXPOSURE_LABEL")); toolPanels.push_back (toneCurve); addPanel (exposurePanel, hlrecovery, M("TP_HLREC_LABEL")); toolPanels.push_back (hlrecovery); addPanel (colorPanel, chmixer, M("TP_CHMIXER_LABEL")); toolPanels.push_back (chmixer); addPanel (exposurePanel, shadowshighlights, M("TP_SHADOWSHLIGHTS_LABEL")); toolPanels.push_back (shadowshighlights); @@ -295,16 +295,15 @@ CropGUIListener* ToolPanelCoordinator::getCropGUIListener () { void ToolPanelCoordinator::initImage (rtengine::StagedImageProcessor* ipc_, bool raw) { ipc = ipc_; - curve->disableListener (); - curve->enableAll (); - curve->enableListener (); - + toneCurve->disableListener (); + toneCurve->enableAll (); + toneCurve->enableListener (); exifpanel->setImageData (ipc->getInitialImage()->getMetaData()); iptcpanel->setImageData (ipc->getInitialImage()->getMetaData()); if (ipc) { - ipc->setAutoExpListener (curve); + ipc->setAutoExpListener (toneCurve); ipc->setSizeListener (crop); ipc->setSizeListener (resize); } @@ -329,9 +328,6 @@ void ToolPanelCoordinator::readOptions () { for (int i=0; iset_expanded (options.tpOpen[i]); - - //if (options.crvOpen.size()>1) - // curve->expandCurve (options.crvOpen[0]); } void ToolPanelCoordinator::writeOptions () { @@ -340,9 +336,6 @@ void ToolPanelCoordinator::writeOptions () { options.tpOpen.clear (); for (int i=0; iget_expanded ()); - - //options.crvOpen.clear (); - //options.crvOpen.push_back (curve->isCurveExpanded()); } @@ -470,10 +463,10 @@ int ToolPanelCoordinator::getSpotWBRectSize () { return whitebalance->getSize (); } -void ToolPanelCoordinator::updateCurveBackgroundHistogram (LUTu &histrgb, LUTu &histl) { +void ToolPanelCoordinator::updateCurveBackgroundHistogram (LUTu &histToneCurve, LUTu &histLCurve) { - curve->updateCurveBackgroundHistogram (histrgb); - lcurve->updateCurveBackgroundHistogram (histl); + toneCurve->updateCurveBackgroundHistogram (histToneCurve); + lcurve->updateCurveBackgroundHistogram (histLCurve); } void ToolPanelCoordinator::foldAllButOne (Gtk::Box* parent, FoldableToolPanel* openedSection) { diff --git a/rtgui/toolpanelcoord.h b/rtgui/toolpanelcoord.h index aa269b959..2dadd358b 100644 --- a/rtgui/toolpanelcoord.h +++ b/rtgui/toolpanelcoord.h @@ -93,7 +93,7 @@ class ToolPanelCoordinator : public ToolPanelListener, Resize* resize; ICMPanel* icm; Crop* crop; - ToneCurve* curve; + ToneCurve* toneCurve; ShadowsHighlights* shadowshighlights; LumaDenoise* lumadenoise; ColorDenoise* colordenoise; @@ -149,7 +149,7 @@ class ToolPanelCoordinator : public ToolPanelListener, ~ToolPanelCoordinator (); bool getChangedState () { return hasChanged; } - void updateCurveBackgroundHistogram (LUTu & histrgb, LUTu & histl); + void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurves); void foldAllButOne (Gtk::Box* parent, FoldableToolPanel* openedSection); // multiple listeners can be added that are notified on changes (typical: profile panel and the history)