Пример #1
0
        public void OnDeserialized(StreamingContext c)
        {
            //if one of them is null the others probably are, and if this one is not then they all should be good.
            //Try to save some cycles on every load

            if (XOffsetCurve == null)
            {
                double value = PixelEffectBase.ScaleValueToCurve(XOffset, 100, -100);
                XOffsetCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                XOffset      = 0;

                if (YOffsetCurve == null)
                {
                    value        = PixelEffectBase.ScaleValueToCurve(YOffset, 100, -100);
                    YOffsetCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    YOffset      = 0;
                }

                if (IncreaseBrightnessCurve == null)
                {
                    value = PixelEffectBase.ScaleValueToCurve(IncreaseBrightness, 100, 10);
                    IncreaseBrightnessCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    IncreaseBrightness      = 0;
                }
            }
        }
Пример #2
0
        public void OnDeserialized(StreamingContext c)
        {
            //if one of them is null the others probably are, and if this one is not then they all should be good.
            //Try to save some cycles on every load
            if (DistanceCurve == null)
            {
                double value = PixelEffectBase.ScaleValueToCurve(Distance, 100, 1);
                DistanceCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                Distance      = 0;

                if (RangeCurve == null)
                {
                    value      = PixelEffectBase.ScaleValueToCurve(Range, 200, 1);
                    RangeCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    Range      = 0;
                }
                if (SpirographRangeCurve == null)
                {
                    value = PixelEffectBase.ScaleValueToCurve(SpirographRange, 300, 1);
                    SpirographRangeCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    SpirographRange      = 0;
                }
                if (SpeedCurve == null)
                {
                    value      = PixelEffectBase.ScaleValueToCurve(Speed, 100, 1);
                    SpeedCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    Speed      = 0;
                }
            }
        }
Пример #3
0
        public void OnDeserialized(StreamingContext c)
        {
            //Ensure defaults for new fields that might not be in older effects.
            if (LevelCurve == null)
            {
                LevelCurve = new Curve(CurveType.Flat100);
            }

            if (BaseLevelCurve == null)
            {
                BaseLevelCurve = new Curve(CurveType.Flat100);
            }

            //if one of them is null the others probably are, and if this one is not then they all should be good.
            //Try to save some cycles on every load

            if (XOffsetCurve == null)
            {
                double value = PixelEffectBase.ScaleValueToCurve(PositionX, 100, -100);
                XOffsetCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                PositionX    = 0;

                if (YOffsetCurve == null)
                {
                    value        = PixelEffectBase.ScaleValueToCurve(Position, 100, -100);
                    YOffsetCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    Position     = 0;
                }
            }
        }
Пример #4
0
        public void OnDeserialized(StreamingContext c)
        {
            //Ensure defaults for new fields that might not be in older effects.
            if (TimeVisibleLength == 0)
            {
                TimeVisibleLength = 750;
            }

            if (LevelCurve == null)
            {
                LevelCurve = new Curve(CurveType.Flat100);
            }

            if (BaseLevelCurve == null)
            {
                BaseLevelCurve = new Curve(CurveType.Flat100);
            }

            //if one of them is null the others probably are, and if this one is not then they all should be good.
            //Try to save some cycles on every load

            if (FontScaleCurve == null)
            {
                AngleCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { 0.0, 100.0 }));

                double value;

                if (FontScaleCurve == null)
                {
                    FontScaleCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { 100.0, 100.0 }));
                    ScaleText      = 0;
                }

                if (XOffsetCurve == null)
                {
                    value        = PixelEffectBase.ScaleValueToCurve(PositionX, 100, -100);
                    XOffsetCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    PositionX    = 0;
                }

                if (YOffsetCurve == null)
                {
                    value        = PixelEffectBase.ScaleValueToCurve(Position, 100, -100);
                    YOffsetCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    Position     = 0;
                }
            }

            if (YOffSetCurve == null)
            {
                YOffSetCurve = new Curve(YOffsetCurve);
                // Copy the old Y Offset curve and then Invert curve as this has been set the wrong way around so convert any existing curves.
                foreach (var p in YOffSetCurve.Points)
                {
                    p.Y = 100 - p.Y;
                }
            }
        }
