Merge branch 'dev' into favorites-gui

This commit is contained in:
Lawrence Lee 2023-02-03 21:58:34 -08:00
commit 2982f02328
No known key found for this signature in database
GPG Key ID: 048FF2B76A63895F
39 changed files with 1583 additions and 929 deletions

View File

@ -155,6 +155,7 @@ jobs:
"libpixman-1-0.dll" \ "libpixman-1-0.dll" \
"libpng16-16.dll" \ "libpng16-16.dll" \
"librsvg-2-2.dll" \ "librsvg-2-2.dll" \
"libsharpyuv-0.dll" \
"libsigc-2.0-0.dll" \ "libsigc-2.0-0.dll" \
"libstdc++-6.dll" \ "libstdc++-6.dll" \
"libsystre-0.dll" \ "libsystre-0.dll" \

View File

@ -1414,6 +1414,7 @@ HISTORY_MSG_FILMNEGATIVE_COLORSPACE;Film negative color space
HISTORY_MSG_FILMNEGATIVE_ENABLED;Film Negative HISTORY_MSG_FILMNEGATIVE_ENABLED;Film Negative
HISTORY_MSG_FILMNEGATIVE_REF_SPOT;FN - Reference input HISTORY_MSG_FILMNEGATIVE_REF_SPOT;FN - Reference input
HISTORY_MSG_FILMNEGATIVE_VALUES;Film negative values HISTORY_MSG_FILMNEGATIVE_VALUES;Film negative values
HISTORY_MSG_GAMUTMUNSEL;Gamut-Munsell
HISTORY_MSG_HISTMATCHING;Auto-matched tone curve HISTORY_MSG_HISTMATCHING;Auto-matched tone curve
HISTORY_MSG_HLBL;Color propagation - blur HISTORY_MSG_HLBL;Color propagation - blur
HISTORY_MSG_ICL_LABGRIDCIEXY;Cie xy HISTORY_MSG_ICL_LABGRIDCIEXY;Cie xy
@ -1421,6 +1422,7 @@ HISTORY_MSG_ICM_AINTENT;Abstract profile intent
HISTORY_MSG_ICM_BLUX;Primaries Blue X HISTORY_MSG_ICM_BLUX;Primaries Blue X
HISTORY_MSG_ICM_BLUY;Primaries Blue Y HISTORY_MSG_ICM_BLUY;Primaries Blue Y
HISTORY_MSG_ICM_FBW;Black and White HISTORY_MSG_ICM_FBW;Black and White
HISTORY_MSG_ICM_GAMUT;Gamut control
HISTORY_MSG_ICM_GREX;Primaries Green X HISTORY_MSG_ICM_GREX;Primaries Green X
HISTORY_MSG_ICM_GREY;Primaries Green Y HISTORY_MSG_ICM_GREY;Primaries Green Y
HISTORY_MSG_ICM_OUTPUT_PRIMARIES;Output - Primaries HISTORY_MSG_ICM_OUTPUT_PRIMARIES;Output - Primaries
@ -1440,6 +1442,7 @@ HISTORY_MSG_LOCALCONTRAST_DARKNESS;Local Contrast - Darkness
HISTORY_MSG_LOCALCONTRAST_ENABLED;Local Contrast HISTORY_MSG_LOCALCONTRAST_ENABLED;Local Contrast
HISTORY_MSG_LOCALCONTRAST_LIGHTNESS;Local Contrast - Lightness HISTORY_MSG_LOCALCONTRAST_LIGHTNESS;Local Contrast - Lightness
HISTORY_MSG_LOCALCONTRAST_RADIUS;Local Contrast - Radius HISTORY_MSG_LOCALCONTRAST_RADIUS;Local Contrast - Radius
HISTORY_MSG_LOCAL_GAMUTMUNSEL;Local - Gamut-Munsell
HISTORY_MSG_METADATA_MODE;Metadata copy mode HISTORY_MSG_METADATA_MODE;Metadata copy mode
HISTORY_MSG_MICROCONTRAST_CONTRAST;Microcontrast - Contrast threshold HISTORY_MSG_MICROCONTRAST_CONTRAST;Microcontrast - Contrast threshold
HISTORY_MSG_PDSHARPEN_AUTO_CONTRAST;CS - Auto threshold HISTORY_MSG_PDSHARPEN_AUTO_CONTRAST;CS - Auto threshold
@ -2266,6 +2269,7 @@ TP_COLORAPP_TCMODE_LIGHTNESS;Lightness
TP_COLORAPP_TCMODE_SATUR;Saturation TP_COLORAPP_TCMODE_SATUR;Saturation
TP_COLORAPP_TEMP2_TOOLTIP;Either symmetrical mode temp = White balance.\nEither select illuminant always set Tint=1.\n\nA temp=2856\nD41 temp=4100\nD50 temp=5003\nD55 temp=5503\nD60 temp=6000\nD65 temp=6504\nD75 temp=7504 TP_COLORAPP_TEMP2_TOOLTIP;Either symmetrical mode temp = White balance.\nEither select illuminant always set Tint=1.\n\nA temp=2856\nD41 temp=4100\nD50 temp=5003\nD55 temp=5503\nD60 temp=6000\nD65 temp=6504\nD75 temp=7504
TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD41 temp=4100\nD50 temp=5003\nD55 temp=5503\nD60 temp=6000\nD65 temp=6504\nD75 temp=7504 TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD41 temp=4100\nD50 temp=5003\nD55 temp=5503\nD60 temp=6000\nD65 temp=6504\nD75 temp=7504
TP_COLORAPP_TEMPOUT_TOOLTIP;Temperature and Tint.\nDepending on the choices made previously, the selected temperature is:\nWhite balance\nA temp=2856\nD41 temp=4100\nD50 temp=5003\nD55 temp=5503\nD60 temp=6000\nD65 temp=6504\nD75 temp=7504\nFree.
TP_COLORAPP_TONECIE;Use CIECAM for tone mapping TP_COLORAPP_TONECIE;Use CIECAM for tone mapping
TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect. TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect.
TP_COLORAPP_VIEWINGF_TOOLTIP;Takes into account the support on which the final image will be viewed (monitor, TV, projector, printer, etc.), as well as its environment. This process will take the data coming from process 'Image Adjustments' and 'bring' it to the support in such a way that the viewing conditions and its environment are taken into account. TP_COLORAPP_VIEWINGF_TOOLTIP;Takes into account the support on which the final image will be viewed (monitor, TV, projector, printer, etc.), as well as its environment. This process will take the data coming from process 'Image Adjustments' and 'bring' it to the support in such a way that the viewing conditions and its environment are taken into account.
@ -2535,6 +2539,7 @@ TP_ICM_DCPILLUMINANT;Illuminant
TP_ICM_DCPILLUMINANT_INTERPOLATED;Interpolated TP_ICM_DCPILLUMINANT_INTERPOLATED;Interpolated
TP_ICM_DCPILLUMINANT_TOOLTIP;Select which embedded DCP illuminant to employ. Default is 'interpolated' which is a mix between the two based on white balance. The setting is only available if a dual-illuminant DCP with interpolation support is selected. TP_ICM_DCPILLUMINANT_TOOLTIP;Select which embedded DCP illuminant to employ. Default is 'interpolated' which is a mix between the two based on white balance. The setting is only available if a dual-illuminant DCP with interpolation support is selected.
TP_ICM_FBW;Black-and-White TP_ICM_FBW;Black-and-White
TP_ICM_GAMUT;Gamut control
TP_ICM_ILLUMPRIM_TOOLTIP;Choose the illuminant closest to the shooting conditions.\nChanges can only be made when the 'Destination primaries' selection is set to 'Custom (sliders)'. TP_ICM_ILLUMPRIM_TOOLTIP;Choose the illuminant closest to the shooting conditions.\nChanges can only be made when the 'Destination primaries' selection is set to 'Custom (sliders)'.
TP_ICM_INPUTCAMERA;Camera standard TP_ICM_INPUTCAMERA;Camera standard
TP_ICM_INPUTCAMERAICC;Auto-matched camera profile TP_ICM_INPUTCAMERAICC;Auto-matched camera profile
@ -2612,8 +2617,6 @@ TP_ICM_WORKING_TRC_SRGB;sRGB g=2.4 s=12.92
TP_ICM_WORKING_TRC_TOOLTIP;Only for built-in profiles. TP_ICM_WORKING_TRC_TOOLTIP;Only for built-in profiles.
TP_IMPULSEDENOISE_LABEL;Impulse Noise Reduction TP_IMPULSEDENOISE_LABEL;Impulse Noise Reduction
TP_IMPULSEDENOISE_THRESH;Threshold TP_IMPULSEDENOISE_THRESH;Threshold
TP_LABCURVE_AVOIDCOLORSHIFT;Avoid color shift
TP_LABCURVE_AVOIDCOLORSHIFT_TOOLTIP;Fit colors into gamut of the working color space and apply Munsell correction (Uniform Perceptual Lab).
TP_LABCURVE_BRIGHTNESS;Lightness TP_LABCURVE_BRIGHTNESS;Lightness
TP_LABCURVE_CHROMATICITY;Chromaticity TP_LABCURVE_CHROMATICITY;Chromaticity
TP_LABCURVE_CHROMA_TOOLTIP;To apply B&W toning, set Chromaticity to -100. TP_LABCURVE_CHROMA_TOOLTIP;To apply B&W toning, set Chromaticity to -100.
@ -2678,7 +2681,7 @@ TP_LOCALLAB_ARTIF_TOOLTIP;ΔE scope threshold increases the range of ΔE scope.
TP_LOCALLAB_AUTOGRAY;Auto mean luminance (Yb%) TP_LOCALLAB_AUTOGRAY;Auto mean luminance (Yb%)
TP_LOCALLAB_AUTOGRAYCIE;Auto TP_LOCALLAB_AUTOGRAYCIE;Auto
TP_LOCALLAB_AVOID;Avoid color shift TP_LOCALLAB_AVOID;Avoid color shift
TP_LOCALLAB_AVOIDCOLORSHIFT_TOOLTIP;Fit colors into gamut of the working color space and apply Munsell correction (Uniform Perceptual Lab).\nMunsell correction always disabled when Jz or CAM16 is used. TP_LOCALLAB_AVOIDCOLORSHIFT_TOOLTIP;Fit colors into gamut of the working color space and apply Munsell correction (Uniform Perceptual Lab).\nMunsell correction always disabled when Jz or CAM16 or Color Appearance and Lighting is used.\n\nDefault: Munsell.\nMunsell correction: fixes Lab mode hue drifts due to non-linearity, when chromaticity is changed (Uniform Perceptual Lab).\nLab: applies a gamut control, in relative colorimetric, Munsell is then applied.\nXYZ Absolute, applies gamut control, in absolute colorimetric, Munsell is then applied.\nXYZ Relative, applies gamut control, in relative colorimetric, Munsell is then applied.
TP_LOCALLAB_AVOIDMUN;Munsell correction only TP_LOCALLAB_AVOIDMUN;Munsell correction only
TP_LOCALLAB_AVOIDMUN_TOOLTIP;Munsell correction always disabled when Jz or CAM16 is used. TP_LOCALLAB_AVOIDMUN_TOOLTIP;Munsell correction always disabled when Jz or CAM16 is used.
TP_LOCALLAB_AVOIDRAD;Soft radius TP_LOCALLAB_AVOIDRAD;Soft radius
@ -2908,6 +2911,11 @@ TP_LOCALLAB_GAMM;Gamma
TP_LOCALLAB_GAMMASKCOL;Gamma TP_LOCALLAB_GAMMASKCOL;Gamma
TP_LOCALLAB_GAMMASK_TOOLTIP;Adjusting Gamma and Slope can provide a soft and artifact-free transformation of the mask by progressively modifying 'L' to avoid any discontinuities. TP_LOCALLAB_GAMMASK_TOOLTIP;Adjusting Gamma and Slope can provide a soft and artifact-free transformation of the mask by progressively modifying 'L' to avoid any discontinuities.
TP_LOCALLAB_GAMSH;Gamma TP_LOCALLAB_GAMSH;Gamma
TP_LOCALLAB_GAMUTNON;None
TP_LOCALLAB_GAMUTLABRELA;Lab
TP_LOCALLAB_GAMUTXYZABSO;XYZ Absolute
TP_LOCALLAB_GAMUTXYZRELA;XYZ Relative
TP_LOCALLAB_GAMUTMUNSELL;Munsell only
TP_LOCALLAB_GAMW;Gamma (wavelet pyramids) TP_LOCALLAB_GAMW;Gamma (wavelet pyramids)
TP_LOCALLAB_GRADANG;Gradient angle TP_LOCALLAB_GRADANG;Gradient angle
TP_LOCALLAB_GRADANG_TOOLTIP;Rotation angle in degrees: -180 0 +180. TP_LOCALLAB_GRADANG_TOOLTIP;Rotation angle in degrees: -180 0 +180.

View File

@ -1281,6 +1281,11 @@ menuitem:hover > * {
color: @text-hl-color; color: @text-hl-color;
} }
menu menuitem > radio + * image:not(.dummy),
#MyExpander menu menuitem > radio + * image:not(.dummy) {
margin-left: 1pt;
}
menu image:not(.dummy), menu image:not(.dummy),
#MyExpander menu image:not(.dummy) { #MyExpander menu image:not(.dummy) {
min-height: 2em; min-height: 2em;

View File

@ -383,6 +383,11 @@ menu arrow {
margin: 0 -0.25em 0 0; margin: 0 -0.25em 0 0;
} }
menu menuitem > radio + * image:not(.dummy),
#MyExpander menu menuitem > radio + * image:not(.dummy) {
margin-left: 1pt;
}
menu image:not(.dummy), menu image:not(.dummy),
#MyExpander menu image:not(.dummy) { #MyExpander menu image:not(.dummy) {
min-height: 2em; min-height: 2em;
@ -1029,4 +1034,4 @@ messagedialog headerbar button.titlebutton {
min-height: 1.25em; min-height: 1.25em;
margin: 0; margin: 0;
} }
/*** end ***************************************************************************************/ /*** end ***************************************************************************************/

View File

@ -351,6 +351,11 @@ menu arrow {
margin: 0 -0.25em 0 0; margin: 0 -0.25em 0 0;
} }
menu menuitem > radio + * image:not(.dummy),
#MyExpander menu menuitem > radio + * image:not(.dummy) {
margin-left: 1pt;
}
menu image:not(.dummy), menu image:not(.dummy),
#MyExpander menu image:not(.dummy) { #MyExpander menu image:not(.dummy) {
min-height: 2em; min-height: 2em;

View File

@ -24,6 +24,7 @@
#include "sleef.h" #include "sleef.h"
#include "opthelper.h" #include "opthelper.h"
#include "iccstore.h" #include "iccstore.h"
#include <iostream>
using namespace std; using namespace std;
@ -1910,6 +1911,152 @@ void Color::Lch2Luv(float c, float h, float &u, float &v)
v = c * sincosval.y; v = c * sincosval.y;
} }
void Color::primaries_to_xyz(double p[6], double Wx, double Wz, double *pxyz)
{
//calculate Xr, Xg, Xb, Yr, Yb, Tg, Zr,Zg Zb
double Wy = 1.0;
double Xr = p[0] / p[1];
double Yr = 1.0;
double Zr = (1.0 - p[0] - p[1]) / p[1];
double Xg = p[2] / p[3];
double Yg = 1.0;
double Zg = (1.0 - p[2] - p[3]) / p[3];
double Xb = p[4] / p[5];
double Yb = 1.0;
double Zb = (1.0 - p[4] - p[5]) / p[5];
using Triple = std::array<double, 3>;
using Matrix = std::array<Triple, 3>;
Matrix input_prim;
Matrix inv_input_prim = {};
input_prim[0][0] = Xr;
input_prim[0][1] = Yr;
input_prim[0][2] = Zr;
input_prim[1][0] = Xg;
input_prim[1][1] = Yg;
input_prim[1][2] = Zg;
input_prim[2][0] = Xb;
input_prim[2][1] = Yb;
input_prim[2][2] = Zb;
//invert matrix
if (!rtengine::invertMatrix(input_prim, inv_input_prim)) {
std::cout << "Matrix is not invertible, skipping" << std::endl;
}
//white point D50 used by LCMS
double Wdx = 0.96420;
double Wdy = 1.0;
double Wdz = 0.82490;
double Sr = Wx * inv_input_prim [0][0] + Wy * inv_input_prim [1][0] + Wz * inv_input_prim [2][0];
double Sg = Wx * inv_input_prim [0][1] + Wy * inv_input_prim [1][1] + Wz * inv_input_prim [2][1];
double Sb = Wx * inv_input_prim [0][2] + Wy * inv_input_prim [1][2] + Wz * inv_input_prim [2][2];
//XYZ matrix for primaries and temp
Matrix mat_xyz = {};
mat_xyz[0][0] = Sr * Xr;
mat_xyz[0][1] = Sr * Yr;
mat_xyz[0][2] = Sr * Zr;
mat_xyz[1][0] = Sg * Xg;
mat_xyz[1][1] = Sg * Yg;
mat_xyz[1][2] = Sg * Zg;
mat_xyz[2][0] = Sb * Xb;
mat_xyz[2][1] = Sb * Yb;
mat_xyz[2][2] = Sb * Zb;
//chromatic adaptation Bradford
Matrix MaBradford = {};
MaBradford[0][0] = 0.8951;
MaBradford[0][1] = -0.7502;
MaBradford[0][2] = 0.0389;
MaBradford[1][0] = 0.2664;
MaBradford[1][1] = 1.7135;
MaBradford[1][2] = -0.0685;
MaBradford[2][0] = -0.1614;
MaBradford[2][1] = 0.0367;
MaBradford[2][2] = 1.0296;
Matrix Ma_oneBradford = {};
Ma_oneBradford[0][0] = 0.9869929;
Ma_oneBradford[0][1] = 0.4323053;
Ma_oneBradford[0][2] = -0.0085287;
Ma_oneBradford[1][0] = -0.1470543;
Ma_oneBradford[1][1] = 0.5183603;
Ma_oneBradford[1][2] = 0.0400428;
Ma_oneBradford[2][0] = 0.1599627;
Ma_oneBradford[2][1] = 0.0492912;
Ma_oneBradford[2][2] = 0.9684867;
//R G B source
double Rs = Wx * MaBradford[0][0] + Wy * MaBradford[1][0] + Wz * MaBradford[2][0];
double Gs = Wx * MaBradford[0][1] + Wy * MaBradford[1][1] + Wz * MaBradford[2][1];
double Bs = Wx * MaBradford[0][2] + Wy * MaBradford[1][2] + Wz * MaBradford[2][2];
// R G B destination
double Rd = Wdx * MaBradford[0][0] + Wdy * MaBradford[1][0] + Wdz * MaBradford[2][0];
double Gd = Wdx * MaBradford[0][1] + Wdy * MaBradford[1][1] + Wdz * MaBradford[2][1];
double Bd = Wdx * MaBradford[0][2] + Wdy * MaBradford[1][2] + Wdz * MaBradford[2][2];
//cone destination
Matrix cone_dest_sourc = {};
cone_dest_sourc [0][0] = Rd / Rs;
cone_dest_sourc [0][1] = 0.;
cone_dest_sourc [0][2] = 0.;
cone_dest_sourc [1][0] = 0.;
cone_dest_sourc [1][1] = Gd / Gs;
cone_dest_sourc [1][2] = 0.;
cone_dest_sourc [2][0] = 0.;
cone_dest_sourc [2][1] = 0.;
cone_dest_sourc [2][2] = Bd / Bs;
//cone dest
Matrix cone_ma_one = {};
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
cone_ma_one[i][j] = 0;
for (int k = 0; k < 3; ++k) {
cone_ma_one[i][j] += cone_dest_sourc [i][k] * Ma_oneBradford[k][j];
}
}
}
//generate adaptation bradford matrix
Matrix adapt_chroma = {};
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
adapt_chroma [i][j] = 0;
for (int k = 0; k < 3; ++k) {
adapt_chroma[i][j] += MaBradford[i][k] * cone_ma_one[k][j];
}
}
}
Matrix mat_xyz_brad = {};
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
mat_xyz_brad[i][j] = 0;
for (int k = 0; k < 3; ++k) {
mat_xyz_brad[i][j] += mat_xyz[i][k] * adapt_chroma[k][j];
}
}
}
//push result in pxyz
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
pxyz[i * 3 + j] = mat_xyz_brad[i][j];
}
}
}
/* /*
* Gamut mapping algorithm * Gamut mapping algorithm
@ -1931,13 +2078,19 @@ void Color::Lch2Luv(float c, float h, float &u, float &v)
* columns of the matrix p=xyz_rgb are RGB tristimulus primaries in XYZ * columns of the matrix p=xyz_rgb are RGB tristimulus primaries in XYZ
* c is the color fixed on the boundary; and m=0 for c=0, m=1 for c=255 * c is the color fixed on the boundary; and m=0 for c=0, m=1 for c=255
*/ */
void Color::gamutmap(float &X, float Y, float &Z, const double p[3][3]) void Color::gamutmap(float &X, float Y, float &Z, const double p[3][3])
{ {
float u = 4 * X / (X + 15 * Y + 3 * Z) - u0; float epsil = 0.0001f;
float v = 9 * Y / (X + 15 * Y + 3 * Z) - v0; float intermXYZ = X + 15 * Y + 3 * Z;
if(intermXYZ <= 0.f) {
intermXYZ = epsil;
}
float u = 4 * X / (intermXYZ) - u0;
float v = 9 * Y / (intermXYZ) - v0;
float lam[3][2]; float lam[3][2];
float lam_min = 1.0; float lam_min = 1.0f;
for (int c = 0; c < 3; c++) for (int c = 0; c < 3; c++)
for (int m = 0; m < 2; m++) { for (int m = 0; m < 2; m++) {
@ -1955,17 +2108,24 @@ void Color::gamutmap(float &X, float Y, float &Z, const double p[3][3])
p[0][c] * (5 * Y * p[1][c1] + m * 65535 * p[1][c1] * p[2][c2] + Y * p[2][c1] - m * 65535 * p[1][c2] * p[2][c1]) + p[0][c] * (5 * Y * p[1][c1] + m * 65535 * p[1][c1] * p[2][c2] + Y * p[2][c1] - m * 65535 * p[1][c2] * p[2][c1]) +
m * 65535 * p[0][c2] * (p[1][c1] * p[2][c] - p[1][c] * p[2][c1]))); m * 65535 * p[0][c2] * (p[1][c1] * p[2][c] - p[1][c] * p[2][c1])));
if (lam[c][m] < lam_min && lam[c][m] > 0) { if (lam[c][m] < lam_min && lam[c][m] > 0.f) {
lam_min = lam[c][m]; lam_min = lam[c][m];
} }
} }
u = u * lam_min + u0; u = u * (double) lam_min + u0;
v = v * lam_min + v0; v = v * (double) lam_min + v0;
X = (9 * u * Y) / (4 * v); X = (9 * u * Y) / (4 * v);
Z = (12 - 3 * u - 20 * v) * Y / (4 * v); float intermuv = 12 - 3 * u - 20 * v;
if(intermuv < 0.f) {
intermuv = 0.f;
}
Z = (intermuv) * Y / (4 * v);
} }
void Color::skinredfloat ( float J, float h, float sres, float Sp, float dred, float protect_red, int sk, float rstprotection, float ko, float &s) void Color::skinredfloat ( float J, float h, float sres, float Sp, float dred, float protect_red, int sk, float rstprotection, float ko, float &s)

View File

