diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 5a5c3b8d0..90beb2c18 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -15,7 +15,7 @@ on: workflow_dispatch: env: - publish_pre_dev_labels: '[]' + publish_pre_dev_labels: '["Beep6581:levels"]' jobs: build: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index e5f4ce166..b30dd9f20 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -15,7 +15,7 @@ on: workflow_dispatch: env: - publish_pre_dev_labels: '[]' + publish_pre_dev_labels: '["Beep6581:levels"]' jobs: diff --git a/rtdata/languages/default b/rtdata/languages/default index ad8962037..81c7bfeee 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1453,6 +1453,7 @@ HISTORY_MSG_ILLUM;CAL - SC - Illuminant HISTORY_MSG_LOCAL_CIE_ANGGRAD;Local CIECAM - gradient angle HISTORY_MSG_LOCAL_CIE_BRICOMP;Local CIECAM Brightness compression HISTORY_MSG_LOCAL_CIE_BRICOMPTH;Local CIECAM Brightness compression threshold +HISTORY_MSG_LOCAL_CIE_BWCIE;Local CIECAM - black and white HISTORY_MSG_LOCAL_CIE_CAT;Matrix adaptation HISTORY_MSG_LOCAL_CIE_DETAILJZ;Local JzCzHz Local contrast HISTORY_MSG_LOCAL_CIE_ENAMASKALL;Local CIECAM All mask tools @@ -1470,6 +1471,9 @@ HISTORY_MSG_LOCAL_CIE_SIGADAP;Local CIECAM Sigmoid adaptability HISTORY_MSG_LOCAL_CIE_SIGMET;Local CIECAM - Sigmoid method HISTORY_MSG_LOCAL_CIE_SLOP;Local CIECAM - Slope HISTORY_MSG_LOCAL_CIE_SLOPESMO;Local CIECAM - Gray balance +HISTORY_MSG_LOCAL_CIE_SLOPESMOR;Local CIECAM - Red balance +HISTORY_MSG_LOCAL_CIE_SLOPESMOG;Local CIECAM - Green balance +HISTORY_MSG_LOCAL_CIE_SLOPESMOB;Local CIECAM - Blue balance HISTORY_MSG_LOCAL_CIE_SMOOTHMET;Local CIECAM - Smooth lights method HISTORY_MSG_LOCAL_CIE_STRGRAD;Local CIECAM - gradient strength L HISTORY_MSG_LOCAL_CIE_TRC;Local CIECAM - TRC @@ -1483,6 +1487,8 @@ HISTORY_MSG_LOCAL_CIE_BLUYL;Local CIECAM - Blue Y HISTORY_MSG_LOCAL_CIE_SHIFTXL;Local CIECAM - Shift x HISTORY_MSG_LOCAL_CIE_SHIFTYL;Local CIECAM - Shift y HISTORY_MSG_LOCAL_CIE_SMOOTH;Local CIECAM - Scale Yb Scene +HISTORY_MSG_LOCAL_CIE_SMOOTHYB;Local CIECAM - Scale Yb Viewing +HISTORY_MSG_LOCAL_CIE_SMOOTH_LUM;Local CIECAM - levels - luminosity mode HISTORY_MSG_LOCAL_CIE_SATCIE;Local CIECAM - Saturation control HISTORY_MSG_LOCAL_CIE_STRLOG;Local CIECAM - Log encoding strength HISTORY_MSG_LOCAL_CIE_WHITES;Local CIECAM - Whites distribution @@ -2684,6 +2690,7 @@ TP_ICM_APPLYHUESATMAP_TOOLTIP;Employ the embedded DCP base table (HueSatMap). Th TP_ICM_APPLYLOOKTABLE;Look table TP_ICM_APPLYLOOKTABLE_TOOLTIP;Employ the embedded DCP look table. The setting is only available if the selected DCP has one. TP_ICM_BPC;Black Point Compensation +TP_ICM_BW;Black and White TP_ICM_DCPILLUMINANT;Illuminant TP_ICM_DCPILLUMINANT_INTERPOLATED;Interpolated TP_ICM_DCPILLUMINANT_TOOLTIP;Select which embedded DCP illuminant to employ. Default is 'interpolated' which is a mix between the two based on white balance. The setting is only available if a dual-illuminant DCP with interpolation support is selected. @@ -2843,7 +2850,7 @@ TP_LOCALLAB_ARTIF_TOOLTIP;ΔE scope threshold increases the range of ΔE scope. TP_LOCALLAB_AUTOGRAY;Auto mean luminance (Yb%) TP_LOCALLAB_AUTOGRAYCIE;Automatic TP_LOCALLAB_AVOID;Avoid color shift -TP_LOCALLAB_AVOIDCOLORSHIFT_TOOLTIP;Fit colors into gamut of the working color space and apply Munsell correction (Uniform Perceptual Lab).\n\nDefault: Munsell only.\nMunsell only, fixes Lab mode hue drifts due to non-linearity, when chromaticity is changed (Uniform Perceptual Lab).\nLab, applies a gamut control, in relative colorimetric, Munsell is then applied.\nXYZ Absolute, applies gamut control, in absolute colorimetric, Munsell is then applied.\nXYZ Relative, applies gamut control, in relative colorimetric, Munsell is then applied. +TP_LOCALLAB_AVOIDCOLORSHIFT_TOOLTIP;Fit colors into gamut of the working color space and apply Munsell correction (Uniform Perceptual Lab).\n\nDefault: Munsell only.\nMunsell only, fixes Lab mode hue drifts due to non-linearity, when chromaticity is changed (Uniform Perceptual Lab).\nLab, applies a gamut control, in relative colorimetric, Munsell is then applied.\nXYZ Absolute, applies gamut control, in absolute colorimetric, Munsell is then applied.\nXYZ Relative, applies gamut control, in relative colorimetric, Munsell is then applied. The result is not the same as Lab. TP_LOCALLAB_AVOIDMUN;Munsell correction only TP_LOCALLAB_AVOIDMUN_TOOLTIP;Munsell correction always disabled when Jz or CAM16 is used. TP_LOCALLAB_AVOIDRAD;Soft radius @@ -2920,9 +2927,10 @@ TP_LOCALLAB_CHRRT;Chroma TP_LOCALLAB_CIE;Color appearance (Cam16 & JzCzHz) TP_LOCALLAB_CIE_SMOOTH_NONE;None TP_LOCALLAB_CIE_SMOOTH_EV;Ev based -TP_LOCALLAB_CIE_SMOOTHFRAME;Highlight attenuation +TP_LOCALLAB_CIE_SMOOTHFRAME;Highlight attenuation & Levels TP_LOCALLAB_CIE_SMOOTH_GAMMA;Slope based TP_LOCALLAB_CIE_SMOOTH_GAMMA ROLLOFF;Gamma based +TP_LOCALLAB_CIE_SMOOTH_LEVELS;Levels TP_LOCALLAB_CIEC;Use Ciecam environment parameters TP_LOCALLAB_CIECAMLOG_TOOLTIP;This module is based on the CIECAM color appearance model which was designed to better simulate how human vision perceives colors under different lighting conditions.\nThe first Ciecam process 'Scene conditions' is carried out by Log encoding, it also uses 'Absolute luminance' at the time of shooting.\nThe second Ciecam process 'Image adjustments' is simplified and uses only 3 variables (local contrast, contrast J, saturation s).\nThe third Ciecam process 'Viewing conditions' adapts the output to the intended viewing conditions (monitor, TV, projector, printer, etc.) so that the chromatic and contrast appearance is preserved across the display environment. TP_LOCALLAB_CIECOLORFRA;Color @@ -3551,9 +3559,14 @@ TP_LOCALLAB_SIGMOIDWHITESCIE_TOOLTIP;Allows you, in Automatic, when the dynamic TP_LOCALLAB_SLOMASKCOL;Slope TP_LOCALLAB_SLOMASK_TOOLTIP;Adjusting Gamma and Slope can provide a soft and artifact-free transformation of the mask by progressively modifying 'L' to avoid any discontinuities. TP_LOCALLAB_SLOPESMOOTH;Gray balance (Slope) +TP_LOCALLAB_SLOPESMOOTHR;Red balance (Slope) +TP_LOCALLAB_SLOPESMOOTHG;Green balance (Slope) +TP_LOCALLAB_SLOPESMOOTHB;Blue balance (Slope) TP_LOCALLAB_SLOSH;Slope TP_LOCALLAB_SMOOTHCIE;Smooth & Tone-Mapping +TP_LOCALLAB_SMOOTHCIE_LUM;Luminosity mode TP_LOCALLAB_SMOOTHCIE_SCA;Scale Yb Scene +TP_LOCALLAB_SMOOTHCIE_YB;Scale Yb Viewing TP_LOCALLAB_SMOOTHCIE_TOOLTIP;Completes the processing carried out by gamma, slope and midtones by causing a slight lowering of lights. Please note this does not replace Highlight reconstruction.\n\nGamma - Slope - based: choice (Standard and Advanced) allows you to simulate a "Tone mapping" using: a) Scene conditions: Black-Ev, White-Ev, Mean luminance (Yb%); b) Viewing conditions: Mean luminance (Yb%).\nScale Yb Scene is function of White-Ev. TP_LOCALLAB_SOFT;Soft Light & Original Retinex TP_LOCALLAB_SOFTM;Soft Light diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index bc0972092..580475c37 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -1062,10 +1062,11 @@ void Crop::update(int todo) float stdretie = parent->stdretis[sp]; float fab = 1.f; - float maxicam = -1000.f; + float maxicam = -1000.f; float rdx, rdy, grx, gry, blx, bly = 0.f; float meanx, meany, meanxe, meanye = 0.f; int ill = 2; + int prim = 3; float minCD; float maxCD; float mini; @@ -1155,7 +1156,7 @@ void Crop::update(int todo) huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, lastsav, parent->previewDeltaE, parent->locallColorMask, parent->locallColorMaskinv, parent->locallExpMask, parent->locallExpMaskinv, parent->locallSHMask, parent->locallSHMaskinv, parent->locallvibMask, parent->localllcMask, parent->locallsharMask, parent->locallcbMask, parent->locallretiMask, parent->locallsoftMask, parent->localltmMask, parent->locallblMask, parent->localllogMask, parent->locall_Mask, parent->locallcieMask, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax, - meantme, stdtme, meanretie, stdretie, fab, maxicam,rdx, rdy, grx, gry, blx, bly, meanx, meany, meanxe, meanye,ill, contsig, lightsig, + meantme, stdtme, meanretie, stdretie, fab, maxicam,rdx, rdy, grx, gry, blx, bly, meanx, meany, meanxe, meanye, prim, ill, contsig, lightsig, highresi, nresi, highresi46, nresi46, Lhighresi, Lnresi, Lhighresi46, Lnresi46); LocallabListener::locallabDenoiseLC denoiselc; @@ -1268,7 +1269,7 @@ void Crop::update(int todo) LHutili, HHutili, CHutili, HHutilijz, CHutilijz, LHutilijz, cclocalcurve2, localcutili, rgblocalcurve2, localrgbutili, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, lastsav, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax, - meantme, stdtme, meanretie, stdretie, fab, maxicam, rdx, rdy, grx, gry, blx, bly, meanx, meany, meanxe, meanye, ill, contsig, lightsig, + meantme, stdtme, meanretie, stdretie, fab, maxicam, rdx, rdy, grx, gry, blx, bly, meanx, meany, meanxe, meanye, prim, ill, contsig, lightsig, highresi, nresi, highresi46, nresi46, Lhighresi, Lnresi, Lhighresi46, Lnresi46); } diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index fbdddf63a..5f8a4df15 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -1280,6 +1280,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) float rdx, rdy, grx, gry, blx, bly = 0.f; float meanx, meany, meanxe, meanye = 0.f; int ill = 2; + int prim = 3; bool istm = params->locallab.spots.at(sp).equiltm && params->locallab.spots.at(sp).exptonemap; bool isreti = params->locallab.spots.at(sp).equilret && params->locallab.spots.at(sp).expreti; //preparation for mean and sigma on current RT-spot @@ -1426,7 +1427,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) LHutili, HHutili, CHutili, HHutilijz, CHutilijz, LHutilijz, cclocalcurve, localcutili, rgblocalcurve, localrgbutili, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, huerblu, chromarblu, lumarblu, huer, chromar, lumar, sobeler, lastsav, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax, - meantm, stdtm, meanreti, stdreti, fab, maxicam, rdx, rdy, grx, gry, blx, bly, meanx, meany, meanxe, meanye, ill, contsig, lightsig, + meantm, stdtm, meanreti, stdreti, fab, maxicam, rdx, rdy, grx, gry, blx, bly, meanx, meany, meanxe, meanye, prim, ill, contsig, lightsig, highresi, nresi, highresi46, nresi46, Lhighresi, Lnresi, Lhighresi46, Lnresi46); diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 3283c8b64..9c6c794f0 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -364,7 +364,7 @@ enum class BlurType { double& huerefblur, double &chromarefblur, double& lumarefblur, double &hueref, double &chromaref, double &lumaref, double &sobelref, int &lastsav, bool prevDeltaE, int llColorMask, int llColorMaskinv, int llExpMask, int llExpMaskinv, int llSHMask, int llSHMaskinv, int llvibMask, int lllcMask, int llsharMask, int llcbMask, int llretiMask, int llsoftMask, int lltmMask, int llblMask, int lllogMask, int ll_Mask, int llcieMask, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax, - float& meantm, float& stdtm, float& meanreti, float& stdreti, float &fab, float &maxicam, float &rdx, float &rdy, float &grx, float &gry, float &blx, float &bly, float &meanx, float &meany, float &meanxe, float &meanye, int &ill, float &contsig, float &lightsig, + float& meantm, float& stdtm, float& meanreti, float& stdreti, float &fab, float &maxicam, float &rdx, float &rdy, float &grx, float &gry, float &blx, float &bly, float &meanx, float &meany, float &meanxe, float &meanye, int &prim, int &ill, float &contsig, float &lightsig, float &highresi, float &nresi, float &highresi46, float &nresi46, float &Lhighresi, float &Lnresi, float &Lhighresi46, float &Lnresi46); void tone_eqcam2(ImProcFunctions *ipf, Imagefloat *rgb, int whits, int blacks, const Glib::ustring &workingProfile, double scale, bool multithread); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index d7eca81ff..a40f2f146 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -941,8 +941,11 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.smoothciem = 2; } else if (locallab.spots.at(sp).smoothciemet == "gamnorol") { lp.smoothciem = 3; + } else if (locallab.spots.at(sp).smoothciemet == "level") { + lp.smoothciem = 4; } + if (locallab.spots.at(sp).spotMethod == "norm") { lp.fullim = 0; } else if (locallab.spots.at(sp).spotMethod == "exc") { @@ -2610,12 +2613,15 @@ float do_get(float x, bool rolloff_, float mid_gray_scene, float gamma, float dr //Copyright (c) 2023 Thatcher Freeman // Adapted to Rawtherapee Jacques Desmis 25 mars 2024 -void tonemapFreeman(float target_slope, float white_point, float black_point, float mid_gray_scene, float mid_gray_view, bool rolloff, LUTf& lut, int mode, bool scale) +void tonemapFreeman(float target_slope, float target_sloper, float target_slopeg , float target_slopeb, float white_point, float black_point, float mid_gray_scene, float mid_gray_view, bool rolloff, LUTf& lut, LUTf& lutr, LUTf& lutg, LUTf& lutb, int mode, bool scale, bool takeyb) { float dr;//Dynamic Range float b; float c;//black point float gamma; + float gammar; + float gammag; + float gammab; float mid_gray_scene_;//Mean luminance - Scene conditions // mid_gray_view //Mean luminance - Viewing conditions @@ -2630,8 +2636,18 @@ void tonemapFreeman(float target_slope, float white_point, float black_point, fl b = (dr / (mid_gray_scene_ - c)) * (1.f - ((mid_gray_scene_ - c) / dr)) * mid_gray_scene_;//b - ponderate mid_gray_scene taking into account the total DR, and the dark part below the mid_gray_scene gamma = target_slope * (float) std::pow((mid_gray_scene_ + b), 2.0) / (dr * b);//Caculate gamma with slope and mid_gray_scene + gammar = target_sloper * (float) std::pow((mid_gray_scene_ + b), 2.0) / (dr * b);//Caculate gamma with slope and mid_gray_scene + gammag = target_slopeg * (float) std::pow((mid_gray_scene_ + b), 2.0) / (dr * b);//Caculate gamma with slope and mid_gray_scene + gammab = target_slopeb * (float) std::pow((mid_gray_scene_ + b), 2.0) / (dr * b);//Caculate gamma with slope and mid_gray_scene float kmid = 1.f;//general case - if(mode == 3 && target_slope != 1.f) {//case tone-mapping + //float kyb = 1.f; + if(takeyb){ + kmid = mid_gray_scene / mid_gray_view; + kmid = cbrt(kmid); + } + // if(mode == 3 && target_slope != 1.f ) {//case tone-mapping +/* + float midutil = mid_gray_view / mid_gray_scene;//take into account ratio between Yb source and Yb viewing float midk = 1.f; float k_slope = 2.2f; @@ -2639,13 +2655,24 @@ void tonemapFreeman(float target_slope, float white_point, float black_point, fl midk = pow_F(midutil, k_slope * (target_slope - 1.f));//ponderation in function target_slope when "slope user" < 1.f } kmid = midk; + } - if (settings->verbose) { +*/ + if (mode == 3 && settings->verbose) { printf("b=%f gamma=%f slope=%f DynRange=%f kmid=%f black=%f Yb-scale=%f\n", (double) b, (double) gamma, (double) target_slope, (double) dr, (double) kmid, (double) c, (double) mid_gray_scene_); } //lut - take from Alberto Griggio - for (int i = 0; i < 65536; ++i) {// i - value image RGB - lut[i] = do_get(float(i) / 65535.f, rolloff, mid_gray_scene_, gamma, dr, b, c, kmid);//call main function + if(mode == 4) { + for (int i = 0; i < 65536; ++i) {// i - value image RGB + lutr[i] = do_get(float(i) / 65535.f, rolloff, mid_gray_scene_, gammar, dr, b, c, kmid);//call main function + lutg[i] = do_get(float(i) / 65535.f, rolloff, mid_gray_scene_, gammag, dr, b, c, kmid);//call main function + lutb[i] = do_get(float(i) / 65535.f, rolloff, mid_gray_scene_, gammab, dr, b, c, kmid);//call main function + } + } else { + kmid = 1.f; + for (int i = 0; i < 65536; ++i) {// i - value image RGB + lut[i] = do_get(float(i) / 65535.f, rolloff, mid_gray_scene_, gamma, dr, b, c, kmid);//call main function + } } } @@ -13769,7 +13796,7 @@ void ImProcFunctions::Lab_Local( double& huerefblur, double& chromarefblur, double& lumarefblur, double& hueref, double& chromaref, double& lumaref, double& sobelref, int &lastsav, bool prevDeltaE, int llColorMask, int llColorMaskinv, int llExpMask, int llExpMaskinv, int llSHMask, int llSHMaskinv, int llvibMask, int lllcMask, int llsharMask, int llcbMask, int llretiMask, int llsoftMask, int lltmMask, int llblMask, int lllogMask, int ll_Mask, int llcieMask, float& minCD, float& maxCD, float& mini, float& maxi, float& Tmean, float& Tsigma, float& Tmin, float& Tmax, - float& meantm, float& stdtm, float& meanreti, float& stdreti, float &fab,float &maxicam, float &rdx, float &rdy, float &grx, float &gry, float &blx, float &bly, float &meanx, float &meany, float &meanxe, float &meanye, int &ill, float &contsig, float &lightsig, + float& meantm, float& stdtm, float& meanreti, float& stdreti, float &fab,float &maxicam, float &rdx, float &rdy, float &grx, float &gry, float &blx, float &bly, float &meanx, float &meany, float &meanxe, float &meanye, int &prim, int &ill, float &contsig, float &lightsig, float& highresi, float& nresi, float& highresi46, float& nresi46, float& Lhighresi, float& Lnresi, float& Lhighresi46, float& Lnresi46 ) @@ -19961,6 +19988,42 @@ void ImProcFunctions::Lab_Local( } if (params->locallab.spots.at(sp).expprecam && params->locallab.spots.at(sp).modecam == "cam16") { + TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(params->icm.workingProfile); + TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix(params->icm.workingProfile); + + float toxyz[3][3] = { + { + static_cast(wprof[0][0] / static_cast(Color::D50x)), + static_cast(wprof[0][1] / static_cast(Color::D50x)), + static_cast(wprof[0][2] / static_cast(Color::D50x)) + }, { + static_cast(wprof[1][0]), + static_cast(wprof[1][1]), + static_cast(wprof[1][2]) + }, { + static_cast(wprof[2][0] / static_cast(Color::D50z)), + static_cast(wprof[2][1] / static_cast(Color::D50z)), + static_cast(wprof[2][2] / static_cast(Color::D50z)) + } + }; + + float maxFactorToxyz = max(toxyz[1][0], toxyz[1][1], toxyz[1][2]); + float equalR = maxFactorToxyz / toxyz[1][0]; + float equalG = maxFactorToxyz / toxyz[1][1]; + float equalB = maxFactorToxyz / toxyz[1][2]; + //inverse matrix user select + double wip[3][3] = { + {wiprof[0][0], wiprof[0][1], wiprof[0][2]}, + {wiprof[1][0], wiprof[1][1], wiprof[1][2]}, + {wiprof[2][0], wiprof[2][1], wiprof[2][2]} + }; + double wp[3][3] = { + {wprof[0][0], wprof[0][1], wprof[0][2]}, + {wprof[1][0], wprof[1][1], wprof[1][2]}, + {wprof[2][0], wprof[2][1], wprof[2][2]} + }; + + Imagefloat *tmpImage = nullptr; tmpImage = new Imagefloat(bfw, bfh); Imagefloat *tmpImagelog = nullptr; @@ -19972,7 +20035,7 @@ void ImProcFunctions::Lab_Local( float gamtone = params->locallab.spots.at(sp).gamjcie; float slotone = params->locallab.spots.at(sp).slopjcie; cmsHTRANSFORM dummy = nullptr; - int prim = 3; + //int prim = 3; int typ = 1; rdx = params->locallab.spots.at(sp).redxl; rdy = params->locallab.spots.at(sp).redyl; @@ -20095,42 +20158,147 @@ void ImProcFunctions::Lab_Local( if(lp.smoothciem == 1) { tone_eqsmooth(this, tmpImage, lp, params->icm.workingProfile, sk, multiThread);//reduce Ev > 0 < 12 - } else if(lp.smoothciem == 2 || lp.smoothciem == 3) {// 2 - only smmoth highlightd - 3 - Tone mapping with slope and mid_grey + } else if(lp.smoothciem == 2 || lp.smoothciem == 3 || lp.smoothciem == 4) {// 2 - only smmoth highlightd - 3 - Tone mapping with slope and mid_grey //TonemapFreeman - Copyright (c) 2023 Thatcher Freeman float mid_gray = 0.01f * lp.sourcegraycie;//Mean luminance Yb Scene float mid_gray_view = 0.01f * lp.targetgraycie;//Mean luminance Yb Viewing + // if(mode == 3 && target_slope != 1.f ) {//case tone-mapping +/* if(params->locallab.spots.at(sp).{ + float midutil = mid_gray_view / mid_gray_scene;//take into account ratio between Yb source and Yb viewing + float midk = 1.f; + float k_slope = 2.2f; + if(target_slope >= 1.f) { + midk = pow_F(midutil, k_slope * (target_slope - 1.f));//ponderation in function target_slope when "slope user" < 1.f + } + kmid = midk; + + } +*/ lp.whiteevjz = LIM(lp.whiteevjz, 0.1f, 31.5f);//limit whiteEv to avoid crash float white_point = xexpf(lp.whiteevjz * std::log(2.f) + xlogf(mid_gray));//lp.whiteevjz White_Ev lp.blackevjz = LIM(lp.blackevjz, -15.5f, -0.2f);//limit BlackEv to avoid crash float black_point = xexpf(lp.blackevjz * std::log(2.f) + xlogf(mid_gray));//lp.blackevjz Black_Ev bool rolloff = true;//only soften highlights float slopegray = 1.f;//slopegray between 0.8 and 1.6 - lineary light the shadows by the user - the gamma is calculated according to slope and the characteristics of the image DR, White, Black + float slopegrayr = 1.f; + float slopegrayg = 1.f; + float slopegrayb = 1.f; int mode = 1; float slopsmoot = 1.f - ((float) params->locallab.spots.at(sp).slopesmo - 1.f);//modify response so when increase slope the grays are becoming lighter + float slopsmootr = 1.f - ((float) params->locallab.spots.at(sp).slopesmor - 1.f); + float slopsmootg = 1.f - ((float) params->locallab.spots.at(sp).slopesmog - 1.f); + float slopsmootb = 1.f - ((float) params->locallab.spots.at(sp).slopesmob - 1.f); + bool takeyb = params->locallab.spots.at(sp).smoothcieyb; + bool lummod = params->locallab.spots.at(sp).smoothcielum; + float maxsl= 4.f;//maximum real slope + float minslider = 0.01f;//minimum slider value > 0.f + float aa = (1.9f - maxsl) / (0.1f - minslider);//interpolation : 1.9f slope value for slider = 0.1f + float bb = 1.9f - 0.1f * aa; + if(lp.smoothciem == 3) {//slope activ, only with choice gamma - slope - based rolloff = false;//allows tone-mapping slope + if(slopsmoot < 0.1f) { + slopsmoot = aa * slopsmoot + bb; + } slopegray = slopsmoot; + slopegrayr = slopsmoot; + slopegrayg = slopsmoot; + slopegrayb = slopsmoot; mode = 3; + }//modify slope + if(lp.smoothciem == 4) {//levels + rolloff = false;//allows tone-mapping slope + if(slopsmootr < 0.1f) { + slopsmootr = aa * slopsmootr + bb; + } + slopegrayr = slopsmootr; + if(slopsmootg < 0.1f) { + slopsmootg = aa * slopsmootg + bb; + } + slopegrayg = slopsmootg; + if(slopsmootb < 0.1f) { + slopsmootb = aa * slopsmootb + bb; + } + slopegrayb = slopsmootb; + mode = 4; } + LUTf lut(65536, LUT_CLIP_OFF);//take from Alberto Griggio + LUTf lutr(65536, LUT_CLIP_OFF); + LUTf lutg(65536, LUT_CLIP_OFF); + LUTf lutb(65536, LUT_CLIP_OFF); bool scale = lp.issmoothcie;//scale Yb mid_gray - WhiteEv and BlavkEv - tonemapFreeman(slopegray, white_point, black_point, mid_gray, mid_gray_view, rolloff, lut, mode, scale); + + tonemapFreeman(slopegray, slopegrayr, slopegrayg, slopegrayb, white_point, black_point, mid_gray, mid_gray_view, rolloff, lut, lutr, lutg, lutb, mode, scale, takeyb); + if(lp.smoothciem == 4) { + if(lummod) {//luminosity mode by Lab conversion #ifdef _OPENMP #pragma omp parallel for #endif - for (int y = 0; y < bfh ; ++ y) {//apply Lut tone-mapping or smooth: thanks to Alberto - gain time. - for (int x = 0; x < bfw ; ++x) { - tmpImage->r(y, x) = 65535.f * lut[tmpImage->r(y, x)]; - tmpImage->g(y, x) = 65535.f * lut[tmpImage->g(y, x)]; - tmpImage->b(y, x) = 65535.f * lut[tmpImage->b(y, x)]; + for (int y = 0; y < bfh ; ++ y) { + for (int x = 0; x < bfw ; ++x) { + float r = tmpImage->r(y, x); + float g = tmpImage->g(y, x); + float b = tmpImage->b(y, x); + //convert to Lab to get a&b before RGB + float xx = toxyz[0][0] * r + toxyz[0][1] * g + toxyz[0][2] * b; + float yy = toxyz[1][0] * r + toxyz[1][1] * g + toxyz[1][2] * b; + float zz = toxyz[2][0] * r + toxyz[2][1] * g + toxyz[2][2] * b; + + float fx = xx < MAXVALF ? Color::cachef[xx] : 327.68f * std::cbrt(xx / MAXVALF); + float fy = yy < MAXVALF ? Color::cachef[yy] : 327.68f * std::cbrt(yy / MAXVALF); + float fz = zz < MAXVALF ? Color::cachef[zz] : 327.68f * std::cbrt(zz / MAXVALF); + + float a_1 = 500.0f * (fx - fy); + float b_1 = 200.0f * (fy - fz); + float rNew = 65535.f * lutr[tmpImage->r(y, x)]; + float gNew = 65535.f * lutg[tmpImage->g(y, x)]; + float bNew = 65535.f * lutb[tmpImage->b(y, x)]; + r += (rNew - r) * equalR; + g += (gNew - g) * equalG; + b += (bNew - b) * equalB; + float newy = toxyz[1][0] * r + toxyz[1][1] * g + toxyz[1][2] * b; + float L_2 = newy <= MAXVALF ? Color::cachefy[newy] : 327.68f * (116.f * xcbrtf(newy / MAXVALF) - 16.f); + float x_, y_, z_; + //calculate RGB with L_2 and old value of a and b + Color::Lab2XYZ(L_2, a_1, b_1, x_, y_, z_) ; + if (params->locallab.spots.at(sp).avoidgamutMethod != "NONE") {//possibility of deactivating to see usefulness. is it necessary? + Color::gamutmap(x_, y_, z_, wp);//if none disabled + } + Color::xyz2rgb(x_, y_, z_, r, g, b, wip); + tmpImage->r(y, x) = r; + tmpImage->g(y, x) = g; + tmpImage->b(y, x) = b; + } + } + } else {//RGG case + #ifdef _OPENMP + #pragma omp parallel for +#endif + for (int y = 0; y < bfh ; ++ y) {//apply Lut tone-mapping or smooth: thanks to Alberto - gain time. + for (int x = 0; x < bfw ; ++x) { + tmpImage->r(y, x) = 65535.f * lutr[tmpImage->r(y, x)]; + tmpImage->g(y, x) = 65535.f * lutg[tmpImage->g(y, x)]; + tmpImage->b(y, x) = 65535.f * lutb[tmpImage->b(y, x)]; + } + } + } + } else {//Slope case + #ifdef _OPENMP + #pragma omp parallel for +#endif + for (int y = 0; y < bfh ; ++ y) {//apply Lut tone-mapping or smooth: thanks to Alberto - gain time. + for (int x = 0; x < bfw ; ++x) { + tmpImage->r(y, x) = 65535.f * lut[tmpImage->r(y, x)]; + tmpImage->g(y, x) = 65535.f * lut[tmpImage->g(y, x)]; + tmpImage->b(y, x) = 65535.f * lut[tmpImage->b(y, x)]; + } } } - } - rgb2lab(*tmpImage, *bufexpfin, params->icm.workingProfile); delete tmpImage; @@ -20220,6 +20388,19 @@ void ImProcFunctions::Lab_Local( ImProcFunctions::localContrast(bufexpfin.get(), bufexpfin->L, localContrastParams, fftwlc, sk); } + if (params->locallab.spots.at(sp).bwcie) { +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) if (multiThread) +#endif + + for (int ir = 0; ir < bfh; ir++) { + for (int jr = 0; jr < bfw; jr++) { + bufexpfin->a[ir][jr] = 0.f; + bufexpfin->b[ir][jr] = 0.f; + } + } + } + const float repart = 1.0 - 0.01 * params->locallab.spots.at(sp).reparcie; int bw = bufexporig->W; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index cd80a8980..763decb75 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -4435,11 +4435,14 @@ LocallabParams::LocallabSpot::LocallabSpot() : comprcieauto(false), normcie(true), gamutcie(true), + bwcie(false), sigcie(true), logcie(false), satcie(true), logcieq(false), smoothcie(false), + smoothcieyb(false), + smoothcielum(false), logjz(false), sigjz(false), sigq(false), @@ -4624,6 +4627,9 @@ LocallabParams::LocallabSpot::LocallabSpot() : gamjcie(2.4), slopjcie(12.923), slopesmo(1.), + slopesmor(1.), + slopesmog(1.), + slopesmob(1.), midtcie(0), grexl(0.1596), greyl(0.8404), @@ -5392,11 +5398,14 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && comprcieauto == other.comprcieauto && normcie == other.normcie && gamutcie == other.gamutcie + && bwcie == other.bwcie && sigcie == other.sigcie && logcie == other.logcie && satcie == other.satcie && logcieq == other.logcieq && smoothcie == other.smoothcie + && smoothcieyb == other.smoothcieyb + && smoothcielum == other.smoothcielum && logjz == other.logjz && sigjz == other.sigjz && sigq == other.sigq @@ -5463,6 +5472,9 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && gamjcie == other.gamjcie && slopjcie == other.slopjcie && slopesmo == other.slopesmo + && slopesmor == other.slopesmor + && slopesmog == other.slopesmog + && slopesmob == other.slopesmob && midtcie == other.midtcie && redxl == other.redxl && redyl == other.redyl @@ -7334,11 +7346,14 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->comprcieauto, "Locallab", "comprcieauto_" + index_str, spot.comprcieauto, keyFile); saveToKeyfile(!pedited || spot_edited->normcie, "Locallab", "normcie_" + index_str, spot.normcie, keyFile); saveToKeyfile(!pedited || spot_edited->gamutcie, "Locallab", "gamutcie_" + index_str, spot.gamutcie, keyFile); + saveToKeyfile(!pedited || spot_edited->bwcie, "Locallab", "bwcie_" + index_str, spot.bwcie, keyFile); saveToKeyfile(!pedited || spot_edited->sigcie, "Locallab", "sigcie_" + index_str, spot.sigcie, keyFile); saveToKeyfile(!pedited || spot_edited->logcie, "Locallab", "logcie_" + index_str, spot.logcie, keyFile); saveToKeyfile(!pedited || spot_edited->satcie, "Locallab", "satcie_" + index_str, spot.satcie, keyFile); saveToKeyfile(!pedited || spot_edited->logcieq, "Locallab", "logcieq_" + index_str, spot.logcieq, keyFile); saveToKeyfile(!pedited || spot_edited->smoothcie, "Locallab", "smoothcie_" + index_str, spot.smoothcie, keyFile); + saveToKeyfile(!pedited || spot_edited->smoothcieyb, "Locallab", "smoothcieyb_" + index_str, spot.smoothcieyb, keyFile); + saveToKeyfile(!pedited || spot_edited->smoothcielum, "Locallab", "smoothcielum_" + index_str, spot.smoothcielum, keyFile); saveToKeyfile(!pedited || spot_edited->logjz, "Locallab", "Logjz_" + index_str, spot.logjz, keyFile); saveToKeyfile(!pedited || spot_edited->sigjz, "Locallab", "Sigjz_" + index_str, spot.sigjz, keyFile); saveToKeyfile(!pedited || spot_edited->sigq, "Locallab", "Sigq_" + index_str, spot.sigq, keyFile); @@ -7405,6 +7420,9 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->gamjcie, "Locallab", "gamjcie_" + index_str, spot.gamjcie, keyFile); saveToKeyfile(!pedited || spot_edited->slopjcie, "Locallab", "slopjcie_" + index_str, spot.slopjcie, keyFile); saveToKeyfile(!pedited || spot_edited->slopesmo, "Locallab", "slopesmo_" + index_str, spot.slopesmo, keyFile); + saveToKeyfile(!pedited || spot_edited->slopesmor, "Locallab", "slopesmor_" + index_str, spot.slopesmor, keyFile); + saveToKeyfile(!pedited || spot_edited->slopesmog, "Locallab", "slopesmog_" + index_str, spot.slopesmog, keyFile); + saveToKeyfile(!pedited || spot_edited->slopesmob, "Locallab", "slopesmob_" + index_str, spot.slopesmob, keyFile); saveToKeyfile(!pedited || spot_edited->midtcie, "Locallab", "midtcie_" + index_str, spot.midtcie, keyFile); saveToKeyfile(!pedited || spot_edited->redxl, "Locallab", "redxl_" + index_str, spot.redxl, keyFile); saveToKeyfile(!pedited || spot_edited->redyl, "Locallab", "redyl_" + index_str, spot.redyl, keyFile); @@ -9687,11 +9705,14 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "comprcieauto_" + index_str, spot.comprcieauto, spotEdited.comprcieauto); assignFromKeyfile(keyFile, "Locallab", "normcie_" + index_str, spot.normcie, spotEdited.normcie); assignFromKeyfile(keyFile, "Locallab", "gamutcie_" + index_str, spot.gamutcie, spotEdited.gamutcie); + assignFromKeyfile(keyFile, "Locallab", "bwcie_" + index_str, spot.bwcie, spotEdited.bwcie); assignFromKeyfile(keyFile, "Locallab", "sigcie_" + index_str, spot.sigcie, spotEdited.sigcie); assignFromKeyfile(keyFile, "Locallab", "logcie_" + index_str, spot.logcie, spotEdited.logcie); assignFromKeyfile(keyFile, "Locallab", "satcie_" + index_str, spot.satcie, spotEdited.satcie); assignFromKeyfile(keyFile, "Locallab", "logcieq_" + index_str, spot.logcieq, spotEdited.logcieq); assignFromKeyfile(keyFile, "Locallab", "smoothcie_" + index_str, spot.smoothcie, spotEdited.smoothcie); + assignFromKeyfile(keyFile, "Locallab", "smoothcieyb_" + index_str, spot.smoothcieyb, spotEdited.smoothcieyb); + assignFromKeyfile(keyFile, "Locallab", "smoothcielum_" + index_str, spot.smoothcielum, spotEdited.smoothcielum); assignFromKeyfile(keyFile, "Locallab", "Logjz_" + index_str, spot.logjz, spotEdited.logjz); assignFromKeyfile(keyFile, "Locallab", "Sigjz_" + index_str, spot.sigjz, spotEdited.sigjz); assignFromKeyfile(keyFile, "Locallab", "Sigq_" + index_str, spot.sigq, spotEdited.sigq); @@ -9767,7 +9788,10 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "gamjcie_" + index_str, spot.gamjcie, spotEdited.gamjcie); assignFromKeyfile(keyFile, "Locallab", "slopjcie_" + index_str, spot.slopjcie, spotEdited.slopjcie); assignFromKeyfile(keyFile, "Locallab", "slopesmo_" + index_str, spot.slopesmo, spotEdited.slopesmo); + assignFromKeyfile(keyFile, "Locallab", "slopesmor_" + index_str, spot.slopesmor, spotEdited.slopesmor); + assignFromKeyfile(keyFile, "Locallab", "slopesmog_" + index_str, spot.slopesmog, spotEdited.slopesmog); assignFromKeyfile(keyFile, "Locallab", "midtcie_" + index_str, spot.midtcie, spotEdited.midtcie); + assignFromKeyfile(keyFile, "Locallab", "slopesmob_" + index_str, spot.slopesmob, spotEdited.slopesmob); assignFromKeyfile(keyFile, "Locallab", "grexl_" + index_str, spot.grexl, spotEdited.grexl); assignFromKeyfile(keyFile, "Locallab", "greyl_" + index_str, spot.greyl, spotEdited.greyl); assignFromKeyfile(keyFile, "Locallab", "bluxl_" + index_str, spot.bluxl, spotEdited.bluxl); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 0eb991933..d1cad0a5d 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1663,11 +1663,14 @@ struct LocallabParams { bool comprcieauto; bool normcie; bool gamutcie; + bool bwcie; bool sigcie; bool logcie; bool satcie; bool logcieq; bool smoothcie; + bool smoothcieyb; + bool smoothcielum; bool logjz; bool sigjz; bool sigq; @@ -1734,6 +1737,9 @@ struct LocallabParams { double gamjcie; double slopjcie; double slopesmo; + double slopesmor; + double slopesmog; + double slopesmob; int midtcie; double grexl; double greyl; diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index e76d17336..e27f372ae 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -448,6 +448,7 @@ public: double meanylc; double meanxelc; double meanyelc; + int primlc; }; struct locallabcieSIG { diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 241d628e9..06194e437 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -1260,6 +1260,7 @@ private: float rdx, rdy, grx, gry, blx, bly = 0.f; float meanx, meany, meanxe, meanye = 0.f; int ill = 2; + int prim = 3; if (params.locallab.spots.at(sp).spotMethod == "exc") { ipf.calc_ref(sp, reservView.get(), reservView.get(), 0, 0, fw, fh, 1, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge, locwavCurveden, locwavdenutili); @@ -1341,7 +1342,7 @@ private: LHutili, HHutili, CHutili, HHutilijz, CHutilijz, LHutilijz, cclocalcurve, localcutili, rgblocalcurve, localrgbutili, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, lastsav, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax, - meantme, stdtme, meanretie, stdretie, fab, maxicam, rdx, rdy, grx, gry, blx, bly, meanx, meany, meanxe, meanye, ill, contsig, lightsig, + meantme, stdtme, meanretie, stdretie, fab, maxicam, rdx, rdy, grx, gry, blx, bly, meanx, meany, meanxe, meanye, prim, ill, contsig, lightsig, highresi, nresi, highresi46, nresi46, Lhighresi, Lnresi, Lhighresi46, Lnresi46 ); diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 999653ad7..bc5e2144b 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -1187,8 +1187,9 @@ void Locallab::cieChanged(const std::vector &cielc, int selspot) const double m2 = cie_lc.at(selspot).meanylc; const double me1 = cie_lc.at(selspot).meanxelc; const double me2 = cie_lc.at(selspot).meanyelc; + const int pri = cie_lc.at(selspot).primlc; - expcie.updateiPrimloc(r1, r2, g1, g2, b1, b2, w1, w2, m1, m2, me1, me2); + expcie.updateiPrimloc(r1, r2, g1, g2, b1, b2, w1, w2, m1, m2, me1, me2, pri); } } diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 4a0e68564..1d43b6ef1 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -77,7 +77,12 @@ protected: rtengine::ProcEvent Evlocallabslopjcie; rtengine::ProcEvent Evlocallabmidtcie; rtengine::ProcEvent Evlocallabslopesmo; + rtengine::ProcEvent Evlocallabslopesmor; + rtengine::ProcEvent Evlocallabslopesmog; + rtengine::ProcEvent Evlocallabslopesmob; rtengine::ProcEvent Evlocallabsmoothcie; + rtengine::ProcEvent Evlocallabsmoothcieyb; + rtengine::ProcEvent Evlocallabsmoothcielum; rtengine::ProcEvent Evlocallabsmoothciemet; rtengine::ProcEvent Evlocallabsigcie; rtengine::ProcEvent Evlocallabillcie; @@ -98,6 +103,7 @@ protected: rtengine::ProcEvent Evlocallabbluyl; rtengine::ProcEvent EvlocallabGridciexy; rtengine::ProcEvent Evlocallabgamutcie; + rtengine::ProcEvent Evlocallabbwcie; rtengine::ProcEvent Evlocallabexpprecam; rtengine::ProcEvent Evlocallablightsigqcie; rtengine::ProcEvent Evlocallabcontsigqcie; @@ -1690,10 +1696,15 @@ private: Adjuster* const slopjcie; Adjuster* const midtcie; Gtk::CheckButton* const smoothcie; + Gtk::CheckButton* const smoothcieyb; + Gtk::CheckButton* const smoothcielum; ToolParamBlock* const ciesmoothBox; Gtk::Box* smoothBox; MyComboBoxText* const smoothciemet; Adjuster* const slopesmo; + Adjuster* const slopesmor; + Adjuster* const slopesmog; + Adjuster* const slopesmob; Adjuster* const whitescie; Adjuster* const blackscie; @@ -1724,6 +1735,8 @@ private: Gtk::CheckButton* const gamutcie; Adjuster* const shiftxl; Adjuster* const shiftyl; + Gtk::Box* bwcieBox; + Gtk::CheckButton* const bwcie; Gtk::Frame* const sigmoidjzFrame; Gtk::Frame* const sigmoid2Frame; @@ -1824,7 +1837,7 @@ private: ThresholdAdjuster* const csThresholdcie; int nextcomprciecount = 0; - sigc::connection AutograycieConn, primMethodconn, illMethodconn, smoothciemetconn, catMethodconn, forcejzConn, forcebwConn, qtojConn, showmaskcieMethodConn, enacieMaskConn, enacieMaskallConn, jabcieConn, sursourcieconn, surroundcieconn, modecieconn, modecamconn, comprcieautoconn, normcieconn, logcieconn, satcieconn, logcieqconn,smoothcieconn, logjzconn, sigjzconn, sigqconn, chjzcieconn, toneMethodcieConn, toneMethodcieConn2, toolcieConn, bwevMethodConn, fftcieMaskConn, gamutcieconn, expprecamconn, sigcieconn; + sigc::connection AutograycieConn, primMethodconn, illMethodconn, smoothciemetconn, catMethodconn, forcejzConn, forcebwConn, qtojConn, showmaskcieMethodConn, enacieMaskConn, enacieMaskallConn, jabcieConn, sursourcieconn, surroundcieconn, modecieconn, modecamconn, comprcieautoconn, normcieconn, logcieconn, satcieconn, logcieqconn,smoothcieconn, smoothcieybconn,smoothcielumconn, logjzconn, sigjzconn, sigqconn, chjzcieconn, toneMethodcieConn, toneMethodcieConn2, toolcieConn, bwevMethodConn, fftcieMaskConn, gamutcieconn, bwcieconn, expprecamconn, sigcieconn; public: Locallabcie(); ~Locallabcie(); @@ -1860,7 +1873,7 @@ public: void bwevMethodChanged(); void updateAutocompute(const float blackev, const float whiteev, const float sourceg, const float sourceab, const float targetg, const float jz1); void updatePrimloc(const float redx, const float redy, const float grex, const float grey, const float blux, const float bluy); - void updateiPrimloc(const float r_x, const float r_y, const float g_x, const float g_y, const float b_x, const float b_y, const float w_x, const float w_y, const float m_x, const float m_y, const float me_x, const float me_y); + void updateiPrimloc(const float r_x, const float r_y, const float g_x, const float g_y, const float b_x, const float b_y, const float w_x, const float w_y, const float m_x, const float m_y, const float me_x, const float me_y, const int pri_); void updatesigloc(const float cont_sig, const float light_sig); private: @@ -1877,6 +1890,7 @@ private: void comprcieautoChanged(); void normcieChanged(); void gamutcieChanged(); + void bwcieChanged(); void illMethodChanged(); void smoothciemetChanged(); void primMethodChanged(); @@ -1885,6 +1899,8 @@ private: void satcieChanged(); void logcieqChanged(); void smoothcieChanged(); + void smoothcieybChanged(); + void smoothcielumChanged(); void sigcieChanged(); void logjzChanged(); void sigjzChanged(); diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index 5417271ab..17b5d3ead 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -7618,10 +7618,15 @@ Locallabcie::Locallabcie(): slopjcie(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SIGSLOPJCIE"), 0., 500., 0.01, 12.923))), midtcie(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MIDTCIE"), -100, 100, 1, 0))), smoothcie(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_SMOOTHCIE_SCA")))), + smoothcieyb(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_SMOOTHCIE_YB")))), + smoothcielum(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_SMOOTHCIE_LUM")))), ciesmoothBox(Gtk::manage(new ToolParamBlock())), smoothBox(Gtk::manage(new Gtk::Box())), smoothciemet(Gtk::manage(new MyComboBoxText())), - slopesmo(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SLOPESMOOTH"), 0.6, 1.6, 0.01, 1.))), + slopesmo(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SLOPESMOOTH"), 0.01, 1.6, 0.01, 1.))), + slopesmor(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SLOPESMOOTHR"), 0.01, 1.6, 0.01, 1.))), + slopesmog(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SLOPESMOOTHG"), 0.01, 1.6, 0.01, 1.))), + slopesmob(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SLOPESMOOTHB"), 0.01, 1.6, 0.01, 1.))), whitescie(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SIGWHITESCIE"), -100, 100, 1, 0))), blackscie(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SIGBLACKSSCIE"), -100, 100, 1, 0))), willBox(Gtk::manage(new Gtk::Box())), @@ -7651,6 +7656,8 @@ Locallabcie::Locallabcie(): gamutcie(Gtk::manage(new Gtk::CheckButton(M("TP_ICM_GAMUT")))), shiftxl(Gtk::manage(new Adjuster(M("TC_LOCALLAB_PRIM_SHIFTX"), -0.20, 0.20, 0.0001, 0.))), shiftyl(Gtk::manage(new Adjuster(M("TC_LOCALLAB_PRIM_SHIFTY"), -0.20, 0.20, 0.0001, 0.))), + bwcieBox(Gtk::manage(new Gtk::Box())), + bwcie(Gtk::manage(new Gtk::CheckButton(M("TP_ICM_BW")))), sigmoidjzFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_SIGJZFRA")))), sigmoid2Frame(Gtk::manage(new Gtk::Frame(M("")))), @@ -7770,7 +7777,12 @@ Locallabcie::Locallabcie(): Evlocallabslopjcie = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_CIE_SLOP"); Evlocallabmidtcie = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_CIE_MIDT"); Evlocallabslopesmo = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_CIE_SLOPESMO"); + Evlocallabslopesmor = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_CIE_SLOPESMOR"); + Evlocallabslopesmog = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_CIE_SLOPESMOG"); + Evlocallabslopesmob = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_CIE_SLOPESMOB"); Evlocallabsmoothcie = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_CIE_SMOOTH"); + Evlocallabsmoothcieyb = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_CIE_SMOOTHYB"); + Evlocallabsmoothcielum = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_CIE_SMOOTH_LUM"); Evlocallabsigcie = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_CIE_SIG"); Evlocallabillcie = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_CIE_ILL"); Evlocallabprimcie = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_CIE_PRIM"); @@ -7785,6 +7797,7 @@ Locallabcie::Locallabcie(): Evlocallabbluyl = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_CIE_BLUYL"); EvlocallabGridciexy = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_CIE_LABGRIDCIE"); Evlocallabgamutcie = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_CIE_GAMUTCIE"); + Evlocallabbwcie = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_CIE_BWCIE"); Evlocallabexpprecam = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_CIE_EXPPRECAM"); Evlocallablightsigqcie = m->newEvent(AUTOEXP, ""); Evlocallabcontsigqcie = m->newEvent(AUTOEXP, ""); @@ -8009,6 +8022,10 @@ Locallabcie::Locallabcie(): ToolParamBlock* const signormBox = Gtk::manage(new ToolParamBlock()); ToolParamBlock* const sigfraBox = Gtk::manage(new ToolParamBlock()); + bwcieBox->pack_start(*bwcie, Gtk::PACK_EXPAND_WIDGET); + + bwcieconn = bwcie->signal_toggled().connect(sigc::mem_fun(*this, &Locallabcie::bwcieChanged)); + modeHBoxbwev->set_spacing(2); ToolParamBlock* const gamcieBox = Gtk::manage(new ToolParamBlock()); Gtk::Label* modeLabelbwev = Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_SIGMOIDQJ") + ":")); @@ -8041,9 +8058,15 @@ Locallabcie::Locallabcie(): smoothciemet->append(M("TP_LOCALLAB_CIE_SMOOTH_EV")); smoothciemet->append(M("TP_LOCALLAB_CIE_SMOOTH_GAMMA ROLLOFF")); smoothciemet->append(M("TP_LOCALLAB_CIE_SMOOTH_GAMMA")); + smoothciemet->append(M("TP_LOCALLAB_CIE_SMOOTH_LEVELS")); smoothciemet->set_active(0); ciesmoothBox->pack_start(*smoothBox); ciesmoothBox->pack_start(*slopesmo); + ciesmoothBox->pack_start(*slopesmor); + ciesmoothBox->pack_start(*slopesmog); + ciesmoothBox->pack_start(*slopesmob); + ciesmoothBox->pack_start(*smoothcielum); + ciesmoothBox->pack_start(*smoothcieyb); ciesmoothBox->pack_start(*smoothcie); smoothciemetconn = smoothciemet->signal_changed().connect(sigc::mem_fun(*this, &Locallabcie::smoothciemetChanged)); @@ -8065,6 +8088,7 @@ Locallabcie::Locallabcie(): colorBox->pack_start(*shiftxl); colorBox->pack_start(*shiftyl); colorFramecie->add(*colorBox); + primillBox->pack_start(*bwcieBox); primillBox->pack_start(*colorFramecie); primillFrame->add(*primillBox); gamcieBox->pack_start(*primillFrame); @@ -8284,6 +8308,8 @@ Locallabcie::Locallabcie(): satcieconn = satcie->signal_toggled().connect(sigc::mem_fun(*this, &Locallabcie::satcieChanged)); logcieqconn = logcieq->signal_toggled().connect(sigc::mem_fun(*this, &Locallabcie::logcieqChanged)); smoothcieconn = smoothcie->signal_toggled().connect(sigc::mem_fun(*this, &Locallabcie::smoothcieChanged)); + smoothcieybconn = smoothcieyb->signal_toggled().connect(sigc::mem_fun(*this, &Locallabcie::smoothcieybChanged)); + smoothcielumconn = smoothcielum->signal_toggled().connect(sigc::mem_fun(*this, &Locallabcie::smoothcielumChanged)); logjzconn = logjz->signal_toggled().connect(sigc::mem_fun(*this, &Locallabcie::logjzChanged)); sigjzconn = sigjz->signal_toggled().connect(sigc::mem_fun(*this, &Locallabcie::sigjzChanged)); sigqconn = sigq->signal_toggled().connect(sigc::mem_fun(*this, &Locallabcie::sigqChanged)); @@ -8407,6 +8433,9 @@ Locallabcie::Locallabcie(): catadcie->setAdjusterListener(this); slopesmo->setAdjusterListener(this); + slopesmor->setAdjusterListener(this); + slopesmog->setAdjusterListener(this); + slopesmob->setAdjusterListener(this); Gtk::Box *TittleVBoxcam16; TittleVBoxcam16 = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); @@ -8891,6 +8920,7 @@ void Locallabcie::disableListener() normcieconn.block(true); expprecamconn.block(true); gamutcieconn.block(true); + bwcieconn.block(true); primMethodconn.block(true); illMethodconn.block(true); smoothciemetconn.block(true); @@ -8900,6 +8930,8 @@ void Locallabcie::disableListener() satcieconn.block(true); logcieqconn.block(true); smoothcieconn.block(true); + smoothcieybconn.block(true); + smoothcielumconn.block(true); logjzconn.block(true); sigjzconn.block(true); sigqconn.block(true); @@ -8930,6 +8962,7 @@ void Locallabcie::enableListener() normcieconn.block(false); expprecamconn.block(false); gamutcieconn.block(false); + bwcieconn.block(false); primMethodconn.block(false); illMethodconn.block(false); smoothciemetconn.block(false); @@ -8939,6 +8972,8 @@ void Locallabcie::enableListener() satcieconn.block(false); logcieqconn.block(false); smoothcieconn.block(false); + smoothcieybconn.block(false); + smoothcielumconn.block(false); logjzconn.block(false); sigjzconn.block(false); sigqconn.block(false); @@ -9173,6 +9208,8 @@ void Locallabcie::read(const rtengine::procparams::ProcParams* pp, const ParamsE smoothciemet->set_active(2); } else if (spot.smoothciemet == "gamnorol") { smoothciemet->set_active(3); + } else if (spot.smoothciemet == "level") { + smoothciemet->set_active(4); } @@ -9239,7 +9276,7 @@ void Locallabcie::read(const rtengine::procparams::ProcParams* pp, const ParamsE primMethod->set_active(11); illMethod->set_active(4); } else if (spot.primMethod == "free") { - primMethod->set_active(9); + primMethod->set_active(12); illMethod->set_sensitive(true); } @@ -9259,11 +9296,14 @@ void Locallabcie::read(const rtengine::procparams::ProcParams* pp, const ParamsE normcie->set_active(spot.normcie); gamutcie->set_active(spot.gamutcie); + bwcie->set_active(spot.bwcie); sigcie->set_active(spot.sigcie); logcie->set_active(spot.logcie); satcie->set_active(spot.satcie); logcieq->set_active(spot.logcieq); smoothcie->set_active(spot.smoothcie); + smoothcieyb->set_active(spot.smoothcieyb); + smoothcielum->set_active(spot.smoothcielum); logjz->set_active(spot.logjz); sigjz->set_active(spot.sigjz); sigq->set_active(spot.sigq); @@ -9277,6 +9317,7 @@ void Locallabcie::read(const rtengine::procparams::ProcParams* pp, const ParamsE normcieChanged(); expprecamChanged(); gamutcieChanged(); + bwcieChanged(); sigcieChanged(); comprcieautoChanged(); sigqChanged(); @@ -9284,6 +9325,8 @@ void Locallabcie::read(const rtengine::procparams::ProcParams* pp, const ParamsE satcieChanged(); logcieqChanged(); smoothcieChanged(); + smoothcieybChanged(); + smoothcielumChanged(); primMethodChanged(); illMethodChanged(); smoothciemetChanged(); @@ -9371,6 +9414,9 @@ void Locallabcie::read(const rtengine::procparams::ProcParams* pp, const ParamsE gamjcie->setValue(spot.gamjcie); slopjcie->setValue(spot.slopjcie); slopesmo->setValue(spot.slopesmo); + slopesmor->setValue(spot.slopesmor); + slopesmog->setValue(spot.slopesmog); + slopesmob->setValue(spot.slopesmob); midtcie->setValue(spot.midtcie); whitescie->setValue(spot.whitescie); blackscie->setValue(spot.blackscie); @@ -9524,11 +9570,14 @@ void Locallabcie::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedi spot.comprcieauto = comprcieauto->get_active(); spot.normcie = normcie->get_active(); spot.gamutcie = gamutcie->get_active(); + spot.bwcie = bwcie->get_active(); spot.sigcie = sigcie->get_active(); spot.logcie = logcie->get_active(); spot.satcie = satcie->get_active(); spot.logcieq = logcieq->get_active(); spot.smoothcie = smoothcie->get_active(); + spot.smoothcieyb = smoothcieyb->get_active(); + spot.smoothcielum = smoothcielum->get_active(); spot.logjz = logjz->get_active(); spot.sigjz = sigjz->get_active(); spot.chjzcie = chjzcie->get_active(); @@ -9560,6 +9609,8 @@ void Locallabcie::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedi spot.smoothciemet = "gam"; } else if (smoothciemet->get_active_row_number() == 3) { spot.smoothciemet = "gamnorol"; + } else if (smoothciemet->get_active_row_number() == 4) { + spot.smoothciemet = "level"; } if (illMethod->get_active_row_number() == 0) { @@ -9689,6 +9740,9 @@ void Locallabcie::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedi spot.gamjcie = gamjcie->getValue(); spot.slopjcie = slopjcie->getValue(); spot.slopesmo = slopesmo->getValue(); + spot.slopesmor = slopesmor->getValue(); + spot.slopesmog = slopesmog->getValue(); + spot.slopesmob = slopesmob->getValue(); spot.midtcie = midtcie->getIntValue(); spot.whitescie = whitescie->getIntValue(); spot.blackscie = blackscie->getIntValue(); @@ -9823,7 +9877,7 @@ void Locallabcie::updatesigloc(const float cont_sig, const float light_sig) -void Locallabcie::updateiPrimloc(const float r_x, const float r_y, const float g_x, const float g_y, const float b_x, const float b_y, const float w_x, const float w_y, const float m_x, const float m_y, const float me_x, const float me_y) +void Locallabcie::updateiPrimloc(const float r_x, const float r_y, const float g_x, const float g_y, const float b_x, const float b_y, const float w_x, const float w_y, const float m_x, const float m_y, const float me_x, const float me_y, const int pri_) { nextrx = r_x; nextry = r_y; @@ -10058,6 +10112,24 @@ void Locallabcie::gamutcieChanged() } +void Locallabcie::bwcieChanged() +{ + + if (isLocActivated && exp->getEnabled()) { + if (listener) { + if (bwcie->get_active()) { + listener->panelChanged(Evlocallabbwcie, + M("GENERAL_ENABLED") + " (" + escapeHtmlChars(getSpotName()) + ")"); + } else { + listener->panelChanged(Evlocallabbwcie, + M("GENERAL_DISABLED") + " (" + escapeHtmlChars(getSpotName()) + ")"); + } + } + } + +} + + void Locallabcie::expprecamChanged() { if (isLocActivated && exp->getEnabled()) { @@ -10164,6 +10236,36 @@ void Locallabcie::smoothcieChanged() } } +void Locallabcie::smoothcieybChanged() +{ + if (isLocActivated && exp->getEnabled()) { + if (listener) { + if (smoothcieyb->get_active()) { + listener->panelChanged(Evlocallabsmoothcieyb, + M("GENERAL_ENABLED") + " (" + escapeHtmlChars(getSpotName()) + ")"); + } else { + listener->panelChanged(Evlocallabsmoothcieyb, + M("GENERAL_DISABLED") + " (" + escapeHtmlChars(getSpotName()) + ")"); + } + } + } +} + +void Locallabcie::smoothcielumChanged() +{ + if (isLocActivated && exp->getEnabled()) { + if (listener) { + if (smoothcielum->get_active()) { + listener->panelChanged(Evlocallabsmoothcielum, + M("GENERAL_ENABLED") + " (" + escapeHtmlChars(getSpotName()) + ")"); + } else { + listener->panelChanged(Evlocallabsmoothcielum, + M("GENERAL_DISABLED") + " (" + escapeHtmlChars(getSpotName()) + ")"); + } + } + } +} + void Locallabcie::logjzChanged() { if (isLocActivated && exp->getEnabled()) { @@ -10541,10 +10643,28 @@ void Locallabcie::smoothciemetChanged() { if(smoothciemet->get_active_row_number() == 3) { slopesmo->show(); + slopesmor->hide(); + slopesmog->hide(); + slopesmob->hide(); smoothcie->show(); + smoothcieyb->hide(); + smoothcielum->hide(); + } else if(smoothciemet->get_active_row_number() == 4) { + slopesmo->hide(); + slopesmor->show(); + slopesmog->show(); + slopesmob->show(); + smoothcie->show(); + smoothcielum->show(); + smoothcieyb->show(); } else { slopesmo->hide(); + slopesmor->hide(); + slopesmog->hide(); + slopesmob->hide(); smoothcie->hide(); + smoothcielum->hide(); + smoothcieyb->hide(); } if (listener) { @@ -10731,7 +10851,12 @@ void Locallabcie::updateGUIToMode(const modeType new_type) comprcieauto->hide(); comprBox->show(); slopesmo->hide(); + slopesmor->hide(); + slopesmog->hide(); + slopesmob->hide(); smoothcie->hide(); + smoothcielum->hide(); + smoothcieyb->hide(); if (modecam->get_active_row_number() == 0) { bevwevFrame->show(); @@ -10743,10 +10868,28 @@ void Locallabcie::updateGUIToMode(const modeType new_type) expgradcie->hide(); if(smoothciemet->get_active_row_number() == 3) { slopesmo->show(); + slopesmor->hide(); + slopesmog->hide(); + slopesmob->hide(); smoothcie->show(); + smoothcielum->hide(); + smoothcieyb->hide(); + } else if(smoothciemet->get_active_row_number() == 4) { + slopesmo->hide(); + slopesmor->show(); + slopesmog->show(); + slopesmob->show(); + smoothcie->show(); + smoothcielum->show(); + smoothcieyb->show(); } else { slopesmo->hide(); + slopesmor->hide(); + slopesmog->hide(); + slopesmob->hide(); smoothcie->hide(); + smoothcielum->hide(); + smoothcieyb->hide(); } } @@ -10853,10 +10996,28 @@ void Locallabcie::updateGUIToMode(const modeType new_type) if(smoothciemet->get_active_row_number() == 3) { slopesmo->show(); + slopesmor->hide(); + slopesmog->hide(); + slopesmob->hide(); smoothcie->show(); + smoothcielum->hide(); + smoothcieyb->hide(); + } else if(smoothciemet->get_active_row_number() == 4) { + slopesmo->hide(); + slopesmor->show(); + slopesmog->show(); + slopesmob->show(); + smoothcie->show(); + smoothcielum->show(); + smoothcieyb->show(); } else { slopesmo->hide(); + slopesmor->hide(); + slopesmog->hide(); + slopesmob->hide(); smoothcie->hide(); + smoothcielum->hide(); + smoothcieyb->hide(); } } @@ -10967,10 +11128,28 @@ void Locallabcie::updateGUIToMode(const modeType new_type) if(smoothciemet->get_active_row_number() == 3) { slopesmo->show(); + slopesmor->hide(); + slopesmog->hide(); + slopesmob->hide(); smoothcie->show(); + smoothcielum->hide(); + smoothcieyb->hide(); + } else if(smoothciemet->get_active_row_number() == 4) { + slopesmo->hide(); + slopesmor->show(); + slopesmog->show(); + slopesmob->show(); + smoothcie->show(); + smoothcielum->show(); + smoothcieyb->show(); } else { slopesmo->hide(); + slopesmor->hide(); + slopesmog->hide(); + slopesmob->hide(); smoothcie->hide(); + smoothcielum->hide(); + smoothcieyb->hide(); } } @@ -11021,10 +11200,28 @@ void Locallabcie::updateGUIToMode(const modeType new_type) if(smoothciemet->get_active_row_number() == 3) { slopesmo->show(); + slopesmor->hide(); + slopesmog->hide(); + slopesmob->hide(); smoothcie->show(); + smoothcielum->hide(); + smoothcieyb->hide(); + } else if(smoothciemet->get_active_row_number() == 4) { + slopesmo->hide(); + slopesmor->show(); + slopesmog->show(); + slopesmob->show(); + smoothcie->show(); + smoothcielum->show(); + smoothcieyb->show(); } else { slopesmo->hide(); + slopesmor->hide(); + slopesmog->hide(); + slopesmob->hide(); smoothcie->hide(); + smoothcielum->hide(); + smoothcieyb->hide(); } } @@ -11125,10 +11322,28 @@ void Locallabcie::updatecieGUI() if(smoothciemet->get_active_row_number() == 3) { slopesmo->show(); + slopesmor->hide(); + slopesmog->hide(); + slopesmob->hide(); smoothcie->show(); + smoothcielum->hide(); + smoothcieyb->hide(); + } else if(smoothciemet->get_active_row_number() == 4) { + slopesmo->hide(); + slopesmor->show(); + slopesmog->show(); + slopesmob->show(); + smoothcie->show(); + smoothcielum->show(); + smoothcieyb->show(); } else { slopesmo->hide(); + slopesmor->hide(); + slopesmog->hide(); + slopesmob->hide(); smoothcie->hide(); + smoothcielum->hide(); + smoothcieyb->hide(); } } @@ -11241,6 +11456,7 @@ void Locallabcie::convertParamToSimple() whiteEvjz->setValue(defSpot.whiteEvjz); whitescie->setValue(defSpot.whitescie); blackscie->setValue(defSpot.blackscie); + bwcie->set_active(defSpot.bwcie); sigq->set_active(defSpot.sigq); //sigq->set_active(defSpot.sigq); @@ -11271,7 +11487,7 @@ void Locallabcie::convertParamToNormal() normcie->set_active(defSpot.normcie); logcieq->set_active(defSpot.logcieq); logcie->set_active(defSpot.logcie); - + bwcie->set_active(defSpot.bwcie); //contsigqcie->setValue(defSpot.contsigqcie); colorflcie->setValue(defSpot.colorflcie); lightqcie->setValue(defSpot.lightqcie); @@ -11399,7 +11615,9 @@ void Locallabcie::setDefaults(const rtengine::procparams::ProcParams* defParams, blackscie->setDefault(defSpot.blackscie); slopjcie->setDefault(defSpot.slopjcie); slopesmo->setDefault(defSpot.slopesmo); - midtcie->setDefault(defSpot.midtcie); + slopesmor->setDefault(defSpot.slopesmo); + slopesmog->setDefault(defSpot.slopesmog); + slopesmob->setDefault(defSpot.slopesmob); sigmoidldajzcie->setDefault(defSpot.sigmoidldajzcie); sigmoidthjzcie->setDefault(defSpot.sigmoidthjzcie); sigmoidbljzcie->setDefault(defSpot.sigmoidbljzcie); @@ -11943,6 +12161,28 @@ void Locallabcie::adjusterChanged(Adjuster* a, double newval) } } + if (a == slopesmor) { + if (listener) { + listener->panelChanged(Evlocallabslopesmor, + slopesmor->getTextValue() + spName); + } + } + + + if (a == slopesmog) { + if (listener) { + listener->panelChanged(Evlocallabslopesmog, + slopesmog->getTextValue() + spName); + } + } + + if (a == slopesmob) { + if (listener) { + listener->panelChanged(Evlocallabslopesmob, + slopesmob->getTextValue() + spName); + } + } + if (a == midtcie) { if (listener) { listener->panelChanged(Evlocallabmidtcie, diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 02d405f76..66ea3f9aa 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1736,11 +1736,14 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).comprcieauto = locallab.spots.at(j).comprcieauto && pSpot.comprcieauto == otherSpot.comprcieauto; locallab.spots.at(j).normcie = locallab.spots.at(j).normcie && pSpot.normcie == otherSpot.normcie; locallab.spots.at(j).gamutcie = locallab.spots.at(j).gamutcie && pSpot.gamutcie == otherSpot.gamutcie; + locallab.spots.at(j).bwcie = locallab.spots.at(j).bwcie && pSpot.bwcie == otherSpot.bwcie; locallab.spots.at(j).sigcie = locallab.spots.at(j).sigcie && pSpot.sigcie == otherSpot.sigcie; locallab.spots.at(j).logcie = locallab.spots.at(j).logcie && pSpot.logcie == otherSpot.logcie; locallab.spots.at(j).satcie = locallab.spots.at(j).satcie && pSpot.satcie == otherSpot.satcie; locallab.spots.at(j).logcieq = locallab.spots.at(j).logcieq && pSpot.logcieq == otherSpot.logcieq; locallab.spots.at(j).smoothcie = locallab.spots.at(j).smoothcie && pSpot.smoothcie == otherSpot.smoothcie; + locallab.spots.at(j).smoothcieyb = locallab.spots.at(j).smoothcieyb && pSpot.smoothcieyb == otherSpot.smoothcieyb; + locallab.spots.at(j).smoothcielum = locallab.spots.at(j).smoothcielum && pSpot.smoothcielum == otherSpot.smoothcielum; locallab.spots.at(j).logjz = locallab.spots.at(j).logjz && pSpot.logjz == otherSpot.logjz; locallab.spots.at(j).sigjz = locallab.spots.at(j).sigjz && pSpot.sigjz == otherSpot.sigjz; locallab.spots.at(j).sigq = locallab.spots.at(j).sigq && pSpot.sigq == otherSpot.sigq; @@ -1801,6 +1804,9 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).gamjcie = locallab.spots.at(j).gamjcie && pSpot.gamjcie == otherSpot.gamjcie; locallab.spots.at(j).slopjcie = locallab.spots.at(j).slopjcie && pSpot.slopjcie == otherSpot.slopjcie; locallab.spots.at(j).slopesmo = locallab.spots.at(j).slopesmo && pSpot.slopesmo == otherSpot.slopesmo; + locallab.spots.at(j).slopesmor = locallab.spots.at(j).slopesmor && pSpot.slopesmor == otherSpot.slopesmor; + locallab.spots.at(j).slopesmog = locallab.spots.at(j).slopesmog && pSpot.slopesmog == otherSpot.slopesmog; + locallab.spots.at(j).slopesmob = locallab.spots.at(j).slopesmob && pSpot.slopesmob == otherSpot.slopesmob; locallab.spots.at(j).midtcie = locallab.spots.at(j).midtcie && pSpot.midtcie == otherSpot.midtcie; locallab.spots.at(j).grexl = locallab.spots.at(j).grexl && pSpot.grexl == otherSpot.grexl; locallab.spots.at(j).greyl = locallab.spots.at(j).greyl && pSpot.greyl == otherSpot.greyl; @@ -5953,11 +5959,14 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).normcie = mods.locallab.spots.at(i).normcie; } - if (locallab.spots.at(i).gamutcie) { toEdit.locallab.spots.at(i).gamutcie = mods.locallab.spots.at(i).gamutcie; } + if (locallab.spots.at(i).bwcie) { + toEdit.locallab.spots.at(i).bwcie = mods.locallab.spots.at(i).bwcie; + } + if (locallab.spots.at(i).sigcie) { toEdit.locallab.spots.at(i).sigcie = mods.locallab.spots.at(i).sigcie; } @@ -5978,6 +5987,14 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).smoothcie = mods.locallab.spots.at(i).smoothcie; } + if (locallab.spots.at(i).smoothcieyb) { + toEdit.locallab.spots.at(i).smoothcieyb = mods.locallab.spots.at(i).smoothcieyb; + } + + if (locallab.spots.at(i).smoothcielum) { + toEdit.locallab.spots.at(i).smoothcielum = mods.locallab.spots.at(i).smoothcielum; + } + if (locallab.spots.at(i).logjz) { toEdit.locallab.spots.at(i).logjz = mods.locallab.spots.at(i).logjz; } @@ -6214,6 +6231,18 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).slopesmo = mods.locallab.spots.at(i).slopesmo; } + if (locallab.spots.at(i).slopesmor) { + toEdit.locallab.spots.at(i).slopesmor = mods.locallab.spots.at(i).slopesmor; + } + + if (locallab.spots.at(i).slopesmog) { + toEdit.locallab.spots.at(i).slopesmog = mods.locallab.spots.at(i).slopesmog; + } + + if (locallab.spots.at(i).slopesmob) { + toEdit.locallab.spots.at(i).slopesmob = mods.locallab.spots.at(i).slopesmob; + } + if (locallab.spots.at(i).midtcie) { toEdit.locallab.spots.at(i).midtcie = mods.locallab.spots.at(i).midtcie; } @@ -8449,11 +8478,14 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : comprcieauto(v), normcie(v), gamutcie(v), + bwcie(v), sigcie(v), logcie(v), satcie(v), logcieq(v), smoothcie(v), + smoothcieyb(v), + smoothcielum(v), logjz(v), sigjz(v), sigq(v), @@ -8514,6 +8546,9 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : gamjcie(v), slopjcie(v), slopesmo(v), + slopesmor(v), + slopesmog(v), + slopesmob(v), midtcie(v), redxl(v), redyl(v), @@ -9202,11 +9237,14 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) comprcieauto = v; normcie = v; gamutcie = v; + bwcie = v; sigcie = v; logcie = v; satcie = v; logcieq = v; smoothcie = v; + smoothcieyb = v; + smoothcielum = v; logjz = v; sigjz = v; sigq = v; @@ -9267,6 +9305,9 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) gamjcie = v; slopjcie = v; slopesmo = v; + slopesmor = v; + slopesmog = v; + slopesmob = v; midtcie = v; redxl = v; redyl = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index c8bd39f9b..57a3ea1cd 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -1016,11 +1016,14 @@ public: bool comprcieauto; bool normcie; bool gamutcie; + bool bwcie; bool sigcie; bool logcie; bool satcie; bool logcieq; bool smoothcie; + bool smoothcieyb; + bool smoothcielum; bool logjz; bool sigjz; bool sigq; @@ -1081,6 +1084,9 @@ public: bool gamjcie; bool slopjcie; bool slopesmo; + bool slopesmor; + bool slopesmog; + bool slopesmob; bool midtcie; bool redxl; bool redyl;