Files
AgraSandbox/AgraV2/Effect.cs
T

48 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AgraV2
{
public class Effect
{
private string _name;
private Panel _toolBox;
private List<double> _processingDuration;
private Stopwatch _chrono;
public string Name { get => _name; set => _name = value; }
public Panel ToolBox { get => _toolBox; set => _toolBox = value; }
public List<double> ProcessingDuration { get => _processingDuration; set => _processingDuration = value; }
public Stopwatch Chrono { get => _chrono; set => _chrono = value; }
public Effect(string name, Panel toolBox)
{
Name = name;
ToolBox = toolBox;
ProcessingDuration = new List<double>();
Chrono = new Stopwatch();
//I start and stop it so the child can just always use Restart()
Chrono.Start();Chrono.Stop();
}
public virtual void populatePannel()
{
//For the childs to explore
ToolBox.Controls.Clear();
}
public virtual Bitmap[] apply(Bitmap inputBmp)
{
return new Bitmap[] { inputBmp };
}
public override string ToString()
{
return Name;
}
}
}