From 8d31a398ab6247bb4577b6677dcb237cb65bff9a Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Thu, 6 Jun 2024 11:14:10 -0700 Subject: [PATCH] ImageUtils returns byte pointers --- src/Graphics/ImageUtils.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Graphics/ImageUtils.cs b/src/Graphics/ImageUtils.cs index 012bb56..70bd4cf 100644 --- a/src/Graphics/ImageUtils.cs +++ b/src/Graphics/ImageUtils.cs @@ -12,7 +12,7 @@ namespace MoonWorks.Graphics /// /// The returned pointer must be freed by calling FreePixelData. /// - public static unsafe IntPtr GetPixelDataFromBytes( + public static unsafe byte* GetPixelDataFromBytes( Span data, out uint width, out uint height, @@ -33,7 +33,7 @@ namespace MoonWorks.Graphics height = (uint) h; sizeInBytes = (uint) len; - return (nint) pixelData; + return pixelData; } } @@ -42,7 +42,7 @@ namespace MoonWorks.Graphics /// /// The returned pointer must be freed by calling FreePixelData. /// - public static unsafe IntPtr GetPixelDataFromStream( + public static unsafe byte* GetPixelDataFromStream( Stream stream, out uint width, out uint height, @@ -65,7 +65,7 @@ namespace MoonWorks.Graphics /// /// The returned pointer must be freed by calling FreePixelData. /// - public static IntPtr GetPixelDataFromFile( + public static unsafe byte* GetPixelDataFromFile( string path, out uint width, out uint height, @@ -140,9 +140,9 @@ namespace MoonWorks.Graphics /// /// Frees pixel data obtained from GetPixelData methods. /// - public unsafe static void FreePixelData(IntPtr pixels) + public unsafe static void FreePixelData(byte* pixels) { - Refresh.Refresh_Image_Free((byte*) pixels); + Refresh.Refresh_Image_Free(pixels); } ///