Fix: Interpolation with clamped boundary returns zero
The BLI image interpolation function with clamped boundary returns zero for out of bound pixels. That's because the neighbour pixel wrapping condition disregarded the border template argument. To fix this, only handle that condition if in border mode. Pull Request: https://projects.blender.org/blender/blender/pulls/119164
This commit is contained in:
@@ -298,7 +298,7 @@ BLI_INLINE void bilinear_fl_impl(const float *buffer,
|
||||
x2 = 0;
|
||||
}
|
||||
}
|
||||
else if (x2 < 0 || x1 >= width) {
|
||||
else if (border && (x2 < 0 || x1 >= width)) {
|
||||
copy_vn_fl(output, components, 0.0f);
|
||||
return;
|
||||
}
|
||||
@@ -307,7 +307,7 @@ BLI_INLINE void bilinear_fl_impl(const float *buffer,
|
||||
y2 = 0;
|
||||
}
|
||||
}
|
||||
else if (y2 < 0 || y1 >= height) {
|
||||
else if (border && (y2 < 0 || y1 >= height)) {
|
||||
copy_vn_fl(output, components, 0.0f);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user