Files
UnrealEngineUWP/Engine/Source/Runtime/ImageWrapper/Private/ExrImageWrapper.h
Ben Marsh 20bf0eb6a1 Updating copyright notices to 2017 (copying from //Tasks/UE4/Dev-Copyright-2017).
#rb none
#lockdown Nick.Penwarden

[CL 3226823 by Ben Marsh in Main branch]
2016-12-08 08:52:44 -05:00

60 lines
1.7 KiB
C++

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "ImageWrapperBase.h"
#if WITH_UNREALEXR
THIRD_PARTY_INCLUDES_START
#include "ThirdParty/openexr/Deploy/include/ImfIO.h"
#include "ThirdParty/openexr/Deploy/include/ImathBox.h"
#include "ThirdParty/openexr/Deploy/include/ImfChannelList.h"
#include "ThirdParty/openexr/Deploy/include/ImfInputFile.h"
#include "ThirdParty/openexr/Deploy/include/ImfOutputFile.h"
#include "ThirdParty/openexr/Deploy/include/ImfArray.h"
#include "ThirdParty/openexr/Deploy/include/ImfHeader.h"
#include "ThirdParty/openexr/Deploy/include/ImfStdIO.h"
#include "ThirdParty/openexr/Deploy/include/ImfChannelList.h"
#include "ThirdParty/openexr/Deploy/include/ImfRgbaFile.h"
THIRD_PARTY_INCLUDES_END
/**
* OpenEXR implementation of the helper class
*/
class FExrImageWrapper
: public FImageWrapperBase
{
public:
/**
* Default Constructor.
*/
FExrImageWrapper();
public:
//~ Begin FImageWrapper Interface
virtual void Compress( int32 Quality ) override;
virtual void Uncompress( const ERGBFormat::Type InFormat, int32 InBitDepth ) override;
virtual bool SetCompressed( const void* InCompressedData, int32 InCompressedSize ) override;
//~ End FImageWrapper Interface
private:
template <Imf::PixelType OutputFormat, typename sourcetype>
void WriteFrameBufferChannel(Imf::FrameBuffer& ImfFrameBuffer, const char* ChannelName, const sourcetype* SrcData, TArray<uint8>& ChannelBuffer);
template <Imf::PixelType OutputFormat, typename sourcetype>
void CompressRaw(const sourcetype* SrcData, bool bIgnoreAlpha);
const char* GetRawChannelName(int ChannelIndex) const;
bool bUseCompression;
};
#endif // WITH_UNREALEXR