ImageReadback<T> Class
Namespace: Stride.Rendering.ImagesAssembly: Stride.Rendering.dll
Allow readback a Texture from GPU to CPU with a frame delay count to avoid blocking read.
public class ImageReadback<T> : ImageEffect, IComponent, IReferencable, ICollectorHolder, IImageEffect, IGraphicsRenderer, IGraphicsRendererBase, IGraphicsRendererCore, IDisposable where T : struct
Type Parameters
Name | Description |
---|---|
T | Pixel struct that should match the input texture format |
Remarks
The input texture should be small enough to avoid CPU/GPU readback stalling
Name | Description | |
---|---|---|
Constructors | ||
ImageReadback() | Initializes a new instance of the ImageReadback<T> class. |
|
Properties | ||
ElapsedTime | Gets the elapsed time to query the result. |
|
ForceGetLatestBlocking | Gets or sets a value indicating whether [force get latest blocking]. |
|
FrameDelayCount | Gets or sets the number of frame to store before reading back. Default is |
|
IsResultAvailable | Gets a boolean indicating whether a result is available from Result. |
|
IsSlow | Gets a boolean indicating whether the readback is slow and may be stalling, indicating a FrameDelayCount to low or an input texture too large for an efficient non-blocking readback. |
|
Result | Gets the result pixels, only valid if IsResultAvailable |
|
Methods | ||
Destroy() | ||
DrawCore(RenderDrawContext) | ||
Reset() |
Constructors
ImageReadback()
Initializes a new instance of the ImageReadback<T> class.
public ImageReadback()
Properties
ElapsedTime
Gets the elapsed time to query the result.
public TimeSpan ElapsedTime { get; }
Property Value
Type | Description |
---|---|
System.TimeSpan | The elapsed time. |
ForceGetLatestBlocking
Gets or sets a value indicating whether [force get latest blocking].
public bool ForceGetLatestBlocking { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
FrameDelayCount
Gets or sets the number of frame to store before reading back. Default is 16
.
public int FrameDelayCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The frame delay count. |
IsResultAvailable
Gets a boolean indicating whether a result is available from Result.
public bool IsResultAvailable { get; }
Property Value
Type | Description |
---|---|
System.Boolean | A result available. |
IsSlow
Gets a boolean indicating whether the readback is slow and may be stalling, indicating a FrameDelayCount to low or an input texture too large for an efficient non-blocking readback.
public bool IsSlow { get; }
Property Value
Type | Description |
---|---|
System.Boolean | The readback is slow and stalling. |
Result
Gets the result pixels, only valid if IsResultAvailable
public T[] Result { get; }
Property Value
Type | Description |
---|---|
T[] | The result. |
Methods
Destroy()
protected override void Destroy()
Overrides
DrawCore(RenderDrawContext)
protected override void DrawCore(RenderDrawContext context)
Parameters
Type | Name | Description |
---|---|---|
RenderDrawContext | context |
Overrides
Reset()
public override void Reset()