expose imguiscene method to load textures from raw pixel data; underlying handling may change, but UIBuilder api can probably remain this way

This commit is contained in:
meli 2020-04-03 16:42:20 -07:00
parent c9d7846d4c
commit a80218d741
3 changed files with 25 additions and 1 deletions

View file

@ -58,6 +58,17 @@ namespace Dalamud.Interface
public TextureWrap LoadImage(byte[] imageData) =>
this.interfaceManager.LoadImage(imageData);
/// <summary>
/// Loads an image from raw unformatted pixel data, with no type or header information. To load formatted data, use <see cref="LoadImage(byte[])"/>.
/// </summary>
/// <param name="imageData">A byte array containing the raw pixel data.</param>
/// <param name="width">The width of the image contained in <paramref name="imageData"/>.</param>
/// <param name="height">The height of the image contained in <paramref name="imageData"/>.</param>
/// <param name="numChannels">The number of channels (bytes per pixel) of the image contained in <paramref name="imageData"/>. This should usually be 4.</param>
/// <returns>A <see cref="TextureWrap"/> object wrapping the created image. Use <see cref="TextureWrap.ImGuiHandle"/> inside ImGui.Image()</returns>
public TextureWrap LoadImageRaw(byte[] imageData, int width, int height, int numChannels) =>
this.interfaceManager.LoadImageRaw(imageData, width, height, numChannels);
/// <summary>
/// Event that is fired when the plugin should open its configuration interface.
/// </summary>