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

Class of static image utility functions. 更多...

#include <ImageUtils.h>

静态 Public 成员函数

static ENGINE_API void CompressImageArray (int32 ImageWidth, int32 ImageHeight, const TArray< FColor > &SrcData, TArray< uint8 > &DstData)
 Compress image to .png uint8 array. 更多...
 
static ENGINE_API UTexture2D * CreateCheckerboardTexture (FColor ColorOne=FColor(64, 64, 64), FColor ColorTwo=FColor(128, 128, 128), int32 CheckerSize=32)
 Creates a new UTexture2D with a checkerboard pattern. 更多...
 
static ENGINE_API UTexture2D * CreateTexture2D (int32 SrcWidth, int32 SrcHeight, const TArray< FColor > &SrcData, UObject *Outer, const FString &Name, const EObjectFlags &Flags, const FCreateTexture2DParameters &InParams)
 Creates a 2D texture from a array of raw color data. 更多...
 
static ENGINE_API void CropAndScaleImage (int32 SrcWidth, int32 SrcHeight, int32 DesiredWidth, int32 DesiredHeight, const TArray< FColor > &SrcData, TArray< FColor > &DstData)
 Crops, and scales an image from a raw image array. 更多...
 
static ENGINE_API bool ExportRenderTarget2DAsHDR (UTextureRenderTarget2D *TexRT, FArchive &Ar)
 Exports a UTextureRenderTarget2D as an HDR image on the disk. 更多...
 
static ENGINE_API bool ExportRenderTarget2DAsPNG (UTextureRenderTarget2D *TexRT, FArchive &Ar)
 Exports a UTextureRenderTarget2D as an HDR image on the disk. 更多...
 
static ENGINE_API bool ExportRenderTargetCubeAsHDR (UTextureRenderTargetCube *TexRT, FArchive &Ar)
 Exports a UTextureRenderTargetCube as an HDR image on the disk. 更多...
 
static ENGINE_API bool ExportTexture2DAsHDR (UTexture2D *TexRT, FArchive &Ar)
 Exports a UTexture2D as an HDR image on the disk. 更多...
 
static ENGINE_API bool ExportTextureCubeAsHDR (UTextureCube *TexRT, FArchive &Ar)
 Exports a UTextureCube as an HDR image on the disk. 更多...
 
static ENGINE_API void ImageResize (int32 SrcWidth, int32 SrcHeight, const TArray64< FLinearColor > &SrcData, int32 DstWidth, int32 DstHeight, TArray64< FLinearColor > &DstData)
 Resizes the given image using a simple average filter and stores it in the destination array. 更多...
 
static ENGINE_API void ImageResize (int32 SrcWidth, int32 SrcHeight, const TArray< FColor > &SrcData, int32 DstWidth, int32 DstHeight, TArray< FColor > &DstData, bool bLinearSpace)
 Resizes the given image using a simple average filter and stores it in the destination array. 更多...
 
static ENGINE_API void ImageResize (int32 SrcWidth, int32 SrcHeight, const TArrayView64< const FLinearColor > &SrcData, int32 DstWidth, int32 DstHeight, const TArrayView64< FLinearColor > &DstData)
 Resizes the given image using a simple average filter and stores it in the destination array. 更多...
 
static ENGINE_API void ImageResize (int32 SrcWidth, int32 SrcHeight, const TArrayView< const FColor > &SrcData, int32 DstWidth, int32 DstHeight, const TArrayView< FColor > &DstData, bool bLinearSpace)
 Resizes the given image using a simple average filter and stores it in the destination array. 更多...
 
static ENGINE_API UTexture2D * ImportBufferAsTexture2D (const TArray< uint8 > &Buffer)
 Imports a texture a buffer and creates Texture2D from it
 
static ENGINE_API UTexture2D * ImportFileAsTexture2D (const FString &Filename)
 Imports a texture file from disk and creates Texture2D from it
 

详细描述

Class of static image utility functions.

成员函数说明

◆ CompressImageArray()

static ENGINE_API void FImageUtils::CompressImageArray ( int32  ImageWidth,
int32  ImageHeight,
const TArray< FColor > &  SrcData,
TArray< uint8 > &  DstData 
)
static

Compress image to .png uint8 array.

参数
ImageHeightSource image width.
ImageWidthSource image height.
SrcDataRaw image array.
DstDatacompressed image array.

◆ CreateCheckerboardTexture()

static ENGINE_API UTexture2D * FImageUtils::CreateCheckerboardTexture ( FColor  ColorOne = FColor(64, 64, 64),
FColor  ColorTwo = FColor(128, 128, 128),
int32  CheckerSize = 32 
)
static

Creates a new UTexture2D with a checkerboard pattern.

参数
ColorOneThe color of half of the squares.
ColorTwoThe color of the other half of the squares.
CheckerSizeThe size in pixels of each checker square.

◆ CreateTexture2D()

static ENGINE_API UTexture2D * FImageUtils::CreateTexture2D ( int32  SrcWidth,
int32  SrcHeight,
const TArray< FColor > &  SrcData,
UObject *  Outer,
const FString &  Name,
const EObjectFlags &  Flags,
const FCreateTexture2DParameters &  InParams 
)
static

Creates a 2D texture from a array of raw color data.

