1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00
Artemis/src/Artemis.Core/RGB.NET/SKTextureBrush.cs
Robert f6090dc296 Code style - Use file scoped namespaces
Code style - Ran code cleanup
2022-08-21 11:36:15 +02:00

44 lines
964 B
C#

using RGB.NET.Core;
namespace Artemis.Core;
internal class SKTextureBrush : AbstractBrush
{
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="TextureBrush" /> class.
/// </summary>
/// <param name="texture">The texture drawn by this brush.</param>
public SKTextureBrush(SKTexture? texture)
{
Texture = texture;
}
#endregion
#region Methods
/// <inheritdoc />
protected override Color GetColorAtPoint(in Rectangle rectangle, in RenderTarget renderTarget)
{
return Texture?.GetColorAtRenderTarget(renderTarget) ?? Color.Transparent;
}
#endregion
#region Properties & Fields
private SKTexture? _texture;
/// <summary>
/// Gets or sets the texture drawn by this brush.
/// </summary>
public SKTexture? Texture
{
get => _texture;
set => SetProperty(ref _texture, value);
}
#endregion
}