Files
UnrealEngineUWP/Engine/Source/Runtime/CrunchCompression/Public/CrunchCompression.h
ryan durand 0f0464a30e Updating copyright for Engine Runtime.
#rnx
#rb none


#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870549 by ryan durand in Main branch]
2019-12-26 14:45:42 -05:00

45 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.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
{
CRUNCHCOMPRESSION_API bool IsValidFormat(const FName& Format);
CRUNCHCOMPRESSION_API bool Encode(const FCrunchEncodeParameters& Parameters, TArray<uint8>& OutCodecPayload, TArray<TArray<uint8>>& OutTilePayload);
}
#endif // WITH_CRUNCH_COMPRESSION
/** 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