raw ca correction/avoid colour shift: fix colour cast when (height % 2) == 1, #4777

This commit is contained in:
heckflosse
2018-09-07 13:50:42 +02:00
parent c9d89c9b1b
commit 198989d598

View File

@@ -1274,6 +1274,20 @@ float* RawImageSource::CA_correct_RT(
} }
} }
#pragma omp single
{
if (H % 2) {
int firstCol = FC(H - 1, 0) & 1;
int colour = FC(H - 1, firstCol);
nonGreen = colour == 0 ? &redFactor : &blueFactor;
for (int j = 0; j < (W + 1) / 2; ++j) {
(*nonGreen)[(H + 1) / 2 - 1][j] = (*nonGreen)[(H + 1) / 2 - 2][j];
}
}
}
#pragma omp barrier
gaussianBlur(redFactor, redFactor, (W+1)/2, (H+1)/2, 30.0); gaussianBlur(redFactor, redFactor, (W+1)/2, (H+1)/2, 30.0);
gaussianBlur(blueFactor, blueFactor, (W+1)/2, (H+1)/2, 30.0); gaussianBlur(blueFactor, blueFactor, (W+1)/2, (H+1)/2, 30.0);