NVIDIA DeepLearning Dataset Synthesizer (NDDS)
 All Classes Namespaces Functions Variables Typedefs Pages
FNVTextureRenderTargetReader Struct Reference
+ Inheritance diagram for FNVTextureRenderTargetReader:
+ Collaboration diagram for FNVTextureRenderTargetReader:

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)
 
- Public Member Functions inherited from FNVTextureReader
FNVTextureReaderoperator= (const FNVTextureReader &OtherReader)
 

Protected Member Functions

void UpdateTextureFromRenderTarget ()
 
- Protected Member Functions inherited from FNVTextureReader
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
 
- Protected Attributes inherited from FNVTextureReader
EPixelFormat ReadbackPixelFormat
 
FIntPoint ReadbackSize
 
FIntRect SourceRect
 
FTexture2DRHIRef SourceTexture
 

Additional Inherited Members

- Public Types inherited from FNVTextureReader
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 Protected Member Functions inherited from FNVTextureReader
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...
 

Detailed Description

Definition at line 122 of file NVTextureReader.h.

Member Function Documentation

virtual bool FNVTextureRenderTargetReader::ReadPixelsData ( FNVTexturePixelData OutPixelsData)
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.

virtual bool FNVTextureRenderTargetReader::ReadPixelsData ( OnFinishedReadingPixelsDataCallback  Callback,
bool  bIgnoreAlpha = false 
)
finalvirtual

Read back the pixels data from the current source texture.

Parameters
CallbackThe function to call after all the pixels data are read from the source texture
bIgnoreAlphaIf 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.


The documentation for this struct was generated from the following file: