despeckle composite node
authorCampbell Barton <ideasman42@gmail.com>
Thu, 23 Aug 2012 06:48:01 +0000 (06:48 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 23 Aug 2012 06:48:01 +0000 (06:48 +0000)
14 files changed:
source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/intern/node.c
source/blender/compositor/CMakeLists.txt
source/blender/compositor/intern/COM_Converter.cpp
source/blender/compositor/nodes/COM_DespeckleNode.cpp [new file with mode: 0644]
source/blender/compositor/nodes/COM_DespeckleNode.h [new file with mode: 0644]
source/blender/compositor/operations/COM_DespeckleOperation.cpp [new file with mode: 0644]
source/blender/compositor/operations/COM_DespeckleOperation.h [new file with mode: 0644]
source/blender/editors/space_node/drawnode.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_nodetree_types.h
source/blender/nodes/CMakeLists.txt
source/blender/nodes/NOD_composite.h
source/blender/nodes/composite/nodes/node_composite_despeckle.c [new file with mode: 0644]

index 2a0679e39772d0402b5cc861db91faca40422deb..4748267278e7d8b63429852a512c70b1c0db12a5 100644 (file)
@@ -680,7 +680,8 @@ void            ntreeGPUMaterialNodes(struct bNodeTree *ntree, struct GPUMateria
 #define CMP_NODE_KEYINGSCREEN          269
 #define CMP_NODE_KEYING                        270
 #define CMP_NODE_TRACKPOS              271
-#define CMP_NODE_INPAINT                272
+#define CMP_NODE_INPAINT    272
+#define CMP_NODE_DESPECKLE  273
 
 #define CMP_NODE_GLARE         301
 #define CMP_NODE_TONEMAP       302
index 37562686a99479f7aeaabadefb564f20e847f406..22b0cccf17586bf45dadbc641912617e143f26ba 100644 (file)
@@ -2139,6 +2139,7 @@ static void registerCompositNodes(bNodeTreeType *ttype)
        register_node_type_cmp_vecblur(ttype);
        register_node_type_cmp_dilateerode(ttype);
        register_node_type_cmp_inpaint(ttype);
+       register_node_type_cmp_despeckle(ttype);
        register_node_type_cmp_defocus(ttype);
        
        register_node_type_cmp_valtorgb(ttype);
index c110d4f077e96f1fb168df38bcb291fc1ca417ef..9932ed17378941a9404808f834202a4660daa98b 100644 (file)
@@ -284,6 +284,8 @@ set(SRC
 
        nodes/COM_FilterNode.cpp
        nodes/COM_FilterNode.h
+       nodes/COM_DespeckleNode.cpp
+       nodes/COM_DespeckleNode.h
        nodes/COM_DilateErodeNode.cpp
        nodes/COM_DilateErodeNode.h
        nodes/COM_InpaintNode.cpp
@@ -592,6 +594,8 @@ set(SRC
        operations/COM_ConvolutionFilterOperation.cpp
        operations/COM_ConvolutionEdgeFilterOperation.h
        operations/COM_ConvolutionEdgeFilterOperation.cpp
+       operations/COM_DespeckleOperation.cpp
+       operations/COM_DespeckleOperation.h
        operations/COM_DilateErodeOperation.cpp
        operations/COM_DilateErodeOperation.h
        operations/COM_InpaintOperation.cpp
index 37b53c44ef745308ec61fcea301a7bbe712099e7..d4fad80ed07d542fe1864350a1ed5405871f21c6 100644 (file)
@@ -56,6 +56,7 @@
 #include "COM_Converter.h"
 #include "COM_CropNode.h"
 #include "COM_DefocusNode.h"
+#include "COM_DespeckleNode.h"
 #include "COM_DifferenceMatteNode.h"
 #include "COM_DilateErodeNode.h"
 #include "COM_DirectionalBlurNode.h"
@@ -307,6 +308,9 @@ Node *Converter::convert(bNode *b_node, bool fast)
                case CMP_NODE_INPAINT:
                        node = new InpaintNode(b_node);
                        break;
+               case CMP_NODE_DESPECKLE:
+                       node = new DespeckleNode(b_node);
+                       break;
                case CMP_NODE_LENSDIST:
                        node = new LensDistortionNode(b_node);
                        break;
diff --git a/source/blender/compositor/nodes/COM_DespeckleNode.cpp b/source/blender/compositor/nodes/COM_DespeckleNode.cpp
new file mode 100644 (file)
index 0000000..603ddcd
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor: Campbell Barton
+ */
+
+#include "COM_DespeckleNode.h"
+#include "DNA_scene_types.h"
+#include "COM_ExecutionSystem.h"
+#include "COM_DespeckleOperation.h"
+#include "BLI_math.h"
+
+DespeckleNode::DespeckleNode(bNode *editorNode) : Node(editorNode)
+{
+       /* pass */
+}
+
+void DespeckleNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context)
+{
+       bNode *editorNode = this->getbNode();
+       InputSocket *inputSocket = this->getInputSocket(0);
+       InputSocket *inputImageSocket = this->getInputSocket(1);
+       OutputSocket *outputSocket = this->getOutputSocket(0);
+       DespeckleOperation *operation = new DespeckleOperation();
+
+       operation->setbNode(editorNode);
+       operation->setThreshold(editorNode->custom3);
+       operation->setThresholdNeighbour(editorNode->custom4);
+
+       inputImageSocket->relinkConnections(operation->getInputSocket(0), 1, graph);
+       inputSocket->relinkConnections(operation->getInputSocket(1), 0, graph);
+       outputSocket->relinkConnections(operation->getOutputSocket());
+       addPreviewOperation(graph, operation->getOutputSocket(0));
+
+       graph->addOperation(operation);
+}
diff --git a/source/blender/compositor/nodes/COM_DespeckleNode.h b/source/blender/compositor/nodes/COM_DespeckleNode.h
new file mode 100644 (file)
index 0000000..2b8ab9d
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor: Campbell Barton
+ */
+
+#ifndef _COM_DespeckleNode_h_
+#define _COM_DespeckleNode_h_
+
+#include "COM_Node.h"
+
+/**
+ * @brief DespeckleNode
+ * @ingroup Node
+ */
+class DespeckleNode : public Node {
+public:
+       DespeckleNode(bNode *editorNode);
+       void convertToOperations(ExecutionSystem *graph, CompositorContext *context);
+};
+
+#endif
diff --git a/source/blender/compositor/operations/COM_DespeckleOperation.cpp b/source/blender/compositor/operations/COM_DespeckleOperation.cpp
new file mode 100644 (file)
index 0000000..6e2f9ab
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor: Campbell Barton
+ */
+
+#include "MEM_guardedalloc.h"
+
+#include "COM_DespeckleOperation.h"
+
+#include "BLI_utildefines.h"
+
+DespeckleOperation::DespeckleOperation() : NodeOperation()
+{
+       this->addInputSocket(COM_DT_COLOR);
+       this->addInputSocket(COM_DT_VALUE);
+       this->addOutputSocket(COM_DT_COLOR);
+       this->setResolutionInputSocketIndex(0);
+       this->m_inputOperation = NULL;
+       this->setComplex(true);
+}
+void DespeckleOperation::initExecution()
+{
+       this->m_inputOperation = this->getInputSocketReader(0);
+       this->m_inputValueOperation = this->getInputSocketReader(1);
+}
+
+void DespeckleOperation::deinitExecution()
+{
+       this->m_inputOperation = NULL;
+       this->m_inputValueOperation = NULL;
+}
+
+BLI_INLINE int color_diff(const float a[3], const float b[3], const float threshold)
+{
+       return ((fabsf(a[0] - b[0]) > threshold) ||
+               (fabsf(a[1] - b[1]) > threshold) ||
+               (fabsf(a[2] - b[2]) > threshold));
+}
+
+void DespeckleOperation::executePixel(float output[4], int x, int y, void *data)
+{
+       float w = 0.0f;
+       float color_org[4];
+       float color_mid[4];
+       float color_mid_ok[4];
+       float in1[4];
+       int x1 = x - 1;
+       int x2 = x;
+       int x3 = x + 1;
+       int y1 = y - 1;
+       int y2 = y;
+       int y3 = y + 1;
+       CLAMP(x1, 0, getWidth() - 1);
+       CLAMP(x2, 0, getWidth() - 1);
+       CLAMP(x3, 0, getWidth() - 1);
+       CLAMP(y1, 0, getHeight() - 1);
+       CLAMP(y2, 0, getHeight() - 1);
+       CLAMP(y3, 0, getHeight() - 1);
+       float value[4];
+       this->m_inputValueOperation->read(value, x2, y2, NULL);
+       //const float mval = 1.0f - value[0];
+
+
+       this->m_inputOperation->read(color_org, x2, y2, NULL);
+
+#define TOT_DIV_ONE 1.0
+#define TOT_DIV_CNR M_SQRT1_2
+
+#define        WTOT (TOT_DIV_ONE * 4 + TOT_DIV_CNR * 4)
+
+#define COLOR_ADD(fac)  \
+{ \
+       madd_v4_v4fl(color_mid, in1, fac); \
+       if (color_diff(in1, color_org, this->m_threshold)) { \
+               w += fac; \
+               madd_v4_v4fl(color_mid_ok, in1, fac); \
+       } \
+}
+
+       zero_v4(color_mid);
+       zero_v4(color_mid_ok);
+
+       this->m_inputOperation->read(in1, x1, y1, NULL); COLOR_ADD(TOT_DIV_CNR)
+       this->m_inputOperation->read(in1, x2, y1, NULL); COLOR_ADD(TOT_DIV_ONE)
+       this->m_inputOperation->read(in1, x3, y1, NULL); COLOR_ADD(TOT_DIV_CNR)
+       this->m_inputOperation->read(in1, x1, y2, NULL); COLOR_ADD(TOT_DIV_ONE)
+
+#if 0
+       this->m_inputOperation->read(in2, x2, y2, NULL);
+       madd_v4_v4fl(color_mid, in2, this->m_filter[4]);
+#endif
+
+       this->m_inputOperation->read(in1, x3, y2, NULL); COLOR_ADD(TOT_DIV_ONE)
+       this->m_inputOperation->read(in1, x1, y3, NULL); COLOR_ADD(TOT_DIV_CNR)
+       this->m_inputOperation->read(in1, x2, y3, NULL); COLOR_ADD(TOT_DIV_ONE)
+       this->m_inputOperation->read(in1, x3, y3, NULL); COLOR_ADD(TOT_DIV_CNR)
+
+       mul_v4_fl(color_mid, 1.0f / (4.0f + (4.0f * M_SQRT1_2)));
+       //mul_v4_fl(color_mid, 1.0f / w);
+
+       if ((w != 0.0f) &&
+           ((w / WTOT) > (this->m_threshold_neighbour)) &&
+           color_diff(color_mid, color_org, this->m_threshold))
+       {
+               mul_v4_fl(color_mid_ok, 1.0f / w);
+               interp_v4_v4v4(output, color_org, color_mid_ok, value[0]);
+       }
+       else {
+               copy_v4_v4(output, color_org);
+       }
+}
+
+bool DespeckleOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
+{
+       rcti newInput;
+       int addx = 1; //(this->m_filterWidth - 1) / 2 + 1;
+       int addy = 1; //(this->m_filterHeight - 1) / 2 + 1;
+       newInput.xmax = input->xmax + addx;
+       newInput.xmin = input->xmin - addx;
+       newInput.ymax = input->ymax + addy;
+       newInput.ymin = input->ymin - addy;
+
+       return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
+}
diff --git a/source/blender/compositor/operations/COM_DespeckleOperation.h b/source/blender/compositor/operations/COM_DespeckleOperation.h
new file mode 100644 (file)
index 0000000..5b79d7c
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor: Campbell Barton
+ */
+
+#ifndef _COM_DespeckleOperation_h
+#define _COM_DespeckleOperation_h
+#include "COM_NodeOperation.h"
+
+class DespeckleOperation : public NodeOperation {
+private:
+       float m_threshold;
+       float m_threshold_neighbour;
+
+       int m_filterWidth;
+       int m_filterHeight;
+
+protected:
+       SocketReader *m_inputOperation;
+       SocketReader *m_inputValueOperation;
+
+public:
+       DespeckleOperation();
+       bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
+       void executePixel(float output[4], int x, int y, void *data);
+
+       void setThreshold(float threshold) { this->m_threshold = threshold; }
+       void setThresholdNeighbour(float threshold) { this->m_threshold_neighbour = threshold; }
+
+       void initExecution();
+       void deinitExecution();
+};
+
+#endif
index c1a410317b783a205456ee26724088db56efe241..125d5e3be7733daeecb30d604c21c495dc2e10a2 100644 (file)
@@ -1812,6 +1812,15 @@ static void node_composit_buts_inpaint(uiLayout *layout, bContext *UNUSED(C), Po
        uiItemR(layout, ptr, "distance", 0, NULL, ICON_NONE);
 }
 
+static void node_composit_buts_despeckle(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
+{
+       uiLayout *col;
+
+       col = uiLayoutColumn(layout, FALSE);
+       uiItemR(col, ptr, "threshold", 0, NULL, ICON_NONE);
+       uiItemR(col, ptr, "threshold_neighbour", 0, NULL, ICON_NONE);
+}
+
 static void node_composit_buts_diff_matte(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 {
        uiLayout *col;
@@ -2674,6 +2683,9 @@ static void node_composit_set_butfunc(bNodeType *ntype)
                case CMP_NODE_INPAINT:
                        ntype->uifunc = node_composit_buts_inpaint;
                        break;
+               case CMP_NODE_DESPECKLE:
+                       ntype->uifunc = node_composit_buts_despeckle;
+                       break;
                case CMP_NODE_OUTPUT_FILE:
                        ntype->uifunc = node_composit_buts_file_output;
                        ntype->uifuncbut = node_composit_buts_file_output_details;
index 6a732cc26491ddaa1610a13fe29a1d3ad49f489a..a608a84bd89e2c06ad541588053cf5b789607a0b 100644 (file)
@@ -2148,6 +2148,23 @@ static void def_cmp_inpaint(StructRNA *srna)
        RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
 }
 
+static void def_cmp_despeckle(StructRNA *srna)
+{
+       PropertyRNA *prop;
+
+       prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "custom3");
+       RNA_def_property_range(prop, 0.0, 1.0f);
+       RNA_def_property_ui_text(prop, "Threshold", "Threshold for detecting pixels to despeckle");
+       RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
+
+       prop = RNA_def_property(srna, "threshold_neighbour", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "custom4");
+       RNA_def_property_range(prop, 0.0, 1.0f);
+       RNA_def_property_ui_text(prop, "Neighbour", "Threshold for the number of neighbour pixels that must match");
+       RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
+}
+
 static void def_cmp_scale(StructRNA *srna)
 {
        PropertyRNA *prop;
index c70dd01cd57b1a20f22e1d06f4d8d488a72fbb45..15ad1c557a50fcbe6f9f9bb5c02db763a79808c9 100644 (file)
@@ -122,6 +122,7 @@ DefNode( CompositorNode, CMP_NODE_ZCOMBINE,       def_cmp_zcombine,       "ZCOMB
 DefNode( CompositorNode, CMP_NODE_COMBRGBA,       0,                      "COMBRGBA",       CombRGBA,         "Combine RGBA",      ""              )
 DefNode( CompositorNode, CMP_NODE_DILATEERODE,    def_cmp_dilate_erode,   "DILATEERODE",    DilateErode,      "Dilate/Erode",      ""              )
 DefNode( CompositorNode, CMP_NODE_INPAINT,        def_cmp_inpaint,        "INPAINT",        Inpaint,          "Inpaint",           ""              )
+DefNode( CompositorNode, CMP_NODE_DESPECKLE,      def_cmp_despeckle,      "DESPECKLE",      Despeckle,        "Despeckle",         ""              )
 DefNode( CompositorNode, CMP_NODE_ROTATE,         def_cmp_rotate,         "ROTATE",         Rotate,           "Rotate",            ""              )
 DefNode( CompositorNode, CMP_NODE_SCALE,          def_cmp_scale,          "SCALE",          Scale,            "Scale",             ""              )
 DefNode( CompositorNode, CMP_NODE_SEPYCCA,        def_cmp_ycc,            "SEPYCCA",        SepYCCA,          "Separate YCCA",     ""              )
index 64987a52a213ca83054e6be5ec2eda01b6243b1c..e1adb419a8ae67804005834d9984bd660dfcddf0 100644 (file)
@@ -59,6 +59,7 @@ set(SRC
        composite/nodes/node_composite_composite.c
        composite/nodes/node_composite_crop.c
        composite/nodes/node_composite_curves.c
+       composite/nodes/node_composite_despeckle.c
        composite/nodes/node_composite_doubleEdgeMask.c
        composite/nodes/node_composite_defocus.c
        composite/nodes/node_composite_diffMatte.c
index 92e547288c90c427b6799f4a0c22745f29816160..bcef230e1d015018f725ae926ca8b4fd5e721cb7 100644 (file)
@@ -81,6 +81,7 @@ void register_node_type_cmp_bilateralblur(struct bNodeTreeType *ttype);
 void register_node_type_cmp_vecblur(struct bNodeTreeType *ttype);
 void register_node_type_cmp_dilateerode(struct bNodeTreeType *ttype);
 void register_node_type_cmp_inpaint(struct bNodeTreeType *ttype);
+void register_node_type_cmp_despeckle(struct bNodeTreeType *ttype);
 void register_node_type_cmp_defocus(struct bNodeTreeType *ttype);
 
 void register_node_type_cmp_valtorgb(struct bNodeTreeType *ttype);
diff --git a/source/blender/nodes/composite/nodes/node_composite_despeckle.c b/source/blender/nodes/composite/nodes/node_composite_despeckle.c
new file mode 100644 (file)
index 0000000..c1861ca
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2006 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/nodes/composite/nodes/node_composite_despeckle.c
+ *  \ingroup cmpnodes
+ */
+
+#include "node_composite_util.h"
+
+/* **************** FILTER  ******************** */
+static bNodeSocketTemplate cmp_node_despeckle_in[]= {
+       {       SOCK_FLOAT, 1, N_("Fac"),                       1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR},
+       {       SOCK_RGBA, 1, N_("Image"),                      1.0f, 1.0f, 1.0f, 1.0f},
+       {       -1, 0, ""       }
+};
+static bNodeSocketTemplate cmp_node_despeckle_out[]= {
+       {       SOCK_RGBA, 0, N_("Image")},
+       {       -1, 0, ""       }
+};
+
+#ifdef WITH_COMPOSITOR_LEGACY
+
+static void node_composit_exec_despeckle(void *UNUSED(data), bNode *UNUSED(node), bNodeStack **UNUSED(in), bNodeStack **UNUSED(out))
+{
+       /* pass */
+}
+
+#endif  /* WITH_COMPOSITOR_LEGACY */
+
+void register_node_type_cmp_despeckle(bNodeTreeType *ttype)
+{
+       static bNodeType ntype;
+
+       node_type_base(ttype, &ntype, CMP_NODE_DESPECKLE, "Despeckle", NODE_CLASS_OP_FILTER, NODE_PREVIEW|NODE_OPTIONS);
+       node_type_socket_templates(&ntype, cmp_node_despeckle_in, cmp_node_despeckle_out);
+       node_type_size(&ntype, 80, 40, 120);
+#ifdef WITH_COMPOSITOR_LEGACY
+       node_type_exec(&ntype, node_composit_exec_despeckle);
+#endif
+
+       nodeRegisterType(ttype, &ntype);
+}