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:
authorCampbell Barton <ideasman42@gmail.com>2019-04-17 07:17:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 07:21:24 +0300
commite12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch)
tree8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/compositor/nodes/COM_FilterNode.cpp
parentb3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff)
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/compositor/nodes/COM_FilterNode.cpp')
-rw-r--r--source/blender/compositor/nodes/COM_FilterNode.cpp107
1 files changed, 62 insertions, 45 deletions
diff --git a/source/blender/compositor/nodes/COM_FilterNode.cpp b/source/blender/compositor/nodes/COM_FilterNode.cpp
index 14a2bb4fe38..1972cabc7c4 100644
--- a/source/blender/compositor/nodes/COM_FilterNode.cpp
+++ b/source/blender/compositor/nodes/COM_FilterNode.cpp
@@ -25,55 +25,72 @@
FilterNode::FilterNode(bNode *editorNode) : Node(editorNode)
{
- /* pass */
+ /* pass */
}
-void FilterNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
+void FilterNode::convertToOperations(NodeConverter &converter,
+ const CompositorContext & /*context*/) const
{
- NodeInput *inputSocket = this->getInputSocket(0);
- NodeInput *inputImageSocket = this->getInputSocket(1);
- NodeOutput *outputSocket = this->getOutputSocket(0);
- ConvolutionFilterOperation *operation = NULL;
+ NodeInput *inputSocket = this->getInputSocket(0);
+ NodeInput *inputImageSocket = this->getInputSocket(1);
+ NodeOutput *outputSocket = this->getOutputSocket(0);
+ 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 ConvolutionEdgeFilterOperation();
- 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;
- }
- converter.addOperation(operation);
+ 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 ConvolutionEdgeFilterOperation();
+ 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;
+ }
+ converter.addOperation(operation);
- converter.mapInputSocket(inputImageSocket, operation->getInputSocket(0));
- converter.mapInputSocket(inputSocket, operation->getInputSocket(1));
- converter.mapOutputSocket(outputSocket, operation->getOutputSocket());
+ converter.mapInputSocket(inputImageSocket, operation->getInputSocket(0));
+ converter.mapInputSocket(inputSocket, operation->getInputSocket(1));
+ converter.mapOutputSocket(outputSocket, operation->getOutputSocket());
- converter.addPreview(operation->getOutputSocket(0));
+ converter.addPreview(operation->getOutputSocket(0));
}