Skip to main content

Interface ITextureReadbackProvider

Service that grants you to read instances of Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap.

Assembly: Dalamud.dll
View Source
Declaration
public interface ITextureReadbackProvider

Methods

GetRawImageAsync(IDalamudTextureWrap, TextureModificationArgs, bool, CancellationToken)

Gets the raw data of a texture wrap.

View Source
Declaration
Task<(RawImageSpecification Specification, byte[] RawData)> GetRawImageAsync(IDalamudTextureWrap wrap, TextureModificationArgs args = default, bool leaveWrapOpen = false, CancellationToken cancellationToken = default)
Returns

System.Threading.Tasks.Task<System.ValueTuple<Dalamud.Interface.Textures.RawImageSpecification,System.Byte[]>>: The raw data and its specifications.

Parameters
TypeNameDescription
Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrapwrapThe source texture wrap.
Dalamud.Interface.Textures.TextureModificationArgsargsThe texture modification arguments.
System.BooleanleaveWrapOpenWhether to leave <code class="paramref">wrap</code> non-disposed when the returned
`System.Threading.Tasks.Task%601` completes. |

| System.Threading.CancellationToken | cancellationToken | The cancellation token. |

GetSupportedImageEncoderInfos()

Gets the supported bitmap encoders.

View Source
Declaration
IEnumerable<IBitmapCodecInfo> GetSupportedImageEncoderInfos()
Returns

System.Collections.Generic.IEnumerable<Dalamud.Interface.Textures.IBitmapCodecInfo>: The supported bitmap encoders.### SaveToStreamAsync(IDalamudTextureWrap, Guid, Stream, IReadOnlyDictionary<string, object>?, bool, bool, CancellationToken) Saves a texture wrap to a stream in an image file format.

View Source
Declaration
Task SaveToStreamAsync(IDalamudTextureWrap wrap, Guid containerGuid, Stream stream, IReadOnlyDictionary<string, object>? props = null, bool leaveWrapOpen = false, bool leaveStreamOpen = false, CancellationToken cancellationToken = default)
Returns

System.Threading.Tasks.Task: A task representing the save process.

Parameters
TypeNameDescription
Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrapwrapThe texture wrap to save.
System.GuidcontainerGuidThe container GUID, obtained from Dalamud.Plugin.Services.ITextureReadbackProvider.GetSupportedImageEncoderInfos().
System.IO.StreamstreamThe stream to save to.
System.Collections.Generic.IReadOnlyDictionary<System.String,System.Object>propsProperties to pass to the encoder. See remarks for valid values.
System.BooleanleaveWrapOpenWhether to leave <code class="paramref">wrap</code> non-disposed when the returned
`System.Threading.Tasks.Task%601` completes. |

| System.Boolean | leaveStreamOpen | Whether to leave <code class="paramref">stream</code> open when the returned System.Threading.Tasks.Task%601 completes. | | System.Threading.CancellationToken | cancellationToken | The cancellation token. |

SaveToFileAsync(IDalamudTextureWrap, Guid, string, IReadOnlyDictionary<string, object>?, bool, CancellationToken)

Saves a texture wrap to a file as an image file.

View Source
Declaration
Task SaveToFileAsync(IDalamudTextureWrap wrap, Guid containerGuid, string path, IReadOnlyDictionary<string, object>? props = null, bool leaveWrapOpen = false, CancellationToken cancellationToken = default)
Returns

System.Threading.Tasks.Task: A task representing the save process.

Parameters
TypeNameDescription
Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrapwrapThe texture wrap to save.
System.GuidcontainerGuidThe container GUID, obtained from Dalamud.Plugin.Services.ITextureReadbackProvider.GetSupportedImageEncoderInfos().
System.StringpathThe target file path. The target file will be overwritten if it exist.
System.Collections.Generic.IReadOnlyDictionary<System.String,System.Object>propsProperties to pass to the encoder. See remarks for valid values.
System.BooleanleaveWrapOpenWhether to leave <code class="paramref">wrap</code> non-disposed when the returned
`System.Threading.Tasks.Task%601` completes. |

| System.Threading.CancellationToken | cancellationToken | The cancellation token. |