Files
UnrealEngineUWP/Engine/Source/Developer/TextureBuildUtilities/Public/TextureBuildUtilities.h
Dan Thompson b66139e721 Shared Linear Texture Encoding [DDC2] -- Separates out the platform tiling code to allow for texture builds to reuse the linear texture that gets encodes with windows.
Primary Components:
    DDC2 texture build input/output revamped to support future FDerivedData references where the bulk data remains in the Zen server during cooks.
    Tiling code is separated out in to ITextureTiler interface so that tiling can be done without calling FChildTextureFormat::CompressImage[Ex]
    Adding mip dimensions to GetMipCountForBuildSettings

#rb fabian.giesen, zousar.shaker
#preflight 6304f87f516bef57ffada18d

[CL 21511157 by Dan Thompson in ue5-main branch]
2022-08-23 12:41:58 -04:00

60 lines
2.1 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "ImageCore.h"
#include "TextureCompressorModule.h" // for FTextureBuildSettings
#include "Interfaces/ITextureFormat.h"
/***
TextureBuildUtilities is a utility module for shared code that Engine and TextureBuildWorker (no Engine) can both see
for Texture-related functions that don't need Texture.h/UTexture
TextureBuildUtilities is hard-linked to the Engine so no LoadModule/ModuleInterface is needed
***/
namespace UE
{
namespace TextureBuildUtilities
{
namespace EncodedTextureExtendedData
{
TEXTUREBUILDUTILITIES_API FCbObject ToCompactBinary(const FEncodedTextureExtendedData& InExtendedData);
TEXTUREBUILDUTILITIES_API bool FromCompactBinary(FEncodedTextureExtendedData& OutExtendedData, FCbObject InCbObject);
}
namespace EncodedTextureDescription
{
TEXTUREBUILDUTILITIES_API FCbObject ToCompactBinary(const FEncodedTextureDescription& InDescription);
TEXTUREBUILDUTILITIES_API bool FromCompactBinary(FEncodedTextureDescription& OutDescription, FCbObject InCbObject);
}
namespace TextureEngineParameters
{
TEXTUREBUILDUTILITIES_API FCbObject ToCompactBinaryWithDefaults(const FTextureEngineParameters& InEngineParameters);
TEXTUREBUILDUTILITIES_API bool FromCompactBinary(FTextureEngineParameters& OutEngineParameters, FCbObject InCbObject);
}
TEXTUREBUILDUTILITIES_API bool TextureFormatIsHdr(FName const& InName);
// Removes platform and other custom prefixes from the name.
// Returns plain format name and the non-platform prefix (with trailing underscore).
// i.e. PLAT_BLAH_AutoDXT returns AutoDXT and writes BLAH_ to OutPrefix.
TEXTUREBUILDUTILITIES_API const FName TextureFormatRemovePrefixFromName(FName const& InName, FName& OutPrefix);
FORCEINLINE const FName TextureFormatRemovePrefixFromName(FName const& InName)
{
FName OutPrefix;
return TextureFormatRemovePrefixFromName(InName,OutPrefix);
}
TEXTUREBUILDUTILITIES_API ERawImageFormat::Type GetVirtualTextureBuildIntermediateFormat(const FTextureBuildSettings& BuildSettings);
} // namespace TextureBuildUtilities
} // namespace UE