@ -1847,6 +1847,13 @@ static inline void Lab2XYZ(vfloat L, vfloat a, vfloat b, vfloat &x, vfloat &y, v
*/ */
static void gamutmap(float &X, float Y, float &Z, const double p[3][3]); static void gamutmap(float &X, float Y, float &Z, const double p[3][3]);
/**
* @brief Convert primaries in XYZ values in function of illuminant
* @param p primaries red, gree, blue
* @param Wx Wy white for illuminant
* @param pxyz return matrix XYZ
*/
static void primaries_to_xyz (double p[6], double Wx, double Wz, double *pxyz);
/** /**
* @brief Get HSV's hue from the Lab's hue * @brief Get HSV's hue from the Lab's hue

View File

@ -19,6 +19,7 @@
#pragma once #pragma once
#include <cstdint>
#include <iostream> #include <iostream>
#include "myfile.h" #include "myfile.h"

View File

@ -1913,7 +1913,9 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
adap = pow(2.0, E_V - 3.0); // cd / m2 adap = pow(2.0, E_V - 3.0); // cd / m2
// end calculation adaptation scene luminosity // end calculation adaptation scene luminosity
} }
if(params->colorappearance.catmethod == "symg") {//force abolute luminance scenescene to 400 in symmetric
adap = 400.;
}
float d, dj, yb; float d, dj, yb;
bool execsharp = false; bool execsharp = false;
@ -1935,24 +1937,60 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
CAMBrightCurveQ.dirty = true; CAMBrightCurveQ.dirty = true;
ipf.ciecam_02float(ncie, float (adap), pW, 2, nprevl, params.get(), customColCurve1, customColCurve2, customColCurve3, histLCAM, histCCAM, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 0, scale, execsharp, d, dj, yb, 1); ipf.ciecam_02float(ncie, float (adap), pW, 2, nprevl, params.get(), customColCurve1, customColCurve2, customColCurve3, histLCAM, histCCAM, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 0, scale, execsharp, d, dj, yb, 1);
//call listener
if ((params->colorappearance.autodegree || params->colorappearance.autodegreeout) && acListener && params->colorappearance.enabled && !params->colorappearance.presetcat02) { if ((params->colorappearance.autodegree || params->colorappearance.autodegreeout) && acListener && params->colorappearance.enabled) {
acListener->autoCamChanged(100.* (double)d, 100.* (double)dj); if(params->colorappearance.catmethod == "symg") {//force chromatic adaptation to 90 in symmetric
d = 0.9;
dj = 0.9;
}
acListener->autoCamChanged(100.* (double)d, 100.* (double)dj);
} }
if (params->colorappearance.autoadapscen && acListener && params->colorappearance.enabled && !params->colorappearance.presetcat02) { if (params->colorappearance.autoadapscen && acListener && params->colorappearance.enabled) {
acListener->adapCamChanged(adap); //real value of adapt scene acListener->adapCamChanged(adap); //real value of adapt scene, force to 400 in symmetric
} }
if (params->colorappearance.autoybscen && acListener && params->colorappearance.enabled && !params->colorappearance.presetcat02) { if (params->colorappearance.autoybscen && acListener && params->colorappearance.enabled) {
if(params->colorappearance.catmethod == "symg") {//force yb scene to 18 in symmetric
yb = 18;
}
acListener->ybCamChanged((int) yb); //real value Yb scene acListener->ybCamChanged((int) yb); //real value Yb scene
} }
double tempsym = 5003.;
// if (params->colorappearance.enabled && params->colorappearance.presetcat02 && params->colorappearance.autotempout) { int wmodel = 0;//wmodel allows - arbitrary - choice of illuminant and temp with choice
// if (params->colorappearance.enabled && params->colorappearance.presetcat02) { if (params->colorappearance.wbmodel == "RawT") {
// acListener->wbCamChanged(params->wb.temperature, params->wb.green); //real temp and tint wmodel = 0;
// acListener->wbCamChanged(params->wb.temperature, 1.f); //real temp and tint = 1. } else if (params->colorappearance.wbmodel == "RawTCAT02") {
// } wmodel = 1;
} else if (params->colorappearance.wbmodel == "free") {
wmodel = 2;//force white balance in symmetric
}
if(params->colorappearance.catmethod == "symg" && wmodel == 2) {
tempsym = params->wb.temperature;//force white balance in symmetric
} else {
if (params->colorappearance.illum == "iA") {//otherwise force illuminant source
tempsym = 2856.;
} else if (params->colorappearance.illum == "i41") {
tempsym = 4100.;
} else if (params->colorappearance.illum == "i50") {
tempsym = 5003.;
} else if (params->colorappearance.illum == "i55") {
tempsym = 5503.;
} else if (params->colorappearance.illum == "i60") {
tempsym = 6000. ;
} else if (params->colorappearance.illum == "i65") {
tempsym = 6504.;
} else if (params->colorappearance.illum == "i75") {
tempsym = 7504.;
} else if (params->colorappearance.illum == "ifree") {
tempsym = params->wb.temperature;//force white balance in symmetric
}
}
if (params->colorappearance.enabled && params->colorappearance.autotempout) {
acListener->wbCamChanged(tempsym, 1.f); //real temp and tint = 1.
}
} else { } else {
// CIECAM is disabled, we free up its image buffer to save some space // CIECAM is disabled, we free up its image buffer to save some space

File diff suppressed because it is too large Load Diff

View File

@ -257,7 +257,7 @@ enum class BlurType {
int shortcu, bool delt, const float hueref, const float chromaref, const float lumaref, int shortcu, bool delt, const float hueref, const float chromaref, const float lumaref,
float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope, bool fftt, float blu_ma, float cont_ma, int indic, float &fab); float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope, bool fftt, float blu_ma, float cont_ma, int indic, float &fab);
void avoidcolshi(const struct local_params& lp, int sp, LabImage * original, LabImage *transformed, int cy, int cx, int sk); void avoidcolshi(const struct local_params& lp, int sp, LabImage *transformed, LabImage *reserved, int cy, int cx, int sk);
void deltaEforMask(float **rdE, int bfw, int bfh, LabImage* bufcolorig, const float hueref, const float chromaref, const float lumaref, void deltaEforMask(float **rdE, int bfw, int bfh, LabImage* bufcolorig, const float hueref, const float chromaref, const float lumaref,
float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope, float balance, float balanceh); float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope, float balance, float balanceh);

View File

@ -416,6 +416,8 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
{ {
const TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(params->icm.workingProfile); const TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(params->icm.workingProfile);
double wprofprim[3][3];//store primaries to XYZ
bool gamutcontrol = params->icm.gamut;
const float toxyz[3][3] = { const float toxyz[3][3] = {
{ {
static_cast<float>(wprof[0][0] / ((normalizeIn ? 65535.0 : 1.0))), //I have suppressed / Color::D50x static_cast<float>(wprof[0][0] / ((normalizeIn ? 65535.0 : 1.0))), //I have suppressed / Color::D50x
@ -440,57 +442,64 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
if (settings->verbose) { if (settings->verbose) {
printf("profile not accepted\n"); printf("profile not accepted\n");
} }
return; return;
} }
if (mul == -5 && gampos == 2.4 && slpos == 12.92310) {//must be change if we change settings RT sRGB if (mul == -5 && gampos == 2.4 && slpos == 12.92310) {//must be change if we change settings RT sRGB
//only in this case we can shortcut..all process..no gamut control..because we reduce...leads to very small differences, but big speedup //only in this case we can shortcut..all process..no gamut control..because we reduce...leads to very small differences, but big speedup
#ifdef _OPENMP #ifdef _OPENMP
#pragma omp parallel for schedule(dynamic, 16) if (multiThread) #pragma omp parallel for schedule(dynamic, 16) if (multiThread)
#endif #endif
for (int i = 0; i < ch; ++i) for (int i = 0; i < ch; ++i)
for (int j = 0; j < cw; ++j) { for (int j = 0; j < cw; ++j) {
float r = src->r(i, j); float r = src->r(i, j);
float g = src->g(i, j); float g = src->g(i, j);
float b = src->b(i, j); float b = src->b(i, j);
r = (Color::igammatab_srgb[r]) / 65535.f; r = (Color::igammatab_srgb[r]) / 65535.f;
g = (Color::igammatab_srgb[g]) / 65535.f; g = (Color::igammatab_srgb[g]) / 65535.f;
b = (Color::igammatab_srgb[b]) / 65535.f; b = (Color::igammatab_srgb[b]) / 65535.f;
dst->r(i, j) = r; dst->r(i, j) = r;
dst->g(i, j) = g; dst->g(i, j) = g;
dst->b(i, j) = b; dst->b(i, j) = b;
} }
return;
return;
} }
if (mul == 1 ||(params->icm.wprim == ColorManagementParams::Primaries::DEFAULT && params->icm.will == ColorManagementParams::Illuminant::DEFAULT)) {//shortcut and speedup when no call primaries and illuminant - no gamut control...in this case be careful if (mul == 1 || (params->icm.wprim == ColorManagementParams::Primaries::DEFAULT && params->icm.will == ColorManagementParams::Illuminant::DEFAULT)) { //shortcut and speedup when no call primaries and illuminant - no gamut control...in this case be careful
GammaValues g_a; //gamma parameters GammaValues g_a; //gamma parameters
double pwr = 1.0 / static_cast<double>(gampos); double pwr = 1.0 / static_cast<double>(gampos);
Color::calcGamma(pwr, slpos, g_a); // call to calcGamma with selected gamma and slope Color::calcGamma(pwr, slpos, g_a); // call to calcGamma with selected gamma and slope
#ifdef _OPENMP #ifdef _OPENMP
# pragma omp parallel for schedule(dynamic,16) if (multiThread) # pragma omp parallel for schedule(dynamic,16) if (multiThread)
#endif #endif
for (int y = 0; y < ch; ++y) { for (int y = 0; y < ch; ++y) {
int x = 0; int x = 0;
#ifdef __SSE2__ #ifdef __SSE2__
for (; x < cw - 3; x += 4) { for (; x < cw - 3; x += 4) {
STVFU(dst->r(y,x), F2V(65536.f) * gammalog(LVFU(src->r(y,x)), F2V(gampos), F2V(slpos), F2V(g_a[3]), F2V(g_a[4]))); STVFU(dst->r(y, x), F2V(65536.f) * gammalog(LVFU(src->r(y, x)), F2V(gampos), F2V(slpos), F2V(g_a[3]), F2V(g_a[4])));
STVFU(dst->g(y,x), F2V(65536.f) * gammalog(LVFU(src->g(y,x)), F2V(gampos), F2V(slpos), F2V(g_a[3]), F2V(g_a[4]))); STVFU(dst->g(y, x), F2V(65536.f) * gammalog(LVFU(src->g(y, x)), F2V(gampos), F2V(slpos), F2V(g_a[3]), F2V(g_a[4])));
STVFU(dst->b(y,x), F2V(65536.f) * gammalog(LVFU(src->b(y,x)), F2V(gampos), F2V(slpos), F2V(g_a[3]), F2V(g_a[4]))); STVFU(dst->b(y, x), F2V(65536.f) * gammalog(LVFU(src->b(y, x)), F2V(gampos), F2V(slpos), F2V(g_a[3]), F2V(g_a[4])));
} }
#endif #endif
for (; x < cw; ++x) { for (; x < cw; ++x) {
dst->r(y,x) = 65536.f * gammalog(src->r(y,x), gampos, slpos, g_a[3], g_a[4]); dst->r(y, x) = 65536.f * gammalog(src->r(y, x), gampos, slpos, g_a[3], g_a[4]);
dst->g(y,x) = 65536.f * gammalog(src->g(y,x), gampos, slpos, g_a[3], g_a[4]); dst->g(y, x) = 65536.f * gammalog(src->g(y, x), gampos, slpos, g_a[3], g_a[4]);
dst->b(y,x) = 65536.f * gammalog(src->b(y,x), gampos, slpos, g_a[3], g_a[4]); dst->b(y, x) = 65536.f * gammalog(src->b(y, x), gampos, slpos, g_a[3], g_a[4]);
} }
} }
return; return;
} }
float redxx = params->icm.redx; float redxx = params->icm.redx;
float redyy = params->icm.redy; float redyy = params->icm.redy;
@ -498,6 +507,7 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
float bluyy = params->icm.bluy; float bluyy = params->icm.bluy;
float grexx = params->icm.grex; float grexx = params->icm.grex;
float greyy = params->icm.grey; float greyy = params->icm.grey;
float epsil = 0.0001f;
if (prim == 12) {//convert datas area to xy if (prim == 12) {//convert datas area to xy
float redgraphx = params->icm.labgridcieALow; float redgraphx = params->icm.labgridcieALow;
@ -519,11 +529,34 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
greyy = 0.55f * (gregraphy + 1.f) - 0.1f; greyy = 0.55f * (gregraphy + 1.f) - 0.1f;
greyy = rtengine::LIM(greyy, 0.5f, 1.f); greyy = rtengine::LIM(greyy, 0.5f, 1.f);
} }
//fixed crash when there is no space or too small..just a line...Possible if bx, by aligned with Gx,Gy Rx,Ry //fixed crash when there is no space or too small..just a line...Possible if bx, by aligned with Gx,Gy Rx,Ry
float ac = (greyy - redyy) / (grexx - redxx); //fix crash if user select 0 for redyy, bluyy, greyy
if (redyy == 0.f) {
redyy = epsil;
}
if (bluyy == 0.f) {
bluyy = epsil;
}
if (greyy == 0.f) {
greyy = epsil;
}
//fix crash if grexx - redxx = 0
float grered = 1.f;
grered = grexx - redxx;
if (grered == 0.f) {
grered = epsil;
}
float ac = (greyy - redyy) / grered;
float bc = greyy - ac * grexx; float bc = greyy - ac * grexx;
float yc = ac * bluxx + bc; float yc = ac * bluxx + bc;
if ((bluyy < yc + 0.0004f) && (bluyy > yc - 0.0004f)) {//under 0.0004 in some case crash because space too small
if ((bluyy < yc + 0.0004f) && (bluyy > yc - 0.0004f)) { //under 0.0004 in some case crash because space too small
return; return;
} }
@ -564,7 +597,6 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
} }
case ColorManagementParams::Primaries::ACES_P0: { case ColorManagementParams::Primaries::ACES_P0: {
profile = "ACESp0";
break; break;
} }
@ -593,11 +625,13 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
break; break;
} }
} }
if (settings->verbose && prim != 0) { if (settings->verbose && prim != 0) {
printf("prim=%i Profile Destination=%s\n", prim, profile.c_str()); printf("prim=%i Profile Destination=%s\n", prim, profile.c_str());
} }
cmsHTRANSFORM hTransform = nullptr; cmsHTRANSFORM hTransform = nullptr;
if (transform) { if (transform) {
hTransform = transform; hTransform = transform;
} else { } else {
@ -622,7 +656,9 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
}; };
double tempv4 = 5003.; double tempv4 = 5003.;
float p[6]; //primaries double p[6]; //primaries
double Wx = 1.0;
double Wz = 1.0;
//primaries for 10 working profiles ==> output profiles //primaries for 10 working profiles ==> output profiles
if (profile == "WideGamut") { if (profile == "WideGamut") {
@ -633,6 +669,9 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
p[4] = 0.1570; p[4] = 0.1570;
p[5] = 0.0180; p[5] = 0.0180;
illum = toUnderlying(ColorManagementParams::Illuminant::D50); illum = toUnderlying(ColorManagementParams::Illuminant::D50);
Wx = 0.964295676;
Wz = 0.825104603;
} else if (profile == "Adobe RGB") { } else if (profile == "Adobe RGB") {
p[0] = 0.6400; //Adobe primaries p[0] = 0.6400; //Adobe primaries
p[1] = 0.3300; p[1] = 0.3300;
@ -642,6 +681,9 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
p[5] = 0.0600; p[5] = 0.0600;
tempv4 = 6504.; tempv4 = 6504.;
illum = toUnderlying(ColorManagementParams::Illuminant::D65); illum = toUnderlying(ColorManagementParams::Illuminant::D65);
Wx = 0.95045471;
Wz = 1.08905029;
} else if (profile == "sRGB") { } else if (profile == "sRGB") {
p[0] = 0.6400; // sRGB primaries p[0] = 0.6400; // sRGB primaries
p[1] = 0.3300; p[1] = 0.3300;
@ -651,6 +693,9 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
p[5] = 0.0600; p[5] = 0.0600;
tempv4 = 6504.; tempv4 = 6504.;
illum = toUnderlying(ColorManagementParams::Illuminant::D65); illum = toUnderlying(ColorManagementParams::Illuminant::D65);
Wx = 0.95045471;
Wz = 1.08905029;
} else if (profile == "BruceRGB") { } else if (profile == "BruceRGB") {
p[0] = 0.6400; // Bruce primaries p[0] = 0.6400; // Bruce primaries
p[1] = 0.3300; p[1] = 0.3300;
@ -660,7 +705,10 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
p[5] = 0.0600; p[5] = 0.0600;
tempv4 = 6504.; tempv4 = 6504.;
illum = toUnderlying(ColorManagementParams::Illuminant::D65); illum = toUnderlying(ColorManagementParams::Illuminant::D65);
} else if (profile == "Beta RGB") { Wx = 0.95045471;
Wz = 1.08905029;
} else if (profile == "Beta RGB") {
p[0] = 0.6888; // Beta primaries p[0] = 0.6888; // Beta primaries
p[1] = 0.3112; p[1] = 0.3112;
p[2] = 0.1986; p[2] = 0.1986;
@ -668,6 +716,9 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
p[4] = 0.1265; p[4] = 0.1265;
p[5] = 0.0352; p[5] = 0.0352;
illum = toUnderlying(ColorManagementParams::Illuminant::D50); illum = toUnderlying(ColorManagementParams::Illuminant::D50);
Wx = 0.964295676;
Wz = 0.825104603;
} else if (profile == "BestRGB") { } else if (profile == "BestRGB") {
p[0] = 0.7347; // Best primaries p[0] = 0.7347; // Best primaries
p[1] = 0.2653; p[1] = 0.2653;
@ -676,6 +727,9 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
p[4] = 0.1300; p[4] = 0.1300;
p[5] = 0.0350; p[5] = 0.0350;
illum = toUnderlying(ColorManagementParams::Illuminant::D50); illum = toUnderlying(ColorManagementParams::Illuminant::D50);
Wx = 0.964295676;
Wz = 0.825104603;
} else if (profile == "Rec2020") { } else if (profile == "Rec2020") {
p[0] = 0.7080; // Rec2020 primaries p[0] = 0.7080; // Rec2020 primaries
p[1] = 0.2920; p[1] = 0.2920;
@ -685,6 +739,9 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
p[5] = 0.0460; p[5] = 0.0460;
tempv4 = 6504.; tempv4 = 6504.;
illum = toUnderlying(ColorManagementParams::Illuminant::D65); illum = toUnderlying(ColorManagementParams::Illuminant::D65);
Wx = 0.95045471;
Wz = 1.08905029;
} else if (profile == "ACESp0") { } else if (profile == "ACESp0") {
p[0] = 0.7347; // ACES P0 primaries p[0] = 0.7347; // ACES P0 primaries
p[1] = 0.2653; p[1] = 0.2653;
@ -694,6 +751,9 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
p[5] = -0.0770; p[5] = -0.0770;
tempv4 = 6004.; tempv4 = 6004.;
illum = toUnderlying(ColorManagementParams::Illuminant::D60); illum = toUnderlying(ColorManagementParams::Illuminant::D60);
Wx = 0.952646075;
Wz = 1.008825184;
} else if (profile == "ACESp1") { } else if (profile == "ACESp1") {
p[0] = 0.713; // ACES P1 primaries p[0] = 0.713; // ACES P1 primaries
p[1] = 0.293; p[1] = 0.293;
@ -703,6 +763,9 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
p[5] = 0.044; p[5] = 0.044;
tempv4 = 6004.; tempv4 = 6004.;
illum = toUnderlying(ColorManagementParams::Illuminant::D60); illum = toUnderlying(ColorManagementParams::Illuminant::D60);
Wx = 0.952646075;
Wz = 1.008825184;
} else if (profile == "ProPhoto") { } else if (profile == "ProPhoto") {
p[0] = 0.7347; //ProPhoto and default primaries p[0] = 0.7347; //ProPhoto and default primaries
p[1] = 0.2653; p[1] = 0.2653;
@ -711,8 +774,11 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
p[4] = 0.0366; p[4] = 0.0366;
p[5] = 0.0001; p[5] = 0.0001;
illum = toUnderlying(ColorManagementParams::Illuminant::D50); illum = toUnderlying(ColorManagementParams::Illuminant::D50);
Wx = 0.964295676;
Wz = 0.825104603;
} else if (profile == "Custom") { } else if (profile == "Custom") {
p[0] = redxx; p[0] = redxx;
p[1] = redyy; p[1] = redyy;
p[2] = grexx; p[2] = grexx;
p[3] = greyy; p[3] = greyy;
@ -743,11 +809,13 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
gammaParams[3] = 1. / slpos; gammaParams[3] = 1. / slpos;
gammaParams[5] = 0.0; gammaParams[5] = 0.0;
gammaParams[6] = 0.0; gammaParams[6] = 0.0;
// printf("ga0=%f ga1=%f ga2=%f ga3=%f ga4=%f\n", ga0, ga1, ga2, ga3, ga4); // printf("ga0=%f ga1=%f ga2=%f ga3=%f ga4=%f\n", ga0, ga1, ga2, ga3, ga4);
// 7 parameters for smoother curves // 7 parameters for smoother curves
cmsCIExyY xyD; cmsCIExyY xyD;
Glib::ustring ills = "D50"; Glib::ustring ills = "D50";
switch (ColorManagementParams::Illuminant(illum)) { switch (ColorManagementParams::Illuminant(illum)) {
case ColorManagementParams::Illuminant::DEFAULT: case ColorManagementParams::Illuminant::DEFAULT:
case ColorManagementParams::Illuminant::STDA: case ColorManagementParams::Illuminant::STDA:
@ -802,55 +870,95 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
cmsWhitePointFromTemp(&xyD, tempv4); cmsWhitePointFromTemp(&xyD, tempv4);
switch (ColorManagementParams::Illuminant(illum)) { switch (ColorManagementParams::Illuminant(illum)) {
case ColorManagementParams::Illuminant::DEFAULT: case ColorManagementParams::Illuminant::DEFAULT: {
case ColorManagementParams::Illuminant::D55: break;
}
case ColorManagementParams::Illuminant::D55: {
Wx = 0.956565934;
Wz = 0.920253249;
break;
}
case ColorManagementParams::Illuminant::D80: { case ColorManagementParams::Illuminant::D80: {
Wx = 0.950095542;
Wz = 1.284213976;
break; break;
} }
case ColorManagementParams::Illuminant::D41: { case ColorManagementParams::Illuminant::D41: {
Wx = 0.991488263;
Wz = 0.631604625;
break; break;
} }
case ColorManagementParams::Illuminant::D50: { case ColorManagementParams::Illuminant::D50: {
xyD = {0.3457, 0.3585, 1.0}; // near LCMS values but not perfect... it's a compromise!! xyD = {0.3457, 0.3585, 1.0}; // near LCMS values but not perfect... it's a compromise!!
Wx = 0.964295676;
Wz = 0.825104603;
break; break;
} }
case ColorManagementParams::Illuminant::D60: { case ColorManagementParams::Illuminant::D60: {
Wx = 0.952646075;
Wz = 1.008825184;
xyD = {0.32168, 0.33767, 1.0}; xyD = {0.32168, 0.33767, 1.0};
break; break;
} }
case ColorManagementParams::Illuminant::D65: { case ColorManagementParams::Illuminant::D65: {
Wx = 0.95045471;
Wz = 1.08905029;
xyD = {0.312700492, 0.329000939, 1.0}; xyD = {0.312700492, 0.329000939, 1.0};
break; break;
} }
case ColorManagementParams::Illuminant::D120: { case ColorManagementParams::Illuminant::D120: {
Wx = 0.979182;
Wz = 1.623623;
xyD = {0.269669, 0.28078, 1.0}; xyD = {0.269669, 0.28078, 1.0};
break; break;
} }
case ColorManagementParams::Illuminant::STDA: { case ColorManagementParams::Illuminant::STDA: {
Wx = 1.098500393;
Wz = 0.355848714;
xyD = {0.447573, 0.407440, 1.0}; xyD = {0.447573, 0.407440, 1.0};
ills = "stdA 2875K"; ills = "stdA 2875K";
break; break;
} }
case ColorManagementParams::Illuminant::TUNGSTEN_2000K: { case ColorManagementParams::Illuminant::TUNGSTEN_2000K: {
Wx = 1.274335;
Wz = 0.145233;
xyD = {0.526591, 0.41331, 1.0}; xyD = {0.526591, 0.41331, 1.0};
ills = "Tungsten 2000K"; ills = "Tungsten 2000K";
break; break;
} }
case ColorManagementParams::Illuminant::TUNGSTEN_1500K: { case ColorManagementParams::Illuminant::TUNGSTEN_1500K: {
Wx = 1.489921;
Wz = 0.053826;
xyD = {0.585703, 0.393157, 1.0}; xyD = {0.585703, 0.393157, 1.0};
ills = "Tungsten 1500K"; ills = "Tungsten 1500K";
break; break;
} }
} }
double wprofpri[9];
if (gamutcontrol) {
//xyz in functiuon primaries and illuminant
Color::primaries_to_xyz(p, Wx, Wz, wprofpri);
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
wprofprim[i][j] = (double) wprofpri[j * 3 + i];
//xyz in TMatrix format
}
}
}
//D41 0.377984 0.381229 //D41 0.377984 0.381229
//D55 0.332424 0.347426 //D55 0.332424 0.347426
//D80 0.293755 0.309185 //D80 0.293755 0.309185
@ -869,7 +977,7 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
cmsWriteTag(oprofdef, cmsSigGreenTRCTag, GammaTRC[1]); cmsWriteTag(oprofdef, cmsSigGreenTRCTag, GammaTRC[1]);
cmsWriteTag(oprofdef, cmsSigBlueTRCTag, GammaTRC[2]); cmsWriteTag(oprofdef, cmsSigBlueTRCTag, GammaTRC[2]);
//to read XYZ values and illuminant //to read XYZ values and illuminant
if (rtengine::settings->verbose) { if (rtengine::settings->verbose) {
cmsCIEXYZ *redT = static_cast<cmsCIEXYZ*>(cmsReadTag(oprofdef, cmsSigRedMatrixColumnTag)); cmsCIEXYZ *redT = static_cast<cmsCIEXYZ*>(cmsReadTag(oprofdef, cmsSigRedMatrixColumnTag));
cmsCIEXYZ *greenT = static_cast<cmsCIEXYZ*>(cmsReadTag(oprofdef, cmsSigGreenMatrixColumnTag)); cmsCIEXYZ *greenT = static_cast<cmsCIEXYZ*>(cmsReadTag(oprofdef, cmsSigGreenMatrixColumnTag));
@ -881,6 +989,7 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
} }
cmsFreeToneCurve(GammaTRC[0]); cmsFreeToneCurve(GammaTRC[0]);
if (oprofdef) { if (oprofdef) {
constexpr cmsUInt32Number flags = cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE | cmsFLAGS_BLACKPOINTCOMPENSATION | cmsFLAGS_GAMUTCHECK; constexpr cmsUInt32Number flags = cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE | cmsFLAGS_BLACKPOINTCOMPENSATION | cmsFLAGS_GAMUTCHECK;
const cmsHPROFILE iprof = ICCStore::getInstance()->getXYZProfile(); const cmsHPROFILE iprof = ICCStore::getInstance()->getXYZProfile();
@ -889,7 +998,10 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
lcmsMutex->unlock(); lcmsMutex->unlock();
} }
} }
if (hTransform) { if (hTransform) {
#ifdef _OPENMP #ifdef _OPENMP
#pragma omp parallel if (multiThread) #pragma omp parallel if (multiThread)
#endif #endif
@ -901,19 +1013,30 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
#pragma omp for schedule(dynamic, 16) nowait #pragma omp for schedule(dynamic, 16) nowait
#endif #endif
for (int i = 0; i < ch; ++i) { for (int i = 0; i < ch; ++i)
{
float *p = pBuf.data; float *p = pBuf.data;
for (int j = 0; j < cw; ++j) { for (int j = 0; j < cw; ++j) {
const float r = src->r(i, j); const float r = src->r(i, j);
const float g = src->g(i, j); const float g = src->g(i, j);
const float b = src->b(i, j); const float b = src->b(i, j);
float X = toxyz[0][0] * r + toxyz[0][1] * g + toxyz[0][2] * b;
float Y = toxyz[1][0] * r + toxyz[1][1] * g + toxyz[1][2] * b;
float Z = toxyz[2][0] * r + toxyz[2][1] * g + toxyz[2][2] * b;
*(p++) = toxyz[0][0] * r + toxyz[0][1] * g + toxyz[0][2] * b; if (gamutcontrol) {
*(p++) = toxyz[1][0] * r + toxyz[1][1] * g + toxyz[1][2] * b; Color::gamutmap(X, Y, Z, wprofprim);//gamut control
*(p++) = toxyz[2][0] * r + toxyz[2][1] * g + toxyz[2][2] * b; }
*(p++) = X;
*(p++) = Y;
*(p++) = Z;
} }
p = pBuf.data; p = pBuf.data;
cmsDoTransform(hTransform, p, p, cw); cmsDoTransform(hTransform, p, p, cw);
for (int j = 0; j < cw; ++j) { for (int j = 0; j < cw; ++j) {
dst->r(i, j) = *(p++) * normalize; dst->r(i, j) = *(p++) * normalize;
dst->g(i, j) = *(p++) * normalize; dst->g(i, j) = *(p++) * normalize;
@ -921,10 +1044,12 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
} }
} }
} }
if (!keepTransForm) { if (!keepTransForm) {
cmsDeleteTransform(hTransform); cmsDeleteTransform(hTransform);
hTransform = nullptr; hTransform = nullptr;
} }
transform = hTransform; transform = hTransform;
} }
} }

View File

@ -12540,12 +12540,31 @@ void ImProcFunctions::clarimerge(const struct local_params& lp, float &mL, float
} }
} }
void ImProcFunctions::avoidcolshi(const struct local_params& lp, int sp, LabImage * original, LabImage *transformed, int cy, int cx, int sk) void ImProcFunctions::avoidcolshi(const struct local_params& lp, int sp, LabImage *transformed, LabImage *reserved, int cy, int cx, int sk)
{ {
if (params->locallab.spots.at(sp).avoid && lp.islocal) { int avoidgamut = 0;
if (params->locallab.spots.at(sp).avoidgamutMethod == "NONE") {
avoidgamut = 0;
} else if (params->locallab.spots.at(sp).avoidgamutMethod == "LAB") {
avoidgamut = 1;
} else if (params->locallab.spots.at(sp).avoidgamutMethod == "XYZ") {
avoidgamut = 2;
} else if (params->locallab.spots.at(sp).avoidgamutMethod == "XYZREL") {
avoidgamut = 3;
} else if (params->locallab.spots.at(sp).avoidgamutMethod == "MUNS") {
avoidgamut = 4;
}
if (avoidgamut == 0) {
return;
}
if (avoidgamut > 0 && lp.islocal) {
const float ach = lp.trans / 100.f; const float ach = lp.trans / 100.f;
bool execmunsell = true; bool execmunsell = true;
if(params->locallab.spots.at(sp).expcie && (params->locallab.spots.at(sp).modecam == "all" || params->locallab.spots.at(sp).modecam == "jz" || params->locallab.spots.at(sp).modecam == "cam16")) {
if (params->locallab.spots.at(sp).expcie && (params->locallab.spots.at(sp).modecam == "all" || params->locallab.spots.at(sp).modecam == "jz" || params->locallab.spots.at(sp).modecam == "cam16")) {
execmunsell = false; execmunsell = false;
} }
@ -12556,11 +12575,18 @@ void ImProcFunctions::avoidcolshi(const struct local_params& lp, int sp, LabImag
{wiprof[2][0], wiprof[2][1], wiprof[2][2]} {wiprof[2][0], wiprof[2][1], wiprof[2][2]}
}; };
TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(params->icm.workingProfile);
const double wp[3][3] = {//improve precision with double
{wprof[0][0], wprof[0][1], wprof[0][2]},
{wprof[1][0], wprof[1][1], wprof[1][2]},
{wprof[2][0], wprof[2][1], wprof[2][2]}
};
const float softr = params->locallab.spots.at(sp).avoidrad;//max softr = 30 const float softr = params->locallab.spots.at(sp).avoidrad;//max softr = 30
const bool muns = params->locallab.spots.at(sp).avoidmun;//Munsell control with 200 LUT // const bool muns = params->locallab.spots.at(sp).avoidmun;//Munsell control with 200 LUT
//improve precision with mint and maxt //improve precision with mint and maxt
const float tr = std::min(2.f, softr); const float tr = std::min(2.f, softr);
const float mint = 0.15f - 0.06f * tr;//between 0.15f and 0.03f const float mint = 0.15f - 0.06f * tr;//between 0.15f and 0.03f
const float maxt = 0.98f + 0.008f * tr;//between 0.98f and 0.996f const float maxt = 0.98f + 0.008f * tr;//between 0.98f and 0.996f
const bool highlight = params->toneCurve.hrenabled; const bool highlight = params->toneCurve.hrenabled;
@ -12581,6 +12607,7 @@ void ImProcFunctions::avoidcolshi(const struct local_params& lp, int sp, LabImag
#ifdef _OPENMP #ifdef _OPENMP
#pragma omp for schedule(dynamic,16) #pragma omp for schedule(dynamic,16)
#endif #endif
for (int y = 0; y < transformed->H; y++) { for (int y = 0; y < transformed->H; y++) {
const int loy = cy + y; const int loy = cy + y;
const bool isZone0 = loy > lp.yc + lp.ly || loy < lp.yc - lp.lyT; // whole line is zone 0 => we can skip a lot of processing const bool isZone0 = loy > lp.yc + lp.ly || loy < lp.yc - lp.lyT; // whole line is zone 0 => we can skip a lot of processing
@ -12640,7 +12667,7 @@ void ImProcFunctions::avoidcolshi(const struct local_params& lp, int sp, LabImag
if (lp.shapmet == 0) { if (lp.shapmet == 0) {
calcTransition(lox, loy, ach, lp, zone, localFactor); calcTransition(lox, loy, ach, lp, zone, localFactor);
} else /*if (lp.shapmet == 1)*/ { } else { /*if (lp.shapmet == 1)*/
calcTransitionrect(lox, loy, ach, lp, zone, localFactor); calcTransitionrect(lox, loy, ach, lp, zone, localFactor);
} }
@ -12675,42 +12702,103 @@ void ImProcFunctions::avoidcolshi(const struct local_params& lp, int sp, LabImag
sincosval.y = aa / (Chprov1 * 327.68f); sincosval.y = aa / (Chprov1 * 327.68f);
sincosval.x = bb / (Chprov1 * 327.68f); sincosval.x = bb / (Chprov1 * 327.68f);
} }
#endif #endif
float lnew = transformed->L[y][x];
float anew = transformed->a[y][x];
float bnew = transformed->b[y][x];
Lprov1 = lnew / 327.68f;
//HH = xatan2f(bnew, anew);
Color::pregamutlab(Lprov1, HH, chr); if (avoidgamut == 1) { //Lab correction
Chprov1 = rtengine::min(Chprov1, chr);
if(!muns) { Color::pregamutlab(Lprov1, HH, chr);
float R, G, B; Chprov1 = rtengine::min(Chprov1, chr);
float R, G, B;
Color::gamutLchonly(HH, sincosval, Lprov1, Chprov1, R, G, B, wip, highlight, mint, maxt);//replace for best results Color::gamutLchonly(HH, sincosval, Lprov1, Chprov1, R, G, B, wip, highlight, mint, maxt);//replace for best results
} lnew = Lprov1 * 327.68f;
transformed->L[y][x] = Lprov1 * 327.68f; anew = 327.68f * Chprov1 * sincosval.y;
transformed->a[y][x] = 327.68f * Chprov1 * sincosval.y; bnew = 327.68f * Chprov1 * sincosval.x;
transformed->b[y][x] = 327.68f * Chprov1 * sincosval.x; //HH = xatan2f(bnew, anew);
transformed->a[y][x] = anew;
transformed->b[y][x] = bnew;
if (needHH) { } else if (avoidgamut == 2 || avoidgamut == 3) { //XYZ correction
const float Lprov2 = original->L[y][x] / 327.68f; float xg, yg, zg;
const float aag = transformed->a[y][x];//anew
const float bbg = transformed->b[y][x];//bnew
float Lag = transformed->L[y][x];
Color::Lab2XYZ(Lag, aag, bbg, xg, yg, zg);
float x0 = xg;
float y0 = yg;
float z0 = zg;
Color::gamutmap(xg, yg, zg, wp);
if (avoidgamut == 3) {//0.5f arbitrary coeff
xg = xg + 0.5f * (x0 - xg);
yg = yg + 0.5f * (y0 - yg);
zg = zg + 0.5f * (z0 - zg);
}
//Color::gamutmap(xg, yg, zg, wp);//Put XYZ in gamut wp
float aag2, bbg2;
Color::XYZ2Lab(xg, yg, zg, Lag, aag2, bbg2);
Lprov1 = Lag / 327.68f;
HH = xatan2f(bbg2, aag2);//rebuild HH in case of...absolute colorimetry
Chprov1 = std::sqrt(SQR(aag2) + SQR(bbg2)) / 327.68f;
if (Chprov1 == 0.0f) {
sincosval.y = 1.f;
sincosval.x = 0.0f;
} else {
sincosval.y = aag2 / (Chprov1 * 327.68f);
sincosval.x = bbg2 / (Chprov1 * 327.68f);
}
lnew = Lprov1 * 327.68f;
anew = 327.68f * Chprov1 * sincosval.y;
bnew = 327.68f * Chprov1 * sincosval.x;
transformed->a[y][x] = anew;
transformed->b[y][x] = bnew;
}
if (needHH && avoidgamut <= 4) {//Munsell
Lprov1 = lnew / 327.68f;
float Chprov = sqrt(SQR(anew) + SQR(bnew)) / 327.68f;
const float Lprov2 = reserved->L[y][x] / 327.68f;
float correctionHue = 0.f; // Munsell's correction float correctionHue = 0.f; // Munsell's correction
float correctlum = 0.f; float correctlum = 0.f;
const float memChprov = std::sqrt(SQR(original->a[y][x]) + SQR(original->b[y][x])) / 327.68f; const float memChprov = std::sqrt(SQR(reserved->a[y][x]) + SQR(reserved->b[y][x])) / 327.68f;
float Chprov = std::sqrt(SQR(transformed->a[y][x]) + SQR(transformed->b[y][x])) / 327.68f;
if(execmunsell) { if (execmunsell) {
Color::AllMunsellLch(true, Lprov1, Lprov2, HH, Chprov, memChprov, correctionHue, correctlum); Color::AllMunsellLch(true, Lprov1, Lprov2, HH, Chprov, memChprov, correctionHue, correctlum);
} }
if (std::fabs(correctionHue) < 0.015f) { if (correctionHue != 0.f || correctlum != 0.f) {
HH += correctlum; // correct only if correct Munsell chroma very small.
if (std::fabs(correctionHue) < 0.015f) {
HH += correctlum; // correct only if correct Munsell chroma very small.
}
sincosval = xsincosf(HH + correctionHue);
} }
sincosval = xsincosf(HH + correctionHue); anew = 327.68f * Chprov * sincosval.y; // apply Munsell
transformed->a[y][x] = 327.68f * Chprov * sincosval.y; // apply Munsell bnew = 327.68f * Chprov * sincosval.x;
transformed->b[y][x] = 327.68f * Chprov * sincosval.x; transformed->a[y][x] = anew; // apply Munsell
transformed->b[y][x] = bnew;
} }
} }
} }
} }
//Guidedfilter to reduce artifacts in transitions //Guidedfilter to reduce artifacts in transitions : case Lab
if (softr != 0.f) {//soft for L a b because we change color... if (softr != 0.f && avoidgamut == 1) {//soft for L a b because we change color...
const float tmpblur = softr < 0.f ? -1.f / softr : 1.f + softr; const float tmpblur = softr < 0.f ? -1.f / softr : 1.f + softr;
const int r1 = rtengine::max<int>(6 / sk * tmpblur + 0.5f, 1); const int r1 = rtengine::max<int>(6 / sk * tmpblur + 0.5f, 1);
const int r2 = rtengine::max<int>(10 / sk * tmpblur + 0.5f, 1); const int r2 = rtengine::max<int>(10 / sk * tmpblur + 0.5f, 1);
@ -12734,13 +12822,15 @@ void ImProcFunctions::avoidcolshi(const struct local_params& lp, int sp, LabImag
for (int y = 0; y < bh ; y++) { for (int y = 0; y < bh ; y++) {
for (int x = 0; x < bw; x++) { for (int x = 0; x < bw; x++) {
ble[y][x] = transformed->L[y][x] / 32768.f; ble[y][x] = transformed->L[y][x] / 32768.f;
guid[y][x] = original->L[y][x] / 32768.f; guid[y][x] = reserved->L[y][x] / 32768.f;
} }
} }
rtengine::guidedFilter(guid, ble, ble, r2, 0.2f * epsil, multiThread); rtengine::guidedFilter(guid, ble, ble, r2, 0.2f * epsil, multiThread);
#ifdef _OPENMP #ifdef _OPENMP
#pragma omp parallel for schedule(dynamic,16) if (multiThread) #pragma omp parallel for schedule(dynamic,16) if (multiThread)
#endif #endif
for (int y = 0; y < bh; y++) { for (int y = 0; y < bh; y++) {
for (int x = 0; x < bw; x++) { for (int x = 0; x < bw; x++) {
transformed->L[y][x] = 32768.f * ble[y][x]; transformed->L[y][x] = 32768.f * ble[y][x];
@ -12757,11 +12847,13 @@ void ImProcFunctions::avoidcolshi(const struct local_params& lp, int sp, LabImag
blechro[y][x] = std::sqrt(SQR(transformed->b[y][x]) + SQR(transformed->a[y][x])) / 32768.f; blechro[y][x] = std::sqrt(SQR(transformed->b[y][x]) + SQR(transformed->a[y][x])) / 32768.f;
} }
} }
rtengine::guidedFilter(guid, blechro, blechro, r1, epsil, multiThread); rtengine::guidedFilter(guid, blechro, blechro, r1, epsil, multiThread);
#ifdef _OPENMP #ifdef _OPENMP
#pragma omp parallel for schedule(dynamic,16) if (multiThread) #pragma omp parallel for schedule(dynamic,16) if (multiThread)
#endif #endif
for (int y = 0; y < bh; y++) { for (int y = 0; y < bh; y++) {
for (int x = 0; x < bw; x++) { for (int x = 0; x < bw; x++) {
const float Chprov1 = std::sqrt(SQR(transformed->a[y][x]) + SQR(transformed->b[y][x])); const float Chprov1 = std::sqrt(SQR(transformed->a[y][x]) + SQR(transformed->b[y][x]));
@ -13286,7 +13378,7 @@ void ImProcFunctions::Lab_Local(
struct local_params lp; struct local_params lp;
calcLocalParams(sp, oW, oH, params->locallab, lp, prevDeltaE, llColorMask, llColorMaskinv, llExpMask, llExpMaskinv, llSHMask, llSHMaskinv, llvibMask, lllcMask, llsharMask, llcbMask, llretiMask, llsoftMask, lltmMask, llblMask, lllogMask, ll_Mask, llcieMask, locwavCurveden, locwavdenutili); calcLocalParams(sp, oW, oH, params->locallab, lp, prevDeltaE, llColorMask, llColorMaskinv, llExpMask, llExpMaskinv, llSHMask, llSHMaskinv, llvibMask, lllcMask, llsharMask, llcbMask, llretiMask, llsoftMask, lltmMask, llblMask, lllogMask, ll_Mask, llcieMask, locwavCurveden, locwavdenutili);
avoidcolshi(lp, sp, original, transformed, cy, cx, sk); //avoidcolshi(lp, sp, transformed, reserved, cy, cx, sk);
const float radius = lp.rad / (sk * 1.4); //0 to 70 ==> see skip const float radius = lp.rad / (sk * 1.4); //0 to 70 ==> see skip
int levred; int levred;
@ -19188,7 +19280,7 @@ void ImProcFunctions::Lab_Local(
// Gamut and Munsell control - very important do not deactivated to avoid crash // Gamut and Munsell control - very important do not deactivated to avoid crash
avoidcolshi(lp, sp, original, transformed, cy, cx, sk); avoidcolshi(lp, sp, transformed, reserved, cy, cx, sk);
} }
} }

View File

@ -137,7 +137,7 @@ enum ProcEventCode {
EvHLComprThreshold = 107, EvHLComprThreshold = 107,
EvResizeBoundingBox = 108, EvResizeBoundingBox = 108,
EvResizeAppliesTo = 109, EvResizeAppliesTo = 109,
EvLAvoidColorShift = 110, //EvLAvoidColorShift = 110,
obsolete_111 = 111, // obsolete obsolete_111 = 111, // obsolete
EvLRSTProtection = 112, EvLRSTProtection = 112,
EvDemosaicDCBIter = 113, EvDemosaicDCBIter = 113,
@ -617,7 +617,7 @@ enum ProcEventCode {
Evlocallabadjblur = 587, Evlocallabadjblur = 587,
Evlocallabbilateral = 588, Evlocallabbilateral = 588,
Evlocallabsensiden = 589, Evlocallabsensiden = 589,
Evlocallabavoid = 590, // Evlocallabavoid = 590,
Evlocallabsharcontrast = 591, Evlocallabsharcontrast = 591,
EvLocenacontrast = 592, EvLocenacontrast = 592,
Evlocallablcradius = 593, Evlocallablcradius = 593,
@ -1067,7 +1067,7 @@ enum ProcEventCode {
Evlocallabnlgam = 1037, Evlocallabnlgam = 1037,
Evlocallabdivgr = 1038, Evlocallabdivgr = 1038,
EvLocallabSpotavoidrad = 1039, EvLocallabSpotavoidrad = 1039,
EvLocallabSpotavoidmun = 1040, //EvLocallabSpotavoidmun = 1040,
Evlocallabcontthres = 1041, Evlocallabcontthres = 1041,
Evlocallabnorm = 1042, Evlocallabnorm = 1042,
Evlocallabreparw = 1043, Evlocallabreparw = 1043,

View File

@ -608,7 +608,7 @@ LCurveParams::LCurveParams() :
brightness(0), brightness(0),
contrast(0), contrast(0),
chromaticity(0), chromaticity(0),
avoidcolorshift(false), gamutmunselmethod("MUN"),
rstprotection(0), rstprotection(0),
lcredsk(true) lcredsk(true)
{ {
@ -630,7 +630,7 @@ bool LCurveParams::operator ==(const LCurveParams& other) const
&& brightness == other.brightness && brightness == other.brightness
&& contrast == other.contrast && contrast == other.contrast
&& chromaticity == other.chromaticity && chromaticity == other.chromaticity
&& avoidcolorshift == other.avoidcolorshift && gamutmunselmethod == other.gamutmunselmethod
&& rstprotection == other.rstprotection && rstprotection == other.rstprotection
&& lcredsk == other.lcredsk; && lcredsk == other.lcredsk;
} }
@ -1461,8 +1461,7 @@ ColorAppearanceParams::ColorAppearanceParams() :
ybout(18), ybout(18),
greenout(1.0), greenout(1.0),
tempsc(5003), tempsc(5003),
greensc(1.0), greensc(1.0)
presetcat02(false)
{ {
} }
@ -1512,8 +1511,7 @@ bool ColorAppearanceParams::operator ==(const ColorAppearanceParams& other) cons
&& ybout == other.ybout && ybout == other.ybout
&& greenout == other.greenout && greenout == other.greenout
&& tempsc == other.tempsc && tempsc == other.tempsc
&& greensc == other.greensc && greensc == other.greensc;
&& presetcat02 == other.presetcat02;
} }
bool ColorAppearanceParams::operator !=(const ColorAppearanceParams& other) const bool ColorAppearanceParams::operator !=(const ColorAppearanceParams& other) const
@ -2278,6 +2276,7 @@ ColorManagementParams::ColorManagementParams() :
bluy(0.0001), bluy(0.0001),
preser(0.), preser(0.),
fbw(false), fbw(false),
gamut(false),
labgridcieALow(0.51763),//Prophoto red = (0.7347+0.1) * 1.81818 - 1 labgridcieALow(0.51763),//Prophoto red = (0.7347+0.1) * 1.81818 - 1
labgridcieBLow(-0.33582), labgridcieBLow(-0.33582),
labgridcieAHigh(-0.75163),//Prophoto blue labgridcieAHigh(-0.75163),//Prophoto blue
@ -2324,6 +2323,7 @@ bool ColorManagementParams::operator ==(const ColorManagementParams& other) cons
&& labgridcieWy == other.labgridcieWy && labgridcieWy == other.labgridcieWy
&& preser == other.preser && preser == other.preser
&& fbw == other.fbw && fbw == other.fbw
&& gamut == other.gamut
&& aRendIntent == other.aRendIntent && aRendIntent == other.aRendIntent
&& outputProfile == other.outputProfile && outputProfile == other.outputProfile
&& outputIntent == other.outputIntent && outputIntent == other.outputIntent
@ -2848,6 +2848,7 @@ LocallabParams::LocallabSpot::LocallabSpot() :
structexclu(0), structexclu(0),
struc(4.0), struc(4.0),
shapeMethod("IND"), shapeMethod("IND"),
avoidgamutMethod("MUNS"),
loc{150, 150, 150, 150}, loc{150, 150, 150, 150},
centerX(0), centerX(0),
centerY(0), centerY(0),
@ -2862,13 +2863,11 @@ LocallabParams::LocallabSpot::LocallabSpot() :
balanh(1.0), balanh(1.0),
colorde(5.0), colorde(5.0),
colorscope(30.0), colorscope(30.0),
avoidrad(0.7), avoidrad(0.),
transitweak(1.0), transitweak(1.0),
transitgrad(0.0), transitgrad(0.0),
hishow(false), hishow(false),
activ(true), activ(true),
avoid(false),
avoidmun(false),
blwh(false), blwh(false),
recurs(false), recurs(false),
laplac(true), laplac(true),
@ -4560,6 +4559,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const
&& structexclu == other.structexclu && structexclu == other.structexclu
&& struc == other.struc && struc == other.struc
&& shapeMethod == other.shapeMethod && shapeMethod == other.shapeMethod
&& avoidgamutMethod == other.avoidgamutMethod
&& loc == other.loc && loc == other.loc
&& centerX == other.centerX && centerX == other.centerX
&& centerY == other.centerY && centerY == other.centerY
@ -4579,8 +4579,6 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const
&& transitgrad == other.transitgrad && transitgrad == other.transitgrad
&& hishow == other.hishow && hishow == other.hishow
&& activ == other.activ && activ == other.activ
&& avoid == other.avoid
&& avoidmun == other.avoidmun
&& blwh == other.blwh && blwh == other.blwh
&& recurs == other.recurs && recurs == other.recurs
&& laplac == other.laplac && laplac == other.laplac
@ -6045,7 +6043,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || pedited->labCurve.brightness, "Luminance Curve", "Brightness", labCurve.brightness, keyFile); saveToKeyfile(!pedited || pedited->labCurve.brightness, "Luminance Curve", "Brightness", labCurve.brightness, keyFile);
saveToKeyfile(!pedited || pedited->labCurve.contrast, "Luminance Curve", "Contrast", labCurve.contrast, keyFile); saveToKeyfile(!pedited || pedited->labCurve.contrast, "Luminance Curve", "Contrast", labCurve.contrast, keyFile);
saveToKeyfile(!pedited || pedited->labCurve.chromaticity, "Luminance Curve", "Chromaticity", labCurve.chromaticity, keyFile); saveToKeyfile(!pedited || pedited->labCurve.chromaticity, "Luminance Curve", "Chromaticity", labCurve.chromaticity, keyFile);
saveToKeyfile(!pedited || pedited->labCurve.avoidcolorshift, "Luminance Curve", "AvoidColorShift", labCurve.avoidcolorshift, keyFile); saveToKeyfile(!pedited || pedited->labCurve.gamutmunselmethod, "Luminance Curve", "Gamutmunse", labCurve.gamutmunselmethod, keyFile);
saveToKeyfile(!pedited || pedited->labCurve.rstprotection, "Luminance Curve", "RedAndSkinTonesProtection", labCurve.rstprotection, keyFile); saveToKeyfile(!pedited || pedited->labCurve.rstprotection, "Luminance Curve", "RedAndSkinTonesProtection", labCurve.rstprotection, keyFile);
saveToKeyfile(!pedited || pedited->labCurve.lcredsk, "Luminance Curve", "LCredsk", labCurve.lcredsk, keyFile); saveToKeyfile(!pedited || pedited->labCurve.lcredsk, "Luminance Curve", "LCredsk", labCurve.lcredsk, keyFile);
saveToKeyfile(!pedited || pedited->labCurve.lcurve, "Luminance Curve", "LCurve", labCurve.lcurve, keyFile); saveToKeyfile(!pedited || pedited->labCurve.lcurve, "Luminance Curve", "LCurve", labCurve.lcurve, keyFile);
@ -6146,7 +6144,6 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || pedited->colorappearance.ybout, "Color appearance", "Ybout", colorappearance.ybout, keyFile); saveToKeyfile(!pedited || pedited->colorappearance.ybout, "Color appearance", "Ybout", colorappearance.ybout, keyFile);
saveToKeyfile(!pedited || pedited->colorappearance.datacie, "Color appearance", "Datacie", colorappearance.datacie, keyFile); saveToKeyfile(!pedited || pedited->colorappearance.datacie, "Color appearance", "Datacie", colorappearance.datacie, keyFile);
saveToKeyfile(!pedited || pedited->colorappearance.tonecie, "Color appearance", "Tonecie", colorappearance.tonecie, keyFile); saveToKeyfile(!pedited || pedited->colorappearance.tonecie, "Color appearance", "Tonecie", colorappearance.tonecie, keyFile);
saveToKeyfile(!pedited || pedited->colorappearance.presetcat02, "Color appearance", "Presetcat02", colorappearance.presetcat02, keyFile);
const std::map<ColorAppearanceParams::TcMode, const char*> ca_mapping = { const std::map<ColorAppearanceParams::TcMode, const char*> ca_mapping = {
{ColorAppearanceParams::TcMode::LIGHT, "Lightness"}, {ColorAppearanceParams::TcMode::LIGHT, "Lightness"},
@ -6348,6 +6345,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || spot_edited->structexclu, "Locallab", "StructExclu_" + index_str, spot.structexclu, keyFile); saveToKeyfile(!pedited || spot_edited->structexclu, "Locallab", "StructExclu_" + index_str, spot.structexclu, keyFile);
saveToKeyfile(!pedited || spot_edited->struc, "Locallab", "Struc_" + index_str, spot.struc, keyFile); saveToKeyfile(!pedited || spot_edited->struc, "Locallab", "Struc_" + index_str, spot.struc, keyFile);
saveToKeyfile(!pedited || spot_edited->shapeMethod, "Locallab", "ShapeMethod_" + index_str, spot.shapeMethod, keyFile); saveToKeyfile(!pedited || spot_edited->shapeMethod, "Locallab", "ShapeMethod_" + index_str, spot.shapeMethod, keyFile);
saveToKeyfile(!pedited || spot_edited->avoidgamutMethod, "Locallab", "AvoidgamutMethod_" + index_str, spot.avoidgamutMethod, keyFile);
saveToKeyfile(!pedited || spot_edited->loc, "Locallab", "Loc_" + index_str, spot.loc, keyFile); saveToKeyfile(!pedited || spot_edited->loc, "Locallab", "Loc_" + index_str, spot.loc, keyFile);
saveToKeyfile(!pedited || spot_edited->centerX, "Locallab", "CenterX_" + index_str, spot.centerX, keyFile); saveToKeyfile(!pedited || spot_edited->centerX, "Locallab", "CenterX_" + index_str, spot.centerX, keyFile);
saveToKeyfile(!pedited || spot_edited->centerY, "Locallab", "CenterY_" + index_str, spot.centerY, keyFile); saveToKeyfile(!pedited || spot_edited->centerY, "Locallab", "CenterY_" + index_str, spot.centerY, keyFile);
@ -6367,8 +6365,6 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || spot_edited->transitgrad, "Locallab", "Transitgrad_" + index_str, spot.transitgrad, keyFile); saveToKeyfile(!pedited || spot_edited->transitgrad, "Locallab", "Transitgrad_" + index_str, spot.transitgrad, keyFile);
saveToKeyfile(!pedited || spot_edited->hishow, "Locallab", "Hishow_" + index_str, spot.hishow, keyFile); saveToKeyfile(!pedited || spot_edited->hishow, "Locallab", "Hishow_" + index_str, spot.hishow, keyFile);
saveToKeyfile(!pedited || spot_edited->activ, "Locallab", "Activ_" + index_str, spot.activ, keyFile); saveToKeyfile(!pedited || spot_edited->activ, "Locallab", "Activ_" + index_str, spot.activ, keyFile);
saveToKeyfile(!pedited || spot_edited->avoid, "Locallab", "Avoid_" + index_str, spot.avoid, keyFile);
saveToKeyfile(!pedited || spot_edited->avoidmun, "Locallab", "Avoidmun_" + index_str, spot.avoidmun, keyFile);
saveToKeyfile(!pedited || spot_edited->blwh, "Locallab", "Blwh_" + index_str, spot.blwh, keyFile); saveToKeyfile(!pedited || spot_edited->blwh, "Locallab", "Blwh_" + index_str, spot.blwh, keyFile);
saveToKeyfile(!pedited || spot_edited->recurs, "Locallab", "Recurs_" + index_str, spot.recurs, keyFile); saveToKeyfile(!pedited || spot_edited->recurs, "Locallab", "Recurs_" + index_str, spot.recurs, keyFile);
saveToKeyfile(!pedited || spot_edited->laplac, "Locallab", "Laplac_" + index_str, spot.laplac, keyFile); saveToKeyfile(!pedited || spot_edited->laplac, "Locallab", "Laplac_" + index_str, spot.laplac, keyFile);
@ -7193,6 +7189,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || pedited->icm.labgridcieWy, "Color Management", "LabGridcieWy", icm.labgridcieWy, keyFile); saveToKeyfile(!pedited || pedited->icm.labgridcieWy, "Color Management", "LabGridcieWy", icm.labgridcieWy, keyFile);
saveToKeyfile(!pedited || pedited->icm.preser, "Color Management", "Preser", icm.preser, keyFile); saveToKeyfile(!pedited || pedited->icm.preser, "Color Management", "Preser", icm.preser, keyFile);
saveToKeyfile(!pedited || pedited->icm.fbw, "Color Management", "Fbw", icm.fbw, keyFile); saveToKeyfile(!pedited || pedited->icm.fbw, "Color Management", "Fbw", icm.fbw, keyFile);
saveToKeyfile(!pedited || pedited->icm.gamut, "Color Management", "Gamut", icm.gamut, keyFile);
saveToKeyfile(!pedited || pedited->icm.outputProfile, "Color Management", "OutputProfile", icm.outputProfile, keyFile); saveToKeyfile(!pedited || pedited->icm.outputProfile, "Color Management", "OutputProfile", icm.outputProfile, keyFile);
saveToKeyfile( saveToKeyfile(
!pedited || pedited->icm.aRendIntent, !pedited || pedited->icm.aRendIntent,
@ -7871,7 +7868,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
// if Saturation == 0, should we set BWToning on? // if Saturation == 0, should we set BWToning on?
assignFromKeyfile(keyFile, "Luminance Curve", "Saturation", pedited, labCurve.chromaticity, pedited->labCurve.chromaticity); assignFromKeyfile(keyFile, "Luminance Curve", "Saturation", pedited, labCurve.chromaticity, pedited->labCurve.chromaticity);
// transform AvoidColorClipping into AvoidColorShift // transform AvoidColorClipping into AvoidColorShift
assignFromKeyfile(keyFile, "Luminance Curve", "AvoidColorClipping", pedited, labCurve.avoidcolorshift, pedited->labCurve.avoidcolorshift); // assignFromKeyfile(keyFile, "Luminance Curve", "AvoidColorClipping", pedited, labCurve.avoidcolorshift, pedited->labCurve.avoidcolorshift);
} else { } else {
if (keyFile.has_key("Luminance Curve", "Chromaticity")) { if (keyFile.has_key("Luminance Curve", "Chromaticity")) {
labCurve.chromaticity = keyFile.get_integer("Luminance Curve", "Chromaticity"); labCurve.chromaticity = keyFile.get_integer("Luminance Curve", "Chromaticity");
@ -7885,7 +7882,6 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
} }
} }
assignFromKeyfile(keyFile, "Luminance Curve", "AvoidColorShift", pedited, labCurve.avoidcolorshift, pedited->labCurve.avoidcolorshift);
assignFromKeyfile(keyFile, "Luminance Curve", "RedAndSkinTonesProtection", pedited, labCurve.rstprotection, pedited->labCurve.rstprotection); assignFromKeyfile(keyFile, "Luminance Curve", "RedAndSkinTonesProtection", pedited, labCurve.rstprotection, pedited->labCurve.rstprotection);
} }
@ -7914,6 +7910,25 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "Luminance Curve", "hhCurve", pedited, labCurve.hhcurve, pedited->labCurve.hhcurve); assignFromKeyfile(keyFile, "Luminance Curve", "hhCurve", pedited, labCurve.hhcurve, pedited->labCurve.hhcurve);
assignFromKeyfile(keyFile, "Luminance Curve", "LcCurve", pedited, labCurve.lccurve, pedited->labCurve.lccurve); assignFromKeyfile(keyFile, "Luminance Curve", "LcCurve", pedited, labCurve.lccurve, pedited->labCurve.lccurve);
assignFromKeyfile(keyFile, "Luminance Curve", "ClCurve", pedited, labCurve.clcurve, pedited->labCurve.clcurve); assignFromKeyfile(keyFile, "Luminance Curve", "ClCurve", pedited, labCurve.clcurve, pedited->labCurve.clcurve);
if (keyFile.has_key("Luminance Curve", "Gamutmunse")) {
assignFromKeyfile(keyFile, "Luminance Curve", "Gamutmunse", pedited, labCurve.gamutmunselmethod, pedited->labCurve.gamutmunselmethod);
} else {
if (ppVersion < 303) {
if (keyFile.has_key("Luminance Curve", "AvoidColorClipping")) {
labCurve.gamutmunselmethod =
keyFile.get_boolean("Luminance Curve", "AvoidColorClipping") ? "LAB" : "NONE";
if (pedited) {
pedited->labCurve.gamutmunselmethod = true;
}
}
} else if (keyFile.has_key("Luminance Curve", "AvoidColorShift")) {
labCurve.gamutmunselmethod =
keyFile.get_boolean("Luminance Curve", "AvoidColorShift") ? "LAB" : "NONE";
if (pedited) {
pedited->labCurve.gamutmunselmethod = true;
}
}
}
} }
if (keyFile.has_group("Sharpening")) { if (keyFile.has_group("Sharpening")) {
@ -8107,7 +8122,6 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "Color appearance", "Ybout", pedited, colorappearance.ybout, pedited->colorappearance.ybout); assignFromKeyfile(keyFile, "Color appearance", "Ybout", pedited, colorappearance.ybout, pedited->colorappearance.ybout);
assignFromKeyfile(keyFile, "Color appearance", "Datacie", pedited, colorappearance.datacie, pedited->colorappearance.datacie); assignFromKeyfile(keyFile, "Color appearance", "Datacie", pedited, colorappearance.datacie, pedited->colorappearance.datacie);
assignFromKeyfile(keyFile, "Color appearance", "Tonecie", pedited, colorappearance.tonecie, pedited->colorappearance.tonecie); assignFromKeyfile(keyFile, "Color appearance", "Tonecie", pedited, colorappearance.tonecie, pedited->colorappearance.tonecie);
assignFromKeyfile(keyFile, "Color appearance", "Presetcat02", pedited, colorappearance.presetcat02, pedited->colorappearance.presetcat02);
const std::map<std::string, ColorAppearanceParams::TcMode> tc_mapping = { const std::map<std::string, ColorAppearanceParams::TcMode> tc_mapping = {
{"Lightness", ColorAppearanceParams::TcMode::LIGHT}, {"Lightness", ColorAppearanceParams::TcMode::LIGHT},
@ -8424,6 +8438,16 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "Locallab", "StructExclu_" + index_str, pedited, spot.structexclu, spotEdited.structexclu); assignFromKeyfile(keyFile, "Locallab", "StructExclu_" + index_str, pedited, spot.structexclu, spotEdited.structexclu);
assignFromKeyfile(keyFile, "Locallab", "Struc_" + index_str, pedited, spot.struc, spotEdited.struc); assignFromKeyfile(keyFile, "Locallab", "Struc_" + index_str, pedited, spot.struc, spotEdited.struc);
assignFromKeyfile(keyFile, "Locallab", "ShapeMethod_" + index_str, pedited, spot.shapeMethod, spotEdited.shapeMethod); assignFromKeyfile(keyFile, "Locallab", "ShapeMethod_" + index_str, pedited, spot.shapeMethod, spotEdited.shapeMethod);
if (keyFile.has_key("Locallab", "AvoidgamutMethod_" + index_str)) {
assignFromKeyfile(keyFile, "Locallab", "AvoidgamutMethod_" + index_str, pedited, spot.avoidgamutMethod, spotEdited.avoidgamutMethod);
} else if (keyFile.has_key("Locallab", "Avoid_" + index_str)) {
const bool avoid = keyFile.get_boolean("Locallab", "Avoid_" + index_str);
const bool munsell = keyFile.has_key("Locallab", "Avoidmun_" + index_str) && keyFile.get_boolean("Locallab", "Avoidmun_" + index_str);
spot.avoidgamutMethod = avoid ? (munsell ? "MUNS" : "LAB") : "NONE";
if (pedited) {
spotEdited.avoidgamutMethod = true;
}
}
assignFromKeyfile(keyFile, "Locallab", "Loc_" + index_str, pedited, spot.loc, spotEdited.loc); assignFromKeyfile(keyFile, "Locallab", "Loc_" + index_str, pedited, spot.loc, spotEdited.loc);
assignFromKeyfile(keyFile, "Locallab", "CenterX_" + index_str, pedited, spot.centerX, spotEdited.centerX); assignFromKeyfile(keyFile, "Locallab", "CenterX_" + index_str, pedited, spot.centerX, spotEdited.centerX);
assignFromKeyfile(keyFile, "Locallab", "CenterY_" + index_str, pedited, spot.centerY, spotEdited.centerY); assignFromKeyfile(keyFile, "Locallab", "CenterY_" + index_str, pedited, spot.centerY, spotEdited.centerY);
@ -8443,8 +8467,6 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "Locallab", "Transitgrad_" + index_str, pedited, spot.transitgrad, spotEdited.transitgrad); assignFromKeyfile(keyFile, "Locallab", "Transitgrad_" + index_str, pedited, spot.transitgrad, spotEdited.transitgrad);
assignFromKeyfile(keyFile, "Locallab", "Hishow_" + index_str, pedited, spot.hishow, spotEdited.hishow); assignFromKeyfile(keyFile, "Locallab", "Hishow_" + index_str, pedited, spot.hishow, spotEdited.hishow);
assignFromKeyfile(keyFile, "Locallab", "Activ_" + index_str, pedited, spot.activ, spotEdited.activ); assignFromKeyfile(keyFile, "Locallab", "Activ_" + index_str, pedited, spot.activ, spotEdited.activ);
assignFromKeyfile(keyFile, "Locallab", "Avoid_" + index_str, pedited, spot.avoid, spotEdited.avoid);
assignFromKeyfile(keyFile, "Locallab", "Avoidmun_" + index_str, pedited, spot.avoidmun, spotEdited.avoidmun);
assignFromKeyfile(keyFile, "Locallab", "Blwh_" + index_str, pedited, spot.blwh, spotEdited.blwh); assignFromKeyfile(keyFile, "Locallab", "Blwh_" + index_str, pedited, spot.blwh, spotEdited.blwh);
assignFromKeyfile(keyFile, "Locallab", "Recurs_" + index_str, pedited, spot.recurs, spotEdited.recurs); assignFromKeyfile(keyFile, "Locallab", "Recurs_" + index_str, pedited, spot.recurs, spotEdited.recurs);
assignFromKeyfile(keyFile, "Locallab", "Laplac_" + index_str, pedited, spot.laplac, spotEdited.laplac); assignFromKeyfile(keyFile, "Locallab", "Laplac_" + index_str, pedited, spot.laplac, spotEdited.laplac);
@ -9459,6 +9481,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "Color Management", "Bluy", pedited, icm.bluy, pedited->icm.bluy); assignFromKeyfile(keyFile, "Color Management", "Bluy", pedited, icm.bluy, pedited->icm.bluy);
assignFromKeyfile(keyFile, "Color Management", "Preser", pedited, icm.preser, pedited->icm.preser); assignFromKeyfile(keyFile, "Color Management", "Preser", pedited, icm.preser, pedited->icm.preser);
assignFromKeyfile(keyFile, "Color Management", "Fbw", pedited, icm.fbw, pedited->icm.fbw); assignFromKeyfile(keyFile, "Color Management", "Fbw", pedited, icm.fbw, pedited->icm.fbw);
assignFromKeyfile(keyFile, "Color Management", "Gamut", pedited, icm.gamut, pedited->icm.gamut);
assignFromKeyfile(keyFile, "Color Management", "LabGridcieALow", pedited, icm.labgridcieALow, pedited->icm.labgridcieALow); assignFromKeyfile(keyFile, "Color Management", "LabGridcieALow", pedited, icm.labgridcieALow, pedited->icm.labgridcieALow);
assignFromKeyfile(keyFile, "Color Management", "LabGridcieBLow", pedited, icm.labgridcieBLow, pedited->icm.labgridcieBLow); assignFromKeyfile(keyFile, "Color Management", "LabGridcieBLow", pedited, icm.labgridcieBLow, pedited->icm.labgridcieBLow);
assignFromKeyfile(keyFile, "Color Management", "LabGridcieAHigh", pedited, icm.labgridcieAHigh, pedited->icm.labgridcieAHigh); assignFromKeyfile(keyFile, "Color Management", "LabGridcieAHigh", pedited, icm.labgridcieAHigh, pedited->icm.labgridcieAHigh);

