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:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-11-10 23:11:25 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-11-10 23:11:25 +0400
commitf81e30a41f961fe681d06fb98fec6e722297292e (patch)
treeb5dac6a3f8488035ba25428fd1fcd6ed76632904 /source/blender/blenlib/BLI_math_interp.h
parent45cd54bcd11d9b1fb62d986328917ca5cebf9b17 (diff)
Solved issue with distorted compositor results in some cases
Originally issue was discovered when using stabilization and movie distortion nodes, but in fact issue was caused by render layer node always doing nearest interpolation. Now made it so this node will respect sampler passed to it's executePixel function and do an interpolation. Added two new functions to do bilinear/bicubic interpolation in float buffer with variable number of components per element, so it could interpolate 1, 3 and 4 component vectors. This functions currently mostly duplicates the same functions from imageprocess.c and it should actually be de-duplicated. Think it's ok to leave a bit of time with such duplication, since functions should be generalized one more time to support byte buffers, which could backfire on readability. Also removed mark as complex from stabilization node, which isn't needed sine int fact this node is not complex.
Diffstat (limited to 'source/blender/blenlib/BLI_math_interp.h')
-rw-r--r--source/blender/blenlib/BLI_math_interp.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_interp.h b/source/blender/blenlib/BLI_math_interp.h
new file mode 100644
index 00000000000..3a107be32bd
--- /dev/null
+++ b/source/blender/blenlib/BLI_math_interp.h
@@ -0,0 +1,35 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2012 by Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Sergey Sharybin
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ *
+ */
+
+#ifndef BLI_MATH_INTERP
+#define BLI_MATH_INTERP
+
+void BLI_bicubic_interpolation(const float *buffer, float *output, int width, int height, int components, float u, float v);
+void BLI_bilinear_interpolation(const float *buffer, float *output, int width, int height, int components, float u, float v);
+
+#endif