From 61f287b364990c97fc7321953a3e73e348f1d0d1 Mon Sep 17 00:00:00 2001 From: Troy Sankey Date: Wed, 18 Jul 2012 18:38:50 -0700 Subject: [PATCH] Photo saved via queue from the Editor tab looks different to the one saved from the File Browser tab, issue 1471 --- COMPILE.txt | 2 +- rtengine/improccoordinator.cc | 2 +- rtengine/improcfun.cc | 14 ++++++++++---- rtengine/improcfun.h | 5 ++++- rtengine/rtthumbnail.cc | 4 ++-- rtengine/simpleprocess.cc | 4 ++-- 6 files changed, 20 insertions(+), 11 deletions(-) diff --git a/COMPILE.txt b/COMPILE.txt index 6de0bf551..a2368638c 100644 --- a/COMPILE.txt +++ b/COMPILE.txt @@ -369,7 +369,7 @@ LINUX liblcms2-dev libpng-dev libsigc++-2.0-dev libtiff-dev mercurial \ zlib1g-dev - in Fedora, run: + In Fedora, run: sudo yum install gcc-c++ cmake bzip2-devel exiv2-devel expat-devel \ fftw-devel glib2-devel glibmm24-devel gtk+-devel gtkmm24-devel \ libjpeg-turbo-devel lcms2-devel libiptcdata-devel libpng-devel \ diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 742711782..0d5c9901e 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -246,7 +246,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) { // if it's just crop we just need the histogram, no image updates if ( todo!=CROP ) { ipf.rgbProc (oprevi, oprevl, hltonecurve, shtonecurve, tonecurve, shmap, params.toneCurve.saturation, - rCurve, gCurve, bCurve); + rCurve, gCurve, bCurve, params.toneCurve.expcomp, params.toneCurve.hlcompr, params.toneCurve.hlcomprthresh); } // compute L channel histogram diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index c9cfc4a98..9e4dc8d91 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -186,9 +186,15 @@ void ImProcFunctions::firstAnalysis (Imagefloat* original, const ProcParams* par } +void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, + SHMap* shmap, int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve) { + rgbProc (working, lab, hltonecurve, shtonecurve, tonecurve, shmap, sat, rCurve, gCurve, bCurve, params->toneCurve.expcomp, params->toneCurve.hlcompr, params->toneCurve.hlcomprthresh); +} + // Process RGB image and convert to LAB space void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, - SHMap* shmap, int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve) { + SHMap* shmap, int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, + double expcomp, int hlcompr, int hlcomprthresh) { int h_th, s_th; if (shmap) { @@ -247,9 +253,9 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, LUTf & hltone if (sCurveEnabled) sCurve = new FlatCurve(params->hsvequalizer.scurve); if (vCurveEnabled) vCurve = new FlatCurve(params->hsvequalizer.vcurve); - const float exp_scale = pow (2.0, params->toneCurve.expcomp); - const float comp = (max(0.0, params->toneCurve.expcomp) + 1.0)*params->toneCurve.hlcompr/100.0; - const float shoulder = ((65536.0/max(1.0f,exp_scale))*(params->toneCurve.hlcomprthresh/200.0))+0.1; + const float exp_scale = pow (2.0, expcomp); + const float comp = (max(0.0, expcomp) + 1.0)*hlcompr/100.0; + const float shoulder = ((65536.0/max(1.0f,exp_scale))*(hlcomprthresh/200.0))+0.1; const float hlrange = 65536.0-shoulder; diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 4b22a3038..f3a039f41 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -117,7 +117,10 @@ class ImProcFunctions { void firstAnalysis (Imagefloat* working, const ProcParams* params, LUTu & vhist16, double gamma); void rgbProc (Imagefloat* working, LabImage* lab, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, - SHMap* shmap, int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve); + SHMap* shmap, int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve); + void rgbProc (Imagefloat* working, LabImage* lab, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, + SHMap* shmap, int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, + double expcomp, int hlcompr, int hlcomprthresh); void luminanceCurve (LabImage* lold, LabImage* lnew, LUTf &curve); void chrominanceCurve (LabImage* lold, LabImage* lnew, LUTf &acurve, LUTf &bcurve, LUTf & satcurve); void vibrance (LabImage* lab);//Jacques' vibrance diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index f268c9d08..1d8af7231 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -739,7 +739,7 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rhei //CurveFactory::complexCurve (expcomp, black/65535.0, params.toneCurve.hlcompr, params.toneCurve.hlcomprthresh, // params.toneCurve.shcompr, params.toneCurve.brightness, params.toneCurve.contrast, // gamma, true, params.toneCurve.curve, hist16, dummy, curve1, curve2, curve, dummy, 16); - CurveFactory::complexCurve (expcomp, black/65535.0, hlcompr, params.toneCurve.hlcomprthresh, + CurveFactory::complexCurve (expcomp, black/65535.0, hlcompr, hlcomprthresh, params.toneCurve.shcompr, bright, contr, gamma, true, params.toneCurve.curve, hist16, dummy, curve1, curve2, curve, dummy, 16); @@ -749,7 +749,7 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rhei LabImage* labView = new LabImage (fw,fh); - ipf.rgbProc (baseImg, labView, curve1, curve2, curve, shmap, params.toneCurve.saturation, rCurve, gCurve, bCurve ); + ipf.rgbProc (baseImg, labView, curve1, curve2, curve, shmap, params.toneCurve.saturation, rCurve, gCurve, bCurve, expcomp, hlcompr, hlcomprthresh); if (shmap) delete shmap; diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 24572902c..deac00b14 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -160,7 +160,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p LUTf bCurve (65536,0); LUTu dummy; - CurveFactory::complexCurve (expcomp, black/65535.0, params.toneCurve.hlcompr, params.toneCurve.hlcomprthresh, params.toneCurve.shcompr, bright, params.toneCurve.contrast, imgsrc->getGamma(), true, params.toneCurve.curve, + CurveFactory::complexCurve (expcomp, black/65535.0, hlcompr, hlcomprthresh, params.toneCurve.shcompr, bright, contr, imgsrc->getGamma(), true, params.toneCurve.curve, hist16, dummy, curve1, curve2, curve, dummy); CurveFactory::RGBCurve (params.rgbCurves.rcurve, rCurve, 1); @@ -169,7 +169,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p LabImage* labView = new LabImage (fw,fh); - ipf.rgbProc (baseImg, labView, curve1, curve2, curve, shmap, params.toneCurve.saturation, rCurve, gCurve, bCurve); + ipf.rgbProc (baseImg, labView, curve1, curve2, curve, shmap, params.toneCurve.saturation, rCurve, gCurve, bCurve, expcomp, hlcompr, hlcomprthresh); // Freeing baseImg because not used anymore delete baseImg;