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; } } }
public override XmlElement ToXML(XmlDocument xmldoc) { if (_bcArgs == null) { _bcArgs = new BrightContrastArg(); } return(_bcArgs.ToXML(xmldoc)); }
public override RgbProcessorArg Clone() { BrightContrastArg arg = new BrightContrastArg(_channel); arg.BrightAdjustValue = _brightAdjustValue; arg.ContrastAdjustValue = _contrastAdjustValue; arg.Brightchangevalue = _brightchangevalue; arg.Channel = _channel; return(arg); }
/// <summary> /// 参数编辑窗口自己的初始化 /// </summary> private void Init() { _bcArg = _arg as BrightContrastArg; InitRGBChannel(); InitControl(); }
public override void CreateDefaultArguments() { _arg = new BrightContrastArg(); }