Profiles - Reworked render pipeline

Profiles - Added two transform modes, normal and clip
Intro animation - Disable with debugger attached
Profile editor - Added layer copy
This commit is contained in:
SpoinkyNL committed 2020-11-08 17:28:22 +01:00
1 parent d37c70371c
commit 427d3d2521
21 files changed
+394 -389

No files matched your search

@@ -107,7 +107,7 @@ namespace Artemis.Core.LayerBrushes
// but LayerBrush<T> and RgbNetLayerBrush<T> outside the core
internal abstract void Initialize();
internal abstract void InternalRender(SKCanvas canvas, SKImageInfo canvasInfo, SKPath path, SKPaint paint);
internal abstract void InternalRender(SKCanvas canvas, SKPath path, SKPaint paint);
internal virtual void Dispose(bool disposing)
{
@@ -22,14 +22,13 @@ namespace Artemis.Core.LayerBrushes
/// <para>Called during rendering or layer preview, in the order configured on the layer</para>
/// </summary>
/// <param name="canvas">The layer canvas</param>
/// <param name="canvasInfo"></param>
/// <param name="path">The path to be filled, represents the shape</param>
/// <param name="paint">The paint to be used to fill the shape</param>
public abstract void Render(SKCanvas canvas, SKImageInfo canvasInfo, SKPath path, SKPaint paint);
public abstract void Render(SKCanvas canvas, SKPath path, SKPaint paint);
internal override void InternalRender(SKCanvas canvas, SKImageInfo canvasInfo, SKPath path, SKPaint paint)
internal override void InternalRender(SKCanvas canvas, SKPath path, SKPaint paint)
{
Render(canvas, canvasInfo, path, paint);
Render(canvas, path, paint);
}
internal override void Initialize()
@@ -28,18 +28,11 @@ namespace Artemis.Core.LayerBrushes
/// <returns>The color the LED will receive</returns>
public abstract SKColor GetColor(ArtemisLed led, SKPoint renderPoint);
internal override void InternalRender(SKCanvas canvas, SKImageInfo canvasInfo, SKPath path, SKPaint paint)
internal override void InternalRender(SKCanvas canvas, SKPath path, SKPaint paint)
{
// We don't want translations on this canvas because that'll displace the LEDs, translations are applied to the points of each LED instead
Layer.ExcludeCanvasFromTranslation(canvas, true);
if (Layer.General.ResizeMode == LayerResizeMode.Normal)
{
// Apply a translated version of the shape as the clipping mask
SKPath shapePath = new SKPath(Layer.LayerShape.Path);
Layer.IncludePathInTranslation(shapePath, true);
canvas.ClipPath(shapePath);
}
// We don't want rotation on this canvas because that'll displace the LEDs, translations are applied to the points of each LED instead
if (Layer.General.TransformMode.CurrentValue == LayerTransformMode.Normal && SupportsTransformation)
canvas.SetMatrix(canvas.TotalMatrix.PreConcat(Layer.GetTransformMatrix(true, false, false, true).Invert()));
using SKPath pointsPath = new SKPath();
using SKPaint ledPaint = new SKPaint();
@@ -52,7 +45,10 @@ namespace Artemis.Core.LayerBrushes
});
}
Layer.ExcludePathFromTranslation(pointsPath, true);
// Apply the translation to the points of each LED instead
if (Layer.General.TransformMode.CurrentValue == LayerTransformMode.Normal && SupportsTransformation)
pointsPath.Transform(Layer.GetTransformMatrix(true, true, true, true).Invert());
SKPoint[] points = pointsPath.Points;
for (int index = 0; index < Layer.Leds.Count; index++)
{
@@ -68,7 +68,7 @@ namespace Artemis.Core.LayerBrushes
}
// Not used in this effect type
internal override void InternalRender(SKCanvas canvas, SKImageInfo canvasInfo, SKPath path, SKPaint paint)
internal override void InternalRender(SKCanvas canvas, SKPath path, SKPaint paint)
{
throw new NotImplementedException("RGB.NET layer effectes do not implement InternalRender");
}