diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-15 21:57:39 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-15 21:57:39 +0400 |
commit | cde4d7284891b07f4a221868f15b4b90a6b42585 (patch) | |
tree | f1f6b37b096a7f5716c9b017245aa45dbccd7dcf /source/blender/compositor/nodes/COM_FilterNode.cpp | |
parent | 687b6e5447855311522cc42ed980c9df3400b1c4 (diff) |
style cleanup: more nodes
Diffstat (limited to 'source/blender/compositor/nodes/COM_FilterNode.cpp')
-rw-r--r-- | source/blender/compositor/nodes/COM_FilterNode.cpp | 69 |
1 files changed, 35 insertions, 34 deletions
diff --git a/source/blender/compositor/nodes/COM_FilterNode.cpp b/source/blender/compositor/nodes/COM_FilterNode.cpp index 7700bceb4ab..23f87805821 100644 --- a/source/blender/compositor/nodes/COM_FilterNode.cpp +++ b/source/blender/compositor/nodes/COM_FilterNode.cpp @@ -27,11 +27,12 @@ #include "BKE_node.h" #include "COM_MixBlendOperation.h" -FilterNode::FilterNode(bNode *editorNode): Node(editorNode) +FilterNode::FilterNode(bNode *editorNode) : Node(editorNode) { + /* pass */ } -void FilterNode::convertToOperations(ExecutionSystem *graph, CompositorContext * context) +void FilterNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context) { InputSocket *inputSocket = this->getInputSocket(0); InputSocket *inputImageSocket = this->getInputSocket(1); @@ -39,38 +40,38 @@ void FilterNode::convertToOperations(ExecutionSystem *graph, CompositorContext * ConvolutionFilterOperation *operation = NULL; switch (this->getbNode()->custom1) { - case CMP_FILT_SOFT: - operation = new ConvolutionFilterOperation(); - operation->set3x3Filter(1/16.0f, 2/16.0f, 1/16.0f, 2/16.0f, 4/16.0f, 2/16.0f, 1/16.0f, 2/16.0f, 1/16.0f); - break; - case CMP_FILT_SHARP: - operation = new ConvolutionFilterOperation(); - operation->set3x3Filter(-1,-1,-1,-1,9,-1,-1,-1,-1); - break; - case CMP_FILT_LAPLACE: - operation = new ConvolutionFilterOperation(); - operation->set3x3Filter(-1/8.0f, -1/8.0f, -1/8.0f, -1/8.0f, 1.0f, -1/8.0f, -1/8.0f, -1/8.0f, -1/8.0f); - break; - case CMP_FILT_SOBEL: - operation = new ConvolutionEdgeFilterOperation(); - operation->set3x3Filter(1,2,1,0,0,0,-1,-2,-1); - break; - case CMP_FILT_PREWITT: - operation = new ConvolutionEdgeFilterOperation(); - operation->set3x3Filter(1,1,1,0,0,0,-1,-1,-1); - break; - case CMP_FILT_KIRSCH: - operation = new ConvolutionEdgeFilterOperation(); - operation->set3x3Filter(5,5,5,-3,-3,-3,-2,-2,-2); - break; - case CMP_FILT_SHADOW: - operation = new ConvolutionFilterOperation(); - operation->set3x3Filter(1,2,1,0,1,0,-1,-2,-1); - break; - default: - operation = new ConvolutionFilterOperation(); - operation->set3x3Filter(0,0,0,0,1,0,0,0,0); - break; + case CMP_FILT_SOFT: + operation = new ConvolutionFilterOperation(); + operation->set3x3Filter(1 / 16.0f, 2 / 16.0f, 1 / 16.0f, 2 / 16.0f, 4 / 16.0f, 2 / 16.0f, 1 / 16.0f, 2 / 16.0f, 1 / 16.0f); + break; + case CMP_FILT_SHARP: + operation = new ConvolutionFilterOperation(); + operation->set3x3Filter(-1, -1, -1, -1, 9, -1, -1, -1, -1); + break; + case CMP_FILT_LAPLACE: + operation = new ConvolutionFilterOperation(); + operation->set3x3Filter(-1 / 8.0f, -1 / 8.0f, -1 / 8.0f, -1 / 8.0f, 1.0f, -1 / 8.0f, -1 / 8.0f, -1 / 8.0f, -1 / 8.0f); + break; + case CMP_FILT_SOBEL: + operation = new ConvolutionEdgeFilterOperation(); + operation->set3x3Filter(1, 2, 1, 0, 0, 0, -1, -2, -1); + break; + case CMP_FILT_PREWITT: + operation = new ConvolutionEdgeFilterOperation(); + operation->set3x3Filter(1, 1, 1, 0, 0, 0, -1, -1, -1); + break; + case CMP_FILT_KIRSCH: + operation = new ConvolutionEdgeFilterOperation(); + operation->set3x3Filter(5, 5, 5, -3, -3, -3, -2, -2, -2); + break; + case CMP_FILT_SHADOW: + operation = new ConvolutionFilterOperation(); + operation->set3x3Filter(1, 2, 1, 0, 1, 0, -1, -2, -1); + break; + default: + operation = new ConvolutionFilterOperation(); + operation->set3x3Filter(0, 0, 0, 0, 1, 0, 0, 0, 0); + break; } inputImageSocket->relinkConnections(operation->getInputSocket(0), 1, graph); |