diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2012-05-31 14:38:11 +0400 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2012-05-31 14:38:11 +0400 |
commit | a9c4f76a6a96bcffc8d94e2da5e636d4304da345 (patch) | |
tree | 38f0d2593d5a5f704fb890cde3b8ba030bfb015d /source/blender/compositor/nodes/COM_DilateErodeNode.cpp | |
parent | 722ce85ff6876ab85b7e934724e89fe24241f670 (diff) |
* Added new dilate/erode function
Diffstat (limited to 'source/blender/compositor/nodes/COM_DilateErodeNode.cpp')
-rw-r--r-- | source/blender/compositor/nodes/COM_DilateErodeNode.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/source/blender/compositor/nodes/COM_DilateErodeNode.cpp b/source/blender/compositor/nodes/COM_DilateErodeNode.cpp index cc96f672ebd..b722e40a875 100644 --- a/source/blender/compositor/nodes/COM_DilateErodeNode.cpp +++ b/source/blender/compositor/nodes/COM_DilateErodeNode.cpp @@ -35,7 +35,7 @@ void DilateErodeNode::convertToOperations(ExecutionSystem *graph, CompositorCont { bNode *editorNode = this->getbNode(); - if (editorNode->custom1 == CMP_NODE_DILATEERODE_DISTANCE) { + if (editorNode->custom1 == CMP_NODE_DILATEERODE_DISTANCE_THRESH) { DilateErodeDistanceOperation *operation = new DilateErodeDistanceOperation(); operation->setDistance(editorNode->custom2); operation->setInset(editorNode->custom3); @@ -52,8 +52,22 @@ void DilateErodeNode::convertToOperations(ExecutionSystem *graph, CompositorCont this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0)); } graph->addOperation(operation); - } - else { + } else if (editorNode->custom1 == CMP_NODE_DILATEERODE_DISTANCE) { + if (editorNode->custom2 > 0) { + DilateDistanceOperation * operation = new DilateDistanceOperation(); + operation->setDistance(editorNode->custom2); + this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph); + this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0)); + graph->addOperation(operation); + } + else { + ErodeDistanceOperation * operation = new ErodeDistanceOperation(); + operation->setDistance(-editorNode->custom2); + this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph); + this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0)); + graph->addOperation(operation); + } + } else { if (editorNode->custom2 > 0) { DilateStepOperation * operation = new DilateStepOperation(); operation->setIterations(editorNode->custom2); |