diff --git a/rtdata/profiles/Pixel Shift/PS ISO Low.pp3 b/rtdata/profiles/Pixel Shift/PS ISO Low.pp3 index 5587b19e0..286b5a289 100644 --- a/rtdata/profiles/Pixel Shift/PS ISO Low.pp3 +++ b/rtdata/profiles/Pixel Shift/PS ISO Low.pp3 @@ -1,18 +1,8 @@ [Sharpening] -Enabled=true -Contrast=5 -Method=rld -DeconvRadius=0.75 -DeconvAmount=100 -DeconvDamping=0 -DeconvIterations=30 +Enabled=false [SharpenMicro] -Enabled=true -Contrast=15 -Matrix=false -Strength=20 -Uniformity=5 +Enabled=false [RAW] CA=true @@ -38,3 +28,6 @@ pixelShiftBlur=true pixelShiftSmoothFactor=0.69999999999999996 pixelShiftLmmse=false pixelShiftNonGreenCross=true + +[PostDemosaicSharpening] +Enabled=true diff --git a/rtdata/profiles/Pixel Shift/PS No Motion.pp3 b/rtdata/profiles/Pixel Shift/PS No Motion.pp3 index f1d889f97..0975251e2 100644 --- a/rtdata/profiles/Pixel Shift/PS No Motion.pp3 +++ b/rtdata/profiles/Pixel Shift/PS No Motion.pp3 @@ -1,18 +1,8 @@ [Sharpening] -Enabled=true -Contrast=5 -Method=rld -DeconvRadius=0.75 -DeconvAmount=100 -DeconvDamping=0 -DeconvIterations=30 +Enabled=false [SharpenMicro] -Enabled=true -Contrast=15 -Matrix=false -Strength=20 -Uniformity=5 +Enabled=false [RAW] CA=true @@ -22,3 +12,6 @@ Method=pixelshift PixelShiftMotion=0 PixelShiftMotionCorrection=5 PixelShiftMotionCorrectionMethod=0 + +[PostDemosaicSharpening] +Enabled=true diff --git a/rtengine/FTblockDN.cc b/rtengine/FTblockDN.cc index ea0565b21..121c8189d 100644 --- a/rtengine/FTblockDN.cc +++ b/rtengine/FTblockDN.cc @@ -1599,9 +1599,9 @@ BENCHFUN Color::Lab2RGBLimit(labdn->L[i1], labdn->a[i1], labdn->b[i1], labdn->L[i1], labdn->a[i1], labdn->b[i1], wip, 9000000.f, 1.f + qhighFactor * realred, 1.f + qhighFactor * realblue, width); for (int j = tileleft; j < tileright; ++j) { int j1 = j - tileleft; - float r_ = labdn->L[i1][j1]; - float g_ = labdn->a[i1][j1]; - float b_ = labdn->b[i1][j1]; + float r_ = std::max(0.f, labdn->L[i1][j1]); + float g_ = std::max(0.f, labdn->a[i1][j1]); + float b_ = std::max(0.f, labdn->b[i1][j1]); //inverse gamma standard (slider) r_ = r_ < 32768.f ? igamcurve[r_] : (Color::gammanf(r_ / 32768.f, igam) * 65535.f); g_ = g_ < 32768.f ? igamcurve[g_] : (Color::gammanf(g_ / 32768.f, igam) * 65535.f); diff --git a/rtengine/badpixels.cc b/rtengine/badpixels.cc index 2710cb28d..0ae63a618 100644 --- a/rtengine/badpixels.cc +++ b/rtengine/badpixels.cc @@ -22,12 +22,39 @@ #include "pixelsmap.h" #include "rawimage.h" #include "rawimagesource.h" +//#define BENCHMARK +#include "StopWatch.h" namespace { unsigned fc(const unsigned int cfa[2][2], int r, int c) { return cfa[r & 1][c & 1]; } + +inline void sum5x5(const array2D& in, int col, float &sum) { +#ifdef __SSE2__ + // sum up 5*4 = 20 values using SSE + // 10 fabs function calls and 10 float additions with SSE + const vfloat sumv = (vabsf(LVFU(in[0][col])) + vabsf(LVFU(in[1][col]))) + + (vabsf(LVFU(in[2][col])) + vabsf(LVFU(in[3][col]))) + + vabsf(LVFU(in[4][col])); + // horizontally add the values and add the result to hfnbrave + sum += vhadd(sumv); + + // add remaining 5 values of last column + sum += (fabsf(in[0][col + 4]) + fabsf(in[1][col + 4])) + + (fabsf(in[2][col + 4]) + fabsf(in[3][col + 4])) + + fabsf(in[4][col + 4]); +#else + // 25 fabs function calls and 25 float additions without SSE + for (int nn = col; nn < col + 5; ++nn) { + sum += (fabsf(in[0][nn]) + fabsf(in[1][nn])) + + (fabsf(in[2][nn]) + fabsf(in[3][nn])) + + fabsf(in[4][nn]); + } +#endif + +} } namespace rtengine @@ -445,126 +472,124 @@ int RawImageSource::interpolateBadPixelsXtrans(const PixelsMap &bitmapBads) /* Search for hot or dead pixels in the image and update the map * For each pixel compare its value to the average of similar color surrounding * (Taken from Emil Martinec idea) - * (Optimized by Ingo Weyrich 2013 and 2015) - */ + * (Optimized by Ingo Weyrich 2013, 2015, and 2019) +*/ int RawImageSource::findHotDeadPixels(PixelsMap &bpMap, const float thresh, const bool findHotPixels, const bool findDeadPixels) const { + BENCHFUN const float varthresh = (20.0 * (thresh / 100.0) + 1.0) / 24.f; - // allocate temporary buffer - float* cfablur = new float[H * W]; - // counter for dead or hot pixels int counter = 0; #ifdef _OPENMP - #pragma omp parallel + #pragma omp parallel reduction(+:counter) #endif { + array2D cfablur(W, 5, ARRAY2D_CLEAR_DATA); + int firstRow = -1; + int lastRow = -1; + #ifdef _OPENMP - #pragma omp for schedule(dynamic,16) nowait + // note, static scheduling is important in this implementation + #pragma omp for schedule(static) nowait #endif - for (int i = 2; i < H - 2; i++) { - for (int j = 2; j < W - 2; j++) { + for (int i = 2; i < H - 2; ++i) { + if (firstRow == -1) { + firstRow = i; + if (firstRow > 2) { + for (int row = firstRow - 2; row < firstRow; ++row) { + const int destRow = row % 5; + for (int j = 2; j < W - 2; ++j) { + const float temp = median(rawData[row - 2][j - 2], rawData[row - 2][j], rawData[row - 2][j + 2], + rawData[row][j - 2], rawData[row][j], rawData[row][j + 2], + rawData[row + 2][j - 2], rawData[row + 2][j], rawData[row + 2][j + 2]); + cfablur[destRow][j] = rawData[row][j] - temp; + } + } + } + } + lastRow = i; + const int destRow = i % 5; + for (int j = 2; j < W - 2; ++j) { const float temp = median(rawData[i - 2][j - 2], rawData[i - 2][j], rawData[i - 2][j + 2], rawData[i][j - 2], rawData[i][j], rawData[i][j + 2], rawData[i + 2][j - 2], rawData[i + 2][j], rawData[i + 2][j + 2]); - cfablur[i * W + j] = rawData[i][j] - temp; + cfablur[destRow][j] = rawData[i][j] - temp; + } + + if (i - 1 > firstRow) { + const int rr = i - 2; + const int rr0 = rr % 5; + for (int cc = 2; cc < W - 2; ++cc) { + //evaluate pixel for heat/death + float pixdev = cfablur[rr0][cc]; + + if (!findDeadPixels && pixdev <= 0.f) { + continue; + } + + if (!findHotPixels && pixdev >= 0.f) { + continue; + } + + pixdev = fabsf(pixdev); + float hfnbrave = -pixdev; + sum5x5(cfablur, cc - 2, hfnbrave); + if (pixdev > varthresh * hfnbrave) { + // mark the pixel as "bad" + bpMap.set(cc, rr); + ++counter; + } + } //end of pixel evaluation } } - // process borders. Former version calculated the median using mirrored border which does not make sense because the original pixel loses weight - // Setting the difference between pixel and median for border pixels to zero should do the job not worse then former version -#ifdef _OPENMP - #pragma omp single -#endif - { - for (int i = 0; i < 2; ++i) { - for (int j = 0; j < W; ++j) { - cfablur[i * W + j] = 0.f; - } - } - - for (int i = 2; i < H - 2; ++i) { - for (int j = 0; j < 2; ++j) { - cfablur[i * W + j] = 0.f; - } - - for (int j = W - 2; j < W; ++j) { - cfablur[i * W + j] = 0.f; - } - } - - for (int i = H - 2; i < H; ++i) { - for (int j = 0; j < W; ++j) { - cfablur[i * W + j] = 0.f; - } - } - } - -#ifdef _OPENMP - #pragma omp barrier // barrier because of nowait clause above - - #pragma omp for reduction(+:counter) schedule(dynamic,16) -#endif - - //cfa pixel heat/death evaluation - for (int rr = 2; rr < H - 2; ++rr) { - for (int cc = 2, rrmWpcc = rr * W + 2; cc < W - 2; ++cc, ++rrmWpcc) { - //evaluate pixel for heat/death - float pixdev = cfablur[rrmWpcc]; - - if (pixdev == 0.f) { - continue; - } - - if ((!findDeadPixels) && pixdev < 0) { - continue; - } - - if ((!findHotPixels) && pixdev > 0) { - continue; - } - - pixdev = fabsf(pixdev); - float hfnbrave = -pixdev; - -#ifdef __SSE2__ - // sum up 5*4 = 20 values using SSE - // 10 fabs function calls and 10 float additions with SSE - vfloat sum = vabsf(LVFU(cfablur[(rr - 2) * W + cc - 2])) + vabsf(LVFU(cfablur[(rr - 1) * W + cc - 2])); - sum += vabsf(LVFU(cfablur[(rr) * W + cc - 2])); - sum += vabsf(LVFU(cfablur[(rr + 1) * W + cc - 2])); - sum += vabsf(LVFU(cfablur[(rr + 2) * W + cc - 2])); - // horizontally add the values and add the result to hfnbrave - hfnbrave += vhadd(sum); - - // add remaining 5 values of last column - for (int mm = rr - 2; mm <= rr + 2; ++mm) { - hfnbrave += fabsf(cfablur[mm * W + cc + 2]); - } - -#else - - // 25 fabs function calls and 25 float additions without SSE - for (int mm = rr - 2; mm <= rr + 2; ++mm) { - for (int nn = cc - 2; nn <= cc + 2; ++nn) { - hfnbrave += fabsf(cfablur[mm * W + nn]); + if (lastRow > 0 && lastRow < H - 2) { + //cfa pixel heat/death evaluation + for (int rr = lastRow - 1; rr < lastRow + 1; ++rr) { + const int i = rr + 2; + const int destRow = i % 5; + if (i >= H - 2) { + for (int j = 2; j < W - 2; j++) { + cfablur[destRow][j] = 0.f; + } + } else { + for (int j = 2; j < W - 2; ++j) { + const float temp = median(rawData[i - 2][j - 2], rawData[i - 2][j], rawData[i - 2][j + 2], + rawData[i][j - 2], rawData[i][j], rawData[i][j + 2], + rawData[i + 2][j - 2], rawData[i + 2][j], rawData[i + 2][j + 2]); + cfablur[destRow][j] = rawData[i][j] - temp; } } -#endif + const int rr0 = rr % 5; + for (int cc = 2; cc < W - 2; ++cc) { + //evaluate pixel for heat/death + float pixdev = cfablur[rr0][cc]; - if (pixdev > varthresh * hfnbrave) { - // mark the pixel as "bad" - bpMap.set(cc, rr); - counter++; - } - }//end of pixel evaluation + if (!findDeadPixels && pixdev <= 0.f) { + continue; + } + + if (!findHotPixels && pixdev >= 0.f) { + continue; + } + + pixdev = fabsf(pixdev); + float hfnbrave = -pixdev; + sum5x5(cfablur, cc - 2, hfnbrave); + if (pixdev > varthresh * hfnbrave) { + // mark the pixel as "bad" + bpMap.set(cc, rr); + ++counter; + } + }//end of pixel evaluation + } } }//end of parallel processing - delete [] cfablur; + return counter; } diff --git a/rtengine/cJSON.c b/rtengine/cJSON.c index fb8ce27e8..130c8e2a5 100644 --- a/rtengine/cJSON.c +++ b/rtengine/cJSON.c @@ -445,9 +445,7 @@ static unsigned char* ensure(printbuffer * const p, size_t needed) p->buffer = NULL; return NULL; - } - if (newbuffer) - { + } else { memcpy(newbuffer, p->buffer, p->offset + 1); } p->hooks.deallocate(p->buffer); @@ -1436,7 +1434,7 @@ fail: static cJSON_bool print_array(const cJSON * const item, printbuffer * const output_buffer) { unsigned char *output_pointer = NULL; - size_t length = 0; + size_t length; cJSON *current_element = item->child; if (output_buffer == NULL) diff --git a/rtengine/camconst.json b/rtengine/camconst.json index 9bdd8e1e3..c0d833db7 100644 --- a/rtengine/camconst.json +++ b/rtengine/camconst.json @@ -2516,7 +2516,7 @@ Camera constants: { // Quality C, "make_model": "Sony ILCE-7RM4", - "raw_crop": [ 0, 0, 9568, 0 ] // full raw frame 9600x6376 - 32 rightmost columns are garbage + "raw_crop": [ 0, 0, -32, 0 ] // full raw frame 9600x6376 - 32 rightmost columns are garbage. Using -32 instead of 9568 to support also 16-shot pixelshift files }, { // Quality B, color matrix copied from a7rm2 diff --git a/rtengine/ciecam02.cc b/rtengine/ciecam02.cc index 8314e5e8f..c7e49b2ed 100644 --- a/rtengine/ciecam02.cc +++ b/rtengine/ciecam02.cc @@ -404,7 +404,7 @@ void Ciecam02::calculate_abfloat ( vfloat &aa, vfloat &bb, vfloat h, vfloat e, v #endif void Ciecam02::initcam1float (float yb, float pilotd, float f, float la, float xw, float yw, float zw, float &n, float &d, float &nbb, float &ncb, - float &cz, float &aw, float &wh, float &pfl, float &fl, float &c) + float &cz, float &aw, float &wh, float &pfl, float &fl, float c) { n = yb / yw; diff --git a/rtengine/ciecam02.h b/rtengine/ciecam02.h index 8b532fba0..75ccfaa8c 100644 --- a/rtengine/ciecam02.h +++ b/rtengine/ciecam02.h @@ -84,7 +84,7 @@ public: * Forward transform from XYZ to CIECAM02 JCh. */ static void initcam1float (float yb, float pilotd, float f, float la, float xw, float yw, float zw, float &n, float &d, float &nbb, float &ncb, - float &cz, float &aw, float &wh, float &pfl, float &fl, float &c); + float &cz, float &aw, float &wh, float &pfl, float &fl, float c); static void initcam2float (float yb, float pilotd, float f, float la, float xw, float yw, float zw, float &n, float &d, float &nbb, float &ncb, float &cz, float &aw, float &fl); diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index b8da498b2..d5348286c 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -7015,7 +7015,8 @@ int CLASS parse_tiff (int base) void CLASS apply_tiff() { - int max_samp=0, ties=0, os, ns, raw=-1, thm=-1, i; + int max_samp=0, ties=0, /*os, ns,*/ raw=-1, thm=-1, i; + uint64_t os, ns; // RT struct jhead jh; thumb_misc = 16; @@ -7045,6 +7046,7 @@ void CLASS apply_tiff() } if ((tiff_ifd[i].comp != 6 || tiff_ifd[i].samples != 3) && (tiff_ifd[i].width | tiff_ifd[i].height) < 0x10000 && + (unsigned)tiff_ifd[i].bps < 33 && (unsigned)tiff_ifd[i].samples < 13 && // RT ns && ((ns > os && (ties = 1)) || (ns == os && shot_select == ties++))) { raw_width = tiff_ifd[i].width; @@ -7112,7 +7114,7 @@ void CLASS apply_tiff() load_raw = &CLASS olympus_load_raw; // ------- RT ------- if (!strncmp(make,"SONY",4) && - !strncmp(model,"ILCE-7RM3",9) && + (!strncmp(model,"ILCE-7RM3",9) || !strncmp(model,"ILCE-7RM4",9)) && tiff_samples == 4 && tiff_ifd[raw].bytes == raw_width*raw_height*tiff_samples*2) { load_raw = &CLASS sony_arq_load_raw; diff --git a/rtengine/dcraw.h b/rtengine/dcraw.h index 5b91d7e8b..c18e6c2ff 100644 --- a/rtengine/dcraw.h +++ b/rtengine/dcraw.h @@ -68,6 +68,7 @@ public: gamm[0]=0.45;gamm[1]=4.5;gamm[2]=gamm[3]=gamm[4]=gamm[5]=0; user_mul[0]=user_mul[1]=user_mul[2]=user_mul[3]=0; greybox[0]=greybox[1]=0; greybox[2]=greybox[3]= UINT_MAX; + RT_canon_CR3_data.CR3_CTMDtag = 0; } protected: diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index fd3c42f6e..a6889b954 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -195,18 +195,8 @@ void Crop::update(int todo) params.dirpyrDenoise.getCurves(noiseLCurve, noiseCCurve); - int tilesize; - int overlap; - - if (settings->leveldnti == 0) { - tilesize = 1024; - overlap = 128; - } - - if (settings->leveldnti == 1) { - tilesize = 768; - overlap = 96; - } + const int tilesize = settings->leveldnti == 0 ? 1024 : 768; + const int overlap = settings->leveldnti == 0 ? 128 : 96; int numtiles_W, numtiles_H, tilewidth, tileheight, tileWskip, tileHskip; diff --git a/rtengine/dual_demosaic_RT.cc b/rtengine/dual_demosaic_RT.cc index b5839ee8b..69d1a189a 100644 --- a/rtengine/dual_demosaic_RT.cc +++ b/rtengine/dual_demosaic_RT.cc @@ -66,14 +66,9 @@ void RawImageSource::dual_demosaic_RT(bool isBayer, const procparams::RAWParams return; } - array2D redTmp(winw, winh); - array2D greenTmp(winw, winh); - array2D blueTmp(winw, winh); array2D L(winw, winh); if (isBayer) { - vng4_demosaic(rawData, redTmp, greenTmp, blueTmp); - if (raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::AMAZEVNG4) || raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::PIXELSHIFT)) { amaze_demosaic_RT(0, 0, winw, winh, rawData, red, green, blue, options.chunkSizeAMAZE, options.measure); } else if (raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::DCBVNG4) ) { @@ -87,7 +82,6 @@ void RawImageSource::dual_demosaic_RT(bool isBayer, const procparams::RAWParams } else { xtrans_interpolate (1, false, options.chunkSizeXT, options.measure); } - fast_xtrans_interpolate(rawData, redTmp, greenTmp, blueTmp); } const float xyz_rgb[3][3] = { // XYZ from RGB @@ -114,6 +108,17 @@ void RawImageSource::dual_demosaic_RT(bool isBayer, const procparams::RAWParams buildBlendMask(L, blend, winw, winh, contrastf, 1.f, autoContrast); contrast = contrastf * 100.f; + array2D& redTmp = L; // L is not needed anymore => reuse it + array2D greenTmp(winw, winh); + array2D blueTmp(winw, winh); + + if (isBayer) { + vng4_demosaic(rawData, redTmp, greenTmp, blueTmp); + } else { + fast_xtrans_interpolate(rawData, redTmp, greenTmp, blueTmp); + } + + // the following is split into 3 loops intentionally to avoid cache conflicts on CPUs with only 4-way cache #ifdef _OPENMP #pragma omp parallel for diff --git a/rtengine/image8.cc b/rtengine/image8.cc index 3d0a8df06..66ad8b60f 100644 --- a/rtengine/image8.cc +++ b/rtengine/image8.cc @@ -233,10 +233,10 @@ void Image8::getStdImage (const ColorTemp &ctemp, int tran, Imagefloat* image, P lineB[dst_x] = CLIP(bm * btot); } else { // computing a special factor for this incomplete sub-region - float area = src_sub_width * src_sub_height; - lineR[dst_x] = CLIP(rm2 * rtot / area); - lineG[dst_x] = CLIP(gm2 * gtot / area); - lineB[dst_x] = CLIP(bm2 * btot / area); + float larea = src_sub_width * src_sub_height; + lineR[dst_x] = CLIP(rm2 * rtot / larea); + lineG[dst_x] = CLIP(gm2 * gtot / larea); + lineB[dst_x] = CLIP(bm2 * btot / larea); } } } diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 90d280117..a4ca0ea0b 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -230,9 +230,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) MyMutex::MyLock processingLock(mProcessing); - constexpr int numofphases = 14; - int readyphase = 0; - bool highDetailNeeded = options.prevdemo == PD_Sidecar ? true : (todo & M_HIGHQUAL); // Check if any detail crops need high detail. If not, take a fast path short cut @@ -273,8 +270,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) //rp.deadPixelFilter = rp.hotPixelFilter = false; } - progress("Applying white balance, color correction & sRGB conversion...", 100 * readyphase / numofphases); - if (frameCountListener) { frameCountListener->FrameCountChanged(imgsrc->getFrameCount(), params->raw.bayersensor.imageNum); } @@ -533,8 +528,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) ipf.firstAnalysis(orig_prev, *params, vhist16); } - readyphase++; - if ((todo & M_HDR) && (params->fattal.enabled || params->dehaze.enabled)) { if (fattal_11_dcrop_cache) { delete fattal_11_dcrop_cache; @@ -551,7 +544,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) oprevi = orig_prev; - progress("Rotate / Distortion...", 100 * readyphase / numofphases); // Remove transformation if unneeded bool needstransform = ipf.needsTransform(); @@ -577,11 +569,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) ipf.lab2rgb(labcbdl, *oprevi, params->icm.workingProfile); } - readyphase++; - progress("Preparing shadow/highlight map...", 100 * readyphase / numofphases); - - readyphase++; - if (todo & M_AUTOEXP) { if (params->toneCurve.autoexp) { LUTu aehist; @@ -618,8 +605,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) } } - progress("Exposure curve & CIELAB conversion...", 100 * readyphase / numofphases); - if (todo & (M_AUTOEXP | M_RGBCURVE)) { if (params->icm.workingTRC == "Custom") { //exec TRC IN free if (oprevi == orig_prev) { @@ -767,8 +752,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) params->crop.mapToResized(pW, pH, scale, x1, x2, y1, y2); } - readyphase++; - if (todo & (M_LUMACURVE | M_CROP)) { LUTu lhist16(32768); lhist16.clear(); @@ -811,8 +794,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) if (todo & (M_LUMINANCE + M_COLOR)) { nprevl->CopyFrom(oprevl); - progress("Applying Color Boost...", 100 * readyphase / numofphases); - histCCurve.clear(); histLCurve.clear(); ipf.chromiLuminanceCurve(nullptr, pW, nprevl, nprevl, chroma_acurve, chroma_bcurve, satcurve, lhskcurve, clcurve, lumacurve, utili, autili, butili, ccutili, cclutili, clcutili, histCCurve, histLCurve); @@ -823,72 +804,22 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) ipf.EPDToneMap(nprevl, 0, scale); } - // for all treatments Defringe, Sharpening, Contrast detail , Microcontrast they are activated if "CIECAM" function are disabled - readyphase++; - - /* Issue 2785, disabled some 1:1 tools - if (scale==1) { - if((params->colorappearance.enabled && !settings->autocielab) || (!params->colorappearance.enabled)){ - progress ("Denoising luminance impulse...",100*readyphase/numofphases); - ipf.impulsedenoise (nprevl); - readyphase++; - } - if((params->colorappearance.enabled && !settings->autocielab) || (!params->colorappearance.enabled)){ - progress ("Defringing...",100*readyphase/numofphases); - ipf.defringe (nprevl); - readyphase++; - } - if (params->sharpenEdge.enabled) { - progress ("Edge sharpening...",100*readyphase/numofphases); - ipf.MLsharpen (nprevl); - readyphase++; - } - if (params->sharpenMicro.enabled) { - if(( params->colorappearance.enabled && !settings->autocielab) || (!params->colorappearance.enabled)){ - progress ("Microcontrast...",100*readyphase/numofphases); - ipf.MLmicrocontrast (nprevl); - readyphase++; - } - } - if(((params->colorappearance.enabled && !settings->autocielab) || (!params->colorappearance.enabled)) && params->sharpening.enabled) { - progress ("Sharpening...",100*readyphase/numofphases); - - float **buffer = new float*[pH]; - for (int i=0; idirpyrequalizer.cbdlMethod == "aft") { if (((params->colorappearance.enabled && !settings->autocielab) || (!params->colorappearance.enabled))) { - progress("Pyramid wavelet...", 100 * readyphase / numofphases); ipf.dirpyrequalizer(nprevl, scale); - //ipf.Lanczoslab (ip_wavelet(LabImage * lab, LabImage * dst, const procparams::EqualizerParams & eqparams), nprevl, 1.f/scale); - readyphase++; } } wavcontlutili = false; - //CurveFactory::curveWavContL ( wavcontlutili,params->wavelet.lcurve, wavclCurve, LUTu & histogramwavcl, LUTu & outBeforeWavCLurveHistogram,int skip); CurveFactory::curveWavContL(wavcontlutili, params->wavelet.wavclCurve, wavclCurve, scale == 1 ? 1 : 16); if ((params->wavelet.enabled)) { WaveletParams WaveParams = params->wavelet; - // WaveParams.getCurves(wavCLVCurve, waOpacityCurveRG, waOpacityCurveBY); WaveParams.getCurves(wavCLVCurve, waOpacityCurveRG, waOpacityCurveBY, waOpacityCurveW, waOpacityCurveWL); int kall = 0; - progress("Wavelet...", 100 * readyphase / numofphases); - // ipf.ip_wavelet(nprevl, nprevl, kall, WaveParams, wavCLVCurve, waOpacityCurveRG, waOpacityCurveBY, scale); ipf.ip_wavelet(nprevl, nprevl, kall, WaveParams, wavCLVCurve, waOpacityCurveRG, waOpacityCurveBY, waOpacityCurveW, waOpacityCurveWL, wavclCurve, scale); } @@ -896,7 +827,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) ipf.softLight(nprevl); if (params->colorappearance.enabled) { - //L histo and Chroma histo for ciecam + // L histo and Chroma histo for ciecam // histogram well be for Lab (Lch) values, because very difficult to do with J,Q, M, s, C int x1, y1, x2, y2; params->crop.mapToResized(pW, pH, scale, x1, x2, y1, y2); @@ -977,8 +908,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) if (params->colorappearance.autoybscen && acListener && params->colorappearance.enabled) { acListener->ybCamChanged((int) yb); //real value Yb scene } - - readyphase++; } else { // CIECAM is disabled, we free up its image buffer to save some space if (ncie) { @@ -1013,8 +942,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) } if (panningRelatedChange || (todo & M_MONITOR)) { - progress("Conversion to RGB...", 100 * readyphase / numofphases); - if ((todo != CROP && todo != MINUPDATE) || (todo & M_MONITOR)) { MyMutex::MyLock prevImgLock(previmg->getMutex()); @@ -1026,7 +953,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) delete workimg; workimg = ipf.lab2rgb(nprevl, 0, 0, pW, pH, params->icm); } catch (char * str) { - progress("Error converting file...", 0); return; } } @@ -1045,8 +971,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) imageListener->imageReady(params->crop); } - readyphase++; - if (hListener) { updateLRGBHistograms(); hListener->histogramChanged(histRed, histGreen, histBlue, histLuma, histToneCurve, histLCurve, histCCurve, /*histCLurve, histLLCurve,*/ histLCAM, histCCAM, histRedRaw, histGreenRaw, histBlueRaw, histChroma, histLRETI); @@ -1209,15 +1133,6 @@ void ImProcCoordinator::updateLRGBHistograms() } -void ImProcCoordinator::progress(Glib::ustring str, int pr) -{ - - /* if (plistener) { - plistener->setProgressStr (str); - plistener->setProgress ((double)pr / 100.0); - }*/ -} - bool ImProcCoordinator::getAutoWB(double& temp, double& green, double equal, double tempBias) { diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index c27cfe76e..96d1f80ce 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -186,7 +186,6 @@ protected: MyMutex minit; // to gain mutually exclusive access to ... to what exactly? - void progress (Glib::ustring str, int pr); void reallocAll (); void updateLRGBHistograms (); void setScale (int prevscale); diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index e10d7f690..40c2de0bd 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -869,7 +869,9 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw mean = (sum / ((height) * width)) / 327.68f; //for Yb for all image...if one day "pipette" we can adapt Yb for each zone } } - +#ifdef _OPENMP + static_cast(numThreads); // to silence cppcheck warning +#endif //evaluate lightness, contrast } @@ -1469,8 +1471,8 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw if (ciedata) { //only with improccoordinator // Data for J Q M s and C histograms int posl, posc; - float brli = 327.f; - float chsacol = 327.f; + float brli; + float chsacol; float libr; float colch; @@ -2049,17 +2051,25 @@ filmlike_clip (float *r, float *g, float *b) } } -void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, - int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clToningcurve, LUTf & cl2Toningcurve, - const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2, const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, DCPProfile *dcpProf, const DCPProfileApplyState &asIn, LUTu &histToneCurve, size_t chunkSize, bool measure) +void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, const LUTf& hltonecurve, const LUTf& shtonecurve, const LUTf& tonecurve, + int sat, const LUTf& rCurve, const LUTf& gCurve, const LUTf& bCurve, float satLimit, float satLimitOpacity, + const ColorGradientCurve& ctColorCurve, const OpacityCurve& ctOpacityCurve, bool opautili, const LUTf& clToningcurve, const LUTf& cl2Toningcurve, + const ToneCurve& customToneCurve1, const ToneCurve& customToneCurve2, const ToneCurve& customToneCurvebw1, const ToneCurve& customToneCurvebw2, + double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, DCPProfile *dcpProf, const DCPProfileApplyState& asIn, + LUTu& histToneCurve, size_t chunkSize, bool measure) { - rgbProc (working, lab, pipetteBuffer, hltonecurve, shtonecurve, tonecurve, sat, rCurve, gCurve, bCurve, satLimit, satLimitOpacity, ctColorCurve, ctOpacityCurve, opautili, clToningcurve, cl2Toningcurve, customToneCurve1, customToneCurve2, customToneCurvebw1, customToneCurvebw2, rrm, ggm, bbm, autor, autog, autob, params->toneCurve.expcomp, params->toneCurve.hlcompr, params->toneCurve.hlcomprthresh, dcpProf, asIn, histToneCurve, chunkSize, measure); + rgbProc(working, lab, pipetteBuffer, hltonecurve, shtonecurve, tonecurve, sat, rCurve, gCurve, bCurve, satLimit, satLimitOpacity, ctColorCurve, ctOpacityCurve, opautili, + clToningcurve, cl2Toningcurve, customToneCurve1, customToneCurve2, customToneCurvebw1, customToneCurvebw2, rrm, ggm, bbm, autor, autog, autob, + params->toneCurve.expcomp, params->toneCurve.hlcompr, params->toneCurve.hlcomprthresh, dcpProf, asIn, histToneCurve, chunkSize, measure); } // Process RGB image and convert to LAB space -void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, - int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clToningcurve, LUTf & cl2Toningcurve, - const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2, const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, double expcomp, int hlcompr, int hlcomprthresh, DCPProfile *dcpProf, const DCPProfileApplyState &asIn, LUTu &histToneCurve, size_t chunkSize, bool measure) +void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, const LUTf& hltonecurve, const LUTf& shtonecurve, const LUTf& tonecurve, + int sat, const LUTf& rCurve, const LUTf& gCurve, const LUTf& bCurve, float satLimit, float satLimitOpacity, + const ColorGradientCurve& ctColorCurve, const OpacityCurve& ctOpacityCurve, bool opautili, const LUTf& clToningcurve, const LUTf& cl2Toningcurve, + const ToneCurve& customToneCurve1, const ToneCurve& customToneCurve2, const ToneCurve& customToneCurvebw1, const ToneCurve& customToneCurvebw2, + double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, double expcomp, int hlcompr, int hlcomprthresh, + DCPProfile *dcpProf, const DCPProfileApplyState& asIn, LUTu& histToneCurve, size_t chunkSize, bool measure) { std::unique_ptr stop; @@ -3758,10 +3768,9 @@ void ImProcFunctions::toningsmh(float r, float g, float b, float &ro, float &go, float rlo; //0.4 0.5 float rlm; //1.1 float rlh; //1.1 - float rlob; //for BW old mode if (mode == 0) { //colour - rlo = rlob = strProtect; //0.5 ==> 0.75 + rlo = strProtect; //0.5 ==> 0.75 rlh = 2.2f * strProtect; rlm = 1.5f * strProtect; constexpr float v0 = 0.15f; @@ -3778,7 +3787,6 @@ void ImProcFunctions::toningsmh(float r, float g, float b, float &ro, float &go, } } else { //bw coefficient to preserve same results as before for satlimtopacity = 0.5 (default) rlo = strProtect * 0.8f; //0.4 - rlob = strProtect; //0.5 rlm = strProtect * 2.2f; //1.1 rlh = strProtect * 2.4f; //1.2 if (v > 0.15f) { @@ -4080,7 +4088,7 @@ void ImProcFunctions::toning2col (float r, float g, float b, float &ro, float &g * @param iplow iphigh [0..1] luminance * @param wp wip 3x3 matrix and inverse conversion rgb XYZ **/ -void ImProcFunctions::labtoning (float r, float g, float b, float &ro, float &go, float &bo, int algm, int metchrom, int twoc, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, LUTf & clToningcurve, LUTf & cl2Toningcurve, float iplow, float iphigh, double wp[3][3], double wip[3][3] ) +void ImProcFunctions::labtoning (float r, float g, float b, float &ro, float &go, float &bo, int algm, int metchrom, int twoc, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, const LUTf & clToningcurve, const LUTf & cl2Toningcurve, float iplow, float iphigh, double wp[3][3], double wip[3][3] ) { ro = CLIP(r); go = CLIP(g); @@ -4139,7 +4147,7 @@ void ImProcFunctions::labtoning (float r, float g, float b, float &ro, float &go } -void ImProcFunctions::luminanceCurve (LabImage* lold, LabImage* lnew, LUTf & curve) +void ImProcFunctions::luminanceCurve (LabImage* lold, LabImage* lnew, const LUTf& curve) { int W = lold->W; @@ -4159,7 +4167,7 @@ void ImProcFunctions::luminanceCurve (LabImage* lold, LabImage* lnew, LUTf & cur -void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW, LabImage* lold, LabImage* lnew, LUTf & acurve, LUTf & bcurve, LUTf & satcurve, LUTf & lhskcurve, LUTf & clcurve, LUTf & curve, bool utili, bool autili, bool butili, bool ccutili, bool cclutili, bool clcutili, LUTu &histCCurve, LUTu &histLCurve) +void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW, LabImage* lold, LabImage* lnew, const LUTf& acurve, const LUTf& bcurve, const LUTf& satcurve, const LUTf& lhskcurve, const LUTf& clcurve, LUTf & curve, bool utili, bool autili, bool butili, bool ccutili, bool cclutili, bool clcutili, LUTu &histCCurve, LUTu &histLCurve) { int W = lold->W; @@ -5353,7 +5361,7 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double int imax = 65536 >> histcompr; int overex = 0; float sum = 0.f, hisum = 0.f, losum = 0.f; - float ave = 0.f, hidev = 0.f, lodev = 0.f; + float ave = 0.f; //find average luminance histogram.getSumAndAverage (sum, ave); @@ -5381,36 +5389,32 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double float octile[8] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}, ospread = 0.f; count = 0; - int i = 0; + int j = 0; - for (; i < min ((int)ave, imax); i++) { + for (; j < min ((int)ave, imax); ++j) { if (count < 8) { - octile[count] += histogram[i]; + octile[count] += histogram[j]; if (octile[count] > sum / 8.f || (count == 7 && octile[count] > sum / 16.f)) { - octile[count] = xlog (1. + (float)i) / log (2.f); + octile[count] = xlog (1. + j) / log (2.f); count++;// = min(count+1,7); } } - //lodev += SQR(ave-i)*histogram[i]; - lodev += (xlog (ave + 1.f) - xlog ((float)i + 1.)) * histogram[i]; - losum += histogram[i]; + losum += histogram[j]; } - for (; i < imax; i++) { + for (; j < imax; ++j) { if (count < 8) { - octile[count] += histogram[i]; + octile[count] += histogram[j]; if (octile[count] > sum / 8.f || (count == 7 && octile[count] > sum / 16.f)) { - octile[count] = xlog (1. + (float)i) / log (2.f); + octile[count] = xlog (1. + j) / log (2.f); count++;// = min(count+1,7); } } - //hidev += SQR(i-ave)*histogram[i]; - hidev += (xlog ((float)i + 1.) - xlog (ave + 1.f)) * histogram[i]; - hisum += histogram[i]; + hisum += histogram[j]; } diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 2229987a1..661f399ef 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -23,7 +23,6 @@ #include "coord2d.h" #include "gamutwarning.h" #include "pipettebuffer.h" -#include "shmap.h" template class LUT; @@ -125,14 +124,19 @@ public: void firstAnalysis(const Imagefloat* const working, const procparams::ProcParams ¶ms, LUTu & vhist16); void updateColorProfiles(const Glib::ustring& monitorProfile, RenderingIntent monitorIntent, bool softProof, bool gamutCheck); - void rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, - int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clcurve, LUTf & cl2curve, const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2, - const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, DCPProfile *dcpProf, const DCPProfileApplyState &asIn, LUTu &histToneCurve, size_t chunkSize = 1, bool measure = false); - void rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, - int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clcurve, LUTf & cl2curve, const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2, - const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, - double expcomp, int hlcompr, int hlcomprthresh, DCPProfile *dcpProf, const DCPProfileApplyState &asIn, LUTu &histToneCurve, size_t chunkSize = 1, bool measure = false); - void labtoning(float r, float g, float b, float &ro, float &go, float &bo, int algm, int metchrom, int twoc, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, LUTf & clToningcurve, LUTf & cl2Toningcurve, float iplow, float iphigh, double wp[3][3], double wip[3][3]); + void rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, const LUTf& hltonecurve, const LUTf& shtonecurve, const LUTf& tonecurve, + int sat, const LUTf& rCurve, const LUTf& gCurve, const LUTf& bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve& ctColorCurve, + const OpacityCurve& ctOpacityCurve, bool opautili, const LUTf& clcurve, const LUTf& cl2curve, const ToneCurve& customToneCurve1, + const ToneCurve& customToneCurve2, const ToneCurve& customToneCurvebw1, const ToneCurve& customToneCurvebw2, + double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, DCPProfile *dcpProf, + const DCPProfileApplyState& asIn, LUTu& histToneCurve, size_t chunkSize = 1, bool measure = false); + void rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, const LUTf& hltonecurve, const LUTf& shtonecurve, const LUTf& tonecurve, + int sat, const LUTf& rCurve, const LUTf& gCurve, const LUTf& bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve& ctColorCurve, + const OpacityCurve& ctOpacityCurve, bool opautili, const LUTf& clcurve, const LUTf& cl2curve, const ToneCurve& customToneCurve1, + const ToneCurve& customToneCurve2, const ToneCurve& customToneCurvebw1, const ToneCurve& customToneCurvebw2, + double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, double expcomp, int hlcompr, + int hlcomprthresh, DCPProfile *dcpProf, const DCPProfileApplyState& asIn, LUTu& histToneCurve, size_t chunkSize = 1, bool measure = false); + void labtoning(float r, float g, float b, float &ro, float &go, float &bo, int algm, int metchrom, int twoc, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, const LUTf & clToningcurve, const LUTf & cl2Toningcurve, float iplow, float iphigh, double wp[3][3], double wip[3][3]); void toning2col(float r, float g, float b, float &ro, float &go, float &bo, float iplow, float iphigh, float rl, float gl, float bl, float rh, float gh, float bh, float SatLow, float SatHigh, float balanS, float balanH, float reducac, int mode, int preser, float strProtect); void toningsmh(float r, float g, float b, float &ro, float &go, float &bo, float RedLow, float GreenLow, float BlueLow, float RedMed, float GreenMed, float BlueMed, float RedHigh, float GreenHigh, float BlueHigh, float reducac, int mode, float strProtect); void toningsmh2(float r, float g, float b, float &ro, float &go, float &bo, float low[3], float satLow, float med[3], float satMed, float high[3], float satHigh, float reducac, int mode, int preser); @@ -142,12 +146,12 @@ public: void retreavergb(float &r, float &g, float &b); void moyeqt(Imagefloat* working, float &moyS, float &eqty); - void luminanceCurve(LabImage* lold, LabImage* lnew, LUTf &curve); + void luminanceCurve(LabImage* lold, LabImage* lnew, const LUTf &curve); void ciecam_02float(CieImage* ncie, float adap, int pW, int pwb, LabImage* lab, const procparams::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, bool execsharp, float &d, float &dj, float &yb, int rtt, bool showSharpMask = false); - void chromiLuminanceCurve(PipetteBuffer *pipetteBuffer, 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 &histLurve); + void chromiLuminanceCurve(PipetteBuffer *pipetteBuffer, int pW, LabImage* lold, LabImage* lnew, const LUTf& acurve, const LUTf& bcurve, const LUTf& satcurve, const LUTf& satclcurve, const LUTf& clcurve, LUTf &curve, bool utili, bool autili, bool butili, bool ccutili, bool cclutili, bool clcutili, LUTu &histCCurve, LUTu &histLurve); void vibrance(LabImage* lab); //Jacques' vibrance // void colorCurve (LabImage* lold, LabImage* lnew); void sharpening(LabImage* lab, const procparams::SharpeningParams &sharpenParam, bool showMask = false); diff --git a/rtengine/ipretinex.cc b/rtengine/ipretinex.cc index b5d504a99..84f33482f 100644 --- a/rtengine/ipretinex.cc +++ b/rtengine/ipretinex.cc @@ -51,6 +51,7 @@ #include "procparams.h" #include "rawimagesource.h" #include "rtengine.h" +#include "shmap.h" #include "StopWatch.h" namespace diff --git a/rtengine/iptransform.cc b/rtengine/iptransform.cc index a4f304413..b1531cc9c 100644 --- a/rtengine/iptransform.cc +++ b/rtengine/iptransform.cc @@ -220,7 +220,7 @@ bool ImProcFunctions::transCoord (int W, int H, const std::vector &src, blue.push_back (Coord2D (src[i].x, src[i].y)); } - return clipped; + return false; } double oW = W, oH = H; diff --git a/rtengine/lcp.cc b/rtengine/lcp.cc index 57a87c1f1..7fec79717 100644 --- a/rtengine/lcp.cc +++ b/rtengine/lcp.cc @@ -27,7 +27,6 @@ #ifdef WIN32 #include -#include #endif #include "lcp.h" diff --git a/rtengine/mytime.h b/rtengine/mytime.h index 80fb0899a..787fefcc3 100644 --- a/rtengine/mytime.h +++ b/rtengine/mytime.h @@ -19,7 +19,7 @@ #pragma once #ifdef WIN32 -#include +#include #elif defined __APPLE__ #include #else diff --git a/rtengine/panasonic_decoders.cc b/rtengine/panasonic_decoders.cc index 37f586a6b..bbbfb7c20 100644 --- a/rtengine/panasonic_decoders.cc +++ b/rtengine/panasonic_decoders.cc @@ -64,7 +64,7 @@ class pana_cs6_page_decoder unsigned char current, *buffer; public: pana_cs6_page_decoder(unsigned char *_buffer, unsigned int bsize) - : lastoffset(0), maxoffset(bsize), current(0), buffer(_buffer) + : pixelbuffer{}, lastoffset(0), maxoffset(bsize), current(0), buffer(_buffer) { } void read_page(); // will throw IO error if not enough space in buffer diff --git a/rtengine/pdaflinesfilter.cc b/rtengine/pdaflinesfilter.cc index 8ac0d3091..1eddbc1ea 100644 --- a/rtengine/pdaflinesfilter.cc +++ b/rtengine/pdaflinesfilter.cc @@ -206,7 +206,7 @@ std::unique_ptr PDAFLinesFilter::lineD } -int PDAFLinesFilter::markLine(array2D &rawData, PixelsMap &bpMap, int y) +int PDAFLinesFilter::markLine(const array2D &rawData, PixelsMap &bpMap, int y) { rowmap_.clear(); rowmap_.resize((W_+1)/2, false); @@ -258,7 +258,7 @@ int PDAFLinesFilter::markLine(array2D &rawData, PixelsMap &bpMap, int y) } -int PDAFLinesFilter::mark(array2D &rawData, PixelsMap &bpMap) +int PDAFLinesFilter::mark(const array2D &rawData, PixelsMap &bpMap) { if (pattern_.empty()) { diff --git a/rtengine/pdaflinesfilter.h b/rtengine/pdaflinesfilter.h index c3d8b47f4..707eb9371 100644 --- a/rtengine/pdaflinesfilter.h +++ b/rtengine/pdaflinesfilter.h @@ -36,12 +36,12 @@ public: explicit PDAFLinesFilter(RawImage *ri); ~PDAFLinesFilter(); - int mark(array2D &rawData, PixelsMap &bpMap); + int mark(const array2D &rawData, PixelsMap &bpMap); RawImageSource::GreenEqulibrateThreshold &greenEqThreshold(); std::unique_ptr lineDenoiseRowBlender(); private: - int markLine(array2D &rawData, PixelsMap &bpMap, int y); + int markLine(const array2D& rawData, PixelsMap &bpMap, int y); RawImage *ri_; int W_; diff --git a/rtengine/pixelshift.cc b/rtengine/pixelshift.cc index ff529697b..2e98b7b22 100644 --- a/rtengine/pixelshift.cc +++ b/rtengine/pixelshift.cc @@ -339,6 +339,8 @@ BENCHFUN lmmse_interpolate_omp(winw, winh, *(rawDataFrames[0]), red, green, blue, bayerParams.lmmse_iterations); } else if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(procparams::RAWParams::BayerSensor::PSDemosaicMethod::AMAZEVNG4)) { dual_demosaic_RT (true, rawParamsIn, winw, winh, *(rawDataFrames[0]), red, green, blue, bayerParams.dualDemosaicContrast, true); + } else if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(procparams::RAWParams::BayerSensor::PSDemosaicMethod::RCDVNG4)) { + dual_demosaic_RT (true, rawParamsIn, winw, winh, *(rawDataFrames[0]), red, green, blue, bayerParams.dualDemosaicContrast, true); } else { amaze_demosaic_RT(winx, winy, winw, winh, *(rawDataFrames[0]), red, green, blue, options.chunkSizeAMAZE, options.measure); } @@ -351,6 +353,8 @@ BENCHFUN lmmse_interpolate_omp(winw, winh, *(rawDataFrames[i + 1]), redTmp[i], greenTmp[i], blueTmp[i], bayerParams.lmmse_iterations); } else if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(procparams::RAWParams::BayerSensor::PSDemosaicMethod::AMAZEVNG4)) { dual_demosaic_RT (true, rawParamsIn, winw, winh, *(rawDataFrames[i + 1]), redTmp[i], greenTmp[i], blueTmp[i], bayerParams.dualDemosaicContrast, true); + } else if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(procparams::RAWParams::BayerSensor::PSDemosaicMethod::RCDVNG4)) { + dual_demosaic_RT (true, rawParamsIn, winw, winh, *(rawDataFrames[i + 1]), redTmp[i], greenTmp[i], blueTmp[i], bayerParams.dualDemosaicContrast, true); } else { amaze_demosaic_RT(winx, winy, winw, winh, *(rawDataFrames[i + 1]), redTmp[i], greenTmp[i], blueTmp[i], options.chunkSizeAMAZE, options.measure); } @@ -380,6 +384,10 @@ BENCHFUN procparams::RAWParams rawParamsTmp = rawParamsIn; rawParamsTmp.bayersensor.method = procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::AMAZEVNG4); dual_demosaic_RT (true, rawParamsTmp, winw, winh, rawData, red, green, blue, bayerParams.dualDemosaicContrast, true); + } else if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(procparams::RAWParams::BayerSensor::PSDemosaicMethod::RCDVNG4)) { + procparams::RAWParams rawParamsTmp = rawParamsIn; + rawParamsTmp.bayersensor.method = procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::RCDVNG4); + dual_demosaic_RT (true, rawParamsTmp, winw, winh, rawData, red, green, blue, bayerParams.dualDemosaicContrast, true); } else { amaze_demosaic_RT(winx, winy, winw, winh, rawData, red, green, blue, options.chunkSizeAMAZE, options.measure); } diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 9483c6a02..ba6fc237b 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2672,6 +2672,7 @@ const std::vector& RAWParams::BayerSensor::getPSDemosaicMethodStrin static const std::vector method_strings { "amaze", "amazevng4", + "rcdvng4", "lmmse" }; return method_strings; diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 01c54ffc5..c41e55872 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1388,6 +1388,7 @@ struct RAWParams { enum class PSDemosaicMethod { AMAZE, AMAZEVNG4, + RCDVNG4, LMMSE }; diff --git a/rtengine/shmap.cc b/rtengine/shmap.cc index 44096d965..abdcc42a4 100644 --- a/rtengine/shmap.cc +++ b/rtengine/shmap.cc @@ -351,7 +351,7 @@ void SHMap::forceStat (float max_, float min_, float avg_) avg = avg_; } -void SHMap::dirpyr_shmap(float ** data_fine, float ** data_coarse, int width, int height, LUTf & rangefn, int level, int scale) +void SHMap::dirpyr_shmap(float ** data_fine, float ** data_coarse, int width, int height, const LUTf& rangefn, int level, int scale) { //scale is spacing of directional averaging weights diff --git a/rtengine/shmap.h b/rtengine/shmap.h index 5373b8302..68e352b23 100644 --- a/rtengine/shmap.h +++ b/rtengine/shmap.h @@ -50,7 +50,7 @@ private: void fillLuminance( Imagefloat * img, float **luminance, double lumi[3] ); void fillLuminanceL( float ** L, float **luminance ); - void dirpyr_shmap(float ** data_fine, float ** data_coarse, int width, int height, LUTf & rangefn, int level, int scale); + void dirpyr_shmap(float ** data_fine, float ** data_coarse, int width, int height, const LUTf& rangefn, int level, int scale); }; diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 3c89fe48d..c35fc7431 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -802,17 +802,7 @@ private: void stage_denoise() { - procparams::ProcParams& params = job->pparams; - //ImProcFunctions ipf (¶ms, true); - ImProcFunctions &ipf = * (ipf_p.get()); - - // perform luma/chroma denoise -// CieImage *cieView; -// NoisCurve noiseLCurve; -// bool lldenoiseutili=false; -// Imagefloat *calclum ; -// params.dirpyrDenoise.getCurves(noiseLCurve, lldenoiseutili); -// if (params.dirpyrDenoise.enabled && lldenoiseutili) { + const procparams::ProcParams& params = job->pparams; DirPyrDenoiseParams denoiseParams = params.dirpyrDenoise; // make a copy because we cheat here @@ -845,9 +835,7 @@ private: } if (denoiseParams.enabled) { - // CurveFactory::denoiseLL(lldenoiseutili, denoiseParams.lcurve, Noisecurve,1); - //denoiseParams.getCurves(noiseLCurve); -// ipf.RGB_denoise(baseImg, baseImg, calclum, imgsrc->isRAW(), denoiseParams, params.defringe, imgsrc->getDirPyrDenoiseExpComp(), noiseLCurve, lldenoiseutili); + ImProcFunctions &ipf = * (ipf_p.get()); float nresi, highresi; int kall = 2; ipf.RGB_denoise (kall, baseImg, baseImg, calclum, ch_M, max_r, max_b, imgsrc->isRAW(), denoiseParams, imgsrc->getDirPyrDenoiseExpComp(), noiseLCurve, noiseCCurve, nresi, highresi); @@ -869,7 +857,7 @@ private: void stage_transform() { - procparams::ProcParams& params = job->pparams; + const procparams::ProcParams& params = job->pparams; //ImProcFunctions ipf (¶ms, true); ImProcFunctions &ipf = * (ipf_p.get()); @@ -1084,13 +1072,10 @@ private: ipf.vibrance (labView); ipf.labColorCorrectionRegions(labView); - if ((params.colorappearance.enabled && !settings->autocielab) || (!params.colorappearance.enabled)) { - ipf.impulsedenoise (labView); - } - // for all treatments Defringe, Sharpening, Contrast detail ,Microcontrast they are activated if "CIECAM" function are disabled if ((params.colorappearance.enabled && !settings->autocielab) || (!params.colorappearance.enabled)) { + ipf.impulsedenoise (labView); ipf.defringe (labView); } diff --git a/rtgui/adjuster.cc b/rtgui/adjuster.cc index 302a2de00..2267a9fc1 100644 --- a/rtgui/adjuster.cc +++ b/rtgui/adjuster.cc @@ -246,7 +246,7 @@ void Adjuster::autoToggled () } if (adjusterListener != nullptr && !blocked) { - adjusterListener->adjusterAutoToggled(this, automatic->get_active()); + adjusterListener->adjusterAutoToggled(this); } } @@ -493,7 +493,7 @@ bool Adjuster::notifyListenerAutoToggled () { if (adjusterListener != nullptr && !blocked) { - adjusterListener->adjusterAutoToggled(this, automatic->get_active()); + adjusterListener->adjusterAutoToggled(this); } return false; diff --git a/rtgui/adjuster.h b/rtgui/adjuster.h index 9800dbac8..59250bc81 100644 --- a/rtgui/adjuster.h +++ b/rtgui/adjuster.h @@ -28,7 +28,7 @@ class AdjusterListener public: virtual ~AdjusterListener() = default; virtual void adjusterChanged (Adjuster* a, double newval) = 0; - virtual void adjusterAutoToggled (Adjuster* a, bool newval) {} + virtual void adjusterAutoToggled (Adjuster* a) {} }; typedef double(*double2double_fun)(double val); diff --git a/rtgui/batchqueue.cc b/rtgui/batchqueue.cc index afbec9efb..8b4583877 100644 --- a/rtgui/batchqueue.cc +++ b/rtgui/batchqueue.cc @@ -147,7 +147,7 @@ int BatchQueue::getThumbnailHeight () return std::max(std::min(options.thumbSizeQueue, 200), 10); } -void BatchQueue::rightClicked (ThumbBrowserEntryBase* entry) +void BatchQueue::rightClicked () { pmenu.popup (3, this->eventTime); } @@ -344,9 +344,8 @@ bool BatchQueue::loadBatchQueue () auto job = rtengine::ProcessingJob::create (source, thumb->getType () == FT_Raw, pparams, fast); - auto prevh = getMaxThumbnailHeight (); - auto prevw = prevh; - thumb->getThumbnailSize (prevw, prevh, &pparams); + const auto prevh = getMaxThumbnailHeight (); + const auto prevw = thumb->getThumbnailWidth(prevh, &pparams); auto entry = new BatchQueueEntry (job, pparams, source, prevw, prevh, thumb, options.overwriteOutputFile); thumb->decreaseRef (); // Removing the refCount acquired by cacheMgr->getEntry diff --git a/rtgui/batchqueue.h b/rtgui/batchqueue.h index f0289faa4..5cde37748 100644 --- a/rtgui/batchqueue.h +++ b/rtgui/batchqueue.h @@ -74,7 +74,7 @@ public: void error(const Glib::ustring& descr) override; rtengine::ProcessingJob* imageReady(rtengine::IImagefloat* img) override; - void rightClicked (ThumbBrowserEntryBase* entry) override; + void rightClicked () override; void doubleClicked (ThumbBrowserEntryBase* entry) override; bool keyPressed (GdkEventKey* event) override; void buttonPressed (LWButton* button, int actionCode, void* actionData) override; diff --git a/rtgui/batchqueuepanel.cc b/rtgui/batchqueuepanel.cc index 9107aaaa8..f7a73a30b 100644 --- a/rtgui/batchqueuepanel.cc +++ b/rtgui/batchqueuepanel.cc @@ -18,7 +18,6 @@ */ #include "batchqueuepanel.h" #include "options.h" -#include "preferences.h" #include "multilangmgr.h" #include "rtwindow.h" #include "soundman.h" diff --git a/rtgui/bayerprocess.cc b/rtgui/bayerprocess.cc index 4a57177e1..5b5cfe9c4 100644 --- a/rtgui/bayerprocess.cc +++ b/rtgui/bayerprocess.cc @@ -672,7 +672,7 @@ void BayerProcess::checkBoxToggled (CheckBox* c, CheckValue newval) } } -void BayerProcess::adjusterAutoToggled(Adjuster* a, bool newval) +void BayerProcess::adjusterAutoToggled(Adjuster* a) { if (multiImage) { if (dualDemosaicContrast->getAutoInconsistent()) { diff --git a/rtgui/bayerprocess.h b/rtgui/bayerprocess.h index 5c7498986..f8348e02b 100644 --- a/rtgui/bayerprocess.h +++ b/rtgui/bayerprocess.h @@ -88,7 +88,7 @@ public: void methodChanged(); void imageNumberChanged(); void adjusterChanged(Adjuster* a, double newval) override; - void adjusterAutoToggled (Adjuster* a, bool newval) override; + void adjusterAutoToggled (Adjuster* a) override; void checkBoxToggled(CheckBox* c, CheckValue newval) override; void pixelShiftMotionMethodChanged(); void pixelShiftDemosaicMethodChanged(); diff --git a/rtgui/cachemanager.cc b/rtgui/cachemanager.cc index 9f6e111e5..c37964e23 100644 --- a/rtgui/cachemanager.cc +++ b/rtgui/cachemanager.cc @@ -25,7 +25,7 @@ #include #ifdef WIN32 -#include +#include #endif #include "cachemanager.h" diff --git a/rtgui/colorappearance.cc b/rtgui/colorappearance.cc index 9a6bee524..62f6eee2c 100644 --- a/rtgui/colorappearance.cc +++ b/rtgui/colorappearance.cc @@ -1565,7 +1565,7 @@ void ColorAppearance::adjusterChanged(Adjuster* a, double newval) } } -void ColorAppearance::adjusterAutoToggled(Adjuster* a, bool newval) +void ColorAppearance::adjusterAutoToggled(Adjuster* a) { if (multiImage) { if (degree->getAutoInconsistent()) { diff --git a/rtgui/colorappearance.h b/rtgui/colorappearance.h index 170212ffe..c42bca774 100644 --- a/rtgui/colorappearance.h +++ b/rtgui/colorappearance.h @@ -47,7 +47,7 @@ public: void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override; void setBatchMode (bool batchMode) override; void adjusterChanged (Adjuster* a, double newval) override; - void adjusterAutoToggled (Adjuster* a, bool newval) override; + void adjusterAutoToggled (Adjuster* a) override; // void adjusterAdapToggled (Adjuster* a, bool newval); void enabledChanged () override; void surroundChanged (); diff --git a/rtgui/crophandler.h b/rtgui/crophandler.h index d5da1cf6e..98c925b67 100644 --- a/rtgui/crophandler.h +++ b/rtgui/crophandler.h @@ -24,7 +24,6 @@ #include -#include "editbuffer.h" #include "lockablecolorpicker.h" #include "threadutils.h" diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index f44e78a56..b00032191 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -33,6 +33,7 @@ #include "editcallbacks.h" #include "editbuffer.h" #include "editwidgets.h" +#include "pointermotionlistener.h" #include "rtsurface.h" #include "../rtengine/dcrop.h" @@ -259,7 +260,7 @@ void CropWindow::getCropAnchorPosition (int& x, int& y) cropHandler.getAnchorPosition(x, y); } -void CropWindow::setCropAnchorPosition (int& x, int& y) +void CropWindow::setCropAnchorPosition (int x, int y) { cropHandler.setAnchorPosition(x, y); } diff --git a/rtgui/cropwindow.h b/rtgui/cropwindow.h index db44a2508..491124ad5 100644 --- a/rtgui/cropwindow.h +++ b/rtgui/cropwindow.h @@ -30,7 +30,6 @@ #include "editenums.h" #include "lwbutton.h" #include "lwbuttonset.h" -#include "pointermotionlistener.h" #include "../rtengine/noncopyable.h" @@ -42,6 +41,7 @@ struct Coord; } class CropWindow; +class PointerMotionListener; class CropWindowListener { @@ -224,7 +224,7 @@ public: void centerCrop (bool update = true); void getCropSize (int& w, int& h); void getCropAnchorPosition (int& w, int& h); - void setCropAnchorPosition (int& w, int& h); + void setCropAnchorPosition (int w, int h); // listeners void setCropGUIListener (CropGUIListener* cgl); diff --git a/rtgui/curveeditorgroup.h b/rtgui/curveeditorgroup.h index 7a5d3a074..5ef13656b 100644 --- a/rtgui/curveeditorgroup.h +++ b/rtgui/curveeditorgroup.h @@ -23,7 +23,6 @@ #include -#include "adjuster.h" #include "guiutils.h" #include "mycurve.h" #include "shcselector.h" diff --git a/rtgui/diagonalcurveeditorsubgroup.h b/rtgui/diagonalcurveeditorsubgroup.h index 184fa576f..a077da807 100644 --- a/rtgui/diagonalcurveeditorsubgroup.h +++ b/rtgui/diagonalcurveeditorsubgroup.h @@ -21,7 +21,7 @@ #include #include "curveeditorgroup.h" - +#include "adjuster.h" #include "../rtengine/noncopyable.h" class DiagonalCurveEditor; diff --git a/rtgui/dirbrowser.h b/rtgui/dirbrowser.h index fa526c3a6..6ead83919 100644 --- a/rtgui/dirbrowser.h +++ b/rtgui/dirbrowser.h @@ -23,10 +23,6 @@ #include "guiutils.h" -#ifdef WIN32 -#include "windows.h" -#endif - class DirBrowser : public Gtk::VBox { public: diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 87f4a0b94..1b5ed3fa7 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -28,9 +28,12 @@ #include "soundman.h" #include "rtimage.h" #include "rtwindow.h" +#include "filepanel.h" #include "guiutils.h" #include "popupbutton.h" #include "options.h" +#include "navigator.h" +#include "previewwindow.h" #include "progressconnector.h" #include "procparamchangers.h" #include "placesbrowser.h" @@ -38,6 +41,10 @@ #include "thumbnail.h" #include "toolpanelcoord.h" +#ifdef WIN32 +#include "windows.h" +#endif + using namespace rtengine::procparams; namespace diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index e348222a5..8993fea07 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -21,11 +21,9 @@ #include -#include "filepanel.h" #include "histogrampanel.h" #include "history.h" #include "imageareapanel.h" -#include "navigator.h" #include "profilepanel.h" #include "progressconnector.h" #include "saveasdlg.h" @@ -38,6 +36,7 @@ class BatchQueueEntry; class EditorPanel; class FilePanel; class MyProgressBar; +class Navigator; class Thumbnail; class ToolPanelCoordinator; diff --git a/rtgui/editwidgets.h b/rtgui/editwidgets.h index d31451ecb..55b4ca3cc 100644 --- a/rtgui/editwidgets.h +++ b/rtgui/editwidgets.h @@ -20,9 +20,9 @@ #ifdef GUIVERSION +#include #include -#include "editbuffer.h" #include "editcoordsys.h" #include "../rtengine/coord.h" @@ -285,7 +285,7 @@ public: rtengine::Coord end; Line (); - Line (rtengine::Coord& begin, rtengine::Coord& end); + Line (const rtengine::Coord& begin, const rtengine::Coord& end); Line (int beginX, int beginY, int endX, int endY); void drawOuterGeometry (Cairo::RefPtr &cr, ObjectMOBuffer *objectBuffer, EditCoordSystem &coordSystem) override; @@ -532,7 +532,7 @@ inline Circle::Circle (int centerX, int centerY, int radius, bool filled, radiusInImageSpace) { } -inline Line::Line (rtengine::Coord& begin, rtengine::Coord& end) : +inline Line::Line (const rtengine::Coord& begin, const rtengine::Coord& end) : begin (begin), end (end) { } diff --git a/rtgui/editwindow.cc b/rtgui/editwindow.cc index 11c0be4e2..8841d3d42 100644 --- a/rtgui/editwindow.cc +++ b/rtgui/editwindow.cc @@ -16,13 +16,14 @@ */ #include "editwindow.h" +#include "editorpanel.h" +#include "filepanel.h" #include "../rtengine/procparams.h" #include "options.h" #include "preferences.h" #include "cursormanager.h" #include "rtwindow.h" #include -#include "rtimage.h" #include "threadutils.h" extern Glib::ustring argv0; diff --git a/rtgui/editwindow.h b/rtgui/editwindow.h index 08e8c0199..f4ada571d 100644 --- a/rtgui/editwindow.h +++ b/rtgui/editwindow.h @@ -20,10 +20,11 @@ #include -#include "editorpanel.h" -#include "filepanel.h" #include "rtimage.h" +class EditorPanel; +class RTWindow; + class EditWindow : public Gtk::Window { diff --git a/rtgui/exportpanel.h b/rtgui/exportpanel.h index f70e47386..7ae7e043c 100644 --- a/rtgui/exportpanel.h +++ b/rtgui/exportpanel.h @@ -21,7 +21,6 @@ #include -#include "adjuster.h" #include "guiutils.h" class ExportPanelListener diff --git a/rtgui/extprog.cc b/rtgui/extprog.cc index a7a757c1b..57d57ecd8 100644 --- a/rtgui/extprog.cc +++ b/rtgui/extprog.cc @@ -22,8 +22,8 @@ #include #ifdef WIN32 -#include #include +#include #endif #include @@ -145,20 +145,19 @@ bool ExtProgStore::searchProgram (const Glib::ustring& name, filePath = progFilesDir + "\\" + Glib::ustring::compose(exePath, ver); - if (Glib::file_test (filePath, Glib::FILE_TEST_EXISTS)) { + if (Glib::file_test(filePath, Glib::FILE_TEST_EXISTS)) { break; } - if (!exePath86.empty ()) { + if (!exePath86.empty()) { filePath = progFilesDirx86 + "\\" + Glib::ustring::compose(exePath86, ver); - if (Glib::file_test (filePath, Glib::FILE_TEST_EXISTS)) { + if (Glib::file_test(filePath, Glib::FILE_TEST_EXISTS)) { break; } } - - filePath.clear (); + filePath.clear(); } } else { @@ -166,21 +165,19 @@ bool ExtProgStore::searchProgram (const Glib::ustring& name, filePath = progFilesDir + "\\" + exePath; - if (Glib::file_test (filePath, Glib::FILE_TEST_EXISTS)) { + if (Glib::file_test(filePath, Glib::FILE_TEST_EXISTS)) { break; } - if (!exePath86.empty ()) { + if (!exePath86.empty()) { filePath = progFilesDirx86 + "\\" + exePath86; - if (Glib::file_test (filePath, Glib::FILE_TEST_EXISTS)) { + if (Glib::file_test(filePath, Glib::FILE_TEST_EXISTS)) { break; } } - - filePath.clear (); - + filePath.clear(); } while (false); } @@ -264,7 +261,7 @@ bool ExtProgStore::openInGimp (const Glib::ustring& fileName) #endif #ifdef WIN32 - if ((uintptr_t)success > 32) { + if (reinterpret_cast(success) > 32) { return true; } #else @@ -279,9 +276,9 @@ bool ExtProgStore::openInGimp (const Glib::ustring& fileName) for (auto ver = 12; ver >= 0; --ver) { executable = Glib::build_filename (options.gimpDir, "bin", Glib::ustring::compose (Glib::ustring("gimp-2.%1.exe"), ver)); - auto success = ShellExecute( NULL, "open", executable.c_str(), fileName.c_str(), NULL, SW_SHOWNORMAL ); + auto lsuccess = ShellExecute( NULL, "open", executable.c_str(), fileName.c_str(), NULL, SW_SHOWNORMAL ); - if ((uintptr_t)success > 32) { + if (reinterpret_cast(lsuccess) > 32) { return true; } } diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index 3dcb573ca..caa60ebbc 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -90,41 +90,36 @@ ThumbBrowserEntryBase* selectOriginalEntry (ThumbBrowserEntryBase* original, Thu void findOriginalEntries (const std::vector& entries) { - typedef std::vector EntryVector; - typedef EntryVector::const_iterator EntryIterator; - typedef std::map BasenameMap; - typedef BasenameMap::const_iterator BasenameIterator; - // Sort all entries into buckets by basename without extension - BasenameMap byBasename; + std::map> byBasename; - for (EntryIterator entry = entries.begin (); entry != entries.end (); ++entry) { - const Glib::ustring basename = Glib::path_get_basename ((*entry)->filename.lowercase()); + for (const auto entry : entries) { + const auto basename = Glib::path_get_basename(entry->filename.lowercase()); - const Glib::ustring::size_type pos = basename.find_last_of ('.'); - if (pos >= basename.length () - 1) { - (*entry)->setOriginal (nullptr); + const auto pos = basename.find_last_of('.'); + if (pos >= basename.length() - 1) { + entry->setOriginal(nullptr); continue; } - const Glib::ustring withoutExtension = basename.substr (0, pos); + const auto withoutExtension = basename.substr(0, pos); - byBasename[withoutExtension].push_back (*entry); + byBasename[withoutExtension].push_back(entry); } // Find the original image for each bucket - for (BasenameIterator bucket = byBasename.begin (); bucket != byBasename.end (); ++bucket) { - const EntryVector& entries = bucket->second; + for (const auto& bucket : byBasename) { + const auto& lentries = bucket.second; ThumbBrowserEntryBase* original = nullptr; // Select the most likely original in a first pass... - for (EntryIterator entry = entries.begin (); entry != entries.end (); ++entry) { - original = selectOriginalEntry (original, *entry); + for (const auto entry : lentries) { + original = selectOriginalEntry(original, entry); } // ...and link all other images to it in a second pass. - for (EntryIterator entry = entries.begin (); entry != entries.end (); ++entry) { - (*entry)->setOriginal (*entry != original ? original : nullptr); + for (const auto entry : lentries) { + entry->setOriginal(entry != original ? original : nullptr); } } } @@ -487,7 +482,7 @@ FileBrowser::~FileBrowser () delete[] amiExtProg; } -void FileBrowser::rightClicked (ThumbBrowserEntryBase* entry) +void FileBrowser::rightClicked () { { diff --git a/rtgui/filebrowser.h b/rtgui/filebrowser.h index b941ea9df..86ab59395 100644 --- a/rtgui/filebrowser.h +++ b/rtgui/filebrowser.h @@ -23,7 +23,6 @@ #include #include "browserfilter.h" -#include "exiffiltersettings.h" #include "exportpanel.h" #include "extprog.h" #include "filebrowserentry.h" @@ -174,7 +173,7 @@ public: void buttonPressed (LWButton* button, int actionCode, void* actionData) override; void redrawNeeded (LWButton* button) override; bool checkFilter (ThumbBrowserEntryBase* entry) const override; - void rightClicked (ThumbBrowserEntryBase* entry) override; + void rightClicked () override; void doubleClicked (ThumbBrowserEntryBase* entry) override; bool keyPressed (GdkEventKey* event) override; diff --git a/rtgui/filebrowserentry.cc b/rtgui/filebrowserentry.cc index 9da4044c1..3129e93e2 100644 --- a/rtgui/filebrowserentry.cc +++ b/rtgui/filebrowserentry.cc @@ -118,7 +118,7 @@ void FileBrowserEntry::calcThumbnailSize () { if (thumbnail) { - thumbnail->getThumbnailSize (prew, preh); + prew = thumbnail->getThumbnailWidth(preh); } } diff --git a/rtgui/filebrowserentry.h b/rtgui/filebrowserentry.h index 1bdbb2ecb..ea5140ed6 100644 --- a/rtgui/filebrowserentry.h +++ b/rtgui/filebrowserentry.h @@ -23,7 +23,6 @@ #include -#include "crophandler.h" #include "editenums.h" #include "filethumbnailbuttonset.h" #include "imageareatoollistener.h" diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index a2622e52c..109a1bb57 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -32,6 +32,7 @@ #include "rtimage.h" #include "cachemanager.h" #include "multilangmgr.h" +#include "coarsepanel.h" #include "filepanel.h" #include "renamedlg.h" #include "thumbimageupdater.h" @@ -40,6 +41,7 @@ #include "placesbrowser.h" #include "pathutils.h" #include "thumbnail.h" +#include "toolbar.h" using namespace std; @@ -1222,9 +1224,8 @@ void FileCatalog::developRequested(const std::vector& tbe, bo rtengine::ProcessingJob* pjob = rtengine::ProcessingJob::create (fbe->filename, th->getType() == FT_Raw, params, fastmode && options.fastexport_use_fast_pipeline); - int pw; - int ph = BatchQueue::calcMaxThumbnailHeight(); - th->getThumbnailSize (pw, ph); + const int ph = BatchQueue::calcMaxThumbnailHeight(); + const int pw = th->getThumbnailWidth(ph); // processThumbImage is the processing intensive part, but adding to queue must be ordered //#pragma omp ordered diff --git a/rtgui/filecatalog.h b/rtgui/filecatalog.h index c71658cca..8f7e5618f 100644 --- a/rtgui/filecatalog.h +++ b/rtgui/filecatalog.h @@ -22,21 +22,21 @@ #include -#include "coarsepanel.h" #include "exiffiltersettings.h" #include "exportpanel.h" #include "filebrowser.h" #include "fileselectionchangelistener.h" #include "fileselectionlistener.h" #include "filterpanel.h" -#include "multilangmgr.h" #include "previewloader.h" #include "threadutils.h" -#include "toolbar.h" #include "../rtengine/noncopyable.h" class FilePanel; +class CoarsePanel; +class ToolBar; + /* * Class: * - handling the list of file (add/remove them) diff --git a/rtgui/filepanel.cc b/rtgui/filepanel.cc index 8f45343de..1a66aed7c 100644 --- a/rtgui/filepanel.cc +++ b/rtgui/filepanel.cc @@ -18,6 +18,7 @@ */ #include "filepanel.h" +#include "dirbrowser.h" #include "batchtoolpanelcoord.h" #include "editorpanel.h" #include "rtwindow.h" @@ -25,6 +26,10 @@ #include "placesbrowser.h" #include "thumbnail.h" +#ifdef WIN32 +#include "windows.h" +#endif + FilePanel::FilePanel () : parent(nullptr), error(0) { diff --git a/rtgui/filepanel.h b/rtgui/filepanel.h index 9db9d99b7..cbfe8e53e 100644 --- a/rtgui/filepanel.h +++ b/rtgui/filepanel.h @@ -20,7 +20,6 @@ #include -#include "dirbrowser.h" #include "exportpanel.h" #include "filecatalog.h" #include "fileselectionlistener.h" @@ -35,6 +34,7 @@ class BatchToolPanelCoordinator; class RTWindow; +class DirBrowser; class FilePanel final : public Gtk::HPaned, diff --git a/rtgui/flatfield.cc b/rtgui/flatfield.cc index ff0c0f9dd..7433fd4de 100644 --- a/rtgui/flatfield.cc +++ b/rtgui/flatfield.cc @@ -252,7 +252,7 @@ void FlatField::adjusterChanged(Adjuster* a, double newval) } } -void FlatField::adjusterAutoToggled (Adjuster* a, bool newval) +void FlatField::adjusterAutoToggled (Adjuster* a) { if (multiImage) { if (flatFieldClipControl->getAutoInconsistent()) { diff --git a/rtgui/flatfield.h b/rtgui/flatfield.h index d20a96acd..5cbc49684 100644 --- a/rtgui/flatfield.h +++ b/rtgui/flatfield.h @@ -79,7 +79,7 @@ public: void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override; void adjusterChanged (Adjuster* a, double newval) override; - void adjusterAutoToggled (Adjuster* a, bool newval) override; + void adjusterAutoToggled (Adjuster* a) override; void flatFieldFileChanged (); void flatFieldFile_Reset (); void flatFieldAutoSelectChanged (); diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index d6ede26da..02a28607f 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -946,22 +946,21 @@ bool MyScrolledWindow::on_scroll_event (GdkEventScroll* event) const double lowerBound = adjust->get_lower(); double value = adjust->get_value(); double step = adjust->get_step_increment(); - double value2 = 0.; if (event->direction == GDK_SCROLL_DOWN) { - value2 = rtengine::min(value + step, upperBound); + const double value2 = rtengine::min(value + step, upperBound); if (value2 != value) { scroll->set_value(value2); } } else if (event->direction == GDK_SCROLL_UP) { - value2 = rtengine::max(value - step, lowerBound); + const double value2 = rtengine::max(value - step, lowerBound); if (value2 != value) { scroll->set_value(value2); } } else if (event->direction == GDK_SCROLL_SMOOTH) { - value2 = rtengine::LIM(value + event->delta_y * step, lowerBound, upperBound); + const double value2 = rtengine::LIM(value + event->delta_y * step, lowerBound, upperBound); if (value2 != value) { scroll->set_value(value2); diff --git a/rtgui/histogrampanel.cc b/rtgui/histogrampanel.cc index ddf60ca75..dd0cbde46 100644 --- a/rtgui/histogrampanel.cc +++ b/rtgui/histogrampanel.cc @@ -983,7 +983,7 @@ void HistogramArea::on_realize () } void HistogramArea::drawCurve(Cairo::RefPtr &cr, - LUTu & data, double scale, int hsize, int vsize) + const LUTu & data, double scale, int hsize, int vsize) { double s = RTScalable::getScale(); @@ -1013,7 +1013,7 @@ void HistogramArea::drawCurve(Cairo::RefPtr &cr, } void HistogramArea::drawMarks(Cairo::RefPtr &cr, - LUTu & data, double scale, int hsize, int & ui, int & oi) + const LUTu & data, double scale, int hsize, int & ui, int & oi) { int s = 8 * RTScalable::getScale(); diff --git a/rtgui/histogrampanel.h b/rtgui/histogrampanel.h index 23b065534..4fd21bcc2 100644 --- a/rtgui/histogrampanel.h +++ b/rtgui/histogrampanel.h @@ -165,8 +165,8 @@ public: type_signal_factor_changed signal_factor_changed(); private: - void drawCurve(Cairo::RefPtr &cr, LUTu & data, double scale, int hsize, int vsize); - void drawMarks(Cairo::RefPtr &cr, LUTu & data, double scale, int hsize, int & ui, int & oi); + void drawCurve(Cairo::RefPtr &cr, const LUTu & data, double scale, int hsize, int vsize); + void drawMarks(Cairo::RefPtr &cr, const LUTu & data, double scale, int hsize, int & ui, int & oi); Gtk::SizeRequestMode get_request_mode_vfunc () const override; void get_preferred_height_vfunc (int& minimum_height, int& natural_height) const override; void get_preferred_width_vfunc (int &minimum_width, int &natural_width) const override; diff --git a/rtgui/hsvequalizer.h b/rtgui/hsvequalizer.h index 987fd20b2..77c1ee1b0 100644 --- a/rtgui/hsvequalizer.h +++ b/rtgui/hsvequalizer.h @@ -20,7 +20,6 @@ #include -#include "adjuster.h" #include "colorprovider.h" #include "curvelistener.h" #include "guiutils.h" @@ -58,6 +57,5 @@ public: void autoOpenCurve () override; void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller) override; - //void adjusterChanged (Adjuster* a, double newval); void enabledChanged() override; }; diff --git a/rtgui/lockablecolorpicker.cc b/rtgui/lockablecolorpicker.cc index cb334c7e4..071847424 100644 --- a/rtgui/lockablecolorpicker.cc +++ b/rtgui/lockablecolorpicker.cc @@ -240,7 +240,7 @@ void LockableColorPicker::updateBackBuffer () } -void LockableColorPicker::draw (Cairo::RefPtr &cr) +void LockableColorPicker::draw (const Cairo::RefPtr &cr) { if (validity == Validity::OUTSIDE) { return; @@ -284,12 +284,12 @@ void LockableColorPicker::setRGB (const float R, const float G, const float B, c } } -void LockableColorPicker::getImagePosition (rtengine::Coord &imgPos) +void LockableColorPicker::getImagePosition (rtengine::Coord &imgPos) const { imgPos = position; } -void LockableColorPicker::getScreenPosition (rtengine::Coord &screenPos) +void LockableColorPicker::getScreenPosition (rtengine::Coord &screenPos) const { if (cropWindow) { cropWindow->imageCoordToScreen(position.x, position.y, screenPos.x, screenPos.y); @@ -328,7 +328,7 @@ void LockableColorPicker::setSize (Size newSize) } } -LockableColorPicker::Size LockableColorPicker::getSize () +LockableColorPicker::Size LockableColorPicker::getSize () const { return size; } diff --git a/rtgui/lockablecolorpicker.h b/rtgui/lockablecolorpicker.h index eadf71773..77d2e8e9f 100644 --- a/rtgui/lockablecolorpicker.h +++ b/rtgui/lockablecolorpicker.h @@ -74,14 +74,14 @@ public: LockableColorPicker (CropWindow* cropWindow, Glib::ustring *oProfile, Glib::ustring *wProfile); - void draw (Cairo::RefPtr &cr); + void draw (const Cairo::RefPtr &cr); // Used to update the RGB color, the HSV values will be updated accordingly void setPosition (const rtengine::Coord &newPos); void setRGB (const float R, const float G, const float B, const float previewR, const float previewG, const float previewB); - void getImagePosition (rtengine::Coord &imgPos); - void getScreenPosition (rtengine::Coord &screenPos); - Size getSize (); + void getImagePosition (rtengine::Coord &imgPos) const; + void getScreenPosition (rtengine::Coord &screenPos) const; + Size getSize () const; bool isOver (int x, int y); void setValidity (Validity isValid); void setSize (Size newSize); diff --git a/rtgui/lwbutton.cc b/rtgui/lwbutton.cc index c6c75584d..26d36f9e0 100644 --- a/rtgui/lwbutton.cc +++ b/rtgui/lwbutton.cc @@ -153,7 +153,7 @@ bool LWButton::releaseNotify (int x, int y) { bool in = inside (x, y); - State nstate = state; + State nstate; bool action = false; if (in && (state == Pressed_In || state == Pressed_Out)) { diff --git a/rtgui/main.cc b/rtgui/main.cc index ae34fc8d0..f669bcf4a 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -53,6 +53,7 @@ #else #include #include "conio.h" +#include "windows.h" #endif // Set this to 1 to make RT work when started with Eclipse and arguments, at least on Windows platform diff --git a/rtgui/mydiagonalcurve.cc b/rtgui/mydiagonalcurve.cc index 9aa52c67e..abd339ce0 100644 --- a/rtgui/mydiagonalcurve.cc +++ b/rtgui/mydiagonalcurve.cc @@ -592,7 +592,6 @@ bool MyDiagonalCurve::handleEvents (GdkEvent* event) curve.x.insert (itx, 0); curve.y.insert (ity, 0); - num++; // the graph is refreshed only if a new point is created curve.x.at(closest_point) = clampedX; @@ -1504,7 +1503,7 @@ void MyDiagonalCurve::setActiveParam (int ac) queue_draw (); } -void MyDiagonalCurve::updateBackgroundHistogram (LUTu & hist) +void MyDiagonalCurve::updateBackgroundHistogram (const LUTu & hist) { if (hist) { //memcpy (bghist, hist, 256*sizeof(unsigned int)); diff --git a/rtgui/mydiagonalcurve.h b/rtgui/mydiagonalcurve.h index a71c0565c..b38373006 100644 --- a/rtgui/mydiagonalcurve.h +++ b/rtgui/mydiagonalcurve.h @@ -85,7 +85,7 @@ public: bool handleEvents (GdkEvent* event) override; void setActiveParam (int ac); void reset (const std::vector &resetCurve, double identityValue = 0.5) override; - void updateBackgroundHistogram (LUTu & hist); + void updateBackgroundHistogram (const LUTu & hist); void pipetteMouseOver (CurveEditor *ce, EditDataProvider *provider, int modifierKey) override; bool pipetteButton1Pressed(EditDataProvider *provider, int modifierKey) override; diff --git a/rtgui/myflatcurve.cc b/rtgui/myflatcurve.cc index f01fb0066..362d34f35 100644 --- a/rtgui/myflatcurve.cc +++ b/rtgui/myflatcurve.cc @@ -653,7 +653,6 @@ bool MyFlatCurve::handleEvents (GdkEvent* event) curve.y.insert (ity, 0); curve.leftTangent.insert (itlt, 0); curve.rightTangent.insert (itrt, 0); - num++; if (mod_type & GDK_CONTROL_MASK) { clampedY = point.getVal01(clampedX); diff --git a/rtgui/navigator.cc b/rtgui/navigator.cc index 6a8137737..619ea0cfd 100644 --- a/rtgui/navigator.cc +++ b/rtgui/navigator.cc @@ -18,6 +18,7 @@ */ #include #include "navigator.h" +#include "previewwindow.h" #include "toolpanel.h" #include "../rtengine/color.h" #include "../rtengine/rt_math.h" diff --git a/rtgui/navigator.h b/rtgui/navigator.h index 953a0a44b..c1c23c6dc 100644 --- a/rtgui/navigator.h +++ b/rtgui/navigator.h @@ -22,7 +22,8 @@ #include "options.h" #include "pointermotionlistener.h" -#include "previewwindow.h" + +class PreviewWindow; class Navigator : public Gtk::Frame, diff --git a/rtgui/partialpastedlg.cc b/rtgui/partialpastedlg.cc index a7d2bd0d1..22f608ae4 100644 --- a/rtgui/partialpastedlg.cc +++ b/rtgui/partialpastedlg.cc @@ -136,6 +136,8 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren raw_ca_avoid_colourshift = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAWCACORR_AVOIDCOLORSHIFT"))); //--- filmNegative = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_FILMNEGATIVE")) ); + //--- + captureSharpening = Gtk::manage (new Gtk::CheckButton (M("TP_PDSHARPENING_LABEL")) ); Gtk::VBox* vboxes[8]; Gtk::HSeparator* hseps[8]; @@ -253,6 +255,7 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren vboxes[7]->pack_start (*raw_ca_avoid_colourshift, Gtk::PACK_SHRINK, 2); vboxes[7]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0); vboxes[7]->pack_start (*filmNegative, Gtk::PACK_SHRINK, 2); + vboxes[7]->pack_start (*captureSharpening, Gtk::PACK_SHRINK, 2); Gtk::VBox* vbCol1 = Gtk::manage (new Gtk::VBox ()); Gtk::VBox* vbCol2 = Gtk::manage (new Gtk::VBox ()); @@ -402,6 +405,8 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren raw_ca_avoid_colourshiftconn = raw_ca_avoid_colourshift->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true)); //--- filmNegativeConn = filmNegative->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true)); + //--- + captureSharpeningConn = captureSharpening->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true)); add_button (M("GENERAL_OK"), Gtk::RESPONSE_OK); add_button (M("GENERAL_CANCEL"), Gtk::RESPONSE_CANCEL); @@ -474,6 +479,7 @@ void PartialPasteDlg::rawToggled () ConnectionBlocker raw_caredblueBlocker(raw_caredblueConn); ConnectionBlocker raw_ca_avoid_colourshiftBlocker(raw_ca_avoid_colourshiftconn); ConnectionBlocker filmNegativeBlocker(filmNegativeConn); + ConnectionBlocker captureSharpeningBlocker(captureSharpeningConn); raw->set_inconsistent (false); @@ -503,6 +509,7 @@ void PartialPasteDlg::rawToggled () raw_caredblue->set_active (raw->get_active ()); raw_ca_avoid_colourshift->set_active (raw->get_active ()); filmNegative->set_active (raw->get_active()); + captureSharpening->set_active (raw->get_active()); } void PartialPasteDlg::basicToggled () @@ -981,6 +988,17 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param filterPE.filmNegative.blueRatio = falsePE.filmNegative.blueRatio; } + if (!captureSharpening->get_active ()) { + filterPE.pdsharpening.enabled = falsePE.pdsharpening.enabled; + filterPE.pdsharpening.contrast = falsePE.pdsharpening.contrast; + filterPE.pdsharpening.autoContrast = falsePE.pdsharpening.autoContrast; + filterPE.pdsharpening.autoRadius = falsePE.pdsharpening.autoRadius; + filterPE.pdsharpening.deconvradius = falsePE.pdsharpening.deconvradius; + filterPE.pdsharpening.deconvradiusOffset = falsePE.pdsharpening.deconvradiusOffset; + filterPE.pdsharpening.deconviter = falsePE.pdsharpening.deconviter; + filterPE.pdsharpening.deconvitercheck = falsePE.pdsharpening.deconvitercheck; + } + if (dstPE) { *dstPE = filterPE; } diff --git a/rtgui/partialpastedlg.h b/rtgui/partialpastedlg.h index da6c9251a..1403e7c1b 100644 --- a/rtgui/partialpastedlg.h +++ b/rtgui/partialpastedlg.h @@ -141,6 +141,7 @@ public: Gtk::CheckButton* ff_ClipControl; Gtk::CheckButton* filmNegative; + Gtk::CheckButton* captureSharpening; sigc::connection everythingConn, basicConn, detailConn, colorConn, lensConn, compositionConn, metaConn, rawConn, advancedConn; @@ -153,6 +154,7 @@ public: sigc::connection df_fileConn, df_AutoSelectConn, ff_fileConn, ff_AutoSelectConn, ff_BlurRadiusConn, ff_BlurTypeConn, ff_ClipControlConn; sigc::connection raw_caredblueConn, raw_ca_autocorrectConn, raw_ca_avoid_colourshiftconn, raw_hotpix_filtConn, raw_deadpix_filtConn, raw_pdaf_lines_filterConn, raw_linenoiseConn, raw_greenthreshConn, raw_ccStepsConn, raw_methodConn, raw_borderConn, raw_imagenumConn, raw_dcb_iterationsConn, raw_lmmse_iterationsConn, raw_pixelshiftConn, raw_dcb_enhanceConn, raw_exposConn, raw_blackConn; sigc::connection filmNegativeConn; + sigc::connection captureSharpeningConn; public: PartialPasteDlg (const Glib::ustring &title, Gtk::Window* parent); diff --git a/rtgui/pdsharpening.cc b/rtgui/pdsharpening.cc index 4f5416c82..18fa7aa2a 100644 --- a/rtgui/pdsharpening.cc +++ b/rtgui/pdsharpening.cc @@ -270,7 +270,7 @@ void PdSharpening::autoRadiusChanged(double autoRadius) ); } -void PdSharpening::adjusterAutoToggled(Adjuster* a, bool newval) +void PdSharpening::adjusterAutoToggled(Adjuster* a) { if (multiImage) { if (a->getAutoInconsistent()) { diff --git a/rtgui/pdsharpening.h b/rtgui/pdsharpening.h index 7d971eaee..eb0576ceb 100644 --- a/rtgui/pdsharpening.h +++ b/rtgui/pdsharpening.h @@ -59,7 +59,7 @@ public: void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override; void setBatchMode (bool batchMode) override; - void adjusterAutoToggled (Adjuster* a, bool newval) override; + void adjusterAutoToggled (Adjuster* a) override; void adjusterChanged (Adjuster* a, double newval) override; void enabledChanged () override; diff --git a/rtgui/placesbrowser.h b/rtgui/placesbrowser.h index 78c94969f..d4640fff4 100644 --- a/rtgui/placesbrowser.h +++ b/rtgui/placesbrowser.h @@ -22,8 +22,6 @@ #include -#include "multilangmgr.h" - class PlacesBrowser : public Gtk::VBox { diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 0bce37af2..68ef3b9ce 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -128,7 +128,7 @@ Preferences::~Preferences () get_size (options.preferencesWidth, options.preferencesHeight); } -int Preferences::getThemeRowNumber (Glib::ustring& longThemeFName) +int Preferences::getThemeRowNumber (const Glib::ustring& longThemeFName) { if (regex->match (longThemeFName + ".css", matchInfo)) { diff --git a/rtgui/preferences.h b/rtgui/preferences.h index b4b90e669..76a104ffa 100644 --- a/rtgui/preferences.h +++ b/rtgui/preferences.h @@ -22,7 +22,6 @@ #include -#include "adjuster.h" #include "dynamicprofilepanel.h" #include "options.h" #include "../rtengine/profilestore.h" @@ -249,7 +248,7 @@ class Preferences : void switchFontTo (const Glib::ustring &newFontFamily, const int newFontSize); bool splashClosed (GdkEventAny* event); - int getThemeRowNumber (Glib::ustring& longThemeFName); + int getThemeRowNumber (const Glib::ustring& longThemeFName); void appendBehavList (Gtk::TreeModel::iterator& parent, Glib::ustring label, int id, bool set); diff --git a/rtgui/previewmodepanel.h b/rtgui/previewmodepanel.h index 98160a5e3..4121dfb92 100644 --- a/rtgui/previewmodepanel.h +++ b/rtgui/previewmodepanel.h @@ -19,8 +19,6 @@ #include -#include "adjuster.h" - class ImageArea; class PreviewModePanel : diff --git a/rtgui/previewwindow.cc b/rtgui/previewwindow.cc index 6268fe3d2..67fa87e0c 100644 --- a/rtgui/previewwindow.cc +++ b/rtgui/previewwindow.cc @@ -230,7 +230,7 @@ bool PreviewWindow::on_motion_notify_event (GdkEventMotion* event) if (x>imgX || y>imgY || w < imgW || h < imgH) { bool inside = event->x > x - 6 && event->x < x + w - 1 + 6 && event->y > y - 6 && event->y < y + h - 1 + 6; - CursorShape newType = cursor_type; + CursorShape newType; if (isMoving) { mainCropWin->remoteMove ((event->x - press_x) / zoom, (event->y - press_y) / zoom); diff --git a/rtgui/progressconnector.h b/rtgui/progressconnector.h index eb6eb3a66..f4d1d8f7e 100644 --- a/rtgui/progressconnector.h +++ b/rtgui/progressconnector.h @@ -79,9 +79,9 @@ class ProgressConnector static int emitEndSignalUI (void* data) { - sigc::signal0* opEnd = (sigc::signal0*) data; - int r = opEnd->emit (); - delete opEnd; + const sigc::signal0* lopEnd = reinterpret_cast*>(data); + const int r = lopEnd->emit (); + delete lopEnd; return r; } diff --git a/rtgui/recentbrowser.h b/rtgui/recentbrowser.h index 68a7962f9..bc8374087 100644 --- a/rtgui/recentbrowser.h +++ b/rtgui/recentbrowser.h @@ -21,7 +21,6 @@ #include #include "guiutils.h" -#include "multilangmgr.h" class RecentBrowser : public Gtk::VBox diff --git a/rtgui/rgbcurves.h b/rtgui/rgbcurves.h index 5ed2ea540..edc80eb41 100644 --- a/rtgui/rgbcurves.h +++ b/rtgui/rgbcurves.h @@ -20,7 +20,6 @@ #include -#include "adjuster.h" #include "colorprovider.h" #include "curvelistener.h" #include "toolpanel.h" diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index ae7072d88..5ab3ab85d 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -44,14 +44,14 @@ extern unsigned char initialGdkScale; static gboolean osx_should_quit_cb (GtkosxApplication *app, gpointer data) { - RTWindow *rtWin = (RTWindow *)data; + RTWindow * const rtWin = static_cast(data); return rtWin->on_delete_event (0); } static void osx_will_quit_cb (GtkosxApplication *app, gpointer data) { - RTWindow *rtWin = (RTWindow *)data; + RTWindow *rtWin = static_cast(data); rtWin->on_delete_event (0); gtk_main_quit (); } @@ -75,7 +75,7 @@ bool RTWindow::osxFileOpenEvent (Glib::ustring path) static gboolean osx_open_file_cb (GtkosxApplication *app, gchar *path_, gpointer data) { - RTWindow *rtWin = (RTWindow *)data; + RTWindow *rtWin = static_cast(data); if (!argv1.empty()) { // skip handling if we have a file argument or else we get double open of same file @@ -232,13 +232,6 @@ RTWindow::RTWindow () } } -#ifndef NDEBUG - else if (!screen) { - printf ("ERROR: Can't get default screen!\n"); - } - -#endif - // ------- end loading theme files RTScalable::init(this); diff --git a/rtgui/rtwindow.h b/rtgui/rtwindow.h index 39e1581e3..100ddf636 100644 --- a/rtgui/rtwindow.h +++ b/rtgui/rtwindow.h @@ -34,6 +34,7 @@ class BatchQueueEntry; class BatchQueuePanel; class EditorPanel; class FilePanel; +class PLDBridge; class RTWindow : public Gtk::Window, public rtengine::ProgressListener, diff --git a/rtgui/saveasdlg.h b/rtgui/saveasdlg.h index e4567f69b..448b37fd7 100644 --- a/rtgui/saveasdlg.h +++ b/rtgui/saveasdlg.h @@ -20,7 +20,6 @@ #include -#include "adjuster.h" #include "saveformatpanel.h" class SaveAsDialog : diff --git a/rtgui/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc index c9329cf91..5f75ab413 100644 --- a/rtgui/thumbbrowserbase.cc +++ b/rtgui/thumbbrowserbase.cc @@ -967,7 +967,7 @@ void ThumbBrowserBase::buttonPressed (int x, int y, int button, GdkEventType typ } MYWRITERLOCK_RELEASE(l); - rightClicked (fileDescr); + rightClicked (); } } // end of MYWRITERLOCK(l, entryRW); diff --git a/rtgui/thumbbrowserbase.h b/rtgui/thumbbrowserbase.h index d6bafaf69..b4caac0a9 100644 --- a/rtgui/thumbbrowserbase.h +++ b/rtgui/thumbbrowserbase.h @@ -225,7 +225,7 @@ public: { return true; } - virtual void rightClicked (ThumbBrowserEntryBase* entry) {} + virtual void rightClicked () = 0; virtual void doubleClicked (ThumbBrowserEntryBase* entry) {} virtual bool keyPressed (GdkEventKey* event) { diff --git a/rtgui/thumbnail.cc b/rtgui/thumbnail.cc index cd7470263..bcf578143 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -590,10 +590,8 @@ void Thumbnail::decreaseRef () cachemgr->closeThumbnail (this); } -void Thumbnail::getThumbnailSize (int &w, int &h, const rtengine::procparams::ProcParams *pparams) +int Thumbnail::getThumbnailWidth (const int h, const rtengine::procparams::ProcParams *pparams) const { - MyMutex::MyLock lock(mutex); - int tw_ = tw; int th_ = th; float imgRatio_ = imgRatio; @@ -613,20 +611,17 @@ void Thumbnail::getThumbnailSize (int &w, int &h, const rtengine::procparams::Pr if (thisCoarse != ppCoarse) { // different orientation -> swapping width & height - int tmp = th_; - th_ = tw_; - tw_ = tmp; - + std::swap(th_, tw_); if (imgRatio_ >= 0.0001f) { imgRatio_ = 1.f / imgRatio_; } } } - if (imgRatio_ > 0.) { - w = (int)(imgRatio_ * (float)h); + if (imgRatio_ > 0.f) { + return imgRatio_ * h; } else { - w = tw_ * h / th_; + return tw_ * h / th_; } } diff --git a/rtgui/thumbnail.h b/rtgui/thumbnail.h index aee5ee0a6..c22c80cea 100644 --- a/rtgui/thumbnail.h +++ b/rtgui/thumbnail.h @@ -119,7 +119,7 @@ public: // unsigned char* getThumbnailImage (int &w, int &h, int fixwh=1); // fixwh = 0: fix w and calculate h, =1: fix h and calculate w rtengine::IImage8* processThumbImage (const rtengine::procparams::ProcParams& pparams, int h, double& scale); rtengine::IImage8* upgradeThumbImage (const rtengine::procparams::ProcParams& pparams, int h, double& scale); - void getThumbnailSize (int &w, int &h, const rtengine::procparams::ProcParams *pparams = nullptr); + int getThumbnailWidth (int h, const rtengine::procparams::ProcParams *pparams = nullptr) const; void getFinalSize (const rtengine::procparams::ProcParams& pparams, int& w, int& h); void getOriginalSize (int& w, int& h); diff --git a/rtgui/toolbar.cc b/rtgui/toolbar.cc index 38ade6566..99c4196c6 100644 --- a/rtgui/toolbar.cc +++ b/rtgui/toolbar.cc @@ -20,6 +20,7 @@ #include "toolbar.h" #include "multilangmgr.h" #include "guiutils.h" +#include "lockablecolorpicker.h" #include "rtimage.h" ToolBar::ToolBar () : showColPickers(true), listener (nullptr), pickerListener(nullptr) diff --git a/rtgui/toolbar.h b/rtgui/toolbar.h index e6d99f819..8ec6bb615 100644 --- a/rtgui/toolbar.h +++ b/rtgui/toolbar.h @@ -20,10 +20,10 @@ #include -#include "lockablecolorpicker.h" #include "toolenum.h" class RTImage; +class LockablePickerToolListener; class ToolBarListener { diff --git a/rtgui/toolpanel.h b/rtgui/toolpanel.h index 0f002e048..aecf1f39f 100644 --- a/rtgui/toolpanel.h +++ b/rtgui/toolpanel.h @@ -22,7 +22,6 @@ #include -#include "editbuffer.h" #include "guiutils.h" #include "multilangmgr.h" #include "paramsedited.h" diff --git a/rtgui/xtransprocess.cc b/rtgui/xtransprocess.cc index 52c46be65..a371bad88 100644 --- a/rtgui/xtransprocess.cc +++ b/rtgui/xtransprocess.cc @@ -225,7 +225,7 @@ void XTransProcess::adjusterChanged(Adjuster* a, double newval) } } -void XTransProcess::adjusterAutoToggled(Adjuster* a, bool newval) +void XTransProcess::adjusterAutoToggled(Adjuster* a) { if (multiImage) { if (dualDemosaicContrast->getAutoInconsistent()) { diff --git a/rtgui/xtransprocess.h b/rtgui/xtransprocess.h index d6cb120e0..fc0dd7502 100644 --- a/rtgui/xtransprocess.h +++ b/rtgui/xtransprocess.h @@ -66,5 +66,5 @@ public: void autoContrastChanged (double autoContrast) override; void adjusterChanged(Adjuster* a, double newval) override; void checkBoxToggled(CheckBox* c, CheckValue newval) override; - void adjusterAutoToggled(Adjuster* a, bool newval) override; + void adjusterAutoToggled(Adjuster* a) override; };