CARLA
Loading...
Searching...
No Matches
Classes | Typedefs | Functions | Variables
ImageUtil Namespace Reference

Classes

struct  ReadImageDataContext
 

Typedefs

using ReadImageDataAsyncCallback = std::function< bool(const void *, size_t, size_t, EPixelFormat, FIntPoint) >
 
using ReadImageDataAsyncCallbackFColor = std::function< bool(TArrayView< const FColor >, FIntPoint) >
 
using ReadImageDataAsyncCallbackFLinearColor = std::function< bool(TArrayView< const FLinearColor >, FIntPoint) >
 

Functions

bool DecodePixelsByFormat (const void *PixelData, int32 SourcePitch, FIntPoint Extent, EPixelFormat Format, FReadSurfaceDataFlags Flags, TArrayView< FColor > Out)
 
bool DecodePixelsByFormat (const void *PixelData, int32 SourcePitch, FIntPoint Extent, EPixelFormat Format, FReadSurfaceDataFlags Flags, TArrayView< FLinearColor > Out)
 
void FlushBatchedReadbacks ()
 
TUniquePtr< TImagePixelData< FColor > > ReadImageData (UTextureRenderTarget2D &RenderTarget)
 
bool ReadImageData (UTextureRenderTarget2D &RenderTarget, TArray64< FColor > &Out)
 
bool ReadImageData (UTextureRenderTarget2D &RenderTarget, TArray< FColor > &Out)
 
static void ReadImageDataAddToBatch (ReadImageDataContext &&Context)
 
bool ReadImageDataAsync (UTextureRenderTarget2D &RenderTarget, FRHIGPUReadbackPoolPtr Pool, ReadImageDataAsyncCallback &&Callback, bool bNonBlocking)
 
bool ReadImageDataAsync (UTextureRenderTarget2D &RenderTarget, ReadImageDataAsyncCallback &&Callback)
 
bool ReadImageDataAsyncFColor (UTextureRenderTarget2D &RenderTarget, ReadImageDataAsyncCallbackFColor &&Callback, bool bNonBlocking, FRHIGPUReadbackPoolPtr Pool)
 
bool ReadImageDataAsyncFLinearColor (UTextureRenderTarget2D &RenderTarget, ReadImageDataAsyncCallbackFLinearColor &&Callback, bool bNonBlocking, FRHIGPUReadbackPoolPtr Pool)
 
static void ReadImageDataBegin (ReadImageDataContext &Self, UTextureRenderTarget2D &RenderTarget, FRHIGPUReadbackPoolPtr Pool, ReadImageDataAsyncCallback &&Callback)
 
static void ReadImageDataEnd (ReadImageDataContext &Self)
 
static void ReadImageDataEndAsync (ReadImageDataContext &&Self)
 
bool ReadSensorImageDataAsync (AShaderBasedSensor &Sensor, ReadImageDataAsyncCallback &&Callback)
 
bool ReadSensorImageDataAsyncFColor (AShaderBasedSensor &Sensor, ReadImageDataAsyncCallbackFColor &&Callback)
 
bool ReadSensorImageDataAsyncFLinearColor (AShaderBasedSensor &Sensor, ReadImageDataAsyncCallbackFLinearColor &&Callback)
 
TFuture< bool > SaveImageData (TUniquePtr< TImagePixelData< FColor > > Data, const FStringView &Path)
 
TFuture< bool > SaveImageData (UTextureRenderTarget2D &RenderTarget, const FStringView &Path)
 

Variables

static TArray< ReadImageDataContext > GBatchedReadbacks
 

Typedef Documentation

◆ ReadImageDataAsyncCallback

using ImageUtil::ReadImageDataAsyncCallback = typedef std::function< bool( const void*, size_t, size_t, EPixelFormat, FIntPoint ) >

Definition at line 26 of file ImageUtil.h.

◆ ReadImageDataAsyncCallbackFColor

using ImageUtil::ReadImageDataAsyncCallbackFColor = typedef std::function< bool( TArrayView<const FColor>, FIntPoint ) >

Definition at line 39 of file ImageUtil.h.

◆ ReadImageDataAsyncCallbackFLinearColor

using ImageUtil::ReadImageDataAsyncCallbackFLinearColor = typedef std::function< bool( TArrayView<const FLinearColor>, FIntPoint ) >

Definition at line 49 of file ImageUtil.h.

Function Documentation

◆ DecodePixelsByFormat() [1/2]

bool ImageUtil::DecodePixelsByFormat ( const void *  PixelData,
int32  SourcePitch,
FIntPoint  Extent,
EPixelFormat  Format,
FReadSurfaceDataFlags  Flags,
TArrayView< FColor >  Out 
)

Definition at line 59 of file ImageUtil.cpp.

◆ DecodePixelsByFormat() [2/2]

bool ImageUtil::DecodePixelsByFormat ( const void *  PixelData,
int32  SourcePitch,
FIntPoint  Extent,
EPixelFormat  Format,
FReadSurfaceDataFlags  Flags,
TArrayView< FLinearColor >  Out 
)

