Skip to content

Commit 85746a8

Browse files
authored
Fix bad colors when demosaic border is odd
Colors are incorrect if the demosaic border is odd and raw chromatic aberration is enabled.
1 parent f93c3dd commit 85746a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rtengine/CA_correct_RT.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ float* RawImageSource::CA_correct_RT(
146146
const unsigned int cfa[2][2] = {{FC(0,0), FC(0,1)}, {FC(1,0), FC(1,1)}};
147147
constexpr int ts = 128;
148148
constexpr int tsh = ts / 2;
149-
const int cb = border_crop;
149+
const int cb = 2 * ((border_crop + 1) / 2); // Round up to nearest even integer.
150150

151151
//shifts to location of vertical and diagonal neighbours
152152
constexpr int v1 = ts, v2 = 2 * ts, v3 = 3 * ts, v4 = 4 * ts; //, p1=-ts+1, p2=-2*ts+2, p3=-3*ts+3, m1=ts+1, m2=2*ts+2, m3=3*ts+3;

0 commit comments

Comments
 (0)