CARLA
 
载入中...
搜索中...
未找到
Public 类型 | 静态 Public 成员函数 | 所有成员列表
FPixelReader类 参考

Utils for reading pixels from UTextureRenderTarget2D. 更多...

#include <PixelReader.h>

Public 类型

using Payload = std::function<void(void *, uint32, uint32, uint32)>
 

静态 Public 成员函数

static TUniquePtr< TImagePixelData< FColor > > DumpPixels (UTextureRenderTarget2D &RenderTarget)
 Dump the pixels in RenderTarget.
 
static TFuture< bool > SavePixelsToDisk (TUniquePtr< TImagePixelData< FColor > > PixelData, const FString &FilePath)
 Asynchronously save the pixels in PixelData to disk.
 
static TFuture< bool > SavePixelsToDisk (UTextureRenderTarget2D &RenderTarget, const FString &FilePath)
 Asynchronously save the pixels in RenderTarget to disk.
 
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.
 
static bool WritePixelsToArray (UTextureRenderTarget2D &RenderTarget, TArray< FColor > &BitMap)
 Copy the pixels in RenderTarget into BitMap.
 
static void WritePixelsToBuffer (const UTextureRenderTarget2D &RenderTarget, uint32 Offset, FRHICommandListImmediate &InRHICmdList, FPixelReader::Payload FuncForSending)
 Copy the pixels in RenderTarget into Buffer.
 

详细描述

Utils for reading pixels from UTextureRenderTarget2D.

待办事项
This class only supports PF_R8G8B8A8 format.

在文件 PixelReader.h34 行定义.

成员类型定义说明

◆ Payload

using FPixelReader::Payload = std::function<void(void *, uint32, uint32, uint32)>

在文件 PixelReader.h38 行定义.

成员函数说明

◆ DumpPixels()

TUniquePtr< TImagePixelData< FColor > > FPixelReader::DumpPixels ( UTextureRenderTarget2D & RenderTarget)
static

Dump the pixels in RenderTarget.

前置条件
To be called from game-thread.

在文件 PixelReader.cpp100 行定义.

引用了 WritePixelsToArray().

被这些函数引用 SavePixelsToDisk().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ SavePixelsToDisk() [1/2]

TFuture< bool > FPixelReader::SavePixelsToDisk ( TUniquePtr< TImagePixelData< FColor > > PixelData,
const FString & FilePath )
static

Asynchronously save the pixels in PixelData to disk.

前置条件
To be called from game-thread.

在文件 PixelReader.cpp121 行定义.

◆ SavePixelsToDisk() [2/2]

TFuture< bool > FPixelReader::SavePixelsToDisk ( UTextureRenderTarget2D & RenderTarget,
const FString & FilePath )
static

Asynchronously save the pixels in RenderTarget to disk.

前置条件
To be called from game-thread.

在文件 PixelReader.cpp114 行定义.

引用了 DumpPixels() , 以及 SavePixelsToDisk().

被这些函数引用 URoadMap::SaveAsPNG(), ASceneCaptureSensor::SaveCaptureToDisk() , 以及 SavePixelsToDisk().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ SendPixelsInRenderThread()

template<typename TSensor , typename TPixel >
void FPixelReader::SendPixelsInRenderThread ( TSensor & Sensor,
bool use16BitFormat = false,
std::function< TArray< TPixel >(void *, uint32)> Conversor = {} )
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.

前置条件
To be called from game-thread.

Blocks until the render thread has finished all it's tasks.

待办事项
Can we make sure the sensor is not going to be destroyed?

在文件 PixelReader.h94 行定义.

引用了 carla::BufferView::CreateFrom(), carla::streaming::detail::token_type::get_stream_id(), FCarlaEngine::GetFrameCounter(), carla::ros2::ROS2::GetInstance(), SendPixelsInRenderThread(), carla::sensor::CompositeSerializer< Items >::Serialize() , 以及 WritePixelsToBuffer().

被这些函数引用 SendPixelsInRenderThread().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ WritePixelsToArray()

bool FPixelReader::WritePixelsToArray ( UTextureRenderTarget2D & RenderTarget,
TArray< FColor > & BitMap )
static

Copy the pixels in RenderTarget into BitMap.

前置条件
To be called from game-thread.

在文件 PixelReader.cpp83 行定义.

被这些函数引用 DumpPixels() , 以及 ASceneCaptureSensor::ReadPixels().

+ 这是这个函数的调用关系图:

◆ WritePixelsToBuffer()

void FPixelReader::WritePixelsToBuffer ( const UTextureRenderTarget2D & RenderTarget,
uint32 Offset,
FRHICommandListImmediate & InRHICmdList,
FPixelReader::Payload FuncForSending )
static

Copy the pixels in RenderTarget into Buffer.

前置条件
To be called from render-thread.

在文件 PixelReader.cpp19 行定义.

被这些函数引用 SendPixelsInRenderThread().

+ 这是这个函数的调用关系图:

该类的文档由以下文件生成: