From 5392ff780b0124cbe6b27d36095ee6cc1175aeb6 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sat, 17 Nov 2012 13:38:39 +0000 Subject: Fix #33210: Diffuse Pass in scale node leads to problems Was own mistake in render layers interpolation changes. --- source/blender/blenlib/intern/math_interp.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'source/blender/blenlib/intern/math_interp.c') diff --git a/source/blender/blenlib/intern/math_interp.c b/source/blender/blenlib/intern/math_interp.c index 59a1c1f649c..5a9e8244a46 100644 --- a/source/blender/blenlib/intern/math_interp.c +++ b/source/blender/blenlib/intern/math_interp.c @@ -134,12 +134,12 @@ BLI_INLINE void bicubic_interpolation(const unsigned char *byte_buffer, const fl w = wx * wy[m + 1]; if (float_output) { - const float *float_data = float_buffer + width * y1 * 4 + 4 * x1; + const float *float_data = float_buffer + width * y1 * components + components * x1; vector_from_float(float_data, data, components); } else { - const unsigned char *byte_data = byte_buffer + width * y1 * 4 + 4 * x1; + const unsigned char *byte_data = byte_buffer + width * y1 * components + components * x1; vector_from_byte(byte_data, data, components); } @@ -173,12 +173,12 @@ BLI_INLINE void bicubic_interpolation(const unsigned char *byte_buffer, const fl float data[4]; if (float_output) { - const float *float_data = float_buffer + width * y1 * 4 + 4 * x1; + const float *float_data = float_buffer + width * y1 * components + components * x1; vector_from_float(float_data, data, components); } else { - const unsigned char *byte_data = byte_buffer + width * y1 * 4 + 4 * x1; + const unsigned char *byte_data = byte_buffer + width * y1 * components + components * x1; vector_from_byte(byte_data, data, components); } @@ -270,16 +270,16 @@ BLI_INLINE void bilinear_interpolation(const unsigned char *byte_buffer, const f /* sample including outside of edges of image */ if (x1 < 0 || y1 < 0) row1 = empty; - else row1 = float_buffer + width * y1 * 4 + 4 * x1; + else row1 = float_buffer + width * y1 * components + components * x1; if (x1 < 0 || y2 > height - 1) row2 = empty; - else row2 = float_buffer + width * y2 * 4 + 4 * x1; + else row2 = float_buffer + width * y2 * components + components * x1; if (x2 > width - 1 || y1 < 0) row3 = empty; - else row3 = float_buffer + width * y1 * 4 + 4 * x2; + else row3 = float_buffer + width * y1 * components + components * x2; if (x2 > width - 1 || y2 > height - 1) row4 = empty; - else row4 = float_buffer + width * y2 * 4 + 4 * x2; + else row4 = float_buffer + width * y2 * components + components * x2; a = u - floorf(u); b = v - floorf(v); @@ -306,16 +306,16 @@ BLI_INLINE void bilinear_interpolation(const unsigned char *byte_buffer, const f /* sample including outside of edges of image */ if (x1 < 0 || y1 < 0) row1 = empty; - else row1 = byte_buffer + width * y1 * 4 + 4 * x1; + else row1 = byte_buffer + width * y1 * components + components * x1; if (x1 < 0 || y2 > height - 1) row2 = empty; - else row2 = byte_buffer + width * y2 * 4 + 4 * x1; + else row2 = byte_buffer + width * y2 * components + components * x1; if (x2 > width - 1 || y1 < 0) row3 = empty; - else row3 = byte_buffer + width * y1 * 4 + 4 * x2; + else row3 = byte_buffer + width * y1 * components + components * x2; if (x2 > width - 1 || y2 > height - 1) row4 = empty; - else row4 = byte_buffer + width * y2 * 4 + 4 * x2; + else row4 = byte_buffer + width * y2 * components + components * x2; a = u - floorf(u); b = v - floorf(v); -- cgit v1.2.3