-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAlphaTrimmedDualBellMatrixFilterElement.cs
71 lines (61 loc) · 4.79 KB
/
AlphaTrimmedDualBellMatrixFilterElement.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using System;
using System.Collections.Generic;
using System.Text;
using MetaphysicsIndustries.Solus;
using MetaphysicsIndustries.Crystalline;
using MetaphysicsIndustries.Epiphany;
using MetaphysicsIndustries.Acuity;
using MetaphysicsIndustries.Utilities;
namespace MetaphysicsIndustries.Amethyst
{
[Serializable]
public class AlphaTrimmedDualBellMatrixFilterElement : MatrixFilterElement
{
public AlphaTrimmedDualBellMatrixFilterElement()
: base(new AlphaTrimmedDualBellFilterNode(), new SizeV(100,80))
{
}
public new AlphaTrimmedDualBellFilterNode Node
{
get { return (AlphaTrimmedDualBellFilterNode)base.Node; }
}
protected override void InitTerminals()
{
base.InitTerminals();
//TerminalsByConnection[Node.WindowSize].Side = BoxOrientation.Up;
TerminalsByConnection[Node.WindowSize].DisplayText = "ws";
//TerminalsByConnection[Node.Alpha].Side = BoxOrientation.Up;
TerminalsByConnection[Node.Alpha].DisplayText = "α";
}
[Serializable]
public class AlphaTrimmedDualBellFilterNode : MatrixFilterNode
{
public AlphaTrimmedDualBellFilterNode()
: base("AT Dual Bell Filter")
{
}
private InputConnection<int> _windowSize = new InputConnection<int>("Window Size");
public InputConnection<int> WindowSize
{
get { return _windowSize; }
}
private InputConnection<float> _alpha = new InputConnection<float>("Alpha");
public InputConnection<float> Alpha
{
get { return _alpha; }
}
protected override void InitConnections()
{
base.InitConnections();
InputConnectionBases.AddRange(WindowSize, Alpha);
}
public override void Execute(Dictionary<InputConnectionBase, object> inputs, Dictionary<OutputConnectionBase, object> outputs)
{
float alpha = (float)inputs[Alpha];
int windowSize = (int)inputs[WindowSize];
Filter = new AlphaTrimmedDualBellEdgeDetectorMatrixFilter(alpha, windowSize);
base.Execute(inputs, outputs);
}
}
}
}