Interface ITextureProvider
Service that grants you access to textures you may render via ImGui.
Assembly: Dalamud.dll
View Source
public interface ITextureProvider
Methods
CreateEmpty(RawImageSpecification, bool, bool, string?)
Creates an empty texture.
View Source
IDalamudTextureWrap CreateEmpty(RawImageSpecification specs, bool cpuRead, bool cpuWrite, string? debugName = null)
Returns
Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap: A new empty texture.
Parameters
Type | Name | Description |
---|---|---|
Dalamud.Interface.Textures.RawImageSpecification | specs | Texture specifications. |
System.Boolean | cpuRead | Whether to support reading from CPU, while disabling reading from GPU. |
System.Boolean | cpuWrite | Whether to support writing from CPU, while disabling writing from GPU. |
System.String | debugName | Name for debug display purposes. |
CreateDrawListTexture(string?)
Creates a texture that can be drawn from an Dalamud.Bindings.ImGui.ImDrawList
or an Dalamud.Bindings.ImGui.ImDrawData
.
View Source
IDrawListTextureWrap CreateDrawListTexture(string? debugName = null)
Returns
Dalamud.Interface.Textures.TextureWraps.IDrawListTextureWrap: A new draw list texture.
Parameters
Type | Name | Description |
---|---|---|
System.String | debugName | Name for debug display purposes. |
CreateFromExistingTextureAsync(IDalamudTextureWrap, TextureModificationArgs, bool, string?, CancellationToken)
Creates a texture from the given existing texture, cropping and converting pixel format as needed.
View Source
Task<IDalamudTextureWrap> CreateFromExistingTextureAsync(IDalamudTextureWrap wrap, TextureModificationArgs args = default, bool leaveWrapOpen = false, string? debugName = null, CancellationToken cancellationToken = default)
Returns
System.Threading.Tasks.Task<Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap>
: A System.Threading.Tasks.Task%601
containing the copied texture on success. Dispose after use.
Parameters
Type | Name | Description |
---|---|---|
Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap | wrap | The source texture wrap. The passed value may be disposed once this function returns, |
without having to wait for the completion of the returned `System.Threading.Tasks.Task%601`. |
| Dalamud.Interface.Textures.TextureModificationArgs | args | The texture modification arguments. |
| System.Boolean
| leaveWrapOpen | Whether to leave <code class="paramref">wrap</code> non-disposed when the returned
System.Threading.Tasks.Task%601
completes. |
| System.String
| debugName | Name for debug display purposes. |
| System.Threading.CancellationToken
| cancellationToken | The cancellation token. |
CreateFromImGuiViewportAsync(ImGuiViewportTextureArgs, string?, CancellationToken)
Creates a texture from an ImGui viewport.
View Source
Task<IDalamudTextureWrap> CreateFromImGuiViewportAsync(ImGuiViewportTextureArgs args, string? debugName = null, CancellationToken cancellationToken = default)
Returns
System.Threading.Tasks.Task<Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap>
: A System.Threading.Tasks.Task%601
containing the copied texture on success. Dispose after use.
Parameters
Type | Name | Description |
---|---|---|
Dalamud.Interface.Textures.ImGuiViewportTextureArgs | args | The arguments for creating a texture. |
System.String | debugName | Name for debug display purposes. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
CreateFromImageAsync(ReadOnlyMemory<byte>, string?, CancellationToken)
Gets a texture from the given bytes, trying to interpret it as a .tex file or other well-known image files, such as .png.
View Source
Task<IDalamudTextureWrap> CreateFromImageAsync(ReadOnlyMemory<byte> bytes, string? debugName = null, CancellationToken cancellationToken = default)
Returns
System.Threading.Tasks.Task<Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap>
: A System.Threading.Tasks.Task%601
containing the loaded texture on success. Dispose after use.
Parameters
Type | Name | Description |
---|---|---|
System.ReadOnlyMemory<System.Byte> | bytes | The bytes to load. |
System.String | debugName | Name for debug display purposes. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
CreateFromImageAsync(Stream, bool, string?, CancellationToken)
Gets a texture from the given stream, trying to interpret it as a .tex file or other well-known image files, such as .png.
View Source
Task<IDalamudTextureWrap> CreateFromImageAsync(Stream stream, bool leaveOpen = false, string? debugName = null, CancellationToken cancellationToken = default)
Returns
System.Threading.Tasks.Task<Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap>
: A System.Threading.Tasks.Task%601
containing the loaded texture on success. Dispose after use.
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream to load data from. |
System.Boolean | leaveOpen | Whether to leave the stream open once the task completes, sucessfully or not. |
System.String | debugName | Name for debug display purposes. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
CreateFromRaw(RawImageSpecification, ReadOnlySpan<byte>, string?)
Gets a texture from the given bytes, interpreting it as a raw bitmap.
View Source
IDalamudTextureWrap CreateFromRaw(RawImageSpecification specs, ReadOnlySpan<byte> bytes, string? debugName = null)
Returns
Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap: The texture loaded from the supplied raw bitmap. Dispose after use.
Parameters
Type | Name | Description |
---|---|---|
Dalamud.Interface.Textures.RawImageSpecification | specs | The specifications for the raw bitmap. |
System.ReadOnlySpan<System.Byte> | bytes | The bytes to load. |
System.String | debugName | Name for debug display purposes. |
CreateFromRawAsync(RawImageSpecification, ReadOnlyMemory<byte>, string?, CancellationToken)
Gets a texture from the given bytes, interpreting it as a raw bitmap.
View Source
Task<IDalamudTextureWrap> CreateFromRawAsync(RawImageSpecification specs, ReadOnlyMemory<byte> bytes, string? debugName = null, CancellationToken cancellationToken = default)
Returns
System.Threading.Tasks.Task<Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap>
: A System.Threading.Tasks.Task%601
containing the loaded texture on success. Dispose after use.
Parameters
Type | Name | Description |
---|---|---|
Dalamud.Interface.Textures.RawImageSpecification | specs | The specifications for the raw bitmap. |
System.ReadOnlyMemory<System.Byte> | bytes | The bytes to load. |
System.String | debugName | Name for debug display purposes. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
CreateFromRawAsync(RawImageSpecification, Stream, bool, string?, CancellationToken)
Gets a texture from the given stream, interpreting the read data as a raw bitmap.
View Source
Task<IDalamudTextureWrap> CreateFromRawAsync(RawImageSpecification specs, Stream stream, bool leaveOpen = false, string? debugName = null, CancellationToken cancellationToken = default)
Returns
System.Threading.Tasks.Task<Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap>
: A System.Threading.Tasks.Task%601
containing the loaded texture on success. Dispose after use.
Parameters
Type | Name | Description |
---|---|---|
Dalamud.Interface.Textures.RawImageSpecification | specs | The specifications for the raw bitmap. |
System.IO.Stream | stream | The stream to load data from. |
System.Boolean | leaveOpen | Whether to leave the stream open once the task completes, sucessfully or not. |
System.String | debugName | Name for debug display purposes. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
CreateFromTexFile(TexFile)
Get a texture handle for the specified Lumina Lumina.Data.Files.TexFile
.
Alias for fetching System.Threading.Tasks.Task%601.Result
from Dalamud.Plugin.Services.ITextureProvider.CreateFromTexFileAsync(Lumina.Data.Files.TexFile%2cSystem.String%2cSystem.Threading.CancellationToken)
.
View Source
IDalamudTextureWrap CreateFromTexFile(TexFile file)
Returns
Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap: A texture wrap that can be used to render the texture. Dispose after use.
Parameters
Type | Name | Description |
---|---|---|
Lumina.Data.Files.TexFile | file | The texture to obtain a handle to. |
CreateFromTexFileAsync(TexFile, string?, CancellationToken)
Get a texture handle for the specified Lumina Lumina.Data.Files.TexFile
.
View Source
Task<IDalamudTextureWrap> CreateFromTexFileAsync(TexFile file, string? debugName = null, CancellationToken cancellationToken = default)
Returns
System.Threading.Tasks.Task<Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap>
: A texture wrap that can be used to render the texture. Dispose after use.
Parameters
Type | Name | Description |
---|---|---|
Lumina.Data.Files.TexFile | file | The texture to obtain a handle to. |
System.String | debugName | Name for debug display purposes. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
CreateFromClipboardAsync(string?, CancellationToken)
Creates a texture from clipboard.
View Source
Task<IDalamudTextureWrap> CreateFromClipboardAsync(string? debugName = null, CancellationToken cancellationToken = default)
Returns
System.Threading.Tasks.Task<Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap>
: A System.Threading.Tasks.Task
representing the status of the operation.
Parameters
Type | Name | Description |
---|---|---|
System.String | debugName | Name for debug display purposes. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
GetSupportedImageDecoderInfos()
Gets the supported bitmap decoders.
View Source
IEnumerable<IBitmapCodecInfo> GetSupportedImageDecoderInfos()
Returns
System.Collections.Generic.IEnumerable<Dalamud.Interface.Textures.IBitmapCodecInfo>
: The supported bitmap decoders.