From ee20b2a4db8cdea1a9975eec206c8f1987e15e9d Mon Sep 17 00:00:00 2001 From: Oliver Duis Date: Sun, 19 Jun 2011 09:22:29 +0200 Subject: [PATCH] False color suppression with blown highlights problem see issue 752 --- rtengine/rawimagesource.cc | 17 +++++++++-------- rtengine/rawimagesource.h | 4 ++-- rtengine/rawimagesource_i.h | 9 +++------ 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 15e9cd131..902209ac7 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -417,7 +417,7 @@ void RawImageSource::getImage (ColorTemp ctemp, int tran, Imagefloat* image, Pre // Color correction (only when running on full resolution) if (ri->isBayer() && pp.skip==1) - correction_YIQ_LQ (image, raw.ccSteps); + processFalseColorCorrection (image, raw.ccSteps); // Applying postmul colorSpaceConversion (image, cmp, embProfile, camProfile, xyz_cam, defGain); @@ -1403,7 +1403,8 @@ int RawImageSource::defTransform (int tran) { //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -void RawImageSource::correction_YIQ_LQ_ (Imagefloat* im, int row_from, int row_to) { +// Thread called part +void RawImageSource::processFalseColorCorrectionThread (Imagefloat* im, int row_from, int row_to) { int W = im->width; @@ -1532,13 +1533,13 @@ void RawImageSource::correction_YIQ_LQ_ (Imagefloat* im, int row_from, int row_ //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -void RawImageSource::correction_YIQ_LQ (Imagefloat* im, int times) { +// correction_YIQ_LQ +void RawImageSource::processFalseColorCorrection (Imagefloat* im, int steps) { if (im->height<4) return; - for (int t=0; theight-2)/nthreads; if (tidheight - 1); + processFalseColorCorrectionThread (im, 1 + tid*blk, im->height - 1); } #else - correction_YIQ_LQ_ (im, 1 , im->height - 1); + processFalseColorCorrectionThread (im, 1 , im->height - 1); #endif } } diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h index 82cb8dcc7..6a1f25d5b 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -106,7 +106,7 @@ class RawImageSource : public ImageSource { void hphd_vertical (float** hpmap, int col_from, int col_to); void hphd_horizontal (float** hpmap, int row_from, int row_to); void hphd_green (float** hpmap); - void correction_YIQ_LQ_ (Imagefloat* im, int row_from, int row_to); + void processFalseColorCorrectionThread (Imagefloat* im, int row_from, int row_to); void hlRecovery (std::string method, float* red, float* green, float* blue, int i, int sx1, int width, int skip, const RAWParams &raw); int defTransform (int tran); void rotateLine (float* line, float** channel, int tran, int i, int w, int h); @@ -157,7 +157,7 @@ class RawImageSource : public ImageSource { protected: typedef unsigned short ushort; - void correction_YIQ_LQ (Imagefloat* i, int times); + void processFalseColorCorrection (Imagefloat* i, int steps); inline void convert_row_to_YIQ (float* r, float* g, float* b, float* Y, float* I, float* Q, int W); inline void convert_row_to_RGB (float* r, float* g, float* b, float* Y, float* I, float* Q, int W); diff --git a/rtengine/rawimagesource_i.h b/rtengine/rawimagesource_i.h index 12a79d870..0910ed96f 100644 --- a/rtengine/rawimagesource_i.h +++ b/rtengine/rawimagesource_i.h @@ -42,12 +42,9 @@ inline void RawImageSource::convert_row_to_YIQ (float* r, float* g, float* b, fl inline void RawImageSource::convert_row_to_RGB (float* r, float* g, float* b, float* Y, float* I, float* Q, int W) { for (int j=1; j