public DistortionEffectConfigTokens(int count) { SubTokens = new DistortionEffectConfigToken[count]; for (int i = 0; i < count; ++i) { SubTokens[i] = new DistortionEffectConfigToken(); } }
public void InitControlFromToken(EffectConfigToken effectToken) { DistortionEffectConfigToken token = (DistortionEffectConfigToken)effectToken; ValueX = token.ValueX; ValueY = token.ValueY; ValueR = token.ValueR; UpdatePanControls(); }
protected override void OnSetRenderInfo(DistortionEffectConfigTokens newTokens, RenderArgs dstArgs, RenderArgs srcArgs) { Surface src = srcArgs.Surface; int wdiv2 = src.Width / 2; int hdiv2 = src.Height / 2; int maxRadius = Math.Min(wdiv2, hdiv2); for (int i = 0; i < newTokens.SubTokens.Length; ++i) { DistortionEffectConfigToken token = newTokens.SubTokens[i]; DistortionEffectProperties props = Props[i]; props.MaxRadius = (int)(maxRadius * token.ValueR); props.TransferCurves = token.GetTransferCurves(new int[] { props.MaxRadius, props.MaxRadius }, new float[] { props.MaxRadius, props.MaxRadius }); props.Center = new PointF(wdiv2 + (float)token.ValueX * wdiv2, hdiv2 + (float)token.ValueY * hdiv2); } }
protected override void InitialInitToken() { DistortionEffectConfigToken token = new DistortionEffectConfigToken(); theEffectToken = token; }