protected override void OnSetRenderInfo(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs) { EffectPluginConfigToken token = (EffectPluginConfigToken)parameters; Corners = token.Corners; sCorners = token.sCorners; AlphaTrans = token.AlphaTrans; AaAmount = token.AaLevel; Perspective = token.Perspective; Uvalue = (double)token.UValue / 100; Vvalue = (double)token.VValue / 100; if (src2 == null || src2.Size != sCorners.Size) { src2?.Dispose(); src2 = new Surface(sCorners.Size); src2.CopySurface(srcArgs.Surface, sCorners); } A = new PointD(Corners[0].X, Corners[0].Y); B = new PointD(Corners[1].X, Corners[1].Y); C = new PointD(Corners[2].X, Corners[2].Y); D = new PointD(Corners[3].X, Corners[3].Y); Antialias = (AaAmount > 1) && AlphaTrans; if (Antialias) { SetupForSubpixels(AaAmount, AaAmount); } base.OnSetRenderInfo(parameters, dstArgs, srcArgs); }
protected EffectPluginConfigToken(EffectPluginConfigToken copyMe) : base(copyMe) { this.Corners = copyMe.Corners; this.sCorners = copyMe.sCorners; this.Tweak = copyMe.Tweak; this.vCorners = copyMe.vCorners; this.AlphaTrans = copyMe.AlphaTrans; this.AaLevel = copyMe.AaLevel; this.Perspective = copyMe.Perspective; this.UValue = copyMe.UValue; this.VValue = copyMe.VValue; this.initialize = copyMe.initialize; this.Anchor = copyMe.Anchor; }
protected override void InitTokenFromDialog() { EffectPluginConfigToken token = (EffectPluginConfigToken)base.theEffectToken; token.Anchor = previewWorkArea; token.Corners = srcCorners; token.vCorners = previewCorners; token.sCorners = srcWorkArea; token.initialize = false; token.Tweak = tweak; token.AlphaTrans = AlphaBox.Checked; token.AaLevel = AaTrack.Value; token.Perspective = PerspBox.Checked; token.UValue = PerspBox.Checked ? UAxis.Value : 1; token.VValue = PerspBox.Checked ? VAxis.Value : 1; }
protected override void InitDialogFromToken(EffectConfigToken effectToken) { EffectPluginConfigToken token = (EffectPluginConfigToken)effectToken; srcCorners = token.Corners; previewWorkArea = token.Anchor; srcWorkArea = token.sCorners; previewCorners = token.vCorners; tweak = token.Tweak; initialize = token.initialize; AlphaBox.Checked = token.AlphaTrans; AaTrack.Value = token.AaLevel; PerspBox.Checked = token.Perspective; UAxis.Value = token.UValue; VAxis.Value = token.VValue; SWAFlag = false; }
protected override void InitialInitToken() { theEffectToken = new EffectPluginConfigToken(); }