Fixed thumbnails showed weired colors in clipped areas; see issue #628

This commit is contained in:
Oliver Duis
2011-04-12 19:48:35 +02:00
parent 463c5e613e
commit b800afff00

View File

@@ -1702,8 +1702,13 @@ TMatrix work = iccStore->workingSpaceInverseMatrix (cmp.working);
for (int j=0; j<im->width; j++) { for (int j=0; j<im->width; 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];
if (newr<0) newr=0; else if (newr>0xffff) newr=0xffff;
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];
if (newg<0) newg=0; else if (newg>0xffff) newg=0xffff;
float newb = mat[2][0]*im->r[i][j] + mat[2][1]*im->g[i][j] + mat[2][2]*im->b[i][j]; float newb = mat[2][0]*im->r[i][j] + mat[2][1]*im->g[i][j] + mat[2][2]*im->b[i][j];
if (newb<0) newb=0; else if (newb>0xffff) newb=0xffff;
im->r[i][j] = (newr); im->r[i][j] = (newr);
im->g[i][j] = (newg); im->g[i][j] = (newg);