View File

@ -376,7 +376,7 @@ struct LCurveParams {
int brightness; int brightness;
int contrast; int contrast;
int chromaticity; int chromaticity;
bool avoidcolorshift; Glib::ustring gamutmunselmethod;
double rstprotection; double rstprotection;
bool lcredsk; bool lcredsk;
@ -709,7 +709,6 @@ struct ColorAppearanceParams {
double greenout; double greenout;
int tempsc; int tempsc;
double greensc; double greensc;
bool presetcat02;
ColorAppearanceParams(); ColorAppearanceParams();
@ -1020,6 +1019,8 @@ struct LocallabParams {
int structexclu; int structexclu;
double struc; double struc;
Glib::ustring shapeMethod; // IND, SYM, INDSL, SYMSL Glib::ustring shapeMethod; // IND, SYM, INDSL, SYMSL
Glib::ustring avoidgamutMethod; // NONE, LAB, XYZ
std::vector<int> loc; // For ellipse/rectangle: {locX, locXL, locY, locYT} std::vector<int> loc; // For ellipse/rectangle: {locX, locXL, locY, locYT}
int centerX; int centerX;
int centerY; int centerY;
@ -1039,8 +1040,6 @@ struct LocallabParams {
double transitgrad; double transitgrad;
bool hishow; bool hishow;
bool activ; bool activ;
bool avoid;
bool avoidmun;
bool blwh; bool blwh;
bool recurs; bool recurs;
bool laplac; bool laplac;
@ -1937,6 +1936,7 @@ struct ColorManagementParams {
double bluy; double bluy;
double preser; double preser;
bool fbw; bool fbw;
bool gamut;
double labgridcieALow; double labgridcieALow;
double labgridcieBLow; double labgridcieBLow;
double labgridcieAHigh; double labgridcieAHigh;

View File

@ -1185,8 +1185,7 @@ int refreshmap[rtengine::NUMOFEVENTS] = {
AUTOEXP, //Evlocallabforcebw AUTOEXP, //Evlocallabforcebw
AUTOEXP, //Evlocallabsigjz AUTOEXP, //Evlocallabsigjz
AUTOEXP, //Evlocallabsigq AUTOEXP, //Evlocallabsigq
AUTOEXP //Evlocallablogcie AUTOEXP //Evlocallablogcie
}; };

View File

@ -50,7 +50,8 @@ BlackWhite::BlackWhite (): FoldableToolPanel(this, TOOL_NAME, M("TP_BWMIX_LABEL"
metHBox->set_spacing (2); metHBox->set_spacing (2);
Gtk::Label* metLabel = Gtk::manage (new Gtk::Label (M("TP_BWMIX_MET") + ":")); Gtk::Label* metLabel = Gtk::manage (new Gtk::Label (M("TP_BWMIX_MET") + ":"));
metHBox->pack_start (*metLabel, Gtk::PACK_SHRINK); metHBox->pack_start (*metLabel, Gtk::PACK_SHRINK);
method = Gtk::manage (new MyComboBoxText ());
method = Gtk::manage (new MyComboBoxText ());
method->append (M("TP_BWMIX_MET_DESAT")); method->append (M("TP_BWMIX_MET_DESAT"));
method->append (M("TP_BWMIX_MET_LUMEQUAL")); method->append (M("TP_BWMIX_MET_LUMEQUAL"));
method->append (M("TP_BWMIX_MET_CHANMIX")); method->append (M("TP_BWMIX_MET_CHANMIX"));

View File

@ -222,7 +222,6 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, TOOL_NAME, M ("TP
milestones.push_back ( GradientMilestone (1., 1., 1., 1.) ); milestones.push_back ( GradientMilestone (1., 1., 1., 1.) );
auto m = ProcEventMapper::getInstance(); auto m = ProcEventMapper::getInstance();
Evcatpreset = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_CAT02PRESET");
EvCATAutotempout = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_TEMPOUT"); EvCATAutotempout = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_TEMPOUT");
EvCATillum = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_ILLUM"); EvCATillum = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_ILLUM");
EvCATcomplex = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_CATCOMPLEX"); EvCATcomplex = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_CATCOMPLEX");
@ -271,10 +270,6 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, TOOL_NAME, M ("TP
catHBox->pack_start(*catmethod); catHBox->pack_start(*catmethod);
genVBox->pack_start (*catHBox, Gtk::PACK_SHRINK); genVBox->pack_start (*catHBox, Gtk::PACK_SHRINK);
presetcat02 = Gtk::manage (new Gtk::CheckButton (M ("TP_COLORAPP_PRESETCAT02")));
presetcat02->set_tooltip_markup (M("TP_COLORAPP_PRESETCAT02_TOOLTIP"));
presetcat02conn = presetcat02->signal_toggled().connect( sigc::mem_fun(*this, &ColorAppearance::presetcat02pressed));
// genVBox->pack_start (*presetcat02, Gtk::PACK_SHRINK);
genFrame->add (*genVBox); genFrame->add (*genVBox);
pack_start (*genFrame, Gtk::PACK_EXPAND_WIDGET, 4); pack_start (*genFrame, Gtk::PACK_EXPAND_WIDGET, 4);
@ -688,14 +683,22 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, TOOL_NAME, M ("TP
ybout->set_tooltip_markup (M ("TP_COLORAPP_YBOUT_TOOLTIP")); ybout->set_tooltip_markup (M ("TP_COLORAPP_YBOUT_TOOLTIP"));
tempout->set_tooltip_markup (M ("TP_COLORAPP_TEMP2_TOOLTIP")); tempout->set_tooltip_markup (M ("TP_COLORAPP_TEMP2_TOOLTIP"));
// tempout->throwOnButtonRelease(); tempout->throwOnButtonRelease();
// tempout->addAutoButton (M ("TP_COLORAPP_TEMPOUT_TOOLTIP")); tempout->addAutoButton (M ("TP_COLORAPP_TEMPOUT_TOOLTIP"));
// I renable tempout with addautobutton to work properly (and all code disabled). There are certainly some redundancies, but it doesn't matter
tempout->show(); tempout->show();
greenout->show(); greenout->show();
ybout->show(); ybout->show();
p3VBox->pack_start (*tempout); Gtk::Frame *tempgreenFrame;
p3VBox->pack_start (*greenout); tempgreenFrame = Gtk::manage(new Gtk::Frame());
tempgreenFrame->set_label_align (0.025, 0.5);
Gtk::Box* tempgreenVBox;
tempgreenVBox = Gtk::manage ( new Gtk::Box(Gtk::ORIENTATION_VERTICAL));
tempgreenVBox->set_spacing (2);
tempgreenVBox->pack_start (*tempout);
tempgreenVBox->pack_start (*greenout);
tempgreenFrame->add(*tempgreenVBox);
p3VBox->pack_start(*tempgreenFrame);
p3VBox->pack_start (*ybout); p3VBox->pack_start (*ybout);
Gtk::Box* surrHBox = Gtk::manage (new Gtk::Box ()); Gtk::Box* surrHBox = Gtk::manage (new Gtk::Box ());
@ -829,7 +832,7 @@ void ColorAppearance::neutral_pressed ()
qcontrast->resetValue (false); qcontrast->resetValue (false);
colorh->resetValue (false); colorh->resetValue (false);
tempout->resetValue (false); tempout->resetValue (false);
// tempout->setAutoValue (true); tempout->setAutoValue (true);
greenout->resetValue (false); greenout->resetValue (false);
ybout->resetValue (false); ybout->resetValue (false);
tempsc->resetValue (false); tempsc->resetValue (false);
@ -876,7 +879,6 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited)
tcmodeconn.block (true); tcmodeconn.block (true);
tcmode2conn.block (true); tcmode2conn.block (true);
tcmode3conn.block (true); tcmode3conn.block (true);
presetcat02conn.block (true);
shape->setCurve (pp->colorappearance.curve); shape->setCurve (pp->colorappearance.curve);
shape2->setCurve (pp->colorappearance.curve2); shape2->setCurve (pp->colorappearance.curve2);
shape3->setCurve (pp->colorappearance.curve3); shape3->setCurve (pp->colorappearance.curve3);
@ -884,7 +886,6 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited)
toneCurveMode2->set_active (toUnderlying(pp->colorappearance.curveMode2)); toneCurveMode2->set_active (toUnderlying(pp->colorappearance.curveMode2));
toneCurveMode3->set_active (toUnderlying(pp->colorappearance.curveMode3)); toneCurveMode3->set_active (toUnderlying(pp->colorappearance.curveMode3));
curveMode3Changed(); // This will set the correct sensitive state of depending Adjusters curveMode3Changed(); // This will set the correct sensitive state of depending Adjusters
presetcat02->set_active(pp->colorappearance.presetcat02);
nexttemp = pp->wb.temperature; nexttemp = pp->wb.temperature;
nextgreen = 1.; //pp->wb.green; nextgreen = 1.; //pp->wb.green;
@ -922,7 +923,7 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited)
adapscen->setAutoInconsistent (multiImage && !pedited->colorappearance.autoadapscen); adapscen->setAutoInconsistent (multiImage && !pedited->colorappearance.autoadapscen);
ybscen->setAutoInconsistent (multiImage && !pedited->colorappearance.autoybscen); ybscen->setAutoInconsistent (multiImage && !pedited->colorappearance.autoybscen);
set_inconsistent (multiImage && !pedited->colorappearance.enabled); set_inconsistent (multiImage && !pedited->colorappearance.enabled);
// tempout->setAutoInconsistent (multiImage && !pedited->colorappearance.autotempout); tempout->setAutoInconsistent (multiImage && !pedited->colorappearance.autotempout);
shape->setUnChanged (!pedited->colorappearance.curve); shape->setUnChanged (!pedited->colorappearance.curve);
shape2->setUnChanged (!pedited->colorappearance.curve2); shape2->setUnChanged (!pedited->colorappearance.curve2);
@ -948,7 +949,6 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited)
if (!pedited->colorappearance.curveMode3) { if (!pedited->colorappearance.curveMode3) {
toneCurveMode3->set_active (3); toneCurveMode3->set_active (3);
} }
presetcat02->set_inconsistent(!pedited->colorappearance.presetcat02);
} }
@ -1108,7 +1108,7 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited)
lastAutoAdapscen = pp->colorappearance.autoadapscen; lastAutoAdapscen = pp->colorappearance.autoadapscen;
lastAutoDegreeout = pp->colorappearance.autodegreeout; lastAutoDegreeout = pp->colorappearance.autodegreeout;
lastAutoybscen = pp->colorappearance.autoybscen; lastAutoybscen = pp->colorappearance.autoybscen;
// lastAutotempout = pp->colorappearance.autotempout; lastAutotempout = pp->colorappearance.autotempout;
degree->setValue (pp->colorappearance.degree); degree->setValue (pp->colorappearance.degree);
degree->setAutoValue (pp->colorappearance.autodegree); degree->setAutoValue (pp->colorappearance.autodegree);
@ -1131,15 +1131,11 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited)
qcontrast->setValue (pp->colorappearance.qcontrast); qcontrast->setValue (pp->colorappearance.qcontrast);
colorh->setValue (pp->colorappearance.colorh); colorh->setValue (pp->colorappearance.colorh);
tempout->setValue (pp->colorappearance.tempout); tempout->setValue (pp->colorappearance.tempout);
// tempout->setAutoValue (pp->colorappearance.autotempout); tempout->setAutoValue (pp->colorappearance.autotempout);
greenout->setValue (pp->colorappearance.greenout); greenout->setValue (pp->colorappearance.greenout);
ybout->setValue (pp->colorappearance.ybout); ybout->setValue (pp->colorappearance.ybout);
tempsc->setValue (pp->colorappearance.tempsc); tempsc->setValue (pp->colorappearance.tempsc);
greensc->setValue (pp->colorappearance.greensc); greensc->setValue (pp->colorappearance.greensc);
presetcat02conn.block (true);
presetcat02->set_active (pp->colorappearance.presetcat02);
presetcat02conn.block (false);
lastpresetcat02 = pp->colorappearance.presetcat02;
if (complexmethod->get_active_row_number() == 0) { if (complexmethod->get_active_row_number() == 0) {
updateGUIToMode(0); updateGUIToMode(0);
@ -1199,12 +1195,11 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited)
pp->colorappearance.curve2 = shape2->getCurve (); pp->colorappearance.curve2 = shape2->getCurve ();
pp->colorappearance.curve3 = shape3->getCurve (); pp->colorappearance.curve3 = shape3->getCurve ();
pp->colorappearance.tempout = tempout->getValue (); pp->colorappearance.tempout = tempout->getValue ();
// pp->colorappearance.autotempout = tempout->getAutoValue (); pp->colorappearance.autotempout = tempout->getAutoValue ();
pp->colorappearance.greenout = greenout->getValue (); pp->colorappearance.greenout = greenout->getValue ();
pp->colorappearance.ybout = ybout->getValue (); pp->colorappearance.ybout = ybout->getValue ();
pp->colorappearance.tempsc = tempsc->getValue (); pp->colorappearance.tempsc = tempsc->getValue ();
pp->colorappearance.greensc = greensc->getValue (); pp->colorappearance.greensc = greensc->getValue ();
pp->colorappearance.presetcat02 = presetcat02->get_active();
int tcMode = toneCurveMode->get_active_row_number(); int tcMode = toneCurveMode->get_active_row_number();
@ -1278,8 +1273,7 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited)
pedited->colorappearance.ybout = ybout->getEditedState (); pedited->colorappearance.ybout = ybout->getEditedState ();
pedited->colorappearance.tempsc = tempsc->getEditedState (); pedited->colorappearance.tempsc = tempsc->getEditedState ();
pedited->colorappearance.greensc = greensc->getEditedState (); pedited->colorappearance.greensc = greensc->getEditedState ();
pedited->colorappearance.presetcat02 = presetcat02->get_inconsistent (); pedited->colorappearance.autotempout = !tempout->getAutoInconsistent();
// pedited->colorappearance.autotempout = !tempout->getAutoInconsistent();
} }
@ -1371,7 +1365,9 @@ void ColorAppearance::updateGUIToMode(int mode)
curveEditorG->hide(); curveEditorG->hide();
curveEditorG2->hide(); curveEditorG2->hide();
curveEditorG3->hide(); curveEditorG3->hide();
greenout->hide(); //greenout->hide();
greenout->set_sensitive(false);
badpixsl->hide(); badpixsl->hide();
datacie->hide(); datacie->hide();
} else { } else {
@ -1380,7 +1376,8 @@ void ColorAppearance::updateGUIToMode(int mode)
curveEditorG->show(); curveEditorG->show();
curveEditorG2->show(); curveEditorG2->show();
curveEditorG3->show(); curveEditorG3->show();
greenout->show(); // greenout->show();
greenout->set_sensitive(true);
badpixsl->show(); badpixsl->show();
datacie->show(); datacie->show();
} }
@ -1399,10 +1396,6 @@ void ColorAppearance::convertParamToNormal()
shape2->reset(); shape2->reset();
shape3->reset(); shape3->reset();
wbmodel->set_active (0); wbmodel->set_active (0);
if (presetcat02->get_active ()) {
wbmodel->set_active (2);
illumChanged();
}
if (catmethod->get_active_row_number() == 1 || catmethod->get_active_row_number() == 2) { if (catmethod->get_active_row_number() == 1 || catmethod->get_active_row_number() == 2) {
wbmodel->set_active (2); wbmodel->set_active (2);
illumChanged(); illumChanged();
@ -1490,13 +1483,13 @@ void ColorAppearance::catmethodChanged()
ybout->setValue(18); ybout->setValue(18);
tempout->setValue (nexttemp); tempout->setValue (nexttemp);
/* if(tempout->getAutoValue()) { if(tempout->getAutoValue()) {
tempout->resetValue (false); tempout->resetValue (false);
} else { } else {
tempout->setValue (nexttemp); tempout->setValue (nexttemp);
tempout->setAutoValue (true); tempout->setAutoValue (true);
} }
*/
greenout->setValue (nextgreen); greenout->setValue (nextgreen);
enableListener(); enableListener();
@ -1545,7 +1538,7 @@ void ColorAppearance::catmethodChanged()
adaplum->resetValue (false); adaplum->resetValue (false);
degreeout->resetValue (false); degreeout->resetValue (false);
ybout->resetValue (false); ybout->resetValue (false);
// tempout->resetValue (false); tempout->resetValue (false);
tempout->setValue (nexttemp); tempout->setValue (nexttemp);
greenout->resetValue (false); greenout->resetValue (false);
enableListener(); enableListener();
@ -1707,140 +1700,6 @@ void ColorAppearance::badpix_toggled () {
} }
*/ */
void ColorAppearance::presetcat02pressed () //keep in case of...
{
if (presetcat02->get_active ()) {
disableListener();
jlight->resetValue (false);
qbright->resetValue (false);
chroma->resetValue (false);
schroma->resetValue (false);
mchroma->resetValue (false);
rstprotection->resetValue (false);
contrast->resetValue (false);
qcontrast->resetValue (false);
colorh->resetValue (false);
tempout->resetValue (false);
greenout->resetValue (false);
ybout->resetValue (false);
tempsc->resetValue (false);
greensc->resetValue (false);
badpixsl->resetValue (false);
wbmodel->set_active (0);
illum->set_active (2);
toneCurveMode->set_active (0);
toneCurveMode2->set_active (1);
toneCurveMode3->set_active (0);
shape->reset();
shape2->reset();
shape3->reset();
gamutconn.block (true);
gamut->set_active (true);
gamutconn.block (false);
degree->setAutoValue (true);
degree->resetValue (false);
degree->setValue(90);
adapscen->resetValue (false);
adapscen->setAutoValue (true);
degreeout->resetValue (false);
degreeout->setAutoValue (true);
ybscen->resetValue (false);
ybscen->setAutoValue (true);
surrsrc->set_active (0);
wbmodel->set_active (2);
tempsc->resetValue (false);
greensc->resetValue (false);
adapscen->setValue(400.);
ybscen->setValue(18);
surround->set_active (0);
adaplum->setValue(400.);
degreeout->setValue(90);
ybout->setValue(18);
tempout->setValue (nexttemp);
/* if(tempout->getAutoValue()) {
tempout->resetValue (false);
} else {
tempout->setValue (nexttemp);
tempout->setAutoValue (true);
}
*/
greenout->setValue (nextgreen);
enableListener();
} else {
disableListener();
/* jlight->resetValue (false);
qbright->resetValue (false);
chroma->resetValue (false);
schroma->resetValue (false);
mchroma->resetValue (false);
rstprotection->resetValue (false);
contrast->resetValue (false);
qcontrast->resetValue (false);
colorh->resetValue (false);
tempout->resetValue (false);
greenout->resetValue (false);
ybout->resetValue (false);
tempsc->resetValue (false);
greensc->resetValue (false);
badpixsl->resetValue (false);
wbmodel->set_active (0);
toneCurveMode->set_active (0);
toneCurveMode2->set_active (0);
toneCurveMode3->set_active (0);
shape->reset();
shape2->reset();
shape3->reset();
gamutconn.block (true);
gamut->set_active (true);
gamutconn.block (false);
*/
degree->setAutoValue (true);
degree->resetValue (false);
adapscen->resetValue (false);
adapscen->setAutoValue (true);
degreeout->resetValue (false);
degreeout->setAutoValue (true);
ybscen->resetValue (false);
ybscen->setAutoValue (true);
surrsrc->set_active (0);
wbmodel->set_active (0);
illum->set_active (2);
tempsc->resetValue (false);
greensc->resetValue (false);
adapscen->resetValue (false);
ybscen->resetValue (false);
surround->set_active (0);
adaplum->resetValue (false);
degreeout->resetValue (false);
ybout->resetValue (false);
tempout->resetValue (false);
greenout->resetValue (false);
enableListener();
}
if (batchMode) {
if (presetcat02->get_inconsistent()) {
presetcat02->set_inconsistent (false);
presetcat02conn.block (true);
presetcat02->set_active (false);
presetcat02conn.block (false);
} else if (lastpresetcat02) {
presetcat02->set_inconsistent (true);
}
lastpresetcat02 = presetcat02->get_active ();
}
if (listener) {
if (presetcat02->get_active ()) {
listener->panelChanged (Evcatpreset, M ("GENERAL_ENABLED"));
} else {
listener->panelChanged (Evcatpreset, M ("GENERAL_DISABLED"));
}
}
}
void ColorAppearance::datacie_toggled () void ColorAppearance::datacie_toggled ()
{ {
@ -2003,9 +1862,6 @@ void ColorAppearance::autoCamChanged (double ccam, double ccamout)
void ColorAppearance::adapCamChanged (double cadap) void ColorAppearance::adapCamChanged (double cadap)
{ {
if(presetcat02->get_active()){
return;
}
idle_register.add( idle_register.add(
[this, cadap]() -> bool [this, cadap]() -> bool
@ -2020,14 +1876,14 @@ void ColorAppearance::adapCamChanged (double cadap)
void ColorAppearance::wbCamChanged (double temp, double tin) void ColorAppearance::wbCamChanged (double temp, double tin)
{ {//reactivate this function
idle_register.add( idle_register.add(
[this, temp, tin]() -> bool [this, temp, tin]() -> bool
{ {
disableListener(); disableListener();
tempout->setValue(temp); tempout->setValue(temp);
greenout->setValue(tin); greenout->setValue(tin);
enableListener(); enableListener();
return false; return false;
} }
@ -2036,9 +1892,6 @@ void ColorAppearance::wbCamChanged (double temp, double tin)
void ColorAppearance::ybCamChanged (int ybsc) void ColorAppearance::ybCamChanged (int ybsc)
{ {
if(presetcat02->get_active()){
return;
}
idle_register.add( idle_register.add(
[this, ybsc]() -> bool [this, ybsc]() -> bool
@ -2124,16 +1977,6 @@ void ColorAppearance::adjusterChanged(Adjuster* a, double newval)
void ColorAppearance::adjusterAutoToggled(Adjuster* a) void ColorAppearance::adjusterAutoToggled(Adjuster* a)
{ {
/*
if(presetcat02->get_active ()){
if(tempout->getAutoValue()) {
tempout->resetValue (false);
} else {
tempout->setValue (nexttemp);
tempout->setAutoValue (true);
}
}
*/
if (multiImage) { if (multiImage) {
if (degree->getAutoInconsistent()) { if (degree->getAutoInconsistent()) {
degree->setAutoInconsistent (false); degree->setAutoInconsistent (false);
@ -2169,7 +2012,7 @@ void ColorAppearance::adjusterAutoToggled(Adjuster* a)
ybscen->setAutoInconsistent (true); ybscen->setAutoInconsistent (true);
} }
/* lastAutotempout = tempout->getAutoValue(); lastAutotempout = tempout->getAutoValue();
if (tempout->getAutoInconsistent()) { if (tempout->getAutoInconsistent()) {
tempout->setAutoInconsistent (false); tempout->setAutoInconsistent (false);
@ -2179,7 +2022,7 @@ void ColorAppearance::adjusterAutoToggled(Adjuster* a)
} }
lastAutotempout = tempout->getAutoValue(); lastAutotempout = tempout->getAutoValue();
*/
} }
if (listener && (multiImage || getEnabled()) ) { if (listener && (multiImage || getEnabled()) ) {
@ -2223,7 +2066,7 @@ void ColorAppearance::adjusterAutoToggled(Adjuster* a)
listener->panelChanged (EvCATAutoyb, M ("GENERAL_DISABLED")); listener->panelChanged (EvCATAutoyb, M ("GENERAL_DISABLED"));
} }
} }
/*
if (a == tempout) { if (a == tempout) {
if (tempout->getAutoInconsistent()) { if (tempout->getAutoInconsistent()) {
listener->panelChanged (EvCATAutotempout, M ("GENERAL_UNCHANGED")); listener->panelChanged (EvCATAutotempout, M ("GENERAL_UNCHANGED"));
@ -2233,7 +2076,7 @@ void ColorAppearance::adjusterAutoToggled(Adjuster* a)
listener->panelChanged (EvCATAutotempout, M ("GENERAL_DISABLED")); listener->panelChanged (EvCATAutotempout, M ("GENERAL_DISABLED"));
} }
} }
*/
} }
} }
void ColorAppearance::enabledChanged () void ColorAppearance::enabledChanged ()

View File

@ -70,7 +70,6 @@ public:
bool adapCamComputed_ (); bool adapCamComputed_ ();
void ybCamChanged (int yb) override; void ybCamChanged (int yb) override;
bool ybCamComputed_ (); bool ybCamComputed_ ();
void presetcat02pressed ();
void curveChanged (CurveEditor* ce) override; void curveChanged (CurveEditor* ce) override;
void curveMode1Changed (); void curveMode1Changed ();
bool curveMode1Changed_ (); bool curveMode1Changed_ ();
@ -108,7 +107,6 @@ public:
void writeOptions (std::vector<int> &tpOpen); void writeOptions (std::vector<int> &tpOpen);
private: private:
rtengine::ProcEvent Evcatpreset;
rtengine::ProcEvent EvCATAutotempout; rtengine::ProcEvent EvCATAutotempout;
rtengine::ProcEvent EvCATillum; rtengine::ProcEvent EvCATillum;
rtengine::ProcEvent EvCATcomplex; rtengine::ProcEvent EvCATcomplex;
@ -161,8 +159,6 @@ private:
Gtk::CheckButton* tonecie; Gtk::CheckButton* tonecie;
// Gtk::CheckButton* sharpcie; // Gtk::CheckButton* sharpcie;
Gtk::Button* neutral; Gtk::Button* neutral;
Gtk::CheckButton* presetcat02;
sigc::connection presetcat02conn;
MyComboBoxText* surrsrc; MyComboBoxText* surrsrc;
sigc::connection surrsrcconn; sigc::connection surrsrcconn;
@ -200,7 +196,6 @@ private:
bool lastgamut; bool lastgamut;
bool lastdatacie; bool lastdatacie;
bool lasttonecie; bool lasttonecie;
bool lastpresetcat02;
double nexttemp; double nexttemp;
double nextgreen; double nextgreen;

View File

@ -24,6 +24,7 @@
#include "options.h" #include "options.h"
#include "../rtengine/procparams.h" #include "../rtengine/procparams.h"
#include "rtimage.h" #include "rtimage.h"
#include "eventmapper.h"
using namespace rtengine; using namespace rtengine;
using namespace procparams; using namespace procparams;
@ -55,6 +56,7 @@ ControlSpotPanel::ControlSpotPanel():
qualityMethod_(Gtk::manage(new MyComboBoxText())), qualityMethod_(Gtk::manage(new MyComboBoxText())),
//complexMethod_(Gtk::manage(new MyComboBoxText())), //complexMethod_(Gtk::manage(new MyComboBoxText())),
wavMethod_(Gtk::manage(new MyComboBoxText())), wavMethod_(Gtk::manage(new MyComboBoxText())),
avoidgamutMethod_(Gtk::manage(new MyComboBoxText())),
sensiexclu_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIEXCLU"), 0, 100, 1, 12))), sensiexclu_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIEXCLU"), 0, 100, 1, 12))),
structexclu_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL"), 0, 100, 1, 0))), structexclu_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL"), 0, 100, 1, 0))),
@ -76,15 +78,13 @@ ControlSpotPanel::ControlSpotPanel():
balanh_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BALANH"), 0.2, 2.5, 0.1, 1.0, Gtk::manage(new RTImage("rawtherapee-logo-16.png")), Gtk::manage(new RTImage("circle-red-green-small.png"))))), balanh_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BALANH"), 0.2, 2.5, 0.1, 1.0, Gtk::manage(new RTImage("rawtherapee-logo-16.png")), Gtk::manage(new RTImage("circle-red-green-small.png"))))),
colorde_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_COLORDE"), -15, 15, 2, 5, Gtk::manage(new RTImage("circle-blue-yellow-small.png")), Gtk::manage(new RTImage("circle-gray-green-small.png"))))), colorde_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_COLORDE"), -15, 15, 2, 5, Gtk::manage(new RTImage("circle-blue-yellow-small.png")), Gtk::manage(new RTImage("circle-gray-green-small.png"))))),
colorscope_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_COLORSCOPE"), 0., 100.0, 1., 30.))), colorscope_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_COLORSCOPE"), 0., 100.0, 1., 30.))),
avoidrad_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_AVOIDRAD"), 0., 30.0, 0.1, 0.7))), avoidrad_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_AVOIDRAD"), 0., 30.0, 0.1, 0.))),
scopemask_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SCOPEMASK"), 0, 100, 1, 60))), scopemask_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SCOPEMASK"), 0, 100, 1, 60))),
denoichmask_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DENOIMASK"), 0., 100., 0.5, 0))), denoichmask_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DENOIMASK"), 0., 100., 0.5, 0))),
lumask_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LUMASK"), -50, 30, 1, 10, Gtk::manage(new RTImage("circle-yellow-small.png")), Gtk::manage(new RTImage("circle-gray-small.png")) ))), lumask_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LUMASK"), -50, 30, 1, 10, Gtk::manage(new RTImage("circle-yellow-small.png")), Gtk::manage(new RTImage("circle-gray-small.png")) ))),
hishow_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_PREVSHOW")))), hishow_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_PREVSHOW")))),
activ_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ACTIVSPOT")))), activ_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ACTIVSPOT")))),
avoid_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_AVOID")))),
avoidmun_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_AVOIDMUN")))),
blwh_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_BLWH")))), blwh_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_BLWH")))),
recurs_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_RECURS")))), recurs_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_RECURS")))),
laplac_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_LAPLACC")))), laplac_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_LAPLACC")))),
@ -100,6 +100,7 @@ ControlSpotPanel::ControlSpotPanel():
preview_(Gtk::manage(new Gtk::ToggleButton(M("TP_LOCALLAB_PREVIEW")))), preview_(Gtk::manage(new Gtk::ToggleButton(M("TP_LOCALLAB_PREVIEW")))),
ctboxshape(Gtk::manage(new Gtk::Box())), ctboxshape(Gtk::manage(new Gtk::Box())),
ctboxshapemethod(Gtk::manage(new Gtk::Box())), ctboxshapemethod(Gtk::manage(new Gtk::Box())),
ctboxgamut(Gtk::manage(new Gtk::Box())),
controlPanelListener(nullptr), controlPanelListener(nullptr),
lastObject_(-1), lastObject_(-1),
@ -111,6 +112,8 @@ ControlSpotPanel::ControlSpotPanel():
excluFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_EXCLUF")))), excluFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_EXCLUF")))),
maskPrevActive(false) maskPrevActive(false)
{ {
auto m = ProcEventMapper::getInstance();
EvLocallabavoidgamutMethod = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_GAMUTMUNSEL");
const bool showtooltip = options.showtooltip; const bool showtooltip = options.showtooltip;
pack_start(*hishow_); pack_start(*hishow_);
@ -397,23 +400,30 @@ ControlSpotPanel::ControlSpotPanel():
activConn_ = activ_->signal_toggled().connect( activConn_ = activ_->signal_toggled().connect(
sigc::mem_fun(*this, &ControlSpotPanel::activChanged)); sigc::mem_fun(*this, &ControlSpotPanel::activChanged));
avoidConn_ = avoid_->signal_toggled().connect( Gtk::Label* const labelgamut = Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_AVOID") + ":"));
sigc::mem_fun(*this, &ControlSpotPanel::avoidChanged)); ctboxgamut->pack_start(*labelgamut, Gtk::PACK_SHRINK, 4);
avoidmunConn_ = avoidmun_->signal_toggled().connect( avoidgamutMethod_->append(M("TP_LOCALLAB_GAMUTNON"));
sigc::mem_fun(*this, &ControlSpotPanel::avoidmunChanged)); avoidgamutMethod_->append(M("TP_LOCALLAB_GAMUTLABRELA"));
avoidgamutMethod_->append(M("TP_LOCALLAB_GAMUTXYZABSO"));
Gtk::Frame* const avFrame = Gtk::manage(new Gtk::Frame()); avoidgamutMethod_->append(M("TP_LOCALLAB_GAMUTXYZRELA"));
avoidgamutMethod_->append(M("TP_LOCALLAB_GAMUTMUNSELL"));
avoidgamutMethod_->set_active(4);
avoidgamutconn_ = avoidgamutMethod_->signal_changed().connect(
sigc::mem_fun(
*this, &ControlSpotPanel::avoidgamutMethodChanged));
ctboxgamut->pack_start(*avoidgamutMethod_);
if (showtooltip) {
ctboxgamut->set_tooltip_text(M("TP_LOCALLAB_AVOIDCOLORSHIFT_TOOLTIP"));
}
Gtk::Frame* const avFrame = Gtk::manage(new Gtk::Frame());
ToolParamBlock* const avbox = Gtk::manage(new ToolParamBlock()); ToolParamBlock* const avbox = Gtk::manage(new ToolParamBlock());
avFrame->set_label_align(0.025, 0.5); avFrame->set_label_align(0.025, 0.5);
avFrame->set_label_widget(*avoid_); avbox->pack_start(*ctboxgamut);
avbox->pack_start(*avoidrad_); avbox->pack_start(*avoidrad_);
avbox->pack_start(*avoidmun_);
avFrame->add(*avbox); avFrame->add(*avbox);
specCaseBox->pack_start(*avFrame); specCaseBox->pack_start(*avFrame);
if (showtooltip) {
avoidmun_->set_tooltip_text(M("TP_LOCALLAB_AVOIDMUN_TOOLTIP"));
}
blwhConn_ = blwh_->signal_toggled().connect( blwhConn_ = blwh_->signal_toggled().connect(
sigc::mem_fun(*this, &ControlSpotPanel::blwhChanged)); sigc::mem_fun(*this, &ControlSpotPanel::blwhChanged));
@ -429,7 +439,6 @@ ControlSpotPanel::ControlSpotPanel():
if (showtooltip) { if (showtooltip) {
recurs_->set_tooltip_text(M("TP_LOCALLAB_RECURS_TOOLTIP")); recurs_->set_tooltip_text(M("TP_LOCALLAB_RECURS_TOOLTIP"));
avoid_->set_tooltip_text(M("TP_LOCALLAB_AVOIDCOLORSHIFT_TOOLTIP"));
} }
specCaseBox->pack_start(*recurs_); specCaseBox->pack_start(*recurs_);
@ -854,8 +863,6 @@ void ControlSpotPanel::load_ControlSpot_param()
avoidrad_->setValue((double)row[spots_.avoidrad]); avoidrad_->setValue((double)row[spots_.avoidrad]);
hishow_->set_active(row[spots_.hishow]); hishow_->set_active(row[spots_.hishow]);
activ_->set_active(row[spots_.activ]); activ_->set_active(row[spots_.activ]);
avoid_->set_active(row[spots_.avoid]);
avoidmun_->set_active(row[spots_.avoidmun]);
blwh_->set_active(row[spots_.blwh]); blwh_->set_active(row[spots_.blwh]);
recurs_->set_active(row[spots_.recurs]); recurs_->set_active(row[spots_.recurs]);
// laplac_->set_active(row[spots_.laplac]); // laplac_->set_active(row[spots_.laplac]);
@ -868,6 +875,8 @@ void ControlSpotPanel::load_ControlSpot_param()
//savrest_->set_active(row[spots_.savrest]); //savrest_->set_active(row[spots_.savrest]);
//complexMethod_->set_active(row[spots_.complexMethod]); //complexMethod_->set_active(row[spots_.complexMethod]);
wavMethod_->set_active(row[spots_.wavMethod]); wavMethod_->set_active(row[spots_.wavMethod]);
avoidgamutMethod_->set_active(row[spots_.avoidgamutMethod]);
} }
void ControlSpotPanel::controlspotChanged() void ControlSpotPanel::controlspotChanged()
@ -1055,6 +1064,34 @@ void ControlSpotPanel::spotMethodChanged()
} }
} }
void ControlSpotPanel::avoidgamutMethodChanged()
{
// Get selected control spot
const auto s = treeview_->get_selection();
if (!s->count_selected_rows()) {
return;
}
const int meth = avoidgamutMethod_->get_active_row_number();
avoidrad_->show();
if(meth == 2 || meth == 3 || meth == 4) {
avoidrad_->hide();
}
const auto iter = s->get_selected();
Gtk::TreeModel::Row row = *iter;
row[spots_.avoidgamutMethod] = avoidgamutMethod_->get_active_row_number();
// Raise event
if (listener) {
listener->panelChanged(EvLocallabavoidgamutMethod, avoidgamutMethod_->get_active_text());
}
}
void ControlSpotPanel::shapeMethodChanged() void ControlSpotPanel::shapeMethodChanged()
{ {
// printf("shapeMethodChanged\n"); // printf("shapeMethodChanged\n");
@ -1217,6 +1254,7 @@ void ControlSpotPanel::updateParamVisibility()
// Update Control Spot GUI according to shapeMethod_ combobox state (to be compliant with shapeMethodChanged function) // Update Control Spot GUI according to shapeMethod_ combobox state (to be compliant with shapeMethodChanged function)
const int method = shapeMethod_->get_active_row_number(); const int method = shapeMethod_->get_active_row_number();
const int meth = avoidgamutMethod_->get_active_row_number();
if (!batchMode) { if (!batchMode) {
if (method == 1 || method == 3) { // Symmetrical cases if (method == 1 || method == 3) { // Symmetrical cases
@ -1260,6 +1298,12 @@ void ControlSpotPanel::updateParamVisibility()
centerY_->show(); centerY_->show();
} }
if(meth == 1) {
avoidrad_->show();
} else {
avoidrad_->hide();
}
// Update Control Spot GUI according to spotMethod_ combobox state (to be compliant with spotMethodChanged function) // Update Control Spot GUI according to spotMethod_ combobox state (to be compliant with spotMethodChanged function)
if (multiImage && spotMethod_->get_active_text() == M("GENERAL_UNCHANGED")) { if (multiImage && spotMethod_->get_active_text() == M("GENERAL_UNCHANGED")) {
excluFrame->show(); excluFrame->show();
@ -1588,57 +1632,6 @@ void ControlSpotPanel::hishowChanged()
} }
void ControlSpotPanel::avoidChanged()
{
// printf("avoidChanged\n");
// Get selected control spot
const auto s = treeview_->get_selection();
if (!s->count_selected_rows()) {
return;
}
const auto iter = s->get_selected();
Gtk::TreeModel::Row row = *iter;
row[spots_.avoid] = avoid_->get_active();
// Raise event
if (listener) {
if (avoid_->get_active()) {
listener->panelChanged(Evlocallabavoid, M("GENERAL_ENABLED"));
} else {
listener->panelChanged(Evlocallabavoid, M("GENERAL_DISABLED"));
}
}
}
void ControlSpotPanel::avoidmunChanged()
{
// printf("avoidmunChanged\n");
// Get selected control spot
const auto s = treeview_->get_selection();
if (!s->count_selected_rows()) {
return;
}
const auto iter = s->get_selected();
Gtk::TreeModel::Row row = *iter;
row[spots_.avoidmun] = avoidmun_->get_active();
// Raise event
if (listener) {
if (avoidmun_->get_active()) {
listener->panelChanged(EvLocallabSpotavoidmun, M("GENERAL_ENABLED"));
} else {
listener->panelChanged(EvLocallabSpotavoidmun, M("GENERAL_DISABLED"));
}
}
}
void ControlSpotPanel::activChanged() void ControlSpotPanel::activChanged()
{ {
// printf("activChanged\n"); // printf("activChanged\n");
@ -1859,8 +1852,6 @@ void ControlSpotPanel::disableParamlistener(bool cond)
avoidrad_->block(cond); avoidrad_->block(cond);
hishowconn_.block(cond); hishowconn_.block(cond);
activConn_.block(cond); activConn_.block(cond);
avoidConn_.block(cond);
avoidmunConn_.block(cond);
blwhConn_.block(cond); blwhConn_.block(cond);
recursConn_.block(cond); recursConn_.block(cond);
laplacConn_.block(cond); laplacConn_.block(cond);
@ -1872,6 +1863,8 @@ void ControlSpotPanel::disableParamlistener(bool cond)
//savrestConn_.block(cond); //savrestConn_.block(cond);
//complexMethodconn_.block(cond); //complexMethodconn_.block(cond);
wavMethodconn_.block(cond); wavMethodconn_.block(cond);
avoidgamutconn_.block(cond);
} }
void ControlSpotPanel::setParamEditable(bool cond) void ControlSpotPanel::setParamEditable(bool cond)
@ -1906,8 +1899,6 @@ void ControlSpotPanel::setParamEditable(bool cond)
avoidrad_->set_sensitive(cond); avoidrad_->set_sensitive(cond);
hishow_->set_sensitive(cond); hishow_->set_sensitive(cond);
activ_->set_sensitive(cond); activ_->set_sensitive(cond);
avoid_->set_sensitive(cond);
avoidmun_->set_sensitive(cond);
blwh_->set_sensitive(cond); blwh_->set_sensitive(cond);
recurs_->set_sensitive(cond); recurs_->set_sensitive(cond);
laplac_->set_sensitive(cond); laplac_->set_sensitive(cond);
@ -1920,6 +1911,7 @@ void ControlSpotPanel::setParamEditable(bool cond)
//complexMethod_->set_sensitive(cond); //complexMethod_->set_sensitive(cond);
wavMethod_->set_sensitive(cond); wavMethod_->set_sensitive(cond);
preview_->set_sensitive(cond); preview_->set_sensitive(cond);
avoidgamutMethod_->set_sensitive(cond);
if (!cond) { if (!cond) {
// Reset complex parameters visibility to default state // Reset complex parameters visibility to default state
@ -2592,8 +2584,6 @@ ControlSpotPanel::SpotRow* ControlSpotPanel::getSpot(const int index)
r->lumask = row[spots_.lumask]; r->lumask = row[spots_.lumask];
r->hishow = row[spots_.hishow]; r->hishow = row[spots_.hishow];
r->activ = row[spots_.activ]; r->activ = row[spots_.activ];
r->avoid = row[spots_.avoid];
r->avoidmun = row[spots_.avoidmun];
r->blwh = row[spots_.blwh]; r->blwh = row[spots_.blwh];
r->recurs = row[spots_.recurs]; r->recurs = row[spots_.recurs];
r->laplac = row[spots_.laplac]; r->laplac = row[spots_.laplac];
@ -2601,6 +2591,7 @@ ControlSpotPanel::SpotRow* ControlSpotPanel::getSpot(const int index)
r->shortc = row[spots_.shortc]; r->shortc = row[spots_.shortc];
//r->savrest = row[spots_.savrest]; //r->savrest = row[spots_.savrest];
r->wavMethod = row[spots_.wavMethod]; r->wavMethod = row[spots_.wavMethod];
r->avoidgamutMethod = row[spots_.avoidgamutMethod];
return r; return r;
} }
@ -2725,8 +2716,6 @@ void ControlSpotPanel::addControlSpot(SpotRow* newSpot)
row[spots_.avoidrad] = newSpot->avoidrad; row[spots_.avoidrad] = newSpot->avoidrad;
row[spots_.hishow] = newSpot->hishow; row[spots_.hishow] = newSpot->hishow;
row[spots_.activ] = newSpot->activ; row[spots_.activ] = newSpot->activ;
row[spots_.avoid] = newSpot->avoid;
row[spots_.avoidmun] = newSpot->avoidmun;
row[spots_.blwh] = newSpot->blwh; row[spots_.blwh] = newSpot->blwh;
row[spots_.recurs] = newSpot->recurs; row[spots_.recurs] = newSpot->recurs;
row[spots_.laplac] = newSpot->laplac; row[spots_.laplac] = newSpot->laplac;
@ -2738,6 +2727,7 @@ void ControlSpotPanel::addControlSpot(SpotRow* newSpot)
//row[spots_.savrest] = newSpot->savrest; //row[spots_.savrest] = newSpot->savrest;
row[spots_.complexMethod] = newSpot->complexMethod; row[spots_.complexMethod] = newSpot->complexMethod;
row[spots_.wavMethod] = newSpot->wavMethod; row[spots_.wavMethod] = newSpot->wavMethod;
row[spots_.avoidgamutMethod] = newSpot->avoidgamutMethod;
updateParamVisibility(); updateParamVisibility();
disableParamlistener(false); disableParamlistener(false);
@ -2845,8 +2835,6 @@ ControlSpotPanel::ControlSpots::ControlSpots()
add(avoidrad); add(avoidrad);
add(hishow); add(hishow);
add(activ); add(activ);
add(avoid);
add(avoidmun);
add(blwh); add(blwh);
add(recurs); add(recurs);
add(laplac); add(laplac);
@ -2858,6 +2846,7 @@ ControlSpotPanel::ControlSpots::ControlSpots()
//add(savrest); //add(savrest);
add(complexMethod); add(complexMethod);
add(wavMethod); add(wavMethod);
add(avoidgamutMethod);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@ -57,6 +57,7 @@ public:
int sensiexclu; int sensiexclu;
int structexclu; int structexclu;
int shapeMethod; // 0 = Independent (mouse), 1 = Symmetrical (mouse), 2 = Independent (mouse + sliders), 3 = Symmetrical (mouse + sliders) int shapeMethod; // 0 = Independent (mouse), 1 = Symmetrical (mouse), 2 = Independent (mouse + sliders), 3 = Symmetrical (mouse + sliders)
int avoidgamutMethod;
int locX; int locX;
int locXL; int locXL;
int locY; int locY;
@ -79,8 +80,6 @@ public:
double avoidrad; double avoidrad;
bool hishow; bool hishow;
bool activ; bool activ;
bool avoid;
bool avoidmun;
bool blwh; bool blwh;
bool recurs; bool recurs;
bool laplac; bool laplac;
@ -243,7 +242,8 @@ private:
void spotMethodChanged(); void spotMethodChanged();
void shapeMethodChanged(); void shapeMethodChanged();
void qualityMethodChanged(); void qualityMethodChanged();
//void complexMethodChanged(); void avoidgamutMethodChanged();
//void complexMethodChanged();
void wavMethodChanged(); void wavMethodChanged();
void updateParamVisibility(); void updateParamVisibility();
@ -252,8 +252,6 @@ private:
void hishowChanged(); void hishowChanged();
void activChanged(); void activChanged();
void avoidChanged();
void avoidmunChanged();
void blwhChanged(); void blwhChanged();
void recursChanged(); void recursChanged();
void laplacChanged(); void laplacChanged();
@ -293,6 +291,7 @@ private:
Gtk::TreeModelColumn<int> sensiexclu; Gtk::TreeModelColumn<int> sensiexclu;
Gtk::TreeModelColumn<int> structexclu; Gtk::TreeModelColumn<int> structexclu;
Gtk::TreeModelColumn<int> shapeMethod; // 0 = Independent (mouse), 1 = Symmetrical (mouse), 2 = Independent (mouse + sliders), 3 = Symmetrical (mouse + sliders) Gtk::TreeModelColumn<int> shapeMethod; // 0 = Independent (mouse), 1 = Symmetrical (mouse), 2 = Independent (mouse + sliders), 3 = Symmetrical (mouse + sliders)
Gtk::TreeModelColumn<int> avoidgamutMethod;
Gtk::TreeModelColumn<int> locX; Gtk::TreeModelColumn<int> locX;
Gtk::TreeModelColumn<int> locXL; Gtk::TreeModelColumn<int> locXL;
Gtk::TreeModelColumn<int> locY; Gtk::TreeModelColumn<int> locY;
@ -315,8 +314,6 @@ private:
Gtk::TreeModelColumn<double> avoidrad; Gtk::TreeModelColumn<double> avoidrad;
Gtk::TreeModelColumn<bool> hishow; Gtk::TreeModelColumn<bool> hishow;
Gtk::TreeModelColumn<bool> activ; Gtk::TreeModelColumn<bool> activ;
Gtk::TreeModelColumn<bool> avoid;
Gtk::TreeModelColumn<bool> avoidmun;
Gtk::TreeModelColumn<bool> blwh; Gtk::TreeModelColumn<bool> blwh;
Gtk::TreeModelColumn<bool> recurs; Gtk::TreeModelColumn<bool> recurs;
Gtk::TreeModelColumn<bool> laplac; Gtk::TreeModelColumn<bool> laplac;
@ -347,6 +344,7 @@ private:
}; };
ControlSpots spots_; ControlSpots spots_;
rtengine::ProcEvent EvLocallabavoidgamutMethod;
// Child widgets // Child widgets
Gtk::ScrolledWindow* const scrolledwindow_; Gtk::ScrolledWindow* const scrolledwindow_;
@ -381,6 +379,8 @@ private:
//sigc::connection complexMethodconn_; //sigc::connection complexMethodconn_;
MyComboBoxText* const wavMethod_; MyComboBoxText* const wavMethod_;
sigc::connection wavMethodconn_; sigc::connection wavMethodconn_;
MyComboBoxText* const avoidgamutMethod_;
sigc::connection avoidgamutconn_;
Adjuster* const sensiexclu_; Adjuster* const sensiexclu_;
Adjuster* const structexclu_; Adjuster* const structexclu_;
@ -411,10 +411,6 @@ private:
sigc::connection hishowconn_; sigc::connection hishowconn_;
Gtk::CheckButton* const activ_; Gtk::CheckButton* const activ_;
sigc::connection activConn_; sigc::connection activConn_;
Gtk::CheckButton* const avoid_;
sigc::connection avoidConn_;
Gtk::CheckButton* const avoidmun_;
sigc::connection avoidmunConn_;
Gtk::CheckButton* const blwh_; Gtk::CheckButton* const blwh_;
sigc::connection blwhConn_; sigc::connection blwhConn_;
Gtk::CheckButton* const recurs_; Gtk::CheckButton* const recurs_;
@ -438,6 +434,7 @@ private:
Gtk::Box* const ctboxshape; Gtk::Box* const ctboxshape;
Gtk::Box* const ctboxshapemethod; Gtk::Box* const ctboxshapemethod;
Gtk::Box* const ctboxgamut;
// Internal variables // Internal variables
ControlPanelListener* controlPanelListener; ControlPanelListener* controlPanelListener;

View File

@ -905,7 +905,6 @@ EditorPanel::EditorPanel (FilePanel* filePanel)
send_to_external = Gtk::manage(new PopUpButton("", false)); send_to_external = Gtk::manage(new PopUpButton("", false));
send_to_external->set_tooltip_text(M("MAIN_BUTTON_SENDTOEDITOR_TOOLTIP")); send_to_external->set_tooltip_text(M("MAIN_BUTTON_SENDTOEDITOR_TOOLTIP"));
setExpandAlignProperties(send_to_external->buttonGroup, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL); setExpandAlignProperties(send_to_external->buttonGroup, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL);
send_to_external->addEntry("palette-brush.png", M("GENERAL_OTHER"));
updateExternalEditorWidget( updateExternalEditorWidget(
options.externalEditorIndex >= 0 ? options.externalEditorIndex : options.externalEditors.size(), options.externalEditorIndex >= 0 ? options.externalEditorIndex : options.externalEditors.size(),
options.externalEditors options.externalEditors
@ -2748,10 +2747,14 @@ void EditorPanel::tbShowHideSidePanels_managestate()
void EditorPanel::updateExternalEditorWidget(int selectedIndex, const std::vector<ExternalEditor> &editors) void EditorPanel::updateExternalEditorWidget(int selectedIndex, const std::vector<ExternalEditor> &editors)
{ {
// Remove the editors and leave the "Other" entry. // Remove the editors.
while (send_to_external->getEntryCount() > 1) { while (send_to_external->getEntryCount()) {
send_to_external->removeEntry(0); send_to_external->removeEntry(send_to_external->getEntryCount() - 1);
} }
// Create new radio button group because they cannot be reused: https://developer-old.gnome.org/gtkmm/3.16/classGtk_1_1RadioButtonGroup.html#details.
send_to_external_radio_group = Gtk::RadioButtonGroup();
// Add the editors. // Add the editors.
for (unsigned i = 0; i < editors.size(); i++) { for (unsigned i = 0; i < editors.size(); i++) {
const auto & name = editors[i].name.empty() ? Glib::ustring(" ") : editors[i].name; const auto & name = editors[i].name.empty() ? Glib::ustring(" ") : editors[i].name;
@ -2771,11 +2774,12 @@ void EditorPanel::updateExternalEditorWidget(int selectedIndex, const std::vecto
gioIcon = Gio::Icon::deserialize(Glib::VariantBase(icon_variant)); gioIcon = Gio::Icon::deserialize(Glib::VariantBase(icon_variant));
} }
send_to_external->insertEntry(i, gioIcon, name); send_to_external->insertEntry(i, gioIcon, name, &send_to_external_radio_group);
} else { } else {
send_to_external->insertEntry(i, "palette-brush.png", name); send_to_external->insertEntry(i, "palette-brush.png", name, &send_to_external_radio_group);
} }
} }
send_to_external->addEntry("palette-brush.png", M("GENERAL_OTHER"), &send_to_external_radio_group);
send_to_external->setSelected(selectedIndex); send_to_external->setSelected(selectedIndex);
send_to_external->show(); send_to_external->show();
} }

