UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FViewportSurfaceReader Struct Reference

#include <FrameGrabber.h>

Public Member Functions

MOVIESCENECAPTURE_API FViewportSurfaceReader (EPixelFormat InPixelFormat, FIntPoint InBufferSize)
 
MOVIESCENECAPTURE_API ~FViewportSurfaceReader ()
 
MOVIESCENECAPTURE_API void Initialize ()
 
MOVIESCENECAPTURE_API void BlockUntilAvailable ()
 
MOVIESCENECAPTURE_API void Reset ()
 
MOVIESCENECAPTURE_API void ResolveRenderTarget (FViewportSurfaceReader *RenderToReadback, const FTextureRHIRef &BackBuffer, TFunction< void(FColor *, int32, int32)> Callback)
 
MOVIESCENECAPTURE_API FIntPoint GetCurrentSize () const
 
void SetCaptureRect (FIntRect InCaptureRect)
 
void SetWindowSize (FIntPoint InWindowSize)
 
bool WasEverQueued () const
 

Protected Member Functions

MOVIESCENECAPTURE_API void Resize (uint32 Width, uint32 Height)
 

Protected Attributes

FThreadSafeBool bEnabled
 
FEventAvailableEvent
 
FTextureRHIRef ReadbackTexture
 
FIntRect CaptureRect
 
FIntPoint WindowSize
 
EPixelFormat PixelFormat
 
bool bIsEnabled
 
bool bQueuedForCapture
 

Detailed Description

A single, managed surface used as a render target resolution destination

Constructor & Destructor Documentation

◆ FViewportSurfaceReader()

FViewportSurfaceReader::FViewportSurfaceReader ( EPixelFormat  InPixelFormat,
FIntPoint  InBufferSize 
)

Constructor

◆ ~FViewportSurfaceReader()

FViewportSurfaceReader::~FViewportSurfaceReader ( )

Destructor

Member Function Documentation

◆ BlockUntilAvailable()

void FViewportSurfaceReader::BlockUntilAvailable ( )

Wait for this reader to become available, if it's currently in use

◆ GetCurrentSize()

MOVIESCENECAPTURE_API FIntPoint FViewportSurfaceReader::GetCurrentSize ( ) const

Get the current size of the texture

◆ Initialize()

void FViewportSurfaceReader::Initialize ( )

Initialize this reader so that it can be waited on.

◆ Reset()

void FViewportSurfaceReader::Reset ( )

Safely resets the state of the wait event. When doing latent surface reading sometimes we may want to just bail on reading a given frame. Should only be performed after flushing rendering commands.

◆ Resize()

void FViewportSurfaceReader::Resize ( uint32  Width,
uint32  Height 
)
protected

Set up this surface to the specified width/height

◆ ResolveRenderTarget()

void FViewportSurfaceReader::ResolveRenderTarget ( FViewportSurfaceReader RenderToReadback,
const FTextureRHIRef BackBuffer,
TFunction< void(FColor *, int32, int32)>  Callback 
)

Resolve the specified viewport RHI, calling the specified callback with the result.

Parameters
BackBufferThe backbuffer to resolve
CallbackCallback to call with the locked texture data. This will be called on an undefined thread.

◆ SetCaptureRect()

void FViewportSurfaceReader::SetCaptureRect ( FIntRect  InCaptureRect)
inline

Set the rectangle within which to read pixels

◆ SetWindowSize()

void FViewportSurfaceReader::SetWindowSize ( FIntPoint  InWindowSize)
inline

Set the window size that we expect from the BackBuffer

◆ WasEverQueued()

bool FViewportSurfaceReader::WasEverQueued ( ) const
inline

Member Data Documentation

◆ AvailableEvent

FEvent* FViewportSurfaceReader::AvailableEvent
protected

Optional event that is triggered when the surface is no longer in use

◆ bEnabled

FThreadSafeBool FViewportSurfaceReader::bEnabled
protected

Whether this surface reader is enabled or not

◆ bIsEnabled

bool FViewportSurfaceReader::bIsEnabled
protected

Whether this reader is enabled or not.

◆ bQueuedForCapture

bool FViewportSurfaceReader::bQueuedForCapture
protected

◆ CaptureRect

FIntRect FViewportSurfaceReader::CaptureRect
protected

The rectangle to read from the surface

◆ PixelFormat

EPixelFormat FViewportSurfaceReader::PixelFormat
protected

The desired pixel format of the resolved textures

◆ ReadbackTexture

FTextureRHIRef FViewportSurfaceReader::ReadbackTexture
protected

Texture used to store the resolved render target

◆ WindowSize

FIntPoint FViewportSurfaceReader::WindowSize
protected

In windows mode, the size of the widget with the border


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