Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/intern/math_interp.c')
-rw-r--r--source/blender/blenlib/intern/math_interp.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/blenlib/intern/math_interp.c b/source/blender/blenlib/intern/math_interp.c
index 4feb954a31a..67850463fe2 100644
--- a/source/blender/blenlib/intern/math_interp.c
+++ b/source/blender/blenlib/intern/math_interp.c
@@ -111,10 +111,12 @@ BLI_INLINE void bicubic_interpolation(const unsigned char *byte_buffer, const fl
/* sample area entirely outside image? */
if (ceil(u) < 0 || floor(u) > width - 1 || ceil(v) < 0 || floor(v) > height - 1) {
- if (float_output)
- float_output[0] = float_output[1] = float_output[2] = float_output[3] = 0.0f;
- if (byte_output)
- byte_output[0] = byte_output[1] = byte_output[2] = byte_output[3] = 0;
+ if (float_output) {
+ fill_vn_fl(float_output, components, 0.0f);
+ }
+ if (byte_output) {
+ fill_vn_uchar(byte_output, components, 0);
+ }
return;
}
@@ -279,7 +281,7 @@ BLI_INLINE void bilinear_interpolation(const unsigned char *byte_buffer, const f
/* sample area entirely outside image? */
if (x2 < 0 || x1 > width - 1 || y2 < 0 || y1 > height - 1) {
- float_output[0] = float_output[1] = float_output[2] = float_output[3] = 0.0f;
+ fill_vn_fl(float_output, components, 0.0f);
return;
}
@@ -321,7 +323,7 @@ BLI_INLINE void bilinear_interpolation(const unsigned char *byte_buffer, const f
/* sample area entirely outside image? */
if (x2 < 0 || x1 > width - 1 || y2 < 0 || y1 > height - 1) {
- byte_output[0] = byte_output[1] = byte_output[2] = byte_output[3] = 0;
+ fill_vn_uchar(byte_output, components, 0);
return;
}
@@ -467,7 +469,7 @@ void BLI_ewa_filter(const int width, const int height,
/* scaling dxt/dyt by full resolution can cause overflow because of huge A/B/C and esp. F values,
* scaling by aspect ratio alone does the opposite, so try something in between instead... */
const float ff2 = (float)width, ff = sqrtf(ff2), q = (float)height / ff;
- const float Ux = du[0] * ff, Vx = dv[0] * q, Uy = du[1] * ff, Vy = dv[1] * q;
+ const float Ux = du[0] * ff, Vx = du[1] * q, Uy = dv[0] * ff, Vy = dv[1] * q;
float A = Vx * Vx + Vy * Vy;
float B = -2.0f * (Ux * Vx + Uy * Vy);
float C = Ux * Ux + Uy * Uy;