5#include "CoreMinimal.h"
6#include "Subsystems/EngineSubsystem.h"
8#include "ImageDownloadSubsystem.generated.h"
10class UTexture2DDynamic;
11using FHttpResponsePtr = TSharedPtr<class IHttpResponse, ESPMode::ThreadSafe>;
12enum class EImageFormat : int8;
18class STREAMCHATUI_API UImageDownloadSubsystem final : public UEngineSubsystem
23 virtual
void Initialize(FSubsystemCollectionBase& Collection) override;
24 virtual
bool ShouldCreateSubsystem(UObject* Outer) const override;
26 void DownloadImage(const FString& Url, TFunction<
void(UTexture2DDynamic*)>);
30 void CacheToMemory(const FString& Url, UTexture2DDynamic* Texture);
31 UTexture2DDynamic* QueryMemoryCache(const FString& Url) const;
34 void CacheToDisk(const FString& Url, const FHttpResponsePtr) const;
35 UTexture2DDynamic* QueryDiskCache(const FString& Url);
37 FString GetDiskPathForUrl(const FString& Url) const;
40 TMap<FString, UTexture2DDynamic*> MemoryCache;