using PaintDotNet.Adjust; using PaintDotNet.Base; using PaintDotNet.Base.Enum; using PaintDotNet.Base.Functionodel; using PaintDotNet.Data.Param; using System.Collections.Generic; namespace PaintDotNet.Data.Action { /// /// 去碎屑,针对相 /// public class Action911 : ParamObject { public override OpenCvSharp.Mat PerformProcess(PhaseModel phaseModel, double rule) { return MorphologyIntent.Debris(phaseModel.mat, this.Lists, phaseModel.color, rule); } public Action911() { this.MenuId = ActionType.ActionDebris; 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 unitArray = new StringArray(); unitArray.key = "UnitParameters"; unitArray.name = PdnResources.GetString("Menu.filterunit.text"); unitArray.initialValue = InvariantData.unitparameters; unitArray.Value = MeasurementUnit.Micron; lists.Add(unitArray); StringArray functionArray = new StringArray(); functionArray.key = "FunctionParameters"; functionArray.name = PdnResources.GetString("Menu.Binaryoperation.Removedebris.filtermethod.text"); functionArray.initialValue = InvariantData.functionparameters; functionArray.Value = FunctionParameters.Remove; lists.Add(functionArray); BooleanObject colorInterval = new BooleanObject(); colorInterval.key = "BoundaryPreservation"; colorInterval.name = PdnResources.GetString("Menu.holdBoundary.text"); colorInterval.initialValue = true; colorInterval.value = true; lists.Add(colorInterval); } } }