重命名

This commit is contained in:
GG Z
2026-01-02 17:30:30 +08:00
parent 0e9db9a2b9
commit fa0d280130
245 changed files with 4405 additions and 4236 deletions

View File

@@ -0,0 +1,87 @@
using System.Windows.Media.Effects;
using VariaStudio.Appearance;
namespace VariaStudio.Effects;
/// <summary>
/// 亮度对比度效果类。此效果用于调整图像或控件的亮度和对比度。
/// 继承自ShaderEffect使用像素着色器实现对输入源的亮度和对比度调节功能。
/// </summary>
public class BrightnessContrastEffect : ShaderEffect
{
/// <summary>
/// 获取或设置作为效果输入的画刷。此属性定义了应用亮度对比度调整的基础图像或控件。
/// 通过设置不同的画刷,可以改变效果作用的对象。
/// </summary>
public Brush Input
{
get => (Brush)GetValue(InputProperty);
set => SetValue(InputProperty, value);
}
/// <summary>
/// 获取或设置作为效果输入的画刷。此属性定义了应用亮度对比度调整的基础图像或控件。
/// 通过设置不同的画刷,可以改变效果作用的对象。
/// </summary>
public static readonly DependencyProperty InputProperty
= RegisterPixelShaderSamplerProperty("Input",
typeof(BrightnessContrastEffect), 0);
/// <summary>
/// 获取或设置亮度效果的值。此属性允许用户调整应用到图像或控件上的亮度级别。
/// 亮度值为0时表示没有亮度调整正值增加亮度负值减少亮度。
/// </summary>
public double Brightness
{
get => (double)GetValue(BrightnessProperty);
set => SetValue(BrightnessProperty, value);
}
/// <summary>
/// 获取或设置亮度效果的值。此属性允许用户调整应用到图像或控件上的亮度级别。
/// 亮度值为0时表示没有亮度调整正值增加亮度负值减少亮度。
/// </summary>
public static readonly DependencyProperty BrightnessProperty =
DependencyProperty.Register(nameof(Brightness), typeof(double),
typeof(BrightnessContrastEffect),
new PropertyMetadata(0.0, PixelShaderConstantCallback(0)));
/// <summary>
/// 获取或设置对比度效果的值。此属性允许用户调整应用到图像或控件上的对比度级别。
/// 对比度值为0时表示没有对比度调整正值增加对比度负值减少对比度。
/// </summary>
public double Contrast
{
get => (double)GetValue(ContrastProperty);
set => SetValue(ContrastProperty, value);
}
/// <summary>
/// 获取或设置对比度效果的值。此属性允许用户调整应用到图像或控件上的对比度级别。
/// 对比度值为0时表示没有对比度调整正值增加对比度负值减少对比度。
/// </summary>
public static readonly DependencyProperty ContrastProperty =
DependencyProperty.Register(nameof(Contrast), typeof(double),
typeof(BrightnessContrastEffect),
new PropertyMetadata(0.0, PixelShaderConstantCallback(1)));
/// <summary>
/// 亮度对比度效果类。此效果用于调整图像或控件的亮度和对比度。
/// 继承自ShaderEffect使用像素着色器实现对输入源的亮度和对比度调节功能。
/// </summary>
public BrightnessContrastEffect()
{
var shaderUri = $"pack://application:,,,/{ThemeManager.LibraryNamespace};component/Shaders/BrightnessContrastEffect.ps";
PixelShader = new PixelShader()
{
UriSource = new Uri(shaderUri)
};
UpdateShaderValue(InputProperty);
UpdateShaderValue(BrightnessProperty);
UpdateShaderValue(ContrastProperty);
}
}