View File

@ -248,6 +248,7 @@ private:
Gtk::Button* queueimg; Gtk::Button* queueimg;
Gtk::Button* saveimgas; Gtk::Button* saveimgas;
PopUpButton* send_to_external; PopUpButton* send_to_external;
Gtk::RadioButtonGroup send_to_external_radio_group;
Gtk::Button* navSync; Gtk::Button* navSync;
Gtk::Button* navNext; Gtk::Button* navNext;
Gtk::Button* navPrev; Gtk::Button* navPrev;

View File

@ -274,7 +274,11 @@ void ExternalEditorPreferences::openFileChooserDialog()
const auto exe_filter = Gtk::FileFilter::create(); const auto exe_filter = Gtk::FileFilter::create();
exe_filter->set_name(M("FILECHOOSER_FILTER_EXECUTABLE")); exe_filter->set_name(M("FILECHOOSER_FILTER_EXECUTABLE"));
exe_filter->add_custom(Gtk::FILE_FILTER_MIME_TYPE, [](const Gtk::FileFilter::Info &info) { exe_filter->add_custom(Gtk::FILE_FILTER_MIME_TYPE, [](const Gtk::FileFilter::Info &info) {
#ifdef WIN32
return info.mime_type == "application/x-msdownload";
#else
return Gio::content_type_can_be_executable(info.mime_type); return Gio::content_type_can_be_executable(info.mime_type);
#endif
}); });
const auto all_filter = Gtk::FileFilter::create(); const auto all_filter = Gtk::FileFilter::create();
all_filter->set_name(M("FILECHOOSER_FILTER_ANY")); all_filter->set_name(M("FILECHOOSER_FILTER_ANY"));

