Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) @ 6944469

#rb none
#rnx

[CL 6944849 by Rolando Caloca in Main branch]
This commit is contained in:
Rolando Caloca
2019-06-11 18:27:07 -04:00
15302 changed files with 2787010 additions and 1793706 deletions
@@ -4,19 +4,41 @@
#include "CoreMinimal.h"
#if WITH_EDITOR
#include "ImageCore.h"
#ifndef WITH_CRUNCH
#define WITH_CRUNCH 1
#endif
/** Crunch compression lib is currently only built for Windows */
#define WITH_CRUNCH_COMPRESSION (WITH_CRUNCH && WITH_EDITOR && PLATFORM_WINDOWS)
#if WITH_CRUNCH
#if WITH_CRUNCH_COMPRESSION
/** Crunch compression */
struct FCrunchEncodeParameters
{
TArray<TArray<uint32>> RawImagesRGBA;
FName OutputFormat;
float CompressionAmmount = 0.0f; // 0 min compression, 1 max compression
uint32 ImageWidth = 0u;
uint32 ImageHeight = 0u;
uint32 NumWorkerThreads = 0u;
bool bIsGammaCorrected = false;
};
namespace CrunchCompression
{
#if WITH_EDITOR
CRUNCHCOMPRESSION_API bool IsValidFormat(const FName& Format);
CRUNCHCOMPRESSION_API bool Encode(const TArray<FImage>& UncompressedSrc, const FName& OutputFormat, TArray<uint8>& OutCodecPayload, TArray<uint8>& OutCompressedData, TArray< TPair<uint32, uint32>>& OutTileInfos);
#endif
CRUNCHCOMPRESSION_API bool Encode(const FCrunchEncodeParameters& Parameters, TArray<uint8>& OutCodecPayload, TArray<TArray<uint8>>& OutTilePayload);
}
#endif // WITH_CRUNCH_COMPRESSION
CRUNCHCOMPRESSION_API void* InitializeDecoderContext(uint8* HeaderData, size_t HeaderDataSize);
CRUNCHCOMPRESSION_API bool Decode(void* Context, uint8* CompressedPixelData, uint32 Slice, uint8* OutUncompressedData, size_t OutDataSize, size_t OutUncompressedDataPitch);
/** Decompression */
namespace CrunchCompression
{
CRUNCHCOMPRESSION_API void* InitializeDecoderContext(const void* HeaderData, size_t HeaderDataSize);
CRUNCHCOMPRESSION_API bool Decode(void* Context, const void* CompressedPixelData, uint32 Slice, void* OutUncompressedData, size_t OutDataSize, size_t OutUncompressedDataPitch);
CRUNCHCOMPRESSION_API void DestroyDecoderContext(void* Context);
}
#endif // WITH_CRUNCH