daily update on 20240613 by nitload youmu[4

This commit is contained in:
Nitload
2024-06-14 05:30:19 +08:00
parent be6c2e6b92
commit 7fb220c523
50 changed files with 991 additions and 700 deletions
+29 -20
View File
@@ -45,6 +45,7 @@ namespace StgSharp.Graphics
{
public class Image : ISSDSerializable, IImageProvider
{
internal byte[] data;
internal ImageInfo info;
@@ -55,27 +56,40 @@ namespace StgSharp.Graphics
//int length = info.width * info.height * info.channel;
}
public ref byte[] DataStream
{
get => ref data;
}
public unsafe Image()
{
info = new ImageInfo();
}
public ImageChannel Channel => info.Channel;
public int ChannelCount => info.ChannelCount;
public int Height => info.Height;
public ref byte[] DataStream
{
get => ref data;
}
public (int width, int height) Size
{
get => (info.Width, info.Height);
}
public ImageChannel Channel => info.Channel;
public int ChannelCount => info.ChannelCount;
public int Height
{
get => info.Height;
internal set => info.Height = value;
}
public int Width
{
get => info.Width;
internal set => info.Width = value;
}
public SerializableTypeCode SSDTypeCode => SerializableTypeCode.PixelImage;
public int Width => info.Width;
public void FromBytes(byte[] stream)
{
}
public static unsafe Image FromFile(string route, ImageLoader loader)
{
@@ -139,11 +153,6 @@ namespace StgSharp.Graphics
return data;
}
public void FromBytes(byte[] stream)
{
}
public Image ProvideImage()
{
throw new NotImplementedException();
@@ -219,12 +228,6 @@ namespace StgSharp.Graphics
set => height = value;
}
public IntPtr StreamPtr
{
get => pixelPtr;
internal set => pixelPtr = value;
}
public int StreamSize
{
get => width * height * channelCount;
@@ -236,6 +239,12 @@ namespace StgSharp.Graphics
set => width = value;
}
public IntPtr StreamPtr
{
get => pixelPtr;
internal set => pixelPtr = value;
}
public override string ToString()
{
return $"{channel}\t{width}\t{height}\t{(ulong)StreamPtr}";