cleanup ImageUtils

what_if_no_video_threads
cosmonaut 2024-03-05 22:50:53 -08:00
parent 33ed8b2364
commit a004488f81
1 changed files with 0 additions and 45 deletions

View File

@ -145,51 +145,6 @@ namespace MoonWorks.Graphics
Refresh.Refresh_Image_Free(pixels); Refresh.Refresh_Image_Free(pixels);
} }
/// <summary>
/// Decodes image data into a TransferBuffer to prepare for image upload.
/// </summary>
public static unsafe uint DecodeIntoTransferBuffer(
Span<byte> data,
TransferBuffer transferBuffer,
uint bufferOffsetInBytes,
TransferOptions option
) {
var pixelData = GetPixelDataFromBytes(data, out var w, out var h, out var sizeInBytes);
var length = transferBuffer.SetData(new Span<byte>((void*) pixelData, (int) sizeInBytes), bufferOffsetInBytes, option);
FreePixelData(pixelData);
return length;
}
/// <summary>
/// Decodes an image stream into a TransferBuffer to prepare for image upload.
/// </summary>
public static unsafe uint DecodeIntoTransferBuffer(
Stream stream,
TransferBuffer transferBuffer,
uint bufferOffsetInBytes,
TransferOptions option
) {
var pixelData = GetPixelDataFromStream(stream, out var w, out var h, out var sizeInBytes);
var length = transferBuffer.SetData(new Span<byte>((void*) pixelData, (int) sizeInBytes), bufferOffsetInBytes, option);
FreePixelData(pixelData);
return length;
}
/// <summary>
/// Decodes an image file into a TransferBuffer to prepare for image upload.
/// </summary>
public static unsafe uint DecodeIntoTransferBuffer(
string path,
TransferBuffer transferBuffer,
uint bufferOffsetInBytes,
TransferOptions option
) {
var pixelData = GetPixelDataFromFile(path, out var w, out var h, out var sizeInBytes);
var length = transferBuffer.SetData(new Span<byte>((void*) pixelData, (int) sizeInBytes), bufferOffsetInBytes, option);
FreePixelData(pixelData);
return length;
}
/// <summary> /// <summary>
/// Saves pixel data contained in a TransferBuffer to a PNG file. /// Saves pixel data contained in a TransferBuffer to a PNG file.
/// </summary> /// </summary>