// The following describes and registers all operations contained in this module. public static void RegisterOperations() { OperationRegistry.RegisterOperation(new Operation("Math Hyper Operations Simple", "To Gray Scale", "Z = ToGrayScale(X)", HyperWrapper(ToGrayScale), true)); OperationRegistry.RegisterOperation(new Operation("Math Hyper Operations Simple", "Invert", "Z = -X", HyperWrapper(Invert), true)); OperationRegistry.RegisterOperation(new Operation("Math Hyper Operations Simple", "Add", "Z = X + Y", HyperWrapper(Add), true)); OperationRegistry.RegisterOperation(new Operation("Math Hyper Operations Simple", "Subtract", "Z = X - Y", HyperWrapper(Subtract), true)); OperationRegistry.RegisterOperation(new Operation("Math Hyper Operations Simple", "Average", "Z = (X + Y) / 2", HyperWrapper(Average), true)); OperationRegistry.RegisterOperation(new Operation("Math Hyper Operations Simple", "ChangeIntensity", "Z = X + c", HyperWrapper(ChangeIntensity), true)); }
// The following describes and registers all operations contained in this module. public static void RegisterOperations() { OperationRegistry.RegisterOperation(new Operation("Math Operations Simple", "To Gray Scale", "Z = ToGrayScale(X)", ToGrayScale, true)); OperationRegistry.RegisterOperation(new Operation("Math Operations Simple", "Invert", "Z = -X", Invert, true)); OperationRegistry.RegisterOperation(new Operation("Math Operations Simple", "Add", "Z = X + Y", Add, true)); OperationRegistry.RegisterOperation(new Operation("Math Operations Simple", "Subtract", "Z = X - Y", Subtract, true)); OperationRegistry.RegisterOperation(new Operation("Math Operations Simple", "Average", "Z = (X + Y) / 2", Average, true)); OperationRegistry.RegisterOperation(new Operation("Math Operations Simple", "ChangeIntensity", "Z = X + c", ChangeIntensity, true)); }
private void ExecuteToolStripMenuItem_Click(object sender, EventArgs e) { //MessageBox.Show(tvwOperations.SelectedNode.Tag.ToString()); try { var watch = Stopwatch.StartNew(); OperationRegistry.Retrieve("", tvwOperations.SelectedNode.Tag.ToString()).Execute(); watch.Stop(); string[] row = { watch.Elapsed.ToString(), tvwOperations.SelectedNode.Tag.ToString() }; listView1.Items.Add(new ListViewItem(row)); } catch { // Let's only get the operations, not the categories... } }