From fbc81028eba66af6f8dcacc29f1f5141228b3994 Mon Sep 17 00:00:00 2001 From: Hombre Date: Mon, 14 May 2018 00:57:55 +0200 Subject: [PATCH] First batch of variable name normalisation in ICM tool, see #4478 --- rtdata/languages/Francais | 8 +- rtdata/languages/default | 36 +- rtengine/FTblockDN.cc | 10 +- rtengine/clutstore.cc | 2 +- rtengine/dcrop.cc | 42 +- rtengine/histmatching.cc | 8 +- rtengine/iccstore.cc | 278 ++++++------ rtengine/imagefloat.cc | 2 +- rtengine/improccoordinator.cc | 22 +- rtengine/improcfun.cc | 36 +- rtengine/iplab2rgb.cc | 12 +- rtengine/ipvibrance.cc | 2 +- rtengine/ipwavelet.cc | 2 +- rtengine/previewimage.cc | 2 +- rtengine/procparams.cc | 163 ++++--- rtengine/procparams.h | 50 +-- rtengine/rawimagesource.cc | 26 +- rtengine/rtthumbnail.cc | 10 +- rtengine/simpleprocess.cc | 66 +-- rtengine/stdimagesource.cc | 10 +- rtengine/tmo_fattal02.cc | 2 +- rtgui/batchtoolpanelcoord.cc | 4 +- rtgui/cropwindow.cc | 10 +- rtgui/filecatalog.cc | 8 +- rtgui/icmpanel.cc | 779 +++++++++++++++++----------------- rtgui/icmpanel.h | 24 +- rtgui/options.cc | 24 +- rtgui/options.h | 8 +- rtgui/paramsedited.cc | 155 ++++--- rtgui/paramsedited.h | 41 +- rtgui/ppversion.h | 4 +- 31 files changed, 918 insertions(+), 928 deletions(-) diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index 1553c0347..d0aeec980 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -1588,10 +1588,10 @@ TP_FLATFIELD_BT_VERTICAL;Vertical TP_FLATFIELD_CLIPCONTROL;Control de l'écrêtage TP_FLATFIELD_CLIPCONTROL_TOOLTIP;"Contrôle de l'écrêtage" évite les hautes lumière brûlées dûs à l'application du champ uniforme. S'il y a déjà des hautes lumières brûlées avant l'application du champ uniforme, "Contrôle de l'écrêtage" peut conduire à une dérive couleur. TP_FLATFIELD_LABEL;Champ Uniforme -TP_GAMMA_CURV;Gamma -TP_GAMMA_FREE;Manuel -TP_GAMMA_OUTPUT;Gamma de sortie -TP_GAMMA_SLOP;Pente (linéaire) +TP_GAMMA_CURV;Gamma: +TP_GAMMA_CUSTOM;Manuel +TP_GAMMA_OUTPUT_TRC_PRESET;Courbe de réponse tonale (TRC): +TP_GAMMA_SLOP;Pente (linéaire): TP_GENERAL_11SCALE_TOOLTIP;Les effets de cet outil ne sont visible ou fiable qu'avec un aperçu à l'échelle 1:1. TP_GRADIENT_CENTER;Centre TP_GRADIENT_CENTER_X;Centre X diff --git a/rtdata/languages/default b/rtdata/languages/default index 84fabade1..13f4ad134 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1596,10 +1596,10 @@ TP_FLATFIELD_CLIPCONTROL;Clip control TP_FLATFIELD_CLIPCONTROL_TOOLTIP;Clip control avoids clipped highlights caused by applying the flat field. If there are already clipped highlights before applying the flat field, clip control can lead to color cast. TP_FLATFIELD_LABEL;Flat-Field TP_GAMMA_CURV;Gamma -TP_GAMMA_FREE;Custom Output Embedded Profile & generate ICC -TP_GAMMA_PRIM;Primaries Output profile -TP_GAMMA_OUTPUT;Tone responce curve -TP_GAMMA_PROF;Generate ICC profile +TP_GAMMA_CUSTOM;Custom output profile +TP_GAMMA_PRIM;Primaries: +TP_GAMMA_OUTPUT_TRC_PRESET;Tone response curve +TP_GAMMA_PROF;Generate ICC profile: TP_GAMMA_PROF_NONE;none TP_GAMMA_PROF_V2;ICC v2 TP_GAMMA_PROF_V4;ICC v4 @@ -1616,12 +1616,12 @@ TP_GAMMA_PRIM_BETA;BetaRGB TP_GAMMA_PRIM_BRUCE;BruceRGB TP_GAMMA_PRIM_FREE;Custom primaries - ICC v4 -TP_GAMMA_PRIM_REDX;Red x -TP_GAMMA_PRIM_REDY;Red y -TP_GAMMA_PRIM_GREX;Green x -TP_GAMMA_PRIM_GREY;Green y -TP_GAMMA_PRIM_BLUX;Blue x -TP_GAMMA_PRIM_BLUY;Blue y +TP_GAMMA_PRIM_REDX;Red X +TP_GAMMA_PRIM_REDY;Red Y +TP_GAMMA_PRIM_GREX;Green X +TP_GAMMA_PRIM_GREY;Green Y +TP_GAMMA_PRIM_BLUX;Blue X +TP_GAMMA_PRIM_BLUY;Blue Y TP_GAMMA_TEMP;Illuminant (ICC v4) TP_GAMMA_TEMP_DEF;Default TP_GAMMA_TEMP_41;D41 @@ -1630,14 +1630,14 @@ TP_GAMMA_TEMP_55;D55 TP_GAMMA_TEMP_60;D60 TP_GAMMA_TEMP_65;D65 TP_GAMMA_TEMP_80;D80 -TP_GAMMA_TEMP_INC;stdA 2856K -TP_GAMMA_TEMP_TOOLTIP;Only whith generate ICC v4, you can change the illuminant and Custom primaries -TP_GAMMA_TRCIN;Gamma - TRC -TP_GAMMA_TRCIN_NONE;None -TP_GAMMA_TRCIN_FREE;Custom -TP_GAMMA_TRCIN_TOOLTIP;Only for build in profiles -TP_GAMMAWORK_GAMMA;Gamma -TP_GAMMAWORK_SLOPE;Slope +TP_GAMMA_TEMP_INC;StdA 2856K +TP_GAMMA_TEMP_TOOLTIP;You can only change the Illuminant and Custom Primaries if you generate an ICC v4 profile +TP_GAMMA_WORKTRC;Tone response curve: +TP_GAMMA_WORKTRC_NONE;None +TP_GAMMA_WORKTRC_CUSTOM;Custom +TP_GAMMA_WORKTRC_TOOLTIP;Only for build in profiles +TP_GAMMA_WORKTRC_GAMMA;Gamma +TP_GAMMA_WORKTRC_SLOPE;Slope TP_GENERAL_11SCALE_TOOLTIP;The effects of this tool are only visible or only accurate at a preview scale of 1:1. TP_GRADIENT_CENTER;Center TP_GRADIENT_CENTER_X;Center X diff --git a/rtengine/FTblockDN.cc b/rtengine/FTblockDN.cc index cfb237d82..0e5cd58a2 100644 --- a/rtengine/FTblockDN.cc +++ b/rtengine/FTblockDN.cc @@ -547,7 +547,7 @@ BENCHFUN if (useNoiseLCurve || useNoiseCCurve) { int hei = calclum->getHeight(); int wid = calclum->getWidth(); - TMatrix wprofi = ICCStore::getInstance()->workingSpaceMatrix(params->icm.working); + TMatrix wprofi = ICCStore::getInstance()->workingSpaceMatrix(params->icm.workingProfile); const float wpi[3][3] = { {static_cast(wprofi[0][0]), static_cast(wprofi[0][1]), static_cast(wprofi[0][2])}, @@ -815,7 +815,7 @@ BENCHFUN } } - TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix(params->icm.working); + TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix(params->icm.workingProfile); //inverse matrix user select const float wip[3][3] = { {static_cast(wiprof[0][0]), static_cast(wiprof[0][1]), static_cast(wiprof[0][2])}, @@ -823,7 +823,7 @@ BENCHFUN {static_cast(wiprof[2][0]), static_cast(wiprof[2][1]), static_cast(wiprof[2][2])} }; - TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(params->icm.working); + TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(params->icm.workingProfile); const float wp[3][3] = { {static_cast(wprof[0][0]), static_cast(wprof[0][1]), static_cast(wprof[0][2])}, @@ -3166,7 +3166,7 @@ void ImProcFunctions::RGB_denoise_info(Imagefloat * src, Imagefloat * provicalc, float** bcalc; hei = provicalc->getHeight(); wid = provicalc->getWidth(); - TMatrix wprofi = ICCStore::getInstance()->workingSpaceMatrix(params->icm.working); + TMatrix wprofi = ICCStore::getInstance()->workingSpaceMatrix(params->icm.workingProfile); const float wpi[3][3] = { {static_cast(wprofi[0][0]), static_cast(wprofi[0][1]), static_cast(wprofi[0][2])}, @@ -3241,7 +3241,7 @@ void ImProcFunctions::RGB_denoise_info(Imagefloat * src, Imagefloat * provicalc, //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(params->icm.working); + TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(params->icm.workingProfile); const float wp[3][3] = { {static_cast(wprof[0][0]), static_cast(wprof[0][1]), static_cast(wprof[0][2])}, {static_cast(wprof[1][0]), static_cast(wprof[1][1]), static_cast(wprof[1][2])}, diff --git a/rtengine/clutstore.cc b/rtengine/clutstore.cc index 4124e38bb..87ce25d97 100644 --- a/rtengine/clutstore.cc +++ b/rtengine/clutstore.cc @@ -50,7 +50,7 @@ bool loadFile( const PreviewProps pp(0, 0, fw, fh, 1); rtengine::procparams::ColorManagementParams icm; - icm.working = working_color_space; + icm.workingProfile = working_color_space; img_src.getImage(curr_wb, TR_NONE, img_float.get(), pp, rtengine::procparams::ToneCurveParams(), rtengine::procparams::RAWParams()); diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 0e77791ee..708b92d61 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -292,19 +292,19 @@ void Crop::update(int todo) float adjustr = 1.f; - if (params.icm.working == "ProPhoto") { + if (params.icm.workingProfile == "ProPhoto") { adjustr = 1.f; - } else if (params.icm.working == "Adobe RGB") { + } else if (params.icm.workingProfile == "Adobe RGB") { adjustr = 1.f / 1.3f; - } else if (params.icm.working == "sRGB") { + } else if (params.icm.workingProfile == "sRGB") { adjustr = 1.f / 1.3f; - } else if (params.icm.working == "WideGamut") { + } else if (params.icm.workingProfile == "WideGamut") { adjustr = 1.f / 1.1f; - } else if (params.icm.working == "Beta RGB") { + } else if (params.icm.workingProfile == "Beta RGB") { adjustr = 1.f / 1.2f; - } else if (params.icm.working == "BestRGB") { + } else if (params.icm.workingProfile == "BestRGB") { adjustr = 1.f / 1.2f; - } else if (params.icm.working == "BruceRGB") { + } else if (params.icm.workingProfile == "BruceRGB") { adjustr = 1.f / 1.2f; } @@ -512,19 +512,19 @@ void Crop::update(int todo) float adjustr = 1.f; - if (params.icm.working == "ProPhoto") { + if (params.icm.workingProfile == "ProPhoto") { adjustr = 1.f; // - } else if (params.icm.working == "Adobe RGB") { + } else if (params.icm.workingProfile == "Adobe RGB") { adjustr = 1.f / 1.3f; - } else if (params.icm.working == "sRGB") { + } else if (params.icm.workingProfile == "sRGB") { adjustr = 1.f / 1.3f; - } else if (params.icm.working == "WideGamut") { + } else if (params.icm.workingProfile == "WideGamut") { adjustr = 1.f / 1.1f; - } else if (params.icm.working == "Beta RGB") { + } else if (params.icm.workingProfile == "Beta RGB") { adjustr = 1.f / 1.2f; - } else if (params.icm.working == "BestRGB") { + } else if (params.icm.workingProfile == "BestRGB") { adjustr = 1.f / 1.2f; - } else if (params.icm.working == "BruceRGB") { + } else if (params.icm.workingProfile == "BruceRGB") { adjustr = 1.f / 1.2f; } @@ -801,16 +801,16 @@ void Crop::update(int todo) const int W = baseCrop->getWidth(); const int H = baseCrop->getHeight(); LabImage labcbdl(W, H); - parent->ipf.rgb2lab(*baseCrop, labcbdl, params.icm.working); + parent->ipf.rgb2lab(*baseCrop, labcbdl, params.icm.workingProfile); parent->ipf.dirpyrequalizer(&labcbdl, skip); - parent->ipf.lab2rgb(labcbdl, *baseCrop, params.icm.working); + parent->ipf.lab2rgb(labcbdl, *baseCrop, params.icm.workingProfile); } if (todo & M_INIT) { - if (params.icm.wtrcin == "Custom") { //exec TRC IN free + if (params.icm.workingTRC == "Custom") { //exec TRC IN free Glib::ustring profile; - profile = params.icm.working; + profile = params.icm.workingProfile; if (profile == "sRGB" || profile == "Adobe RGB" || profile == "ProPhoto" || profile == "WideGamut" || profile == "BruceRGB" || profile == "Beta RGB" || profile == "BestRGB" || profile == "Rec2020" || profile == "ACESp0" || profile == "ACESp1") { @@ -823,7 +823,7 @@ void Crop::update(int todo) int mul = -5; double gga = 2.4, ssl = 12.92; - readyImg0 = parent->ipf.workingtrc(baseCrop, cw, ch, mul, params.icm.working, gga, ssl, ga0, ga1, ga2, ga3, ga4, ga5, ga6); + readyImg0 = parent->ipf.workingtrc(baseCrop, cw, ch, mul, params.icm.workingProfile, gga, ssl, ga0, ga1, ga2, ga3, ga4, ga5, ga6); #pragma omp parallel for @@ -838,9 +838,9 @@ void Crop::update(int todo) delete readyImg0; //adjust gamma TRC Imagefloat* readyImg = NULL; - gga = params.icm.gamm, ssl = params.icm.slop; + gga = params.icm.outputGamma, ssl = params.icm.outputSlope; mul = 5; - readyImg = parent->ipf.workingtrc(baseCrop, cw, ch, mul, params.icm.working, gga, ssl, ga0, ga1, ga2, ga3, ga4, ga5, ga6); + readyImg = parent->ipf.workingtrc(baseCrop, cw, ch, mul, params.icm.workingProfile, gga, ssl, ga0, ga1, ga2, ga3, ga4, ga5, ga6); #pragma omp parallel for for (int row = 0; row < ch; row++) { diff --git a/rtengine/histmatching.cc b/rtengine/histmatching.cc index 92f658baf..947b7f34e 100644 --- a/rtengine/histmatching.cc +++ b/rtengine/histmatching.cc @@ -180,7 +180,7 @@ void RawImageSource::getAutoMatchedToneCurve(const ColorManagementParams &cp, st const auto same_profile = [](const ColorManagementParams &a, const ColorManagementParams &b) -> bool { - return (a.input == b.input + return (a.inputProfile == b.inputProfile && a.toneCurve == b.toneCurve && a.applyLookTable == b.applyLookTable && a.applyBaselineExposureOffset == b.applyBaselineExposureOffset @@ -210,9 +210,9 @@ void RawImageSource::getAutoMatchedToneCurve(const ColorManagementParams &cp, st neutral.icm = cp; neutral.raw.bayersensor.method = RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::FAST); neutral.raw.xtranssensor.method = RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::FAST); - neutral.icm.output = "sRGB"; - neutral.icm.gamma = "Free"; - neutral.icm.freegamma = false; + neutral.icm.outputProfile = "sRGB"; + neutral.icm.outputGammaPreset = "Custom"; + neutral.icm.customOutputProfile = false; std::unique_ptr source; { diff --git a/rtengine/iccstore.cc b/rtengine/iccstore.cc index bb08c9404..fa36d8695 100644 --- a/rtengine/iccstore.cc +++ b/rtengine/iccstore.cc @@ -1044,45 +1044,45 @@ void rtengine::ICCStore::getGammaArray(const procparams::ColorManagementParams & { const double eps = 0.000000001; // not divide by zero - if (icm.freegamma && icm.gamma != "Custom") { //if Free gamma selected with other than Free + if (icm.customOutputProfile && icm.outputGammaPreset != "Custom") { //if Free gamma selected with other than Free // gamma : ga[0],ga[1],ga[2],ga[3],ga[4],ga[5] by calcul - if (icm.gamma == "BT709_g2.2_s4.5") { + if (icm.outputGammaPreset == "BT709_g2.2_s4.5") { ga[0] = 2.22; //BT709 2.2 4.5 - my preferred as D.Coffin ga[1] = 0.909995; ga[2] = 0.090005; ga[3] = 0.222222; ga[4] = 0.081071; - } else if (icm.gamma == "sRGB_g2.4_s12.92") { + } else if (icm.outputGammaPreset == "sRGB_g2.4_s12.92") { ga[0] = 2.40; //sRGB 2.4 12.92 - RT default as Lightroom ga[1] = 0.947858; ga[2] = 0.052142; ga[3] = 0.077399; ga[4] = 0.039293; - } else if (icm.gamma == "High_g1.3_s3.35") { + } else if (icm.outputGammaPreset == "High_g1.3_s3.35") { ga[0] = 1.3 ; //for high dynamic images ga[1] = 0.998279; ga[2] = 0.001721; ga[3] = 0.298507; ga[4] = 0.005746; - } else if (icm.gamma == "Low_g2.6_s6.9") { + } else if (icm.outputGammaPreset == "Low_g2.6_s6.9") { ga[0] = 2.6 ; //gamma 2.6 variable : for low contrast images ga[1] = 0.891161; ga[2] = 0.108839; ga[3] = 0.144928; ga[4] = 0.076332; - } else if (icm.gamma == "standard_g2.2") { + } else if (icm.outputGammaPreset == "standard_g2.2") { ga[0] = 2.2; //gamma=2.2(as gamma of Adobe, Widegamut...) ga[1] = 1.; ga[2] = 0.; ga[3] = 1. / eps; ga[4] = 0.; - } else if (icm.gamma == "standard_g1.8") { + } else if (icm.outputGammaPreset == "standard_g1.8") { ga[0] = 1.8; //gamma=1.8(as gamma of Prophoto) ga[1] = 1.; ga[2] = 0.; ga[3] = 1. / eps; ga[4] = 0.; - } else if (icm.gamma == "Lab_g3.0s9.03296") { + } else if (icm.outputGammaPreset == "Lab_g3.0s9.03296") { ga[0] = 3.0; //Lab gamma =3 slope=9.03296 ga[1] = 0.8621; ga[2] = 0.1379; @@ -1101,15 +1101,15 @@ void rtengine::ICCStore::getGammaArray(const procparams::ColorManagementParams & ga[6] = 0.0; } else { //free gamma selected GammaValues g_a; //gamma parameters - double pwr = 1.0 / icm.gampos; - double ts = icm.slpos; - double slope = icm.slpos == 0 ? eps : icm.slpos; + double pwr = 1.0 / icm.workingTRCGamma; + double ts = icm.workingTRCSlope; + double slope = icm.workingTRCSlope == 0 ? eps : icm.workingTRCSlope; int mode = 0; Color::calcGamma(pwr, ts, mode, g_a); // call to calcGamma with selected gamma and slope : return parameters for LCMS2 ga[4] = g_a[3] * ts; //printf("g_a.gamma0=%f g_a.gamma1=%f g_a.gamma2=%f g_a.gamma3=%f g_a.gamma4=%f\n", g_a.gamma0,g_a.gamma1,g_a.gamma2,g_a.gamma3,g_a.gamma4); - ga[0] = icm.gampos; + ga[0] = icm.workingTRCGamma; ga[1] = 1. / (1.0 + g_a[4]); ga[2] = g_a[4] / (1.0 + g_a[4]); ga[3] = 1. / slope; @@ -1325,14 +1325,14 @@ cmsHPROFILE rtengine::ICCStore::createGammaProfile(const procparams::ColorManage ColorTemp temp = ColorTemp::D50; //primaries for 10 working profiles ==> output profiles - if (icm.wprimaries == "Widegamut") { + if (icm.outputPimariesPreset == "Widegamut") { p[0] = 0.7350; //Widegamut primaries p[1] = 0.2650; p[2] = 0.1150; p[3] = 0.8260; p[4] = 0.1570; p[5] = 0.0180; - } else if (icm.wprimaries == "Adobe") { + } else if (icm.outputPimariesPreset == "Adobe") { p[0] = 0.6400; //Adobe primaries p[1] = 0.3300; p[2] = 0.2100; @@ -1340,7 +1340,7 @@ cmsHPROFILE rtengine::ICCStore::createGammaProfile(const procparams::ColorManage p[4] = 0.1500; p[5] = 0.0600; temp = ColorTemp::D65; - } else if (icm.wprimaries == "sRGB") { + } else if (icm.outputPimariesPreset == "sRGB") { p[0] = 0.6400; // sRGB primaries p[1] = 0.3300; p[2] = 0.3000; @@ -1348,7 +1348,7 @@ cmsHPROFILE rtengine::ICCStore::createGammaProfile(const procparams::ColorManage p[4] = 0.1500; p[5] = 0.0600; temp = ColorTemp::D65; - } else if (icm.wprimaries == "BruceRGB") { + } else if (icm.outputPimariesPreset == "BruceRGB") { p[0] = 0.6400; // Bruce primaries p[1] = 0.3300; p[2] = 0.2800; @@ -1356,21 +1356,21 @@ cmsHPROFILE rtengine::ICCStore::createGammaProfile(const procparams::ColorManage p[4] = 0.1500; p[5] = 0.0600; temp = ColorTemp::D65; - } else if (icm.wprimaries == "BetaRGB") { + } else if (icm.outputPimariesPreset == "BetaRGB") { p[0] = 0.6888; // Beta primaries p[1] = 0.3112; p[2] = 0.1986; p[3] = 0.7551; p[4] = 0.1265; p[5] = 0.0352; - } else if (icm.wprimaries == "BestRGB") { + } else if (icm.outputPimariesPreset == "BestRGB") { p[0] = 0.7347; // Best primaries p[1] = 0.2653; p[2] = 0.2150; p[3] = 0.7750; p[4] = 0.1300; p[5] = 0.0350; - } else if (icm.wprimaries == "Rec2020") { + } else if (icm.outputPimariesPreset == "Rec2020") { p[0] = 0.7080; // Rec2020 primaries p[1] = 0.2920; p[2] = 0.1700; @@ -1378,7 +1378,7 @@ cmsHPROFILE rtengine::ICCStore::createGammaProfile(const procparams::ColorManage p[4] = 0.1310; p[5] = 0.0460; temp = ColorTemp::D65; - } else if (icm.wprimaries == "Acesp0") { + } else if (icm.outputPimariesPreset == "Acesp0") { p[0] = 0.7347; // ACES P0 primaries p[1] = 0.2653; p[2] = 0.0000; @@ -1386,7 +1386,7 @@ cmsHPROFILE rtengine::ICCStore::createGammaProfile(const procparams::ColorManage p[4] = 0.0001; p[5] = -0.0770; temp = ColorTemp::D60; - } else if (icm.wprimaries == "Acesp1") { + } else if (icm.outputPimariesPreset == "Acesp1") { p[0] = 0.713; // ACES P1 primaries p[1] = 0.293; p[2] = 0.165; @@ -1394,20 +1394,20 @@ cmsHPROFILE rtengine::ICCStore::createGammaProfile(const procparams::ColorManage p[4] = 0.128; p[5] = 0.044; temp = ColorTemp::D60; - } else if (icm.wprimaries == "Prophoto") { + } else if (icm.outputPimariesPreset == "Prophoto") { p[0] = 0.7347; //ProPhoto and default primaries p[1] = 0.2653; p[2] = 0.1596; p[3] = 0.8404; p[4] = 0.0366; p[5] = 0.0001; - } else if (icm.wprimaries == "pfree") { - p[0] = icm.predx; - p[1] = icm.predy; - p[2] = icm.pgrex; - p[3] = icm.pgrey; - p[4] = icm.pblux; - p[5] = icm.pbluy; + } else if (icm.outputPimariesPreset == "pfree") { + p[0] = icm.redPrimaryX; + p[1] = icm.redPrimaryY; + p[2] = icm.greenPrimaryX; + p[3] = icm.greenPrimaryY; + p[4] = icm.bluePrimaryX; + p[5] = icm.bluePrimaryY; } else { p[0] = 0.7347; //default primaries p[1] = 0.2653; @@ -1442,32 +1442,32 @@ cmsHPROFILE rtengine::ICCStore::createGammaProfile(const procparams::ColorManage //lcmsMutex->lock(); Mutex acquired by the caller double tempv4 = 5000.; - if (icm.wprofile == "v4" && icm.wtemp != "DEF") { - if (icm.wtemp == "D41") { + if (icm.outputProfileVersion == "v4" && icm.outputIlluminant != "DEF") { + if (icm.outputIlluminant == "D41") { tempv4 = 4100.; - } else if (icm.wtemp == "D50") { + } else if (icm.outputIlluminant == "D50") { tempv4 = 5003.; - } else if (icm.wtemp == "D55") { + } else if (icm.outputIlluminant == "D55") { tempv4 = 5500.; - } else if (icm.wtemp == "D60") { + } else if (icm.outputIlluminant == "D60") { tempv4 = 6004.; - } else if (icm.wtemp == "D65") { + } else if (icm.outputIlluminant == "D65") { tempv4 = 6504.; - } else if (icm.wtemp == "D80") { + } else if (icm.outputIlluminant == "D80") { tempv4 = 8000.; - } else if (icm.wtemp == "stdA") { + } else if (icm.outputIlluminant == "stdA") { tempv4 = 5003.; } } - if (icm.wprofile == "v4" && icm.wtemp != "DEF") { + if (icm.outputProfileVersion == "v4" && icm.outputIlluminant != "DEF") { cmsWhitePointFromTemp(&xyD, tempv4); } else { cmsWhitePointFromTemp(&xyD, (double)temp); } - if (icm.wtemp == "stdA") xyD = {0.447573, 0.407440, 1.0}; + if (icm.outputIlluminant == "stdA") xyD = {0.447573, 0.407440, 1.0}; // cmsWhitePointFromTemp(&xyD, (double)temp); @@ -1492,51 +1492,51 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: Glib::ustring gammaStr; - if (icm.freegamma && icm.gampos < 1.35) { + if (icm.customOutputProfile && icm.workingTRCGamma < 1.35) { pro = true; //select profil with gammaTRC modified : - } else if (icm.gamma == "linear_g1.0" || (icm.gamma == "High_g1.3_s3.35")) { + } else if (icm.outputGammaPreset == "linear_g1.0" || (icm.outputGammaPreset == "High_g1.3_s3.35")) { pro = true; //pro=0 RT_sRGB || Prophoto } //necessary for V2 profile - if (icm.wprimaries == "Prophoto" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.prophoto) && !pro) { + if (icm.outputPimariesPreset == "Prophoto" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.prophoto) && !pro) { outProfile = options.rtSettings.prophoto; outPr = "Large_"; - } else if (icm.wprimaries == "Adobe" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.adobe)) { + } else if (icm.outputPimariesPreset == "Adobe" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.adobe)) { outProfile = options.rtSettings.adobe; outPr = "Medium_"; - } else if (icm.wprimaries == "Widegamut" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.widegamut)) { + } else if (icm.outputPimariesPreset == "Widegamut" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.widegamut)) { outProfile = options.rtSettings.widegamut; outPr = "Wide_"; - } else if (icm.wprimaries == "BetaRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.beta)) { + } else if (icm.outputPimariesPreset == "BetaRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.beta)) { outProfile = options.rtSettings.beta; outPr = "Beta_"; - } else if (icm.wprimaries == "BestRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.best)) { + } else if (icm.outputPimariesPreset == "BestRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.best)) { outProfile = options.rtSettings.best; outPr = "Best_"; - } else if (icm.wprimaries == "BruceRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.bruce)) { + } else if (icm.outputPimariesPreset == "BruceRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.bruce)) { outProfile = options.rtSettings.bruce; outPr = "Bruce_"; - } else if (icm.wprimaries == "sRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.srgb) && !pro) { + } else if (icm.outputPimariesPreset == "sRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.srgb) && !pro) { outProfile = options.rtSettings.srgb; outPr = "sRGB_"; - } else if (icm.wprimaries == "sRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.srgb10) && pro) { + } else if (icm.outputPimariesPreset == "sRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.srgb10) && pro) { outProfile = options.rtSettings.srgb10; outPr = "sRGB_"; - } else if (icm.wprimaries == "Prophoto" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.prophoto10) && pro) { + } else if (icm.outputPimariesPreset == "Prophoto" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.prophoto10) && pro) { outProfile = options.rtSettings.prophoto10; outPr = "Large_"; - } else if (icm.wprimaries == "Rec2020" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.rec2020)) { + } else if (icm.outputPimariesPreset == "Rec2020" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.rec2020)) { outProfile = options.rtSettings.rec2020; outPr = "Rec2020_"; - } else if (icm.wprimaries == "Acesp0" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.ACESp0)) { + } else if (icm.outputPimariesPreset == "Acesp0" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.ACESp0)) { outProfile = options.rtSettings.ACESp0; outPr = "Acesp0_"; - } else if (icm.wprimaries == "Acesp1" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.ACESp1)) { + } else if (icm.outputPimariesPreset == "Acesp1" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.ACESp1)) { outProfile = options.rtSettings.ACESp1; outPr = "Acesp1_"; - } else if (icm.wprimaries == "pfree") { + } else if (icm.outputPimariesPreset == "pfree") { outProfile = options.rtSettings.srgb; printf("PFRRE\n"); outPr = "pfree_"; @@ -1544,7 +1544,7 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: } else { // Should not occurs if (settings->verbose) { - printf("\"%s\": unknown working profile! - use LCMS2 substitution\n", icm.working.c_str()); + printf("\"%s\": unknown working profile! - use LCMS2 substitution\n", icm.workingProfile.c_str()); } return nullptr; @@ -1577,58 +1577,58 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: mlu = cmsMLUalloc(ContextID, 1); Glib::ustring outPro; Glib::ustring outTemp; - double gammsave = 2.4; - double slopesave = 12.92; - if (icm.gamma == "High_g1.3_s3.35") { + double gammsave = 2.4; + double slopesave = 12.92; + if (icm.outputGammaPreset == "High_g1.3_s3.35") { gammaStr = "_High_g=1.3_s=3.35"; - gammsave = 1.3; - slopesave = 3.35; - } else if (icm.gamma == "Low_g2.6_s6.9") { + gammsave = 1.3; + slopesave = 3.35; + } else if (icm.outputGammaPreset == "Low_g2.6_s6.9") { gammaStr = "_Low_g=2.6_s=6.9"; - gammsave = 2.6; - slopesave = 6.9; - } else if (icm.gamma == "sRGB_g2.4_s12.92") { + gammsave = 2.6; + slopesave = 6.9; + } else if (icm.outputGammaPreset == "sRGB_g2.4_s12.92") { gammaStr = "_sRGB_g=2.4_s=12.92"; - gammsave = 2.4; - slopesave = 12.92; - } else if (icm.gamma == "BT709_g2.2_s4.5") { + gammsave = 2.4; + slopesave = 12.92; + } else if (icm.outputGammaPreset == "BT709_g2.2_s4.5") { gammaStr = "_BT709_g=2.2_s=4.5"; - gammsave = 2.22; - slopesave = 4.5; - } else if (icm.gamma == "linear_g1.0") { + gammsave = 2.22; + slopesave = 4.5; + } else if (icm.outputGammaPreset == "linear_g1.0") { gammaStr = "_Linear_g=1.0"; - gammsave = 1.; - slopesave = 0.; - } else if (icm.gamma == "standard_g2.2") { + gammsave = 1.; + slopesave = 0.; + } else if (icm.outputGammaPreset == "standard_g2.2") { gammaStr = "_g=2.2"; - gammsave = 2.2; - slopesave = 0.; - } else if (icm.gamma == "standard_g1.8") { + gammsave = 2.2; + slopesave = 0.; + } else if (icm.outputGammaPreset == "standard_g1.8") { gammaStr = "_g=1.8"; - gammsave = 1.8; - slopesave = 0.; - } else if (icm.gamma == "Lab_g3.0s9.03296") { + gammsave = 1.8; + slopesave = 0.; + } else if (icm.outputGammaPreset == "Lab_g3.0s9.03296") { gammaStr = "_LAB_g3.0_s9.03296"; - gammsave = 3.0; - slopesave = 9.03296; + gammsave = 3.0; + slopesave = 9.03296; } outTemp = outPr; - if (icm.wprofile == "v4" && icm.wtemp != "DEF") { - if (icm.wtemp == "D41") { + if (icm.outputProfileVersion == "v4" && icm.outputIlluminant != "DEF") { + if (icm.outputIlluminant == "D41") { outPr = outPr + "D41"; - } else if (icm.wtemp == "D50") { + } else if (icm.outputIlluminant == "D50") { outPr = outPr + "D50"; - } else if (icm.wtemp == "D55") { + } else if (icm.outputIlluminant == "D55") { outPr = outPr + "D55"; - } else if (icm.wtemp == "D60") { + } else if (icm.outputIlluminant == "D60") { outPr = outPr + "D60"; - } else if (icm.wtemp == "D65") { + } else if (icm.outputIlluminant == "D65") { outPr = outPr + "D65"; - } else if (icm.wtemp == "D80") { + } else if (icm.outputIlluminant == "D80") { outPr = outPr + "D80"; - } else if (icm.wtemp == "stdA") { + } else if (icm.outputIlluminant == "stdA") { outPr = outPr + "stdA"; } @@ -1637,42 +1637,39 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: } // create description with gamma + slope + primaries - std::wostringstream gammaWs; + std::wostringstream gammaWs; std::wstring gammaStrICC; gammaWs.precision(3); - - Glib::ustring gammaGS;//to save gamma and slope in a tag - if (icm.gamma == "Custom") { - if (icm.wprofile == "v4") { - outPro = "RTv4_" + outPr + std::to_string((float)icm.gampos) + " " + std::to_string((float)icm.slpos) + ".icc"; - } else if (icm.wprofile == "v2" || icm.wprofile == "none") { - outPro = "RTv2_" + outPr + std::to_string((float)icm.gampos) + " " + std::to_string((float)icm.slpos) + ".icc"; + Glib::ustring gammaGS;//to save gamma and slope in a tag + + if (icm.outputGammaPreset == "Custom") { + if (icm.outputProfileVersion == "v4") { + outPro = "RTv4_" + outPr + std::to_string((float)icm.workingTRCGamma) + " " + std::to_string((float)icm.workingTRCSlope) + ".icc"; + } else if (icm.outputProfileVersion == "v2" || icm.outputProfileVersion == "none") { + outPro = "RTv2_" + outPr + std::to_string((float)icm.workingTRCGamma) + " " + std::to_string((float)icm.workingTRCSlope) + ".icc"; } gammaWs.precision(2); - gammaWs << outTemp << " g=" << (float)icm.gampos << " s=" << (float)icm.slpos; - gammaGS ="g" +std::to_string((double)icm.gampos) + "s" + std::to_string((double)icm.slpos) + "!"; + gammaWs << outTemp << " g=" << (float)icm.workingTRCGamma << " s=" << (float)icm.workingTRCSlope; + gammaGS ="g" +std::to_string((double)icm.workingTRCGamma) + "s" + std::to_string((double)icm.workingTRCSlope) + "!"; } else { - if (icm.wprofile == "v4") { + if (icm.outputProfileVersion == "v4") { outPro = "RTv4_" + outPr + gammaStr + ".icc"; - } else if (icm.wprofile == "v2" || icm.wprofile == "none") { + } else if (icm.outputProfileVersion == "v2" || icm.outputProfileVersion == "none") { outPro = "RTv2_" + outPr + gammaStr + ".icc"; } gammaWs << outTemp << gammaStr; - gammaGS = "g" + std::to_string(gammsave) + "s" + std::to_string(slopesave) + "!"; - - - + gammaGS = "g" + std::to_string(gammsave) + "s" + std::to_string(slopesave) + "!"; } - - //write in tag 'dmdd' values of current gamma and slope to retrive after in Output profile + + //write in tag 'dmdd' values of current gamma and slope to retrive after in Output profile wchar_t *wGammaGS = (wchar_t*)g_utf8_to_utf16 (gammaGS.c_str(), -1, NULL, NULL, NULL); if (!wGammaGS) { printf("Error: lab2rgbOut / g_utf8_to_utf16 failed!\n"); @@ -1686,7 +1683,6 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: printf("Error: lab2rgbOut / cmsMLUsetWide failed for \"%s\" !\n", gammaGS.c_str()); } - cmsMLUsetWide(mlu, "en", "US", gammaWs.str().c_str()); cmsMLU *copyright = cmsMLUalloc(NULL, 1); @@ -1695,7 +1691,7 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: cmsMLUfree(copyright); cmsWriteTag(outputProfile, cmsSigProfileDescriptionTag, mlu);//desc changed - + cmsMLUfree(description); // instruction with //ICC are used to generate ICC profile @@ -1703,7 +1699,7 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: printf("Description error\n"); } else { - if (icm.wprofile == "v4") { + if (icm.outputProfileVersion == "v4") { cmsSetProfileVersion(outputProfile, 4.3); } else { cmsSetProfileVersion(outputProfile, 2.0); @@ -1720,7 +1716,7 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: }; ColorTemp temp = ColorTemp::D50; - if (icm.wprimaries == "Widegamut") { + if (icm.outputPimariesPreset == "Widegamut") { p[0] = 0.7350; //Widegamut primaries p[1] = 0.2650; p[2] = 0.1150; @@ -1728,7 +1724,7 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: p[4] = 0.1570; p[5] = 0.0180; - } else if (icm.wprimaries == "Adobe") { + } else if (icm.outputPimariesPreset == "Adobe") { p[0] = 0.6400; //Adobe primaries p[1] = 0.3300; p[2] = 0.2100; @@ -1736,7 +1732,7 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: p[4] = 0.1500; p[5] = 0.0600; temp = ColorTemp::D65; - } else if (icm.wprimaries == "sRGB") { + } else if (icm.outputPimariesPreset == "sRGB") { p[0] = 0.6400; // sRGB primaries p[1] = 0.3300; p[2] = 0.3000; @@ -1744,7 +1740,7 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: p[4] = 0.1500; p[5] = 0.0600; temp = ColorTemp::D65; - } else if (icm.wprimaries == "BruceRGB") { + } else if (icm.outputPimariesPreset == "BruceRGB") { p[0] = 0.6400; // Bruce primaries p[1] = 0.3300; p[2] = 0.2800; @@ -1752,21 +1748,21 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: p[4] = 0.1500; p[5] = 0.0600; temp = ColorTemp::D65; - } else if (icm.wprimaries == "BetaRGB") { + } else if (icm.outputPimariesPreset == "BetaRGB") { p[0] = 0.6888; // Beta primaries p[1] = 0.3112; p[2] = 0.1986; p[3] = 0.7551; p[4] = 0.1265; p[5] = 0.0352; - } else if (icm.wprimaries == "BestRGB") { + } else if (icm.outputPimariesPreset == "BestRGB") { p[0] = 0.7347; // Best primaries p[1] = 0.2653; p[2] = 0.2150; p[3] = 0.7750; p[4] = 0.1300; p[5] = 0.0350; - } else if (icm.wprimaries == "Rec2020") { + } else if (icm.outputPimariesPreset == "Rec2020") { p[0] = 0.7080; // Rec2020 primaries p[1] = 0.2920; p[2] = 0.1700; @@ -1774,7 +1770,7 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: p[4] = 0.1310; p[5] = 0.0460; temp = ColorTemp::D65; - } else if (icm.wprimaries == "Acesp0") { + } else if (icm.outputPimariesPreset == "Acesp0") { p[0] = 0.7347; // ACES P0 primaries p[1] = 0.2653; p[2] = 0.0000; @@ -1782,7 +1778,7 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: p[4] = 0.0001; p[5] = -0.0770; temp = ColorTemp::D60; - } else if (icm.wprimaries == "Acesp1") { + } else if (icm.outputPimariesPreset == "Acesp1") { p[0] = 0.713; // ACES P1 primaries p[1] = 0.293; p[2] = 0.165; @@ -1790,20 +1786,20 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: p[4] = 0.128; p[5] = 0.044; temp = ColorTemp::D60; - } else if (icm.wprimaries == "Prophoto") { + } else if (icm.outputPimariesPreset == "Prophoto") { p[0] = 0.7347; //ProPhoto and default primaries p[1] = 0.2653; p[2] = 0.1596; p[3] = 0.8404; p[4] = 0.0366; p[5] = 0.0001; - } else if (icm.wprimaries == "pfree") { - p[0] = icm.predx; - p[1] = icm.predy; - p[2] = icm.pgrex; - p[3] = icm.pgrey; - p[4] = icm.pblux; - p[5] = icm.pbluy; + } else if (icm.outputPimariesPreset == "pfree") { + p[0] = icm.redPrimaryX; + p[1] = icm.redPrimaryY; + p[2] = icm.greenPrimaryX; + p[3] = icm.greenPrimaryY; + p[4] = icm.bluePrimaryX; + p[5] = icm.bluePrimaryY; } else { p[0] = 0.7347; //default primaries @@ -1822,20 +1818,20 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: }; double tempv4 = 5000.; - if (icm.wprofile == "v4" && icm.wtemp != "DEF") { - if (icm.wtemp == "D41") { + if (icm.outputProfileVersion == "v4" && icm.outputIlluminant != "DEF") { + if (icm.outputIlluminant == "D41") { tempv4 = 4100.; - } else if (icm.wtemp == "D50") { + } else if (icm.outputIlluminant == "D50") { tempv4 = 5003.; - } else if (icm.wtemp == "D55") { + } else if (icm.outputIlluminant == "D55") { tempv4 = 5500.; - } else if (icm.wtemp == "D60") { + } else if (icm.outputIlluminant == "D60") { tempv4 = 6004.; - } else if (icm.wtemp == "D65") { + } else if (icm.outputIlluminant == "D65") { tempv4 = 6504.; - } else if (icm.wtemp == "D80") { + } else if (icm.outputIlluminant == "D80") { tempv4 = 8000.; - } else if (icm.wtemp == "stdA") { + } else if (icm.outputIlluminant == "stdA") { tempv4 = 5003.; } @@ -1843,13 +1839,13 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: } - if (icm.wprofile == "v4" && icm.wtemp != "DEF") { + if (icm.outputProfileVersion == "v4" && icm.outputIlluminant != "DEF") { cmsWhitePointFromTemp(&xyD, tempv4); } else { cmsWhitePointFromTemp(&xyD, (double)temp); } - if (icm.wtemp == "stdA") xyD = {0.447573, 0.407440, 1.0}; + if (icm.outputIlluminant == "stdA") xyD = {0.447573, 0.407440, 1.0}; cmsToneCurve* GammaTRC[3]; @@ -1857,7 +1853,7 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: // Calculate output profile's rTRC gTRC bTRC GammaTRC[0] = GammaTRC[1] = GammaTRC[2] = cmsBuildParametricToneCurve(nullptr, 5, Parameters); - if (icm.wprofile == "v4") { + if (icm.outputProfileVersion == "v4") { outputProfile = cmsCreateRGBProfile(&xyD, &Primaries, GammaTRC); } @@ -1875,11 +1871,11 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: cmsMLUfree(mlu); - Glib::ustring realoutPro; - realoutPro = options.cacheBaseDir + "/" + outPro;//ICC profile in cache + Glib::ustring realoutPro; + realoutPro = options.cacheBaseDir + "/" + outPro;//ICC profile in cache - if (icm.wprofile == "v2" || icm.wprofile == "v4") { + if (icm.outputProfileVersion == "v2" || icm.outputProfileVersion == "v4") { cmsSaveProfileToFile(outputProfile, realoutPro.c_str()); } diff --git a/rtengine/imagefloat.cc b/rtengine/imagefloat.cc index 39ad0fe8b..f5190181a 100644 --- a/rtengine/imagefloat.cc +++ b/rtengine/imagefloat.cc @@ -462,7 +462,7 @@ void Imagefloat::calcCroppedHistogram(const ProcParams ¶ms, float scale, LUT hist.clear(); // Set up factors to calc the lightness - TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params.icm.working); + TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params.icm.workingProfile); float facRed = wprof[1][0]; float facGreen = wprof[1][1]; diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index ee9f21513..aa2a57108 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -440,9 +440,9 @@ void ImProcCoordinator::updatePreviewImage(int todo, Crop* cropCall) const int W = oprevi->getWidth(); const int H = oprevi->getHeight(); LabImage labcbdl(W, H); - ipf.rgb2lab(*oprevi, labcbdl, params.icm.working); + ipf.rgb2lab(*oprevi, labcbdl, params.icm.workingProfile); ipf.dirpyrequalizer(&labcbdl, scale); - ipf.lab2rgb(labcbdl, *oprevi, params.icm.working); + ipf.lab2rgb(labcbdl, *oprevi, params.icm.workingProfile); } readyphase++; @@ -486,9 +486,9 @@ void ImProcCoordinator::updatePreviewImage(int todo, Crop* cropCall) progress("Exposure curve & CIELAB conversion...", 100 * readyphase / numofphases); if (todo & M_INIT) { - if (params.icm.wtrcin == "Custom") { //exec TRC IN free + if (params.icm.workingTRC == "Custom") { //exec TRC IN free Glib::ustring profile; - profile = params.icm.working; + profile = params.icm.workingProfile; if (profile == "sRGB" || profile == "Adobe RGB" || profile == "ProPhoto" || profile == "WideGamut" || profile == "BruceRGB" || profile == "Beta RGB" || profile == "BestRGB" || profile == "Rec2020" || profile == "ACESp0" || profile == "ACESp1") { int cw = oprevi->getWidth(); @@ -499,7 +499,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, Crop* cropCall) int mul = -5; double gga = 2.4, ssl = 12.92; - readyImg0 = ipf.workingtrc(oprevi, cw, ch, mul, params.icm.working, gga, ssl, ga0, ga1, ga2, ga3, ga4, ga5, ga6); + readyImg0 = ipf.workingtrc(oprevi, cw, ch, mul, params.icm.workingProfile, gga, ssl, ga0, ga1, ga2, ga3, ga4, ga5, ga6); #pragma omp parallel for for (int row = 0; row < ch; row++) { @@ -513,9 +513,9 @@ void ImProcCoordinator::updatePreviewImage(int todo, Crop* cropCall) delete readyImg0; //adjust TRC Imagefloat* readyImg = NULL; - gga = params.icm.gamm, ssl = params.icm.slop; + gga = params.icm.outputGamma, ssl = params.icm.outputSlope; mul = 5; - readyImg = ipf.workingtrc(oprevi, cw, ch, mul, params.icm.working, gga, ssl, ga0, ga1, ga2, ga3, ga4, ga5, ga6); + readyImg = ipf.workingtrc(oprevi, cw, ch, mul, params.icm.workingProfile, gga, ssl, ga0, ga1, ga2, ga3, ga4, ga5, ga6); #pragma omp parallel for for (int row = 0; row < ch; row++) { @@ -551,7 +551,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, Crop* cropCall) opautili = false; if (params.colorToning.enabled) { - TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(params.icm.working); + TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(params.icm.workingProfile); double wp[3][3] = { {wprof[0][0], wprof[0][1], wprof[0][2]}, {wprof[1][0], wprof[1][1], wprof[1][2]}, @@ -887,8 +887,8 @@ void ImProcCoordinator::updatePreviewImage(int todo, Crop* cropCall) } // Update the monitor color transform if necessary - if ((todo & M_MONITOR) || (lastOutputProfile != params.icm.output) || lastOutputIntent != params.icm.outputIntent || lastOutputBPC != params.icm.outputBPC) { - lastOutputProfile = params.icm.output; + if ((todo & M_MONITOR) || (lastOutputProfile != params.icm.outputProfile) || lastOutputIntent != params.icm.outputIntent || lastOutputBPC != params.icm.outputBPC) { + lastOutputProfile = params.icm.outputProfile; lastOutputIntent = params.icm.outputIntent; lastOutputBPC = params.icm.outputBPC; ipf.updateColorProfiles(monitorProfile, monitorIntent, softProof, gamutCheck); @@ -1256,7 +1256,7 @@ void ImProcCoordinator::saveInputICCReference(const Glib::ustring& fname, bool a PreviewProps pp(0, 0, fW, fH, 1); ProcParams ppar = params; ppar.toneCurve.hrenabled = false; - ppar.icm.input = "(none)"; + ppar.icm.inputProfile = "(none)"; Imagefloat* im = new Imagefloat(fW, fH); imgsrc->preprocess(ppar.raw, ppar.lensProf, ppar.coarse); imgsrc->demosaic(ppar.raw); diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 5aea884fb..530e7401f 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -324,7 +324,7 @@ void ImProcFunctions::updateColorProfiles (const Glib::ustring& monitorProfile, } outIntent = settings->printerIntent; } else { - oprof = ICCStore::getInstance()->getProfile(params->icm.output); + oprof = ICCStore::getInstance()->getProfile(params->icm.outputProfile); if (params->icm.outputBPC) { flags |= cmsFLAGS_BLACKPOINTCOMPENSATION; } @@ -397,7 +397,7 @@ void ImProcFunctions::updateColorProfiles (const Glib::ustring& monitorProfile, void ImProcFunctions::firstAnalysis (const Imagefloat* const original, const ProcParams ¶ms, LUTu & histogram) { - TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params.icm.working); + TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params.icm.workingProfile); lumimul[0] = wprof[1][0]; lumimul[1] = wprof[1][1]; @@ -958,7 +958,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw //matrix for current working space - TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (params->icm.working); + TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (params->icm.workingProfile); const float wip[3][3] = { { (float)wiprof[0][0], (float)wiprof[0][1], (float)wiprof[0][2]}, { (float)wiprof[1][0], (float)wiprof[1][1], (float)wiprof[1][2]}, @@ -2040,8 +2040,8 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer } } - TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params->icm.working); - TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (params->icm.working); + TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params->icm.workingProfile); + TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (params->icm.workingProfile); float toxyz[3][3] = { { @@ -2150,7 +2150,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer hald_clut = CLUTStore::getInstance().getClut ( params->filmSimulation.clutFilename ); if ( hald_clut ) { - clutAndWorkingProfilesAreSame = hald_clut->getProfile() == params->icm.working; + clutAndWorkingProfilesAreSame = hald_clut->getProfile() == params->icm.workingProfile; if ( !clutAndWorkingProfilesAreSame ) { xyz2clut = ICCStore::getInstance()->workingSpaceInverseMatrix ( hald_clut->getProfile() ); @@ -2179,7 +2179,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer const float comp = (max (0.0, expcomp) + 1.0) * hlcompr / 100.0; const float shoulder = ((65536.0 / max (1.0f, exp_scale)) * (hlcomprthresh / 200.0)) + 0.1; const float hlrange = 65536.0 - shoulder; - const bool isProPhoto = (params->icm.working == "ProPhoto"); + const bool isProPhoto = (params->icm.workingProfile == "ProPhoto"); // extracting datas from 'params' to avoid cache flush (to be confirmed) ToneCurveParams::TcMode curveMode = params->toneCurve.curveMode; ToneCurveParams::TcMode curveMode2 = params->toneCurve.curveMode2; @@ -2196,12 +2196,12 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer if (hasToneCurve1 && curveMode == ToneCurveParams::TcMode::PERCEPTUAL) { const PerceptualToneCurve& userToneCurve = static_cast (customToneCurve1); - userToneCurve.initApplyState (ptc1ApplyState, params->icm.working); + userToneCurve.initApplyState (ptc1ApplyState, params->icm.workingProfile); } if (hasToneCurve2 && curveMode2 == ToneCurveParams::TcMode::PERCEPTUAL) { const PerceptualToneCurve& userToneCurve = static_cast (customToneCurve2); - userToneCurve.initApplyState (ptc2ApplyState, params->icm.working); + userToneCurve.initApplyState (ptc2ApplyState, params->icm.workingProfile); } bool hasColorToning = params->colorToning.enabled && bool (ctOpacityCurve) && bool (ctColorCurve) && params->colorToning.method != "LabGrid"; @@ -4239,19 +4239,19 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW // if(params->labCurve.avoidclip ){ // parameter to adapt curve C=f(C) to gamut - if (params->icm.working == "ProPhoto") { + if (params->icm.workingProfile == "ProPhoto") { adjustr = 1.2f; // 1.2 instead 1.0 because it's very rare to have C>170.. - } else if (params->icm.working == "Adobe RGB") { + } else if (params->icm.workingProfile == "Adobe RGB") { adjustr = 1.8f; - } else if (params->icm.working == "sRGB") { + } else if (params->icm.workingProfile == "sRGB") { adjustr = 2.0f; - } else if (params->icm.working == "WideGamut") { + } else if (params->icm.workingProfile == "WideGamut") { adjustr = 1.2f; - } else if (params->icm.working == "Beta RGB") { + } else if (params->icm.workingProfile == "Beta RGB") { adjustr = 1.4f; - } else if (params->icm.working == "BestRGB") { + } else if (params->icm.workingProfile == "BestRGB") { adjustr = 1.4f; - } else if (params->icm.working == "BruceRGB") { + } else if (params->icm.workingProfile == "BruceRGB") { adjustr = 1.8f; } @@ -4318,14 +4318,14 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW const bool gamutLch = settings->gamutLch; const float amountchroma = (float) settings->amchroma; - TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (params->icm.working); + TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (params->icm.workingProfile); const 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]} }; - TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params->icm.working); + TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params->icm.workingProfile); const double wp[3][3] = { {wprof[0][0], wprof[0][1], wprof[0][2]}, {wprof[1][0], wprof[1][1], wprof[1][2]}, diff --git a/rtengine/iplab2rgb.cc b/rtengine/iplab2rgb.cc index 1a76b4e90..28b743b7a 100644 --- a/rtengine/iplab2rgb.cc +++ b/rtengine/iplab2rgb.cc @@ -186,12 +186,12 @@ Image8* ImProcFunctions::lab2rgb(LabImage* lab, int cx, int cy, int cw, int ch, bool standard_gamma; if (settings->HistogramWorking && consider_histogram_settings) { - profile = icm.working; + profile = icm.workingProfile; standard_gamma = true; } else { - profile = icm.output; + profile = icm.outputProfile; - if (icm.output.empty() || icm.output == ColorManagementParams::NoICMString) { + if (icm.outputProfile.empty() || icm.outputProfile == ColorManagementParams::NoICMString) { profile = "sRGB"; } @@ -312,8 +312,8 @@ Imagefloat* ImProcFunctions::lab2rgbOut(LabImage* lab, int cx, int cy, int cw, i oprof = ICCStore::getInstance()->createGammaProfile(icm, *ga); lcmsMutex->unlock(); } else { - oprof = ICCStore::getInstance()->getProfile(icm.output); - Glib::ustring outtest = icm.output; + oprof = ICCStore::getInstance()->getProfile(icm.outputProfile); + Glib::ustring outtest = icm.outputProfile; std::string fileis_RTv2 = outtest.substr(0, 4); //printf("IsRTv2=%s\n", fileis_RTv2.c_str()); if(fileis_RTv2 == "RTv2") {//Only fot ICC v2 : read tag from desc to retrieve gamma and slope save before in generate ICC v2 @@ -436,7 +436,7 @@ Imagefloat* ImProcFunctions::workingtrc(Imagefloat* working, int cw, int ch, int { TMatrix wprof; - wprof = ICCStore::getInstance()->workingSpaceMatrix(params->icm.working); + wprof = ICCStore::getInstance()->workingSpaceMatrix(params->icm.workingProfile); double dx = Color::D50x; double dz = Color::D50z; diff --git a/rtengine/ipvibrance.cc b/rtengine/ipvibrance.cc index 26141423c..f7a938c33 100644 --- a/rtengine/ipvibrance.cc +++ b/rtengine/ipvibrance.cc @@ -162,7 +162,7 @@ void ImProcFunctions::vibrance (LabImage* lab) const bool protectskins = params->vibrance.protectskins; const bool avoidcolorshift = params->vibrance.avoidcolorshift; - TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (params->icm.working); + TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (params->icm.workingProfile); //inverse matrix user select const float wip[3][3] = { {static_cast(wiprof[0][0]), static_cast(wiprof[0][1]), static_cast(wiprof[0][2])}, diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index cd1bbc5f5..def469b70 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -148,7 +148,7 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const // init variables to display Munsell corrections MunsellDebugInfo* MunsDebugInfo = new MunsellDebugInfo(); #endif - TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (params->icm.working); + TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (params->icm.workingProfile); const double wip[3][3] = { {wiprof[0][0], wiprof[0][1], wiprof[0][2]}, {wiprof[1][0], wiprof[1][1], wiprof[1][2]}, diff --git a/rtengine/previewimage.cc b/rtengine/previewimage.cc index 0b3610de2..0ac99f9cd 100644 --- a/rtengine/previewimage.cc +++ b/rtengine/previewimage.cc @@ -107,7 +107,7 @@ PreviewImage::PreviewImage (const Glib::ustring &fname, const Glib::ustring &ext ColorTemp wb = rawImage.getWB (); rawImage.getFullSize (fw, fh, TR_NONE); PreviewProps pp (0, 0, fw, fh, 1); - params.icm.input = Glib::ustring("(embedded)"); + params.icm.inputProfile = Glib::ustring("(embedded)"); params.raw.bayersensor.method = RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::FAST); params.raw.deadPixelFilter = false; params.raw.ca_autocorrect = false; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index b45e1d674..a8ff0b5ba 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -33,7 +33,6 @@ #include "../rtgui/version.h" using namespace std; -extern Options options; namespace { @@ -1944,66 +1943,64 @@ bool ResizeParams::operator !=(const ResizeParams& other) const const Glib::ustring ColorManagementParams::NoICMString = Glib::ustring("No ICM: sRGB output"); ColorManagementParams::ColorManagementParams() : - input("(cameraICC)"), + inputProfile("(cameraICC)"), toneCurve(false), applyLookTable(false), applyBaselineExposureOffset(true), applyHueSatMap(true), dcpIlluminant(0), - working("ProPhoto"), - output("RT_sRGB"), + workingProfile("ProPhoto"), + workingTRC("none"), + workingTRCGamma(2.4), + workingTRCSlope(12.92310), + outputProfile("RT_sRGB"), outputIntent(RI_RELATIVE), outputBPC(true), - gamma("Custom"), - gampos(2.4), - slpos(12.92310), - predx(0.6400), - predy(0.3300), - pgrex(0.3000), - pgrey(0.6000), - pblux(0.1500), - pbluy(0.0600), - gamm(2.4), - slop(12.92), - - wprimaries("sRGB"), - wprofile("none"), - wtemp("DEF"), - freegamma(false), - wtrcin("none") - + customOutputProfile(false), + outputPimariesPreset("sRGB"), + redPrimaryX(0.6400), + redPrimaryY(0.3300), + greenPrimaryX(0.3000), + greenPrimaryY(0.6000), + bluePrimaryX(0.1500), + bluePrimaryY(0.0600), + outputGammaPreset("Custom"), + outputGamma(2.4), + outputSlope(12.92), + outputProfileVersion("none"), + outputIlluminant("DEF") { } bool ColorManagementParams::operator ==(const ColorManagementParams& other) const { return - input == other.input + inputProfile == other.inputProfile && toneCurve == other.toneCurve && applyLookTable == other.applyLookTable && applyBaselineExposureOffset == other.applyBaselineExposureOffset && applyHueSatMap == other.applyHueSatMap && dcpIlluminant == other.dcpIlluminant - && working == other.working - && output == other.output + && workingProfile == other.workingProfile + && workingTRC == other.workingTRC + && workingTRCGamma == other.workingTRCGamma + && workingTRCSlope == other.workingTRCSlope + && outputProfile == other.outputProfile && outputIntent == other.outputIntent && outputBPC == other.outputBPC - && gamma == other.gamma - && gampos == other.gampos - && slpos == other.slpos - && predx == other.predx - && predy == other.predy - && pgrex == other.pgrex - && pgrey == other.pgrey - && pblux == other.pblux - && pbluy == other.pbluy - && gamm == other.gamm - && slop == other.slop - && wprimaries == other.wprimaries - && wprofile == other.wprofile - && wtemp == other.wtemp - && wtrcin == other.wtrcin - && freegamma == other.freegamma; + && customOutputProfile == other.customOutputProfile + && outputPimariesPreset == other.outputPimariesPreset + && redPrimaryX == other.redPrimaryX + && redPrimaryY == other.redPrimaryY + && greenPrimaryX == other.greenPrimaryX + && greenPrimaryY == other.greenPrimaryY + && bluePrimaryX == other.bluePrimaryX + && bluePrimaryY == other.bluePrimaryY + && outputGammaPreset == other.outputGammaPreset + && outputGamma == other.outputGamma + && outputSlope == other.outputSlope + && outputProfileVersion == other.outputProfileVersion + && outputIlluminant == other.outputIlluminant; } bool ColorManagementParams::operator !=(const ColorManagementParams& other) const @@ -3141,14 +3138,17 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->prsharpening.deconviter, "PostResizeSharpening", "DeconvIterations", prsharpening.deconviter, keyFile); // Color management - saveToKeyfile(!pedited || pedited->icm.input, "Color Management", "InputProfile", relativePathIfInside(fname, fnameAbsolute, icm.input), keyFile); + saveToKeyfile(!pedited || pedited->icm.inputProfile, "Color Management", "InputProfile", relativePathIfInside(fname, fnameAbsolute, icm.inputProfile), keyFile); saveToKeyfile(!pedited || pedited->icm.toneCurve, "Color Management", "ToneCurve", icm.toneCurve, keyFile); saveToKeyfile(!pedited || pedited->icm.applyLookTable, "Color Management", "ApplyLookTable", icm.applyLookTable, keyFile); saveToKeyfile(!pedited || pedited->icm.applyBaselineExposureOffset, "Color Management", "ApplyBaselineExposureOffset", icm.applyBaselineExposureOffset, keyFile); saveToKeyfile(!pedited || pedited->icm.applyHueSatMap, "Color Management", "ApplyHueSatMap", icm.applyHueSatMap, keyFile); saveToKeyfile(!pedited || pedited->icm.dcpIlluminant, "Color Management", "DCPIlluminant", icm.dcpIlluminant, keyFile); - saveToKeyfile(!pedited || pedited->icm.working, "Color Management", "WorkingProfile", icm.working, keyFile); - saveToKeyfile(!pedited || pedited->icm.output, "Color Management", "OutputProfile", icm.output, keyFile); + saveToKeyfile(!pedited || pedited->icm.workingProfile, "Color Management", "WorkingProfile", icm.workingProfile, keyFile); + saveToKeyfile(!pedited || pedited->icm.workingTRC, "Color Management", "WorkingTRC", icm.workingTRC, keyFile); + saveToKeyfile(!pedited || pedited->icm.workingTRCGamma, "Color Management", "WorkingTRCGamma", icm.workingTRCGamma, keyFile); + saveToKeyfile(!pedited || pedited->icm.workingTRCSlope, "Color Management", "WorkingTRCSlope", icm.workingTRCSlope, keyFile); + saveToKeyfile(!pedited || pedited->icm.outputProfile, "Color Management", "OutputProfile", icm.outputProfile, keyFile); saveToKeyfile( !pedited || pedited->icm.outputIntent, "Color Management", @@ -3163,23 +3163,19 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo keyFile ); saveToKeyfile(!pedited || pedited->icm.outputBPC, "Color Management", "OutputBPC", icm.outputBPC, keyFile); - saveToKeyfile(!pedited || pedited->icm.gamma, "Color Management", "GammaCustom", icm.gamma, keyFile); - saveToKeyfile(!pedited || pedited->icm.freegamma, "Color Management", "Freegamma", icm.freegamma, keyFile); - saveToKeyfile(!pedited || pedited->icm.gampos, "Color Management", "GammaValue", icm.gampos, keyFile); - saveToKeyfile(!pedited || pedited->icm.slpos, "Color Management", "GammaSlope", icm.slpos, keyFile); - saveToKeyfile(!pedited || pedited->icm.predx, "Color Management", "GammaPredx", icm.predx, keyFile); - saveToKeyfile(!pedited || pedited->icm.predy, "Color Management", "GammaPredy", icm.predy, keyFile); - saveToKeyfile(!pedited || pedited->icm.pgrex, "Color Management", "GammaPgrex", icm.pgrex, keyFile); - saveToKeyfile(!pedited || pedited->icm.pgrey, "Color Management", "GammaPgrey", icm.pgrey, keyFile); - saveToKeyfile(!pedited || pedited->icm.pblux, "Color Management", "GammaPblux", icm.pblux, keyFile); - saveToKeyfile(!pedited || pedited->icm.pbluy, "Color Management", "GammaPbluy", icm.pbluy, keyFile); - saveToKeyfile(!pedited || pedited->icm.gamm, "Color Management", "GammaValueIn", icm.gamm, keyFile); - saveToKeyfile(!pedited || pedited->icm.slop, "Color Management", "GammaSlopeIn", icm.slop, keyFile); - - saveToKeyfile(!pedited || pedited->icm.wprimaries, "Color Management", "GammaPrimaries", icm.wprimaries, keyFile); - saveToKeyfile(!pedited || pedited->icm.wtemp, "Color Management", "GammaTemp", icm.wtemp, keyFile); - saveToKeyfile(!pedited || pedited->icm.wprofile, "Color Management", "GammaProfile", icm.wprofile, keyFile); - saveToKeyfile(!pedited || pedited->icm.wtrcin, "Color Management", "GammaTRCIN", icm.wtrcin, keyFile); + saveToKeyfile(!pedited || pedited->icm.customOutputProfile, "Color Management", "CustomOutputProfile", icm.customOutputProfile, keyFile); + saveToKeyfile(!pedited || pedited->icm.outputPrimariesPreset, "Color Management", "OutputPimariesPreset", icm.outputPimariesPreset, keyFile); + saveToKeyfile(!pedited || pedited->icm.redPrimaryX, "Color Management", "RedPrimaryX", icm.redPrimaryX, keyFile); + saveToKeyfile(!pedited || pedited->icm.redPrimaryY, "Color Management", "RedPrimaryY", icm.redPrimaryY, keyFile); + saveToKeyfile(!pedited || pedited->icm.greenPrimaryX, "Color Management", "GreenPrimaryX", icm.greenPrimaryX, keyFile); + saveToKeyfile(!pedited || pedited->icm.greenPrimaryY, "Color Management", "GreenPrimaryY", icm.greenPrimaryY, keyFile); + saveToKeyfile(!pedited || pedited->icm.bluePrimaryX, "Color Management", "BluePrimaryX", icm.bluePrimaryX, keyFile); + saveToKeyfile(!pedited || pedited->icm.bluePrimaryY, "Color Management", "BluePrimaryY", icm.bluePrimaryY, keyFile); + saveToKeyfile(!pedited || pedited->icm.outputGammaPreset, "Color Management", "OutputGammaPreset", icm.outputGammaPreset, keyFile); + saveToKeyfile(!pedited || pedited->icm.outputGamma, "Color Management", "OutputGamma", icm.outputGamma, keyFile); + saveToKeyfile(!pedited || pedited->icm.outputSlope, "Color Management", "OutputSlope", icm.outputSlope, keyFile); + saveToKeyfile(!pedited || pedited->icm.outputProfileVersion, "Color Management", "OutputProfileVersion", icm.outputProfileVersion, keyFile); + saveToKeyfile(!pedited || pedited->icm.outputIlluminant, "Color Management", "OutputIlluminant", icm.outputIlluminant, keyFile); // Wavelet saveToKeyfile(!pedited || pedited->wavelet.enabled, "Wavelet", "Enabled", wavelet.enabled, keyFile); @@ -4163,10 +4159,10 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) if (keyFile.has_group("Color Management")) { if (keyFile.has_key("Color Management", "InputProfile")) { - icm.input = expandRelativePath(fname, "file:", keyFile.get_string("Color Management", "InputProfile")); + icm.inputProfile = expandRelativePath(fname, "file:", keyFile.get_string("Color Management", "InputProfile")); if (pedited) { - pedited->icm.input = true; + pedited->icm.inputProfile = true; } } @@ -4175,9 +4171,12 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Color Management", "ApplyBaselineExposureOffset", pedited, icm.applyBaselineExposureOffset, pedited->icm.applyBaselineExposureOffset); assignFromKeyfile(keyFile, "Color Management", "ApplyHueSatMap", pedited, icm.applyHueSatMap, pedited->icm.applyHueSatMap); assignFromKeyfile(keyFile, "Color Management", "DCPIlluminant", pedited, icm.dcpIlluminant, pedited->icm.dcpIlluminant); - assignFromKeyfile(keyFile, "Color Management", "WorkingProfile", pedited, icm.working, pedited->icm.working); - assignFromKeyfile(keyFile, "Color Management", "OutputProfile", pedited, icm.output, pedited->icm.output); + assignFromKeyfile(keyFile, "Color Management", "WorkingProfile", pedited, icm.workingProfile, pedited->icm.workingProfile); + assignFromKeyfile(keyFile, "Color Management", "WorkingTRC", pedited, icm.workingTRC, pedited->icm.workingTRC); + assignFromKeyfile(keyFile, "Color Management", "WorkingTRCGamma", pedited, icm.workingTRCGamma, pedited->icm.workingTRCGamma); + assignFromKeyfile(keyFile, "Color Management", "WorkingTRCSlope", pedited, icm.workingTRCSlope, pedited->icm.workingTRCSlope); + assignFromKeyfile(keyFile, "Color Management", "OutputProfile", pedited, icm.outputProfile, pedited->icm.outputProfile); if (keyFile.has_key("Color Management", "OutputProfileIntent")) { Glib::ustring intent = keyFile.get_string("Color Management", "OutputProfileIntent"); @@ -4195,26 +4194,24 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) pedited->icm.outputIntent = true; } } - assignFromKeyfile(keyFile, "Color Management", "OutputBPC", pedited, icm.outputBPC, pedited->icm.outputBPC); - assignFromKeyfile(keyFile, "Color Management", "GammaCustom", pedited, icm.gamma, pedited->icm.gamma); - assignFromKeyfile(keyFile, "Color Management", "Freegamma", pedited, icm.freegamma, pedited->icm.freegamma); - assignFromKeyfile(keyFile, "Color Management", "GammaValue", pedited, icm.gampos, pedited->icm.gampos); - assignFromKeyfile(keyFile, "Color Management", "GammaSlope", pedited, icm.slpos, pedited->icm.slpos); - assignFromKeyfile(keyFile, "Color Management", "GammaPredx", pedited, icm.predx, pedited->icm.predx); - assignFromKeyfile(keyFile, "Color Management", "GammaPredy", pedited, icm.predy, pedited->icm.predy); - assignFromKeyfile(keyFile, "Color Management", "GammaPgrex", pedited, icm.pgrex, pedited->icm.pgrex); - assignFromKeyfile(keyFile, "Color Management", "GammaPgrey", pedited, icm.pgrey, pedited->icm.pgrey); - assignFromKeyfile(keyFile, "Color Management", "GammaPblux", pedited, icm.pblux, pedited->icm.pblux); - assignFromKeyfile(keyFile, "Color Management", "GammaPbluy", pedited, icm.pbluy, pedited->icm.pbluy); - assignFromKeyfile(keyFile, "Color Management", "GammaValueIn", pedited, icm.gamm, pedited->icm.gamm); - assignFromKeyfile(keyFile, "Color Management", "GammaSlopeIn", pedited, icm.slop, pedited->icm.slop); - - assignFromKeyfile(keyFile, "Color Management", "GammaPrimaries", pedited, icm.wprimaries, pedited->icm.wprimaries); - assignFromKeyfile(keyFile, "Color Management", "GammaProfile", pedited, icm.wprofile, pedited->icm.wprofile); - assignFromKeyfile(keyFile, "Color Management", "GammaTemp", pedited, icm.wtemp, pedited->icm.wtemp); - assignFromKeyfile(keyFile, "Color Management", "GammaTRCIN", pedited, icm.wtrcin, pedited->icm.wtrcin); + if (ppVersion < 334) { + } else { + } + assignFromKeyfile(keyFile, "Color Management", ppVersion < 334 ? "Freegamma" : "CustomOutputProfile", pedited, icm.customOutputProfile, pedited->icm.customOutputProfile); + assignFromKeyfile(keyFile, "Color Management", "OutputPimariesPreset", pedited, icm.outputPimariesPreset, pedited->icm.outputPrimariesPreset); + assignFromKeyfile(keyFile, "Color Management", "RedPrimaryX", pedited, icm.redPrimaryX, pedited->icm.redPrimaryX); + assignFromKeyfile(keyFile, "Color Management", "RedPrimaryY", pedited, icm.redPrimaryY, pedited->icm.redPrimaryY); + assignFromKeyfile(keyFile, "Color Management", "GreenPrimaryX", pedited, icm.greenPrimaryX, pedited->icm.greenPrimaryX); + assignFromKeyfile(keyFile, "Color Management", "GreenPrimaryY", pedited, icm.greenPrimaryY, pedited->icm.greenPrimaryY); + assignFromKeyfile(keyFile, "Color Management", "BluePrimaryX", pedited, icm.bluePrimaryX, pedited->icm.bluePrimaryX); + assignFromKeyfile(keyFile, "Color Management", "BluePrimaryY", pedited, icm.bluePrimaryY, pedited->icm.bluePrimaryY); + assignFromKeyfile(keyFile, "Color Management", ppVersion < 334 ? "Gammafree" : "OutputGammaPreset", pedited, icm.outputGammaPreset, pedited->icm.outputGammaPreset); + assignFromKeyfile(keyFile, "Color Management", ppVersion < 334 ? "GammaValue" : "OutputGamma", pedited, icm.outputGamma, pedited->icm.outputGamma); + assignFromKeyfile(keyFile, "Color Management", ppVersion < 334 ? "GammaSlope" : "OutputSlope", pedited, icm.outputSlope, pedited->icm.outputSlope); + assignFromKeyfile(keyFile, "Color Management", "OutputProfileVersion", pedited, icm.outputProfileVersion, pedited->icm.outputProfileVersion); + assignFromKeyfile(keyFile, "Color Management", "OutputIlluminant", pedited, icm.outputIlluminant, pedited->icm.outputIlluminant); } if (keyFile.has_group("Wavelet")) { diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 67e1d92ed..813c31edf 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1006,35 +1006,37 @@ struct ResizeParams { * Parameters of the color spaces used during the processing */ struct ColorManagementParams { - Glib::ustring input; - bool toneCurve; - bool applyLookTable; - bool applyBaselineExposureOffset; - bool applyHueSatMap; + Glib::ustring inputProfile; + bool toneCurve; + bool applyLookTable; + bool applyBaselineExposureOffset; + bool applyHueSatMap; int dcpIlluminant; - Glib::ustring working; - Glib::ustring output; + + Glib::ustring workingProfile; + Glib::ustring workingTRC; + double workingTRCGamma; + double workingTRCSlope; + + Glib::ustring outputProfile; RenderingIntent outputIntent; bool outputBPC; - Glib::ustring gamma; - double gampos; - double slpos; - double predx; - double predy; - double pgrex; - double pgrey; - double pblux; - double pbluy; - double gamm; - double slop; - - Glib::ustring wprimaries; - Glib::ustring wprofile; - Glib::ustring wtemp; + bool customOutputProfile; + Glib::ustring outputPimariesPreset; + double redPrimaryX; + double redPrimaryY; + double greenPrimaryX; + double greenPrimaryY; + double bluePrimaryX; + double bluePrimaryY; + Glib::ustring outputGammaPreset; + double outputGamma; + double outputSlope; + Glib::ustring outputProfileVersion; + Glib::ustring outputIlluminant; + static const Glib::ustring NoICMString; - bool freegamma; - Glib::ustring wtrcin; ColorManagementParams(); diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index a6811df08..5eb1de809 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -914,16 +914,16 @@ DCPProfile *RawImageSource::getDCP(const ColorManagementParams &cmp, DCPProfile: { DCPProfile *dcpProf = nullptr; cmsHPROFILE dummy; - findInputProfile(cmp.input, nullptr, (static_cast(getMetaData()))->getCamera(), &dcpProf, dummy); + findInputProfile(cmp.inputProfile, nullptr, (static_cast(getMetaData()))->getCamera(), &dcpProf, dummy); if (dcpProf == nullptr) { if (settings->verbose) { - printf("Can't load DCP profile '%s'!\n", cmp.input.c_str()); + printf("Can't load DCP profile '%s'!\n", cmp.inputProfile.c_str()); } return nullptr; } - dcpProf->setStep2ApplyState(cmp.working, cmp.toneCurve, cmp.applyLookTable, cmp.applyBaselineExposureOffset, as); + dcpProf->setStep2ApplyState(cmp.workingProfile, cmp.toneCurve, cmp.applyLookTable, cmp.applyBaselineExposureOffset, as); return dcpProf; } @@ -2320,7 +2320,7 @@ void RawImageSource::retinexPrepareBuffers(const ColorManagementParams& cmp, con } } else { - TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (cmp.working); + TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (cmp.workingProfile); const float wp[3][3] = { {static_cast(wprof[0][0]), static_cast(wprof[0][1]), static_cast(wprof[0][2])}, {static_cast(wprof[1][0]), static_cast(wprof[1][1]), static_cast(wprof[1][2])}, @@ -2597,7 +2597,7 @@ void RawImageSource::retinex(const ColorManagementParams& cmp, const RetinexPara } } else { - TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (cmp.working); + TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (cmp.workingProfile); double wip[3][3] = { {wiprof[0][0], wiprof[0][1], wiprof[0][2]}, @@ -3953,7 +3953,7 @@ void RawImageSource::colorSpaceConversion_ (Imagefloat* im, const ColorManagemen cmsHPROFILE in; DCPProfile *dcpProf; - if (!findInputProfile(cmp.input, embedded, camName, &dcpProf, in)) { + if (!findInputProfile(cmp.inputProfile, embedded, camName, &dcpProf, in)) { return; } @@ -3970,7 +3970,7 @@ void RawImageSource::colorSpaceConversion_ (Imagefloat* im, const ColorManagemen {camMatrix[2][0], camMatrix[2][1], camMatrix[2][2]} } }; - dcpProf->apply(im, cmp.dcpIlluminant, cmp.working, wb, pre_mul_row, cam_matrix, cmp.applyHueSatMap); + dcpProf->apply(im, cmp.dcpIlluminant, cmp.workingProfile, wb, pre_mul_row, cam_matrix, cmp.applyHueSatMap); return; } @@ -3979,7 +3979,7 @@ void RawImageSource::colorSpaceConversion_ (Imagefloat* im, const ColorManagemen // in this case we avoid using the slllllooooooowwww lcms // Calculate matrix for direct conversion raw>working space - TMatrix work = ICCStore::getInstance()->workingSpaceInverseMatrix (cmp.working); + TMatrix work = ICCStore::getInstance()->workingSpaceInverseMatrix (cmp.workingProfile); double mat[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; for (int i = 0; i < 3; i++) @@ -4005,7 +4005,7 @@ void RawImageSource::colorSpaceConversion_ (Imagefloat* im, const ColorManagemen } } else { - bool working_space_is_prophoto = (cmp.working == "ProPhoto"); + bool working_space_is_prophoto = (cmp.workingProfile == "ProPhoto"); // use supplied input profile @@ -4077,7 +4077,7 @@ void RawImageSource::colorSpaceConversion_ (Imagefloat* im, const ColorManagemen // check if the working space is fully contained in prophoto if (!working_space_is_prophoto && camera_icc_type == CAMERA_ICC_TYPE_GENERIC) { - TMatrix toxyz = ICCStore::getInstance()->workingSpaceMatrix(cmp.working); + TMatrix toxyz = ICCStore::getInstance()->workingSpaceMatrix(cmp.workingProfile); TMatrix torgb = ICCStore::getInstance()->workingSpaceInverseMatrix("ProPhoto"); float rgb[3] = {0.f, 0.f, 0.f}; for (int i = 0; i < 2 && !working_space_is_prophoto; ++i) { @@ -4090,9 +4090,9 @@ void RawImageSource::colorSpaceConversion_ (Imagefloat* im, const ColorManagemen for (int j = 0; j < 2; ++j) { if (rgb[j] < 0.f || rgb[j] > 1.f) { working_space_is_prophoto = true; - prophoto = ICCStore::getInstance()->workingSpace(cmp.working); + prophoto = ICCStore::getInstance()->workingSpace(cmp.workingProfile); if (settings->verbose) { - std::cout << "colorSpaceConversion_: converting directly to " << cmp.working << " instead of passing through ProPhoto" << std::endl; + std::cout << "colorSpaceConversion_: converting directly to " << cmp.workingProfile << " instead of passing through ProPhoto" << std::endl; } break; } @@ -4145,7 +4145,7 @@ void RawImageSource::colorSpaceConversion_ (Imagefloat* im, const ColorManagemen if (!working_space_is_prophoto) { toxyz = ICCStore::getInstance()->workingSpaceMatrix ("ProPhoto"); - torgb = ICCStore::getInstance()->workingSpaceInverseMatrix (cmp.working); //sRGB .. Adobe...Wide... + torgb = ICCStore::getInstance()->workingSpaceInverseMatrix (cmp.workingProfile); //sRGB .. Adobe...Wide... } #ifdef _OPENMP diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 3c2d3e6f5..93ad41c1b 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -285,8 +285,8 @@ Image8 *load_inspector_mode(const Glib::ustring &fname, RawMetaDataLocation &rml ProcParams neutral; neutral.raw.bayersensor.method = RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::FAST); neutral.raw.xtranssensor.method = RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::FAST); - neutral.icm.input = "(camera)"; - neutral.icm.working = "RT_sRGB"; + neutral.icm.inputProfile = "(camera)"; + neutral.icm.workingProfile = "RT_sRGB"; src.preprocess(neutral.raw, neutral.lensProf, neutral.coarse, false); src.demosaic(neutral.raw); @@ -1233,7 +1233,7 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, eSensorT bool opautili = false; if (params.colorToning.enabled) { - TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params.icm.working); + TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params.icm.workingProfile); double wp[3][3] = { {wprof[0][0], wprof[0][1], wprof[0][2]}, {wprof[1][0], wprof[1][1], wprof[1][2]}, @@ -1285,10 +1285,10 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, eSensorT if (isRaw) { cmsHPROFILE dummy; - RawImageSource::findInputProfile (params.icm.input, nullptr, camName, &dcpProf, dummy); + RawImageSource::findInputProfile (params.icm.inputProfile, nullptr, camName, &dcpProf, dummy); if (dcpProf) { - dcpProf->setStep2ApplyState (params.icm.working, params.icm.toneCurve, params.icm.applyLookTable, params.icm.applyBaselineExposureOffset, as); + dcpProf->setStep2ApplyState (params.icm.workingProfile, params.icm.toneCurve, params.icm.applyLookTable, params.icm.applyBaselineExposureOffset, as); } } diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 85ac8e728..1809822a6 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -367,21 +367,21 @@ private: float multip = 1.f; float adjustr = 1.f; - if (params.icm.working == "ProPhoto") { + if (params.icm.workingProfile == "ProPhoto") { adjustr = 1.f; // - } else if (params.icm.working == "Adobe RGB") { + } else if (params.icm.workingProfile == "Adobe RGB") { adjustr = 1.f / 1.3f; - } else if (params.icm.working == "sRGB") { + } else if (params.icm.workingProfile == "sRGB") { adjustr = 1.f / 1.3f; - } else if (params.icm.working == "WideGamut") { + } else if (params.icm.workingProfile == "WideGamut") { adjustr = 1.f / 1.1f; - } else if (params.icm.working == "Rec2020") { + } else if (params.icm.workingProfile == "Rec2020") { adjustr = 1.f / 1.1f; - } else if (params.icm.working == "Beta RGB") { + } else if (params.icm.workingProfile == "Beta RGB") { adjustr = 1.f / 1.2f; - } else if (params.icm.working == "BestRGB") { + } else if (params.icm.workingProfile == "BestRGB") { adjustr = 1.f / 1.2f; - } else if (params.icm.working == "BruceRGB") { + } else if (params.icm.workingProfile == "BruceRGB") { adjustr = 1.f / 1.2f; } @@ -610,21 +610,21 @@ private: float MinRMoy = 0.f; float MinBMoy = 0.f; - if (params.icm.working == "ProPhoto") { + if (params.icm.workingProfile == "ProPhoto") { adjustr = 1.f; - } else if (params.icm.working == "Adobe RGB") { + } else if (params.icm.workingProfile == "Adobe RGB") { adjustr = 1.f / 1.3f; - } else if (params.icm.working == "sRGB") { + } else if (params.icm.workingProfile == "sRGB") { adjustr = 1.f / 1.3f; - } else if (params.icm.working == "WideGamut") { + } else if (params.icm.workingProfile == "WideGamut") { adjustr = 1.f / 1.1f; - } else if (params.icm.working == "Rec2020") { + } else if (params.icm.workingProfile == "Rec2020") { adjustr = 1.f / 1.1f; - } else if (params.icm.working == "Beta RGB") { + } else if (params.icm.workingProfile == "Beta RGB") { adjustr = 1.f / 1.2f; - } else if (params.icm.working == "BestRGB") { + } else if (params.icm.workingProfile == "BestRGB") { adjustr = 1.f / 1.2f; - } else if (params.icm.working == "BruceRGB") { + } else if (params.icm.workingProfile == "BruceRGB") { adjustr = 1.f / 1.2f; } @@ -876,17 +876,17 @@ private: const int W = baseImg->getWidth(); const int H = baseImg->getHeight(); LabImage labcbdl (W, H); - ipf.rgb2lab (*baseImg, labcbdl, params.icm.working); + ipf.rgb2lab (*baseImg, labcbdl, params.icm.workingProfile); ipf.dirpyrequalizer (&labcbdl, 1); - ipf.lab2rgb (labcbdl, *baseImg, params.icm.working); + ipf.lab2rgb (labcbdl, *baseImg, params.icm.workingProfile); } //gamma TRC working { - if (params.icm.wtrcin == "Custom") { //exec TRC IN free + if (params.icm.workingTRC == "Custom") { //exec TRC IN free Glib::ustring profile; - profile = params.icm.working; + profile = params.icm.workingProfile; if (profile == "sRGB" || profile == "Adobe RGB" || profile == "ProPhoto" || profile == "WideGamut" || profile == "BruceRGB" || profile == "Beta RGB" || profile == "BestRGB" || profile == "Rec2020" || profile == "ACESp0" || profile == "ACESp1") { int cw = baseImg->getWidth(); @@ -897,7 +897,7 @@ private: int mul = -5; double gga = 2.4, ssl = 12.92; - readyImg0 = ipf.workingtrc(baseImg, cw, ch, mul, params.icm.working, gga, ssl, ga0, ga1, ga2, ga3, ga4, ga5, ga6); + readyImg0 = ipf.workingtrc(baseImg, cw, ch, mul, params.icm.workingProfile, gga, ssl, ga0, ga1, ga2, ga3, ga4, ga5, ga6); #pragma omp parallel for for (int row = 0; row < ch; row++) { @@ -911,9 +911,9 @@ private: delete readyImg0; //adjust TRC Imagefloat* readyImg = NULL; - gga = params.icm.gamm, ssl = params.icm.slop; + gga = params.icm.outputGamma, ssl = params.icm.outputSlope; mul = 5; - readyImg = ipf.workingtrc(baseImg, cw, ch, mul, params.icm.working, gga, ssl, ga0, ga1, ga2, ga3, ga4, ga5, ga6); + readyImg = ipf.workingtrc(baseImg, cw, ch, mul, params.icm.workingProfile, gga, ssl, ga0, ga1, ga2, ga3, ga4, ga5, ga6); #pragma omp parallel for for (int row = 0; row < ch; row++) { @@ -955,7 +955,7 @@ private: bool opautili = false; if (params.colorToning.enabled) { - TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params.icm.working); + TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params.icm.workingProfile); double wp[3][3] = { {wprof[0][0], wprof[0][1], wprof[0][2]}, {wprof[1][0], wprof[1][1], wprof[1][2]}, @@ -1282,7 +1282,7 @@ private: bool useLCMS = false; bool bwonly = params.blackwhite.enabled && !params.colorToning.enabled && !autili && !butili ; - if (params.icm.freegamma /*!= "Free" || params.icm.freegamma*/) { + if (params.icm.customOutputProfile /*!= "Custom" || params.icm.customOutputProfile*/) { GammaValues ga; // if(params.blackwhite.enabled) params.toneCurve.hrenabled=false; @@ -1304,7 +1304,7 @@ private: readyImg = ipf.lab2rgbOut (labView, cx, cy, cw, ch, params.icm); if (settings->verbose) { - printf ("Output profile_: \"%s\"\n", params.icm.output.c_str()); + printf ("Output profile_: \"%s\"\n", params.icm.outputProfile.c_str()); } } @@ -1363,21 +1363,21 @@ private: } else { // use the selected output profile if present, otherwise use LCMS2 profile generate by lab2rgb16 w/ gamma - if (params.icm.output != "" && params.icm.output != ColorManagementParams::NoICMString) { + if (params.icm.outputProfile != "" && params.icm.outputProfile != ColorManagementParams::NoICMString) { // if ICCStore::getInstance()->getProfile send back an object, then ICCStore::getInstance()->getContent will do too - cmsHPROFILE jprof = ICCStore::getInstance()->getProfile (params.icm.output); //get outProfile + cmsHPROFILE jprof = ICCStore::getInstance()->getProfile (params.icm.outputProfile); //get outProfile if (jprof == nullptr) { if (settings->verbose) { - printf ("\"%s\" ICC output profile not found!\n - use LCMS2 substitution\n", params.icm.output.c_str()); + printf ("\"%s\" ICC output profile not found!\n - use LCMS2 substitution\n", params.icm.outputProfile.c_str()); } } else { if (settings->verbose) { - printf ("Using \"%s\" output profile\n", params.icm.output.c_str()); + printf ("Using \"%s\" output profile\n", params.icm.outputProfile.c_str()); } - ProfileContent pc = ICCStore::getInstance()->getContent (params.icm.output); + ProfileContent pc = ICCStore::getInstance()->getContent (params.icm.outputProfile); readyImg->setOutputProfile (pc.getData().c_str(), pc.getData().size()); } } else { @@ -1424,7 +1424,7 @@ private: double scale_factor = ipf.resizeScale (¶ms, fw, fh, imw, imh); std::unique_ptr tmplab (new LabImage (fw, fh)); - ipf.rgb2lab (*baseImg, *tmplab, params.icm.working); + ipf.rgb2lab (*baseImg, *tmplab, params.icm.workingProfile); if (params.crop.enabled) { int cx = params.crop.x; @@ -1461,7 +1461,7 @@ private: delete baseImg; baseImg = new Imagefloat (fw, fh); - ipf.lab2rgb (*tmplab, *baseImg, params.icm.working); + ipf.lab2rgb (*tmplab, *baseImg, params.icm.workingProfile); } void adjust_procparams (double scale_factor) diff --git a/rtengine/stdimagesource.cc b/rtengine/stdimagesource.cc index 61bf90b31..5f0c14b7f 100644 --- a/rtengine/stdimagesource.cc +++ b/rtengine/stdimagesource.cc @@ -218,9 +218,9 @@ void StdImageSource::colorSpaceConversion (Imagefloat* im, const ColorManagement bool skipTransform = false; cmsHPROFILE in = nullptr; - cmsHPROFILE out = ICCStore::getInstance()->workingSpace (cmp.working); + cmsHPROFILE out = ICCStore::getInstance()->workingSpace (cmp.workingProfile); - if (cmp.input == "(embedded)" || cmp.input == "" || cmp.input == "(camera)" || cmp.input == "(cameraICC)") { + if (cmp.inputProfile == "(embedded)" || cmp.inputProfile == "" || cmp.inputProfile == "(camera)" || cmp.inputProfile == "(cameraICC)") { if (embedded) { in = embedded; } else { @@ -231,8 +231,8 @@ void StdImageSource::colorSpaceConversion (Imagefloat* im, const ColorManagement } } } else { - if (cmp.input != "(none)") { - in = ICCStore::getInstance()->getProfile (cmp.input); + if (cmp.inputProfile != "(none)") { + in = ICCStore::getInstance()->getProfile (cmp.inputProfile); if (in == nullptr && embedded) { in = embedded; @@ -268,7 +268,7 @@ void StdImageSource::colorSpaceConversion (Imagefloat* im, const ColorManagement cmsDeleteTransform(hTransform); } else { - printf("Could not convert from %s to %s\n", in == embedded ? "embedded profile" : cmp.input.data(), cmp.working.data()); + printf("Could not convert from %s to %s\n", in == embedded ? "embedded profile" : cmp.inputProfile.data(), cmp.workingProfile.data()); } } } diff --git a/rtengine/tmo_fattal02.cc b/rtengine/tmo_fattal02.cc index c6faef2e7..359b33575 100644 --- a/rtengine/tmo_fattal02.cc +++ b/rtengine/tmo_fattal02.cc @@ -1092,7 +1092,7 @@ void ImProcFunctions::ToneMapFattal02 (Imagefloat *rgb) constexpr float luminance_noise_floor = 65.535f; constexpr float min_luminance = 1.f; - TMatrix ws = ICCStore::getInstance()->workingSpaceMatrix (params->icm.working); + TMatrix ws = ICCStore::getInstance()->workingSpaceMatrix (params->icm.workingProfile); #ifdef _OPENMP #pragma omp parallel for if(multiThread) diff --git a/rtgui/batchtoolpanelcoord.cc b/rtgui/batchtoolpanelcoord.cc index d3c3fb4c6..0cec37a49 100644 --- a/rtgui/batchtoolpanelcoord.cc +++ b/rtgui/batchtoolpanelcoord.cc @@ -273,8 +273,8 @@ void BatchToolPanelCoordinator::initSession () if (options.baBehav[ADDSET_CAT_CONTRAST]) { pparams.colorappearance.contrast = 0; } if (options.baBehav[ADDSET_CAT_CONTRAST_Q]) { pparams.colorappearance.qcontrast = 0; } if (options.baBehav[ADDSET_CAT_HUE]) { pparams.colorappearance.colorh = 0; } - if (options.baBehav[ADDSET_FREE_OUPUT_GAMMA]) { pparams.icm.gampos = 0; } - if (options.baBehav[ADDSET_FREE_OUTPUT_SLOPE]) { pparams.icm.slpos = 0; } + if (options.baBehav[ADDSET_FREE_OUPUT_GAMMA]) { pparams.icm.workingTRCGamma = 0; } + if (options.baBehav[ADDSET_FREE_OUTPUT_SLOPE]) { pparams.icm.workingTRCSlope = 0; } //if (options.baBehav[ADDSET_CBOOST_AMOUNT]) pparams.colorBoost.amount = 0; //if (options.baBehav[ADDSET_CS_BLUEYELLOW]) pparams.colorShift.a = 0; //if (options.baBehav[ADDSET_CS_GREENMAGENTA]) pparams.colorShift.b = 0; diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index 08ea9d0f7..b01efffec 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -362,7 +362,7 @@ void CropWindow::buttonPress (int button, int type, int bstate, int x, int y) // Add a new Color Picker rtengine::Coord imgPos; screenCoordToImage(x, y, imgPos.x, imgPos.y); - LockableColorPicker *newPicker = new LockableColorPicker(this, &cropHandler.colorParams.output, &cropHandler.colorParams.working); + LockableColorPicker *newPicker = new LockableColorPicker(this, &cropHandler.colorParams.outputProfile, &cropHandler.colorParams.workingProfile); colorPickers.push_back(newPicker); hoveredPicker = newPicker; updateHoveredPicker(&imgPos); @@ -1016,10 +1016,10 @@ void CropWindow::pointerMoved (int bstate, int x, int y) printf("Using \"%s\" output\n", outputProfile.c_str()); if(outputProfile=="RT_sRGB") printf("OK SRGB2"); */ - pmlistener->pointerMoved (false, cropHandler.colorParams.output, cropHandler.colorParams.working, mx, my, -1, -1, -1); + pmlistener->pointerMoved (false, cropHandler.colorParams.outputProfile, cropHandler.colorParams.workingProfile, mx, my, -1, -1, -1); if (pmhlistener) { - pmhlistener->pointerMoved (false, cropHandler.colorParams.output, cropHandler.colorParams.working, mx, my, -1, -1, -1); + pmhlistener->pointerMoved (false, cropHandler.colorParams.outputProfile, cropHandler.colorParams.workingProfile, mx, my, -1, -1, -1); } } else { @@ -1063,12 +1063,12 @@ void CropWindow::pointerMoved (int bstate, int x, int y) } } // pmlistener->pointerMoved (true, cropHandler.colorParams.working, mx, my, pix[0], pix[1], pix[2]); - pmlistener->pointerMoved (true, cropHandler.colorParams.output, cropHandler.colorParams.working, mx, my, rval, gval, bval); + pmlistener->pointerMoved (true, cropHandler.colorParams.outputProfile, cropHandler.colorParams.workingProfile, mx, my, rval, gval, bval); if (pmhlistener) // pmhlistener->pointerMoved (true, cropHandler.colorParams.working, mx, my, pix[0], pix[1], pix[2]); { - pmhlistener->pointerMoved (true, cropHandler.colorParams.output, cropHandler.colorParams.working, mx, my, pix[0], pix[1], pix[2]); + pmhlistener->pointerMoved (true, cropHandler.colorParams.outputProfile, cropHandler.colorParams.workingProfile, mx, my, pix[0], pix[1], pix[2]); } } diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index 86c530661..53aa06003 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -1180,12 +1180,12 @@ void FileCatalog::developRequested (std::vector tbe, bool fas params.raw.bayersensor.method = options.fastexport_raw_bayer_method; params.raw.xtranssensor.method = options.fastexport_raw_xtrans_method; - params.icm.input = options.fastexport_icm_input; - params.icm.working = options.fastexport_icm_working; - params.icm.output = options.fastexport_icm_output; + params.icm.inputProfile = options.fastexport_icm_input_profile; + params.icm.workingProfile = options.fastexport_icm_working_profile; + params.icm.outputProfile = options.fastexport_icm_output_profile; params.icm.outputIntent = options.fastexport_icm_outputIntent; params.icm.outputBPC = options.fastexport_icm_outputBPC; - params.icm.gamma = options.fastexport_icm_gamma; + params.icm.outputGammaPreset = options.fastexport_icm_custom_output_profile; } if (params.resize.enabled) { diff --git a/rtgui/icmpanel.cc b/rtgui/icmpanel.cc index ee252bef1..c1f948c15 100644 --- a/rtgui/icmpanel.cc +++ b/rtgui/icmpanel.cc @@ -169,63 +169,60 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha Gtk::Frame *wFrame = Gtk::manage(new Gtk::Frame(M("TP_ICM_WORKINGPROFILE"))); wFrame->set_label_align(0.025, 0.5); - Gtk::VBox *wVBox = Gtk::manage(new Gtk::VBox()); - wVBox->set_spacing(2); + Gtk::VBox *wProfVBox = Gtk::manage(new Gtk::VBox()); + wProfVBox->set_spacing(2); - wnames = Gtk::manage(new MyComboBoxText()); - wVBox->pack_start(*wnames, Gtk::PACK_SHRINK); + wProfNames = Gtk::manage(new MyComboBoxText()); + wProfVBox->pack_start(*wProfNames, Gtk::PACK_SHRINK); std::vector wpnames = rtengine::ICCStore::getInstance()->getWorkingProfiles(); for (size_t i = 0; i < wpnames.size(); i++) { - wnames->append(wpnames[i]); + wProfNames->append(wpnames[i]); } - wnames->set_active(0); + wProfNames->set_active(0); // wFrame->add(*wVBox); //-----------------gamma TRC working - trcinHBox = Gtk::manage(new Gtk::HBox()); + wTRCHBox = Gtk::manage(new Gtk::HBox()); - Gtk::Label* trcinlab = Gtk::manage(new Gtk::Label(M("TP_GAMMA_TRCIN") + ":")); + Gtk::Label* wtrclab = Gtk::manage(new Gtk::Label(M("TP_GAMMA_WORKTRC"))); - trcinHBox->pack_start(*trcinlab, Gtk::PACK_SHRINK); - wtrcin = Gtk::manage(new MyComboBoxText()); - trcinHBox->pack_start(*wtrcin, Gtk::PACK_EXPAND_WIDGET); - wVBox->pack_start(*trcinHBox, Gtk::PACK_EXPAND_WIDGET); - wtrcin->append(M("TP_GAMMA_TRCIN_NONE")); - wtrcin->append(M("TP_GAMMA_TRCIN_FREE")); + wTRCHBox->pack_start(*wtrclab, Gtk::PACK_SHRINK); + wTRC = Gtk::manage(new MyComboBoxText()); + wTRCHBox->pack_start(*wTRC, Gtk::PACK_EXPAND_WIDGET); + wProfVBox->pack_start(*wTRCHBox, Gtk::PACK_EXPAND_WIDGET); + wTRC->append(M("TP_GAMMA_WORKTRC_NONE")); + wTRC->append(M("TP_GAMMA_WORKTRC_CUSTOM")); - wtrcin->set_active(0); - wtrcin->set_tooltip_text(M("TP_GAMMA_TRCIN_TOOLTIP")); + wTRC->set_active(0); + wTRC->set_tooltip_text(M("TP_GAMMA_WORKTRC_TOOLTIP")); - Gtk::VBox * gammaVBox = Gtk::manage(new Gtk::VBox()); - gammaVBox->set_spacing(2); + wGamma = Gtk::manage(new Adjuster(M("TP_GAMMA_WORKTRC_GAMMA"), 0.40, 15.0, 0.001, 2.4)); + wSlope = Gtk::manage(new Adjuster(M("TP_GAMMA_WORKTRC_SLOPE"), 0., 150., 0.01, 12.92)); + wProfVBox->pack_start(*wGamma, Gtk::PACK_SHRINK); + wGamma->show(); - gamm = Gtk::manage(new Adjuster(M("TP_GAMMAWORK_GAMMA"), 0.40, 15.0, 0.001, 2.4)); - slop = Gtk::manage(new Adjuster(M("TP_GAMMAWORK_SLOPE"), 0., 150., 0.01, 12.92)); - wVBox->pack_start(*gamm, Gtk::PACK_SHRINK); - gamm->show(); - - wVBox->pack_start(*slop, Gtk::PACK_SHRINK); - slop->show(); + wProfVBox->pack_start(*wSlope, Gtk::PACK_SHRINK); + wSlope->show(); - gamm->setAdjusterListener(this); - slop->setAdjusterListener(this); + wGamma->setAdjusterListener(this); + wSlope->setAdjusterListener(this); - if (gamm->delay < options.adjusterMaxDelay) { - gamm->delay = options.adjusterMaxDelay; + if (wGamma->delay < options.adjusterMaxDelay) { + wGamma->delay = options.adjusterMaxDelay; } - if (slop->delay < options.adjusterMaxDelay) { - slop->delay = options.adjusterMaxDelay; + if (wSlope->delay < options.adjusterMaxDelay) { + wSlope->delay = options.adjusterMaxDelay; } - wFrame->add(*wVBox); + wFrame->add(*wProfVBox); pack_start(*wFrame, Gtk::PACK_EXPAND_WIDGET); @@ -236,99 +233,99 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha Gtk::Frame *oFrame = Gtk::manage(new Gtk::Frame(M("TP_ICM_OUTPUTPROFILE"))); oFrame->set_label_align(0.025, 0.5); - Gtk::VBox *oVBox = Gtk::manage(new Gtk::VBox()); - oVBox->set_spacing(2); + Gtk::VBox *oProfVBox = Gtk::manage(new Gtk::VBox()); + oProfVBox->set_spacing(2); - onames = Gtk::manage(new MyComboBoxText()); - oVBox->pack_start(*onames, Gtk::PACK_SHRINK); + oProfNames = Gtk::manage(new MyComboBoxText()); + oProfVBox->pack_start(*oProfNames, Gtk::PACK_SHRINK); - onames->append(M("TP_ICM_NOICM")); - onames->set_active(0); + oProfNames->append(M("TP_ICM_NOICM")); + oProfNames->set_active(0); std::vector opnames = ICCStore::getInstance()->getProfiles(rtengine::ICCStore::ProfileType::OUTPUT); for (size_t i = 0; i < opnames.size(); i++) { - onames->append(opnames[i]); + oProfNames->append(opnames[i]); } - onames->set_active(0); + oProfNames->set_active(0); // Rendering intent Gtk::HBox *riHBox = Gtk::manage(new Gtk::HBox()); - Gtk::Label* outputIntentLbl = Gtk::manage(new Gtk::Label(M("TP_ICM_PROFILEINTENT") + ":")); + Gtk::Label* outputIntentLbl = Gtk::manage(new Gtk::Label(M("TP_ICM_PROFILEINTENT"))); riHBox->pack_start(*outputIntentLbl, Gtk::PACK_SHRINK); - ointent.reset(new PopUpButton()); - ointent->addEntry("intent-perceptual.png", M("PREFERENCES_INTENT_PERCEPTUAL")); - ointent->addEntry("intent-relative.png", M("PREFERENCES_INTENT_RELATIVE")); - ointent->addEntry("intent-saturation.png", M("PREFERENCES_INTENT_SATURATION")); - ointent->addEntry("intent-absolute.png", M("PREFERENCES_INTENT_ABSOLUTE")); - ointent->setSelected(1); - ointent->show(); - riHBox->pack_start(*ointent->buttonGroup, Gtk::PACK_EXPAND_PADDING); - oVBox->pack_start(*riHBox, Gtk::PACK_SHRINK); + oRendIntent.reset(new PopUpButton()); + oRendIntent->addEntry("intent-perceptual.png", M("PREFERENCES_INTENT_PERCEPTUAL")); + oRendIntent->addEntry("intent-relative.png", M("PREFERENCES_INTENT_RELATIVE")); + oRendIntent->addEntry("intent-saturation.png", M("PREFERENCES_INTENT_SATURATION")); + oRendIntent->addEntry("intent-absolute.png", M("PREFERENCES_INTENT_ABSOLUTE")); + oRendIntent->setSelected(1); + oRendIntent->show(); + riHBox->pack_start(*oRendIntent->buttonGroup, Gtk::PACK_EXPAND_PADDING); + oProfVBox->pack_start(*riHBox, Gtk::PACK_SHRINK); // Black Point Compensation obpc = Gtk::manage(new Gtk::CheckButton((M("TP_ICM_BPC")))); obpc->set_active(true); - oVBox->pack_start(*obpc, Gtk::PACK_SHRINK); + oProfVBox->pack_start(*obpc, Gtk::PACK_SHRINK); // Output gamma - gaHBox = Gtk::manage(new Gtk::HBox()); + oTRCHBox = Gtk::manage(new Gtk::HBox()); //Gtk::HBox* gaHBox = Gtk::manage(new Gtk::HBox()); - Gtk::Label* galab = Gtk::manage(new Gtk::Label(M("TP_GAMMA_OUTPUT") + ":")); + Gtk::Label* galab = Gtk::manage(new Gtk::Label(M("TP_GAMMA_OUTPUT_TRC_PRESET"))); - gaHBox->pack_start(*galab, Gtk::PACK_SHRINK); - wgamma = Gtk::manage(new MyComboBoxText()); - gaHBox->pack_start(*wgamma, Gtk::PACK_EXPAND_WIDGET); + oTRCHBox->pack_start(*galab, Gtk::PACK_SHRINK); + oTRCPresets = Gtk::manage(new MyComboBoxText()); + oTRCHBox->pack_start(*oTRCPresets, Gtk::PACK_EXPAND_WIDGET); - std::vector wpgamma = rtengine::ICCStore::getGamma(); + std::vector outputTRCPresets = rtengine::ICCStore::getGamma(); - for (size_t i = 0; i < wpgamma.size(); i++) { - wgamma->append(wpgamma[i]); + for (size_t i = 0; i < outputTRCPresets.size(); i++) { + oTRCPresets->append(outputTRCPresets[i]); } - wgamma->set_active(0); + oTRCPresets->set_active(0); - Gtk::Frame* fgFrame = Gtk::manage(new Gtk::Frame()); + Gtk::Frame* cgFrame = Gtk::manage(new Gtk::Frame()); - Gtk::VBox *fgVBox = Gtk::manage(new Gtk::VBox()); - fgVBox->set_spacing(2); + Gtk::VBox *cgVBox = Gtk::manage(new Gtk::VBox()); + cgVBox->set_spacing(2); - freegamma = Gtk::manage(new Gtk::CheckButton((M("TP_GAMMA_FREE")))); - freegamma->set_active(false); - fgFrame->set_label_widget(*freegamma); + customOutProfile = Gtk::manage(new Gtk::CheckButton((M("TP_GAMMA_CUSTOM")))); + customOutProfile->set_active(false); + cgFrame->set_label_widget(*customOutProfile); //primaries - priHBox = Gtk::manage(new Gtk::HBox()); + primariesHBox = Gtk::manage(new Gtk::HBox()); - Gtk::Label* prilab = Gtk::manage(new Gtk::Label(M("TP_GAMMA_PRIM") + ":")); + Gtk::Label* prilab = Gtk::manage(new Gtk::Label(M("TP_GAMMA_PRIM"))); - priHBox->pack_start(*prilab, Gtk::PACK_SHRINK); - wprimaries = Gtk::manage(new MyComboBoxText()); - priHBox->pack_start(*wprimaries, Gtk::PACK_EXPAND_WIDGET); - fgVBox->pack_start(*priHBox, Gtk::PACK_EXPAND_WIDGET); - wprimaries->append(M("TP_GAMMA_PRIM_ACESP0")); - wprimaries->append(M("TP_GAMMA_PRIM_ACESP1")); - wprimaries->append(M("TP_GAMMA_PRIM_ADOBE")); - wprimaries->append(M("TP_GAMMA_PRIM_PROPH")); - wprimaries->append(M("TP_GAMMA_PRIM_REC2020")); - wprimaries->append(M("TP_GAMMA_PRIM_SRGB")); - wprimaries->append(M("TP_GAMMA_PRIM_WIDEG")); - wprimaries->append(M("TP_GAMMA_PRIM_BEST")); - wprimaries->append(M("TP_GAMMA_PRIM_BETA")); - wprimaries->append(M("TP_GAMMA_PRIM_BRUCE")); - wprimaries->append(M("TP_GAMMA_PRIM_FREE")); - wprimaries->set_active(5); + primariesHBox->pack_start(*prilab, Gtk::PACK_SHRINK); + primaries = Gtk::manage(new MyComboBoxText()); + primariesHBox->pack_start(*primaries, Gtk::PACK_EXPAND_WIDGET); + cgVBox->pack_start(*primariesHBox, Gtk::PACK_EXPAND_WIDGET); + primaries->append(M("TP_GAMMA_PRIM_ACESP0")); + primaries->append(M("TP_GAMMA_PRIM_ACESP1")); + primaries->append(M("TP_GAMMA_PRIM_ADOBE")); + primaries->append(M("TP_GAMMA_PRIM_PROPH")); + primaries->append(M("TP_GAMMA_PRIM_REC2020")); + primaries->append(M("TP_GAMMA_PRIM_SRGB")); + primaries->append(M("TP_GAMMA_PRIM_WIDEG")); + primaries->append(M("TP_GAMMA_PRIM_BEST")); + primaries->append(M("TP_GAMMA_PRIM_BETA")); + primaries->append(M("TP_GAMMA_PRIM_BRUCE")); + primaries->append(M("TP_GAMMA_PRIM_FREE")); + primaries->set_active(5); prifreeVBox = Gtk::manage(new Gtk::VBox()); prigreenHBox = Gtk::manage(new Gtk::HBox()); priblueHBox = Gtk::manage(new Gtk::HBox()); priredHBox = Gtk::manage(new Gtk::HBox()); - + Gtk::Image* gamuts0 = Gtk::manage(new RTImage("rt-logo-tiny.png")); Gtk::Image* gamutl0 = Gtk::manage(new RTImage("rt-logo-small.png")); Gtk::Image* gamuts1 = Gtk::manage(new RTImage("rt-logo-tiny.png")); @@ -350,20 +347,18 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha pbluy = Gtk::manage(new Adjuster(M("TP_GAMMA_PRIM_BLUY"), -0.0700, 0.0700, 0.0001, 0.060, gamutl5, gamuts5)); priredHBox->pack_start(*predx,Gtk::PACK_EXPAND_WIDGET, 4); - priredHBox->pack_start(*predy,Gtk::PACK_EXPAND_WIDGET, 4); - prifreeVBox->pack_start(*priredHBox,Gtk::PACK_EXPAND_WIDGET, 4); + priredHBox->pack_start(*predy,Gtk::PACK_EXPAND_WIDGET, 4); + prifreeVBox->pack_start(*priredHBox,Gtk::PACK_EXPAND_WIDGET, 4); prigreenHBox->pack_start(*pgrex, Gtk::PACK_EXPAND_WIDGET, 4); prigreenHBox->pack_start(*pgrey, Gtk::PACK_EXPAND_WIDGET, 4); - prifreeVBox->pack_start(*prigreenHBox, Gtk::PACK_EXPAND_WIDGET, 4); + prifreeVBox->pack_start(*prigreenHBox, Gtk::PACK_EXPAND_WIDGET, 4); - priblueHBox->pack_start(*pblux, Gtk::PACK_EXPAND_WIDGET, 4); priblueHBox->pack_start(*pbluy, Gtk::PACK_EXPAND_WIDGET, 4); - prifreeVBox->pack_start(*priblueHBox,Gtk::PACK_EXPAND_WIDGET, 4);; - - - fgVBox->pack_start(*prifreeVBox, Gtk::PACK_SHRINK); + prifreeVBox->pack_start(*priblueHBox,Gtk::PACK_EXPAND_WIDGET, 4); + + cgVBox->pack_start(*prifreeVBox, Gtk::PACK_SHRINK); predx->setAdjusterListener(this); predy->setAdjusterListener(this); @@ -373,9 +368,9 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha pbluy->setAdjusterListener(this); //sliders gampos and slpos - fgVBox->pack_start(*gaHBox, Gtk::PACK_EXPAND_WIDGET); + cgVBox->pack_start(*oTRCHBox, Gtk::PACK_EXPAND_WIDGET); trcHBox = Gtk::manage(new Gtk::HBox()); - + gampos = Gtk::manage(new Adjuster(M("TP_GAMMA_CURV"), 1, 3.5, 0.00001, 2.4)); gampos->setAdjusterListener(this); @@ -395,8 +390,8 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha slpos->show(); trcHBox->pack_start(*gampos, Gtk::PACK_EXPAND_WIDGET, 4); //gamma trcHBox->pack_start(*slpos, Gtk::PACK_EXPAND_WIDGET, 4); //slope - fgVBox->pack_start(*trcHBox, Gtk::PACK_EXPAND_WIDGET, 4); - + cgVBox->pack_start(*trcHBox, Gtk::PACK_EXPAND_WIDGET, 4); + //V2 or V4 profiles profHBox = Gtk::manage(new Gtk::HBox()); Gtk::Label* proflab = Gtk::manage(new Gtk::Label(M("TP_GAMMA_PROF") + ":")); @@ -405,12 +400,11 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha wprofile = Gtk::manage(new MyComboBoxText()); profHBox->pack_start(*wprofile, Gtk::PACK_EXPAND_WIDGET); - // fgVBox->pack_start(*profHBox, Gtk::PACK_EXPAND_WIDGET); +// fgVBox->pack_start(*profHBox, Gtk::PACK_EXPAND_WIDGET); wprofile->append(M("TP_GAMMA_PROF_NONE")); wprofile->append(M("TP_GAMMA_PROF_V2")); wprofile->append(M("TP_GAMMA_PROF_V4")); - wprofile->set_active(0); //temperature @@ -421,7 +415,7 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha tempHBox->pack_start(*templab, Gtk::PACK_SHRINK); wtemp = Gtk::manage(new MyComboBoxText()); tempHBox->pack_start(*wtemp, Gtk::PACK_EXPAND_WIDGET); - fgVBox->pack_start(*tempHBox, Gtk::PACK_EXPAND_WIDGET); + cgVBox->pack_start(*tempHBox, Gtk::PACK_EXPAND_WIDGET); wtemp->append(M("TP_GAMMA_TEMP_DEF")); wtemp->append(M("TP_GAMMA_TEMP_41")); wtemp->append(M("TP_GAMMA_TEMP_50")); @@ -433,19 +427,17 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha wtemp->set_active(0); wtemp->set_tooltip_text(M("TP_GAMMA_TEMP_TOOLTIP")); - - fgVBox->pack_start(*profHBox, Gtk::PACK_EXPAND_WIDGET); - fgFrame->add(*fgVBox); - oVBox->pack_start(*fgFrame, Gtk::PACK_EXPAND_WIDGET); + cgVBox->pack_start(*profHBox, Gtk::PACK_EXPAND_WIDGET); - oFrame->add(*oVBox); + cgFrame->add(*cgVBox); + oProfVBox->pack_start(*cgFrame, Gtk::PACK_EXPAND_WIDGET); + + oFrame->add(*oProfVBox); pack_start(*oFrame, Gtk::PACK_EXPAND_WIDGET); - // ---------------------------- Output gamma list entries - Glib::RefPtr filter_icc = Gtk::FileFilter::create(); filter_icc->set_name(M("FILECHOOSER_FILTER_COLPROF")); filter_icc->add_pattern("*.dcp"); @@ -475,21 +467,20 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha ipDialog->set_show_hidden(true); // ProgramData is hidden on Windows #endif - oldip = ""; - wnamesconn = wnames->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::wpChanged)); - onamesconn = onames->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::opChanged)); - ointentconn = ointent->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::oiChanged)); - wgammaconn = wgamma->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::gpChanged)); + wnamesconn = wProfNames->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::wpChanged)); + onamesconn = oProfNames->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::opChanged)); + ointentconn = oRendIntent->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::oiChanged)); + wgammaconn = oTRCPresets->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::gpChanged)); dcpillconn = dcpIll->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::dcpIlluminantChanged)); - wprimariesconn = wprimaries->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::wprimariesChanged)); + wprimariesconn = primaries->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::wprimariesChanged)); wprofileconn = wprofile->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::wprofileChanged)); wtempconn = wtemp->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::wtempChanged)); - wtrcinconn = wtrcin->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::wtrcinChanged)); + wtrcinconn = wTRC->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::wtrcinChanged)); obpcconn = obpc->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::oBPCChanged)); - gamcsconn = freegamma->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::GamChanged)); + gamcsconn = customOutProfile->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::GamChanged)); tcurveconn = ckbToneCurve->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::toneCurveChanged)); ltableconn = ckbApplyLookTable->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::applyLookTableChanged)); beoconn = ckbApplyBaselineExposureOffset->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::applyBaselineExposureOffsetChanged)); @@ -517,18 +508,18 @@ void ICMPanel::updateRenderingIntent(const Glib::ustring &profile) //printf("Intents: %d / Perceptual: %d Relative: %d Saturation: %d Absolute: %d\n", supportedIntents, supportsPerceptual, supportsRelative, supportsSaturation, supportsAbsolute); if (!profile.empty() && (supportsPerceptual || supportsRelative || supportsSaturation || supportsAbsolute)) { - ointent->set_sensitive(true); - ointent->setItemSensitivity(0, supportsPerceptual); - ointent->setItemSensitivity(1, supportsRelative); - ointent->setItemSensitivity(2, supportsSaturation); - ointent->setItemSensitivity(3, supportsAbsolute); + oRendIntent->set_sensitive(true); + oRendIntent->setItemSensitivity(0, supportsPerceptual); + oRendIntent->setItemSensitivity(1, supportsRelative); + oRendIntent->setItemSensitivity(2, supportsSaturation); + oRendIntent->setItemSensitivity(3, supportsAbsolute); } else { - ointent->setItemSensitivity(0, true); - ointent->setItemSensitivity(1, true); - ointent->setItemSensitivity(2, true); - ointent->setItemSensitivity(3, true); - ointent->set_sensitive(false); - ointent->setSelected(1); + oRendIntent->setItemSensitivity(0, true); + oRendIntent->setItemSensitivity(1, true); + oRendIntent->setItemSensitivity(2, true); + oRendIntent->setItemSensitivity(3, true); + oRendIntent->set_sensitive(false); + oRendIntent->setSelected(1); } } @@ -680,107 +671,107 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited) ConnectionBlocker wtempconn_(wtempconn); // ConnectionBlocker wtrcinconn_(wtrcinconn); - if (pp->icm.input.substr(0, 5) != "file:" && !ipDialog->get_filename().empty()) { - ipDialog->set_filename(pp->icm.input); + if (pp->icm.inputProfile.substr(0, 5) != "file:" && !ipDialog->get_filename().empty()) { + ipDialog->set_filename(pp->icm.inputProfile); } - if (pp->icm.input == "(none)") { + if (pp->icm.inputProfile == "(none)") { inone->set_active(true); updateDCP(pp->icm.dcpIlluminant, ""); - } else if (pp->icm.input == "(embedded)" || ((pp->icm.input == "(camera)" || pp->icm.input == "") && icamera->get_state() == Gtk::STATE_INSENSITIVE)) { + } else if (pp->icm.inputProfile == "(embedded)" || ((pp->icm.inputProfile == "(camera)" || pp->icm.inputProfile == "") && icamera->get_state() == Gtk::STATE_INSENSITIVE)) { iembedded->set_active(true); updateDCP(pp->icm.dcpIlluminant, ""); - } else if ((pp->icm.input == "(cameraICC)") && icameraICC->get_state() != Gtk::STATE_INSENSITIVE) { + } else if ((pp->icm.inputProfile == "(cameraICC)") && icameraICC->get_state() != Gtk::STATE_INSENSITIVE) { icameraICC->set_active(true); updateDCP(pp->icm.dcpIlluminant, "(cameraICC)"); - } else if ((pp->icm.input == "(cameraICC)") && icamera->get_state() != Gtk::STATE_INSENSITIVE && icameraICC->get_state() == Gtk::STATE_INSENSITIVE) { + } else if ((pp->icm.inputProfile == "(cameraICC)") && icamera->get_state() != Gtk::STATE_INSENSITIVE && icameraICC->get_state() == Gtk::STATE_INSENSITIVE) { // this is the case when (cameraICC) is instructed by packaged profiles, but ICC file is not found // therefore falling back UI to explicitly reflect the (camera) option icamera->set_active(true); updateDCP(pp->icm.dcpIlluminant, ""); - } else if ((pp->icm.input == "(cameraICC)") && icamera->get_state() == Gtk::STATE_INSENSITIVE && icameraICC->get_state() == Gtk::STATE_INSENSITIVE) { + } else if ((pp->icm.inputProfile == "(cameraICC)") && icamera->get_state() == Gtk::STATE_INSENSITIVE && icameraICC->get_state() == Gtk::STATE_INSENSITIVE) { // If neither (camera) nor (cameraICC) are available, as is the case when loading a non-raw, activate (embedded). iembedded->set_active(true); updateDCP(pp->icm.dcpIlluminant, "(cameraICC)"); - } else if ((pp->icm.input == "(camera)" || pp->icm.input == "") && icamera->get_state() != Gtk::STATE_INSENSITIVE) { + } else if ((pp->icm.inputProfile == "(camera)" || pp->icm.inputProfile == "") && icamera->get_state() != Gtk::STATE_INSENSITIVE) { icamera->set_active(true); updateDCP(pp->icm.dcpIlluminant, ""); } else { ifromfile->set_active(true); - oldip = pp->icm.input.substr(5); // cut of "file:" - ipDialog->set_filename(pp->icm.input.substr(5)); - updateDCP(pp->icm.dcpIlluminant, pp->icm.input.substr(5)); + oldip = pp->icm.inputProfile.substr(5); // cut of "file:" + ipDialog->set_filename(pp->icm.inputProfile.substr(5)); + updateDCP(pp->icm.dcpIlluminant, pp->icm.inputProfile.substr(5)); } - wnames->set_active_text(pp->icm.working); - wgamma->set_active_text(pp->icm.gamma); + wProfNames->set_active_text(pp->icm.workingProfile); + oTRCPresets->set_active_text(pp->icm.outputGammaPreset); - if (pp->icm.wprimaries == "Acesp0") { - wprimaries->set_active(0); - } else if (pp->icm.wprimaries == "Acesp1") { - wprimaries->set_active(1); - } else if (pp->icm.wprimaries == "Adobe") { - wprimaries->set_active(2); - } else if (pp->icm.wprimaries == "Prophoto") { - wprimaries->set_active(3); - } else if (pp->icm.wprimaries == "Rec2020") { - wprimaries->set_active(4); - } else if (pp->icm.wprimaries == "sRGB") { - wprimaries->set_active(5); - } else if (pp->icm.wprimaries == "Widegamut") { - wprimaries->set_active(6); - } else if (pp->icm.wprimaries == "BestRGB") { - wprimaries->set_active(7); - } else if (pp->icm.wprimaries == "BetaRGB") { - wprimaries->set_active(8); - } else if (pp->icm.wprimaries == "BruceRGB") { - wprimaries->set_active(9); - } else if (pp->icm.wprimaries == "pfree") { - wprimaries->set_active(10); + if (pp->icm.outputPimariesPreset == "Acesp0") { + primaries->set_active(0); + } else if (pp->icm.outputPimariesPreset == "Acesp1") { + primaries->set_active(1); + } else if (pp->icm.outputPimariesPreset == "Adobe") { + primaries->set_active(2); + } else if (pp->icm.outputPimariesPreset == "Prophoto") { + primaries->set_active(3); + } else if (pp->icm.outputPimariesPreset == "Rec2020") { + primaries->set_active(4); + } else if (pp->icm.outputPimariesPreset == "sRGB") { + primaries->set_active(5); + } else if (pp->icm.outputPimariesPreset == "Widegamut") { + primaries->set_active(6); + } else if (pp->icm.outputPimariesPreset == "BestRGB") { + primaries->set_active(7); + } else if (pp->icm.outputPimariesPreset == "BetaRGB") { + primaries->set_active(8); + } else if (pp->icm.outputPimariesPreset == "BruceRGB") { + primaries->set_active(9); + } else if (pp->icm.outputPimariesPreset == "pfree") { + primaries->set_active(10); } - if (wprimaries->get_active_row_number() == 10) { + if (primaries->get_active_row_number() == 10) { prifreeVBox->set_sensitive(true); } else { prifreeVBox->set_sensitive(false); } - if (pp->icm.wtemp == "DEF") { + if (pp->icm.outputIlluminant == "DEF") { wtemp->set_active(0); - } else if (pp->icm.wtemp == "D41") { + } else if (pp->icm.outputIlluminant == "D41") { wtemp->set_active(1); - } else if (pp->icm.wtemp == "D50") { + } else if (pp->icm.outputIlluminant == "D50") { wtemp->set_active(2); - } else if (pp->icm.wtemp == "D55") { + } else if (pp->icm.outputIlluminant == "D55") { wtemp->set_active(3); - } else if (pp->icm.wtemp == "D60") { + } else if (pp->icm.outputIlluminant == "D60") { wtemp->set_active(4); - } else if (pp->icm.wtemp == "D65") { + } else if (pp->icm.outputIlluminant == "D65") { wtemp->set_active(5); - } else if (pp->icm.wtemp == "D80") { + } else if (pp->icm.outputIlluminant == "D80") { wtemp->set_active(6); - } else if (pp->icm.wtemp == "stdA") { + } else if (pp->icm.outputIlluminant == "stdA") { wtemp->set_active(7); } - if (pp->icm.wtrcin == "none") { - wtrcin->set_active(0); - } else if (pp->icm.wtrcin == "Custom") { - wtrcin->set_active(1); + if (pp->icm.workingTRC == "none") { + wTRC->set_active(0); + } else if (pp->icm.workingTRC == "Custom") { + wTRC->set_active(1); } - if (pp->icm.wprofile == "none") { + if (pp->icm.outputProfileVersion == "none") { wprofile->set_active(0); - } else if (pp->icm.wprofile == "v2") { + } else if (pp->icm.outputProfileVersion == "v2") { wprofile->set_active(1); - } else if (pp->icm.wprofile == "v4") { + } else if (pp->icm.outputProfileVersion == "v4") { wprofile->set_active(2); } - if (wprimaries->get_active_row_number() == 10) { + if (primaries->get_active_row_number() == 10) { wprofile->set_active(2); } @@ -790,17 +781,17 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited) wprimariesChanged(); wtrcinChanged(); - if (pp->icm.output == ColorManagementParams::NoICMString) { - onames->set_active_text(M("TP_ICM_NOICM")); + if (pp->icm.outputProfile == ColorManagementParams::NoICMString) { + oProfNames->set_active_text(M("TP_ICM_NOICM")); } else { - onames->set_active_text(pp->icm.output); + oProfNames->set_active_text(pp->icm.outputProfile); } - if (onames->get_active_row_number() == -1) { - onames->set_active_text(M("TP_ICM_NOICM")); + if (oProfNames->get_active_row_number() == -1) { + oProfNames->set_active_text(M("TP_ICM_NOICM")); } - ointent->setSelected(pp->icm.outputIntent); + oRendIntent->setSelected(pp->icm.outputIntent); obpc->set_active(pp->icm.outputBPC); ckbToneCurve->set_active(pp->icm.toneCurve); @@ -812,22 +803,22 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited) ckbApplyHueSatMap->set_active(pp->icm.applyHueSatMap); lastApplyHueSatMap = pp->icm.applyHueSatMap; - freegamma->set_active(pp->icm.freegamma); - lastgamfree = pp->icm.freegamma; + customOutProfile->set_active(pp->icm.customOutputProfile); + lastgamfree = pp->icm.customOutputProfile; if (!batchMode) { - onames->set_sensitive(/*wgamma->get_active_row_number() == 0 &&*/ !pp->icm.freegamma); //"default" - wgamma->set_sensitive(pp->icm.freegamma); - gampos->set_sensitive(pp->icm.freegamma); - gampos->set_sensitive(pp->icm.gamma == "Custom"); - slpos->set_sensitive(pp->icm.freegamma); - slpos->set_sensitive(pp->icm.gamma == "Custom"); - updateRenderingIntent(pp->icm.output); - wprimaries->set_sensitive(pp->icm.freegamma); - wprofile->set_sensitive(pp->icm.freegamma); + oProfNames->set_sensitive(/*wgamma->get_active_row_number() == 0 &&*/ !pp->icm.customOutputProfile); //"default" + oTRCPresets->set_sensitive(pp->icm.customOutputProfile); + gampos->set_sensitive(pp->icm.customOutputProfile); + gampos->set_sensitive(pp->icm.outputGammaPreset == "Custom"); + slpos->set_sensitive(pp->icm.customOutputProfile); + slpos->set_sensitive(pp->icm.outputGammaPreset == "Custom"); + updateRenderingIntent(pp->icm.outputProfile); + primaries->set_sensitive(pp->icm.customOutputProfile); + wprofile->set_sensitive(pp->icm.customOutputProfile); if (wprofile->get_active_row_number() == 2) { - wtemp->set_sensitive(pp->icm.freegamma); + wtemp->set_sensitive(pp->icm.customOutputProfile); } else { wtemp->set_sensitive(false); } @@ -836,72 +827,72 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited) } - gampos->setValue(pp->icm.gampos); - slpos->setValue(pp->icm.slpos); - predx->setValue(pp->icm.predx); - predy->setValue(pp->icm.predy); - pgrex->setValue(pp->icm.pgrex); - pgrey->setValue(pp->icm.pgrey); - pblux->setValue(pp->icm.pblux); - pbluy->setValue(pp->icm.pbluy); - gamm->setValue(pp->icm.gamm); - slop->setValue(pp->icm.slop); + gampos->setValue(pp->icm.workingTRCGamma); + slpos->setValue(pp->icm.workingTRCSlope); + predx->setValue(pp->icm.redPrimaryX); + predy->setValue(pp->icm.redPrimaryY); + pgrex->setValue(pp->icm.greenPrimaryX); + pgrey->setValue(pp->icm.greenPrimaryY); + pblux->setValue(pp->icm.bluePrimaryX); + pbluy->setValue(pp->icm.bluePrimaryY); + wGamma->setValue(pp->icm.outputGamma); + wSlope->setValue(pp->icm.outputSlope); if (pedited) { - iunchanged->set_active(!pedited->icm.input); + iunchanged->set_active(!pedited->icm.inputProfile); obpc->set_inconsistent(!pedited->icm.outputBPC); ckbToneCurve->set_inconsistent(!pedited->icm.toneCurve); ckbApplyLookTable->set_inconsistent(!pedited->icm.applyLookTable); ckbApplyBaselineExposureOffset->set_inconsistent(!pedited->icm.applyBaselineExposureOffset); ckbApplyHueSatMap->set_inconsistent(!pedited->icm.applyHueSatMap); - freegamma->set_inconsistent(!pedited->icm.freegamma); + customOutProfile->set_inconsistent(!pedited->icm.customOutputProfile); - if (!pedited->icm.working) { - wnames->set_active_text(M("GENERAL_UNCHANGED")); + if (!pedited->icm.workingProfile) { + wProfNames->set_active_text(M("GENERAL_UNCHANGED")); } - if (!pedited->icm.output) { - onames->set_active_text(M("GENERAL_UNCHANGED")); + if (!pedited->icm.outputProfile) { + oProfNames->set_active_text(M("GENERAL_UNCHANGED")); } if (!pedited->icm.outputIntent) { - ointent->setSelected(4); + oRendIntent->setSelected(4); } if (!pedited->icm.dcpIlluminant) { dcpIll->set_active_text(M("GENERAL_UNCHANGED")); } - if (!pedited->icm.gamma) { - wgamma->set_active_text(M("GENERAL_UNCHANGED")); + if (!pedited->icm.outputGammaPreset) { + oTRCPresets->set_active_text(M("GENERAL_UNCHANGED")); } - if (!pedited->icm.wprimaries) { - wprimaries->set_active_text(M("GENERAL_UNCHANGED")); + if (!pedited->icm.outputPrimariesPreset) { + primaries->set_active_text(M("GENERAL_UNCHANGED")); } - if (!pedited->icm.wprofile) { + if (!pedited->icm.outputProfileVersion) { wprofile->set_active_text(M("GENERAL_UNCHANGED")); } - if (!pedited->icm.wtemp) { + if (!pedited->icm.outputIlluminant) { wtemp->set_active_text(M("GENERAL_UNCHANGED")); } - if (!pedited->icm.wtrcin) { - wtrcin->set_active_text(M("GENERAL_UNCHANGED")); + if (!pedited->icm.workingTRC) { + wTRC->set_active_text(M("GENERAL_UNCHANGED")); } - gampos->setEditedState(pedited->icm.gampos ? Edited : UnEdited); - slpos->setEditedState(pedited->icm.slpos ? Edited : UnEdited); - predx->setEditedState(pedited->icm.predx ? Edited : UnEdited); - predy->setEditedState(pedited->icm.predy ? Edited : UnEdited); - pgrex->setEditedState(pedited->icm.pgrex ? Edited : UnEdited); - pgrey->setEditedState(pedited->icm.pgrey ? Edited : UnEdited); - pblux->setEditedState(pedited->icm.pblux ? Edited : UnEdited); - pbluy->setEditedState(pedited->icm.pbluy ? Edited : UnEdited); - gamm->setEditedState(pedited->icm.gamm ? Edited : UnEdited); - slop->setEditedState(pedited->icm.slop ? Edited : UnEdited); + gampos->setEditedState(pedited->icm.workingTRCGamma ? Edited : UnEdited); + slpos->setEditedState(pedited->icm.workingTRCSlope ? Edited : UnEdited); + predx->setEditedState(pedited->icm.redPrimaryX ? Edited : UnEdited); + predy->setEditedState(pedited->icm.redPrimaryY ? Edited : UnEdited); + pgrex->setEditedState(pedited->icm.greenPrimaryX ? Edited : UnEdited); + pgrey->setEditedState(pedited->icm.greenPrimaryY ? Edited : UnEdited); + pblux->setEditedState(pedited->icm.bluePrimaryX ? Edited : UnEdited); + pbluy->setEditedState(pedited->icm.bluePrimaryY ? Edited : UnEdited); + wGamma->setEditedState(pedited->icm.outputGamma ? Edited : UnEdited); + wSlope->setEditedState(pedited->icm.outputSlope ? Edited : UnEdited); } @@ -912,37 +903,37 @@ void ICMPanel::write(ProcParams* pp, ParamsEdited* pedited) { if (inone->get_active()) { - pp->icm.input = "(none)"; + pp->icm.inputProfile = "(none)"; } else if (iembedded->get_active()) { - pp->icm.input = "(embedded)"; + pp->icm.inputProfile = "(embedded)"; } else if (icamera->get_active()) { - pp->icm.input = "(camera)"; + pp->icm.inputProfile = "(camera)"; } else if (icameraICC->get_active()) { - pp->icm.input = "(cameraICC)"; + pp->icm.inputProfile = "(cameraICC)"; } else { if (Glib::file_test(ipDialog->get_filename(), Glib::FILE_TEST_EXISTS) && !Glib::file_test(ipDialog->get_filename(), Glib::FILE_TEST_IS_DIR)) { - pp->icm.input = "file:" + ipDialog->get_filename(); + pp->icm.inputProfile = "file:" + ipDialog->get_filename(); } else { - pp->icm.input = ""; // just a directory + pp->icm.inputProfile = ""; // just a directory } Glib::ustring p = Glib::path_get_dirname(ipDialog->get_filename()); } - pp->icm.working = wnames->get_active_text(); - pp->icm.gamma = wgamma->get_active_text(); + pp->icm.workingProfile = wProfNames->get_active_text(); + pp->icm.outputGammaPreset = oTRCPresets->get_active_text(); pp->icm.dcpIlluminant = rtengine::max(dcpIll->get_active_row_number(), 0); - pp->icm.wprimaries = wprimaries->get_active_text(); - pp->icm.wtemp = wtemp->get_active_text(); - pp->icm.wtrcin = wtrcin->get_active_text(); + pp->icm.outputPimariesPreset = primaries->get_active_text(); + pp->icm.outputIlluminant = wtemp->get_active_text(); + pp->icm.workingTRC = wTRC->get_active_text(); - if (onames->get_active_text() == M("TP_ICM_NOICM")) { - pp->icm.output = ColorManagementParams::NoICMString; + if (oProfNames->get_active_text() == M("TP_ICM_NOICM")) { + pp->icm.outputProfile = ColorManagementParams::NoICMString; } else { - pp->icm.output = onames->get_active_text(); + pp->icm.outputProfile = oProfNames->get_active_text(); } - int ointentVal = ointent->getSelected(); + int ointentVal = oRendIntent->getSelected(); if (ointentVal >= 0 && ointentVal < RI__COUNT) { pp->icm.outputIntent = static_cast(ointentVal); @@ -951,133 +942,133 @@ void ICMPanel::write(ProcParams* pp, ParamsEdited* pedited) } if (wprofile->get_active_row_number() == 0) { - pp->icm.wprofile = "none"; + pp->icm.outputProfileVersion = "none"; } else if (wprofile->get_active_row_number() == 1) { - pp->icm.wprofile = "v2"; + pp->icm.outputProfileVersion = "v2"; } else if (wprofile->get_active_row_number() == 2) { - pp->icm.wprofile = "v4"; + pp->icm.outputProfileVersion = "v4"; } - if (wprimaries->get_active_row_number() == 0) { - pp->icm.wprimaries = "Acesp0"; - } else if (wprimaries->get_active_row_number() == 1) { - pp->icm.wprimaries = "Acesp1"; - } else if (wprimaries->get_active_row_number() == 2) { - pp->icm.wprimaries = "Adobe"; - } else if (wprimaries->get_active_row_number() == 3) { - pp->icm.wprimaries = "Prophoto"; - } else if (wprimaries->get_active_row_number() == 4) { - pp->icm.wprimaries = "Rec2020"; - } else if (wprimaries->get_active_row_number() == 5) { - pp->icm.wprimaries = "sRGB"; - } else if (wprimaries->get_active_row_number() == 6) { - pp->icm.wprimaries = "Widegamut"; - } else if (wprimaries->get_active_row_number() == 7) { - pp->icm.wprimaries = "BestRGB"; - } else if (wprimaries->get_active_row_number() == 8) { - pp->icm.wprimaries = "BetaRGB"; - } else if (wprimaries->get_active_row_number() == 9) { - pp->icm.wprimaries = "BruceRGB"; - } else if (wprimaries->get_active_row_number() == 10) { - pp->icm.wprimaries = "pfree"; + if (primaries->get_active_row_number() == 0) { + pp->icm.outputPimariesPreset = "Acesp0"; + } else if (primaries->get_active_row_number() == 1) { + pp->icm.outputPimariesPreset = "Acesp1"; + } else if (primaries->get_active_row_number() == 2) { + pp->icm.outputPimariesPreset = "Adobe"; + } else if (primaries->get_active_row_number() == 3) { + pp->icm.outputPimariesPreset = "Prophoto"; + } else if (primaries->get_active_row_number() == 4) { + pp->icm.outputPimariesPreset = "Rec2020"; + } else if (primaries->get_active_row_number() == 5) { + pp->icm.outputPimariesPreset = "sRGB"; + } else if (primaries->get_active_row_number() == 6) { + pp->icm.outputPimariesPreset = "Widegamut"; + } else if (primaries->get_active_row_number() == 7) { + pp->icm.outputPimariesPreset = "BestRGB"; + } else if (primaries->get_active_row_number() == 8) { + pp->icm.outputPimariesPreset = "BetaRGB"; + } else if (primaries->get_active_row_number() == 9) { + pp->icm.outputPimariesPreset = "BruceRGB"; + } else if (primaries->get_active_row_number() == 10) { + pp->icm.outputPimariesPreset = "pfree"; } if (wtemp->get_active_row_number() == 0) { - pp->icm.wtemp = "DEF"; + pp->icm.outputIlluminant = "DEF"; } else if (wtemp->get_active_row_number() == 1) { - pp->icm.wtemp = "D41"; + pp->icm.outputIlluminant = "D41"; } else if (wtemp->get_active_row_number() == 2) { - pp->icm.wtemp = "D50"; + pp->icm.outputIlluminant = "D50"; } else if (wtemp->get_active_row_number() == 3) { - pp->icm.wtemp = "D55"; + pp->icm.outputIlluminant = "D55"; } else if (wtemp->get_active_row_number() == 4) { - pp->icm.wtemp = "D60"; + pp->icm.outputIlluminant = "D60"; } else if (wtemp->get_active_row_number() == 5) { - pp->icm.wtemp = "D65"; + pp->icm.outputIlluminant = "D65"; } else if (wtemp->get_active_row_number() == 6) { - pp->icm.wtemp = "D80"; + pp->icm.outputIlluminant = "D80"; } else if (wtemp->get_active_row_number() == 7) { - pp->icm.wtemp = "stdA"; + pp->icm.outputIlluminant = "stdA"; } - if (wtrcin->get_active_row_number() == 0) { - pp->icm.wtrcin = "none"; - } else if (wtrcin->get_active_row_number() == 1) { - pp->icm.wtrcin = "Custom"; + if (wTRC->get_active_row_number() == 0) { + pp->icm.workingTRC = "none"; + } else if (wTRC->get_active_row_number() == 1) { + pp->icm.workingTRC = "Custom"; } - pp->icm.freegamma = freegamma->get_active(); + pp->icm.customOutputProfile = customOutProfile->get_active(); pp->icm.toneCurve = ckbToneCurve->get_active(); pp->icm.applyLookTable = ckbApplyLookTable->get_active(); pp->icm.applyBaselineExposureOffset = ckbApplyBaselineExposureOffset->get_active(); pp->icm.applyHueSatMap = ckbApplyHueSatMap->get_active(); - pp->icm.gampos = (double) gampos->getValue(); - pp->icm.slpos = (double) slpos->getValue(); + pp->icm.workingTRCGamma = (double) gampos->getValue(); + pp->icm.workingTRCSlope = (double) slpos->getValue(); pp->icm.outputBPC = obpc->get_active(); - pp->icm.predx = (double) predx->getValue(); - pp->icm.predy = (double) predy->getValue(); - pp->icm.pgrex = (double) pgrex->getValue(); - pp->icm.pgrey = (double) pgrey->getValue(); - pp->icm.pblux = (double) pblux->getValue(); - pp->icm.pbluy = (double) pbluy->getValue(); - pp->icm.gamm = (double) gamm->getValue(); - pp->icm.slop = (double) slop->getValue(); + pp->icm.redPrimaryX = (double) predx->getValue(); + pp->icm.redPrimaryY = (double) predy->getValue(); + pp->icm.greenPrimaryX = (double) pgrex->getValue(); + pp->icm.greenPrimaryY = (double) pgrey->getValue(); + pp->icm.bluePrimaryX = (double) pblux->getValue(); + pp->icm.bluePrimaryY = (double) pbluy->getValue(); + pp->icm.outputGamma = (double) wGamma->getValue(); + pp->icm.outputSlope = (double) wSlope->getValue(); if (pedited) { - pedited->icm.input = !iunchanged->get_active(); - pedited->icm.working = wnames->get_active_text() != M("GENERAL_UNCHANGED"); - pedited->icm.output = onames->get_active_text() != M("GENERAL_UNCHANGED"); - pedited->icm.outputIntent = ointent->getSelected() < 4; + pedited->icm.inputProfile = !iunchanged->get_active(); + pedited->icm.workingProfile = wProfNames->get_active_text() != M("GENERAL_UNCHANGED"); + pedited->icm.outputProfile = oProfNames->get_active_text() != M("GENERAL_UNCHANGED"); + pedited->icm.outputIntent = oRendIntent->getSelected() < 4; pedited->icm.outputBPC = !obpc->get_inconsistent(); pedited->icm.dcpIlluminant = dcpIll->get_active_text() != M("GENERAL_UNCHANGED"); pedited->icm.toneCurve = !ckbToneCurve->get_inconsistent(); pedited->icm.applyLookTable = !ckbApplyLookTable->get_inconsistent(); pedited->icm.applyBaselineExposureOffset = !ckbApplyBaselineExposureOffset->get_inconsistent(); pedited->icm.applyHueSatMap = !ckbApplyHueSatMap->get_inconsistent(); - pedited->icm.gamma = wgamma->get_active_text() != M("GENERAL_UNCHANGED"); - pedited->icm.freegamma = !freegamma->get_inconsistent(); - pedited->icm.gampos = gampos->getEditedState(); - pedited->icm.slpos = slpos->getEditedState(); - pedited->icm.predx = predx->getEditedState(); - pedited->icm.predy = predy->getEditedState(); - pedited->icm.pgrex = pgrex->getEditedState(); - pedited->icm.pgrey = pgrey->getEditedState(); - pedited->icm.pblux = pblux->getEditedState(); - pedited->icm.pbluy = pbluy->getEditedState(); - pedited->icm.gamm = gamm->getEditedState(); - pedited->icm.slop = slop->getEditedState(); + pedited->icm.outputGammaPreset = oTRCPresets->get_active_text() != M("GENERAL_UNCHANGED"); + pedited->icm.customOutputProfile = !customOutProfile->get_inconsistent(); + pedited->icm.workingTRCGamma = gampos->getEditedState(); + pedited->icm.workingTRCSlope = slpos->getEditedState(); + pedited->icm.redPrimaryX = predx->getEditedState(); + pedited->icm.redPrimaryY = predy->getEditedState(); + pedited->icm.greenPrimaryX = pgrex->getEditedState(); + pedited->icm.greenPrimaryY = pgrey->getEditedState(); + pedited->icm.bluePrimaryX = pblux->getEditedState(); + pedited->icm.bluePrimaryY = pbluy->getEditedState(); + pedited->icm.outputGamma = wGamma->getEditedState(); + pedited->icm.outputSlope = wSlope->getEditedState(); - pedited->icm.wprimaries = wprimaries->get_active_text() != M("GENERAL_UNCHANGED"); - pedited->icm.wprofile = wprofile->get_active_text() != M("GENERAL_UNCHANGED"); - pedited->icm.wtemp = wtemp->get_active_text() != M("GENERAL_UNCHANGED"); - pedited->icm.wtrcin = wtrcin->get_active_text() != M("GENERAL_UNCHANGED"); + pedited->icm.outputPrimariesPreset = primaries->get_active_text() != M("GENERAL_UNCHANGED"); + pedited->icm.outputProfileVersion = wprofile->get_active_text() != M("GENERAL_UNCHANGED"); + pedited->icm.outputIlluminant = wtemp->get_active_text() != M("GENERAL_UNCHANGED"); + pedited->icm.workingTRC = wTRC->get_active_text() != M("GENERAL_UNCHANGED"); } } void ICMPanel::setDefaults(const ProcParams* defParams, const ParamsEdited* pedited) { - gampos->setDefault(defParams->icm.gampos); - slpos->setDefault(defParams->icm.slpos); - predx->setDefault(defParams->icm.predx); - predy->setDefault(defParams->icm.predy); - pgrex->setDefault(defParams->icm.pgrex); - pgrey->setDefault(defParams->icm.pgrey); - pblux->setDefault(defParams->icm.pblux); - pbluy->setDefault(defParams->icm.pbluy); - gamm->setDefault(defParams->icm.gamm); - slop->setDefault(defParams->icm.slop); + gampos->setDefault(defParams->icm.workingTRCGamma); + slpos->setDefault(defParams->icm.workingTRCSlope); + predx->setDefault(defParams->icm.redPrimaryX); + predy->setDefault(defParams->icm.redPrimaryY); + pgrex->setDefault(defParams->icm.greenPrimaryX); + pgrey->setDefault(defParams->icm.greenPrimaryY); + pblux->setDefault(defParams->icm.bluePrimaryX); + pbluy->setDefault(defParams->icm.bluePrimaryY); + wGamma->setDefault(defParams->icm.outputGamma); + wSlope->setDefault(defParams->icm.outputSlope); if (pedited) { - gampos->setDefaultEditedState(pedited->icm.gampos ? Edited : UnEdited); - slpos->setDefaultEditedState(pedited->icm.slpos ? Edited : UnEdited); - predx->setDefaultEditedState(pedited->icm.predx ? Edited : UnEdited); - predy->setDefaultEditedState(pedited->icm.predy ? Edited : UnEdited); - pgrex->setDefaultEditedState(pedited->icm.pgrex ? Edited : UnEdited); - pgrey->setDefaultEditedState(pedited->icm.pgrey ? Edited : UnEdited); - pblux->setDefaultEditedState(pedited->icm.pblux ? Edited : UnEdited); - pbluy->setDefaultEditedState(pedited->icm.pbluy ? Edited : UnEdited); - gamm->setDefaultEditedState(pedited->icm.gamm ? Edited : UnEdited); - slop->setDefaultEditedState(pedited->icm.slop ? Edited : UnEdited); + gampos->setDefaultEditedState(pedited->icm.workingTRCGamma ? Edited : UnEdited); + slpos->setDefaultEditedState(pedited->icm.workingTRCSlope ? Edited : UnEdited); + predx->setDefaultEditedState(pedited->icm.redPrimaryX ? Edited : UnEdited); + predy->setDefaultEditedState(pedited->icm.redPrimaryY ? Edited : UnEdited); + pgrex->setDefaultEditedState(pedited->icm.greenPrimaryX ? Edited : UnEdited); + pgrey->setDefaultEditedState(pedited->icm.greenPrimaryY ? Edited : UnEdited); + pblux->setDefaultEditedState(pedited->icm.bluePrimaryX ? Edited : UnEdited); + pbluy->setDefaultEditedState(pedited->icm.bluePrimaryY ? Edited : UnEdited); + wGamma->setDefaultEditedState(pedited->icm.outputGamma ? Edited : UnEdited); + wSlope->setDefaultEditedState(pedited->icm.outputSlope ? Edited : UnEdited); } else { gampos->setDefaultEditedState(Irrelevant); @@ -1088,8 +1079,8 @@ void ICMPanel::setDefaults(const ProcParams* defParams, const ParamsEdited* pedi pgrey->setDefaultEditedState(Irrelevant); pblux->setDefaultEditedState(Irrelevant); pbluy->setDefaultEditedState(Irrelevant); - gamm->setDefaultEditedState(Irrelevant); - slop->setDefaultEditedState(Irrelevant); + wGamma->setDefaultEditedState(Irrelevant); + wSlope->setDefaultEditedState(Irrelevant); } } @@ -1103,7 +1094,7 @@ void ICMPanel::setAdjusterBehavior(bool gammaadd, bool slopeadd) void ICMPanel::adjusterChanged(Adjuster* a, double newval) { - if (listener && (freegamma->get_active() || batchMode)) { + if (listener && (customOutProfile->get_active() || batchMode)) { Glib::ustring costr = Glib::ustring::format(std::setw(3), std::fixed, std::setprecision(2), newval); @@ -1129,9 +1120,9 @@ void ICMPanel::adjusterChanged(Adjuster* a, double newval) if (listener || batchMode) { Glib::ustring costr2 = Glib::ustring::format(std::setw(3), std::fixed, std::setprecision(2), newval); - if (a == gamm) { + if (a == wGamma) { listener->panelChanged(EvICMgamm, costr2); - } else if (a == slop) { + } else if (a == wSlope) { listener->panelChanged(EvICMslop, costr2); } @@ -1147,24 +1138,24 @@ void ICMPanel::wpChanged() } if (listener) { - listener->panelChanged(EvWProfile, wnames->get_active_text()); + listener->panelChanged(EvWProfile, wProfNames->get_active_text()); } } void ICMPanel::wprimariesChanged() { - if (wprimaries->get_active_row_number() == 10) { + if (primaries->get_active_row_number() == 10) { prifreeVBox->set_sensitive(true); } else { prifreeVBox->set_sensitive(false); } - if (wprimaries->get_active_row_number() == 10) { + if (primaries->get_active_row_number() == 10) { wprofile->set_active(2); } if (listener) { - listener->panelChanged(EvICMprimariMethod, wprimaries->get_active_text()); + listener->panelChanged(EvICMprimariMethod, primaries->get_active_text()); } } @@ -1187,17 +1178,17 @@ void ICMPanel::wtempChanged() void ICMPanel::wtrcinChanged() { - if (wtrcin->get_active_row_number() == 0) { - gamm->set_sensitive(false); - slop->set_sensitive(false); + if (wTRC->get_active_row_number() == 0) { + wGamma->set_sensitive(false); + wSlope->set_sensitive(false); } else { - gamm->set_sensitive(true); - slop->set_sensitive(true); + wGamma->set_sensitive(true); + wSlope->set_sensitive(true); } if (listener) { - listener->panelChanged(EvICMtrcinMethod, wtrcin->get_active_text()); + listener->panelChanged(EvICMtrcinMethod, wTRC->get_active_text()); } } @@ -1221,7 +1212,7 @@ void ICMPanel::wprofileChanged() void ICMPanel::gpChanged() { - if (wgamma->get_active_row_number() == 0) { + if (oTRCPresets->get_active_row_number() == 0) { gampos->set_sensitive(true); slpos->set_sensitive(true); } else { @@ -1230,8 +1221,8 @@ void ICMPanel::gpChanged() } if (listener) { - listener->panelChanged(EvGAMMA, wgamma->get_active_text()); - onames->set_sensitive(wgamma->get_active_row_number() == 0); + listener->panelChanged(EvGAMMA, oTRCPresets->get_active_text()); + oProfNames->set_sensitive(oTRCPresets->get_active_row_number() == 0); } } @@ -1395,57 +1386,57 @@ void ICMPanel::GamChanged() } if (multiImage) { - if (freegamma->get_inconsistent()) { - freegamma->set_inconsistent(false); + if (customOutProfile->get_inconsistent()) { + customOutProfile->set_inconsistent(false); gamcsconn.block(true); - freegamma->set_active(false); + customOutProfile->set_active(false); gamcsconn.block(false); } else if (lastgamfree) { - freegamma->set_inconsistent(true); + customOutProfile->set_inconsistent(true); } - lastgamfree = freegamma->get_active(); + lastgamfree = customOutProfile->get_active(); } if (listener) { - if (freegamma->get_inconsistent()) { + if (customOutProfile->get_inconsistent()) { listener->panelChanged(EvGAMFREE, M("GENERAL_UNCHANGED")); - } else if (freegamma->get_active()) { + } else if (customOutProfile->get_active()) { listener->panelChanged(EvGAMFREE, M("GENERAL_ENABLED")); if (!batchMode) { - onames->set_sensitive(false);//disabled choice - wgamma->show(); + oProfNames->set_sensitive(false);//disabled choice + oTRCPresets->show(); gampos->show(); slpos->show(); - wprimaries->show(); + primaries->show(); wprofile->show(); wtemp->show(); - - wgamma->set_sensitive(true); + + oTRCPresets->set_sensitive(true); gampos->set_sensitive(true); slpos->set_sensitive(true); - wprimaries->set_sensitive(true); + primaries->set_sensitive(true); wprofile->set_sensitive(true); //wtemp->set_sensitive(true); if (wprofile->get_active_row_number() == 2) { wtemp->set_sensitive(true); } - priHBox->show(); - prifreeVBox->show(); + primariesHBox->show(); + prifreeVBox->show(); - priHBox->set_sensitive(true); - if (wprimaries->get_active_row_number() == 10) { + primariesHBox->set_sensitive(true); + if (primaries->get_active_row_number() == 10) { prifreeVBox->set_sensitive(true); } else { prifreeVBox->set_sensitive(false); } - gaHBox->show(); + oTRCHBox->show(); profHBox->show(); tempHBox->show(); - gaHBox->set_sensitive(true); + oTRCHBox->set_sensitive(true); profHBox->set_sensitive(true); tempHBox->set_sensitive(true); } @@ -1453,34 +1444,34 @@ void ICMPanel::GamChanged() listener->panelChanged(EvGAMFREE, M("GENERAL_DISABLED")); if (!batchMode) { - onames->set_sensitive(true); - wgamma->hide(); + oProfNames->set_sensitive(true); + oTRCPresets->hide(); gampos->hide(); slpos->hide(); - wprimaries->hide(); + primaries->hide(); wprofile->hide(); - wtemp->hide(); - - wgamma->set_sensitive(false); + wtemp->hide(); + + oTRCPresets->set_sensitive(false); gampos->set_sensitive(false); slpos->set_sensitive(false); - wprimaries->set_sensitive(false); + primaries->set_sensitive(false); wprofile->set_sensitive(false); - + if (wprofile->get_active_row_number() != 2) { wtemp->set_sensitive(false); } - priHBox->hide(); + primariesHBox->hide(); prifreeVBox->hide(); - gaHBox->hide(); + oTRCHBox->hide(); profHBox->hide(); tempHBox->hide(); - priHBox->set_sensitive(false); + primariesHBox->set_sensitive(false); prifreeVBox->set_sensitive(false); - gaHBox->set_sensitive(false); + oTRCHBox->set_sensitive(false); profHBox->set_sensitive(false); tempHBox->set_sensitive(false); @@ -1493,11 +1484,11 @@ void ICMPanel::GamChanged() void ICMPanel::opChanged() { if (!batchMode) { - updateRenderingIntent(onames->get_active_text()); + updateRenderingIntent(oProfNames->get_active_text()); } if (listener) { - listener->panelChanged(EvOProfile, onames->get_active_text()); + listener->panelChanged(EvOProfile, oProfNames->get_active_text()); } } @@ -1656,19 +1647,19 @@ void ICMPanel::setBatchMode(bool batchMode) iVBox->pack_start(*iunchanged, Gtk::PACK_SHRINK, 4); iVBox->reorder_child(*iunchanged, 5); removeIfThere(this, saveRef); - onames->append(M("GENERAL_UNCHANGED")); - ointent->addEntry("unchanged-22.png", M("GENERAL_UNCHANGED")); - ointent->show(); - wnames->append(M("GENERAL_UNCHANGED")); - wgamma->append(M("GENERAL_UNCHANGED")); - wprimaries->append(M("GENERAL_UNCHANGED")); + oProfNames->append(M("GENERAL_UNCHANGED")); + oRendIntent->addEntry("unchanged-22.png", M("GENERAL_UNCHANGED")); + oRendIntent->show(); + wProfNames->append(M("GENERAL_UNCHANGED")); + oTRCPresets->append(M("GENERAL_UNCHANGED")); + primaries->append(M("GENERAL_UNCHANGED")); wprofile->append(M("GENERAL_UNCHANGED")); wtemp->append(M("GENERAL_UNCHANGED")); - wtrcin->append(M("GENERAL_UNCHANGED")); + wTRC->append(M("GENERAL_UNCHANGED")); dcpIll->append(M("GENERAL_UNCHANGED")); gampos->showEditedCB(); slpos->showEditedCB(); - gamm->showEditedCB(); - slop->showEditedCB(); + wGamma->showEditedCB(); + wSlope->showEditedCB(); } diff --git a/rtgui/icmpanel.h b/rtgui/icmpanel.h index a855347b7..1c9ddad53 100644 --- a/rtgui/icmpanel.h +++ b/rtgui/icmpanel.h @@ -55,8 +55,8 @@ protected: Adjuster* pgrey; Adjuster* pblux; Adjuster* pbluy; - Adjuster* gamm; - Adjuster* slop; + Adjuster* wGamma; + Adjuster* wSlope; Gtk::Label* labmga; Gtk::HBox* gabox; @@ -92,19 +92,19 @@ private: rtengine::ProcEvent EvICMtrcinMethod; Gtk::VBox * iVBox; - Gtk::HBox* priHBox; - Gtk::HBox* gaHBox; + Gtk::HBox* primariesHBox; + Gtk::HBox* oTRCHBox; Gtk::HBox* profHBox; Gtk::HBox* tempHBox; Gtk::VBox* prifreeVBox; - Gtk::HBox* trcinHBox; + Gtk::HBox* wTRCHBox; Gtk::HBox* prigreenHBox; Gtk::HBox* priblueHBox; Gtk::HBox* trcHBox; Gtk::HBox* priredHBox; Gtk::CheckButton* obpc; - Gtk::CheckButton* freegamma; + Gtk::CheckButton* customOutProfile; Gtk::RadioButton* inone; Gtk::RadioButton* iembedded; @@ -118,22 +118,22 @@ private: Gtk::CheckButton* ckbApplyLookTable; Gtk::CheckButton* ckbApplyBaselineExposureOffset; Gtk::CheckButton* ckbApplyHueSatMap; - MyComboBoxText* wnames; + MyComboBoxText* wProfNames; sigc::connection wnamesconn; - MyComboBoxText* wgamma; + MyComboBoxText* oTRCPresets; sigc::connection wgammaconn; - MyComboBoxText* wprimaries; + MyComboBoxText* primaries; sigc::connection wprimariesconn; MyComboBoxText* wprofile; sigc::connection wprofileconn; MyComboBoxText* wtemp; sigc::connection wtempconn; - MyComboBoxText* wtrcin; + MyComboBoxText* wTRC; sigc::connection wtrcinconn; - MyComboBoxText* onames; + MyComboBoxText* oProfNames; sigc::connection onamesconn; - std::unique_ptr ointent; + std::unique_ptr oRendIntent; sigc::connection ointentconn; Gtk::RadioButton* iunchanged; MyFileChooserButton* ipDialog; diff --git a/rtgui/options.cc b/rtgui/options.cc index 928d3cf47..9e0f9cedd 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -461,12 +461,12 @@ void Options::setDefaults() fastexport_bypass_raw_ca = true; fastexport_bypass_raw_df = true; fastexport_bypass_raw_ff = true; - fastexport_icm_input = "(camera)"; - fastexport_icm_working = "ProPhoto"; - fastexport_icm_output = "RT_sRGB"; + fastexport_icm_input_profile = "(camera)"; + fastexport_icm_working_profile = "ProPhoto"; + fastexport_icm_output_profile = "RT_sRGB"; fastexport_icm_outputIntent = rtengine::RI_RELATIVE; fastexport_icm_outputBPC = true; - fastexport_icm_gamma = "Free"; + fastexport_icm_custom_output_profile = "Custom"; fastexport_resize_enabled = true; fastexport_resize_scale = 1; fastexport_resize_appliesTo = "Cropped area"; @@ -1622,15 +1622,15 @@ void Options::readFromFile(Glib::ustring fname) } if (keyFile.has_key("Fast Export", "fastexport_icm_input")) { - fastexport_icm_input = keyFile.get_string("Fast Export", "fastexport_icm_input"); + fastexport_icm_input_profile = keyFile.get_string("Fast Export", "fastexport_icm_input"); } if (keyFile.has_key("Fast Export", "fastexport_icm_working")) { - fastexport_icm_working = keyFile.get_string("Fast Export", "fastexport_icm_working"); + fastexport_icm_working_profile = keyFile.get_string("Fast Export", "fastexport_icm_working"); } if (keyFile.has_key("Fast Export", "fastexport_icm_output")) { - fastexport_icm_output = keyFile.get_string("Fast Export", "fastexport_icm_output"); + fastexport_icm_output_profile = keyFile.get_string("Fast Export", "fastexport_icm_output"); } if (keyFile.has_key("Fast Export", "fastexport_icm_output_intent")) { @@ -1642,7 +1642,7 @@ void Options::readFromFile(Glib::ustring fname) } if (keyFile.has_key("Fast Export", "fastexport_icm_gamma")) { - fastexport_icm_gamma = keyFile.get_string("Fast Export", "fastexport_icm_gamma"); + fastexport_icm_custom_output_profile = keyFile.get_string("Fast Export", "fastexport_icm_gamma"); } if (keyFile.has_key("Fast Export", "fastexport_resize_enabled")) { @@ -2033,12 +2033,12 @@ void Options::saveToFile(Glib::ustring fname) keyFile.set_boolean("Fast Export", "fastexport_bypass_raw_ca", fastexport_bypass_raw_ca); keyFile.set_boolean("Fast Export", "fastexport_bypass_raw_df", fastexport_bypass_raw_df); keyFile.set_boolean("Fast Export", "fastexport_bypass_raw_ff", fastexport_bypass_raw_ff); - keyFile.set_string("Fast Export", "fastexport_icm_input", fastexport_icm_input); - keyFile.set_string("Fast Export", "fastexport_icm_working", fastexport_icm_working); - keyFile.set_string("Fast Export", "fastexport_icm_output", fastexport_icm_output); + keyFile.set_string("Fast Export", "fastexport_icm_input", fastexport_icm_input_profile); + keyFile.set_string("Fast Export", "fastexport_icm_working", fastexport_icm_working_profile); + keyFile.set_string("Fast Export", "fastexport_icm_output", fastexport_icm_output_profile); keyFile.set_integer("Fast Export", "fastexport_icm_output_intent", fastexport_icm_outputIntent); keyFile.set_boolean("Fast Export", "fastexport_icm_output_bpc", fastexport_icm_outputBPC); - keyFile.set_string("Fast Export", "fastexport_icm_gamma", fastexport_icm_gamma); + keyFile.set_string("Fast Export", "fastexport_icm_gamma", fastexport_icm_custom_output_profile); keyFile.set_boolean("Fast Export", "fastexport_resize_enabled", fastexport_resize_enabled); keyFile.set_double("Fast Export", "fastexport_resize_scale", fastexport_resize_scale); keyFile.set_string("Fast Export", "fastexport_resize_appliesTo", fastexport_resize_appliesTo); diff --git a/rtgui/options.h b/rtgui/options.h index 25fa31b6d..8d736dc3d 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -309,12 +309,12 @@ public: bool fastexport_bypass_raw_ca; bool fastexport_bypass_raw_df; bool fastexport_bypass_raw_ff; - Glib::ustring fastexport_icm_input; - Glib::ustring fastexport_icm_working; - Glib::ustring fastexport_icm_output; + Glib::ustring fastexport_icm_input_profile; + Glib::ustring fastexport_icm_working_profile; + Glib::ustring fastexport_icm_output_profile; rtengine::RenderingIntent fastexport_icm_outputIntent; bool fastexport_icm_outputBPC; - Glib::ustring fastexport_icm_gamma; + Glib::ustring fastexport_icm_custom_output_profile; bool fastexport_resize_enabled; double fastexport_resize_scale; Glib::ustring fastexport_resize_appliesTo; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 4de401a66..acb2579f4 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -374,32 +374,32 @@ void ParamsEdited::set(bool v) resize.width = v; resize.height = v; resize.enabled = v; - icm.input = v; + icm.inputProfile = v; icm.toneCurve = v; icm.applyLookTable = v; icm.applyBaselineExposureOffset = v; icm.applyHueSatMap = v; icm.dcpIlluminant = v; - icm.working = v; - icm.output = v; + icm.workingProfile = v; + icm.outputProfile = v; icm.outputIntent = v; - icm.outputBPC = v; - icm.gamma = v; - icm.freegamma = v; - icm.gampos = v; - icm.slpos = v; - icm.predx = v; - icm.predy = v; - icm.pgrex = v; - icm.pgrey = v; - icm.pblux = v; - icm.pbluy = v; - icm.gamm = v; - icm.slop = v; - icm.wprimaries = v; - icm.wprofile = v; - icm.wtemp = v; - icm.wtrcin = v; + icm.outputBPC = v; + icm.outputGammaPreset = v; + icm.customOutputProfile = v; + icm.workingTRCGamma = v; + icm.workingTRCSlope = v; + icm.redPrimaryX = v; + icm.redPrimaryY = v; + icm.greenPrimaryX = v; + icm.greenPrimaryY = v; + icm.bluePrimaryX = v; + icm.bluePrimaryY = v; + icm.outputGamma = v; + icm.outputSlope = v; + icm.outputPrimariesPreset = v; + icm.outputProfileVersion = v; + icm.outputIlluminant = v; + icm.workingTRC = v; raw.bayersensor.method = v; raw.bayersensor.imageNum = v; raw.bayersensor.ccSteps = v; @@ -932,33 +932,32 @@ void ParamsEdited::initFrom(const std::vector& resize.width = resize.width && p.resize.width == other.resize.width; resize.height = resize.height && p.resize.height == other.resize.height; resize.enabled = resize.enabled && p.resize.enabled == other.resize.enabled; - icm.input = icm.input && p.icm.input == other.icm.input; + icm.inputProfile = icm.inputProfile && p.icm.inputProfile == other.icm.inputProfile; icm.toneCurve = icm.toneCurve && p.icm.toneCurve == other.icm.toneCurve; icm.applyLookTable = icm.applyLookTable && p.icm.applyLookTable == other.icm.applyLookTable; icm.applyBaselineExposureOffset = icm.applyBaselineExposureOffset && p.icm.applyBaselineExposureOffset == other.icm.applyBaselineExposureOffset; icm.applyHueSatMap = icm.applyHueSatMap && p.icm.applyHueSatMap == other.icm.applyHueSatMap; icm.dcpIlluminant = icm.dcpIlluminant && p.icm.dcpIlluminant == other.icm.dcpIlluminant; - icm.working = icm.working && p.icm.working == other.icm.working; - icm.output = icm.output && p.icm.output == other.icm.output; + icm.workingProfile = icm.workingProfile && p.icm.workingProfile == other.icm.workingProfile; + icm.outputProfile = icm.outputProfile && p.icm.outputProfile == other.icm.outputProfile; icm.outputIntent = icm.outputIntent && p.icm.outputIntent == other.icm.outputIntent; icm.outputBPC = icm.outputBPC && p.icm.outputBPC == other.icm.outputBPC ; - icm.gamma = icm.gamma && p.icm.gamma == other.icm.gamma; - icm.freegamma = icm.freegamma && p.icm.freegamma == other.icm.freegamma; - icm.gampos = icm.gampos && p.icm.gampos == other.icm.gampos; - icm.slpos = icm.slpos && p.icm.slpos == other.icm.slpos; - icm.predx = icm.predx && p.icm.predx == other.icm.predx; - icm.predy = icm.predy && p.icm.predy == other.icm.predy; - icm.pgrex = icm.pgrex && p.icm.pgrex == other.icm.pgrex; - icm.pgrey = icm.pgrey && p.icm.pgrey == other.icm.pgrey; - icm.pblux = icm.pblux && p.icm.pblux == other.icm.pblux; - icm.pbluy = icm.pbluy && p.icm.pbluy == other.icm.pbluy; - icm.gamm = icm.gamm && p.icm.gamm == other.icm.gamm; - icm.slop = icm.slop && p.icm.slop == other.icm.slop; - - icm.wprimaries = icm.wprimaries && p.icm.wprimaries == other.icm.wprimaries; - icm.wprofile = icm.wprofile && p.icm.wprofile == other.icm.wprofile; - icm.wtemp = icm.wtemp && p.icm.wtemp == other.icm.wtemp; - icm.wtrcin = icm.wtrcin && p.icm.wtrcin == other.icm.wtrcin; + icm.outputGammaPreset = icm.outputGammaPreset && p.icm.outputGammaPreset == other.icm.outputGammaPreset; + icm.customOutputProfile = icm.customOutputProfile && p.icm.customOutputProfile == other.icm.customOutputProfile; + icm.workingTRCGamma = icm.workingTRCGamma && p.icm.workingTRCGamma == other.icm.workingTRCGamma; + icm.workingTRCSlope = icm.workingTRCSlope && p.icm.workingTRCSlope == other.icm.workingTRCSlope; + icm.redPrimaryX = icm.redPrimaryX && p.icm.redPrimaryX == other.icm.redPrimaryX; + icm.redPrimaryY = icm.redPrimaryY && p.icm.redPrimaryY == other.icm.redPrimaryY; + icm.greenPrimaryX = icm.greenPrimaryX && p.icm.greenPrimaryX == other.icm.greenPrimaryX; + icm.greenPrimaryY = icm.greenPrimaryY && p.icm.greenPrimaryY == other.icm.greenPrimaryY; + icm.bluePrimaryX = icm.bluePrimaryX && p.icm.bluePrimaryX == other.icm.bluePrimaryX; + icm.bluePrimaryY = icm.bluePrimaryY && p.icm.bluePrimaryY == other.icm.bluePrimaryY; + icm.outputGamma = icm.outputGamma && p.icm.outputGamma == other.icm.outputGamma; + icm.outputSlope = icm.outputSlope && p.icm.outputSlope == other.icm.outputSlope; + icm.outputPrimariesPreset = icm.outputPrimariesPreset && p.icm.outputPimariesPreset == other.icm.outputPimariesPreset; + icm.outputProfileVersion = icm.outputProfileVersion && p.icm.outputProfileVersion == other.icm.outputProfileVersion; + icm.outputIlluminant = icm.outputIlluminant && p.icm.outputIlluminant == other.icm.outputIlluminant; + icm.workingTRC = icm.workingTRC && p.icm.workingTRC == other.icm.workingTRC; raw.bayersensor.method = raw.bayersensor.method && p.raw.bayersensor.method == other.raw.bayersensor.method; raw.bayersensor.imageNum = raw.bayersensor.imageNum && p.raw.bayersensor.imageNum == other.raw.bayersensor.imageNum; raw.bayersensor.ccSteps = raw.bayersensor.ccSteps && p.raw.bayersensor.ccSteps == other.raw.bayersensor.ccSteps; @@ -2409,8 +2408,8 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.resize.enabled = mods.resize.enabled; } - if (icm.input) { - toEdit.icm.input = mods.icm.input; + if (icm.inputProfile) { + toEdit.icm.inputProfile = mods.icm.inputProfile; } if (icm.toneCurve) { @@ -2433,12 +2432,12 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.icm.dcpIlluminant = mods.icm.dcpIlluminant; } - if (icm.working) { - toEdit.icm.working = mods.icm.working; + if (icm.workingProfile) { + toEdit.icm.workingProfile = mods.icm.workingProfile; } - if (icm.output) { - toEdit.icm.output = mods.icm.output; + if (icm.outputProfile) { + toEdit.icm.outputProfile = mods.icm.outputProfile; } if (icm.outputIntent) { @@ -2449,68 +2448,68 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.icm.outputBPC = mods.icm.outputBPC; } - if (icm.gampos) { - toEdit.icm.gampos = dontforceSet && options.baBehav[ADDSET_FREE_OUPUT_GAMMA] ? toEdit.icm.gampos + mods.icm.gampos : mods.icm.gampos; + if (icm.workingTRCGamma) { + toEdit.icm.workingTRCGamma = dontforceSet && options.baBehav[ADDSET_FREE_OUPUT_GAMMA] ? toEdit.icm.workingTRCGamma + mods.icm.workingTRCGamma : mods.icm.workingTRCGamma; } - if (icm.slpos) { - toEdit.icm.slpos = dontforceSet && options.baBehav[ADDSET_FREE_OUTPUT_SLOPE] ? toEdit.icm.slpos + mods.icm.slpos : mods.icm.slpos; + if (icm.workingTRCSlope) { + toEdit.icm.workingTRCSlope = dontforceSet && options.baBehav[ADDSET_FREE_OUTPUT_SLOPE] ? toEdit.icm.workingTRCSlope + mods.icm.workingTRCSlope : mods.icm.workingTRCSlope; } - if (icm.gamm) { - toEdit.icm.gamm = mods.icm.gamm; + if (icm.outputGamma) { + toEdit.icm.outputGamma = mods.icm.outputGamma; } - if (icm.slop) { - toEdit.icm.slop = mods.icm.slop; + if (icm.outputSlope) { + toEdit.icm.outputSlope = mods.icm.outputSlope; } - if (icm.predx) { - toEdit.icm.predx = mods.icm.predx; + if (icm.redPrimaryX) { + toEdit.icm.redPrimaryX = mods.icm.redPrimaryX; } - if (icm.predy) { - toEdit.icm.predy = mods.icm.predy; + if (icm.redPrimaryY) { + toEdit.icm.redPrimaryY = mods.icm.redPrimaryY; } - if (icm.pgrex) { - toEdit.icm.pgrex = mods.icm.pgrex; + if (icm.greenPrimaryX) { + toEdit.icm.greenPrimaryX = mods.icm.greenPrimaryX; } - if (icm.pgrey) { - toEdit.icm.pgrey = mods.icm.pgrey; + if (icm.greenPrimaryY) { + toEdit.icm.greenPrimaryY = mods.icm.greenPrimaryY; } - if (icm.pblux) { - toEdit.icm.pblux = mods.icm.pblux; + if (icm.bluePrimaryX) { + toEdit.icm.bluePrimaryX = mods.icm.bluePrimaryX; } - if (icm.pbluy) { - toEdit.icm.pbluy = mods.icm.pbluy; + if (icm.bluePrimaryY) { + toEdit.icm.bluePrimaryY = mods.icm.bluePrimaryY; } - if (icm.gamma) { - toEdit.icm.gamma = mods.icm.gamma; + if (icm.outputGammaPreset) { + toEdit.icm.outputGammaPreset = mods.icm.outputGammaPreset; } - if (icm.wprimaries) { - toEdit.icm.wprimaries = mods.icm.wprimaries; + if (icm.outputPrimariesPreset) { + toEdit.icm.outputPimariesPreset = mods.icm.outputPimariesPreset; } - if (icm.wprofile) { - toEdit.icm.wprofile = mods.icm.wprofile; + if (icm.outputProfileVersion) { + toEdit.icm.outputProfileVersion = mods.icm.outputProfileVersion; } - if (icm.wtemp) { - toEdit.icm.wtemp = mods.icm.wtemp; + if (icm.outputIlluminant) { + toEdit.icm.outputIlluminant = mods.icm.outputIlluminant; } - if (icm.wtrcin) { - toEdit.icm.wtrcin = mods.icm.wtrcin; + if (icm.workingTRC) { + toEdit.icm.workingTRC = mods.icm.workingTRC; } - if (icm.freegamma) { - toEdit.icm.freegamma = mods.icm.freegamma; + if (icm.customOutputProfile) { + toEdit.icm.customOutputProfile = mods.icm.customOutputProfile; } if (raw.bayersensor.method) { diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 21e9047dc..182a3a2b8 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -575,32 +575,35 @@ class ColorManagementParamsEdited { public: - bool input; + bool inputProfile; bool toneCurve; bool applyLookTable; bool applyBaselineExposureOffset; bool applyHueSatMap; bool dcpIlluminant; - bool working; - bool output; + + bool workingProfile; + bool workingTRC; + bool workingTRCGamma; + bool workingTRCSlope; + + bool outputProfile; bool outputIntent; bool outputBPC; - bool gamma; - bool gampos; - bool slpos; - bool predx; - bool predy; - bool pgrex; - bool pgrey; - bool pblux; - bool pbluy; - bool freegamma; - bool wprimaries; - bool wprofile; - bool wtemp; - bool gamm; - bool slop; - bool wtrcin; + + bool customOutputProfile; + bool outputPrimariesPreset; + bool redPrimaryX; + bool redPrimaryY; + bool greenPrimaryX; + bool greenPrimaryY; + bool bluePrimaryX; + bool bluePrimaryY; + bool outputGammaPreset; + bool outputGamma; + bool outputSlope; + bool outputProfileVersion; + bool outputIlluminant; }; class WaveletParamsEdited { diff --git a/rtgui/ppversion.h b/rtgui/ppversion.h index 1265d9969..265e78bdb 100644 --- a/rtgui/ppversion.h +++ b/rtgui/ppversion.h @@ -1,11 +1,13 @@ #pragma once // This number has to be incremented whenever the PP3 file format is modified or the behaviour of a tool changes -#define PPVERSION 333 +#define PPVERSION 334 #define PPVERSION_AEXP 301 //value of PPVERSION when auto exposure algorithm was modified /* Log of version changes + 334 2018-05-14 + [ICM] enhanced custom output profile 333 2018-04-26 new Shadows/Highlights tool 332 2018-04-18