Solving issue 1457: "Preview sometimes doesn't update, demozaicing occure too often"
This commit is contained in:
@@ -79,7 +79,7 @@ void Crop::update (int todo) {
|
|||||||
else
|
else
|
||||||
needsinitupdate = setCropSizes (wx, wy, ww, wh, ws, true); // this set skip=ws
|
needsinitupdate = setCropSizes (wx, wy, ww, wh, ws, true); // this set skip=ws
|
||||||
// it something has been reallocated, all processing steps have to be performed
|
// it something has been reallocated, all processing steps have to be performed
|
||||||
if (needsinitupdate)
|
if (needsinitupdate || (todo & M_HIGHQUAL))
|
||||||
todo = ALL;
|
todo = ALL;
|
||||||
|
|
||||||
baseCrop = origCrop;
|
baseCrop = origCrop;
|
||||||
|
@@ -28,7 +28,7 @@ namespace rtengine {
|
|||||||
extern const Settings* settings;
|
extern const Settings* settings;
|
||||||
|
|
||||||
ImProcCoordinator::ImProcCoordinator ()
|
ImProcCoordinator::ImProcCoordinator ()
|
||||||
: workimg(NULL), awbComputed(false), ipf(¶ms, true), scale(10), lastHighDetail(false), allocated(false),
|
: workimg(NULL), awbComputed(false), ipf(¶ms, true), scale(10), highDetailComputed(false), allocated(false),
|
||||||
pW(-1), pH(-1), plistener(NULL),
|
pW(-1), pH(-1), plistener(NULL),
|
||||||
imageListener(NULL), aeListener(NULL), hListener(NULL), resultValid(false),
|
imageListener(NULL), aeListener(NULL), hListener(NULL), resultValid(false),
|
||||||
changeSinceLast(0), updaterRunning(false), destroying(false) {
|
changeSinceLast(0), updaterRunning(false), destroying(false) {
|
||||||
@@ -137,15 +137,23 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) {
|
|||||||
OR HLR gets disabled when Color method was selected
|
OR HLR gets disabled when Color method was selected
|
||||||
*/
|
*/
|
||||||
// If high detail (=100%) is newly selected, do a demosaic update, since the last was just with FAST
|
// If high detail (=100%) is newly selected, do a demosaic update, since the last was just with FAST
|
||||||
if ((todo & M_RAW)
|
if ( (todo & M_RAW)
|
||||||
|| (!lastHighDetail && highDetailNeeded)
|
|| (!highDetailComputed && highDetailNeeded)
|
||||||
|| (params.hlrecovery.enabled && params.hlrecovery.method!="Color" && imgsrc->IsrgbSourceModified())
|
|| ( params.hlrecovery.enabled && params.hlrecovery.method!="Color" && imgsrc->IsrgbSourceModified())
|
||||||
|| (!params.hlrecovery.enabled && params.hlrecovery.method=="Color" && imgsrc->IsrgbSourceModified())){
|
|| (!params.hlrecovery.enabled && params.hlrecovery.method=="Color" && imgsrc->IsrgbSourceModified()))
|
||||||
|
{
|
||||||
|
|
||||||
if (settings->verbose) printf("Demosaic %s\n",rp.dmethod.c_str());
|
if (settings->verbose) printf("Demosaic %s\n",rp.dmethod.c_str());
|
||||||
imgsrc->demosaic( rp );
|
imgsrc->demosaic( rp );
|
||||||
|
if (highDetailNeeded) {
|
||||||
|
highDetailComputed = true;
|
||||||
|
if (params.hlrecovery.enabled && params.hlrecovery.method=="Color") {
|
||||||
|
todo |= M_INIT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
highDetailComputed = false;
|
||||||
}
|
}
|
||||||
lastHighDetail=highDetailNeeded;
|
|
||||||
|
|
||||||
|
|
||||||
if (todo & M_INIT) {
|
if (todo & M_INIT) {
|
||||||
|
@@ -60,7 +60,7 @@ class ImProcCoordinator : public StagedImageProcessor {
|
|||||||
ImProcFunctions ipf;
|
ImProcFunctions ipf;
|
||||||
|
|
||||||
int scale;
|
int scale;
|
||||||
bool lastHighDetail; // was the last update running in high detail?
|
bool highDetailComputed;
|
||||||
bool allocated;
|
bool allocated;
|
||||||
|
|
||||||
void freeAll ();
|
void freeAll ();
|
||||||
|
Reference in New Issue
Block a user