public Argument(ScriptBase parent, string name, string type) : base(parent, name, type) { this.passingType = PassingType.Value; parent.AddArgument(this); this.documentation = new ArgumentDoc(this); }
public Argument(ScriptBase parent, string name, string type, PassingType pass, bool is_array) : base(parent, name, type, is_array) { this.passingType = pass; parent.AddArgument(this); this.documentation = new ArgumentDoc(this); }
public void ReadXml(XmlReader reader) { reader.MoveToContent(); _argName = reader.GetAttribute("ArgName"); _passingType = (PassingType)Enum.Parse(typeof(PassingType), reader.GetAttribute("PassingType")); _argType = DeserializeType(reader, "Type"); }
public void ChangePassongType(PassingType passingType) { if (IsReadOnly) { throw new MemberAccessException("attribute is read-only (non-Modifiable)!"); } _passingType = passingType; }
public ParameterInfo(ParameterInfo other) { if (other == null) { throw new ArgumentNullException(); } _argType = other.ArgType; _argName = other.ArgName; _passingType = other.ArgPassingType; }
//constructors---------------------------------------------------------------------- public ParameterInfo(Type argType, string argName, PassingType passingType) { if (argType == null || string.IsNullOrEmpty(argName)) { throw new ArgumentNullException(); } if (!NameValidator.isNameValid(argName)) { throw new ArgumentException("argument name is invalid!"); } _argType = argType; _argName = argName; _passingType = passingType; }
public Form2(PassingType pt, ProcessType proc) { InitializeComponent(); label1.Visible = false; panel1.AutoScroll = true; previewPicture.Location = new Point(0, 0); previewPicture.SizeMode = PictureBoxSizeMode.Zoom; PassingType pts = PassingType.Denoise4; switch (pt) { case PassingType.Binary: this.Text = "二值图"; pts = PassingType.Binary; break; case PassingType.Noise: this.Text = "噪声图"; pts = PassingType.Noise; break; case PassingType.Denoise4: this.Text = "四邻域探测去噪图"; pts = PassingType.Denoise4; break; case PassingType.Denoise8: this.Text = "八邻域探测去噪图"; pts = PassingType.Denoise8; break; default: this.Text = "浏览"; break; } if (pt >= PassingType.Denoise4) { this.Text += " (" + (proc == ProcessType.Climbing ? "爬山算法" : "模拟退火算法") + ") "; } core.passOut(pts, ref preImage); previewPicture.Image = preImage; if (pt >= PassingType.Denoise4) { label1.Text = "去噪率:" + (core.getRate() * 100).ToString("0.000") + "%"; label1.Visible = true; } }
// 显示浏览画面 private void showPreview(int buttonId, PassingType pt) { Form2 form2; if (comboBox2.SelectedIndex == 0) { core.select(pt, ProcessType.Climbing, (PrefersType)comboBox3.SelectedIndex); form2 = new Form2(pt, ProcessType.Climbing); } else { core.select(pt, ProcessType.Annealing, (PrefersType)comboBox3.SelectedIndex); form2 = new Form2(pt, ProcessType.Annealing); } form2.Show(); }
// 从后台获得图像 private void outbuffering(PassingType pt) { core.passOut(pt, ref outimage); }
/// <summary> /// 向后台要求某项服务计算 /// </summary> /// <param name="pt">服务类型的名称</param> /// <param name="proc">服务提供的方法</param> public void select(PassingType pt, ProcessType proc, PrefersType prec) { processer = proc; if (prec == PrefersType.Border) { h = 0.0; m = 1.0; n = 2.1; } else { h = 0.5; m = 1.5; n = 2.1; } switch (pt) { case PassingType.Binary: this.convert(2); break; case PassingType.Noise: this.noise(); break; case PassingType.Denoise4: this.denoise(1); break; default: this.denoise(2); break; } }
/// <summary> /// 从后台传输数据到前台的方法 /// </summary> /// <param name="pt">请求的图像类型</param> /// <param name="outputImage">用于存储返回图片的引用</param> public void passOut(PassingType pt, ref Bitmap outputImage) { Bitmap bp = new Bitmap(bitmapData.Width, bitmapData.Height); BitmapData bpData = bp.LockBits(new Rectangle(Point.Empty, bp.Size), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb); if (pt == PassingType.Binary) { Marshal.Copy(GrayPool, 0, bpData.Scan0, GrayPool.Length); } else if (pt == PassingType.Noise) { Marshal.Copy(noisePool, 0, bpData.Scan0, noisePool.Length); } else { Marshal.Copy(pGrayData, 0, bpData.Scan0, pGrayData.Length); } bp.UnlockBits(bpData); outputImage = bp; }
public ReadOnlyParameterInfo(Type argType, string argName, PassingType passingType) : base(argType, argName, passingType) { }
public ParameterInfo(SerializationInfo info, StreamingContext context) { _argName = info.GetString("ArgName"); _passingType = (PassingType)info.GetValue("PassingType", typeof(PassingType)); _argType = DeserializeType(info, context, "Type"); }
public IRLine(Point2D from, Point2D to, PassingType passingType) { Dx = to.X - from.X; Dy = to.Y - from.Y; PassingType = passingType; }
public IRLine(double dx, double dy, PassingType passingType) { Dx = dx; Dy = dy; PassingType = passingType; }