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:
authorJeroen Bakker <j.bakker@atmind.nl>2012-05-21 14:20:30 +0400
committerJeroen Bakker <j.bakker@atmind.nl>2012-05-21 14:20:30 +0400
commit998a850f9f2747065ffe379097907232a85cd2d5 (patch)
treea4b86c8a1f10e1c39e7557edad82d2a55574ea62 /source/blender/compositor/nodes/COM_DilateErodeNode.cpp
parent14e4ad930209a3b861b5b514fbd23b39a7d16e94 (diff)
Added switch in dilate/erode between old (Step) and new (Distance)
algorithm Connected the Glare Fog Flow to use Fast Gaussian in stead of Bokeh blur
Diffstat (limited to 'source/blender/compositor/nodes/COM_DilateErodeNode.cpp')
-rw-r--r--source/blender/compositor/nodes/COM_DilateErodeNode.cpp41
1 files changed, 31 insertions, 10 deletions
diff --git a/source/blender/compositor/nodes/COM_DilateErodeNode.cpp b/source/blender/compositor/nodes/COM_DilateErodeNode.cpp
index 2118f5b8e47..55759ba410f 100644
--- a/source/blender/compositor/nodes/COM_DilateErodeNode.cpp
+++ b/source/blender/compositor/nodes/COM_DilateErodeNode.cpp
@@ -33,16 +33,37 @@ DilateErodeNode::DilateErodeNode(bNode *editorNode): Node(editorNode)
void DilateErodeNode::convertToOperations(ExecutionSystem *graph, CompositorContext * context)
{
+
bNode *editorNode = this->getbNode();
- DilateErodeOperation *operation = new DilateErodeOperation();
- operation->setDistance(editorNode->custom2);
- operation->setInset(2.0f);
+ if (editorNode->custom1 == CMP_NODE_DILATEERODE_DISTANCE) {
+ DilateErodeDistanceOperation *operation = new DilateErodeDistanceOperation();
+ operation->setDistance(editorNode->custom2);
+ operation->setInset(editorNode->custom3);
+
+ this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0));
- this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0));
-
- AntiAliasOperation * antiAlias = new AntiAliasOperation();
- addLink(graph, operation->getOutputSocket(), antiAlias->getInputSocket(0));
- this->getOutputSocket(0)->relinkConnections(antiAlias->getOutputSocket(0));
- graph->addOperation(operation);
- graph->addOperation(antiAlias);
+ if (editorNode->custom3 < 2.0f) {
+ AntiAliasOperation * antiAlias = new AntiAliasOperation();
+ addLink(graph, operation->getOutputSocket(), antiAlias->getInputSocket(0));
+ this->getOutputSocket(0)->relinkConnections(antiAlias->getOutputSocket(0));
+ graph->addOperation(antiAlias);
+ } else {
+ this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0));
+ }
+ graph->addOperation(operation);
+ } else {
+ if (editorNode->custom2 > 0) {
+ DilateStepOperation * operation = new DilateStepOperation();
+ operation->setIterations(editorNode->custom2);
+ this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0));
+ this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0));
+ graph->addOperation(operation);
+ } else {
+ ErodeStepOperation * operation = new ErodeStepOperation();
+ operation->setIterations(-editorNode->custom2);
+ this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0));
+ this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0));
+ graph->addOperation(operation);
+ }
+ }
}