Exemple #1
0
        protected override void BeforeProcess()
        {
            _bcArgs = _arg as BrightContrastArg;
            int    bright = _bcArgs.BrightAdjustValue;
            double change = _bcArgs.Brightchangevalue;
            double dstepC = (_bcArgs.ContrastAdjustValue + PARA_1) * PARA_2;

            if (dstepC > 1)
            {
                dstepC = dstepC * dstepC * dstepC;
            }
            double bChange = bright * change * dstepC - PARA_MIDDLE * dstepC + PARA_MIDDLE;

            _rgbs = new byte[256];
            if (_bcArgs.IsChanged)
            {
                for (int i = 0; i < 256; i++)
                {
                    _rgbs[i] = ColorMath.FixByte(i * dstepC + bChange);
                }
            }
            else
            {
                for (int i = 0; i < 256; i++)
                {
                    _rgbs[i] = (byte)i;
                }
            }
        }
Exemple #2
0
 public override XmlElement ToXML(XmlDocument xmldoc)
 {
     if (_bcArgs == null)
     {
         _bcArgs = new BrightContrastArg();
     }
     return(_bcArgs.ToXML(xmldoc));
 }
Exemple #3
0
        public override RgbProcessorArg Clone()
        {
            BrightContrastArg arg = new BrightContrastArg(_channel);

            arg.BrightAdjustValue   = _brightAdjustValue;
            arg.ContrastAdjustValue = _contrastAdjustValue;
            arg.Brightchangevalue   = _brightchangevalue;
            arg.Channel             = _channel;
            return(arg);
        }
Exemple #4
0
 /// <summary>
 /// 参数编辑窗口自己的初始化
 /// </summary>
 private void Init()
 {
     _bcArg = _arg as BrightContrastArg;
     InitRGBChannel();
     InitControl();
 }
Exemple #5
0
 public override void CreateDefaultArguments()
 {
     _arg = new BrightContrastArg();
 }