protected override void RenderEffectByLocation(int numFrames, PixelLocationFrameBuffer frameBuffer) { var bufferWi = BufferWi; var bufferHt = BufferHt; for (int effectFrame = 0; effectFrame < numFrames; effectFrame++) { frameBuffer.CurrentFrame = effectFrame; var intervalPos = GetEffectTimeIntervalPosition(effectFrame); var intervalPosFactor = intervalPos * 100; double level = LevelCurve.GetValue(intervalPos); int thickness = (int)Math.Round(CalculateBorderThickness(intervalPosFactor) / 2); int topThickness = (int)(TopThicknessCurve.GetValue(intervalPosFactor) * bufferHt / 100); int bottomThickness = (int)(BottomThicknessCurve.GetValue(intervalPosFactor) * bufferHt / 100); int leftThickness = (int)(LeftThicknessCurve.GetValue(intervalPosFactor) * bufferWi / 100); int rightThickness = (int)(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; xOffsetAdj = 0; yOffsetAdj = 0; } else if (BorderType == BorderType.Single) { rightThickness = thickness; topThickness = thickness; leftThickness = thickness; bottomThickness = thickness; } foreach (var elementLocation in frameBuffer.ElementLocations) { CalculatePixel(elementLocation.X, elementLocation.Y, frameBuffer, thickness, topThickness, bottomThickness, leftThickness, rightThickness, level, borderWidth, borderHeight, color, xOffsetAdj, yOffsetAdj, ref bufferHt, ref bufferWi); } } }
protected override void RenderEffectByLocation(int numFrames, PixelLocationFrameBuffer frameBuffer) { var nodes = frameBuffer.ElementLocations.OrderBy(x => x.X).ThenBy(x => x.Y).GroupBy(x => x.X); for (int effectFrame = 0; effectFrame < numFrames; effectFrame++) { frameBuffer.CurrentFrame = effectFrame; var intervalPos = GetEffectTimeIntervalPosition(effectFrame); var intervalPosFactor = intervalPos * 100; double level = LevelCurve.GetValue(intervalPos); int thickness = (int)Math.Round(CalculateBorderThickness(intervalPosFactor) / 2); int topThickness = (int)(TopThicknessCurve.GetValue(intervalPosFactor) * BufferHt / 100); int bottomThickness = (int)(BottomThicknessCurve.GetValue(intervalPosFactor) * BufferHt / 100); int leftThickness = (int)(LeftThicknessCurve.GetValue(intervalPosFactor) * BufferWi / 100); int rightThickness = (int)(RightThicknessCurve.GetValue(intervalPosFactor) * BufferWi / 100); int borderWidth = (int)(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; } foreach (IGrouping <int, ElementLocation> elementLocations in nodes) { foreach (var elementLocation in elementLocations) { CalculatePixel(elementLocation.X, elementLocation.Y, frameBuffer, thickness, topThickness, bottomThickness, leftThickness, rightThickness, intervalPosFactor, level, effectFrame, borderWidth, color); } } } }
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); } } }
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); } } }