You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#jira UETOOL-3823 #rb lonnie.li #preflight 617b1aea5794a500014f544a #ROBOMERGE-AUTHOR: michael.balzer #ROBOMERGE-SOURCE: CL 17972239 in //UE5/Release-5.0/... via CL 17972248 #ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v885-17909292) #ROBOMERGE[STARSHIP]: UE5-Main [CL 17972256 by michael balzer in ue5-release-engine-test branch]
81 lines
2.7 KiB
C++
81 lines
2.7 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "VectorTypes.h"
|
|
#include "Image/ImageDimensions.h"
|
|
#include "Image/ImageBuilder.h"
|
|
#include "Engine/Texture2D.h"
|
|
#include "Math/Color.h"
|
|
|
|
|
|
|
|
namespace UE
|
|
{
|
|
namespace AssetUtils
|
|
{
|
|
using namespace UE::Geometry;
|
|
|
|
/**
|
|
* Extract the Dimensions and image pixels from an input TextureMap
|
|
* By default, the "Source" texture data is read. This is only available in-Editor. At runtime, only "Platform" data is available.
|
|
* @param TextureMap the texture map to read
|
|
* @param DestImageOut the result of the texture read
|
|
* @param bPreferPlatformData if true, platform data will be returned even in-Editor.
|
|
* @return true on success
|
|
*/
|
|
MODELINGCOMPONENTS_API bool ReadTexture(
|
|
UTexture2D* TextureMap,
|
|
TImageBuilder<FVector4f>& DestImageOut,
|
|
const bool bPreferPlatformData = false);
|
|
|
|
/**
|
|
* Convert input UTexture2D to single-channel. Assumption is it has more than one channel. Red channel is used.
|
|
* @return true on success
|
|
*/
|
|
MODELINGCOMPONENTS_API bool ConvertToSingleChannel(UTexture2D* TextureMap);
|
|
|
|
/**
|
|
* Issue requests to the render thread to force virtual textures to load for the given screen dimensions.
|
|
* @param bWaitForPrefetchToComplete if true, FlushRenderingCommands() is called to wait for the textures to finish loading
|
|
* @return true on success
|
|
*/
|
|
MODELINGCOMPONENTS_API bool ForceVirtualTexturePrefetch(FImageDimensions ScreenSpaceDimensions, bool bWaitForPrefetchToComplete = true);
|
|
|
|
/**
|
|
* Save image stored in Pixels, of given Dimensions to <Project>/Intermediate/DebugSubFolder/FilenameBase_<FileCounter>.bmp
|
|
* If UseFileCounter is not specified, an internal static counter that is incremented each call is used.
|
|
*/
|
|
MODELINGCOMPONENTS_API bool SaveDebugImage(
|
|
const TArray<FColor>& Pixels,
|
|
FImageDimensions Dimensions,
|
|
FString DebugSubfolder,
|
|
FString FilenameBase,
|
|
int32 UseFileCounter = -1);
|
|
|
|
/**
|
|
* Save image stored in Pixels, of given Dimensions to <Project>/Intermediate/DebugSubFolder/FilenameBase_<FileCounter>.bmp
|
|
* If UseFileCounter is not specified, an internal static counter that is incremented each call is used.
|
|
*/
|
|
MODELINGCOMPONENTS_API bool SaveDebugImage(
|
|
const TArray<FLinearColor>& Pixels,
|
|
FImageDimensions Dimensions,
|
|
bool bConvertToSRGB,
|
|
FString DebugSubfolder,
|
|
FString FilenameBase,
|
|
int32 UseFileCounter = -1);
|
|
|
|
/**
|
|
* Save Image to <Project>/Intermediate/DebugSubFolder/FilenameBase_<FileCounter>.bmp
|
|
* If UseFileCounter is not specified, an internal static counter that is incremented each call is used.
|
|
*/
|
|
MODELINGCOMPONENTS_API bool SaveDebugImage(
|
|
const FImageAdapter& Image,
|
|
bool bConvertToSRGB,
|
|
FString DebugSubfolder,
|
|
FString FilenameBase,
|
|
int32 UseFileCounter = -1);
|
|
}
|
|
}
|
|
|