Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/FTextureRenderTarget2DArrayResou- > API/Runtime/Engine/FTextureRenderTarget2DArrayResou-/ReadPixels
- FRenderTarget::ReadPixels()
- FTextureRenderTarget2DArrayResource::ReadPixels()
References
| Module | Engine |
| Header | /Engine/Source/Runtime/Engine/Public/TextureRenderTarget2DArrayResource.h |
| Include | #include "TextureRenderTarget2DArrayResource.h" |
| Source | /Engine/Source/Runtime/Engine/Private/UnrealClient.cpp |
virtual bool ReadPixels
(
TArray < FColor > & OutImageData,
FReadSurfaceDataFlags InFlags,
FIntRect InSrcRect
)
Remarks
Reads the render target's displayed pixels into a preallocated color buffer. This will convert whatever the pixel format is to FColor Prefer using FImageUtils::GetRenderTargetImage rather than calling this directly.
The default value for InFlags specifies RCM_UNorm which will cause values to be scaled into [0,1] ; use RCM_MinMax to retrieve values without change.
If the RenderTarget surface is float linear, it will converted to SRGB FColor, if InFlags.bLinearToGamma is set (which is on by default). If the RenderTarget surface is U8, then the SRGB/not state is unchanged, the U8 values are retrieved unchanged in either Linear or SRGB. Gamma is handled correctly automatically by FImageUtils::GetRenderTargetImage