MVVM frame work done, under unit test

This commit is contained in:
Nitload
2024-07-25 04:41:24 +08:00
parent 924fe6eef7
commit da75200347
101 changed files with 8435 additions and 847 deletions
@@ -0,0 +1,42 @@
using StgSharp.Math;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;
namespace StgSharp.Graphics
{
public class TextureProvider : IImageProvider
{
private Image _tex;
private vec2d[] _texCoord;
public Span<vec2d> TextureCoordinate
{
get => new Span<vec2d>(_texCoord);
}
public Image ProvideImage()
{
return _tex;
}
public TextureProvider(Image image, vec2d[] coord)
{
_tex = image;
_texCoord = coord;
}
public ref vec2d this[int index]
{
get => ref _texCoord[index];
}
public void ReadImage(IImageProvider provider)
{
_tex = provider.ProvideImage();
}
}
}