protected override PropertyCollection OnCreatePropertyCollectionCore() { this._enumDropDown = new EnumDropDownValues <ValueSources>(); return(new PropertyCollection(new Property[] { new StaticListChoiceProperty(PropertyNames.ValueSource, this._enumDropDown.Values), new BooleanProperty(PropertyNames.FFTDirectionIsForward, !this._isForwards) })); }
protected override void OnSetRenderInfoCore(PropertyBasedEffectConfigToken newToken, RenderArgs dstArgs, RenderArgs srcArgs) { if (this._enumDropDown == null) { this._enumDropDown = new EnumDropDownValues <ValueSources>(); } this._isForwards = !newToken.GetProperty <BooleanProperty>(PropertyNames.FFTDirectionIsForward).Value; this._valueSource = this._enumDropDown.GetEnumMember(newToken.GetProperty <StaticListChoiceProperty>(PropertyNames.ValueSource).Value); }
protected override PropertyCollection OnCreatePropertyCollectionCore() { RectInt32 bounds = this.EnvironmentParameters.GetSelection(this.EnvironmentParameters.SourceSurface.Bounds).GetBoundsRectInt32(); double maxX = bounds.Width / 2.0; double maxY = bounds.Height / 2.0; this._lowPassX = Math.Round(this.InitialCutoffLowPassX * maxX); this._lowPassY = Math.Round(this.InitialCutoffLowPassY * maxY); this._highPassX = Math.Round(this.InitialCutoffHighPassX * maxX); this._highPassY = Math.Round(this.InitialCutoffHighPassY * maxY); this._enumDropDown = new EnumDropDownValues <ValueSources>(); var props = new List <Property>(); var rules = new List <PropertyCollectionRule>(); props.Add(new StaticListChoiceProperty(PropertyNames.ValueSource, this._enumDropDown.Values)); if (this.ShowSlidersLowPass) { props.Add(new DoubleProperty(PropertyNames.CutoffFrequencyLowPassX, this._lowPassX, 0, maxX)); props.Add(new DoubleProperty(PropertyNames.CutoffFrequencyLowPassY, this._lowPassY, 0, maxY)); rules.Add(new ReadOnlyBoundToBooleanRule(PropertyNames.CutoffFrequencyLowPassY, PropertyNames.LinkCutoffFrequencies, false)); } if (this.ShowSlidersHighPass) { props.Add(new DoubleProperty(PropertyNames.CutoffFrequencyHighPassX, this._highPassX, 0, maxX)); props.Add(new DoubleProperty(PropertyNames.CutoffFrequencyHighPassY, this._highPassY, 0, maxY)); rules.Add(new ReadOnlyBoundToBooleanRule(PropertyNames.CutoffFrequencyHighPassY, PropertyNames.LinkCutoffFrequencies, false)); } if (this.ShowSlidersLowPass || this.ShowSlidersHighPass) { props.Add(new BooleanProperty(PropertyNames.LinkCutoffFrequencies, this._linkFrequencies)); } if (this.ShowSlidersLowPass && this.ShowSlidersHighPass) { rules.Add(new SoftMutuallyBoundMinMaxRule <double, DoubleProperty>(PropertyNames.CutoffFrequencyHighPassX, PropertyNames.CutoffFrequencyLowPassX)); rules.Add(new SoftMutuallyBoundMinMaxRule <double, DoubleProperty>(PropertyNames.CutoffFrequencyHighPassY, PropertyNames.CutoffFrequencyLowPassY)); } return(new PropertyCollection(props, rules)); }
protected override void OnSetRenderInfoCore(PropertyBasedEffectConfigToken newToken, RenderArgs dstArgs, RenderArgs srcArgs) { RectInt32 bounds = this.EnvironmentParameters.GetSelection(this.EnvironmentParameters.SourceSurface.Bounds).GetBoundsRectInt32(); if (this._enumDropDown == null) { this._enumDropDown = new EnumDropDownValues <ValueSources>(); } this._valueSource = this._enumDropDown.GetEnumMember(newToken.GetProperty <StaticListChoiceProperty>(PropertyNames.ValueSource).Value); this._linkFrequencies = newToken.GetProperty <BooleanProperty>(PropertyNames.LinkCutoffFrequencies).Value; if (this.ShowSlidersLowPass) { this._lowPassX = newToken.GetProperty <DoubleProperty>(PropertyNames.CutoffFrequencyLowPassX).Value; if (this._linkFrequencies) { this._lowPassY = this._lowPassX / bounds.Width * bounds.Height; } else { this._lowPassY = newToken.GetProperty <DoubleProperty>(PropertyNames.CutoffFrequencyLowPassY).Value; } } if (this.ShowSlidersHighPass) { this._highPassX = newToken.GetProperty <DoubleProperty>(PropertyNames.CutoffFrequencyHighPassX).Value; if (this._linkFrequencies) { this._highPassY = this._highPassX / bounds.Width * bounds.Height; } else { this._highPassY = newToken.GetProperty <DoubleProperty>(PropertyNames.CutoffFrequencyHighPassY).Value; } } }