Skip to main content

Interface ITextureProvider

Service that grants you access to textures you may render via ImGui.

Assembly: Dalamud.dll
View Source
Declaration
public interface ITextureProvider

Methods

CreateEmpty(RawImageSpecification, bool, bool, string?)

Creates an empty texture.

View Source
Declaration
IDalamudTextureWrap CreateEmpty(RawImageSpecification specs, bool cpuRead, bool cpuWrite, string? debugName = null)
Returns

Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap: A new empty texture.

Parameters
TypeNameDescription
Dalamud.Interface.Textures.RawImageSpecificationspecsTexture specifications.
System.BooleancpuReadWhether to support reading from CPU, while disabling reading from GPU.
System.BooleancpuWriteWhether to support writing from CPU, while disabling writing from GPU.
System.StringdebugNameName 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
Declaration
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
TypeNameDescription
Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrapwrapThe 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
Declaration
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
TypeNameDescription
Dalamud.Interface.Textures.ImGuiViewportTextureArgsargsThe arguments for creating a texture.
System.StringdebugNameName for debug display purposes.
System.Threading.CancellationTokencancellationTokenThe 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
Declaration
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
TypeNameDescription
System.ReadOnlyMemory<System.Byte>bytesThe bytes to load.
System.StringdebugNameName for debug display purposes.
System.Threading.CancellationTokencancellationTokenThe 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
Declaration
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
TypeNameDescription
System.IO.StreamstreamThe stream to load data from.
System.BooleanleaveOpenWhether to leave the stream open once the task completes, sucessfully or not.
System.StringdebugNameName for debug display purposes.
System.Threading.CancellationTokencancellationTokenThe cancellation token.

CreateFromRaw(RawImageSpecification, ReadOnlySpan<byte>, string?)

Gets a texture from the given bytes, interpreting it as a raw bitmap.

View Source
Declaration
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
TypeNameDescription
Dalamud.Interface.Textures.RawImageSpecificationspecsThe specifications for the raw bitmap.
System.ReadOnlySpan<System.Byte>bytesThe bytes to load.
System.StringdebugNameName 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
Declaration
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
TypeNameDescription
Dalamud.Interface.Textures.RawImageSpecificationspecsThe specifications for the raw bitmap.
System.ReadOnlyMemory<System.Byte>bytesThe bytes to load.
System.StringdebugNameName for debug display purposes.
System.Threading.CancellationTokencancellationTokenThe 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
Declaration
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
TypeNameDescription
Dalamud.Interface.Textures.RawImageSpecificationspecsThe specifications for the raw bitmap.
System.IO.StreamstreamThe stream to load data from.
System.BooleanleaveOpenWhether to leave the stream open once the task completes, sucessfully or not.
System.StringdebugNameName for debug display purposes.
System.Threading.CancellationTokencancellationTokenThe 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
Declaration
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
TypeNameDescription
Lumina.Data.Files.TexFilefileThe texture to obtain a handle to.

CreateFromTexFileAsync(TexFile, string?, CancellationToken)

Get a texture handle for the specified Lumina Lumina.Data.Files.TexFile.

View Source
Declaration
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
TypeNameDescription
Lumina.Data.Files.TexFilefileThe texture to obtain a handle to.
System.StringdebugNameName for debug display purposes.
System.Threading.CancellationTokencancellationTokenThe cancellation token.

GetSupportedImageDecoderInfos()

Gets the supported bitmap decoders.

View Source
Declaration
IEnumerable<IBitmapCodecInfo> GetSupportedImageDecoderInfos()
Returns

System.Collections.Generic.IEnumerable<Dalamud.Interface.Textures.IBitmapCodecInfo>: The supported bitmap decoders.### GetFromGameIcon(in GameIconLookup) Gets a shared texture corresponding to the given game resource icon specifier.

View Source
Declaration
ISharedImmediateTexture GetFromGameIcon(in GameIconLookup lookup)
Returns

Dalamud.Interface.Textures.ISharedImmediateTexture: The shared texture that you may use to obtain the loaded texture wrap and load states.

Parameters
TypeNameDescription
Dalamud.Interface.Textures.GameIconLookuplookupA game icon specifier.

TryGetFromGameIcon(in GameIconLookup, out ISharedImmediateTexture?)

Gets a shared texture corresponding to the given game resource icon specifier.

View Source
Declaration
bool TryGetFromGameIcon(in GameIconLookup lookup, out ISharedImmediateTexture? texture)
Returns

