using System;
using Artemis.Core.Models.Profile;
using SkiaSharp;
namespace Artemis.Core.Plugins.LayerElement
{
public abstract class LayerElement : IDisposable
{
protected LayerElement(Layer layer, Guid guid, LayerElementSettings settings, LayerElementDescriptor descriptor)
{
Layer = layer;
Guid = guid;
Settings = settings;
Descriptor = descriptor;
}
public Layer Layer { get; }
public Guid Guid { get; }
public LayerElementSettings Settings { get; }
public LayerElementDescriptor Descriptor { get; }
public virtual void Dispose()
{
}
///
/// Called by the profile editor to populate the layer element properties panel
///
///
public abstract LayerElementViewModel GetViewModel();
///
/// Called before rendering every frame, write your update logic here
///
///
public virtual void Update(double deltaTime)
{
}
///
/// Allows you to perform rendering on the surface before any layer-clipping is applied
/// Called before rendering, in the order configured on the layer
///
///
/// The entire surface canvas
public virtual void RenderPreProcess(SKPath framePath, SKCanvas canvas)
{
}
///
/// The main method of rendering anything to the layer. The provided is specific to the layer
/// and matches it's width and height.
/// Called during rendering, in the order configured on the layer
///
///
/// The layer canvas
public virtual void Render(SKPath framePath, SKCanvas canvas)
{
}
///
/// Allows you to modify the used to draw the layer's on the
/// .
/// Called after rendering, in the order configured on the layer.
///
///
///
/// The bitmap created from the layer canvas
/// The current shader used to draw the bitmap on the surface canvas
/// The resulting shader used to draw the bitmap on the surface canvas
public virtual void RenderPostProcess(SKPath framePath, SKCanvas canvas)
{
}
}
}