From 5ec5a0cf21e39fff0f88c83908abce08c78cae37 Mon Sep 17 00:00:00 2001 From: Emil Martinec Date: Thu, 7 Apr 2011 14:40:47 -0500 Subject: [PATCH] re-enabling some functions mistakenly turned off from float branch testing. --- rtengine/dcrop.cc | 5 +---- rtengine/rawimagesource.cc | 32 ++++++++++---------------------- 2 files changed, 11 insertions(+), 26 deletions(-) diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 0bf949553..0becc9379 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -112,10 +112,7 @@ void Crop::update (int todo) { setCropSizes (rqcropx, rqcropy, rqcropw, rqcroph, skip, true); PreviewProps pp (trafx, trafy, trafw*skip, trafh*skip, skip); parent->imgsrc->getImage (parent->currWB, tr, origCrop, pp, params.hlrecovery, params.icm, params.raw ); - /*if (origCrop->height>100 & origCrop->width>100) { - printf("dcrop init R= %f G= %f B= %f \n",origCrop->r[100][100]/256,origCrop->g[100][100]/256,origCrop->b[100][100]/256); - printf("init sRGB R= %d G= %d B= %d \n",CurveFactory::gamma_srgb((int)origCrop->r[100][100])/256,CurveFactory::gamma_srgb((int)origCrop->g[100][100])/256,CurveFactory::gamma_srgb((int)origCrop->b[100][100])/256); - }*/ + parent->minit.unlock (); } diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index e2920e06e..149aea679 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -358,12 +358,8 @@ void RawImageSource::getImage (ColorTemp ctemp, int tran, Imagefloat* image, Pre } } - //if (hrp.enabled) - // hlRecovery (hrp.method, line_red, line_grn, line_blue, i, sx1, imwidth, skip); - - if (ix==imheight-1 && skip==6) - printf("getImage before transLine r=%f g=%f b=%f \n", - image->r[828/skip][786/skip],image->g[828/skip][786/skip],image->b[828/skip][786/skip]); + if (hrp.enabled) + hlRecovery (hrp.method, line_red, line_grn, line_blue, i, sx1, imwidth, skip); transLine (line_red, line_grn, line_blue, ix, image, tran, imwidth, imheight, fw); @@ -375,7 +371,7 @@ void RawImageSource::getImage (ColorTemp ctemp, int tran, Imagefloat* image, Pre #ifdef _OPENMP } #endif - /*if (fuji) { + if (fuji) { int a = ((tran & TR_ROT) == TR_R90 && image->width%2==0) || ((tran & TR_ROT) == TR_R180 && image->height%2+image->width%2==1) || ((tran & TR_ROT) == TR_R270 && image->height%2==0); // first row for (int j=1+a; jwidth-1; j+=2) { @@ -415,21 +411,18 @@ void RawImageSource::getImage (ColorTemp ctemp, int tran, Imagefloat* image, Pre image->g[image->height-1][j] = (image->g[image->height-2][j] + image->g[image->height-1][j+1] + image->g[image->height-1][j-1]) / 3; image->b[image->height-1][j] = (image->b[image->height-2][j] + image->b[image->height-1][j+1] + image->b[image->height-1][j-1]) / 3; } - }*/ + } // Flip if needed - /*if (tran & TR_HFLIP) + if (tran & TR_HFLIP) hflip (image); if (tran & TR_VFLIP) - vflip (image);*/ + vflip (image); // Color correction - //if (ri->isBayer() && pp.skip==1) - // correction_YIQ_LQ (image, pp.skip==1?1:raw.ccSteps); - if (skip==6) - printf("getImage after transLine r=%f g=%f b=%f \n", - image->r[828/skip][786/skip],image->g[828/skip][786/skip],image->b[828/skip][786/skip]); - + if (ri->isBayer() && pp.skip==1) + correction_YIQ_LQ (image, pp.skip==1?1:raw.ccSteps); + // Applying postmul colorSpaceConversion (image, cmp, embProfile, camProfile, xyz_cam, defGain); @@ -1579,9 +1572,6 @@ void RawImageSource::colorSpaceConversion (Imagefloat* im, ColorManagementParams #pragma omp parallel for for (int i=0; iheight; i++) for (int j=0; jwidth; j++) { - - if (i==828/6 && j==786/6) - printf("colorConv before r=%f g=%f b=%f \n",im->r[i][j],im->g[i][j],im->b[i][j]); float newr = mat[0][0]*im->r[i][j] + mat[0][1]*im->g[i][j] + mat[0][2]*im->b[i][j]; float newg = mat[1][0]*im->r[i][j] + mat[1][1]*im->g[i][j] + mat[1][2]*im->b[i][j]; @@ -1590,9 +1580,7 @@ void RawImageSource::colorSpaceConversion (Imagefloat* im, ColorManagementParams im->r[i][j] = (newr); im->g[i][j] = (newg); im->b[i][j] = (newb); - - if (i==828/6 && j==786/6) - printf("colorConv after r=%f g=%f b=%f \n",im->r[i][j],im->g[i][j],im->b[i][j]); + } } else {// use supplied input profile //color space transform is expecting data in the range (0,1)