Interface ITextureReadbackProvider
Service that grants you to read instances of Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap.
Assembly: Dalamud.dll
View Source
public interface ITextureReadbackProvider
Methods
GetRawImageAsync(IDalamudTextureWrap, TextureModificationArgs, bool, CancellationToken)
Gets the raw data of a texture wrap.
View Source
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
Type | Name | Description |
---|---|---|
Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap | wrap | The source texture wrap. |
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.Threading.CancellationToken
| cancellationToken | The cancellation token. |
GetSupportedImageEncoderInfos()
Gets the supported bitmap encoders.
View Source
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
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
Type | Name | Description |
---|---|---|
Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap | wrap | The texture wrap to save. |
System.Guid | containerGuid | The container GUID, obtained from Dalamud.Plugin.Services.ITextureReadbackProvider.GetSupportedImageEncoderInfos(). |
System.IO.Stream | stream | The stream to save to. |
System.Collections.Generic.IReadOnlyDictionary<System.String,System.Object> | props | Properties to pass to the encoder. See remarks for valid values. |
System.Boolean | leaveWrapOpen | Whether 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
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
Type | Name | Description |
---|---|---|
Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap | wrap | The texture wrap to save. |
System.Guid | containerGuid | The container GUID, obtained from Dalamud.Plugin.Services.ITextureReadbackProvider.GetSupportedImageEncoderInfos(). |
System.String | path | The target file path. The target file will be overwritten if it exist. |
System.Collections.Generic.IReadOnlyDictionary<System.String,System.Object> | props | Properties to pass to the encoder. See remarks for valid values. |
System.Boolean | leaveWrapOpen | Whether 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. |