From 5a41f3ef96d4fdabdf4a3a51504049127c7850ee Mon Sep 17 00:00:00 2001 From: natureh Date: Mon, 23 Jul 2012 22:50:24 +0200 Subject: [PATCH] Solving issue 1407: "Auto CA Correction in RAW page is not applied when re-open 4.0.9.1" --- rtengine/improccoordinator.cc | 15 ++++++++++----- rtengine/improccoordinator.h | 3 ++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 361c3aecc..5ad16a34f 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -28,7 +28,7 @@ namespace rtengine { extern const Settings* settings; ImProcCoordinator::ImProcCoordinator () - : workimg(NULL), awbComputed(false), ipf(¶ms, true), scale(10), highDetailComputed(false), allocated(false), + : workimg(NULL), awbComputed(false), ipf(¶ms, true), scale(10), highDetailPreprocessComputed(false), highDetailRawComputed(false), allocated(false), pW(-1), pH(-1), plistener(NULL), imageListener(NULL), aeListener(NULL), hListener(NULL), resultValid(false), changeSinceLast(0), updaterRunning(false), destroying(false) { @@ -122,9 +122,14 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) { } progress ("Applying white balance, color correction & sRGB conversion...",100*readyphase/numofphases); - if ( todo & M_PREPROC) { + // 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->preprocess( rp, params.lensProf, params.coarse ); imgsrc->getRAWHistogram( histRedRaw, histGreenRaw, histBlueRaw ); + if (highDetailNeeded) + highDetailPreprocessComputed = true; + else + highDetailPreprocessComputed = false; } /* @@ -139,7 +144,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) { */ // If high detail (=100%) is newly selected, do a demosaic update, since the last was just with FAST if ( (todo & M_RAW) - || (!highDetailComputed && highDetailNeeded) + || (!highDetailRawComputed && highDetailNeeded) || ( params.hlrecovery.enabled && params.hlrecovery.method!="Color" && imgsrc->IsrgbSourceModified()) || (!params.hlrecovery.enabled && params.hlrecovery.method=="Color" && imgsrc->IsrgbSourceModified())) { @@ -147,13 +152,13 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) { if (settings->verbose) printf("Demosaic %s\n",rp.dmethod.c_str()); imgsrc->demosaic( rp ); if (highDetailNeeded) { - highDetailComputed = true; + highDetailRawComputed = true; if (params.hlrecovery.enabled && params.hlrecovery.method=="Color") { todo |= M_INIT; } } else - highDetailComputed = false; + highDetailRawComputed = false; } diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index aca603c24..b04e58e90 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -60,7 +60,8 @@ class ImProcCoordinator : public StagedImageProcessor { ImProcFunctions ipf; int scale; - bool highDetailComputed; + bool highDetailPreprocessComputed; + bool highDetailRawComputed; bool allocated; void freeAll ();