参数
SrcWidthSource image width.
SrcHeightSource image height.
SrcDataSource image data.
OuterOuter for the texture object.
NameName for the texture object.
FlagsObject flags for the texture object.
InParamsParams about how to set up the texture.
返回
Returns a pointer to the constructed 2D texture object.

◆ CropAndScaleImage()

static ENGINE_API void FImageUtils::CropAndScaleImage ( int32  SrcWidth,
int32  SrcHeight,
int32  DesiredWidth,
int32  DesiredHeight,
const TArray< FColor > &  SrcData,
TArray< FColor > &  DstData 
)
static

Crops, and scales an image from a raw image array.

参数
SrcWidthSource image width.
SrcHeightSource image height.
DesiredWidthDesired Width.
DesiredHeightDesired Height.
SrcDataRaw image array.
DstDatacompressed image array.

◆ ExportRenderTarget2DAsHDR()

static ENGINE_API bool FImageUtils::ExportRenderTarget2DAsHDR ( UTextureRenderTarget2D *  TexRT,
FArchive &  Ar 
)
static

Exports a UTextureRenderTarget2D as an HDR image on the disk.

参数
TexRTThe render target to export
ArArchive to fill with data.
返回
Export operation success or failure.

◆ ExportRenderTarget2DAsPNG()

static ENGINE_API bool FImageUtils::ExportRenderTarget2DAsPNG ( UTextureRenderTarget2D *  TexRT,
FArchive &  Ar 
)
static

Exports a UTextureRenderTarget2D as an HDR image on the disk.

参数
TexRTThe render target to export
ArArchive to fill with data.
返回
Export operation success or failure.

◆ ExportRenderTargetCubeAsHDR()

static ENGINE_API bool FImageUtils::ExportRenderTargetCubeAsHDR ( UTextureRenderTargetCube *  TexRT,
FArchive &  Ar 
)
static

Exports a UTextureRenderTargetCube as an HDR image on the disk.

参数
TexRTThe render target cube to export
ArArchive to fill with data.
返回
Export operation success or failure.

◆ ExportTexture2DAsHDR()

static ENGINE_API bool FImageUtils::ExportTexture2DAsHDR ( UTexture2D *  TexRT,
FArchive &  Ar 
)
static

Exports a UTexture2D as an HDR image on the disk.

参数
TexRTThe texture to export
ArArchive to fill with data.
返回
Export operation success or failure.

◆ ExportTextureCubeAsHDR()

static ENGINE_API bool FImageUtils::ExportTextureCubeAsHDR ( UTextureCube *  TexRT,
FArchive &  Ar 
)
static

Exports a UTextureCube as an HDR image on the disk.

参数
TexRTThe texture cube to export
ArArchive to fill with data.
返回
Export operation success or failure.

◆ ImageResize() [1/4]

static ENGINE_API void FImageUtils::ImageResize ( int32  SrcWidth,
int32  SrcHeight,
const TArray64< FLinearColor > &  SrcData,
int32  DstWidth,
int32  DstHeight,
TArray64< FLinearColor > &  DstData 
)
static

Resizes the given image using a simple average filter and stores it in the destination array.

This version constrains aspect ratio.

参数
SrcWidthSource image width.
SrcHeightSource image height.
SrcDataSource image data.
DstWidthDestination image width.
DstHeightDestination image height.
DstDataDestination image data.

◆ ImageResize() [2/4]

static ENGINE_API void FImageUtils::ImageResize ( int32  SrcWidth,
int32  SrcHeight,
const TArray< FColor > &  SrcData,
int32  DstWidth,
int32  DstHeight,
TArray< FColor > &  DstData,
bool  bLinearSpace 
)
static

Resizes the given image using a simple average filter and stores it in the destination array.

This version constrains aspect ratio.

参数
SrcWidthSource image width.
SrcHeightSource image height.
SrcDataSource image data.
DstWidthDestination image width.
DstHeightDestination image height.
DstDataDestination image data.

◆ ImageResize() [3/4]

static ENGINE_API void FImageUtils::ImageResize ( int32  SrcWidth,
int32  SrcHeight,
const TArrayView64< const FLinearColor > &  SrcData,
int32  DstWidth,
int32  DstHeight,
const TArrayView64< FLinearColor > &  DstData 
)
static

Resizes the given image using a simple average filter and stores it in the destination array.

This version constrains aspect ratio. Accepts TArrayViews but requires that DstData be pre-sized appropriately

参数
SrcWidthSource image width.
SrcHeightSource image height.
SrcDataSource image data.
DstWidthDestination image width.
DstHeightDestination image height.
DstDataDestination image data. (must already be sized to DstWidth*DstHeight)

◆ ImageResize() [4/4]

static ENGINE_API void FImageUtils::ImageResize ( int32  SrcWidth,
int32  SrcHeight,
const TArrayView< const FColor > &  SrcData,
int32  DstWidth,
int32  DstHeight,
const TArrayView< FColor > &  DstData,
bool  bLinearSpace 
)
static

Resizes the given image using a simple average filter and stores it in the destination array.

This version constrains aspect ratio. Accepts TArrayViews but requires that DstData be pre-sized appropriately

参数
SrcWidthSource image width.
SrcHeightSource image height.
SrcDataSource image data.
DstWidthDestination image width.
DstHeightDestination image height.
DstDataDestination image data. (must already be sized to DstWidth*DstHeight)

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