public GlowEffect() : base(StaticName, StaticImage, null, EffectDirectives.None, true) { this.blurEffect = new BlurEffect(); this.bcAdjustment = new BrightnessAndContrastAdjustment(); this.screenBlendOp = new UserBlendOps.ScreenBlendOp(); }
public PencilSketchEffect() : base(StaticName, StaticIcon.Reference, SubmenuNames.Artistic, EffectFlags.Configurable) { this.blurEffect = new GaussianBlurEffect(); this.blurProps = this.blurEffect.CreatePropertyCollection(); this.bacAdjustment = new BrightnessAndContrastAdjustment(); this.bacProps = this.bacAdjustment.CreatePropertyCollection(); }
public GlowEffect() : base(StaticName, StaticImage, SubmenuNames.Photo, EffectFlags.Configurable) { this.blurEffect = new GaussianBlurEffect(); this.blurProps = this.blurEffect.CreatePropertyCollection(); this.bcAdjustment = new BrightnessAndContrastAdjustment(); this.bcProps = this.bcAdjustment.CreatePropertyCollection(); this.screenBlendOp = new UserBlendOps.ScreenBlendOp(); }
public SoftenPortraitEffect() : base(StaticName, StaticIcon, SubmenuNames.Photo, EffectFlags.Configurable) { this.blurEffect = new GaussianBlurEffect(); this.blurProps = this.blurEffect.CreatePropertyCollection(); this.desaturateOp = new UnaryPixelOps.Desaturate(); this.bacAdjustment = new BrightnessAndContrastAdjustment(); this.bacProps = this.bacAdjustment.CreatePropertyCollection(); this.overlayOp = new UserBlendOps.OverlayBlendOp(); }
void Render(Surface dst, Surface src, Rectangle rect) { // Setup for calling the Gaussian Blur effect GaussianBlurEffect blurEffect = new GaussianBlurEffect(); PropertyCollection blurProps = blurEffect.CreatePropertyCollection(); PropertyBasedEffectConfigToken BlurParameters = new PropertyBasedEffectConfigToken(blurProps); BlurParameters.SetPropertyValue(GaussianBlurEffect.PropertyNames.Radius, Amount1); blurEffect.SetRenderInfo(BlurParameters, new RenderArgs(bluredSurface), new RenderArgs(alignedSurface)); // Call the Gaussian Blur function blurEffect.Render(new Rectangle[1] { rect }, 0, 1); // Setup for calling the Brightness and Contrast Adjustment function BrightnessAndContrastAdjustment bacAdjustment = new BrightnessAndContrastAdjustment(); PropertyCollection bacProps = bacAdjustment.CreatePropertyCollection(); PropertyBasedEffectConfigToken bacParameters = new PropertyBasedEffectConfigToken(bacProps); bacParameters.SetPropertyValue(BrightnessAndContrastAdjustment.PropertyNames.Brightness, Amount2); bacParameters.SetPropertyValue(BrightnessAndContrastAdjustment.PropertyNames.Contrast, 0); bacAdjustment.SetRenderInfo(bacParameters, new RenderArgs(lightSurface), new RenderArgs(bluredSurface)); // Call the Brightness and Contrast Adjustment function bacAdjustment.Render(new Rectangle[1] { rect }, 0, 1); for (int y = rect.Top; y < rect.Bottom; y++) { if (IsCancelRequested) return; for (int x = rect.Left; x < rect.Right; x++) { if (Amount4) { dst[x, y] = normalOp.Apply(lightSurface[x, y], src[x, y]); } else { dst[x, y] = lightSurface[x, y]; } } } }