Definition at line 38 of file ImageUtil.cpp.

Referenced by ReadImageDataAsyncFColor(), and ReadImageDataAsyncFLinearColor().

◆ FlushBatchedReadbacks()

void ImageUtil::FlushBatchedReadbacks ( )

◆ ReadImageData() [1/3]

TUniquePtr< TImagePixelData< FColor > > ImageUtil::ReadImageData ( UTextureRenderTarget2D &  RenderTarget)

Definition at line 172 of file ImageUtil.cpp.

References ReadImageData().

◆ ReadImageData() [2/3]

bool ImageUtil::ReadImageData ( UTextureRenderTarget2D &  RenderTarget,
TArray64< FColor > &  Out 
)

Definition at line 155 of file ImageUtil.cpp.

◆ ReadImageData() [3/3]

bool ImageUtil::ReadImageData ( UTextureRenderTarget2D &  RenderTarget,
TArray< FColor > &  Out 
)

Definition at line 138 of file ImageUtil.cpp.

Referenced by ReadImageData(), and SaveImageData().

◆ ReadImageDataAddToBatch()

static void ImageUtil::ReadImageDataAddToBatch ( ReadImageDataContext &&  Context)
static

Definition at line 345 of file ImageUtil.cpp.

References GBatchedReadbacks, and ReadImageDataAddToBatch().

Referenced by ReadImageDataAddToBatch(), and ReadImageDataAsync().

◆ ReadImageDataAsync() [1/2]

bool ImageUtil::ReadImageDataAsync ( UTextureRenderTarget2D &  RenderTarget,
FRHIGPUReadbackPoolPtr  Pool,
ReadImageDataAsyncCallback &&  Callback,
bool  bNonBlocking 
)

◆ ReadImageDataAsync() [2/2]

bool ImageUtil::ReadImageDataAsync ( UTextureRenderTarget2D &  RenderTarget,
ReadImageDataAsyncCallback &&  Callback 
)

Definition at line 464 of file ImageUtil.cpp.

References ReadImageDataAsync().

◆ ReadImageDataAsyncFColor()

bool ImageUtil::ReadImageDataAsyncFColor ( UTextureRenderTarget2D &  RenderTarget,
ReadImageDataAsyncCallbackFColor &&  Callback,
bool  bNonBlocking,
FRHIGPUReadbackPoolPtr  Pool 
)

◆ ReadImageDataAsyncFLinearColor()

bool ImageUtil::ReadImageDataAsyncFLinearColor ( UTextureRenderTarget2D &  RenderTarget,
ReadImageDataAsyncCallbackFLinearColor &&  Callback,
bool  bNonBlocking,
FRHIGPUReadbackPoolPtr  Pool 
)

◆ ReadImageDataBegin()

static void ImageUtil::ReadImageDataBegin ( ReadImageDataContext &  Self,
UTextureRenderTarget2D &  RenderTarget,
FRHIGPUReadbackPoolPtr  Pool,
ReadImageDataAsyncCallback &&  Callback 
)
static

◆ ReadImageDataEnd()

static void ImageUtil::ReadImageDataEnd ( ReadImageDataContext &  Self)
static

◆ ReadImageDataEndAsync()

static void ImageUtil::ReadImageDataEndAsync ( ReadImageDataContext &&  Self)
static

Definition at line 297 of file ImageUtil.cpp.

References ReadImageDataEnd().

Referenced by ReadImageDataAsync().

◆ ReadSensorImageDataAsync()

bool ImageUtil::ReadSensorImageDataAsync ( AShaderBasedSensor &  Sensor,
ReadImageDataAsyncCallback &&  Callback 
)

◆ ReadSensorImageDataAsyncFColor()

bool ImageUtil::ReadSensorImageDataAsyncFColor ( AShaderBasedSensor &  Sensor,
ReadImageDataAsyncCallbackFColor &&  Callback 
)

◆ ReadSensorImageDataAsyncFLinearColor()

bool ImageUtil::ReadSensorImageDataAsyncFLinearColor ( AShaderBasedSensor &  Sensor,
ReadImageDataAsyncCallbackFLinearColor &&  Callback 
)

◆ SaveImageData() [1/2]

TFuture< bool > ImageUtil::SaveImageData ( TUniquePtr< TImagePixelData< FColor > >  Data,
const FStringView &  Path 
)

Definition at line 194 of file ImageUtil.cpp.

◆ SaveImageData() [2/2]

TFuture< bool > ImageUtil::SaveImageData ( UTextureRenderTarget2D &  RenderTarget,
const FStringView &  Path 
)

Definition at line 185 of file ImageUtil.cpp.

References ReadImageData(), and SaveImageData().

Referenced by SaveImageData().

Variable Documentation

◆ GBatchedReadbacks

TArray<ReadImageDataContext> ImageUtil::GBatchedReadbacks
static

Definition at line 343 of file ImageUtil.cpp.

Referenced by FlushBatchedReadbacks(), and ReadImageDataAddToBatch().