re-enabling some functions mistakenly turned off from float branch testing.

This commit is contained in:
Emil Martinec
2011-04-07 14:40:47 -05:00
parent b38fe14fe7
commit 5ec5a0cf21
2 changed files with 11 additions and 26 deletions

View File

@@ -112,10 +112,7 @@ void Crop::update (int todo) {
setCropSizes (rqcropx, rqcropy, rqcropw, rqcroph, skip, true); setCropSizes (rqcropx, rqcropy, rqcropw, rqcroph, skip, true);
PreviewProps pp (trafx, trafy, trafw*skip, trafh*skip, skip); PreviewProps pp (trafx, trafy, trafw*skip, trafh*skip, skip);
parent->imgsrc->getImage (parent->currWB, tr, origCrop, pp, params.hlrecovery, params.icm, params.raw ); 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 (); parent->minit.unlock ();
} }

View File

@@ -358,12 +358,8 @@ void RawImageSource::getImage (ColorTemp ctemp, int tran, Imagefloat* image, Pre
} }
} }
//if (hrp.enabled) if (hrp.enabled)
// hlRecovery (hrp.method, line_red, line_grn, line_blue, i, sx1, imwidth, skip); 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]);
transLine (line_red, line_grn, line_blue, ix, image, tran, imwidth, imheight, fw); 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 #ifdef _OPENMP
} }
#endif #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); 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 // first row
for (int j=1+a; j<image->width-1; j+=2) { for (int j=1+a; j<image->width-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->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; 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 // Flip if needed
/*if (tran & TR_HFLIP) if (tran & TR_HFLIP)
hflip (image); hflip (image);
if (tran & TR_VFLIP) if (tran & TR_VFLIP)
vflip (image);*/ vflip (image);
// Color correction // Color correction
//if (ri->isBayer() && pp.skip==1) if (ri->isBayer() && pp.skip==1)
// correction_YIQ_LQ (image, pp.skip==1?1:raw.ccSteps); 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]);
// Applying postmul // Applying postmul
colorSpaceConversion (image, cmp, embProfile, camProfile, xyz_cam, defGain); colorSpaceConversion (image, cmp, embProfile, camProfile, xyz_cam, defGain);
@@ -1579,9 +1572,6 @@ void RawImageSource::colorSpaceConversion (Imagefloat* im, ColorManagementParams
#pragma omp parallel for #pragma omp parallel for
for (int i=0; i<im->height; i++) for (int i=0; i<im->height; i++)
for (int j=0; j<im->width; j++) { for (int j=0; j<im->width; 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 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]; 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->r[i][j] = (newr);
im->g[i][j] = (newg); im->g[i][j] = (newg);
im->b[i][j] = (newb); 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 } else {// use supplied input profile
//color space transform is expecting data in the range (0,1) //color space transform is expecting data in the range (0,1)