protected override void InitDialogFromToken(EffectConfigToken effectToken)
        {
            CurvesEffectConfigToken token = (CurvesEffectConfigToken)effectToken;

            bool oldValue = finishTokenOnDropDownChanged;

            finishTokenOnDropDownChanged = false;

            switch (token.ColorTransferMode)
            {
            case ColorTransferMode.Luminosity:
                modeComboBox.SelectedItem = colorTransferNames.EnumValueToLocalizedName(ColorTransferMode.Luminosity);
                break;

            case ColorTransferMode.Rgb:
                modeComboBox.SelectedItem = colorTransferNames.EnumValueToLocalizedName(ColorTransferMode.Rgb);
                break;
            }

            finishTokenOnDropDownChanged = oldValue;

            curveControl.ControlPoints = (SortedList <int, int>[])token.ControlPoints.Clone();
            curveControl.Invalidate();
            curveControl.Update();
        }
 protected CurvesEffectConfigToken(CurvesEffectConfigToken copyMe)
     : base(copyMe)
 {
     this.uop = copyMe.Uop;
     this.colorTransferMode = copyMe.ColorTransferMode;
     this.controlPoints     = (SortedList <int, int>[])copyMe.controlPoints.Clone();
 }
 protected CurvesEffectConfigToken(CurvesEffectConfigToken copyMe)
     : base(copyMe)
 {
     this.uop = copyMe.Uop;
     this.colorTransferMode = copyMe.ColorTransferMode;
     this.controlPoints = (SortedList<int, int>[])copyMe.controlPoints.Clone();
 }
示例#4
0
        public override void Render(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs, Rectangle[] rois, int startIndex, int length)
        {
            CurvesEffectConfigToken token = parameters as CurvesEffectConfigToken;

            if (token != null)
            {
                UnaryPixelOp uop = token.Uop;

                for (int i = startIndex; i < startIndex + length; ++i)
                {
                    uop.Apply(dstArgs.Surface, srcArgs.Surface, rois[i]);
                }
            }
        }
        protected override void InitialInitToken()
        {
            CurvesEffectConfigToken token = new CurvesEffectConfigToken();

            theEffectToken = token;
        }
 protected override void InitialInitToken()
 {
     CurvesEffectConfigToken token = new CurvesEffectConfigToken();
     theEffectToken = token;
 }