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/compositor/operations/COM_ScaleOperation.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/compositor/operations/COM_ScaleOperation.h')
-rw-r--r--source/blender/compositor/operations/COM_ScaleOperation.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/source/blender/compositor/operations/COM_ScaleOperation.h b/source/blender/compositor/operations/COM_ScaleOperation.h
index 4239ff063fb..f42cdbd78ed 100644
--- a/source/blender/compositor/operations/COM_ScaleOperation.h
+++ b/source/blender/compositor/operations/COM_ScaleOperation.h
@@ -25,7 +25,19 @@
#include "COM_NodeOperation.h"
-class ScaleOperation : public NodeOperation {
+class BaseScaleOperation : public NodeOperation {
+public:
+ void setSampler(PixelSampler sampler) { this->m_sampler = (int) sampler; }
+
+protected:
+ BaseScaleOperation();
+
+ PixelSampler getEffectiveSampler(PixelSampler sampler) { return (m_sampler == -1) ? sampler : (PixelSampler) m_sampler; }
+
+ int m_sampler;
+};
+
+class ScaleOperation : public BaseScaleOperation {
private:
SocketReader *m_inputOperation;
SocketReader *m_inputXOperation;
@@ -41,7 +53,7 @@ public:
void deinitExecution();
};
-class ScaleAbsoluteOperation : public NodeOperation {
+class ScaleAbsoluteOperation : public BaseScaleOperation {
SocketReader *m_inputOperation;
SocketReader *m_inputXOperation;
SocketReader *m_inputYOperation;
@@ -57,7 +69,7 @@ public:
void deinitExecution();
};
-class ScaleFixedSizeOperation : public NodeOperation {
+class ScaleFixedSizeOperation : public BaseScaleOperation {
SocketReader *m_inputOperation;
int m_newWidth;
int m_newHeight;