mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-03 14:23:40 +01:00
Utility class and namespace
This commit is contained in:
parent
ff5502baa8
commit
16266f9636
14 changed files with 114 additions and 19 deletions
|
|
@ -5,9 +5,8 @@ using System.Diagnostics;
|
|||
using System.IO;
|
||||
using System.Threading;
|
||||
|
||||
using Dalamud.Data.LuminaExtensions;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Internal;
|
||||
using Dalamud.Utility;
|
||||
using ImGuiScene;
|
||||
using JetBrains.Annotations;
|
||||
using Lumina;
|
||||
|
|
|
|||
|
|
@ -1,32 +0,0 @@
|
|||
using ImGuiScene;
|
||||
using Lumina.Data.Files;
|
||||
|
||||
namespace Dalamud.Data.LuminaExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Extensions to <see cref="TexFile"/>.
|
||||
/// </summary>
|
||||
public static class TexFileExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the image data formatted for <see cref="RawDX11Scene.LoadImageRaw"/>.
|
||||
/// </summary>
|
||||
/// <param name="texFile">The TexFile to format.</param>
|
||||
/// <returns>The formatted image data.</returns>
|
||||
public static byte[] GetRgbaImageData(this TexFile texFile)
|
||||
{
|
||||
var imageData = texFile.ImageData;
|
||||
var dst = new byte[imageData.Length];
|
||||
|
||||
for (var i = 0; i < dst.Length; i += 4)
|
||||
{
|
||||
dst[i] = imageData[i + 2];
|
||||
dst[i + 1] = imageData[i + 1];
|
||||
dst[i + 2] = imageData[i];
|
||||
dst[i + 3] = imageData[i + 3];
|
||||
}
|
||||
|
||||
return dst;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue