From 2a660e1965c463427fa696041ab47426cb593ecf Mon Sep 17 00:00:00 2001 From: Ingo Date: Mon, 20 Oct 2014 16:46:41 +0200 Subject: [PATCH] Reduce peak memory usage of queue processing, Issue 2527 --- rtengine/dcrop.cc | 4 +- rtengine/improccoordinator.cc | 10 +-- rtengine/improcfun.cc | 55 +++++++++++---- rtengine/improcfun.h | 8 +-- rtengine/impulse_denoise.h | 129 +++++++++++++--------------------- rtengine/labimage.cc | 25 +------ rtengine/labimage.h | 26 +++++++ rtengine/rtengine.h | 2 +- rtengine/rtthumbnail.cc | 8 +-- rtengine/simpleprocess.cc | 67 ++++++++---------- rtgui/editorpanel.cc | 4 +- 11 files changed, 159 insertions(+), 179 deletions(-) diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 18e0d9757..882b6d0ff 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -326,13 +326,13 @@ void Crop::update (int todo) { float d; // not used after this block skip2=skip; parent->ipf.ciecam_02float (cieCrop, float(adap), begh, endh, 1, 2, labnCrop, ¶ms, parent->customColCurve1, parent->customColCurve2, parent->customColCurve3, - dummy, dummy, parent->CAMBrightCurveJ, parent->CAMBrightCurveQ, parent->CAMMean, 5, 1,(float**)cbuffer, execsharp, d, skip, 1); + dummy, dummy, parent->CAMBrightCurveJ, parent->CAMBrightCurveQ, parent->CAMMean, 5, 1, execsharp, d, skip, 1); } else { double dd; // not used after this block parent->ipf.ciecam_02 (cieCrop,adap, begh, endh, 1, 2, labnCrop, ¶ms, parent->customColCurve1, parent->customColCurve2, parent->customColCurve3, - dummy, dummy, parent->CAMBrightCurveJ, parent->CAMBrightCurveQ, parent->CAMMean, 5, 1,(float**)cbuffer, execsharp, dd, skip, 1); + dummy, dummy, parent->CAMBrightCurveJ, parent->CAMBrightCurveQ, parent->CAMMean, 5, 1, execsharp, dd, skip, 1); } } else { diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 1bafdc692..310052369 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -584,9 +584,6 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) { int endh=pH; float d; double dd; - float **buffer = new float*[pH]; - for (int i=0; iciecamfloat){ - ipf.ciecam_02float (ncie, float(adap), begh, endh, pW, 2, nprevl, ¶ms, customColCurve1,customColCurve2,customColCurve3, histLCAM, histCCAM, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, (float**)buffer, execsharp, d, scale, 1); + ipf.ciecam_02float (ncie, float(adap), begh, endh, pW, 2, nprevl, ¶ms, customColCurve1,customColCurve2,customColCurve3, histLCAM, histCCAM, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, execsharp, d, scale, 1); if(params.colorappearance.autodegree && acListener && params.colorappearance.enabled) acListener->autoCamChanged(100.*(double)d); if(params.colorappearance.autoadapscen && acListener && params.colorappearance.enabled) acListener->adapCamChanged(adap);//real value of adapt scene luminosity } else { - ipf.ciecam_02 (ncie, adap, begh, endh, pW, 2, nprevl, ¶ms, customColCurve1,customColCurve2,customColCurve3, histLCAM, histCCAM, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, (float**)buffer, execsharp, dd, scale, 1); + ipf.ciecam_02 (ncie, adap, begh, endh, pW, 2, nprevl, ¶ms, customColCurve1,customColCurve2,customColCurve3, histLCAM, histCCAM, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, execsharp, dd, scale, 1); if(params.colorappearance.autodegree && acListener && params.colorappearance.enabled) acListener->autoCamChanged(100.*dd); if(params.colorappearance.autoadapscen && acListener && params.colorappearance.enabled) acListener->adapCamChanged(adap); } - for (int i=0; i void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh, int pW, int pwb, LabImage* lab, const ProcParams* params , const ColorAppearance & customColCurve1, const ColorAppearance & customColCurve2,const ColorAppearance & customColCurve3, - LUTu & histLCAM, LUTu & histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, float** buffer, bool execsharp, double &d, int scalecd, int rtt) + LUTu & histLCAM, LUTu & histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, bool execsharp, double &d, int scalecd, int rtt) { if(params->colorappearance.enabled) { //int lastskip; @@ -973,7 +973,11 @@ if(params->colorappearance.badpixsl > 0) if(execsharp) { if (params->sharpenMicro.enabled)if(execsharp) ImProcFunctions::MLmicrocontrastcam(ncie); -if(params->sharpening.enabled) if(execsharp) {ImProcFunctions::sharpeningcam (ncie, (float**)buffer);} //sharpening adapted to CIECAM +if(params->sharpening.enabled) + if(execsharp) { + float **buffer = lab->L; // We can use the L-buffer from lab as buffer to save some memory + ImProcFunctions::sharpeningcam (ncie, buffer); // sharpening adapted to CIECAM + } //if(params->dirpyrequalizer.enabled) if(execsharp) { if(params->dirpyrequalizer.enabled /*&& (execsharp)*/) { @@ -1145,7 +1149,7 @@ if((params->colorappearance.tonecie || (params->colorappearance.tonecie && param // Copyright (c) 2012 Jacques Desmis void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int endh, int pW, int pwb, LabImage* lab, const ProcParams* params, const ColorAppearance & customColCurve1, const ColorAppearance & customColCurve2,const ColorAppearance & customColCurve3, - LUTu & histLCAM, LUTu & histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, float** buffer, bool execsharp, float &d, int scalecd, int rtt) + LUTu & histLCAM, LUTu & histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, bool execsharp, float &d, int scalecd, int rtt) { if(params->colorappearance.enabled) { //int lastskip; @@ -1877,7 +1881,12 @@ if((params->colorappearance.tonecie && (epdEnabled)) || (params->sharpening.enab //all this treatments reduce artefacts, but can leed to slighty different results -if(params->defringe.enabled) if(execsharp) ImProcFunctions::defringecam (ncie);//defringe adapted to CIECAM +if(params->defringe.enabled) + if(execsharp) { + lab->deleteLab(); + ImProcFunctions::defringecam (ncie);//defringe adapted to CIECAM + lab->reallocLab(); + } //if(params->dirpyrequalizer.enabled) if(execsharp) { if(params->dirpyrequalizer.enabled) { if(params->dirpyrequalizer.gamutlab /*&& execsharp*/) {//remove artifacts by gaussian blur - skin control @@ -1891,21 +1900,35 @@ if(params->dirpyrequalizer.enabled) { int hotbad=0; float chrom=50.f; + lab->deleteLab(); ImProcFunctions::badpixcam (ncie, artifact, 5, 2 , b_l, t_l, t_r, b_r, params->dirpyrequalizer.skinprotect, chrom, hotbad); //enabled remove artifacts for cbDL + lab->reallocLab(); } } //if(params->colorappearance.badpixsl > 0) { int mode=params->colorappearance.badpixsl; if(params->colorappearance.badpixsl > 0) if(execsharp){ int mode=params->colorappearance.badpixsl; + lab->deleteLab(); ImProcFunctions::badpixcam (ncie, 3.0, 10, mode, 0, 0, 0, 0, 0, 0, 1);//for bad pixels CIECAM + lab->reallocLab(); } -if(params->impulseDenoise.enabled) if(execsharp) ImProcFunctions::impulsedenoisecam (ncie);//impulse adapted to CIECAM +if(params->impulseDenoise.enabled) if(execsharp) { + float **buffers[3]; + buffers[0] = lab->L; + buffers[1] = lab->a; + buffers[2] = lab->b; + ImProcFunctions::impulsedenoisecam (ncie,buffers);//impulse adapted to CIECAM +} if (params->sharpenMicro.enabled)if(execsharp) ImProcFunctions::MLmicrocontrastcam(ncie); -if(params->sharpening.enabled) if(execsharp) {ImProcFunctions::sharpeningcam (ncie, (float**)buffer);} //sharpening adapted to CIECAM +if(params->sharpening.enabled) + if(execsharp) { + float **buffer = lab->L; // We can use the L-buffer from lab as buffer to save some memory + ImProcFunctions::sharpeningcam (ncie, buffer); // sharpening adapted to CIECAM + } //if(params->dirpyrequalizer.enabled) if(execsharp) { if(params->dirpyrequalizer.enabled /*&& execsharp*/) { @@ -1917,7 +1940,11 @@ if(params->dirpyrequalizer.enabled /*&& execsharp*/) { // if(params->dirpyrequalizer.algo=="FI") choice=0; // else if(params->dirpyrequalizer.algo=="LA") choice=1; - if(rtt==1) dirpyr_equalizercam(ncie, ncie->sh_p, ncie->sh_p, ncie->W, ncie->H, ncie->h_p, ncie->C_p, params->dirpyrequalizer.mult, params->dirpyrequalizer.threshold, params->dirpyrequalizer.skinprotect, true, params->dirpyrequalizer.gamutlab, b_l,t_l,t_r,b_r, choice, scalecd);//contrast by detail adapted to CIECAM + if(rtt==1) { + lab->deleteLab(); + dirpyr_equalizercam(ncie, ncie->sh_p, ncie->sh_p, ncie->W, ncie->H, ncie->h_p, ncie->C_p, params->dirpyrequalizer.mult, params->dirpyrequalizer.threshold, params->dirpyrequalizer.skinprotect, true, params->dirpyrequalizer.gamutlab, b_l,t_l,t_r,b_r, choice, scalecd);//contrast by detail adapted to CIECAM + lab->reallocLab(); + } /* if(params->colorappearance.badpixsl > 0) if(execsharp){ int mode=params->colorappearance.badpixsl; printf("BADPIX"); @@ -1950,7 +1977,11 @@ if((params->colorappearance.tonecie && (epdEnabled)) || (params->sharpening.enab || (params->dirpyrequalizer.enabled && settings->autocielab) ||(params->defringe.enabled && settings->autocielab) || (params->sharpenMicro.enabled && settings->autocielab) || (params->impulseDenoise.enabled && settings->autocielab) || (params->colorappearance.badpixsl >0 && settings->autocielab)){ - if(epdEnabled && params->colorappearance.tonecie && algepd) ImProcFunctions::EPDToneMapCIE(ncie, a_w, c_, w_h, width, height, begh, endh, minQ, maxQ, Iterates, scale ); + if(epdEnabled && params->colorappearance.tonecie && algepd) { + lab->deleteLab(); + ImProcFunctions::EPDToneMapCIE(ncie, a_w, c_, w_h, width, height, begh, endh, minQ, maxQ, Iterates, scale ); + lab->reallocLab(); + } //EPDToneMapCIE adated to CIECAM @@ -5002,11 +5033,11 @@ void ImProcFunctions::colorCurve (LabImage* lold, LabImage* lnew) { impulse_nr (lab, (float)params->impulseDenoise.thresh/20.0 ); } - void ImProcFunctions::impulsedenoisecam (CieImage* ncie) { + void ImProcFunctions::impulsedenoisecam (CieImage* ncie, float **buffers[3]) { if (params->impulseDenoise.enabled && ncie->W>=8 && ncie->H>=8) - impulse_nrcam (ncie, (float)params->impulseDenoise.thresh/20.0 ); + impulse_nrcam (ncie, (float)params->impulseDenoise.thresh/20.0, buffers ); } void ImProcFunctions::defringe (LabImage* lab) { @@ -5017,8 +5048,8 @@ void ImProcFunctions::colorCurve (LabImage* lold, LabImage* lnew) { } void ImProcFunctions::defringecam (CieImage* ncie) { - if (params->defringe.enabled && ncie->W>=8 && ncie->H>=8) PF_correct_RTcam(ncie, ncie, params->defringe.radius, params->defringe.threshold); - + if (params->defringe.enabled && ncie->W>=8 && ncie->H>=8) + PF_correct_RTcam(ncie, ncie, params->defringe.radius, params->defringe.threshold); } void ImProcFunctions::badpixcam(CieImage* ncie, double rad, int thr, int mode, float b_l, float t_l, float t_r, float b_r, float skinprot, float chrom, int hotbad){ diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index af7dd0638..7fa07a5da 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -214,10 +214,10 @@ class ImProcFunctions { void luminanceCurve (LabImage* lold, LabImage* lnew, LUTf &curve); void ciecam_02float (CieImage* ncie, float adap, int begh, int endh, int pW, int pwb, LabImage* lab, const ProcParams* params, const ColorAppearance & customColCurve1, const ColorAppearance & customColCurve, const ColorAppearance & customColCurve3, - LUTu &histLCAM, LUTu &histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, float** buffer, bool execsharp, float &d, int scalecd, int rtt); + LUTu &histLCAM, LUTu &histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, bool execsharp, float &d, int scalecd, int rtt); void ciecam_02 (CieImage* ncie, double adap, int begh, int endh, int pW, int pwb, LabImage* lab, const ProcParams* params, const ColorAppearance & customColCurve1, const ColorAppearance & customColCurve, const ColorAppearance & customColCurve3, - LUTu &histLCAM, LUTu &histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, float** buffer, bool execsharp, double &d, int scalecd, int rtt); + LUTu &histLCAM, LUTu &histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, bool execsharp, double &d, int scalecd, int rtt); void chromiLuminanceCurve (EditBuffer *editBuffer, int pW, LabImage* lold, LabImage* lnew, LUTf &acurve, LUTf &bcurve, LUTf & satcurve,LUTf & satclcurve, LUTf &clcurve, LUTf &curve, bool utili, bool autili, bool butili, bool ccutili, bool cclutili, bool clcutili, LUTu &histCCurve, LUTu &histCLurve, LUTu &histLCurve, LUTu &histLurve); void vibrance (LabImage* lab);//Jacques' vibrance void colorCurve (LabImage* lold, LabImage* lnew); @@ -236,9 +236,9 @@ class ImProcFunctions { void MLmicrocontrastcam(CieImage* ncie ); //Manuel's microcontrast void impulsedenoise (LabImage* lab);//Emil's impulse denoise - void impulsedenoisecam (CieImage* ncie); + void impulsedenoisecam (CieImage* ncie, float **buffers[3]); void impulse_nr (LabImage* lab, double thresh); - void impulse_nrcam (CieImage* ncie, double thresh); + void impulse_nrcam (CieImage* ncie, double thresh, float **buffers[3]); void dirpyrdenoise (LabImage* src);//Emil's pyramid denoise void dirpyrequalizer (LabImage* lab, int scale);//Emil's equalizer diff --git a/rtengine/impulse_denoise.h b/rtengine/impulse_denoise.h index 402b83b6f..3151e8ec0 100644 --- a/rtengine/impulse_denoise.h +++ b/rtengine/impulse_denoise.h @@ -23,19 +23,13 @@ #include "improcfun.h" #include "cieimage.h" #include "sleef.c" -#ifdef __SSE2__ -#include "sleefsseavx.c" -#endif +#include "opthelper.h" using namespace std; namespace rtengine { -#if defined( __SSE2__ ) && defined( WIN32 ) -__attribute__((force_align_arg_pointer)) void ImProcFunctions::impulse_nr (LabImage* lab, double thresh) -#else -void ImProcFunctions::impulse_nr (LabImage* lab, double thresh) -#endif +SSEFUNCTION void ImProcFunctions::impulse_nr (LabImage* lab, double thresh) { // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -240,13 +234,8 @@ void ImProcFunctions::impulse_nr (LabImage* lab, double thresh) } -#if defined( __SSE2__ ) && defined( WIN32 ) -__attribute__((force_align_arg_pointer)) void ImProcFunctions::impulse_nrcam (CieImage* ncie, double thresh) -#else -void ImProcFunctions::impulse_nrcam (CieImage* ncie, double thresh) -#endif +SSEFUNCTION void ImProcFunctions::impulse_nrcam (CieImage* ncie, double thresh, float **buffers[3]) { - // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // impulse noise removal // local variables @@ -256,67 +245,16 @@ void ImProcFunctions::impulse_nrcam (CieImage* ncie, double thresh) float piid=3.14159265f/180.f; + // buffer for the lowpass image - float ** lpf = new float *[height]; + float ** lpf = buffers[0]; // buffer for the highpass image - float ** impish = new float *[height]; - for (int i=0; ih_p[i][j])); - tempv = LVFU(ncie->C_p[i][j]); - _mm_storeu_ps(&sraa[i][j], tempv * sincosvalv.y); - _mm_storeu_ps(&srbb[i][j], tempv * sincosvalv.x); - } - for (; jh_p[i][j]); - sraa[i][j]=ncie->C_p[i][j]*sincosval.y; - srbb[i][j]=ncie->C_p[i][j]*sincosval.x; - } -#else - for (j=0; jh_p[i][j]); - sraa[i][j]=ncie->C_p[i][j]*sincosval.y; - srbb[i][j]=ncie->C_p[i][j]*sincosval.x; - } -#endif - } -} //The cleaning algorithm starts here @@ -404,6 +342,48 @@ void ImProcFunctions::impulse_nrcam (CieImage* ncie, double thresh) } //now impulsive values have been identified + + const float eps = 1.0f; + + float** sraa = buffers[0]; // we can reuse buffers[0] because lpf is not needed anymore at this point + float** srbb = buffers[2]; + +#ifdef _OPENMP +#pragma omp parallel +#endif +{ + int j; + float2 sincosval; +#ifdef __SSE2__ + vfloat2 sincosvalv; + __m128 piidv = _mm_set1_ps( piid ); + __m128 tempv; +#endif +#ifdef _OPENMP +#pragma omp for +#endif + for (int i=0; ih_p[i][j])); + tempv = LVFU(ncie->C_p[i][j]); + _mm_storeu_ps(&sraa[i][j], tempv * sincosvalv.y); + _mm_storeu_ps(&srbb[i][j], tempv * sincosvalv.x); + } + for (; jh_p[i][j]); + sraa[i][j]=ncie->C_p[i][j]*sincosval.y; + srbb[i][j]=ncie->C_p[i][j]*sincosval.x; + } +#else + for (j=0; jh_p[i][j]); + sraa[i][j]=ncie->C_p[i][j]*sincosval.y; + srbb[i][j]=ncie->C_p[i][j]*sincosval.x; + } +#endif + } +} // Issue 1671: // often, noise isn't evenly distributed, e.g. only a few noisy pixels in the bright sky, but many in the dark foreground, @@ -524,19 +504,6 @@ void ImProcFunctions::impulse_nrcam (CieImage* ncie, double thresh) } } - for (int i=0; iH; - float** buffer = new float*[fh]; - for (int i=0; igetImage (currWB, tr, baseImg, pp, params.toneCurve, params.icm, params.raw); if (pl) pl->setProgress (0.45); - LUTf Noisecurve (65536,0); +// LUTf Noisecurve (65536,0); +//!!!// auto exposure!!! + double expcomp = params.toneCurve.expcomp; + int bright = params.toneCurve.brightness; + int contr = params.toneCurve.contrast; + int black = params.toneCurve.black; + int hlcompr = params.toneCurve.hlcompr; + int hlcomprthresh = params.toneCurve.hlcomprthresh; + + if (params.toneCurve.autoexp) { + LUTu aehist; int aehistcompr; + imgsrc->getAutoExpHistogram (aehist, aehistcompr); + ipf.getAutoExp (aehist, aehistcompr, imgsrc->getDefGain(), params.toneCurve.clip, expcomp, bright, contr, black, hlcompr,hlcomprthresh); + } + + // at this stage, we can flush the raw data to free up quite an important amount of memory + // commented out because it makes the application crash when batch processing... + // TODO: find a better place to flush rawData and rawRGB + if(flush) { + imgsrc->flushRawData(); + imgsrc->flushRGB(); + } // perform luma/chroma denoise // CieImage *cieView; @@ -175,25 +196,6 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p shmap->update (baseImg, shradius, ipf.lumimul, params.sh.hq, 1); } // RGB processing -//!!!// auto exposure!!! - double expcomp = params.toneCurve.expcomp; - int bright = params.toneCurve.brightness; - int contr = params.toneCurve.contrast; - int black = params.toneCurve.black; - int hlcompr = params.toneCurve.hlcompr; - int hlcomprthresh = params.toneCurve.hlcomprthresh; - - if (params.toneCurve.autoexp) { - LUTu aehist; int aehistcompr; - imgsrc->getAutoExpHistogram (aehist, aehistcompr); - ipf.getAutoExp (aehist, aehistcompr, imgsrc->getDefGain(), params.toneCurve.clip, expcomp, bright, contr, black, hlcompr,hlcomprthresh); - } - - // at this stage, we can flush the raw data to free up quite an important amount of memory - // commented out because it makes the application crash when batch processing... - // TODO: find a better place to flush rawData and rawRGB - //imgsrc->flushRawData(); - //imgsrc->flushRGB(); LUTf curve1 (65536,0); LUTf curve2 (65536,0); @@ -415,31 +417,18 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p float d; double dd; - float** buffer = new float*[fh]; - for (int i=0; iciecamfloat) ipf.ciecam_02float (cieView, float(adap), begh, endh,1,2, labView, ¶ms,customColCurve1,customColCurve2,customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, (float**)buffer, true, d, sk, 1); - else ipf.ciecam_02 (cieView, adap, begh, endh,1,2, labView, ¶ms,customColCurve1,customColCurve2,customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, (float**)buffer, true, dd, 1, 1); - for (int i=0; iciecamfloat) ipf.ciecam_02float (cieView, float(adap), begh, endh,1,2, labView, ¶ms,customColCurve1,customColCurve2,customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, d, sk, 1); + else ipf.ciecam_02 (cieView, adap, begh, endh,1,2, labView, ¶ms,customColCurve1,customColCurve2,customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, dd, 1, 1); } else { int f_h=2,f_w=2; float d; double dd; - float** buffer = new float*[f_h]; - for (int i=0; iciecamfloat) ipf.ciecam_02float (cieView, float(adap), begh, endh,1,2, labView, ¶ms,customColCurve1,customColCurve2,customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, (float**)buffer, true, d, sk, 1); - else ipf.ciecam_02 (cieView, adap, begh, endh,1, 2, labView, ¶ms,customColCurve1,customColCurve2,customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, (float**)buffer, true, dd, 1, 1); - - for (int i=0; iciecamfloat) ipf.ciecam_02float (cieView, float(adap), begh, endh,1,2, labView, ¶ms,customColCurve1,customColCurve2,customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, d, sk, 1); + else ipf.ciecam_02 (cieView, adap, begh, endh,1, 2, labView, ¶ms,customColCurve1,customColCurve2,customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, dd, 1, 1); } } delete cieView; @@ -781,7 +770,7 @@ void batchProcessingThread (ProcessingJob* job, BatchProcessingListener* bpl, bo while (currentJob) { int errorCode; - IImage16* img = processImage (currentJob, errorCode, bpl, tunnelMetaData); + IImage16* img = processImage (currentJob, errorCode, bpl, tunnelMetaData, true); if (errorCode) { bpl->error (M("MAIN_MSG_CANNOTLOAD")); currentJob = NULL; diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index d71ab1c10..9725e55b8 100755 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -1214,7 +1214,7 @@ void EditorPanel::saveAsPressed () { rtengine::ProcessingJob* job = rtengine::ProcessingJob::create (ipc->getInitialImage(), pparams); ProgressConnector *ld = new ProgressConnector(); - ld->startFunc(sigc::bind(sigc::ptr_fun(&rtengine::processImage), job, err, parent->getProgressListener(), options.tunnelMetaData ), + ld->startFunc(sigc::bind(sigc::ptr_fun(&rtengine::processImage), job, err, parent->getProgressListener(), options.tunnelMetaData, false ), sigc::bind(sigc::mem_fun( *this,&EditorPanel::idle_saveImage ),ld,fnameOut,sf )); saveimgas->set_sensitive(false); sendtogimp->set_sensitive(false); @@ -1248,7 +1248,7 @@ void EditorPanel::sendToGimpPressed () { ipc->getParams (&pparams); rtengine::ProcessingJob* job = rtengine::ProcessingJob::create (ipc->getInitialImage(), pparams); ProgressConnector *ld = new ProgressConnector(); - ld->startFunc(sigc::bind(sigc::ptr_fun(&rtengine::processImage), job, err, parent->getProgressListener(), options.tunnelMetaData ), + ld->startFunc(sigc::bind(sigc::ptr_fun(&rtengine::processImage), job, err, parent->getProgressListener(), options.tunnelMetaData, false ), sigc::bind(sigc::mem_fun( *this,&EditorPanel::idle_sendToGimp ),ld )); saveimgas->set_sensitive(false); sendtogimp->set_sensitive(false);