Ejemplo n.º 1
0
        protected override void OnSetRenderInfo(PropertyBasedEffectConfigToken newToken, RenderArgs dstArgs, RenderArgs srcArgs)
        {
            this.inkOutline = newToken.GetProperty <Int32Property>(PropertyNames.InkOutline).Value;
            this.coloring   = newToken.GetProperty <Int32Property>(PropertyNames.Coloring).Value;

            PropertyBasedEffectConfigToken glowToken = new PropertyBasedEffectConfigToken(this.glowProps);

            glowToken.SetPropertyValue(GlowEffect.PropertyNames.Radius, 6);
            glowToken.SetPropertyValue(GlowEffect.PropertyNames.Brightness, -(this.coloring - 50) * 2);
            glowToken.SetPropertyValue(GlowEffect.PropertyNames.Contrast, -(this.coloring - 50) * 2);
            this.glowEffect.SetRenderInfo(glowToken, dstArgs, srcArgs);

            base.OnSetRenderInfo(newToken, dstArgs, srcArgs);
        }
Ejemplo n.º 2
0
        protected override void OnSetRenderInfo(PropertyBasedEffectConfigToken newToken, RenderArgs dstArgs, RenderArgs srcArgs)
        {
            this.softness = newToken.GetProperty <Int32Property>(PropertyNames.Softness).Value;
            this.lighting = newToken.GetProperty <Int32Property>(PropertyNames.Lighting).Value;
            this.warmth   = newToken.GetProperty <Int32Property>(PropertyNames.Warmth).Value;

            PropertyBasedEffectConfigToken blurToken = new PropertyBasedEffectConfigToken(this.blurProps);

            blurToken.SetPropertyValue(GaussianBlurEffect.PropertyNames.Radius, this.softness * 3);
            this.blurEffect.SetRenderInfo(blurToken, dstArgs, srcArgs);

            PropertyBasedEffectConfigToken bacToken = new PropertyBasedEffectConfigToken(this.bacProps);

            bacToken.SetPropertyValue(BrightnessAndContrastAdjustment.PropertyNames.Brightness, this.lighting);
            bacToken.SetPropertyValue(BrightnessAndContrastAdjustment.PropertyNames.Contrast, -this.lighting / 2);
            this.bacAdjustment.SetRenderInfo(bacToken, dstArgs, dstArgs);

            base.OnSetRenderInfo(newToken, dstArgs, srcArgs);
        }
Ejemplo n.º 3
0
        protected override void OnSetRenderInfo(PropertyBasedEffectConfigToken newToken, RenderArgs dstArgs, RenderArgs srcArgs)
        {
            this.pencilTipSize = newToken.GetProperty <Int32Property>(PropertyNames.PencilTipSize).Value;
            this.colorRange    = newToken.GetProperty <Int32Property>(PropertyNames.ColorRange).Value;

            PropertyBasedEffectConfigToken blurToken = new PropertyBasedEffectConfigToken(this.blurProps);

            blurToken.SetPropertyValue(GaussianBlurEffect.PropertyNames.Radius, this.pencilTipSize);
            this.blurEffect.SetRenderInfo(blurToken, dstArgs, srcArgs);

            PropertyBasedEffectConfigToken bacToken = new PropertyBasedEffectConfigToken(this.bacProps);

            bacToken.SetPropertyValue(BrightnessAndContrastAdjustment.PropertyNames.Brightness, this.colorRange);
            bacToken.SetPropertyValue(BrightnessAndContrastAdjustment.PropertyNames.Contrast, -this.colorRange);
            this.bacAdjustment.SetRenderInfo(bacToken, dstArgs, dstArgs);

            this.desaturateEffect.SetRenderInfo(null, dstArgs, dstArgs);

            this.invertEffect.SetRenderInfo(null, dstArgs, dstArgs);

            base.OnSetRenderInfo(newToken, dstArgs, srcArgs);
        }