Files
UnrealEngineUWP/Engine/Source/Developer/ScreenShotComparisonTools/Public/Interfaces/IScreenShotManager.h
Marc Audy 11f5b21210 Merging //UE5/Release-Engine-Staging @ 13752110 to Main (//UE5/Main)
#rnx

[CL 13753156 by Marc Audy in ue5-main branch]
2020-06-23 18:40:00 -04:00

79 lines
2.4 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
/*=============================================================================
IScreenShotComparisonModule.h: Declares the IScreenShotComparisonModule interface.
=============================================================================*/
#pragma once
#include "CoreMinimal.h"
#include "Async/Future.h"
#include "ImageComparer.h"
class IScreenShotManager;
struct FAutomationScreenshotMetadata;
/**
* Type definition for shared pointers to instances of IScreenShotManager.
*/
typedef TSharedPtr<class IScreenShotManager> IScreenShotManagerPtr;
/**
* Type definition for shared references to instances of IScreenShotManager.
*/
typedef TSharedRef<class IScreenShotManager> IScreenShotManagerRef;
struct FScreenshotExportResults
{
bool Success;
FString ExportPath;
FScreenshotExportResults()
: Success(false)
{
}
};
/**
* Describes options available when comparing screenshots
*/
enum class EScreenShotCompareOptions
{
None,
DiscardImage,
KeepImage,
};
/**
* Interface that defines a class which is capable of comparing screenshots at a provided path with checked in ground truth versions
* and generate results and reports.
*/
class IScreenShotManager
{
public:
virtual ~IScreenShotManager(){ }
/**
* Takes the file at the provided path and uses the metadata to find and compare it with a ground truth version.
*
* @param IncomingPath Path to the file. The file can reside anywhere but for best practices it should be under FPaths::AutomationTransientDir()
* @param MetaData Meta data for the image. This should have been created when the image was captured and is usually at the same path but with a json extension
* @param Options Comparison options. Use EScreenShotCompareOptions::DiscardImage if the incoming image does not need to be preserved (implicit if the path is under a transient dir)
*
* @return TFuture<FImageComparisonResult>
*/
virtual TFuture<FImageComparisonResult> CompareScreenshotAsync(const FString& IncomingPath, const FAutomationScreenshotMetadata& MetaData, const EScreenShotCompareOptions Options) = 0;
/**
* Exports rs screenshots to the export location specified
*/
virtual TFuture<FScreenshotExportResults> ExportComparisonResultsAsync(FString ExportPath = TEXT("")) = 0;
/**
* Imports screenshot comparison data from a given path.
*/
virtual bool OpenComparisonReports(FString ImportPath, TArray<FComparisonReport>& OutReports) = 0;
};