diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2012-08-28 14:41:37 +0400 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2012-08-28 14:41:37 +0400 |
commit | 8fd747114388dbbb10733415eaa707f9801abf1a (patch) | |
tree | a8207827aceb7d52fcf5a97bcb7695feab15f5e3 /source/blender/compositor/nodes | |
parent | c43583a23ae0e552779148236f973d20275f9bd0 (diff) |
cleanup pixel sampler code (pixel interpolations in compositor)
Diffstat (limited to 'source/blender/compositor/nodes')
-rw-r--r-- | source/blender/compositor/nodes/COM_RotateNode.cpp | 14 | ||||
-rw-r--r-- | source/blender/compositor/nodes/COM_Stabilize2dNode.cpp | 9 | ||||
-rw-r--r-- | source/blender/compositor/nodes/COM_TransformNode.cpp | 12 |
3 files changed, 9 insertions, 26 deletions
diff --git a/source/blender/compositor/nodes/COM_RotateNode.cpp b/source/blender/compositor/nodes/COM_RotateNode.cpp index bb058d18b80..d7712323a27 100644 --- a/source/blender/compositor/nodes/COM_RotateNode.cpp +++ b/source/blender/compositor/nodes/COM_RotateNode.cpp @@ -39,19 +39,7 @@ void RotateNode::convertToOperations(ExecutionSystem *system, CompositorContext RotateOperation *operation = new RotateOperation(); SetSamplerOperation *sampler = new SetSamplerOperation(); - switch (this->getbNode()->custom1) { - case 0: - sampler->setSampler(COM_PS_NEAREST); - break; - case 1: - sampler->setSampler(COM_PS_BILINEAR); - break; - case 2: - sampler->setSampler(COM_PS_BICUBIC); - break; - - } - + sampler->setSampler((PixelSampler)this->getbNode()->custom1); addLink(system, sampler->getOutputSocket(), operation->getInputSocket(0)); inputSocket->relinkConnections(sampler->getInputSocket(0), 0, system); diff --git a/source/blender/compositor/nodes/COM_Stabilize2dNode.cpp b/source/blender/compositor/nodes/COM_Stabilize2dNode.cpp index 85b8695263f..b28ee3eade1 100644 --- a/source/blender/compositor/nodes/COM_Stabilize2dNode.cpp +++ b/source/blender/compositor/nodes/COM_Stabilize2dNode.cpp @@ -26,6 +26,7 @@ #include "COM_RotateOperation.h" #include "COM_ScaleOperation.h" #include "COM_MovieClipAttributeOperation.h" +#include "COM_SetSamplerOperation.h" extern "C" { #include "DNA_movieclip_types.h" @@ -49,6 +50,7 @@ void Stabilize2dNode::convertToOperations(ExecutionSystem *graph, CompositorCont MovieClipAttributeOperation *angleAttribute = new MovieClipAttributeOperation(); MovieClipAttributeOperation *xAttribute = new MovieClipAttributeOperation(); MovieClipAttributeOperation *yAttribute = new MovieClipAttributeOperation(); + SetSamplerOperation *psoperation = new SetSamplerOperation(); scaleAttribute->setAttribute(MCA_SCALE); scaleAttribute->setFramenumber(context->getFramenumber()); @@ -77,8 +79,10 @@ void Stabilize2dNode::convertToOperations(ExecutionSystem *graph, CompositorCont addLink(graph, rotateOperation->getOutputSocket(), translateOperation->getInputSocket(0)); addLink(graph, xAttribute->getOutputSocket(), translateOperation->getInputSocket(1)); addLink(graph, yAttribute->getOutputSocket(), translateOperation->getInputSocket(2)); - - this->getOutputSocket()->relinkConnections(translateOperation->getOutputSocket()); + + psoperation->setSampler((PixelSampler)this->getbNode()->custom1); + addLink(graph, translateOperation->getOutputSocket(), psoperation->getInputSocket(0)); + this->getOutputSocket()->relinkConnections(psoperation->getOutputSocket()); graph->addOperation(scaleAttribute); graph->addOperation(angleAttribute); @@ -87,4 +91,5 @@ void Stabilize2dNode::convertToOperations(ExecutionSystem *graph, CompositorCont graph->addOperation(scaleOperation); graph->addOperation(translateOperation); graph->addOperation(rotateOperation); + graph->addOperation(psoperation); } diff --git a/source/blender/compositor/nodes/COM_TransformNode.cpp b/source/blender/compositor/nodes/COM_TransformNode.cpp index ff6e276d1ac..154761665cf 100644 --- a/source/blender/compositor/nodes/COM_TransformNode.cpp +++ b/source/blender/compositor/nodes/COM_TransformNode.cpp @@ -46,17 +46,7 @@ void TransformNode::convertToOperations(ExecutionSystem *graph, CompositorContex TranslateOperation *translateOperation = new TranslateOperation(); SetSamplerOperation *sampler = new SetSamplerOperation(); - switch (this->getbNode()->custom1) { - case 0: - sampler->setSampler(COM_PS_NEAREST); - break; - case 1: - sampler->setSampler(COM_PS_BILINEAR); - break; - case 2: - sampler->setSampler(COM_PS_BICUBIC); - break; - } + sampler->setSampler((PixelSampler)this->getbNode()->custom1); imageInput->relinkConnections(sampler->getInputSocket(0), 0, graph); addLink(graph, sampler->getOutputSocket(), scaleOperation->getInputSocket(0)); |