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/nodes/COM_ScaleNode.cpp
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/nodes/COM_ScaleNode.cpp')
-rw-r--r--source/blender/compositor/nodes/COM_ScaleNode.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/source/blender/compositor/nodes/COM_ScaleNode.cpp b/source/blender/compositor/nodes/COM_ScaleNode.cpp
index c51782b77af..d535e71a33c 100644
--- a/source/blender/compositor/nodes/COM_ScaleNode.cpp
+++ b/source/blender/compositor/nodes/COM_ScaleNode.cpp
@@ -26,6 +26,7 @@
#include "COM_ExecutionSystem.h"
#include "BKE_node.h"
#include "COM_SetValueOperation.h"
+#include "COM_SetSamplerOperation.h"
ScaleNode::ScaleNode(bNode *editorNode) : Node(editorNode)
{
@@ -38,7 +39,9 @@ void ScaleNode::convertToOperations(ExecutionSystem *graph, CompositorContext *c
InputSocket *inputXSocket = this->getInputSocket(1);
InputSocket *inputYSocket = this->getInputSocket(2);
OutputSocket *outputSocket = this->getOutputSocket(0);
+ BaseScaleOperation *scaleoperation;
bNode *bnode = this->getbNode();
+
switch (bnode->custom1) {
case CMP_SCALE_RELATIVE: {
ScaleOperation *operation = new ScaleOperation();
@@ -46,8 +49,8 @@ void ScaleNode::convertToOperations(ExecutionSystem *graph, CompositorContext *c
inputSocket->relinkConnections(operation->getInputSocket(0), 0, graph);
inputXSocket->relinkConnections(operation->getInputSocket(1), 1, graph);
inputYSocket->relinkConnections(operation->getInputSocket(2), 2, graph);
- outputSocket->relinkConnections(operation->getOutputSocket(0));
- graph->addOperation(operation);
+
+ scaleoperation = operation;
}
break;
case CMP_SCALE_SCENEPERCENT: {
@@ -57,9 +60,9 @@ void ScaleNode::convertToOperations(ExecutionSystem *graph, CompositorContext *c
inputSocket->relinkConnections(operation->getInputSocket(0), 0, graph);
addLink(graph, scaleFactorOperation->getOutputSocket(), operation->getInputSocket(1));
addLink(graph, scaleFactorOperation->getOutputSocket(), operation->getInputSocket(2));
- outputSocket->relinkConnections(operation->getOutputSocket(0));
graph->addOperation(scaleFactorOperation);
- graph->addOperation(operation);
+
+ scaleoperation = operation;
}
break;
@@ -75,9 +78,9 @@ void ScaleNode::convertToOperations(ExecutionSystem *graph, CompositorContext *c
operation->setNewWidth(rd->xsch * rd->size / 100.0f);
operation->setNewHeight(rd->ysch * rd->size / 100.0f);
inputSocket->relinkConnections(operation->getInputSocket(0), 0, graph);
- outputSocket->relinkConnections(operation->getOutputSocket(0));
operation->getInputSocket(0)->getConnection()->setIgnoreResizeCheck(true);
- graph->addOperation(operation);
+
+ scaleoperation = operation;
}
break;
@@ -87,9 +90,12 @@ void ScaleNode::convertToOperations(ExecutionSystem *graph, CompositorContext *c
inputSocket->relinkConnections(operation->getInputSocket(0), 0, graph);
inputXSocket->relinkConnections(operation->getInputSocket(1), 1, graph);
inputYSocket->relinkConnections(operation->getInputSocket(2), 2, graph);
- outputSocket->relinkConnections(operation->getOutputSocket(0));
- graph->addOperation(operation);
+
+ scaleoperation = operation;
}
break;
}
+
+ outputSocket->relinkConnections(scaleoperation->getOutputSocket(0));
+ graph->addOperation(scaleoperation);
}