using ExampleWorld.wit.imports.lyra.api; namespace LyraApi.Asset; public class ImageHandle(IAsset.ImageHandle handle) : IAssetHandle { internal IAsset.ImageHandle inner = handle; public uint? Height => inner.Height(); public uint? Width => inner.Width(); public static object? FromRawHandle(UntypedHandle untypedHandle) { var handle = IAsset.ImageHandle.FromRawHandle(untypedHandle.inner); return handle != null ? new ImageHandle(handle) : null; } /// /// Get the image's pixels as native endian bytes. /// /// /// Keep in mind that this does copy the image's pixels from the host. /// This is pretty slow. public byte[]? GetImageBytes() { return inner.GetBytes(); } }