123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- using PaintDotNet.Data.Param;
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace PaintDotNet.Data.Action
- {
- /// <summary>
- /// 通用分析 专用分析父类
- /// </summary>
- public class ActionAnalysis: ParamObject
- {
- public ActionAnalysis() {
- this.OpenImage = "current";
- //默认1个颜色区间
- BooleanObject colorInterval = new BooleanObject();
- colorInterval.key = "colorInterval";
- colorInterval.name = PdnResources.GetString("Menu.inverse.text");
- colorInterval.initialValue = false;
- colorInterval.value = false;
- lists.Add(colorInterval);
- //第一个参数
- List<double> oneL = new List<double>();
- oneL.Add(0);
- oneL.Add(0);
- DecimalScope one = new DecimalScope(0, 255);
- one.key = "scope1";
- one.name = PdnResources.GetString("Menu.Colorinterval.text");
- one.value = oneL;
- lists.Add(one);
- List<double> threeL = new List<double>();
- threeL.Add(0);
- threeL.Add(0);
- DecimalScope three = new DecimalScope(0, 255);
- three.key = "scope3";
- three.name = "反选" + PdnResources.GetString("Menu.Colorinterval.text");
- three.value = threeL;
- lists.Add(three);
- List<double> twoL = new List<double>();
- twoL.Add(0);
- twoL.Add(0);
- DecimalScope two = new DecimalScope(0, 255);
- two.key = "scope2";
- two.name = "反选" + PdnResources.GetString("Menu.Colorinterval.text");
- two.value = twoL;
- lists.Add(two);
- BooleanObject autoThreshold = new BooleanObject();
- autoThreshold.key = "autoThreshold";
- autoThreshold.name = PdnResources.GetString("Menu.Automaticthreshold.text");
- autoThreshold.initialValue = false;
- autoThreshold.value = false;
- lists.Add(autoThreshold);
- //重要说明:binaryMat和Original两个参数顺序不能颠倒
- BooleanObject Original = new BooleanObject();
- Original.key = "binarization";
- Original.name = PdnResources.GetString("Menu.Binarization.text");
- Original.initialValue = false;
- Original.value = false;
- lists.Add(Original);
- BooleanObject binaryMat = new BooleanObject();
- binaryMat.key = "theoriginalcolor";
- binaryMat.name = PdnResources.GetString("Menu.Theoriginalcolor.text");
- binaryMat.initialValue = false;
- binaryMat.value = false;
- lists.Add(binaryMat);
- //二值样式
- ChoiseArray binaryType = new ChoiseArray("binaryStyle", PdnResources.GetString("Menu.Binarystyle.text"),
- new BooleanObject[]
- {
- new BooleanObject("1", PdnResources.GetString("Menu.solid.text"), true, null),//fill
- new BooleanObject("2", PdnResources.GetString("Menu.Sideline.text"), false, null)//solid
- }
- );
- binaryType.initialValue = 1;
- binaryType.value = 1;
- lists.Add(binaryType);
- ColorNumber phaseColor = new ColorNumber();
- phaseColor.key = "phaseColor";
- phaseColor.name = PdnResources.GetString("Menu.Phasecolor.text");
- phaseColor.Value = Color.Red.ToArgb();
- lists.Add(phaseColor);
- IntegerNumber seven = new IntegerNumber(0, 10);
- seven.key = "CalculatorDecimalDigits";
- seven.name = "小数点位数";
- seven.initialValue = 2;
- seven.value = 2;
- lists.Add(seven);
- lists.Add(new BooleanObject("OpenWhileExportReport", "生成报告时打开设置", true, null));
- lists.Add(new BooleanObject("ExportResults", "导出结果", true, null));
- lists.Add(new BooleanObject("ExportReports", "生成报告", true, null));
- lists.Add(new BooleanObject("ExportProjects", "导出项目", true, null));
- }
- }
- }
|