Fix colour tint when using raw ca correction avoid colour shift on images with (height % 2) == 1
This commit is contained in:
@@ -1261,12 +1261,10 @@ float* RawImageSource::CA_correct_RT(
|
||||
#pragma omp single
|
||||
{
|
||||
if (H % 2) {
|
||||
// odd height => factors for one channel are not set in last row => use values of preceding row
|
||||
const int firstCol = FC(0, 0) & 1;
|
||||
const int colour = FC(0, firstCol);
|
||||
const array2D<float>* nonGreen = colour == 0 ? blueFactor : redFactor;
|
||||
// odd height => factors are not set in last row => use values of preceding row
|
||||
for (int j = 0; j < (W + 1) / 2; ++j) {
|
||||
(*nonGreen)[(H + 1) / 2 - 1][j] = (*nonGreen)[(H + 1) / 2 - 2][j];
|
||||
(*redFactor)[(H + 1) / 2 - 1][j] = (*redFactor)[(H + 1) / 2 - 2][j];
|
||||
(*blueFactor)[(H + 1) / 2 - 1][j] = (*blueFactor)[(H + 1) / 2 - 2][j];
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user