Files
UnrealEngineUWP/Engine/Source/Developer/ImageWrapper/Private/ImageWrapperModule.cpp
Allan Bentham 98da78a389 Added OpenEXR library, added OpenEXR format to ImageWrapper Module, Changed highres screenshot code to save with image wrapper.
#ttp 318670 - UE4: RENDERING: FORTNITE: Write HighResScreenshots to OpenEXR (ideally PSD as well)
#proj Engine
#branch UE4
#summary Added OpenEXR library, added OpenEXR format to ImageWrapper Module, Changed highres screenshot code to save with image wrapper.
#Add OpenEXR support (for writing) to ImageWrapper module. (enabled for windows builds only)
#Add added option to highres screenshot code to choose to output as hdr / openexr
#Add 2 new visualisation modes, scene depth world units and custom depth world units.
#add cvar 'r.BufferVisualizationDumpFramesAsHDR' to enable hdr export from console.
#change FRCPassPostProcessMaterial can specify an override output texture format if required.
#add SaveImage function to FHighResScreenshotConfig

[CL 2252882 by Allan Bentham in Main branch]
2014-08-12 08:36:24 -04:00

69 lines
1.3 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#include "ImageWrapperPrivatePCH.h"
DEFINE_LOG_CATEGORY(LogImageWrapper);
/**
* Image Wrapper module
*/
class FImageWrapperModule
: public IImageWrapperModule
{
public:
// IImageWrapperModule interface
virtual IImageWrapperPtr CreateImageWrapper( const EImageFormat::Type InFormat ) override
{
FImageWrapperBase* ImageWrapper = NULL;
// Allocate a helper for the format type
switch(InFormat)
{
#if WITH_UNREALPNG
case EImageFormat::PNG:
ImageWrapper = new FPngImageWrapper();
break;
#endif // WITH_UNREALPNG
#if WITH_UNREALJPEG
case EImageFormat::JPEG:
ImageWrapper = new FJpegImageWrapper();
break;
case EImageFormat::GrayscaleJPEG:
ImageWrapper = new FJpegImageWrapper(1);
break;
#endif //WITH_UNREALJPEG
case EImageFormat::BMP:
ImageWrapper = new FBmpImageWrapper();
break;
case EImageFormat::ICO:
ImageWrapper = new FIcoImageWrapper();
break;
#if WITH_UNREALEXR
case EImageFormat::EXR:
ImageWrapper = new FExrImageWrapper();
break;
#endif
default:
break;
}
return MakeShareable(ImageWrapper);
}
public:
// IModuleInterface interface
virtual void StartupModule( ) override { }
virtual void ShutdownModule( ) override { }
};
IMPLEMENT_MODULE(FImageWrapperModule, ImageWrapper);