Merge branch 'dev' into rt-cli
This commit is contained in:
@@ -34,7 +34,7 @@ extern const Settings* settings;
|
||||
|
||||
ImProcCoordinator::ImProcCoordinator ()
|
||||
: orig_prev(nullptr), oprevi(nullptr), oprevl(nullptr), nprevl(nullptr), previmg(nullptr), workimg(nullptr),
|
||||
ncie(nullptr), imgsrc(nullptr), shmap(nullptr), lastAwbEqual(0.), ipf(¶ms, true), monitorIntent(RI_RELATIVE),
|
||||
ncie(nullptr), imgsrc(nullptr), shmap(nullptr), lastAwbEqual(0.), lastAwbTempBias(0.0), ipf(¶ms, true), monitorIntent(RI_RELATIVE),
|
||||
softProof(false), gamutCheck(false), scale(10), highDetailPreprocessComputed(false), highDetailRawComputed(false),
|
||||
allocated(false), bwAutoR(-9000.f), bwAutoG(-9000.f), bwAutoB(-9000.f), CAMMean(NAN),
|
||||
|
||||
@@ -87,7 +87,7 @@ ImProcCoordinator::ImProcCoordinator ()
|
||||
fw(0), fh(0), tr(0),
|
||||
fullw(1), fullh(1),
|
||||
pW(-1), pH(-1),
|
||||
plistener(nullptr), imageListener(nullptr), aeListener(nullptr), acListener(nullptr), abwListener(nullptr), actListener(nullptr), adnListener(nullptr), awavListener(nullptr), dehaListener(nullptr), hListener(nullptr),
|
||||
plistener(nullptr), imageListener(nullptr), aeListener(nullptr), acListener(nullptr), abwListener(nullptr), awbListener(nullptr), actListener(nullptr), adnListener(nullptr), awavListener(nullptr), dehaListener(nullptr), hListener(nullptr),
|
||||
resultValid(false), lastOutputProfile("BADFOOD"), lastOutputIntent(RI__COUNT), lastOutputBPC(false), thread(nullptr), changeSinceLast(0), updaterRunning(false), destroying(false), utili(false), autili(false), wavcontlutili(false),
|
||||
butili(false), ccutili(false), cclutili(false), clcutili(false), opautili(false), conversionBuffer(1, 1), colourToningSatLimit(0.f), colourToningSatLimitOpacity(0.f)
|
||||
{}
|
||||
@@ -185,6 +185,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
|
||||
|
||||
// raw auto CA is bypassed if no high detail is needed, so we have to compute it when high detail is needed
|
||||
if ( (todo & M_PREPROC) || (!highDetailPreprocessComputed && highDetailNeeded)) {
|
||||
imgsrc->setCurrentFrame(params.raw.bayersensor.imageNum);
|
||||
imgsrc->preprocess( rp, params.lensProf, params.coarse );
|
||||
imgsrc->getRAWHistogram( histRedRaw, histGreenRaw, histBlueRaw );
|
||||
|
||||
@@ -214,7 +215,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
|
||||
|
||||
if (settings->verbose) {
|
||||
if (imgsrc->getSensorType() == ST_BAYER) {
|
||||
printf("Demosaic Bayer image using method: %s\n", rp.bayersensor.method.c_str());
|
||||
printf("Demosaic Bayer image n.%d using method: %s\n", rp.bayersensor.imageNum + 1, rp.bayersensor.method.c_str());
|
||||
} else if (imgsrc->getSensorType() == ST_FUJI_XTRANS) {
|
||||
printf("Demosaic X-Trans image with using method: %s\n", rp.xtranssensor.method.c_str());
|
||||
}
|
||||
@@ -284,15 +285,17 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
|
||||
if (params.wb.method == "Camera") {
|
||||
currWB = imgsrc->getWB ();
|
||||
} else if (params.wb.method == "Auto") {
|
||||
if (lastAwbEqual != params.wb.equal) {
|
||||
if (lastAwbEqual != params.wb.equal || lastAwbTempBias != params.wb.tempBias) {
|
||||
double rm, gm, bm;
|
||||
imgsrc->getAutoWBMultipliers(rm, gm, bm);
|
||||
|
||||
if (rm != -1.) {
|
||||
autoWB.update(rm, gm, bm, params.wb.equal);
|
||||
autoWB.update(rm, gm, bm, params.wb.equal, params.wb.tempBias);
|
||||
lastAwbEqual = params.wb.equal;
|
||||
lastAwbTempBias = params.wb.tempBias;
|
||||
} else {
|
||||
lastAwbEqual = -1.;
|
||||
lastAwbTempBias = 0.0;
|
||||
autoWB.useDefaults(params.wb.equal);
|
||||
}
|
||||
|
||||
@@ -305,6 +308,9 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
|
||||
|
||||
params.wb.temperature = currWB.getTemp ();
|
||||
params.wb.green = currWB.getGreen ();
|
||||
if(params.wb.method == "Auto" && awbListener) {
|
||||
awbListener->WBChanged(params.wb.temperature, params.wb.green);
|
||||
}
|
||||
|
||||
int tr = getCoarseBitMask(params.coarse);
|
||||
|
||||
@@ -796,7 +802,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
|
||||
MyMutex::MyLock prevImgLock(previmg->getMutex());
|
||||
|
||||
try {
|
||||
// Computing the preview image, i.e. converting from WCS->Monitor color space (soft-proofing disabled) or WCS->Output profile->Monitor color space (soft-proofing enabled)
|
||||
// Computing the preview image, i.e. converting from WCS->Monitor color space (soft-proofing disabled) or WCS->Printer profile->Monitor color space (soft-proofing enabled)
|
||||
ipf.lab2monitorRgb (nprevl, previmg);
|
||||
|
||||
// Computing the internal image for analysis, i.e. conversion from WCS->Output profile
|
||||
@@ -1011,21 +1017,23 @@ void ImProcCoordinator::progress (Glib::ustring str, int pr)
|
||||
}*/
|
||||
}
|
||||
|
||||
bool ImProcCoordinator::getAutoWB (double& temp, double& green, double equal)
|
||||
bool ImProcCoordinator::getAutoWB (double& temp, double& green, double equal, double tempBias)
|
||||
{
|
||||
|
||||
if (imgsrc) {
|
||||
if (lastAwbEqual != equal) {
|
||||
if (lastAwbEqual != equal || lastAwbTempBias != tempBias) {
|
||||
// Issue 2500 MyMutex::MyLock lock(minit); // Also used in crop window
|
||||
double rm, gm, bm;
|
||||
imgsrc->getAutoWBMultipliers(rm, gm, bm);
|
||||
|
||||
if (rm != -1) {
|
||||
autoWB.update(rm, gm, bm, equal);
|
||||
autoWB.update(rm, gm, bm, equal, tempBias);
|
||||
lastAwbEqual = equal;
|
||||
lastAwbTempBias = tempBias;
|
||||
} else {
|
||||
lastAwbEqual = -1.;
|
||||
autoWB.useDefaults(equal);
|
||||
lastAwbTempBias = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1162,15 +1170,17 @@ void ImProcCoordinator::saveInputICCReference (const Glib::ustring& fname, bool
|
||||
if (params.wb.method == "Camera") {
|
||||
currWB = imgsrc->getWB ();
|
||||
} else if (params.wb.method == "Auto") {
|
||||
if (lastAwbEqual != params.wb.equal) {
|
||||
if (lastAwbEqual != params.wb.equal || lastAwbTempBias != params.wb.tempBias) {
|
||||
double rm, gm, bm;
|
||||
imgsrc->getAutoWBMultipliers(rm, gm, bm);
|
||||
|
||||
if (rm != -1.) {
|
||||
autoWB.update(rm, gm, bm, params.wb.equal);
|
||||
autoWB.update(rm, gm, bm, params.wb.equal, params.wb.tempBias);
|
||||
lastAwbEqual = params.wb.equal;
|
||||
lastAwbTempBias = params.wb.tempBias;
|
||||
} else {
|
||||
lastAwbEqual = -1.;
|
||||
lastAwbTempBias = 0.0;
|
||||
autoWB.useDefaults(params.wb.equal);
|
||||
}
|
||||
}
|
||||
@@ -1216,8 +1226,8 @@ void ImProcCoordinator::saveInputICCReference (const Glib::ustring& fname, bool
|
||||
// image may contain out of range samples, clip them to avoid wrap-arounds
|
||||
#pragma omp parallel for
|
||||
|
||||
for(int i = 0; i < im->height; i++) {
|
||||
for(int j = 0; j < im->width; j++) {
|
||||
for(int i = 0; i < im->getHeight(); i++) {
|
||||
for(int j = 0; j < im->getWidth(); j++) {
|
||||
im->r(i, j) = CLIP(im->r(i, j));
|
||||
im->g(i, j) = CLIP(im->g(i, j));
|
||||
im->b(i, j) = CLIP(im->b(i, j));
|
||||
|
Reference in New Issue
Block a user