Backup/CRD.WinUI/HSLFilter.cs

(开头部分) 11KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;

using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace CRD.WinUI
{

    public interface IFilter
    {
        Image ExecuteFilter(Image inputImage);
    }

    public abstract class BasicFilter : IFilter
    {
        private Color _bgColor = Color.FromArgb(0, 0, 0, 0);
        private InterpolationMode _interpolation = InterpolationMode.HighQualityBicubic;

        public abstract Image ExecuteFilter(Image img);

        public Color BackgroundColor
        {
            get
            {
                return this._bgColor;
            }
            set
            {
                this._bgColor = value;
            }
        }

        public InterpolationMode Interpolation
        {
            get
            {
                return this._interpolation;
            }
            set
            {
                this._interpolation = value;
            }
        }
    }

    public class HSLFilter : BasicFilter
    {
        private double _hue = 0.0;
        private double _lightness = 0.0;
        private double _saturation = 0.0;//5|1|a|s|p|x

        public override Image ExecuteFilter(Image img)
        {
            if (img == null) return null;

后面还有 275 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。