View File

@ -318,22 +318,26 @@ bool ExtProgStore::openInPhotoshop (const Glib::ustring& fileName)
return spawnCommandAsync (cmdLine); return spawnCommandAsync (cmdLine);
} }
bool ExtProgStore::openInCustomEditor (const Glib::ustring& fileName) bool ExtProgStore::openInCustomEditor (const Glib::ustring& fileName, const Glib::ustring* command)
{ {
if (!command) {
command = &(options.customEditorProg);
}
#if defined WIN32 #if defined WIN32
const auto cmdLine = Glib::ustring("\"") + options.customEditorProg + Glib::ustring("\""); const auto cmdLine = Glib::ustring("\"") + *command + Glib::ustring("\"");
auto success = ShellExecute( NULL, "open", cmdLine.c_str(), ('"' + fileName + '"').c_str(), NULL, SW_SHOWNORMAL ); auto success = ShellExecute( NULL, "open", cmdLine.c_str(), ('"' + fileName + '"').c_str(), NULL, SW_SHOWNORMAL );
return (uintptr_t)success > 32; return (uintptr_t)success > 32;
#elif defined __APPLE__ #elif defined __APPLE__
const auto cmdLine = options.customEditorProg + Glib::ustring(" \"") + fileName + Glib::ustring("\""); const auto cmdLine = *command + Glib::ustring(" \"") + fileName + Glib::ustring("\"");
return spawnCommandAsync (cmdLine); return spawnCommandAsync (cmdLine);
#else #else
const auto cmdLine = options.customEditorProg + Glib::ustring(" ") + Glib::shell_quote(fileName); const auto cmdLine = *command + Glib::ustring(" ") + Glib::shell_quote(fileName);
return spawnCommandAsync (cmdLine); return spawnCommandAsync (cmdLine);
#endif #endif
@ -342,13 +346,30 @@ bool ExtProgStore::openInCustomEditor (const Glib::ustring& fileName)
bool ExtProgStore::openInExternalEditor(const Glib::ustring &fileName, const Glib::RefPtr<Gio::AppInfo> &editorInfo) bool ExtProgStore::openInExternalEditor(const Glib::ustring &fileName, const Glib::RefPtr<Gio::AppInfo> &editorInfo)
{ {
bool success = false;
try { try {
return editorInfo->launch(Gio::File::create_for_path(fileName)); success = editorInfo->launch(Gio::File::create_for_path(fileName));
} catch (const Glib::Error &e) { } catch (const Glib::Error &e) {
std::cerr std::cerr
<< "Error launching external editor.\n" << "Error launching external editor.\n"
<< "Error code #" << e.code() << ": " << e.what() << "Error code #" << e.code() << ": " << e.what()
<< std::endl; << std::endl;
return false; success = false;
} }
if (success) {
return true;
}
if (rtengine::settings->verbose) {
std::cout << "Unable to launch external editor with Gio. Trying custom launcher." << std::endl;
}
Glib::ustring command = editorInfo->get_commandline();
#if defined WIN32
if (command.length() > 2 && command[0] == '"' && command[command.length() - 1] == '"') {
command = command.substr(1, command.length() - 2);
}
#endif
return openInCustomEditor(fileName, &command);
} }

View File

@ -69,7 +69,7 @@ public:
static bool openInGimp (const Glib::ustring& fileName); static bool openInGimp (const Glib::ustring& fileName);
static bool openInPhotoshop (const Glib::ustring& fileName); static bool openInPhotoshop (const Glib::ustring& fileName);
static bool openInCustomEditor (const Glib::ustring& fileName); static bool openInCustomEditor (const Glib::ustring& fileName, const Glib::ustring* command = nullptr);
static bool openInExternalEditor(const Glib::ustring &fileName, const Glib::RefPtr<Gio::AppInfo> &editorInfo); static bool openInExternalEditor(const Glib::ustring &fileName, const Glib::RefPtr<Gio::AppInfo> &editorInfo);
}; };

View File

@ -1506,48 +1506,110 @@ TextOrIcon::TextOrIcon (const Glib::ustring &fname, const Glib::ustring &labelTx
} }
MyImageMenuItem::MyImageMenuItem(Glib::ustring label, Glib::ustring imageFileName) class ImageAndLabel::Impl
{ {
RTImage* itemImage = nullptr; public:
RTImage* image;
Gtk::Label* label;
if (!imageFileName.empty()) { Impl(RTImage* image, Gtk::Label* label) : image(image), label(label) {}
itemImage = Gtk::manage(new RTImage(imageFileName)); static std::unique_ptr<RTImage> createImage(const Glib::ustring& fileName);
};
std::unique_ptr<RTImage> ImageAndLabel::Impl::createImage(const Glib::ustring& fileName)
{
if (fileName.empty()) {
return nullptr;
} }
return std::unique_ptr<RTImage>(new RTImage(fileName));
construct(label, itemImage);
} }
MyImageMenuItem::MyImageMenuItem(Glib::ustring label, RTImage* itemImage) { ImageAndLabel::ImageAndLabel(const Glib::ustring& label, const Glib::ustring& imageFileName) :
construct(label, itemImage); ImageAndLabel(label, Gtk::manage(Impl::createImage(imageFileName).release()))
{
} }
void MyImageMenuItem::construct(Glib::ustring label, RTImage* itemImage) ImageAndLabel::ImageAndLabel(const Glib::ustring& label, RTImage *image) :
pimpl(new Impl(image, Gtk::manage(new Gtk::Label(label))))
{ {
box = Gtk::manage (new Gtk::Grid()); Gtk::Grid* grid = Gtk::manage(new Gtk::Grid());
this->label = Gtk::manage( new Gtk::Label(label)); grid->set_orientation(Gtk::ORIENTATION_HORIZONTAL);
box->set_orientation(Gtk::ORIENTATION_HORIZONTAL);
if (itemImage) { if (image) {
image = itemImage; grid->attach_next_to(*image, Gtk::POS_LEFT, 1, 1);
box->attach_next_to(*image, Gtk::POS_LEFT, 1, 1);
} else {
image = nullptr;
} }
box->attach_next_to(*this->label, Gtk::POS_RIGHT, 1, 1); grid->attach_next_to(*(pimpl->label), Gtk::POS_RIGHT, 1, 1);
box->set_column_spacing(4); grid->set_column_spacing(4);
box->set_row_spacing(0); grid->set_row_spacing(0);
add(*box); pack_start(*grid, Gtk::PACK_SHRINK, 0);
}
const RTImage* ImageAndLabel::getImage() const
{
return pimpl->image;
}
const Gtk::Label* ImageAndLabel::getLabel() const
{
return pimpl->label;
}
class MyImageMenuItem::Impl
{
private:
std::unique_ptr<ImageAndLabel> widget;
public:
Impl(const Glib::ustring &label, const Glib::ustring &imageFileName) :
widget(new ImageAndLabel(label, imageFileName)) {}
Impl(const Glib::ustring &label, RTImage *itemImage) :
widget(new ImageAndLabel(label, itemImage)) {}
ImageAndLabel* getWidget() const { return widget.get(); }
};
MyImageMenuItem::MyImageMenuItem(const Glib::ustring& label, const Glib::ustring& imageFileName) :
pimpl(new Impl(label, imageFileName))
{
add(*(pimpl->getWidget()));
}
MyImageMenuItem::MyImageMenuItem(const Glib::ustring& label, RTImage* itemImage) :
pimpl(new Impl(label, itemImage))
{
add(*(pimpl->getWidget()));
} }
const RTImage *MyImageMenuItem::getImage () const const RTImage *MyImageMenuItem::getImage () const
{ {
return image; return pimpl->getWidget()->getImage();
} }
const Gtk::Label* MyImageMenuItem::getLabel () const const Gtk::Label* MyImageMenuItem::getLabel () const
{ {
return label; return pimpl->getWidget()->getLabel();
}
class MyRadioImageMenuItem::Impl
{
std::unique_ptr<ImageAndLabel> widget;
public:
Impl(const Glib::ustring &label, RTImage *image) :
widget(new ImageAndLabel(label, image)) {}
ImageAndLabel* getWidget() const { return widget.get(); }
};
MyRadioImageMenuItem::MyRadioImageMenuItem(const Glib::ustring& label, RTImage *image, Gtk::RadioButton::Group& group) :
Gtk::RadioMenuItem(group),
pimpl(new Impl(label, image))
{
add(*(pimpl->getWidget()));
}
const Gtk::Label* MyRadioImageMenuItem::getLabel() const
{
return pimpl->getWidget()->getLabel();
} }
MyProgressBar::MyProgressBar(int width) : w(rtengine::max(width, 10 * RTScalable::getScale())) {} MyProgressBar::MyProgressBar(int width) : w(rtengine::max(width, 10 * RTScalable::getScale())) {}