Пример #5
0
        public void OnDeserialized(StreamingContext c)
        {
            if (PinWheel3D)
            {
                PinWheelBladeType = PinWheelBladeType.ThreeD;
                PinWheel3D        = false;
            }


            //if one of them is null the others probably are, and if this one is not then they all should be good.
            //Try to save some cycles on every load
            if (TwistCurve == null)
            {
                double value = PixelEffectBase.ScaleValueToCurve(Twist, 500d, -500d);
                TwistCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                Twist      = 0;

                if (ThicknessCurve == null)
                {
                    value          = PixelEffectBase.ScaleValueToCurve(Thickness, 100, 1);
                    ThicknessCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    Thickness      = 0;
                }
                if (SizeCurve == null)
                {
                    value     = PixelEffectBase.ScaleValueToCurve(Size, 400, 1);
                    SizeCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    Size      = 0;
                }
                if (SpeedCurve == null)
                {
                    value      = PixelEffectBase.ScaleValueToCurve(Speed, 50, 1);
                    SpeedCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    Speed      = 0;
                }
                if (XOffsetCurve == null)
                {
                    value        = PixelEffectBase.ScaleValueToCurve(XOffset, 100, -100);
                    XOffsetCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    XOffset      = 0;
                }
                if (YOffsetCurve == null)
                {
                    value        = PixelEffectBase.ScaleValueToCurve(YOffset, 100, -100);
                    YOffsetCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    YOffset      = 0;
                }
                if (CenterHubCurve == null)
                {
                    value          = PixelEffectBase.ScaleValueToCurve(CenterStart, 100, 0);
                    CenterHubCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    CenterStart    = 0;
                }
            }
        }
Пример #6
0
 public void OnDeserialized(StreamingContext c)
 {
     //if one of them is null the others probably are, and if this one is not then they all should be good.
     //Try to save some cycles on every load
     if (HueShiftCurve == null)
     {
         double value = PixelEffectBase.ScaleValueToCurve(HueShift, 100, 0);
         HueShiftCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
         HueShift      = 0;
     }
 }
Пример #7
0
        public void OnDeserialized(StreamingContext c)
        {
            //if one of them is null the others probably are, and if this one is not then they all should be good.
            //Try to save some cycles on every load
            if (WidthCurve == null)
            {
                double value    = PixelEffectBase.ScaleValueToCurve(StartWidth, 255, 0);
                double endValue = PixelEffectBase.ScaleValueToCurve(EndWidth, 255, 0);
                WidthCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, endValue }));
                StartWidth = 0;
                EndWidth   = 0;

                if (CenterYCurve == null)
                {
                    if (TargetPositioning == TargetPositioningType.Locations)
                    {
                        CenterY = 100 - CenterY;
                    }
                    else if (Orientation == StringOrientation.Vertical)
                    {
                        //fix the backwards x y adjustment when strings are vertical
                        var tempX = CenterX;
                        CenterX = CenterY;
                        CenterY = tempX;
                    }
                    CenterYCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new double[] { CenterY, CenterY }));
                    CenterY      = 0;
                }

                if (CenterXCurve == null)
                {
                    CenterXCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new double[] { CenterX, CenterX }));
                    CenterX      = 0;
                }

                if (AccelerationCurve == null)
                {
                    value             = PixelEffectBase.ScaleValueToCurve(Acceleration, 10, -10);
                    AccelerationCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    Acceleration      = 0;
                }
                if (RadiusCurve == null)
                {
                    value       = PixelEffectBase.ScaleValueToCurve(StartRadius, 750, 0);
                    endValue    = PixelEffectBase.ScaleValueToCurve(EndRadius, 750, 0);
                    RadiusCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, endValue }));
                    EndRadius   = 0;
                    StartRadius = 0;
                }
            }
        }
Пример #8
0
        private void SetupPictureEffect()
        {
            if (_thePic == null)
            {
                _thePic = new FastPictureEffect();
            }
            //_thePic.Source = PictureSource.File;
            _thePic.TargetNodes = TargetNodes;
            _thePic.CacheElementEnumerator();
            _thePic.StringOrientation = Orientation;
            _thePic.ScaleToGrid       = ScaleToGrid;
            _thePic.ScalePercent      = ScalePercent;
            //_thePic.TimeSpan = TimeSpan;

            var intensityCurve = PixelEffectBase.ScaleValueToCurve(IntensityLevel, 100.0, 0.0);

            _thePic.LevelCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { intensityCurve, intensityCurve }));
        }
Пример #9
0
        public void OnDeserialized(StreamingContext c)
        {
            //if one of them is null the others probably are, and if this one is not then they all should be good.
            //Try to save some cycles on every load
            if (RotationCurve == null)
            {
                double value = PixelEffectBase.ScaleValueToCurve(Rotation, 150d, -150d);
                RotationCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                Rotation      = 0;

                if (ThicknessCurve == null)
                {
                    value          = PixelEffectBase.ScaleValueToCurve(Thickness, 100, 1);
                    ThicknessCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    Thickness      = 0;
                }
            }
        }