System.Boolean: Whether or not the lookup succeeded.

Parameters
TypeNameDescription
Dalamud.Interface.Textures.GameIconLookuplookupA game icon specifier.
Dalamud.Interface.Textures.ISharedImmediateTexturetextureThe resulting Dalamud.Interface.Textures.ISharedImmediateTexture.

GetFromGame(string)

Gets a shared texture corresponding to the given path to a game resource.

View Source
Declaration
ISharedImmediateTexture GetFromGame(string path)
Returns

Dalamud.Interface.Textures.ISharedImmediateTexture: The shared texture that you may use to obtain the loaded texture wrap and load states.

Parameters
TypeNameDescription
System.StringpathA path to a game resource.

GetFromFile(string)

Gets a shared texture corresponding to the given file on the filesystem.

View Source
Declaration
ISharedImmediateTexture GetFromFile(string path)
Returns

Dalamud.Interface.Textures.ISharedImmediateTexture: The shared texture that you may use to obtain the loaded texture wrap and load states.

Parameters
TypeNameDescription
System.StringpathA path to a file on the filesystem.

GetFromFile(FileInfo)

Gets a shared texture corresponding to the given file on the filesystem.

View Source
Declaration
ISharedImmediateTexture GetFromFile(FileInfo file)
Returns

Dalamud.Interface.Textures.ISharedImmediateTexture: The shared texture that you may use to obtain the loaded texture wrap and load states.

Parameters
TypeNameDescription
System.IO.FileInfofileThe file on the filesystem to load.

GetFromFileAbsolute(string)

Gets a shared texture corresponding to the given file on the filesystem.

View Source
Declaration
ISharedImmediateTexture GetFromFileAbsolute(string fullPath)
Returns

Dalamud.Interface.Textures.ISharedImmediateTexture: The shared texture that you may use to obtain the loaded texture wrap and load states.

Parameters
TypeNameDescription
System.StringfullPathThe file on the filesystem to load. Requires a full path.

GetFromManifestResource(Assembly, string)

Gets a shared texture corresponding to the given file of the assembly manifest resources.

View Source
Declaration
ISharedImmediateTexture GetFromManifestResource(Assembly assembly, string name)
Returns

Dalamud.Interface.Textures.ISharedImmediateTexture: The shared texture that you may use to obtain the loaded texture wrap and load states.

Parameters
TypeNameDescription
System.Reflection.AssemblyassemblyThe assembly containing manifest resources.
System.StringnameThe case-sensitive name of the manifest resource being requested.

GetIconPath(in GameIconLookup)

Get a path for a specific icon's .tex file.

View Source
Declaration
string GetIconPath(in GameIconLookup lookup)
Returns

System.String: The path to the icon.

Parameters
TypeNameDescription
Dalamud.Interface.Textures.GameIconLookuplookupThe icon lookup.
Exceptions

System.IO.FileNotFoundException
If a corresponding file could not be found.

TryGetIconPath(in GameIconLookup, out string?)

Gets the path of an icon.

View Source
Declaration
bool TryGetIconPath(in GameIconLookup lookup, out string? path)
Returns

System.Boolean: true if the corresponding file exists and <code class="paramref">path</code> has been set.

Parameters
TypeNameDescription
Dalamud.Interface.Textures.GameIconLookuplookupThe icon lookup.
System.StringpathThe resolved path.

IsDxgiFormatSupported(int)

Determines whether the system supports the given DXGI format. For use with Dalamud.Interface.Textures.RawImageSpecification.DxgiFormat.

View Source
Declaration
bool IsDxgiFormatSupported(int dxgiFormat)
Returns

System.Boolean: true if supported.

Parameters
TypeNameDescription
System.Int32dxgiFormatThe DXGI format.

IsDxgiFormatSupportedForCreateFromExistingTextureAsync(int)

Determines whether the system supports the given DXGI format for use with Dalamud.Plugin.Services.ITextureProvider.CreateFromExistingTextureAsync(Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap%2cDalamud.Interface.Textures.TextureModificationArgs%2cSystem.Boolean%2cSystem.String%2cSystem.Threading.CancellationToken).

View Source
Declaration
bool IsDxgiFormatSupportedForCreateFromExistingTextureAsync(int dxgiFormat)
Returns

System.Boolean: true if supported.

Parameters
TypeNameDescription
System.Int32dxgiFormatThe DXGI format.