View File

@ -494,20 +494,56 @@ public:
TextOrIcon (const Glib::ustring &filename, const Glib::ustring &labelTx, const Glib::ustring &tooltipTx); TextOrIcon (const Glib::ustring &filename, const Glib::ustring &labelTx, const Glib::ustring &tooltipTx);
}; };
class MyImageMenuItem final : public Gtk::MenuItem /**
* Widget with image and label placed horizontally.
*/
class ImageAndLabel final : public Gtk::Box
{ {
private: class Impl;
Gtk::Grid *box; std::unique_ptr<Impl> pimpl;
RTImage *image;
Gtk::Label *label;
void construct(Glib::ustring label, RTImage* image);
public: public:
MyImageMenuItem (Glib::ustring label, Glib::ustring imageFileName); ImageAndLabel(const Glib::ustring& label, const Glib::ustring& imageFileName);
MyImageMenuItem (Glib::ustring label, RTImage* image); ImageAndLabel(const Glib::ustring& label, RTImage* image);
const RTImage* getImage() const;
const Gtk::Label* getLabel() const;
};
/**
* Menu item with an image and label.
*/
class MyImageMenuItemInterface
{
public:
virtual const Gtk::Label* getLabel() const = 0;
};
/**
* Basic image menu item.
*/
class MyImageMenuItem final : public Gtk::MenuItem, public MyImageMenuItemInterface
{
class Impl;
std::unique_ptr<Impl> pimpl;
public:
MyImageMenuItem (const Glib::ustring& label, const Glib::ustring& imageFileName);
MyImageMenuItem (const Glib::ustring& label, RTImage* image);
const RTImage *getImage () const; const RTImage *getImage () const;
const Gtk::Label* getLabel () const; const Gtk::Label* getLabel() const override;
};
/**
* Image menu item with radio selector.
*/
class MyRadioImageMenuItem final : public Gtk::RadioMenuItem, public MyImageMenuItemInterface
{
class Impl;
std::unique_ptr<Impl> pimpl;
public:
MyRadioImageMenuItem(const Glib::ustring& label, RTImage* image, Gtk::RadioButton::Group& group);
const Gtk::Label* getLabel() const override;
}; };
class MyProgressBar final : public Gtk::ProgressBar class MyProgressBar final : public Gtk::ProgressBar

View File