Пример #10
0
        public void OnDeserialized(StreamingContext c)
        {
            //if one of them is null the others probably are, and if this one is not then they all should be good.
            //Try to save some cycles on every load
            if (GroundLevelCurve == null)
            {
                double value;

                GroundLevelCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { 0.0, 0.0 }));
                GroundColor      = new ColorGradient(Color.ForestGreen);

                if (SpeedVariationCurve == null)
                {
                    double variation = RandomSpeed ? (MaxSpeed - MinSpeed) : 0.0;
                    value = PixelEffectBase.ScaleValueToCurve(variation, 200, 1);
                    SpeedVariationCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                }
                if (CenterSpeedCurve == null)
                {
                    double center = RandomSpeed ? (double)(MaxSpeed + MinSpeed) / 2 : Speed;
                    value            = PixelEffectBase.ScaleValueToCurve(center, 200, 1);
                    CenterSpeedCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    MinSpeed         = 0;
                    MaxSpeed         = 0;
                    Speed            = 0;
                    RandomSpeed      = true;
                }

                if (PixelCountCurve == null)
                {
                    value           = PixelEffectBase.ScaleValueToCurve(PixelCount, 200, 1);
                    PixelCountCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    PixelCount      = 0;
                }

                if (LengthCurve == null)
                {
                    value       = PixelEffectBase.ScaleValueToCurve(Length, 100, 1);
                    LengthCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    Length      = 0;
                }
            }
        }
Пример #11
0
        public void OnDeserialized(StreamingContext c)
        {
            //The following is due to adding the PictureSource datamember and also no longer requiring the None selection for Embedded picture tiles.
            if (string.IsNullOrEmpty(FileName))
            {
                Source = PictureSource.Embedded;
            }
            if (TilePictures == TilePictures.None)
            {
                TilePictures = TilePictures.BlueGlowDots;
            }

            //if one of them is null the others probably are, and if this one is not then they all should be good.
            //Try to save some cycles on every load

            if (XOffsetCurve == null)
            {
                double value = PixelEffectBase.ScaleValueToCurve(XOffset, 100, -100);
                XOffsetCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                XOffset      = 0;

                if (YOffsetCurve == null)
                {
                    value        = PixelEffectBase.ScaleValueToCurve(YOffset, 100, -100);
                    YOffsetCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    YOffset      = 0;
                }

                if (IncreaseBrightnessCurve == null)
                {
                    value = PixelEffectBase.ScaleValueToCurve(IncreaseBrightness, 100, 10);
                    IncreaseBrightnessCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    IncreaseBrightness      = 0;
                }
            }
        }
Пример #12
0
        public void OnDeserialized(StreamingContext c)
        {
            //if one of them is null the others probably are, and if this one is not then they all should be good.
            //Try to save some cycles on every load
            if (LengthCurve == null)
            {
                double value = PixelEffectBase.ScaleValueToCurve(Length, 20, 1);
                LengthCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                Length      = 0;

                if (CountCurve == null)
                {
                    value      = PixelEffectBase.ScaleValueToCurve(Count, 100, 1);
                    CountCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    Count      = 0;
                }
                if (SpeedCurve == null)
                {
                    value      = PixelEffectBase.ScaleValueToCurve(Speed, 100, 1);
                    SpeedCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    Speed      = 0;
                }
            }
        }
Пример #13
0
        public void OnDeserialized(StreamingContext c)
        {
            //if one of them is null the others probably are, and if this one is not then they all should be good.
            //Try to save some cycles on every load
            if (BuildUpSpeedCurve == null)
            {
                double value;
                BuildUpSpeedCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { 15.0, 15.0 }));

                if (SpeedVariationCurve == null)
                {
                    double variation = RandomSpeed ? (MaxSpeed - MinSpeed) : 0.0;
                    value = PixelEffectBase.ScaleValueToCurve(variation, 60, 1);
                    SpeedVariationCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                }

                if (FlakeCountCurve == null)
                {
                    value           = PixelEffectBase.ScaleValueToCurve(FlakeCount, 100, 1);
                    FlakeCountCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    FlakeCount      = 0;
                }

                if (CenterSpeedCurve == null)
                {
                    double center = RandomSpeed ? (double)(MaxSpeed + MinSpeed) / 2 : Speed;

                    value            = PixelEffectBase.ScaleValueToCurve(center, 60, 1);
                    CenterSpeedCurve = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { value, value }));
                    MinSpeed         = 0;
                    MaxSpeed         = 0;
                    Speed            = 0;
                    RandomSpeed      = true;
                }
            }
        }