From d21c96cdd6c9d755ae8c6168c6aa610343b67295 Mon Sep 17 00:00:00 2001 From: Hombre Date: Wed, 20 Apr 2011 18:58:30 +0200 Subject: [PATCH] Solving issue 630 : Randomly distributed colored hotspot pixels in defloat branch. Now there's still hotspots (especially BIG ones at 1:1 scale :) ), but they are not random anymore... --- rtengine/iplab2rgb.cc | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/rtengine/iplab2rgb.cc b/rtengine/iplab2rgb.cc index 981290279..29e575850 100644 --- a/rtengine/iplab2rgb.cc +++ b/rtengine/iplab2rgb.cc @@ -66,6 +66,7 @@ void ImProcFunctions::lab2rgb (LabImage* lab, Image8* image) { #pragma omp parallel for if (multiThread) for (int i=0; iH; i++) { float buffer[3*lab->W]; + float g; const int ix = i * 3 * lab->W; int iy = 0; @@ -74,7 +75,6 @@ void ImProcFunctions::lab2rgb (LabImage* lab, Image8* image) { float* ra = lab->a[i]; float* rb = lab->b[i]; - float R,G,B; float fy,fx,fz,x_,y_,z_; for (int j=0; jW; j++) { @@ -105,6 +105,7 @@ void ImProcFunctions::lab2rgb (LabImage* lab, Image8* image) { float* ra = lab->a[i]; float* rb = lab->b[i]; int ix = i * 3 * lab->W; + float g; float R,G,B; float fy,fx,fz,x_,y_,z_; @@ -117,9 +118,9 @@ void ImProcFunctions::lab2rgb (LabImage* lab, Image8* image) { fx = (0.002 * ra[j]) / 327.68 + fy; fz = fy - (0.005 * rb[j]) / 327.68; - x_ = 65535*Lab2xyz(fx)*D50x; - y_ = 65535*Lab2xyz(fy); - z_ = 65535*Lab2xyz(fz)*D50z; + x_ = 65535.0*Lab2xyz(fx)*D50x; + y_ = 65535.0*Lab2xyz(fy); + z_ = 65535.0*Lab2xyz(fz)*D50z; xyz2srgb(x_,y_,z_,R,G,B); @@ -162,6 +163,7 @@ Image8* ImProcFunctions::lab2rgb (LabImage* lab, int cx, int cy, int cw, int ch, #pragma omp parallel for if (multiThread) for (int i=cy; i