@ -64,6 +64,7 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, TOOL_NAME, M("TP_ICM_LABEL")), iu
EvICMpreser = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_ICM_PRESER"); EvICMpreser = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_ICM_PRESER");
EvICMLabGridciexy = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_ICL_LABGRIDCIEXY"); EvICMLabGridciexy = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_ICL_LABGRIDCIEXY");
EvICMfbw = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_ICM_FBW"); EvICMfbw = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_ICM_FBW");
EvICMgamut = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_ICM_GAMUT");
isBatchMode = lastToneCurve = lastApplyLookTable = lastApplyBaselineExposureOffset = lastApplyHueSatMap = false; isBatchMode = lastToneCurve = lastApplyLookTable = lastApplyBaselineExposureOffset = lastApplyHueSatMap = false;
ipDialog = Gtk::manage(new MyFileChooserButton(M("TP_ICM_INPUTDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN)); ipDialog = Gtk::manage(new MyFileChooserButton(M("TP_ICM_INPUTDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN));
@ -265,8 +266,12 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, TOOL_NAME, M("TP_ICM_LABEL")), iu
wprimBox->pack_start(*wprim, Gtk::PACK_EXPAND_WIDGET); wprimBox->pack_start(*wprim, Gtk::PACK_EXPAND_WIDGET);
fbw = Gtk::manage(new Gtk::CheckButton((M("TP_ICM_FBW")))); fbw = Gtk::manage(new Gtk::CheckButton((M("TP_ICM_FBW"))));
fbw->set_active(true); fbw->set_active(true);
gamut = Gtk::manage(new Gtk::CheckButton((M("TP_ICM_GAMUT"))));
gamut->set_active(false);
trcProfVBox->pack_start(*wprimBox, Gtk::PACK_EXPAND_WIDGET); trcProfVBox->pack_start(*wprimBox, Gtk::PACK_EXPAND_WIDGET);
trcProfVBox->pack_start(*fbw, Gtk::PACK_EXPAND_WIDGET); trcProfVBox->pack_start(*fbw, Gtk::PACK_EXPAND_WIDGET);
trcProfVBox->pack_start(*gamut, Gtk::PACK_EXPAND_WIDGET);
neutral = Gtk::manage (new Gtk::Button (M ("TP_ICM_NEUTRAL"))); neutral = Gtk::manage (new Gtk::Button (M ("TP_ICM_NEUTRAL")));
setExpandAlignProperties (neutral, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); setExpandAlignProperties (neutral, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
@ -470,6 +475,7 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, TOOL_NAME, M("TP_ICM_LABEL")), iu
wprimconn = wprim->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::wprimChanged)); wprimconn = wprim->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::wprimChanged));
fbwconn = fbw->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::fbwChanged)); fbwconn = fbw->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::fbwChanged));
gamutconn = gamut->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::gamutChanged));
obpcconn = obpc->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::oBPCChanged)); obpcconn = obpc->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::oBPCChanged));
tcurveconn = ckbToneCurve->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::toneCurveChanged)); tcurveconn = ckbToneCurve->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::toneCurveChanged));
ltableconn = ckbApplyLookTable->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::applyLookTableChanged)); ltableconn = ckbApplyLookTable->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::applyLookTableChanged));
@ -515,6 +521,7 @@ void ICMPanel::neutral_pressed ()
wSlope->setValue(defPar.workingTRCSlope);//12.92 wSlope->setValue(defPar.workingTRCSlope);//12.92
preser->setValue(defPar.preser); preser->setValue(defPar.preser);
fbw->set_active(defPar.fbw); fbw->set_active(defPar.fbw);
gamut->set_active(defPar.gamut);
wTRC->set_active(toUnderlying(ColorManagementParams::WorkingTrc::NONE));//reset to none wTRC->set_active(toUnderlying(ColorManagementParams::WorkingTrc::NONE));//reset to none
will->set_active(toUnderlying(ColorManagementParams::Illuminant::DEFAULT));//reset to default - after wprim will->set_active(toUnderlying(ColorManagementParams::Illuminant::DEFAULT));//reset to default - after wprim
} }
@ -767,6 +774,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
ConnectionBlocker obpcconn_(obpcconn); ConnectionBlocker obpcconn_(obpcconn);
ConnectionBlocker fbwconn_(fbwconn); ConnectionBlocker fbwconn_(fbwconn);
ConnectionBlocker gamutconn_(gamutconn);
ConnectionBlocker ipc_(ipc); ConnectionBlocker ipc_(ipc);
ConnectionBlocker tcurveconn_(tcurveconn); ConnectionBlocker tcurveconn_(tcurveconn);
ConnectionBlocker ltableconn_(ltableconn); ConnectionBlocker ltableconn_(ltableconn);
@ -840,6 +848,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
obpc->set_active(pp->icm.outputBPC); obpc->set_active(pp->icm.outputBPC);
fbw->set_active(pp->icm.fbw); fbw->set_active(pp->icm.fbw);
gamut->set_active(pp->icm.gamut);
ckbToneCurve->set_active(pp->icm.toneCurve); ckbToneCurve->set_active(pp->icm.toneCurve);
lastToneCurve = pp->icm.toneCurve; lastToneCurve = pp->icm.toneCurve;
ckbApplyLookTable->set_active(pp->icm.applyLookTable); ckbApplyLookTable->set_active(pp->icm.applyLookTable);
@ -864,6 +873,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
iunchanged->set_active(!pedited->icm.inputProfile); iunchanged->set_active(!pedited->icm.inputProfile);
obpc->set_inconsistent(!pedited->icm.outputBPC); obpc->set_inconsistent(!pedited->icm.outputBPC);
fbw->set_inconsistent(!pedited->icm.fbw); fbw->set_inconsistent(!pedited->icm.fbw);
gamut->set_inconsistent(!pedited->icm.gamut);
ckbToneCurve->set_inconsistent(!pedited->icm.toneCurve); ckbToneCurve->set_inconsistent(!pedited->icm.toneCurve);
ckbApplyLookTable->set_inconsistent(!pedited->icm.applyLookTable); ckbApplyLookTable->set_inconsistent(!pedited->icm.applyLookTable);
ckbApplyBaselineExposureOffset->set_inconsistent(!pedited->icm.applyBaselineExposureOffset); ckbApplyBaselineExposureOffset->set_inconsistent(!pedited->icm.applyBaselineExposureOffset);
@ -922,6 +932,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
willulab->set_sensitive(false); willulab->set_sensitive(false);
wprim->set_sensitive(false); wprim->set_sensitive(false);
fbw->set_sensitive(false); fbw->set_sensitive(false);
gamut->set_sensitive(false);
wprimlab->set_sensitive(false); wprimlab->set_sensitive(false);
riaHBox->set_sensitive(false); riaHBox->set_sensitive(false);
redFrame->hide(); redFrame->hide();
@ -933,6 +944,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
willulab->set_sensitive(true); willulab->set_sensitive(true);
wprim->set_sensitive(true); wprim->set_sensitive(true);
fbw->set_sensitive(true); fbw->set_sensitive(true);
gamut->set_sensitive(true);
wprimlab->set_sensitive(true); wprimlab->set_sensitive(true);
if (ColorManagementParams::Primaries(wprim->get_active_row_number()) == ColorManagementParams::Primaries::DEFAULT) { if (ColorManagementParams::Primaries(wprim->get_active_row_number()) == ColorManagementParams::Primaries::DEFAULT) {
redFrame->hide(); redFrame->hide();
@ -975,6 +987,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
willulab->set_sensitive(true); willulab->set_sensitive(true);
wprim->set_sensitive(true); wprim->set_sensitive(true);
fbw->set_sensitive(true); fbw->set_sensitive(true);
gamut->set_sensitive(true);
wprimlab->set_sensitive(true); wprimlab->set_sensitive(true);
wGamma->set_sensitive(false); wGamma->set_sensitive(false);
wSlope->set_sensitive(false); wSlope->set_sensitive(false);
@ -992,6 +1005,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
willulab->set_sensitive(true); willulab->set_sensitive(true);
wprim->set_sensitive(true); wprim->set_sensitive(true);
fbw->set_sensitive(true); fbw->set_sensitive(true);
gamut->set_sensitive(true);
wprimlab->set_sensitive(true); wprimlab->set_sensitive(true);
wGamma->set_sensitive(false); wGamma->set_sensitive(false);
wSlope->set_sensitive(false); wSlope->set_sensitive(false);
@ -1009,6 +1023,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
willulab->set_sensitive(true); willulab->set_sensitive(true);
wprim->set_sensitive(true); wprim->set_sensitive(true);
fbw->set_sensitive(true); fbw->set_sensitive(true);
gamut->set_sensitive(true);
wprimlab->set_sensitive(true); wprimlab->set_sensitive(true);
redFrame->show(); redFrame->show();
wGamma->set_sensitive(false); wGamma->set_sensitive(false);
@ -1027,6 +1042,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
willulab->set_sensitive(true); willulab->set_sensitive(true);
wprim->set_sensitive(true); wprim->set_sensitive(true);
fbw->set_sensitive(true); fbw->set_sensitive(true);
gamut->set_sensitive(true);
wprimlab->set_sensitive(true); wprimlab->set_sensitive(true);
riaHBox->set_sensitive(true); riaHBox->set_sensitive(true);
if (ColorManagementParams::Primaries(wprim->get_active_row_number()) == ColorManagementParams::Primaries::DEFAULT) { if (ColorManagementParams::Primaries(wprim->get_active_row_number()) == ColorManagementParams::Primaries::DEFAULT) {
@ -1044,6 +1060,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
willulab->set_sensitive(true); willulab->set_sensitive(true);
wprim->set_sensitive(true); wprim->set_sensitive(true);
fbw->set_sensitive(true); fbw->set_sensitive(true);
gamut->set_sensitive(true);
wprimlab->set_sensitive(true); wprimlab->set_sensitive(true);
wGamma->set_sensitive(false); wGamma->set_sensitive(false);
wSlope->set_sensitive(false); wSlope->set_sensitive(false);
@ -1145,6 +1162,7 @@ void ICMPanel::write(ProcParams* pp, ParamsEdited* pedited)
pp->icm.applyHueSatMap = ckbApplyHueSatMap->get_active(); pp->icm.applyHueSatMap = ckbApplyHueSatMap->get_active();
pp->icm.outputBPC = obpc->get_active(); pp->icm.outputBPC = obpc->get_active();
pp->icm.fbw = fbw->get_active(); pp->icm.fbw = fbw->get_active();
pp->icm.gamut = gamut->get_active();
pp->icm.workingTRCGamma = wGamma->getValue(); pp->icm.workingTRCGamma = wGamma->getValue();
pp->icm.workingTRCSlope = wSlope->getValue(); pp->icm.workingTRCSlope = wSlope->getValue();
pp->icm.redx = redx->getValue(); pp->icm.redx = redx->getValue();
@ -1164,6 +1182,7 @@ void ICMPanel::write(ProcParams* pp, ParamsEdited* pedited)
pedited->icm.aRendIntent = aRendIntent->getSelected() < 4; pedited->icm.aRendIntent = aRendIntent->getSelected() < 4;
pedited->icm.outputBPC = !obpc->get_inconsistent(); pedited->icm.outputBPC = !obpc->get_inconsistent();
pedited->icm.fbw = !fbw->get_inconsistent(); pedited->icm.fbw = !fbw->get_inconsistent();
pedited->icm.gamut = !gamut->get_inconsistent();
pedited->icm.dcpIlluminant = dcpIll->get_active_text() != M("GENERAL_UNCHANGED"); pedited->icm.dcpIlluminant = dcpIll->get_active_text() != M("GENERAL_UNCHANGED");
pedited->icm.toneCurve = !ckbToneCurve->get_inconsistent(); pedited->icm.toneCurve = !ckbToneCurve->get_inconsistent();
pedited->icm.applyLookTable = !ckbApplyLookTable->get_inconsistent(); pedited->icm.applyLookTable = !ckbApplyLookTable->get_inconsistent();
@ -1270,6 +1289,7 @@ void ICMPanel::wtrcinChanged()
willulab->set_sensitive(false); willulab->set_sensitive(false);
wprim->set_sensitive(false); wprim->set_sensitive(false);
fbw->set_sensitive(false); fbw->set_sensitive(false);
gamut->set_sensitive(false);
wprimlab->set_sensitive(false); wprimlab->set_sensitive(false);
redFrame->hide(); redFrame->hide();
riaHBox->set_sensitive(false); riaHBox->set_sensitive(false);
@ -1280,6 +1300,7 @@ void ICMPanel::wtrcinChanged()
will->set_sensitive(false); will->set_sensitive(false);
wprim->set_sensitive(true); wprim->set_sensitive(true);
fbw->set_sensitive(true); fbw->set_sensitive(true);
gamut->set_sensitive(true);
wprimlab->set_sensitive(true); wprimlab->set_sensitive(true);
willulab->set_sensitive(true); willulab->set_sensitive(true);
if (ColorManagementParams::Primaries(wprim->get_active_row_number()) == ColorManagementParams::Primaries::DEFAULT) { if (ColorManagementParams::Primaries(wprim->get_active_row_number()) == ColorManagementParams::Primaries::DEFAULT) {
@ -1313,6 +1334,7 @@ void ICMPanel::wtrcinChanged()
willulab->set_sensitive(true); willulab->set_sensitive(true);
wprim->set_sensitive(true); wprim->set_sensitive(true);
fbw->set_sensitive(true); fbw->set_sensitive(true);
gamut->set_sensitive(true);
wprimlab->set_sensitive(true); wprimlab->set_sensitive(true);
wGamma->set_sensitive(false); wGamma->set_sensitive(false);
wSlope->set_sensitive(false); wSlope->set_sensitive(false);
@ -1338,6 +1360,7 @@ void ICMPanel::wtrcinChanged()
willulab->set_sensitive(true); willulab->set_sensitive(true);
wprim->set_sensitive(true); wprim->set_sensitive(true);
fbw->set_sensitive(true); fbw->set_sensitive(true);
gamut->set_sensitive(true);
wGamma->set_sensitive(false); wGamma->set_sensitive(false);
wSlope->set_sensitive(false); wSlope->set_sensitive(false);
riaHBox->set_sensitive(true); riaHBox->set_sensitive(true);
@ -1364,6 +1387,7 @@ void ICMPanel::wtrcinChanged()
willulab->set_sensitive(true); willulab->set_sensitive(true);
wprim->set_sensitive(true); wprim->set_sensitive(true);
fbw->set_sensitive(true); fbw->set_sensitive(true);
gamut->set_sensitive(true);
wprimlab->set_sensitive(true); wprimlab->set_sensitive(true);
wGamma->set_sensitive(false); wGamma->set_sensitive(false);
wSlope->set_sensitive(false); wSlope->set_sensitive(false);
@ -1391,6 +1415,7 @@ void ICMPanel::wtrcinChanged()
willulab->set_sensitive(true); willulab->set_sensitive(true);
wprim->set_sensitive(true); wprim->set_sensitive(true);
fbw->set_sensitive(true); fbw->set_sensitive(true);
gamut->set_sensitive(true);
wprimlab->set_sensitive(true); wprimlab->set_sensitive(true);
wGamma->set_sensitive(false); wGamma->set_sensitive(false);
wSlope->set_sensitive(false); wSlope->set_sensitive(false);
@ -1418,6 +1443,7 @@ void ICMPanel::wtrcinChanged()
willulab->set_sensitive(true); willulab->set_sensitive(true);
wprim->set_sensitive(true); wprim->set_sensitive(true);
fbw->set_sensitive(true); fbw->set_sensitive(true);
gamut->set_sensitive(true);
wprimlab->set_sensitive(true); wprimlab->set_sensitive(true);
wGamma->set_sensitive(false); wGamma->set_sensitive(false);
wSlope->set_sensitive(false); wSlope->set_sensitive(false);
@ -2025,6 +2051,33 @@ void ICMPanel::fbwChanged()
} }
} }
void ICMPanel::gamutChanged()
{
if (multiImage) {
if (gamut->get_inconsistent()) {
gamut->set_inconsistent(false);
gamutconn.block(true);
gamut->set_active(false);
gamutconn.block(false);
} else if (lastgamut) {
gamut->set_inconsistent(true);
}
lastgamut = gamut->get_active();
}
if (listener) {
if (gamut->get_inconsistent()) {
listener->panelChanged(EvICMgamut, M("GENERAL_UNCHANGED"));
} else if (fbw->get_active()) {
listener->panelChanged(EvICMgamut, M("GENERAL_ENABLED"));
} else {
listener->panelChanged(EvICMgamut, M("GENERAL_DISABLED"));
}
}
}
void ICMPanel::setRawMeta(bool raw, const rtengine::FramesData* pMeta) void ICMPanel::setRawMeta(bool raw, const rtengine::FramesData* pMeta)
{ {

View File

@ -81,6 +81,8 @@ protected:
bool lastfbw; bool lastfbw;
sigc::connection fbwconn; sigc::connection fbwconn;
bool isBatchMode; bool isBatchMode;
bool lastgamut;
sigc::connection gamutconn;
private: private:
rtengine::ProcEvent EvICMprimariMethod; rtengine::ProcEvent EvICMprimariMethod;
@ -107,6 +109,7 @@ private:
rtengine::ProcEvent EvICMpreser; rtengine::ProcEvent EvICMpreser;
rtengine::ProcEvent EvICMLabGridciexy; rtengine::ProcEvent EvICMLabGridciexy;
rtengine::ProcEvent EvICMfbw; rtengine::ProcEvent EvICMfbw;
rtengine::ProcEvent EvICMgamut;
LabGrid *labgridcie; LabGrid *labgridcie;
IdleRegister idle_register; IdleRegister idle_register;
@ -121,6 +124,7 @@ private:
Gtk::Box* iVBox; Gtk::Box* iVBox;
Gtk::Box* wTRCBox; Gtk::Box* wTRCBox;
Gtk::CheckButton* fbw; Gtk::CheckButton* fbw;
Gtk::CheckButton* gamut;
Gtk::CheckButton* obpc; Gtk::CheckButton* obpc;
Gtk::RadioButton* inone; Gtk::RadioButton* inone;
@ -198,6 +202,7 @@ public:
void aiChanged(int n); void aiChanged(int n);
void oBPCChanged(); void oBPCChanged();
void fbwChanged(); void fbwChanged();
void gamutChanged();
void ipChanged(); void ipChanged();
void ipSelectionChanged(); void ipSelectionChanged();
void dcpIlluminantChanged(); void dcpIlluminantChanged();

View File

@ -19,6 +19,7 @@
#include <iomanip> #include <iomanip>
#include "labcurve.h" #include "labcurve.h"
#include "eventmapper.h"
#include "curveeditor.h" #include "curveeditor.h"
#include "curveeditorgroup.h" #include "curveeditorgroup.h"
@ -34,61 +35,80 @@ using namespace rtengine::procparams;
const Glib::ustring LCurve::TOOL_NAME = "labcurves"; const Glib::ustring LCurve::TOOL_NAME = "labcurves";
LCurve::LCurve () : FoldableToolPanel(this, TOOL_NAME, M("TP_LABCURVE_LABEL"), false, true) LCurve::LCurve() : FoldableToolPanel(this, TOOL_NAME, M("TP_LABCURVE_LABEL"), false, true)
{ {
brightness = Gtk::manage (new Adjuster (M("TP_LABCURVE_BRIGHTNESS"), -100., 100., 1., 0.)); auto m = ProcEventMapper::getInstance();
contrast = Gtk::manage (new Adjuster (M("TP_LABCURVE_CONTRAST"), -100., 100., 1., 0.)); Evgamutmunsell = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_GAMUTMUNSEL");
chromaticity = Gtk::manage (new Adjuster (M("TP_LABCURVE_CHROMATICITY"), -100., 100., 1., 0.)); CurveListener::setMulti(true);
brightness = Gtk::manage(new Adjuster(M("TP_LABCURVE_BRIGHTNESS"), -100., 100., 1., 0.));
contrast = Gtk::manage(new Adjuster(M("TP_LABCURVE_CONTRAST"), -100., 100., 1., 0.));
chromaticity = Gtk::manage(new Adjuster(M("TP_LABCURVE_CHROMATICITY"), -100., 100., 1., 0.));
chromaticity->set_tooltip_markup(M("TP_LABCURVE_CHROMA_TOOLTIP")); chromaticity->set_tooltip_markup(M("TP_LABCURVE_CHROMA_TOOLTIP"));
pack_start (*brightness); pack_start(*brightness);
brightness->show (); brightness->show();
pack_start (*contrast); pack_start(*contrast);
contrast->show (); contrast->show();
pack_start (*chromaticity); pack_start(*chromaticity);
chromaticity->show (); chromaticity->show();
brightness->setAdjusterListener (this); brightness->setAdjusterListener(this);
contrast->setAdjusterListener (this); contrast->setAdjusterListener(this);
chromaticity->setAdjusterListener (this); chromaticity->setAdjusterListener(this);
brightness->setLogScale(2, 0, true); brightness->setLogScale(2, 0, true);
contrast->setLogScale(2, 0, true); contrast->setLogScale(2, 0, true);
chromaticity->setLogScale(2, 0, true); chromaticity->setLogScale(2, 0, true);
//%%%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%%%
Gtk::Separator* hsep2 = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); Gtk::Separator* hsep2 = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL));
hsep2->show (); hsep2->show();
pack_start (*hsep2, Gtk::PACK_EXPAND_WIDGET, 4); pack_start(*hsep2, Gtk::PACK_EXPAND_WIDGET, 4);
avoidcolorshift = Gtk::manage (new Gtk::CheckButton (M("TP_LABCURVE_AVOIDCOLORSHIFT")));
avoidcolorshift->set_tooltip_text (M("TP_LABCURVE_AVOIDCOLORSHIFT_TOOLTIP"));
pack_start (*avoidcolorshift, Gtk::PACK_SHRINK, 4);
lcredsk = Gtk::manage (new Gtk::CheckButton (M("TP_LABCURVE_LCREDSK")));
lcredsk->set_tooltip_markup (M("TP_LABCURVE_LCREDSK_TOOLTIP"));
pack_start (*lcredsk);
rstprotection = Gtk::manage ( new Adjuster (M("TP_LABCURVE_RSTPROTECTION"), 0., 100., 0.1, 0.) );
pack_start (*rstprotection);
rstprotection->show ();
rstprotection->setAdjusterListener (this); Gtk::Box* metHBox = Gtk::manage(new Gtk::Box());
rstprotection->set_tooltip_text (M("TP_LABCURVE_RSTPRO_TOOLTIP")); metHBox->set_spacing(2);
Gtk::Label* metLabel = Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_AVOID") + ":"));
metHBox->pack_start(*metLabel, Gtk::PACK_SHRINK);
acconn = avoidcolorshift->signal_toggled().connect( sigc::mem_fun(*this, &LCurve::avoidcolorshift_toggled) ); gamutmunselmethod = Gtk::manage(new MyComboBoxText());
lcconn = lcredsk->signal_toggled().connect( sigc::mem_fun(*this, &LCurve::lcredsk_toggled) ); gamutmunselmethod->append(M("TP_LOCALLAB_GAMUTNON"));
gamutmunselmethod->append(M("TP_LOCALLAB_GAMUTLABRELA"));
gamutmunselmethod->append(M("TP_LOCALLAB_GAMUTXYZABSO"));
gamutmunselmethod->append(M("TP_LOCALLAB_GAMUTXYZRELA"));
gamutmunselmethod->append(M("TP_LOCALLAB_GAMUTMUNSELL"));
gamutmunselmethod->set_active(4);
gamutmunselmethod->set_tooltip_text(M("TP_LOCALLAB_AVOIDCOLORSHIFT_TOOLTIP"));
metHBox->pack_start(*gamutmunselmethod);
pack_start(*metHBox);
gamutmunselmethodconn = gamutmunselmethod->signal_changed().connect(sigc::mem_fun(*this, &LCurve::gamutmunselChanged));
lcredsk = Gtk::manage(new Gtk::CheckButton(M("TP_LABCURVE_LCREDSK")));
lcredsk->set_tooltip_markup(M("TP_LABCURVE_LCREDSK_TOOLTIP"));
pack_start(*lcredsk);
rstprotection = Gtk::manage(new Adjuster(M("TP_LABCURVE_RSTPROTECTION"), 0., 100., 0.1, 0.));
pack_start(*rstprotection);
rstprotection->show();
rstprotection->setAdjusterListener(this);
rstprotection->set_tooltip_text(M("TP_LABCURVE_RSTPRO_TOOLTIP"));
lcconn = lcredsk->signal_toggled().connect(sigc::mem_fun(*this, &LCurve::lcredsk_toggled));
//%%%%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%%%%
Gtk::Separator* hsep3 = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); Gtk::Separator* hsep3 = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL));
hsep3->show (); hsep3->show();
pack_start (*hsep3, Gtk::PACK_EXPAND_WIDGET, 4); pack_start(*hsep3, Gtk::PACK_EXPAND_WIDGET, 4);
curveEditorG = new CurveEditorGroup (options.lastLabCurvesDir); curveEditorG = new CurveEditorGroup(options.lastLabCurvesDir);
curveEditorG->setCurveListener (this); curveEditorG->setCurveListener(this);
lshape = static_cast<DiagonalCurveEditor*>(curveEditorG->addCurve(CT_Diagonal, "L*")); lshape = static_cast<DiagonalCurveEditor*>(curveEditorG->addCurve(CT_Diagonal, "L*"));
lshape->setTooltip(M("TP_LABCURVE_CURVEEDITOR_LL_TOOLTIP")); lshape->setTooltip(M("TP_LABCURVE_CURVEEDITOR_LL_TOOLTIP"));
@ -218,88 +238,111 @@ LCurve::LCurve () : FoldableToolPanel(this, TOOL_NAME, M("TP_LABCURVE_LABEL"), f
// This will add the reset button at the end of the curveType buttons // This will add the reset button at the end of the curveType buttons
curveEditorG->curveListComplete(); curveEditorG->curveListComplete();
pack_start (*curveEditorG, Gtk::PACK_SHRINK, 4); pack_start(*curveEditorG, Gtk::PACK_SHRINK, 4);
Gtk::Separator* hsepdh = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); Gtk::Separator* hsepdh = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL));
hsepdh->show (); hsepdh->show();
pack_start (*hsepdh, Gtk::PACK_EXPAND_WIDGET, 4); pack_start(*hsepdh, Gtk::PACK_EXPAND_WIDGET, 4);
show_all_children();
} }
LCurve::~LCurve () LCurve::~LCurve()
{ {
delete curveEditorG; delete curveEditorG;
} }
void LCurve::read (const ProcParams* pp, const ParamsEdited* pedited) void LCurve::read(const ProcParams* pp, const ParamsEdited* pedited)
{ {
disableListener (); disableListener();
gamutmunselmethodconn.block(true);
brightness->setValue(pp->labCurve.brightness);
contrast->setValue(pp->labCurve.contrast);
chromaticity->setValue(pp->labCurve.chromaticity);
adjusterChanged(chromaticity, pp->labCurve.chromaticity); // To update the GUI sensitiveness
//%%%%%%%%%%%%%%%%%%%%%%
rstprotection->setValue(pp->labCurve.rstprotection);
bwtconn.block(true);
lcconn.block(true);
lcredsk->set_active(pp->labCurve.lcredsk);
bwtconn.block(false);
lcconn.block(false);
lastLCVal = pp->labCurve.lcredsk;
//%%%%%%%%%%%%%%%%%%%%%%
lshape->setCurve(pp->labCurve.lcurve);
ashape->setCurve(pp->labCurve.acurve);
bshape->setCurve(pp->labCurve.bcurve);
ccshape->setCurve(pp->labCurve.cccurve);
chshape->setCurve(pp->labCurve.chcurve);
lhshape->setCurve(pp->labCurve.lhcurve);
hhshape->setCurve(pp->labCurve.hhcurve);
lcshape->setCurve(pp->labCurve.lccurve);
clshape->setCurve(pp->labCurve.clcurve);
if (pedited && !pedited->labCurve.gamutmunselmethod) {
gamutmunselmethod->set_active(4); // "Unchanged"
} else if (pp->labCurve.gamutmunselmethod == "NONE") {
gamutmunselmethod->set_active(0);
} else if (pp->labCurve.gamutmunselmethod == "LAB") {
gamutmunselmethod->set_active(1);
} else if (pp->labCurve.gamutmunselmethod == "XYZ") {
gamutmunselmethod->set_active(2);
} else if (pp->labCurve.gamutmunselmethod == "XYZREL") {
gamutmunselmethod->set_active(3);
} else if (pp->labCurve.gamutmunselmethod == "MUN") {
gamutmunselmethod->set_active(4);
}
gamutmunselChanged();
if (pedited) { if (pedited) {
brightness->setEditedState (pedited->labCurve.brightness ? Edited : UnEdited); brightness->setEditedState(pedited->labCurve.brightness ? Edited : UnEdited);
contrast->setEditedState (pedited->labCurve.contrast ? Edited : UnEdited); contrast->setEditedState(pedited->labCurve.contrast ? Edited : UnEdited);
chromaticity->setEditedState (pedited->labCurve.chromaticity ? Edited : UnEdited); chromaticity->setEditedState(pedited->labCurve.chromaticity ? Edited : UnEdited);
//%%%%%%%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%%%%%%%
rstprotection->setEditedState (pedited->labCurve.rstprotection ? Edited : UnEdited); rstprotection->setEditedState(pedited->labCurve.rstprotection ? Edited : UnEdited);
avoidcolorshift->set_inconsistent (!pedited->labCurve.avoidcolorshift); lcredsk->set_inconsistent(!pedited->labCurve.lcredsk);
lcredsk->set_inconsistent (!pedited->labCurve.lcredsk);
//%%%%%%%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%%%%%%%
lshape->setUnChanged (!pedited->labCurve.lcurve); lshape->setUnChanged(!pedited->labCurve.lcurve);
ashape->setUnChanged (!pedited->labCurve.acurve); ashape->setUnChanged(!pedited->labCurve.acurve);
bshape->setUnChanged (!pedited->labCurve.bcurve); bshape->setUnChanged(!pedited->labCurve.bcurve);
ccshape->setUnChanged (!pedited->labCurve.cccurve); ccshape->setUnChanged(!pedited->labCurve.cccurve);
chshape->setUnChanged (!pedited->labCurve.chcurve); chshape->setUnChanged(!pedited->labCurve.chcurve);
lhshape->setUnChanged (!pedited->labCurve.lhcurve); lhshape->setUnChanged(!pedited->labCurve.lhcurve);
hhshape->setUnChanged (!pedited->labCurve.hhcurve); hhshape->setUnChanged(!pedited->labCurve.hhcurve);
lcshape->setUnChanged (!pedited->labCurve.lccurve); lcshape->setUnChanged(!pedited->labCurve.lccurve);
clshape->setUnChanged (!pedited->labCurve.clcurve); clshape->setUnChanged(!pedited->labCurve.clcurve);
if (!pedited->labCurve.gamutmunselmethod) {
gamutmunselmethod->set_active_text(M("GENERAL_UNCHANGED"));
}
set_inconsistent(multiImage && !pedited->labCurve.enabled); set_inconsistent(multiImage && !pedited->labCurve.enabled);
} }
brightness->setValue (pp->labCurve.brightness); gamutmunselmethodconn.block(false);
contrast->setValue (pp->labCurve.contrast);
chromaticity->setValue (pp->labCurve.chromaticity);
adjusterChanged(chromaticity, pp->labCurve.chromaticity); // To update the GUI sensitiveness
//%%%%%%%%%%%%%%%%%%%%%%
rstprotection->setValue (pp->labCurve.rstprotection);
bwtconn.block (true);
acconn.block (true);
lcconn.block (true);
avoidcolorshift->set_active (pp->labCurve.avoidcolorshift);
lcredsk->set_active (pp->labCurve.lcredsk);
bwtconn.block (false);
acconn.block (false);
lcconn.block (false);
lastACVal = pp->labCurve.avoidcolorshift;
lastLCVal = pp->labCurve.lcredsk;
//%%%%%%%%%%%%%%%%%%%%%%
lshape->setCurve (pp->labCurve.lcurve);
ashape->setCurve (pp->labCurve.acurve);
bshape->setCurve (pp->labCurve.bcurve);
ccshape->setCurve (pp->labCurve.cccurve);
chshape->setCurve (pp->labCurve.chcurve);
lhshape->setCurve (pp->labCurve.lhcurve);
hhshape->setCurve (pp->labCurve.hhcurve);
lcshape->setCurve (pp->labCurve.lccurve);
clshape->setCurve (pp->labCurve.clcurve);
setEnabled(pp->labCurve.enabled); setEnabled(pp->labCurve.enabled);
queue_draw(); queue_draw();
enableListener (); enableListener();
} }
void LCurve::autoOpenCurve ()
void LCurve::autoOpenCurve()
{ {
// Open up the first curve if selected // Open up the first curve if selected
bool active = lshape->openIfNonlinear(); bool active = lshape->openIfNonlinear();
@ -338,7 +381,7 @@ void LCurve::autoOpenCurve ()
} }
void LCurve::setEditProvider (EditDataProvider *provider) void LCurve::setEditProvider(EditDataProvider *provider)
{ {
lshape->setEditProvider(provider); lshape->setEditProvider(provider);
ccshape->setEditProvider(provider); ccshape->setEditProvider(provider);
@ -353,127 +396,128 @@ void LCurve::setEditProvider (EditDataProvider *provider)
} }
void LCurve::write (ProcParams* pp, ParamsEdited* pedited) void LCurve::write(ProcParams* pp, ParamsEdited* pedited)
{ {
pp->labCurve.enabled = getEnabled(); pp->labCurve.enabled = getEnabled();
pp->labCurve.brightness = brightness->getValue ();
pp->labCurve.contrast = (int)contrast->getValue ();
pp->labCurve.chromaticity = (int)chromaticity->getValue ();
//%%%%%%%%%%%%%%%%%%%%%%
pp->labCurve.avoidcolorshift = avoidcolorshift->get_active ();
pp->labCurve.lcredsk = lcredsk->get_active ();
pp->labCurve.rstprotection = rstprotection->getValue (); pp->labCurve.brightness = brightness->getValue();
pp->labCurve.contrast = (int)contrast->getValue();
pp->labCurve.chromaticity = (int)chromaticity->getValue();
//%%%%%%%%%%%%%%%%%%%%%%
pp->labCurve.lcredsk = lcredsk->get_active();
pp->labCurve.rstprotection = rstprotection->getValue();
//%%%%%%%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%%%%%%%
pp->labCurve.lcurve = lshape->getCurve (); pp->labCurve.lcurve = lshape->getCurve();
pp->labCurve.acurve = ashape->getCurve (); pp->labCurve.acurve = ashape->getCurve();
pp->labCurve.bcurve = bshape->getCurve (); pp->labCurve.bcurve = bshape->getCurve();
pp->labCurve.cccurve = ccshape->getCurve (); pp->labCurve.cccurve = ccshape->getCurve();
pp->labCurve.chcurve = chshape->getCurve (); pp->labCurve.chcurve = chshape->getCurve();
pp->labCurve.lhcurve = lhshape->getCurve (); pp->labCurve.lhcurve = lhshape->getCurve();
pp->labCurve.hhcurve = hhshape->getCurve (); pp->labCurve.hhcurve = hhshape->getCurve();
pp->labCurve.lccurve = lcshape->getCurve (); pp->labCurve.lccurve = lcshape->getCurve();
pp->labCurve.clcurve = clshape->getCurve (); pp->labCurve.clcurve = clshape->getCurve();
if (pedited) { if (pedited) {
pedited->labCurve.brightness = brightness->getEditedState (); pedited->labCurve.brightness = brightness->getEditedState();
pedited->labCurve.contrast = contrast->getEditedState (); pedited->labCurve.contrast = contrast->getEditedState();
pedited->labCurve.chromaticity = chromaticity->getEditedState (); pedited->labCurve.chromaticity = chromaticity->getEditedState();
//%%%%%%%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%%%%%%%
pedited->labCurve.avoidcolorshift = !avoidcolorshift->get_inconsistent();
pedited->labCurve.lcredsk = !lcredsk->get_inconsistent(); pedited->labCurve.lcredsk = !lcredsk->get_inconsistent();
pedited->labCurve.rstprotection = rstprotection->getEditedState (); pedited->labCurve.rstprotection = rstprotection->getEditedState();
pedited->labCurve.gamutmunselmethod = gamutmunselmethod->get_active_text() != M("GENERAL_UNCHANGED");
pedited->labCurve.lcurve = !lshape->isUnChanged (); pedited->labCurve.lcurve = !lshape->isUnChanged();
pedited->labCurve.acurve = !ashape->isUnChanged (); pedited->labCurve.acurve = !ashape->isUnChanged();
pedited->labCurve.bcurve = !bshape->isUnChanged (); pedited->labCurve.bcurve = !bshape->isUnChanged();
pedited->labCurve.cccurve = !ccshape->isUnChanged (); pedited->labCurve.cccurve = !ccshape->isUnChanged();
pedited->labCurve.chcurve = !chshape->isUnChanged (); pedited->labCurve.chcurve = !chshape->isUnChanged();
pedited->labCurve.lhcurve = !lhshape->isUnChanged (); pedited->labCurve.lhcurve = !lhshape->isUnChanged();
pedited->labCurve.hhcurve = !hhshape->isUnChanged (); pedited->labCurve.hhcurve = !hhshape->isUnChanged();
pedited->labCurve.lccurve = !lcshape->isUnChanged (); pedited->labCurve.lccurve = !lcshape->isUnChanged();
pedited->labCurve.clcurve = !clshape->isUnChanged (); pedited->labCurve.clcurve = !clshape->isUnChanged();
pedited->labCurve.enabled = !get_inconsistent(); pedited->labCurve.enabled = !get_inconsistent();
} }
if (gamutmunselmethod->get_active_row_number() == 0) {
pp->labCurve.gamutmunselmethod = "NONE";
} else if (gamutmunselmethod->get_active_row_number() == 1) {
pp->labCurve.gamutmunselmethod = "LAB";
} else if (gamutmunselmethod->get_active_row_number() == 2) {
pp->labCurve.gamutmunselmethod = "XYZ";
} else if (gamutmunselmethod->get_active_row_number() == 3) {
pp->labCurve.gamutmunselmethod = "XYZREL";
} else if (gamutmunselmethod->get_active_row_number() == 4) {
pp->labCurve.gamutmunselmethod = "MUN";
}
} }
void LCurve::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) void LCurve::setDefaults(const ProcParams* defParams, const ParamsEdited* pedited)
{ {
brightness->setDefault (defParams->labCurve.brightness); brightness->setDefault(defParams->labCurve.brightness);
contrast->setDefault (defParams->labCurve.contrast); contrast->setDefault(defParams->labCurve.contrast);
chromaticity->setDefault (defParams->labCurve.chromaticity); chromaticity->setDefault(defParams->labCurve.chromaticity);
rstprotection->setDefault (defParams->labCurve.rstprotection); rstprotection->setDefault(defParams->labCurve.rstprotection);
if (pedited) { if (pedited) {
brightness->setDefaultEditedState (pedited->labCurve.brightness ? Edited : UnEdited); brightness->setDefaultEditedState(pedited->labCurve.brightness ? Edited : UnEdited);
contrast->setDefaultEditedState (pedited->labCurve.contrast ? Edited : UnEdited); contrast->setDefaultEditedState(pedited->labCurve.contrast ? Edited : UnEdited);
chromaticity->setDefaultEditedState (pedited->labCurve.chromaticity ? Edited : UnEdited); chromaticity->setDefaultEditedState(pedited->labCurve.chromaticity ? Edited : UnEdited);
rstprotection->setDefaultEditedState (pedited->labCurve.rstprotection ? Edited : UnEdited); rstprotection->setDefaultEditedState(pedited->labCurve.rstprotection ? Edited : UnEdited);
} else { } else {
brightness->setDefaultEditedState (Irrelevant); brightness->setDefaultEditedState(Irrelevant);
contrast->setDefaultEditedState (Irrelevant); contrast->setDefaultEditedState(Irrelevant);
chromaticity->setDefaultEditedState (Irrelevant); chromaticity->setDefaultEditedState(Irrelevant);
rstprotection->setDefaultEditedState (Irrelevant); rstprotection->setDefaultEditedState(Irrelevant);
} }
} }
//%%%%%%%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%%%%%%%
//Color shift control changed
void LCurve::avoidcolorshift_toggled () void LCurve::gamutmunselChanged()
{ {
if (batchMode) { if (listener && (multiImage || getEnabled())) {
if (avoidcolorshift->get_inconsistent()) { listener->panelChanged(Evgamutmunsell, gamutmunselmethod->get_active_text());
avoidcolorshift->set_inconsistent (false);
acconn.block (true);
avoidcolorshift->set_active (false);
acconn.block (false);
} else if (lastACVal) {
avoidcolorshift->set_inconsistent (true);
}
lastACVal = avoidcolorshift->get_active ();
} }
if (listener && getEnabled()) {
if (avoidcolorshift->get_active ()) {
listener->panelChanged (EvLAvoidColorShift, M("GENERAL_ENABLED"));
} else {
listener->panelChanged (EvLAvoidColorShift, M("GENERAL_DISABLED"));
}
}
} }
void LCurve::lcredsk_toggled ()
void LCurve::lcredsk_toggled()
{ {
if (batchMode) { if (batchMode) {
if (lcredsk->get_inconsistent()) { if (lcredsk->get_inconsistent()) {
lcredsk->set_inconsistent (false); lcredsk->set_inconsistent(false);
lcconn.block (true); lcconn.block(true);
lcredsk->set_active (false); lcredsk->set_active(false);
lcconn.block (false); lcconn.block(false);
} else if (lastLCVal) { } else if (lastLCVal) {
lcredsk->set_inconsistent (true); lcredsk->set_inconsistent(true);
} }
lastLCVal = lcredsk->get_active (); lastLCVal = lcredsk->get_active();
} else { } else {
lcshape->refresh(); lcshape->refresh();
} }
if (listener && getEnabled()) { if (listener && getEnabled()) {
if (lcredsk->get_active ()) { if (lcredsk->get_active()) {
listener->panelChanged (EvLLCredsk, M("GENERAL_ENABLED")); listener->panelChanged(EvLLCredsk, M("GENERAL_ENABLED"));
} else { } else {
listener->panelChanged (EvLLCredsk, M("GENERAL_DISABLED")); listener->panelChanged(EvLLCredsk, M("GENERAL_DISABLED"));
} }
} }
} }
@ -486,44 +530,44 @@ void LCurve::lcredsk_toggled ()
* If more than one curve has been added, the curve listener is automatically * If more than one curve has been added, the curve listener is automatically
* set to 'multi=true', and send a pointer of the modified curve in a parameter * set to 'multi=true', and send a pointer of the modified curve in a parameter
*/ */
void LCurve::curveChanged (CurveEditor* ce) void LCurve::curveChanged(CurveEditor* ce)
{ {
if (listener && getEnabled()) { if (listener && getEnabled()) {
if (ce == lshape) { if (ce == lshape) {
listener->panelChanged (EvLLCurve, M("HISTORY_CUSTOMCURVE")); listener->panelChanged(EvLLCurve, M("HISTORY_CUSTOMCURVE"));
} }
if (ce == ashape) { if (ce == ashape) {
listener->panelChanged (EvLaCurve, M("HISTORY_CUSTOMCURVE")); listener->panelChanged(EvLaCurve, M("HISTORY_CUSTOMCURVE"));
} }
if (ce == bshape) { if (ce == bshape) {
listener->panelChanged (EvLbCurve, M("HISTORY_CUSTOMCURVE")); listener->panelChanged(EvLbCurve, M("HISTORY_CUSTOMCURVE"));
} }
if (ce == ccshape) { if (ce == ccshape) {
listener->panelChanged (EvLCCCurve, M("HISTORY_CUSTOMCURVE")); listener->panelChanged(EvLCCCurve, M("HISTORY_CUSTOMCURVE"));
} }
if (ce == chshape) { if (ce == chshape) {
listener->panelChanged (EvLCHCurve, M("HISTORY_CUSTOMCURVE")); listener->panelChanged(EvLCHCurve, M("HISTORY_CUSTOMCURVE"));
} }
if (ce == lhshape) { if (ce == lhshape) {
listener->panelChanged (EvLLHCurve, M("HISTORY_CUSTOMCURVE")); listener->panelChanged(EvLLHCurve, M("HISTORY_CUSTOMCURVE"));
} }
if (ce == hhshape) { if (ce == hhshape) {
listener->panelChanged (EvLHHCurve, M("HISTORY_CUSTOMCURVE")); listener->panelChanged(EvLHHCurve, M("HISTORY_CUSTOMCURVE"));
} }
if (ce == lcshape) { if (ce == lcshape) {
listener->panelChanged (EvLLCCurve, M("HISTORY_CUSTOMCURVE")); listener->panelChanged(EvLLCCurve, M("HISTORY_CUSTOMCURVE"));
} }
if (ce == clshape) { if (ce == clshape) {
listener->panelChanged (EvLCLCurve, M("HISTORY_CUSTOMCURVE")); listener->panelChanged(EvLCLCurve, M("HISTORY_CUSTOMCURVE"));
} }
@ -535,45 +579,43 @@ void LCurve::adjusterChanged(Adjuster* a, double newval)
Glib::ustring costr; Glib::ustring costr;
if (a == brightness) { if (a == brightness) {
costr = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), a->getValue()); costr = Glib::ustring::format(std::setw(3), std::fixed, std::setprecision(2), a->getValue());
} else if (a == rstprotection) { } else if (a == rstprotection) {
costr = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(1), a->getValue()); costr = Glib::ustring::format(std::setw(3), std::fixed, std::setprecision(1), a->getValue());
} else { } else {
costr = Glib::ustring::format ((int)a->getValue()); costr = Glib::ustring::format((int)a->getValue());
} }
if (a == brightness) { if (a == brightness) {
if (listener && getEnabled()) { if (listener && getEnabled()) {
listener->panelChanged (EvLBrightness, costr); listener->panelChanged(EvLBrightness, costr);
} }
} else if (a == contrast) { } else if (a == contrast) {
if (listener && getEnabled()) { if (listener && getEnabled()) {
listener->panelChanged (EvLContrast, costr); listener->panelChanged(EvLContrast, costr);
} }
} else if (a == rstprotection) { } else if (a == rstprotection) {
if (listener && getEnabled()) { if (listener && getEnabled()) {
listener->panelChanged (EvLRSTProtection, costr); listener->panelChanged(EvLRSTProtection, costr);
} }
} else if (a == chromaticity) { } else if (a == chromaticity) {
if (multiImage) { if (multiImage) {
//if chromaticity==-100 (lowest value), we enter the B&W mode and avoid color shift and rstprotection has no effect //if chromaticity==-100 (lowest value), we enter the B&W mode and avoid color shift and rstprotection has no effect
rstprotection->set_sensitive( true ); rstprotection->set_sensitive(true);
avoidcolorshift->set_sensitive( true ); lcredsk->set_sensitive(true);
lcredsk->set_sensitive( true );
} else { } else {
//if chromaticity==-100 (lowest value), we enter the B&W mode and avoid color shift and rstprotection has no effect //if chromaticity==-100 (lowest value), we enter the B&W mode and avoid color shift and rstprotection has no effect
rstprotection->set_sensitive( int(newval) > -100 ); //no reason for grey rstprotection rstprotection->set_sensitive(int(newval) > -100); //no reason for grey rstprotection
avoidcolorshift->set_sensitive( int(newval) > -100 ); lcredsk->set_sensitive(int(newval) > -100);
lcredsk->set_sensitive( int(newval) > -100 );
} }
if (listener && getEnabled()) { if (listener && getEnabled()) {
listener->panelChanged (EvLSaturation, costr); listener->panelChanged(EvLSaturation, costr);
} }
} }
} }
void LCurve::colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller *caller) void LCurve::colorForValue(double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller *caller)
{ {
float R = 0.f, G = 0.f, B = 0.f; float R = 0.f, G = 0.f, B = 0.f;
@ -588,47 +630,54 @@ void LCurve::colorForValue (double valX, double valY, enum ColorCaller::ElemType
float value = (1.f - 0.7f) * float(valX) + 0.7f; float value = (1.f - 0.7f) * float(valX) + 0.7f;
// whole hue range // whole hue range
// Y axis / from 0.15 up to 0.75 (arbitrary values; was 0.45 before) // Y axis / from 0.15 up to 0.75 (arbitrary values; was 0.45 before)
Color::hsv2rgb01(float(valY*0.8), float(valX), value, R, G, B); Color::hsv2rgb01(float(valY * 0.8), float(valX), value, R, G, B);
} else if (callerId == 6) { // cc - left bar } else if (callerId == 6) { // cc - left bar
float value = (1.f - 0.7f) * float(valX) + 0.7f; float value = (1.f - 0.7f) * float(valX) + 0.7f;
float hue = (1.14056f - 0.92f) * float(valY) + 0.92f; float hue = (1.14056f - 0.92f) * float(valY) + 0.92f;
if (hue > 1.0f) { if (hue > 1.0f) {
hue -= 1.0f; hue -= 1.0f;
} }
// Y axis / from 0.15 up to 0.75 (arbitrary values; was 0.45 before) // Y axis / from 0.15 up to 0.75 (arbitrary values; was 0.45 before)
Color::hsv2rgb01(hue, float(valX), value, R, G, B); Color::hsv2rgb01(hue, float(valX), value, R, G, B);
} else if (callerId == 3) { // lc - bottom bar } else if (callerId == 3) { // lc - bottom bar
float value = (1.f - 0.7f) * float(valX) + 0.7f; float value = (1.f - 0.7f) * float(valX) + 0.7f;
if (lcredsk->get_active()) { if (lcredsk->get_active()) {
// skin range // skin range
// -0.1 rad < Hue < 1.6 rad // -0.1 rad < Hue < 1.6 rad
// Y axis / from 0.92 up to 0.14056 // Y axis / from 0.92 up to 0.14056
float hue = (1.14056f - 0.92f) * float(valY) + 0.92f; float hue = (1.14056f - 0.92f) * float(valY) + 0.92f;
if (hue > 1.0f) { if (hue > 1.0f) {
hue -= 1.0f; hue -= 1.0f;
} }
// Y axis / from 0.15 up to 0.75 (arbitrary values; was 0.45 before) // Y axis / from 0.15 up to 0.75 (arbitrary values; was 0.45 before)
Color::hsv2rgb01(hue, float(valX), value, R, G, B); Color::hsv2rgb01(hue, float(valX), value, R, G, B);
} else { } else {
// whole hue range // whole hue range
// Y axis / from 0.15 up to 0.75 (arbitrary values; was 0.45 before) // Y axis / from 0.15 up to 0.75 (arbitrary values; was 0.45 before)
Color::hsv2rgb01(float(valY*0.8), float(valX), value, R, G, B); Color::hsv2rgb01(float(valY * 0.8), float(valX), value, R, G, B);
} }
} else if (callerId == 4) { // LH - bottom bar } else if (callerId == 4) { // LH - bottom bar
Color::hsv2rgb01(float(valX), 0.5f, float(valY), R, G, B); Color::hsv2rgb01(float(valX), 0.5f, float(valY), R, G, B);
} else if (callerId == 5) { // HH - bottom bar } else if (callerId == 5) { // HH - bottom bar
float h = float((valY - 0.5) * 0.3 + valX); float h = float((valY - 0.5) * 0.3 + valX);
if (h > 1.0f) { if (h > 1.0f) {
h -= 1.0f; h -= 1.0f;
} else if (h < 0.0f) { } else if (h < 0.0f) {
h += 1.0f; h += 1.0f;
} }
Color::hsv2rgb01(h, 0.5f, 0.5f, R, G, B); Color::hsv2rgb01(h, 0.5f, 0.5f, R, G, B);
} else if (callerId == 7) { // cc and cl - left bar } else if (callerId == 7) { // cc and cl - left bar
float value = (1.f - 0.7f) * float(valX) + 0.7f; float value = (1.f - 0.7f) * float(valX) + 0.7f;
// whole hue range // whole hue range
// Y axis / from 0.15 up to 0.75 (arbitrary values; was 0.45 before) // Y axis / from 0.15 up to 0.75 (arbitrary values; was 0.45 before)
Color::hsv2rgb01(float(valY*0.8), 1.f - float(valX), value, R, G, B); Color::hsv2rgb01(float(valY * 0.8), 1.f - float(valX), value, R, G, B);
} }
caller->ccRed = double(R); caller->ccRed = double(R);
@ -636,17 +685,19 @@ void LCurve::colorForValue (double valX, double valY, enum ColorCaller::ElemType
caller->ccBlue = double(B); caller->ccBlue = double(B);
} }
void LCurve::setBatchMode (bool batchMode) void LCurve::setBatchMode(bool batchMode)
{ {
ToolPanel::setBatchMode (batchMode); ToolPanel::setBatchMode(batchMode);
brightness->showEditedCB (); brightness->showEditedCB();
contrast->showEditedCB (); contrast->showEditedCB();
chromaticity->showEditedCB (); chromaticity->showEditedCB();
rstprotection->showEditedCB (); rstprotection->showEditedCB();
curveEditorG->setBatchMode (batchMode); curveEditorG->setBatchMode(batchMode);
lcshape->setBottomBarColorProvider(nullptr, -1); lcshape->setBottomBarColorProvider(nullptr, -1);
lcshape->setLeftBarColorProvider(nullptr, -1); lcshape->setLeftBarColorProvider(nullptr, -1);
gamutmunselmethod->append(M("GENERAL_UNCHANGED"));
} }
@ -663,13 +714,13 @@ void LCurve::updateCurveBackgroundHistogram(
const LUTu& histLRETI const LUTu& histLRETI
) )
{ {
lshape->updateBackgroundHistogram (histLCurve); lshape->updateBackgroundHistogram(histLCurve);
ccshape->updateBackgroundHistogram (histCCurve); ccshape->updateBackgroundHistogram(histCCurve);
lcshape->updateBackgroundHistogram (histCCurve); lcshape->updateBackgroundHistogram(histCCurve);
clshape->updateBackgroundHistogram (histLCurve); clshape->updateBackgroundHistogram(histLCurve);
} }
void LCurve::setAdjusterBehavior (bool bradd, bool contradd, bool satadd) void LCurve::setAdjusterBehavior(bool bradd, bool contradd, bool satadd)
{ {
brightness->setAddMode(bradd); brightness->setAddMode(bradd);
@ -677,7 +728,7 @@ void LCurve::setAdjusterBehavior (bool bradd, bool contradd, bool satadd)
chromaticity->setAddMode(satadd); chromaticity->setAddMode(satadd);
} }
void LCurve::trimValues (rtengine::procparams::ProcParams* pp) void LCurve::trimValues(rtengine::procparams::ProcParams* pp)
{ {
brightness->trimValue(pp->labCurve.brightness); brightness->trimValue(pp->labCurve.brightness);
@ -689,11 +740,11 @@ void LCurve::enabledChanged()
{ {
if (listener) { if (listener) {
if (get_inconsistent()) { if (get_inconsistent()) {
listener->panelChanged (EvLEnabled, M("GENERAL_UNCHANGED")); listener->panelChanged(EvLEnabled, M("GENERAL_UNCHANGED"));
} else if (getEnabled()) { } else if (getEnabled()) {
listener->panelChanged (EvLEnabled, M("GENERAL_ENABLED")); listener->panelChanged(EvLEnabled, M("GENERAL_ENABLED"));
} else { } else {
listener->panelChanged (EvLEnabled, M("GENERAL_DISABLED")); listener->panelChanged(EvLEnabled, M("GENERAL_DISABLED"));
} }
} }
} }

View File

@ -59,11 +59,14 @@ protected:
DiagonalCurveEditor* cdshape; DiagonalCurveEditor* cdshape;
//%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%
Gtk::CheckButton* avoidcolorshift;
Gtk::CheckButton* lcredsk; Gtk::CheckButton* lcredsk;
MyComboBoxText* gamutmunselmethod;
sigc::connection gamutmunselmethodconn;
rtengine::ProcEvent Evgamutmunsell;
Adjuster* rstprotection; Adjuster* rstprotection;
sigc::connection bwtconn, acconn, lcconn; sigc::connection bwtconn, lcconn;
bool lastACVal, lastLCVal; bool lastACVal, lastLCVal;
//%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%
@ -85,8 +88,8 @@ public:
void curveChanged (CurveEditor* ce) override; void curveChanged (CurveEditor* ce) override;
void adjusterChanged (Adjuster* a, double newval) override; void adjusterChanged (Adjuster* a, double newval) override;
void avoidcolorshift_toggled ();
void lcredsk_toggled(); void lcredsk_toggled();
void gamutmunselChanged();
void updateCurveBackgroundHistogram( void updateCurveBackgroundHistogram(
const LUTu& histToneCurve, const LUTu& histToneCurve,

View File

@ -279,6 +279,18 @@ void Locallab::read(const rtengine::procparams::ProcParams* pp, const ParamsEdit
} else { } else {
r->shapeMethod = 3; r->shapeMethod = 3;
} }
if (pp->locallab.spots.at(i).avoidgamutMethod == "NONE") {
r->avoidgamutMethod = 0;
} else if (pp->locallab.spots.at(i).avoidgamutMethod == "LAB") {
r->avoidgamutMethod = 1;
} else if (pp->locallab.spots.at(i).avoidgamutMethod == "XYZ") {
r->avoidgamutMethod= 2;
} else if (pp->locallab.spots.at(i).avoidgamutMethod == "XYZREL") {
r->avoidgamutMethod= 3;
} else if (pp->locallab.spots.at(i).avoidgamutMethod == "MUNS") {
r->avoidgamutMethod= 4;
}
r->locX = pp->locallab.spots.at(i).loc.at(0); r->locX = pp->locallab.spots.at(i).loc.at(0);
r->locXL = pp->locallab.spots.at(i).loc.at(1); r->locXL = pp->locallab.spots.at(i).loc.at(1);
@ -308,8 +320,6 @@ void Locallab::read(const rtengine::procparams::ProcParams* pp, const ParamsEdit
r->avoidrad = pp->locallab.spots.at(i).avoidrad; r->avoidrad = pp->locallab.spots.at(i).avoidrad;
r->hishow = pp->locallab.spots.at(i).hishow; r->hishow = pp->locallab.spots.at(i).hishow;
r->activ = pp->locallab.spots.at(i).activ; r->activ = pp->locallab.spots.at(i).activ;
r->avoid = pp->locallab.spots.at(i).avoid;
r->avoidmun = pp->locallab.spots.at(i).avoidmun;
r->blwh = pp->locallab.spots.at(i).blwh; r->blwh = pp->locallab.spots.at(i).blwh;
r->recurs = pp->locallab.spots.at(i).recurs; r->recurs = pp->locallab.spots.at(i).recurs;
r->laplac = true; //pp->locallab.spots.at(i).laplac; r->laplac = true; //pp->locallab.spots.at(i).laplac;
@ -443,6 +453,18 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
r->shapeMethod = 3; r->shapeMethod = 3;
} }
if (newSpot->avoidgamutMethod == "NONE") {
r->avoidgamutMethod = 0;
} else if (newSpot->avoidgamutMethod == "LAB") {
r->avoidgamutMethod = 1;
} else if (newSpot->avoidgamutMethod == "XYZ") {
r->avoidgamutMethod = 2;
} else if (newSpot->avoidgamutMethod == "XYZREL") {
r->avoidgamutMethod = 3;
} else if (newSpot->avoidgamutMethod == "MUNS") {
r->avoidgamutMethod = 4;
}
// Calculate spot size and center position according to preview area // Calculate spot size and center position according to preview area
if (provider && !batchMode) { if (provider && !batchMode) {
provider->getImageSize(imW, imH); provider->getImageSize(imW, imH);
@ -490,8 +512,6 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
r->avoidrad = newSpot->avoidrad; r->avoidrad = newSpot->avoidrad;
r->hishow = newSpot->hishow; r->hishow = newSpot->hishow;
r->activ = newSpot->activ; r->activ = newSpot->activ;
r->avoid = newSpot->avoid;
r->avoidmun = newSpot->avoidmun;
r->blwh = newSpot->blwh; r->blwh = newSpot->blwh;
r->recurs = newSpot->recurs; r->recurs = newSpot->recurs;
r->laplac = newSpot->laplac; r->laplac = newSpot->laplac;
@ -744,6 +764,18 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
r->shapeMethod = 3; r->shapeMethod = 3;
} }
//printf("n0=%f n1=%f n2=%f n3=%f\n", (double) newSpot->loc.at(0), (double) newSpot->loc.at(1), (double) newSpot->loc.at(2), (double) newSpot->loc.at(3)); //printf("n0=%f n1=%f n2=%f n3=%f\n", (double) newSpot->loc.at(0), (double) newSpot->loc.at(1), (double) newSpot->loc.at(2), (double) newSpot->loc.at(3));
if (newSpot->avoidgamutMethod == "NONE") {
r->avoidgamutMethod = 0;
} else if (newSpot->avoidgamutMethod == "LAB") {
r->avoidgamutMethod = 1;
} else if (newSpot->avoidgamutMethod== "XYZ") {
r->avoidgamutMethod = 2;
} else if (newSpot->avoidgamutMethod== "XYZREL") {
r->avoidgamutMethod = 3;
} else if (newSpot->avoidgamutMethod== "MUNS") {
r->avoidgamutMethod = 4;
}
//printf("n0=%f n1=%f n2=%f n3=%f\n", (double) newSpot->loc.at(0), (double) newSpot->loc.at(1), (double) newSpot->loc.at(2), (double) newSpot->loc.at(3));
// Calculate spot size and center position according to preview area // Calculate spot size and center position according to preview area
if (provider && !batchMode) { if (provider && !batchMode) {
@ -801,8 +833,6 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
r->colorscope = newSpot->colorscope; r->colorscope = newSpot->colorscope;
r->avoidrad = newSpot->avoidrad; r->avoidrad = newSpot->avoidrad;
r->activ = newSpot->activ; r->activ = newSpot->activ;
r->avoid = newSpot->avoid;
r->avoidmun = newSpot->avoidmun;
r->blwh = newSpot->blwh; r->blwh = newSpot->blwh;
r->recurs = newSpot->recurs; r->recurs = newSpot->recurs;
r->laplac = newSpot->laplac; r->laplac = newSpot->laplac;
@ -929,6 +959,18 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
pp->locallab.spots.at(pp->locallab.selspot).shapeMethod = "SYMSL"; pp->locallab.spots.at(pp->locallab.selspot).shapeMethod = "SYMSL";
} }
if (r->avoidgamutMethod == 0) {
pp->locallab.spots.at(pp->locallab.selspot).avoidgamutMethod = "NONE";
} else if (r->avoidgamutMethod == 1) {
pp->locallab.spots.at(pp->locallab.selspot).avoidgamutMethod = "LAB";
} else if (r->avoidgamutMethod == 2) {
pp->locallab.spots.at(pp->locallab.selspot).avoidgamutMethod = "XYZ";
} else if (r->avoidgamutMethod == 3) {
pp->locallab.spots.at(pp->locallab.selspot).avoidgamutMethod = "XYZREL";
} else if (r->avoidgamutMethod == 4) {
pp->locallab.spots.at(pp->locallab.selspot).avoidgamutMethod = "MUNS";
}
pp->locallab.spots.at(pp->locallab.selspot).loc.at(0) = r->locX; pp->locallab.spots.at(pp->locallab.selspot).loc.at(0) = r->locX;
pp->locallab.spots.at(pp->locallab.selspot).loc.at(1) = r->locXL; pp->locallab.spots.at(pp->locallab.selspot).loc.at(1) = r->locXL;
pp->locallab.spots.at(pp->locallab.selspot).loc.at(2) = r->locY; pp->locallab.spots.at(pp->locallab.selspot).loc.at(2) = r->locY;
@ -957,8 +999,6 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
pp->locallab.spots.at(pp->locallab.selspot).avoidrad = r->avoidrad; pp->locallab.spots.at(pp->locallab.selspot).avoidrad = r->avoidrad;
pp->locallab.spots.at(pp->locallab.selspot).hishow = r->hishow; pp->locallab.spots.at(pp->locallab.selspot).hishow = r->hishow;
pp->locallab.spots.at(pp->locallab.selspot).activ = r->activ; pp->locallab.spots.at(pp->locallab.selspot).activ = r->activ;
pp->locallab.spots.at(pp->locallab.selspot).avoid = r->avoid;
pp->locallab.spots.at(pp->locallab.selspot).avoidmun = r->avoidmun;
pp->locallab.spots.at(pp->locallab.selspot).blwh = r->blwh; pp->locallab.spots.at(pp->locallab.selspot).blwh = r->blwh;
pp->locallab.spots.at(pp->locallab.selspot).recurs = r->recurs; pp->locallab.spots.at(pp->locallab.selspot).recurs = r->recurs;
pp->locallab.spots.at(pp->locallab.selspot).laplac = r->laplac; pp->locallab.spots.at(pp->locallab.selspot).laplac = r->laplac;

View File

@ -104,7 +104,7 @@ void ParamsEdited::set(bool v)
labCurve.brightness = v; labCurve.brightness = v;
labCurve.contrast = v; labCurve.contrast = v;
labCurve.chromaticity = v; labCurve.chromaticity = v;
labCurve.avoidcolorshift = v; labCurve.gamutmunselmethod = v;
labCurve.rstprotection = v; labCurve.rstprotection = v;
labCurve.lcredsk = v; labCurve.lcredsk = v;
localContrast.enabled = v; localContrast.enabled = v;
@ -254,7 +254,6 @@ void ParamsEdited::set(bool v)
colorappearance.ybout = v; colorappearance.ybout = v;
colorappearance.tempsc = v; colorappearance.tempsc = v;
colorappearance.greensc = v; colorappearance.greensc = v;
colorappearance.presetcat02 = v;
//colorBoost.amount = v; //colorBoost.amount = v;
//colorBoost.avoidclip = v; //colorBoost.avoidclip = v;
@ -453,6 +452,7 @@ void ParamsEdited::set(bool v)
icm.bluy = v; icm.bluy = v;
icm.preser = v; icm.preser = v;
icm.fbw = v; icm.fbw = v;
icm.gamut = v;
icm.labgridcieALow = v; icm.labgridcieALow = v;
icm.labgridcieBLow = v; icm.labgridcieBLow = v;
icm.labgridcieAHigh = v; icm.labgridcieAHigh = v;
@ -804,7 +804,7 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
labCurve.brightness = labCurve.brightness && p.labCurve.brightness == other.labCurve.brightness; labCurve.brightness = labCurve.brightness && p.labCurve.brightness == other.labCurve.brightness;
labCurve.contrast = labCurve.contrast && p.labCurve.contrast == other.labCurve.contrast; labCurve.contrast = labCurve.contrast && p.labCurve.contrast == other.labCurve.contrast;
labCurve.chromaticity = labCurve.chromaticity && p.labCurve.chromaticity == other.labCurve.chromaticity; labCurve.chromaticity = labCurve.chromaticity && p.labCurve.chromaticity == other.labCurve.chromaticity;
labCurve.avoidcolorshift = labCurve.avoidcolorshift && p.labCurve.avoidcolorshift == other.labCurve.avoidcolorshift; labCurve.gamutmunselmethod = labCurve.gamutmunselmethod && p.labCurve.gamutmunselmethod == other.labCurve.gamutmunselmethod;
labCurve.rstprotection = labCurve.rstprotection && p.labCurve.rstprotection == other.labCurve.rstprotection; labCurve.rstprotection = labCurve.rstprotection && p.labCurve.rstprotection == other.labCurve.rstprotection;
labCurve.lcredsk = labCurve.lcredsk && p.labCurve.lcredsk == other.labCurve.lcredsk; labCurve.lcredsk = labCurve.lcredsk && p.labCurve.lcredsk == other.labCurve.lcredsk;
@ -908,7 +908,6 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
vibrance.avoidcolorshift = vibrance.avoidcolorshift && p.vibrance.avoidcolorshift == other.vibrance.avoidcolorshift; vibrance.avoidcolorshift = vibrance.avoidcolorshift && p.vibrance.avoidcolorshift == other.vibrance.avoidcolorshift;
vibrance.pastsattog = vibrance.pastsattog && p.vibrance.pastsattog == other.vibrance.pastsattog; vibrance.pastsattog = vibrance.pastsattog && p.vibrance.pastsattog == other.vibrance.pastsattog;
vibrance.skintonescurve = vibrance.skintonescurve && p.vibrance.skintonescurve == other.vibrance.skintonescurve; vibrance.skintonescurve = vibrance.skintonescurve && p.vibrance.skintonescurve == other.vibrance.skintonescurve;
colorappearance.enabled = colorappearance.enabled && p.colorappearance.enabled == other.colorappearance.enabled; colorappearance.enabled = colorappearance.enabled && p.colorappearance.enabled == other.colorappearance.enabled;
colorappearance.degree = colorappearance.degree && p.colorappearance.degree == other.colorappearance.degree; colorappearance.degree = colorappearance.degree && p.colorappearance.degree == other.colorappearance.degree;
colorappearance.autodegree = colorappearance.autodegree && p.colorappearance.autodegree == other.colorappearance.autodegree; colorappearance.autodegree = colorappearance.autodegree && p.colorappearance.autodegree == other.colorappearance.autodegree;
@ -955,7 +954,6 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
colorappearance.ybout = colorappearance.ybout && p.colorappearance.ybout == other.colorappearance.ybout; colorappearance.ybout = colorappearance.ybout && p.colorappearance.ybout == other.colorappearance.ybout;
colorappearance.tempsc = colorappearance.tempsc && p.colorappearance.tempsc == other.colorappearance.tempsc; colorappearance.tempsc = colorappearance.tempsc && p.colorappearance.tempsc == other.colorappearance.tempsc;
colorappearance.greensc = colorappearance.greensc && p.colorappearance.greensc == other.colorappearance.greensc; colorappearance.greensc = colorappearance.greensc && p.colorappearance.greensc == other.colorappearance.greensc;
colorappearance.presetcat02 = colorappearance.presetcat02 && p.colorappearance.presetcat02 == other.colorappearance.presetcat02;
//colorBoost.amount = colorBoost.amount && p.colorBoost.amount == other.colorBoost.amount; //colorBoost.amount = colorBoost.amount && p.colorBoost.amount == other.colorBoost.amount;
//colorBoost.avoidclip = colorBoost.avoidclip && p.colorBoost.avoidclip == other.colorBoost.avoidclip; //colorBoost.avoidclip = colorBoost.avoidclip && p.colorBoost.avoidclip == other.colorBoost.avoidclip;
@ -1091,6 +1089,7 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
locallab.spots.at(j).structexclu = locallab.spots.at(j).structexclu && pSpot.structexclu == otherSpot.structexclu; locallab.spots.at(j).structexclu = locallab.spots.at(j).structexclu && pSpot.structexclu == otherSpot.structexclu;
locallab.spots.at(j).struc = locallab.spots.at(j).struc && pSpot.struc == otherSpot.struc; locallab.spots.at(j).struc = locallab.spots.at(j).struc && pSpot.struc == otherSpot.struc;
locallab.spots.at(j).shapeMethod = locallab.spots.at(j).shapeMethod && pSpot.shapeMethod == otherSpot.shapeMethod; locallab.spots.at(j).shapeMethod = locallab.spots.at(j).shapeMethod && pSpot.shapeMethod == otherSpot.shapeMethod;
locallab.spots.at(j).avoidgamutMethod = locallab.spots.at(j).avoidgamutMethod && pSpot.avoidgamutMethod == otherSpot.avoidgamutMethod;
locallab.spots.at(j).loc = locallab.spots.at(j).loc && pSpot.loc == otherSpot.loc; locallab.spots.at(j).loc = locallab.spots.at(j).loc && pSpot.loc == otherSpot.loc;
locallab.spots.at(j).centerX = locallab.spots.at(j).centerX && pSpot.centerX == otherSpot.centerX; locallab.spots.at(j).centerX = locallab.spots.at(j).centerX && pSpot.centerX == otherSpot.centerX;
locallab.spots.at(j).centerY = locallab.spots.at(j).centerY && pSpot.centerY == otherSpot.centerY; locallab.spots.at(j).centerY = locallab.spots.at(j).centerY && pSpot.centerY == otherSpot.centerY;
@ -1110,8 +1109,6 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
locallab.spots.at(j).transitgrad = locallab.spots.at(j).transitgrad && pSpot.transitgrad == otherSpot.transitgrad; locallab.spots.at(j).transitgrad = locallab.spots.at(j).transitgrad && pSpot.transitgrad == otherSpot.transitgrad;
locallab.spots.at(j).hishow = locallab.spots.at(j).hishow && pSpot.hishow == otherSpot.hishow; locallab.spots.at(j).hishow = locallab.spots.at(j).hishow && pSpot.hishow == otherSpot.hishow;
locallab.spots.at(j).activ = locallab.spots.at(j).activ && pSpot.activ == otherSpot.activ; locallab.spots.at(j).activ = locallab.spots.at(j).activ && pSpot.activ == otherSpot.activ;
locallab.spots.at(j).avoid = locallab.spots.at(j).avoid && pSpot.avoid == otherSpot.avoid;
locallab.spots.at(j).avoidmun = locallab.spots.at(j).avoidmun && pSpot.avoidmun == otherSpot.avoidmun;
locallab.spots.at(j).blwh = locallab.spots.at(j).blwh && pSpot.blwh == otherSpot.blwh; locallab.spots.at(j).blwh = locallab.spots.at(j).blwh && pSpot.blwh == otherSpot.blwh;
locallab.spots.at(j).recurs = locallab.spots.at(j).recurs && pSpot.recurs == otherSpot.recurs; locallab.spots.at(j).recurs = locallab.spots.at(j).recurs && pSpot.recurs == otherSpot.recurs;
locallab.spots.at(j).laplac = locallab.spots.at(j).laplac && pSpot.laplac == otherSpot.laplac; locallab.spots.at(j).laplac = locallab.spots.at(j).laplac && pSpot.laplac == otherSpot.laplac;
@ -1873,6 +1870,7 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
icm.labgridcieWy = icm.labgridcieWy && p.icm.labgridcieWy == other.icm.labgridcieWy; icm.labgridcieWy = icm.labgridcieWy && p.icm.labgridcieWy == other.icm.labgridcieWy;
icm.preser = icm.preser && p.icm.preser == other.icm.preser; icm.preser = icm.preser && p.icm.preser == other.icm.preser;
icm.fbw = icm.fbw && p.icm.fbw == other.icm.fbw; icm.fbw = icm.fbw && p.icm.fbw == other.icm.fbw;
icm.gamut = icm.gamut && p.icm.gamut == other.icm.gamut;
icm.aRendIntent = icm.aRendIntent && p.icm.aRendIntent == other.icm.aRendIntent; icm.aRendIntent = icm.aRendIntent && p.icm.aRendIntent == other.icm.aRendIntent;
icm.workingTRC = icm.workingTRC && p.icm.workingTRC == other.icm.workingTRC; icm.workingTRC = icm.workingTRC && p.icm.workingTRC == other.icm.workingTRC;
icm.will = icm.will && p.icm.will == other.icm.will; icm.will = icm.will && p.icm.will == other.icm.will;
@ -2392,8 +2390,8 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.labCurve.chromaticity = dontforceSet && options.baBehav[ADDSET_LC_CHROMATICITY] ? toEdit.labCurve.chromaticity + mods.labCurve.chromaticity : mods.labCurve.chromaticity; toEdit.labCurve.chromaticity = dontforceSet && options.baBehav[ADDSET_LC_CHROMATICITY] ? toEdit.labCurve.chromaticity + mods.labCurve.chromaticity : mods.labCurve.chromaticity;
} }
if (labCurve.avoidcolorshift) { if (labCurve.gamutmunselmethod) {
toEdit.labCurve.avoidcolorshift = mods.labCurve.avoidcolorshift; toEdit.labCurve.gamutmunselmethod = mods.labCurve.gamutmunselmethod;
} }
if (labCurve.rstprotection) { if (labCurve.rstprotection) {
@ -3034,9 +3032,6 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.colorappearance.tonecie = mods.colorappearance.tonecie; toEdit.colorappearance.tonecie = mods.colorappearance.tonecie;
} }
if (colorappearance.presetcat02) {
toEdit.colorappearance.presetcat02 = mods.colorappearance.presetcat02;
}
// if (colorappearance.sharpcie) toEdit.colorappearance.sharpcie = mods.colorappearance.sharpcie; // if (colorappearance.sharpcie) toEdit.colorappearance.sharpcie = mods.colorappearance.sharpcie;
if (impulseDenoise.enabled) { if (impulseDenoise.enabled) {
@ -3437,6 +3432,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.locallab.spots.at(i).shapeMethod = mods.locallab.spots.at(i).shapeMethod; toEdit.locallab.spots.at(i).shapeMethod = mods.locallab.spots.at(i).shapeMethod;
} }
if (locallab.spots.at(i).avoidgamutMethod) {
toEdit.locallab.spots.at(i).avoidgamutMethod = mods.locallab.spots.at(i).avoidgamutMethod;
}
if (locallab.spots.at(i).loc) { if (locallab.spots.at(i).loc) {
toEdit.locallab.spots.at(i).loc = mods.locallab.spots.at(i).loc; toEdit.locallab.spots.at(i).loc = mods.locallab.spots.at(i).loc;
} }
@ -3513,14 +3512,6 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.locallab.spots.at(i).activ = mods.locallab.spots.at(i).activ; toEdit.locallab.spots.at(i).activ = mods.locallab.spots.at(i).activ;
} }
if (locallab.spots.at(i).avoid) {
toEdit.locallab.spots.at(i).avoid = mods.locallab.spots.at(i).avoid;
}
if (locallab.spots.at(i).avoidmun) {
toEdit.locallab.spots.at(i).avoidmun = mods.locallab.spots.at(i).avoidmun;
}
if (locallab.spots.at(i).blwh) { if (locallab.spots.at(i).blwh) {
toEdit.locallab.spots.at(i).blwh = mods.locallab.spots.at(i).blwh; toEdit.locallab.spots.at(i).blwh = mods.locallab.spots.at(i).blwh;
} }
@ -6382,6 +6373,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.icm.fbw = mods.icm.fbw; toEdit.icm.fbw = mods.icm.fbw;
} }
if (icm.gamut) {
toEdit.icm.gamut = mods.icm.gamut;
}
if (icm.labgridcieALow) { if (icm.labgridcieALow) {
toEdit.icm.labgridcieALow = mods.icm.labgridcieALow; toEdit.icm.labgridcieALow = mods.icm.labgridcieALow;
} }
@ -7411,6 +7406,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) :
structexclu(v), structexclu(v),
struc(v), struc(v),
shapeMethod(v), shapeMethod(v),
avoidgamutMethod(v),
loc(v), loc(v),
centerX(v), centerX(v),
centerY(v), centerY(v),
@ -7430,8 +7426,6 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) :
transitgrad(v), transitgrad(v),
hishow(v), hishow(v),
activ(v), activ(v),
avoid(v),
avoidmun(v),
blwh(v), blwh(v),
recurs(v), recurs(v),
laplac(v), laplac(v),
@ -8103,6 +8097,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v)
structexclu = v; structexclu = v;
struc = v; struc = v;
shapeMethod = v; shapeMethod = v;
avoidgamutMethod = v;
loc = v; loc = v;
centerX = v; centerX = v;
centerY = v; centerY = v;
@ -8122,8 +8117,6 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v)
transitgrad = v; transitgrad = v;
hishow = v; hishow = v;
activ = v; activ = v;
avoid = v;
avoidmun = v;
blwh = v; blwh = v;
recurs = v; recurs = v;
laplac = v; laplac = v;

