Change calculation references in case of exclude spot

This commit is contained in:
Desmis 2018-02-08 07:57:28 +01:00
parent 4136a6ee03
commit abd26953a5
3 changed files with 80 additions and 64 deletions

View File

@ -737,7 +737,7 @@ void CurveFactory::complexsgnCurve(bool & autili, bool & butili, bool & ccutili
}
void CurveFactory::complexCurve (double ecomp, double black, double hlcompr, double hlcomprthresh,
void CurveFactory::complexCurve(double ecomp, double black, double hlcompr, double hlcomprthresh,
double shcompr, double br, double contr,
const std::vector<double>& curvePoints,
const std::vector<double>& curvePoints2,
@ -2566,7 +2566,7 @@ void PerceptualToneCurve::BatchApply(const size_t start, const size_t end, float
Color::Prophotoxyz(r, g, b, x, y, z);
float J, C, h;
Ciecam02::xyz2jch_ciecam02float( J, C, h,
Ciecam02::xyz2jch_ciecam02float(J, C, h,
aw, fl,
x * 0.0015259022f, y * 0.0015259022f, z * 0.0015259022f,
xw, yw, zw,
@ -2583,6 +2583,7 @@ void PerceptualToneCurve::BatchApply(const size_t start, const size_t end, float
g = newg;
b = newb;
}
rc[i] = r;
gc[i] = g;
bc[i] = b;
@ -2677,10 +2678,10 @@ void PerceptualToneCurve::BatchApply(const size_t start, const size_t end, float
C *= cmul;
Ciecam02::jch2xyz_ciecam02float( x, y, z,
Ciecam02::jch2xyz_ciecam02float(x, y, z,
J, C, h,
xw, yw, zw,
c, nc, 1, pow1, nbb, ncb, fl, cz, d, aw );
c, nc, 1, pow1, nbb, ncb, fl, cz, d, aw);
if (!isfinite(x) || !isfinite(y) || !isfinite(z)) {
// can happen for colours on the rim of being outside gamut, that worked without chroma scaling but not with. Then we return only the curve's result.
@ -2756,6 +2757,7 @@ void PerceptualToneCurve::BatchApply(const size_t start, const size_t end, float
g = newg;
b = newb;
}
rc[i] = r;
gc[i] = g;
bc[i] = b;

View File

@ -229,7 +229,7 @@ ImProcCoordinator::ImProcCoordinator()
chromar(0),
lumar(0),
sobeler(0),
colourToningSatLimit(0.f), colourToningSatLimitOpacity(0.f), lastspotdup(false), highQualityComputed (false),
colourToningSatLimit(0.f), colourToningSatLimitOpacity(0.f), lastspotdup(false), highQualityComputed(false),
retistrsav(nullptr)
{}
@ -2698,7 +2698,12 @@ void ImProcCoordinator::updatePreviewImage(int todo, Crop* cropCall)
double huere, chromare, lumare, huerefblu;
double sobelre;
if (params.locallab.Exclumethod == "exc") {
ipf.calc_ref(reserv, reserv, 0, 0, pW, pH, scale, huerefblu, huere, chromare, lumare, sobelre);
} else {
ipf.calc_ref(nprevl, nprevl, 0, 0, pW, pH, scale, huerefblu, huere, chromare, lumare, sobelre);
}
huerblu = huerefblu;
huer = huere;
chromar = chromare;
@ -4899,25 +4904,28 @@ void ImProcCoordinator::changenumberofspot(int **dataspot, int maxdata, int maxs
fich2.close() ;
}
}
bool ImProcCoordinator::getHighQualComputed() {
bool ImProcCoordinator::getHighQualComputed()
{
// this function may only be called from detail windows
if(!highQualityComputed) {
if(options.prevdemo == PD_Sidecar) {
if (!highQualityComputed) {
if (options.prevdemo == PD_Sidecar) {
// we already have high quality preview
setHighQualComputed();
} else {
for (size_t i = 0; i < crops.size() - 1; ++i) { // -1, because last entry is the freshly created detail window
if (crops[i]->get_skip() == 1 ) { // there is at least one crop with skip == 1 => we already have high quality preview
if (crops[i]->get_skip() == 1) { // there is at least one crop with skip == 1 => we already have high quality preview
setHighQualComputed();
break;
}
}
}
}
return highQualityComputed;
}
void ImProcCoordinator::setHighQualComputed() {
void ImProcCoordinator::setHighQualComputed()
{
highQualityComputed = true;
}

View File

@ -1147,8 +1147,8 @@ private:
dataspots = new int*[maxdata];
LUTf huerefs(500, -10000.f);
LUTf sobelrefs(500, -10000.f);
LUTi centerx (500, -10000);
LUTi centery (500, -10000);
LUTi centerx(500, -10000);
LUTi centery(500, -10000);
for (int i = 0; i < maxdata; i++) {
dataspots[i] = new int[maxspot];
@ -1722,7 +1722,7 @@ private:
params.locallab.locY = dataspots[4][sp];
params.locallab.locYT = dataspots[5][sp];
params.locallab.locXL = dataspots[6][sp];
params.locallab.centerX = centerx[sp]= dataspots[7][sp];
params.locallab.centerX = centerx[sp] = dataspots[7][sp];
params.locallab.centerY = centery[sp] = dataspots[8][sp];
params.locallab.lightness = dataspots[9][sp];
params.locallab.contrast = dataspots[10][sp];
@ -2166,8 +2166,14 @@ private:
double huere, chromare, lumare, huerefblu;
double sobelre;
if (params.locallab.Exclumethod == "exc") {
ipf.calc_ref(reservView, reservView, 0, 0, fw, fh, 1, huerefblu, huere, chromare, lumare, sobelre);
} else {
ipf.calc_ref(labView, labView, 0, 0, fw, fh, 1, huerefblu, huere, chromare, lumare, sobelre);
}
params.locallab.huerefblur = huerefblu;
params.locallab.hueref = huere;
params.locallab.chromaref = chromare;