Public Member Functions | |
FNVTextureRenderTargetReader (UTextureRenderTarget2D *InRenderTarget=nullptr) | |
const UTextureRenderTarget2D * | GetTextureRenderTarget () const |
virtual bool | ReadPixelsData (FNVTexturePixelData &OutPixelData) final |
Read back the pixels data from the current source texture NOTE: This function is sync, the pixels data is returned right away but it may cause the game to hitches since it flush the rendering commands. More... | |
virtual bool | ReadPixelsData (OnFinishedReadingPixelsDataCallback Callback, bool bIgnoreAlpha=false) final |
Read back the pixels data from the current source texture. More... | |
void | SetTextureRenderTarget (UTextureRenderTarget2D *NewRenderTarget) |
![]() | |
FNVTextureReader & | operator= (const FNVTextureReader &OtherReader) |
Protected Member Functions | |
void | UpdateTextureFromRenderTarget () |
![]() | |
bool | ReadPixelsData (OnFinishedReadingPixelsDataCallback Callback, const FTexture2DRHIRef &NewSourceTexture, const FIntRect &NewSourceRect=FIntRect(), EPixelFormat NewReadbackPixelFormat=EPixelFormat::PF_Unknown, const FIntPoint &NewReadbackSize=FIntPoint::ZeroValue, bool bIgnoreAlpha=false) |
Read back the pixels data from the current source texture. More... | |
bool | ReadPixelsData (FNVTexturePixelData &OutPixelsData, const FTexture2DRHIRef &NewSourceTexture, const FIntRect &NewSourceRect=FIntRect(), EPixelFormat NewReadbackPixelFormat=EPixelFormat::PF_Unknown, const FIntPoint &NewReadbackSize=FIntPoint::ZeroValue) |
Read back the pixels data from the current source texture NOTE: This function is sync, the pixels data is returned right away but it may cause the game to hitches since it flush the rendering commands. More... | |
void | SetSourceTexture (FTexture2DRHIRef NewSourceTexture, const FIntRect &NewSourceRect=FIntRect(), EPixelFormat NewReadbackPixelFormat=EPixelFormat::PF_Unknown, const FIntPoint &NewReadbackSize=FIntPoint::ZeroValue) |
Change the information of the texture to read from. More... | |
Protected Attributes | |
UTextureRenderTarget2D * | SourceRenderTarget |
![]() | |
EPixelFormat | ReadbackPixelFormat |
FIntPoint | ReadbackSize |
FIntRect | SourceRect |
FTexture2DRHIRef | SourceTexture |
Additional Inherited Members | |
![]() | |
typedef TFunction< void(const FNVTexturePixelData &)> | OnFinishedReadingPixelsDataCallback |
Callback function get called after finish reading pixels data FNVTexturePixelData - The struct contain the texture's pixels data. More... | |
typedef TFunction< void(uint8 *, EPixelFormat, FIntPoint)> | OnFinishedReadingRawPixelsCallback |
Callback function get called after finish reading pixels data uint8* - pointer to pixel array buffer EPixelFormat - format of the read back pixels FIntPoint - 2d size of the pixels image. More... | |
![]() | |
static FNVTexturePixelData | BuildPixelData (uint8 *PixelsData, EPixelFormat PixelFormat, const FIntPoint &ImageSize, const FIntPoint &TargetSize) |
static void | BuildPixelData (FNVTexturePixelData &OutPixelsData, uint8 *PixelsData, EPixelFormat PixelFormat, const FIntPoint &ImageSize, const FIntPoint &TargetSize) |
static void | CopyTexture2d (class IRendererModule *RendererModule, FRHICommandListImmediate &RHICmdList, const FTexture2DRHIRef &SourceTexture, const FIntRect &SourceRect, FTexture2DRHIRef &TargetTexture, const FIntRect &TargetRect, bool bOverwriteAlpha=true) |
Copy the pixels data from a texture to another one NOTE: The function return back right away but the action is running in the GPU. More... | |
static bool | ReadPixelsRaw (const FTexture2DRHIRef &SourceTexture, const FIntRect &SourceRect, EPixelFormat TargetPixelFormat, const FIntPoint &TargetSize, bool bIgnoreAlpha, OnFinishedReadingRawPixelsCallback Callback) |
Read the pixel data from a render target. More... | |
Definition at line 122 of file NVTextureReader.h.
|
finalvirtual |
Read back the pixels data from the current source texture NOTE: This function is sync, the pixels data is returned right away but it may cause the game to hitches since it flush the rendering commands.
Reimplemented from FNVTextureReader.
|
finalvirtual |
Read back the pixels data from the current source texture.
Callback | The function to call after all the pixels data are read from the source texture |
bIgnoreAlpha | If true, just set the alpha value of the readback pixels to 1, otherwise read it correctly NOTE: This function is async, the reading process will run on the rendering thread in parallel with the game thread |
Reimplemented from FNVTextureReader.