View File

@ -109,7 +109,7 @@ struct LCurveParamsEdited {
bool brightness; bool brightness;
bool contrast; bool contrast;
bool chromaticity; bool chromaticity;
bool avoidcolorshift; bool gamutmunselmethod;
bool rstprotection; bool rstprotection;
bool lcurve; bool lcurve;
bool acurve; bool acurve;
@ -305,7 +305,6 @@ struct ColorAppearanceParamsEdited {
bool ybout; bool ybout;
bool tempsc; bool tempsc;
bool greensc; bool greensc;
bool presetcat02;
}; };
struct DirPyrDenoiseParamsEdited { struct DirPyrDenoiseParamsEdited {
@ -403,6 +402,7 @@ public:
bool structexclu; bool structexclu;
bool struc; bool struc;
bool shapeMethod; bool shapeMethod;
bool avoidgamutMethod;
bool loc; bool loc;
bool centerX; bool centerX;
bool centerY; bool centerY;
@ -422,8 +422,6 @@ public:
bool transitgrad; bool transitgrad;
bool hishow; bool hishow;
bool activ; bool activ;
bool avoid;
bool avoidmun;
bool blwh; bool blwh;
bool recurs; bool recurs;
bool laplac; bool laplac;
@ -1231,6 +1229,7 @@ struct ColorManagementParamsEdited {
bool bluy; bool bluy;
bool preser; bool preser;
bool fbw; bool fbw;
bool gamut;
bool labgridcieALow; bool labgridcieALow;
bool labgridcieBLow; bool labgridcieBLow;
bool labgridcieAHigh; bool labgridcieAHigh;

View File

@ -73,44 +73,50 @@ PopUpCommon::~PopUpCommon ()
{ {
} }
bool PopUpCommon::addEntry (const Glib::ustring& fileName, const Glib::ustring& label) bool PopUpCommon::addEntry (const Glib::ustring& fileName, const Glib::ustring& label, Gtk::RadioButtonGroup* radioGroup)
{ {
return insertEntry(getEntryCount(), fileName, label); return insertEntry(getEntryCount(), fileName, label, radioGroup);
} }
bool PopUpCommon::insertEntry(int position, const Glib::ustring& fileName, const Glib::ustring& label) bool PopUpCommon::insertEntry(int position, const Glib::ustring& fileName, const Glib::ustring& label, Gtk::RadioButtonGroup *radioGroup)
{ {
RTImage* image = nullptr; RTImage* image = nullptr;
if (!fileName.empty()) { if (!fileName.empty()) {
image = Gtk::manage(new RTImage(fileName)); image = Gtk::manage(new RTImage(fileName));
} }
bool success = insertEntryImpl(position, fileName, Glib::RefPtr<const Gio::Icon>(), image, label); bool success = insertEntryImpl(position, fileName, Glib::RefPtr<const Gio::Icon>(), image, label, radioGroup);
if (!success && image) { if (!success && image) {
delete image; delete image;
} }
return success; return success;
} }
bool PopUpCommon::insertEntry(int position, const Glib::RefPtr<const Gio::Icon>& gIcon, const Glib::ustring& label) bool PopUpCommon::insertEntry(int position, const Glib::RefPtr<const Gio::Icon>& gIcon, const Glib::ustring& label, Gtk::RadioButtonGroup *radioGroup)
{ {
RTImage* image = Gtk::manage(new RTImage(gIcon, Gtk::ICON_SIZE_BUTTON)); RTImage* image = Gtk::manage(new RTImage(gIcon, Gtk::ICON_SIZE_BUTTON));
bool success = insertEntryImpl(position, "", gIcon, image, label); bool success = insertEntryImpl(position, "", gIcon, image, label, radioGroup);
if (!success) { if (!success) {
delete image; delete image;
} }
return success; return success;
} }
bool PopUpCommon::insertEntryImpl(int position, const Glib::ustring& fileName, const Glib::RefPtr<const Gio::Icon>& gIcon, RTImage* image, const Glib::ustring& label) bool PopUpCommon::insertEntryImpl(int position, const Glib::ustring& fileName, const Glib::RefPtr<const Gio::Icon>& gIcon, RTImage* image, const Glib::ustring& label, Gtk::RadioButtonGroup* radioGroup)
{ {
if (label.empty() || position < 0 || position > getEntryCount()) if (label.empty() || position < 0 || position > getEntryCount())
return false; return false;
// Create the menu item and image // Create the menu item and image
MyImageMenuItem *newItem = Gtk::manage(new MyImageMenuItem(label, image)); Gtk::MenuItem *newItem;
if (radioGroup) {
newItem = Gtk::manage(new MyRadioImageMenuItem(label, image, *radioGroup));
}
else {
newItem = Gtk::manage(new MyImageMenuItem(label, image));
}
imageIcons.insert(imageIcons.begin() + position, gIcon); imageIcons.insert(imageIcons.begin() + position, gIcon);
imageFilenames.insert(imageFilenames.begin() + position, fileName); imageFilenames.insert(imageFilenames.begin() + position, fileName);
images.insert(images.begin() + position, newItem->getImage()); images.insert(images.begin() + position, image);
// When there is at least 1 choice, we add the arrow button // When there is at least 1 choice, we add the arrow button
if (images.size() == 1) { if (images.size() == 1) {
@ -154,9 +160,8 @@ void PopUpCommon::removeEntry(int position)
setButtonHint(); setButtonHint();
} }
MyImageMenuItem *menuItem = dynamic_cast<MyImageMenuItem *>(menu->get_children()[position]); std::unique_ptr<Gtk::Widget> menuItem(menu->get_children()[position]);
menu->remove(*menuItem); menu->remove(*menuItem);
delete menuItem;
imageIcons.erase(imageIcons.begin() + position); imageIcons.erase(imageIcons.begin() + position);
imageFilenames.erase(imageFilenames.begin() + position); imageFilenames.erase(imageFilenames.begin() + position);
images.erase(images.begin() + position); images.erase(images.begin() + position);
@ -222,6 +227,12 @@ bool PopUpCommon::setSelected (int entryNum)
changeImage(entryNum); changeImage(entryNum);
selected = entryNum; selected = entryNum;
setButtonHint(); setButtonHint();
auto radioMenuItem = dynamic_cast<Gtk::RadioMenuItem*>(menu->get_children()[entryNum]);
if (radioMenuItem && menu->get_active() != radioMenuItem) {
radioMenuItem->set_active();
}
return true; return true;
} }
} }
@ -248,7 +259,7 @@ void PopUpCommon::setButtonHint()
if (selected > -1) { if (selected > -1) {
auto widget = menu->get_children ()[selected]; auto widget = menu->get_children ()[selected];
auto item = dynamic_cast<MyImageMenuItem*>(widget); auto item = dynamic_cast<MyImageMenuItemInterface*>(widget);
if (item) { if (item) {
hint += escapeHtmlChars(item->getLabel()->get_text()); hint += escapeHtmlChars(item->getLabel()->get_text());

View File

@ -40,6 +40,7 @@ class Grid;
class Menu; class Menu;
class Button; class Button;
class ImageMenuItem; class ImageMenuItem;
class RadioButtonGroup;
class Widget; class Widget;
} }
@ -60,9 +61,9 @@ public:
explicit PopUpCommon (Gtk::Button* button, const Glib::ustring& label = ""); explicit PopUpCommon (Gtk::Button* button, const Glib::ustring& label = "");
virtual ~PopUpCommon (); virtual ~PopUpCommon ();
bool addEntry (const Glib::ustring& fileName, const Glib::ustring& label); bool addEntry (const Glib::ustring& fileName, const Glib::ustring& label, Gtk::RadioButtonGroup* radioGroup = nullptr);
bool insertEntry(int position, const Glib::ustring& fileName, const Glib::ustring& label); bool insertEntry(int position, const Glib::ustring& fileName, const Glib::ustring& label, Gtk::RadioButtonGroup* radioGroup = nullptr);
bool insertEntry(int position, const Glib::RefPtr<const Gio::Icon>& gIcon, const Glib::ustring& label); bool insertEntry(int position, const Glib::RefPtr<const Gio::Icon>& gIcon, const Glib::ustring& label, Gtk::RadioButtonGroup* radioGroup = nullptr);
int getEntryCount () const; int getEntryCount () const;
bool setSelected (int entryNum); bool setSelected (int entryNum);
int getSelected () const; int getSelected () const;
@ -91,7 +92,7 @@ private:
void changeImage(int position); void changeImage(int position);
void changeImage(const Glib::ustring& fileName, const Glib::RefPtr<const Gio::Icon>& gIcon); void changeImage(const Glib::ustring& fileName, const Glib::RefPtr<const Gio::Icon>& gIcon);
void entrySelected(Gtk::Widget* menuItem); void entrySelected(Gtk::Widget* menuItem);
bool insertEntryImpl(int position, const Glib::ustring& fileName, const Glib::RefPtr<const Gio::Icon>& gIcon, RTImage* image, const Glib::ustring& label); bool insertEntryImpl(int position, const Glib::ustring& fileName, const Glib::RefPtr<const Gio::Icon>& gIcon, RTImage* image, const Glib::ustring& label, Gtk::RadioButtonGroup* radioGroup);
void showMenu(GdkEventButton* event); void showMenu(GdkEventButton* event);
protected: protected:

View File

@ -33,7 +33,7 @@
class BatchQueueEntry; class BatchQueueEntry;
class BatchQueuePanel; class BatchQueuePanel;
class EditorPanel; class EditorPanel;
class ExternalEditor; struct ExternalEditor;
class FilePanel; class FilePanel;
class PLDBridge; class PLDBridge;
class RTWindow final : class RTWindow final :