Debian Codegraph @

operations/common/difference-of-gaussians.c

raw symbols SCIP
1 /* This file is an image processing operation for GEGL
2 *
3 * GEGL is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 3 of the License, or (at your option) any later version.
7 *
8 * GEGL is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with GEGL; if not, see <https://www.gnu.org/licenses/>.
15 *
16 * Copyright 2006 Øyvind Kolås <[email protected]g>
17 */
18
19 #include "config.h"
20 #include <glib/gi18n-lib.h>
21
22 #ifdef GEGL_PROPERTIES
23
24 property_double (radius1, _("Radius 1"), 1.0)
25 value_range (0.0, 1000.0)
26 ui_range (0.0, 10.0)
27 ui_gamma (1.5)
28
29 property_double (radius2, _("Radius 2"), 2.0)
30 value_range (0.0, 1000.0)
31 ui_range (0.0, 20.0)
32 ui_gamma (1.5)
33
34 #else
35
36 #define GEGL_OP_META
37 #define GEGL_OP_NAME difference_of_gaussians
38 #define GEGL_OP_C_SOURCE difference-of-gaussians.c
39
40 #include "gegl-op.h"
41
42 static void attach (GeglOperation *operation)
43 {
44 GeglNode *gegl = operation->node;
45 GeglNode *input, *output, *subtract, *blur1, *blur2;
46
47 input = gegl_node_get_input_proxy (gegl, "input");
48 output = gegl_node_get_output_proxy (gegl, "output");
49
50 subtract = gegl_node_new_child (gegl,
51 "operation", "gegl:subtract",
52 NULL);
53
54 blur1 = gegl_node_new_child (gegl,
55 "operation", "gegl:gaussian-blur",
56 NULL);
57
58 blur2 = gegl_node_new_child (gegl,
59 "operation", "gegl:gaussian-blur",
60 NULL);
61
62 gegl_node_link_many (input, blur1, subtract, output, NULL);
63 gegl_node_link (input, blur2);
64
65 gegl_node_connect (subtract, "aux", blur2, "output");
66
67 gegl_operation_meta_redirect (operation, "radius1", blur1, "std-dev-x");
68 gegl_operation_meta_redirect (operation, "radius1", blur1, "std-dev-y");
69 gegl_operation_meta_redirect (operation, "radius2", blur2, "std-dev-x");
70 gegl_operation_meta_redirect (operation, "radius2", blur2, "std-dev-y");
71
72 }
73
74 static void
75 gegl_op_class_init (GeglOpClass *klass)
76 {
77 GeglOperationClass *operation_class;
78
79 operation_class = GEGL_OPERATION_CLASS (klass);
80
81 operation_class->attach = attach;
82
83 gegl_operation_class_set_keys (operation_class,
84 "name", "gegl:difference-of-gaussians",
85 "title", _("Difference of Gaussians"),
86 "categories", "edge-detect",
87 "reference-hash", "45ed5656a238a5125700fc254001b2ac",
88 "description", _("Edge detection with control of edge thickness, based "
89 "on the difference of two gaussian blurs"),
90 NULL);
91 }
92
93 #endif