iplocallab.cc: further cleanups
This commit is contained in:
parent
92d8e9920c
commit
e9218c314f
@ -13932,7 +13932,7 @@ void ImProcFunctions::Lab_Local(
|
|||||||
//inverse
|
//inverse
|
||||||
|
|
||||||
else if (lp.invex && (lp.expcomp != 0.0 || lp.laplacexp > 0.1f || params->locallab.spots.at(sp).fatamount > 1.f || (exlocalcurve && localexutili) || lp.enaExpMaskinv || lp.showmaskexpmetinv == 1) && lp.exposena) {
|
else if (lp.invex && (lp.expcomp != 0.0 || lp.laplacexp > 0.1f || params->locallab.spots.at(sp).fatamount > 1.f || (exlocalcurve && localexutili) || lp.enaExpMaskinv || lp.showmaskexpmetinv == 1) && lp.exposena) {
|
||||||
float adjustr = 2.f;
|
constexpr float adjustr = 2.f;
|
||||||
std::unique_ptr<LabImage> bufmaskblurexp;
|
std::unique_ptr<LabImage> bufmaskblurexp;
|
||||||
std::unique_ptr<LabImage> originalmaskexp;
|
std::unique_ptr<LabImage> originalmaskexp;
|
||||||
const std::unique_ptr<LabImage> bufexporig(new LabImage(GW, GH));
|
const std::unique_ptr<LabImage> bufexporig(new LabImage(GW, GH));
|
||||||
@ -13952,51 +13952,38 @@ void ImProcFunctions::Lab_Local(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int inv = 1;
|
constexpr int inv = 1;
|
||||||
bool showmaske = false;
|
const bool showmaske = lp.showmaskexpmetinv == 1;
|
||||||
bool enaMask = false;
|
const bool enaMask = lp.enaExpMaskinv;
|
||||||
bool deltaE = false;
|
constexpr bool deltaE = false;
|
||||||
bool modmask = false;
|
constexpr bool modmask = false;
|
||||||
bool zero = false;
|
const bool zero = lp.showmaskexpmetinv == 0;
|
||||||
bool modif = false;
|
constexpr bool modif = false;
|
||||||
|
const float chrom = lp.chromaexp;
|
||||||
if (lp.showmaskexpmetinv == 1) {
|
const float rad = lp.radmaexp;
|
||||||
showmaske = true;
|
const float gamma = lp.gammaexp;
|
||||||
}
|
const float slope = lp.slomaexp;
|
||||||
|
const float blendm = lp.blendmaexp;
|
||||||
if (lp.enaExpMaskinv) {
|
const float lap = params->locallab.spots.at(sp).lapmaskexp;
|
||||||
enaMask = true;
|
const bool pde = params->locallab.spots.at(sp).laplac;
|
||||||
}
|
|
||||||
|
|
||||||
if (lp.showmaskexpmetinv == 0) {
|
|
||||||
zero = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
float chrom = lp.chromaexp;
|
|
||||||
float rad = lp.radmaexp;
|
|
||||||
float gamma = lp.gammaexp;
|
|
||||||
float slope = lp.slomaexp;
|
|
||||||
float blendm = lp.blendmaexp;
|
|
||||||
float lap = params->locallab.spots.at(sp).lapmaskexp;
|
|
||||||
bool pde = params->locallab.spots.at(sp).laplac;
|
|
||||||
LocwavCurve dummy;
|
LocwavCurve dummy;
|
||||||
bool lmasutilicolwav = false;
|
const bool lmasutilicolwav = false;
|
||||||
// bool delt = params->locallab.spots.at(sp).deltae;
|
// bool delt = params->locallab.spots.at(sp).deltae;
|
||||||
bool delt = false;
|
const bool delt = false;
|
||||||
int sco = params->locallab.spots.at(sp).scopemask;
|
const int sco = params->locallab.spots.at(sp).scopemask;
|
||||||
int shado = 0;
|
constexpr int shado = 0;
|
||||||
int shortcu = 0;//lp.mergemet; //params->locallab.spots.at(sp).shortc;
|
constexpr int shortcu = 0;//lp.mergemet; //params->locallab.spots.at(sp).shortc;
|
||||||
int lumask = params->locallab.spots.at(sp).lumask;
|
const int lumask = params->locallab.spots.at(sp).lumask;
|
||||||
|
|
||||||
const int limscope = 80;
|
constexpr int limscope = 80;
|
||||||
const float mindE = 2.f + MINSCOPE * sco * lp.thr;
|
const float mindE = 2.f + MINSCOPE * sco * lp.thr;
|
||||||
const float maxdE = 5.f + MAXSCOPE * sco * (1 + 0.1f * lp.thr);
|
const float maxdE = 5.f + MAXSCOPE * sco * (1 + 0.1f * lp.thr);
|
||||||
const float mindElim = 2.f + MINSCOPE * limscope * lp.thr;
|
const float mindElim = 2.f + MINSCOPE * limscope * lp.thr;
|
||||||
const float maxdElim = 5.f + MAXSCOPE * limscope * (1 + 0.1f * lp.thr);
|
const float maxdElim = 5.f + MAXSCOPE * limscope * (1 + 0.1f * lp.thr);
|
||||||
float amountcd = 0.f;
|
constexpr float amountcd = 0.f;
|
||||||
float anchorcd = 50.f;
|
constexpr float anchorcd = 50.f;
|
||||||
LocHHmaskCurve lochhhmasCurve;
|
LocHHmaskCurve lochhhmasCurve;
|
||||||
bool lhhmasutili = false;
|
constexpr bool lhhmasutili = false;
|
||||||
|
|
||||||
maskcalccol(false, pde, GW, GH, 0, 0, sk, cx, cy, bufexporig.get(), bufmaskblurexp.get(), originalmaskexp.get(), original, reserved, inv, lp,
|
maskcalccol(false, pde, GW, GH, 0, 0, sk, cx, cy, bufexporig.get(), bufmaskblurexp.get(), originalmaskexp.get(), original, reserved, inv, lp,
|
||||||
0.f, false,
|
0.f, false,
|
||||||
@ -14008,7 +13995,6 @@ void ImProcFunctions::Lab_Local(
|
|||||||
|
|
||||||
if (lp.showmaskexpmetinv == 1) {
|
if (lp.showmaskexpmetinv == 1) {
|
||||||
showmask(lumask, lp, 0, 0, cx, cy, GW, GH, bufexporig.get(), transformed, bufmaskblurexp.get(), inv);
|
showmask(lumask, lp, 0, 0, cx, cy, GW, GH, bufexporig.get(), transformed, bufmaskblurexp.get(), inv);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -14019,138 +14005,45 @@ void ImProcFunctions::Lab_Local(
|
|||||||
float avge;
|
float avge;
|
||||||
calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili);
|
calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//local color and light
|
//local color and light
|
||||||
const float factor = LocallabParams::LABGRIDL_CORR_MAX * 3.276f;
|
const float factor = LocallabParams::LABGRIDL_CORR_MAX * 3.276f;
|
||||||
const float scaling = LocallabParams::LABGRIDL_CORR_SCALE;
|
const float scaling = LocallabParams::LABGRIDL_CORR_SCALE;
|
||||||
const float scaledirect = LocallabParams::LABGRIDL_DIRECT_SCALE;
|
const float scaledirect = LocallabParams::LABGRIDL_DIRECT_SCALE;
|
||||||
float a_scale = (lp.highA - lp.lowA) / factor / scaling;
|
const float a_scale = (lp.highA - lp.lowA) / factor / scaling;
|
||||||
float a_base = lp.lowA / scaling;
|
const float a_base = lp.lowA / scaling;
|
||||||
float b_scale = (lp.highB - lp.lowB) / factor / scaling;
|
const float b_scale = (lp.highB - lp.lowB) / factor / scaling;
|
||||||
float b_base = lp.lowB / scaling;
|
const float b_base = lp.lowB / scaling;
|
||||||
bool ctoning = (a_scale != 0.f || b_scale != 0.f || a_base != 0.f || b_base != 0.f);
|
const bool ctoning = (a_scale != 0.f || b_scale != 0.f || a_base != 0.f || b_base != 0.f);
|
||||||
|
const float a_scalemerg = (lp.highAmerg - lp.lowAmerg) / factor / scaling;
|
||||||
float a_scalemerg = (lp.highAmerg - lp.lowAmerg) / factor / scaling;
|
const float a_basemerg = lp.lowAmerg / scaling;
|
||||||
float a_basemerg = lp.lowAmerg / scaling;
|
const float b_scalemerg = (lp.highBmerg - lp.lowBmerg) / factor / scaling;
|
||||||
float b_scalemerg = (lp.highBmerg - lp.lowBmerg) / factor / scaling;
|
const float b_basemerg = lp.lowBmerg / scaling;
|
||||||
float b_basemerg = lp.lowBmerg / scaling;
|
const bool ctoningmerg = (a_scalemerg != 0.f || b_scalemerg != 0.f || a_basemerg != 0.f || b_basemerg != 0.f);
|
||||||
bool ctoningmerg = (a_scalemerg != 0.f || b_scalemerg != 0.f || a_basemerg != 0.f || b_basemerg != 0.f);
|
|
||||||
|
|
||||||
if (!lp.inv && (lp.chro != 0 || lp.ligh != 0.f || lp.cont != 0 || ctoning || lp.mergemet > 0 || lp.strcol != 0.f || lp.strcolab != 0.f || lp.qualcurvemet != 0 || lp.showmaskcolmet == 2 || lp.enaColorMask || lp.showmaskcolmet == 3 || lp.showmaskcolmet == 4 || lp.showmaskcolmet == 5 || lp.prevdE) && lp.colorena) { // || lllocalcurve)) { //interior ellipse renforced lightness and chroma //locallutili
|
if (!lp.inv && (lp.chro != 0 || lp.ligh != 0.f || lp.cont != 0 || ctoning || lp.mergemet > 0 || lp.strcol != 0.f || lp.strcolab != 0.f || lp.qualcurvemet != 0 || lp.showmaskcolmet == 2 || lp.enaColorMask || lp.showmaskcolmet == 3 || lp.showmaskcolmet == 4 || lp.showmaskcolmet == 5 || lp.prevdE) && lp.colorena) { // || lllocalcurve)) { //interior ellipse renforced lightness and chroma //locallutili
|
||||||
/*
|
|
||||||
//test for fftw blur with tiles fftw_tile_blur....not good we can see tiles - very long time
|
|
||||||
int GW = original->W;
|
|
||||||
int GH = original->H;
|
|
||||||
MyMutex::MyLock lock (*fftwMutex);
|
|
||||||
|
|
||||||
double radius = 100.f;
|
|
||||||
int tilssize = 64;
|
|
||||||
#ifdef _OPENMP
|
|
||||||
const int numThreads = omp_get_max_threads();
|
|
||||||
#else
|
|
||||||
const int numThreads = 1;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
int max_numblox_W = ceil((static_cast<float>(GW)) / offset) + 2;
|
|
||||||
// calculate min size of numblox_W.
|
|
||||||
int min_numblox_W = ceil((static_cast<float>(GW)) / offset) + 2;
|
|
||||||
fftw_tile_blur(GW, GH, tilssize , max_numblox_W, min_numblox_W, original->L, numThreads, radius);
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
//test for fftw blur with fftw_convol_blur: good result speedup moderate , but less used of memory than gaussianblur
|
|
||||||
|
|
||||||
//with FFTW curious results ex with playraw23_hombre.pef - size 4942*3276
|
|
||||||
// with size 4942*3276 time for tIF 3200ms
|
|
||||||
// with size 4941*3275 time for TIF 950ms...no differences in TIF and with 4928*3250 (2^6 * 7 * 11) * (2 * 5^3 * 13) = 520ms
|
|
||||||
// "step" to reproduce about 6 pixels
|
|
||||||
//another strange with DSCF1337.RAF 4012*6018 time 1318ms
|
|
||||||
// with 4004*6016 time 1091ms
|
|
||||||
//with 4004*6013 time 4057ms...steps seem also about 6 or 8
|
|
||||||
//NEF D200 best with 3888 * 2607 instead of 3892 2608
|
|
||||||
//D700 4275*2835 instead 4276*2836
|
|
||||||
//PANA LX100 4120*3095 instead of 4120*3096
|
|
||||||
//I have compared many things with FFTF COS -0.5 2*n -0.5, prime factor decomposition....nothing found
|
|
||||||
//I have read doc...nothing about that
|
|
||||||
//doc says optimum is with size 2^a * 3^b * 5^c * 7^d * 11^e * 13^f with e+f = 0 or 1
|
|
||||||
//we must found a number below of size as this
|
|
||||||
//combinaison
|
|
||||||
//see above fftw_size
|
|
||||||
|
|
||||||
/*
|
|
||||||
int GW = 4928/SQR(sk); //original->W-lp.ligh;//for test change size W
|
|
||||||
int GH = 3250/SQR(sk);//original->H- lp.cont;//test for chnage size H
|
|
||||||
printf("Gw=%i Gh=%i\n", GW, GH);
|
|
||||||
MyMutex::MyLock lock (*fftwMutex);
|
|
||||||
|
|
||||||
|
|
||||||
float *datain = nullptr; //new float[GW*GH];
|
|
||||||
datain = (float*) fftwf_malloc(sizeof(float) * (GW * GH));//allocate real datas for FFT
|
|
||||||
|
|
||||||
float *dataout = new float[GW*GH];
|
|
||||||
float radius = 500.f;
|
|
||||||
#ifdef _OPENMP
|
|
||||||
#pragma omp parallel for schedule(dynamic,16)
|
|
||||||
#endif
|
|
||||||
for (int y = 0; y < GH; y++) {
|
|
||||||
for (int x = 0; x < GW; x++) {
|
|
||||||
datain[y * GW + x] =original->L[y][x];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fftw_convol_blur(datain, dataout, GW, GH, radius, 0);
|
|
||||||
#ifdef _OPENMP
|
|
||||||
#pragma omp parallel for schedule(dynamic,16)
|
|
||||||
#endif
|
|
||||||
for (int y = 0; y < GH; y++) {
|
|
||||||
for (int x = 0; x < GW; x++) {
|
|
||||||
original->L[y][x] = dataout[y * GW + x];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
delete [] dataout;
|
|
||||||
fftwf_free(datain);
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
int ystart = std::max(static_cast<int>(lp.yc - lp.lyT) - cy, 0);
|
int ystart = std::max(static_cast<int>(lp.yc - lp.lyT) - cy, 0);
|
||||||
int yend = std::min(static_cast<int>(lp.yc + lp.ly) - cy, original->H);
|
int yend = std::min(static_cast<int>(lp.yc + lp.ly) - cy, original->H);
|
||||||
int xstart = std::max(static_cast<int>(lp.xc - lp.lxL) - cx, 0);
|
int xstart = std::max(static_cast<int>(lp.xc - lp.lxL) - cx, 0);
|
||||||
int xend = std::min(static_cast<int>(lp.xc + lp.lx) - cx, original->W);
|
int xend = std::min(static_cast<int>(lp.xc + lp.lx) - cx, original->W);
|
||||||
int bfh = yend - ystart;
|
int bfh = yend - ystart;
|
||||||
int bfw = xend - xstart;
|
int bfw = xend - xstart;
|
||||||
bool spez = params->locallab.spots.at(sp).special;
|
const bool spez = params->locallab.spots.at(sp).special;
|
||||||
int bfhr = bfh;
|
|
||||||
int bfwr = bfw;
|
|
||||||
// printf("bfw=%i bfh=%i lpx=%f lpy=%f lpxL=%f lpYT=%f\n", bfw, bfh, lp.lx, lp.ly, lp.lxL, lp.lyT);
|
|
||||||
|
|
||||||
if (bfw >= mSP && bfh >= mSP) {
|
if (bfw >= mSP && bfh >= mSP) {
|
||||||
|
|
||||||
if (lp.blurcolmask >= 0.25f && lp.fftColorMask && call == 2) {
|
if (lp.blurcolmask >= 0.25f && lp.fftColorMask && call == 2) {
|
||||||
optfft(N_fftwsize, bfh, bfw, bfhr, bfwr, lp, original->H, original->W, xstart, ystart, xend, yend, cx, cy);
|
optfft(N_fftwsize, bfh, bfw, bfh, bfw, lp, original->H, original->W, xstart, ystart, xend, yend, cx, cy);
|
||||||
}
|
}
|
||||||
|
|
||||||
//printf("bfwred=%i bfhred=%i lpx=%f lpy=%f lpxL=%f lpYT=%f\n", bfwr, bfhr, lp.lx, lp.ly, lp.lxL, lp.lyT);
|
|
||||||
|
|
||||||
bfh = bfhr;
|
|
||||||
bfw = bfwr;
|
|
||||||
|
|
||||||
std::unique_ptr<LabImage> bufcolorig;
|
std::unique_ptr<LabImage> bufcolorig;
|
||||||
std::unique_ptr<LabImage> bufcolfin;
|
std::unique_ptr<LabImage> bufcolfin;
|
||||||
std::unique_ptr<LabImage> bufmaskblurcol;
|
std::unique_ptr<LabImage> bufmaskblurcol;
|
||||||
std::unique_ptr<LabImage> originalmaskcol;
|
std::unique_ptr<LabImage> originalmaskcol;
|
||||||
std::unique_ptr<LabImage> bufcolreserv;
|
std::unique_ptr<LabImage> bufcolreserv;
|
||||||
std::unique_ptr<LabImage> buftemp;
|
std::unique_ptr<LabImage> buftemp;
|
||||||
|
|
||||||
// array2D<float> buflight(bfw, bfh, true);
|
|
||||||
// JaggedArray<float> bufchro(bfw, bfh, true);
|
|
||||||
// JaggedArray<float> bufhh(bfw, bfh, true);
|
|
||||||
|
|
||||||
array2D<float> blend2;
|
array2D<float> blend2;
|
||||||
// JaggedArray<float> buf_a(bfw, bfh, true);
|
|
||||||
// JaggedArray<float> buf_b(bfw, bfh, true);
|
|
||||||
|
|
||||||
float adjustr = 1.0f;
|
float adjustr = 1.0f;
|
||||||
|
|
||||||
@ -14184,7 +14077,6 @@ void ImProcFunctions::Lab_Local(
|
|||||||
#ifdef _OPENMP
|
#ifdef _OPENMP
|
||||||
#pragma omp parallel for schedule(dynamic,16)
|
#pragma omp parallel for schedule(dynamic,16)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (int y = 0; y < bfh ; y++) {
|
for (int y = 0; y < bfh ; y++) {
|
||||||
for (int x = 0; x < bfw; x++) {
|
for (int x = 0; x < bfw; x++) {
|
||||||
bufcolorig->L[y][x] = original->L[y + ystart][x + xstart];
|
bufcolorig->L[y][x] = original->L[y + ystart][x + xstart];
|
||||||
@ -14210,7 +14102,6 @@ void ImProcFunctions::Lab_Local(
|
|||||||
#ifdef _OPENMP
|
#ifdef _OPENMP
|
||||||
#pragma omp parallel for schedule(dynamic,16)
|
#pragma omp parallel for schedule(dynamic,16)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (int y = ystart; y < yend ; y++) {
|
for (int y = ystart; y < yend ; y++) {
|
||||||
for (int x = xstart; x < xend; x++) {
|
for (int x = xstart; x < xend; x++) {
|
||||||
const int lox = cx + x;
|
const int lox = cx + x;
|
||||||
@ -14232,65 +14123,38 @@ void ImProcFunctions::Lab_Local(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int inv = 0;
|
const int inv = 0;
|
||||||
bool showmaske = false;
|
const bool showmaske = lp.showmaskcolmet == 3;
|
||||||
bool enaMask = false;
|
const bool enaMask = lp.enaColorMask;
|
||||||
bool deltaE = false;
|
const bool deltaE = lp.showmaskcolmet == 5;
|
||||||
bool modmask = false;
|
const bool modmask = lp.showmaskcolmet == 2;
|
||||||
bool zero = false;
|
const bool zero = lp.showmaskcolmet == 0;
|
||||||
bool modif = false;
|
const bool modif = lp.showmaskcolmet == 1;
|
||||||
|
const float chrom = lp.chromacol;
|
||||||
if (lp.showmaskcolmet == 3) {
|
const float rad = lp.radmacol;
|
||||||
showmaske = true;
|
const float gamma = lp.gammacol;
|
||||||
}
|
const float slope = lp.slomacol;
|
||||||
|
const float blendm = lp.blendmacol;
|
||||||
if (lp.enaColorMask) {
|
const float lap = params->locallab.spots.at(sp).lapmaskcol;
|
||||||
enaMask = true;
|
const bool pde = params->locallab.spots.at(sp).laplac;
|
||||||
}
|
const int shado = params->locallab.spots.at(sp).shadmaskcol;
|
||||||
|
const int sco = params->locallab.spots.at(sp).scopemask;
|
||||||
if (lp.showmaskcolmet == 5) {
|
const int level_bl = params->locallab.spots.at(sp).csthresholdcol.getBottomLeft();
|
||||||
deltaE = true;
|
const int level_hl = params->locallab.spots.at(sp).csthresholdcol.getTopLeft();
|
||||||
}
|
const int level_br = params->locallab.spots.at(sp).csthresholdcol.getBottomRight();
|
||||||
|
const int level_hr = params->locallab.spots.at(sp).csthresholdcol.getTopRight();
|
||||||
if (lp.showmaskcolmet == 2) {
|
const int shortcu = lp.mergemet; //params->locallab.spots.at(sp).shortc;
|
||||||
modmask = true;
|
const int lumask = params->locallab.spots.at(sp).lumask;
|
||||||
}
|
const float strumask = 0.02f * (float) params->locallab.spots.at(sp).strumaskcol;
|
||||||
|
|
||||||
if (lp.showmaskcolmet == 1) {
|
|
||||||
modif = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lp.showmaskcolmet == 0) {
|
|
||||||
zero = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
float chrom = lp.chromacol;
|
|
||||||
float rad = lp.radmacol;
|
|
||||||
float gamma = lp.gammacol;
|
|
||||||
float slope = lp.slomacol;
|
|
||||||
float blendm = lp.blendmacol;
|
|
||||||
float lap = params->locallab.spots.at(sp).lapmaskcol;
|
|
||||||
bool pde = params->locallab.spots.at(sp).laplac;
|
|
||||||
int shado = params->locallab.spots.at(sp).shadmaskcol;
|
|
||||||
int sco = params->locallab.spots.at(sp).scopemask;
|
|
||||||
int level_bl = params->locallab.spots.at(sp).csthresholdcol.getBottomLeft();
|
|
||||||
int level_hl = params->locallab.spots.at(sp).csthresholdcol.getTopLeft();
|
|
||||||
int level_br = params->locallab.spots.at(sp).csthresholdcol.getBottomRight();
|
|
||||||
int level_hr = params->locallab.spots.at(sp).csthresholdcol.getTopRight();
|
|
||||||
int shortcu = lp.mergemet; //params->locallab.spots.at(sp).shortc;
|
|
||||||
int lumask = params->locallab.spots.at(sp).lumask;
|
|
||||||
float strumask = 0.02f * (float) params->locallab.spots.at(sp).strumaskcol;
|
|
||||||
float conthr = 0.01f * params->locallab.spots.at(sp).conthrcol;
|
float conthr = 0.01f * params->locallab.spots.at(sp).conthrcol;
|
||||||
int tonemod = 0;
|
const float mercol = params->locallab.spots.at(sp).mercol;
|
||||||
float mercol = params->locallab.spots.at(sp).mercol;
|
const float merlucol = params->locallab.spots.at(sp).merlucol;
|
||||||
float merlucol = params->locallab.spots.at(sp).merlucol;
|
|
||||||
|
|
||||||
|
int tonemod = 0;
|
||||||
if (params->locallab.spots.at(sp).toneMethod == "one") {
|
if (params->locallab.spots.at(sp).toneMethod == "one") {
|
||||||
tonemod = 0;
|
tonemod = 0;
|
||||||
} else if (params->locallab.spots.at(sp).toneMethod == "two") {
|
} else if (params->locallab.spots.at(sp).toneMethod == "two") {
|
||||||
@ -14301,13 +14165,13 @@ void ImProcFunctions::Lab_Local(
|
|||||||
tonemod = 3;
|
tonemod = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int limscope = 80;
|
constexpr int limscope = 80;
|
||||||
const float mindE = 2.f + MINSCOPE * sco * lp.thr;
|
const float mindE = 2.f + MINSCOPE * sco * lp.thr;
|
||||||
const float maxdE = 5.f + MAXSCOPE * sco * (1 + 0.1f * lp.thr);
|
const float maxdE = 5.f + MAXSCOPE * sco * (1 + 0.1f * lp.thr);
|
||||||
const float mindElim = 2.f + MINSCOPE * limscope * lp.thr;
|
const float mindElim = 2.f + MINSCOPE * limscope * lp.thr;
|
||||||
const float maxdElim = 5.f + MAXSCOPE * limscope * (1 + 0.1f * lp.thr);
|
const float maxdElim = 5.f + MAXSCOPE * limscope * (1 + 0.1f * lp.thr);
|
||||||
float amountcd = 0.f;
|
const float amountcd = 0.f;
|
||||||
float anchorcd = 50.f;
|
const float anchorcd = 50.f;
|
||||||
|
|
||||||
maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, bufcolorig.get(), bufmaskblurcol.get(), originalmaskcol.get(), original, reserved, inv, lp,
|
maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, bufcolorig.get(), bufmaskblurcol.get(), originalmaskcol.get(), original, reserved, inv, lp,
|
||||||
strumask, astool,
|
strumask, astool,
|
||||||
@ -14320,11 +14184,8 @@ void ImProcFunctions::Lab_Local(
|
|||||||
|
|
||||||
if (lp.showmaskcolmet == 3) {
|
if (lp.showmaskcolmet == 3) {
|
||||||
showmask(lumask, lp, xstart, ystart, cx, cy, bfw, bfh, bufcolorig.get(), transformed, bufmaskblurcol.get(), 0);
|
showmask(lumask, lp, xstart, ystart, cx, cy, bfw, bfh, bufcolorig.get(), transformed, bufmaskblurcol.get(), 0);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
} else if (lp.showmaskcolmet == 4) {
|
||||||
|
|
||||||
if (lp.showmaskcolmet == 4) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -14334,9 +14195,7 @@ void ImProcFunctions::Lab_Local(
|
|||||||
|
|
||||||
if (rgblocalcurve && localrgbutili && lp.qualcurvemet != 0) {
|
if (rgblocalcurve && localrgbutili && lp.qualcurvemet != 0) {
|
||||||
usergb = true;
|
usergb = true;
|
||||||
|
Imagefloat *tmpImage = new Imagefloat(bfw, bfh);
|
||||||
Imagefloat *tmpImage = nullptr;
|
|
||||||
tmpImage = new Imagefloat(bfw, bfh);
|
|
||||||
|
|
||||||
float *rtemp = new float[bfw * bfh];
|
float *rtemp = new float[bfw * bfh];
|
||||||
float *gtemp = new float[bfw * bfh];
|
float *gtemp = new float[bfw * bfh];
|
||||||
@ -14353,8 +14212,6 @@ void ImProcFunctions::Lab_Local(
|
|||||||
gtemp[y * bfw + x] = tmpImage->g(y, x);
|
gtemp[y * bfw + x] = tmpImage->g(y, x);
|
||||||
btemp[y * bfw + x] = tmpImage->b(y, x);
|
btemp[y * bfw + x] = tmpImage->b(y, x);
|
||||||
|
|
||||||
assert(rgblocalcurve);
|
|
||||||
|
|
||||||
//std
|
//std
|
||||||
if (tonemod == 0) {
|
if (tonemod == 0) {
|
||||||
curves::setLutVal(rgblocalcurve, rtemp[y * bfw + x], gtemp[y * bfw + x], btemp[y * bfw + x]);
|
curves::setLutVal(rgblocalcurve, rtemp[y * bfw + x], gtemp[y * bfw + x], btemp[y * bfw + x]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user