Utils for reading pixels from UTextureRenderTarget2D. More...
#include <PixelReader.h>
Public Types | |
using | Payload = std::function< void(void *, uint32, uint32, uint32)> |
Static Public Member Functions | |
static TUniquePtr< TImagePixelData< FColor > > | DumpPixels (UTextureRenderTarget2D &RenderTarget) |
Dump the pixels in RenderTarget. More... | |
static TFuture< bool > | SavePixelsToDisk (UTextureRenderTarget2D &RenderTarget, const FString &FilePath) |
Asynchronously save the pixels in RenderTarget to disk. More... | |
static TFuture< bool > | SavePixelsToDisk (TUniquePtr< TImagePixelData< FColor >> PixelData, const FString &FilePath) |
Asynchronously save the pixels in PixelData to disk. More... | |
template<typename TSensor , typename TPixel > | |
static void | SendPixelsInRenderThread (TSensor &Sensor, bool use16BitFormat=false, std::function< TArray< TPixel >(void *, uint32)> Conversor={}) |
Convenience function to enqueue a render command that sends the pixels down the Sensor's data stream. More... | |
static bool | WritePixelsToArray (UTextureRenderTarget2D &RenderTarget, TArray< FColor > &BitMap) |
Copy the pixels in RenderTarget into BitMap. More... | |
static void | WritePixelsToBuffer (const UTextureRenderTarget2D &RenderTarget, uint32 Offset, FRHICommandListImmediate &InRHICmdList, FPixelReader::Payload FuncForSending) |
Copy the pixels in RenderTarget into Buffer. More... | |
Utils for reading pixels from UTextureRenderTarget2D.
Definition at line 34 of file PixelReader.h.
using FPixelReader::Payload = std::function<void(void *, uint32, uint32, uint32)> |
Definition at line 38 of file PixelReader.h.
|
static |
Dump the pixels in RenderTarget.
Definition at line 100 of file PixelReader.cpp.
References WritePixelsToArray().
Referenced by SavePixelsToDisk().
|
static |
Asynchronously save the pixels in RenderTarget to disk.
Definition at line 114 of file PixelReader.cpp.
References DumpPixels().
Referenced by URoadMap::SaveAsPNG(), and ASceneCaptureSensor::SaveCaptureToDisk().
|
static |
Asynchronously save the pixels in PixelData to disk.
Definition at line 121 of file PixelReader.cpp.
|
static |
Convenience function to enqueue a render command that sends the pixels down the Sensor's data stream.
It expects a sensor derived from ASceneCaptureSensor or compatible.
Note that the serializer needs to define a "header_offset" that it's allocated in front of the buffer.
Blocks until the render thread has finished all it's tasks.
Definition at line 94 of file PixelReader.h.
References carla::BufferView::CreateFrom(), FCarlaEngine::GetFrameCounter(), carla::ros2::ROS2::GetInstance(), carla::sensor::CompositeSerializer< Items >::Serialize(), and WritePixelsToBuffer().
|
static |
Copy the pixels in RenderTarget into BitMap.
Definition at line 83 of file PixelReader.cpp.
Referenced by DumpPixels(), and ASceneCaptureSensor::ReadPixels().
|
static |
Copy the pixels in RenderTarget into Buffer.
Definition at line 19 of file PixelReader.cpp.
Referenced by SendPixelsInRenderThread().