using PaintDotNet.Adjust;
using PaintDotNet.Base;
using PaintDotNet.Base.Enum;
using PaintDotNet.Base.Functionodel;
using PaintDotNet.Data.Param;
using System.Collections.Generic;
using System.Drawing;
namespace PaintDotNet.Data.Action
{
///
/// 孔洞删除,针对相
///
public class Action914 : ParamObject
{
public double outmin, outmax;
public override OpenCvSharp.Mat PerformProcess(PhaseModel phaseModel, double rule)
{
return Adjust.MorphologyIntent.HoleRemoval(phaseModel.mat, this.Lists, phaseModel.color, rule, out outmin, out outmax);
}
public Action914()
{
this.MenuId = ActionType.ActionHoleRemoval;
this.OpenImage = "currentPhase";
//this.OpenImage = "";//###
////this.OpenImage = "currentPhase";
StringArray stringArray = new StringArray();
stringArray.key = "FilterParameters";
stringArray.name = PdnResources.GetString("Menu.Filterparams.text");
stringArray.initialValue = InvariantData.filterparameters;
stringArray.Value = FilterParameters.Area;
lists.Add(stringArray);
List oneL = new List();
oneL.Add(0);
oneL.Add(0);
DecimalScope one = new DecimalScope(0, int.MaxValue);
one.key = "Scope";
one.name = PdnResources.GetString("Menu.numberrange.text");
one.value = oneL;
lists.Add(one);
StringArray unitsArray = new StringArray();
unitsArray.key = "UnitParameters";
unitsArray.name = PdnResources.GetString("Menu.filterunit.text");
unitsArray.initialValue = InvariantData.unitparameters;
unitsArray.Value = MeasurementUnit.Micron;
lists.Add(unitsArray);
ColorNumber phase0Color = new ColorNumber();
phase0Color.key = "HoleColor";
phase0Color.name = PdnResources.GetString("Menu.Binaryoperation.Holedelete.Holecolor.text");
phase0Color.Value = Color.Yellow.ToArgb();
phase0Color.initialValue = Color.Yellow.ToArgb();
lists.Add(phase0Color);
}
}
}