BinaryExtractionModel.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. using System.Xml.Serialization;
  2. namespace PaintDotNet.Base.SettingModel
  3. {
  4. /// <summary>
  5. /// 二值提取 - 参数设置
  6. /// </summary>
  7. [XmlRoot("ROOT")]
  8. public class BinaryExtractionModel
  9. {
  10. /// <summary>
  11. /// 1个颜色区间或2个颜色区间
  12. /// </summary>
  13. public int ColorInterval { get; set; }
  14. /// <summary>
  15. /// 第一个颜色区间起始值
  16. /// </summary>
  17. public int ColorOneStart { get; set; }
  18. /// <summary>
  19. /// 第一个颜色区间结束值
  20. /// </summary>
  21. public int ColorOneEnd { get; set; }
  22. /// <summary>
  23. /// 第二个颜色区间起始值
  24. /// </summary>
  25. public int ColorTwoStart { get; set; }
  26. /// <summary>
  27. /// 第二个颜色区间结束值
  28. /// </summary>
  29. public int ColorTwoEnd { get; set; }
  30. /// <summary>
  31. /// 第三个颜色区间起始值
  32. /// </summary>
  33. public int ColorThreeStart { get; set; }
  34. /// <summary>
  35. /// 第三个颜色区间结束值
  36. /// </summary>
  37. public int ColorThreeEnd { get; set; }
  38. /// <summary>
  39. /// 自动阈值
  40. /// </summary>
  41. public bool AutoThreshold { get; set; }
  42. /// <summary>
  43. /// 删除边界对象
  44. /// </summary>
  45. public bool DeleteBoundaryObject { get; set; }
  46. /// <summary>
  47. /// 孔洞填充
  48. /// </summary>
  49. public bool HoleFilling { get; set; }
  50. /// <summary>
  51. /// 碎屑删除
  52. /// </summary>
  53. public bool DebrisRemoval { get; set; }
  54. /// <summary>
  55. /// 碎屑删除面积起始值
  56. /// </summary>
  57. public int DebrisAreaStart { get; set; }
  58. /// <summary>
  59. /// 碎屑删除面积结束值
  60. /// </summary>
  61. public int DebrisAreaEnd { get; set; }
  62. /// <summary>
  63. /// 二值样式
  64. /// </summary>
  65. public int BinaryStyle { get; set; }
  66. /// <summary>
  67. /// 相颜色
  68. /// </summary>
  69. public int PhaseColor { get; set; }
  70. /// <summary>
  71. /// 目标选择
  72. /// </summary>
  73. public int TargetSelection { get; set; }
  74. /// <summary>
  75. /// 是否二值化和显示原图, 0不二值化和不显示原图,1不二值化和显示原图,2二值化和不显示原图,3二值化和显示原图
  76. /// </summary>
  77. public int BinaryCheckFlag { get; set; }
  78. public BinaryExtractionModel cloneModel()
  79. {
  80. BinaryExtractionModel newMod = new BinaryExtractionModel();
  81. newMod.ColorInterval = this.ColorInterval;
  82. newMod.ColorOneStart = this.ColorOneStart;
  83. newMod.ColorOneEnd = this.ColorOneEnd;
  84. newMod.ColorTwoStart = this.ColorTwoStart;
  85. newMod.ColorTwoEnd = this.ColorTwoEnd;
  86. newMod.ColorThreeStart = this.ColorThreeStart;
  87. newMod.ColorThreeEnd = this.ColorThreeEnd;
  88. newMod.AutoThreshold = this.AutoThreshold;
  89. newMod.DeleteBoundaryObject = this.DeleteBoundaryObject;
  90. newMod.HoleFilling = this.HoleFilling;
  91. newMod.DebrisRemoval = this.DebrisRemoval;
  92. newMod.DebrisAreaStart = this.DebrisAreaStart;
  93. newMod.DebrisAreaEnd = this.DebrisAreaEnd;
  94. newMod.BinaryStyle = this.BinaryStyle;
  95. newMod.PhaseColor = this.PhaseColor;
  96. newMod.TargetSelection = this.TargetSelection;
  97. newMod.BinaryCheckFlag = this.BinaryCheckFlag;
  98. return newMod;
  99. }
  100. }
  101. }