Naming cleanups. (No functional changes, prep for patch)
This commit is contained in:
@@ -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; i<y2; i++) {
|
||||
int ofs = (i*pW + x1)*3;
|
||||
@@ -382,17 +381,16 @@ void ImProcCoordinator::updateHistograms (int x1, int y1, int x2, int y2) {
|
||||
int g=workimg->data[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; i<y2; i++)
|
||||
for (int j=x1; j<x2; j++) {
|
||||
Lhist[(int)(nprevl->L[i][j]/128)]++;
|
||||
histLuma[(int)(nprevl->L[i][j]/128)]++;
|
||||
}
|
||||
|
||||
/*for (int i=0; i<256; i++) {
|
||||
|
@@ -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;
|
||||
|
@@ -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). */
|
||||
|
@@ -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]);
|
||||
|
@@ -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(){
|
||||
|
@@ -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 ();
|
||||
|
@@ -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);
|
||||
};
|
||||
|
@@ -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; i<options.tpOpen.size(); i++)
|
||||
if (i<expList.size())
|
||||
expList[i]->set_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; i<expList.size(); i++)
|
||||
options.tpOpen.push_back (expList[i]->get_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) {
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user