Convert to .NET SDK type csproj

This commit is contained in:
ema
2024-11-30 17:00:22 +08:00
parent e2f1fddb09
commit 507b157a40
83 changed files with 14413 additions and 3386 deletions

View File

@@ -0,0 +1,51 @@
using System;
using System.Reflection;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Effects;
namespace WPFMediaKit.Effects;
/// <summary>
/// This is a WPF pixel shader effect that will scale 16-235 HD-TV pixel output to
/// 0-255 pixel values for deeper color on video.
/// </summary>
public class DeeperColorEffect : ShaderEffect
{
private static string m_assemblyShortName;
public static DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(DeeperColorEffect), 0);
public DeeperColorEffect()
{
var u = new Uri(@"pack://application:,,,/" + AssemblyShortName + ";component/Effects/DeeperColor.ps");
PixelShader = new PixelShader { UriSource = u };
UpdateShaderValue(InputProperty);
}
private static string AssemblyShortName
{
get
{
if (m_assemblyShortName == null)
{
Assembly a = typeof(DeeperColorEffect).Assembly;
m_assemblyShortName = a.ToString().Split(',')[0];
}
return m_assemblyShortName;
}
}
public Brush Input
{
get
{
return ((Brush)(GetValue(InputProperty)));
}
set
{
SetValue(InputProperty, value);
}
}
}

View File

@@ -0,0 +1,9 @@
sampler2D implicitInputSampler : register(s0);
#define const1 (16.0/255.0)
#define const2 (255.0/219.0)
float4 main(float2 tex : TEXCOORD0) : COLOR
{
return((tex2D( implicitInputSampler, tex ) - const1 ) * const2);
}