mirror of
https://codeberg.org/Ikatono/TierMaker.git
synced 2025-10-28 20:45:35 -05:00
18 lines
431 B
C#
18 lines
431 B
C#
using System.Text.Json.Serialization;
|
|
using Godot;
|
|
|
|
public class SerialImage
|
|
{
|
|
[JsonInclude]
|
|
public byte[] DataWebp { get; set; }
|
|
[JsonInclude]
|
|
[JsonConverter(typeof(JsonStringEnumConverter))]
|
|
public StretchMode StretchMode { get; set; }
|
|
public ImageWithMetadata ToImageWithMetadata()
|
|
{
|
|
var im = new Image();
|
|
im.LoadWebpFromBuffer(DataWebp);
|
|
return new(im, StretchMode);
|
|
}
|
|
}
|