Пример #1
0
        protected override void RenderEffect(int effectFrame, IPixelFrameBuffer frameBuffer)
        {
            var intervalPos       = GetEffectTimeIntervalPosition(effectFrame);
            var intervalPosFactor = intervalPos * 100;
            var bufferWi          = BufferWi;
            var bufferHt          = BufferHt;

            double level           = LevelCurve.GetValue(intervalPosFactor) / 100;
            int    thickness       = (int)Math.Round(CalculateBorderThickness(intervalPosFactor) / 2);
            int    topThickness    = (int)Math.Round(TopThicknessCurve.GetValue(intervalPosFactor) * bufferHt / 100);
            int    bottomThickness = (int)Math.Round(BottomThicknessCurve.GetValue(intervalPosFactor) * bufferHt / 100);
            int    leftThickness   = (int)Math.Round(LeftThicknessCurve.GetValue(intervalPosFactor) * bufferWi / 100);
            int    rightThickness  = (int)Math.Round(RightThicknessCurve.GetValue(intervalPosFactor) * bufferWi / 100);
            int    borderHeight    = (int)CalculateBorderHeight(intervalPosFactor) / 2;
            int    borderWidth     = (int)(CalculateBorderSize(intervalPosFactor) / 2);
            int    xOffsetAdj      = CalculateXOffset(intervalPosFactor) * (bufferWi - borderWidth) / 100;
            int    yOffsetAdj      = CalculateYOffset(intervalPosFactor) * (bufferHt - borderHeight) / 100;
            Color  color           = Color.GetColorAt(GetEffectTimeIntervalPosition(effectFrame));

            if (BorderMode == BorderMode.Simple)
            {
                thickness    = SimpleBorderWidth;
                borderWidth  = 0;
                borderHeight = 0;
            }
            else if (BorderType == BorderType.Single)
            {
                rightThickness  = thickness;
                topThickness    = thickness;
                leftThickness   = thickness;
                bottomThickness = thickness;
            }

            for (int x = 0; x < bufferWi; x++)
            {
                for (int y = 0; y < bufferHt; y++)
                {
                    CalculatePixel(x, y, frameBuffer, thickness, topThickness,
                                   bottomThickness, leftThickness, rightThickness, level, borderWidth, borderHeight, color, xOffsetAdj, yOffsetAdj, ref bufferHt, ref bufferWi);
                }
            }
        }
Пример #2
0
        protected override void RenderEffect(int effectFrame, IPixelFrameBuffer frameBuffer)
        {
            var intervalPos       = GetEffectTimeIntervalPosition(effectFrame);
            var intervalPosFactor = intervalPos * 100;

            double level           = LevelCurve.GetValue(intervalPosFactor) / 100;
            int    thickness       = (int)Math.Round(CalculateBorderThickness(intervalPosFactor) / 2);
            int    topThickness    = (int)Math.Round(TopThicknessCurve.GetValue(intervalPosFactor) * BufferHt / 100);
            int    bottomThickness = (int)Math.Round(BottomThicknessCurve.GetValue(intervalPosFactor) * BufferHt / 100);
            int    leftThickness   = (int)Math.Round(LeftThicknessCurve.GetValue(intervalPosFactor) * BufferWi / 100);
            int    rightThickness  = (int)Math.Round(RightThicknessCurve.GetValue(intervalPosFactor) * BufferWi / 100);
            int    borderWidth     = (int)Math.Round(CalculateBorderSize(intervalPosFactor) / 2);
            Color  color           = Color.GetColorAt(GetEffectTimeIntervalPosition(effectFrame));

            if (BorderMode == BorderMode.Simple)
            {
                thickness   = SimpleBorderWidth;
                borderWidth = 0;
            }
            else if (BorderType == BorderType.Single)
            {
                rightThickness  = thickness;
                topThickness    = thickness;
                leftThickness   = thickness;
                bottomThickness = thickness;
            }

            for (int x = 0; x < BufferWi; x++)
            {
                for (int y = 0; y < BufferHt; y++)
                {
                    CalculatePixel(x, y, frameBuffer, thickness, topThickness,
                                   bottomThickness, leftThickness, rightThickness,
                                   intervalPosFactor, level, effectFrame, borderWidth, color);
                }
            }
        }