|
@@ -12,7 +12,6 @@ using System;
|
|
|
using System.Windows;
|
|
|
using System.Windows.Media;
|
|
|
using System.Windows.Media.Effects;
|
|
|
-using System.Windows.Media.Media3D;
|
|
|
|
|
|
|
|
|
namespace PicView.Editing.HlslEffects
|
|
@@ -1779,171 +1778,6 @@ namespace PicView.Editing.HlslEffects
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- /// <summary>Pixel shader that samples the color from an image and draws every odd pixel transparent.</summary>
|
|
|
- public class TransparentAlternatingPixelsEffect : ShaderEffect
|
|
|
- {
|
|
|
- public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(TransparentAlternatingPixelsEffect), 0);
|
|
|
- public static readonly DependencyProperty TextureSizeProperty = DependencyProperty.Register("TextureSize", typeof(Point), typeof(TransparentAlternatingPixelsEffect), new UIPropertyMetadata(new Point(512D, 512D), PixelShaderConstantCallback(0)));
|
|
|
- public TransparentAlternatingPixelsEffect(double intensity)
|
|
|
- {
|
|
|
- var value = intensity / 50;
|
|
|
- TextureSize = new Point(intensity, intensity);
|
|
|
- PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
|
|
|
- pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/TransparentAlternatingPixelsEffect.ps", UriKind.RelativeOrAbsolute);
|
|
|
- this.PixelShader = pixelShader;
|
|
|
-
|
|
|
- this.UpdateShaderValue(InputProperty);
|
|
|
- this.UpdateShaderValue(TextureSizeProperty);
|
|
|
- }
|
|
|
- public Brush Input
|
|
|
- {
|
|
|
- get
|
|
|
- {
|
|
|
- return ((Brush)(this.GetValue(InputProperty)));
|
|
|
- }
|
|
|
- set
|
|
|
- {
|
|
|
- this.SetValue(InputProperty, value);
|
|
|
- }
|
|
|
- }
|
|
|
- /// <summary>The Size of the texture.</summary>
|
|
|
- public Point TextureSize
|
|
|
- {
|
|
|
- get
|
|
|
- {
|
|
|
- return ((Point)(this.GetValue(TextureSizeProperty)));
|
|
|
- }
|
|
|
- set
|
|
|
- {
|
|
|
- this.SetValue(TextureSizeProperty, value);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- /// <summary>Pixel shader that samples the color from an image and draws every odd pixel transparent.</summary>
|
|
|
- public class TransparentAlternatingPixelsMultipliedEffect : ShaderEffect
|
|
|
- {
|
|
|
- public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(TransparentAlternatingPixelsMultipliedEffect), 0);
|
|
|
- public static readonly DependencyProperty TextureSizeProperty = DependencyProperty.Register("TextureSize", typeof(Point), typeof(TransparentAlternatingPixelsMultipliedEffect), new UIPropertyMetadata(new Point(512D, 512D), PixelShaderConstantCallback(0)));
|
|
|
- public TransparentAlternatingPixelsMultipliedEffect()
|
|
|
- {
|
|
|
- PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
|
|
|
- pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/TransparentAlternatingPixelsMultipliedEffect.ps", UriKind.RelativeOrAbsolute);
|
|
|
- this.PixelShader = pixelShader;
|
|
|
-
|
|
|
- this.UpdateShaderValue(InputProperty);
|
|
|
- this.UpdateShaderValue(TextureSizeProperty);
|
|
|
- }
|
|
|
- public Brush Input
|
|
|
- {
|
|
|
- get
|
|
|
- {
|
|
|
- return ((Brush)(this.GetValue(InputProperty)));
|
|
|
- }
|
|
|
- set
|
|
|
- {
|
|
|
- this.SetValue(InputProperty, value);
|
|
|
- }
|
|
|
- }
|
|
|
- /// <summary>The Size of the texture.</summary>
|
|
|
- public Point TextureSize
|
|
|
- {
|
|
|
- get
|
|
|
- {
|
|
|
- return ((Point)(this.GetValue(TextureSizeProperty)));
|
|
|
- }
|
|
|
- set
|
|
|
- {
|
|
|
- this.SetValue(TextureSizeProperty, value);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- /// <summary>Pixel shader that samples the color from an image and draws every odd row transparent.</summary>
|
|
|
- public class TransparentAlternatingScanlinesEffect : ShaderEffect
|
|
|
- {
|
|
|
- public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(TransparentAlternatingScanlinesEffect), 0);
|
|
|
- public static readonly DependencyProperty TextureSizeProperty = DependencyProperty.Register("TextureSize", typeof(Point), typeof(TransparentAlternatingScanlinesEffect), new UIPropertyMetadata(new Point(512D, 512D), PixelShaderConstantCallback(0)));
|
|
|
- public TransparentAlternatingScanlinesEffect()
|
|
|
- {
|
|
|
- PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
|
|
|
- pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/TransparentAlternatingScanlinesEffect.ps", UriKind.RelativeOrAbsolute);
|
|
|
- this.PixelShader = pixelShader;
|
|
|
-
|
|
|
- this.UpdateShaderValue(InputProperty);
|
|
|
- this.UpdateShaderValue(TextureSizeProperty);
|
|
|
- }
|
|
|
- public Brush Input
|
|
|
- {
|
|
|
- get
|
|
|
- {
|
|
|
- return ((Brush)(this.GetValue(InputProperty)));
|
|
|
- }
|
|
|
- set
|
|
|
- {
|
|
|
- this.SetValue(InputProperty, value);
|
|
|
- }
|
|
|
- }
|
|
|
- /// <summary>The Size of the texture.</summary>
|
|
|
- public Point TextureSize
|
|
|
- {
|
|
|
- get
|
|
|
- {
|
|
|
- return ((Point)(this.GetValue(TextureSizeProperty)));
|
|
|
- }
|
|
|
- set
|
|
|
- {
|
|
|
- this.SetValue(TextureSizeProperty, value);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- public class ReflectionEffect : ShaderEffect
|
|
|
- {
|
|
|
- public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(ReflectionEffect), 0);
|
|
|
- public static readonly DependencyProperty ReflectionHeightProperty = DependencyProperty.Register("ReflectionHeight", typeof(Color), typeof(ReflectionEffect), new UIPropertyMetadata(Color.FromArgb(255, 0, 0, 0), PixelShaderConstantCallback(1)));
|
|
|
- public static readonly DependencyProperty DdxUvDdyUvProperty = DependencyProperty.Register("DdxUvDdyUv", typeof(Color), typeof(ReflectionEffect), new UIPropertyMetadata(Color.FromArgb(255, 0, 0, 0), PixelShaderConstantCallback(6)));
|
|
|
- public ReflectionEffect()
|
|
|
- {
|
|
|
- PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
|
|
|
- pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/ReflectionEffect.ps", UriKind.RelativeOrAbsolute);
|
|
|
- this.PixelShader = pixelShader;
|
|
|
-
|
|
|
- this.UpdateShaderValue(InputProperty);
|
|
|
- this.UpdateShaderValue(ReflectionHeightProperty);
|
|
|
- this.UpdateShaderValue(DdxUvDdyUvProperty);
|
|
|
- }
|
|
|
- public Brush Input
|
|
|
- {
|
|
|
- get
|
|
|
- {
|
|
|
- return ((Brush)(this.GetValue(InputProperty)));
|
|
|
- }
|
|
|
- set
|
|
|
- {
|
|
|
- this.SetValue(InputProperty, value);
|
|
|
- }
|
|
|
- }
|
|
|
- public Color ReflectionHeight
|
|
|
- {
|
|
|
- get
|
|
|
- {
|
|
|
- return ((Color)(this.GetValue(ReflectionHeightProperty)));
|
|
|
- }
|
|
|
- set
|
|
|
- {
|
|
|
- this.SetValue(ReflectionHeightProperty, value);
|
|
|
- }
|
|
|
- }
|
|
|
- public Color DdxUvDdyUv
|
|
|
- {
|
|
|
- get
|
|
|
- {
|
|
|
- return ((Color)(this.GetValue(DdxUvDdyUvProperty)));
|
|
|
- }
|
|
|
- set
|
|
|
- {
|
|
|
- this.SetValue(DdxUvDdyUvProperty, value);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
public class GrayscaleEffect : ShaderEffect
|
|
|
{
|