This commit is contained in:
2023-11-16 12:36:25 +05:00
parent e6a96a7e54
commit 6c6a5fb4ae
8 changed files with 5 additions and 259 deletions
+5 -5
View File
@@ -295,19 +295,19 @@
},
{
"Name": "createProcess",
"Enabled": true
"Enabled": false
},
{
"Name": "manageTextFile",
"Enabled": true
"Enabled": false
},
{
"Name": "JPrinter",
"Enabled": true
"Enabled": false
},
{
"Name": "EasyXMLParser",
"Enabled": true,
"Enabled": false,
"MarketplaceURL": "com.epicgames.launcher://ue/marketplace/content/af98110080a4411a8eaf3b8e931b8655"
},
{
@@ -338,7 +338,7 @@
},
{
"Name": "DLSS",
"Enabled": true,
"Enabled": false,
"MarketplaceURL": "https://www.unrealengine.com/marketplace/en-US/product/nvidia-dlss"
},
{
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

@@ -1,22 +0,0 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "base64plugin.h"
#define LOCTEXT_NAMESPACE "Fbase64pluginModule"
void Fbase64pluginModule::StartupModule()
{
// This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module
}
void Fbase64pluginModule::ShutdownModule()
{
// This function may be called during shutdown to clean up your module. For modules that support dynamic reloading,
// we call this function before unloading the module.
}
#undef LOCTEXT_NAMESPACE
IMPLEMENT_MODULE(Fbase64pluginModule, base64plugin)
@@ -1,106 +0,0 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "base64pluginBPLibrary.h"
#include "base64plugin.h"
// Fill out your copyright notice in the Description page of Project Settings.
#include "Misc/Base64.h"
#include "Engine/TextureRenderTarget2D.h"
#include "ImageUtils.h"
#include "Math/Color.h"
#include "Misc/FileHelper.h"
Ubase64pluginBPLibrary::Ubase64pluginBPLibrary(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}
TArray<FColor> readRT(UTextureRenderTarget2D* TextureRenderTarget) {
TArray<FColor> OutLDRValues;
TArray<FLinearColor> OutHDRValues;
if (!TextureRenderTarget)
{
return OutLDRValues;
}
FTextureRenderTarget2DResource* RTResource = (FTextureRenderTarget2DResource*)TextureRenderTarget->GameThread_GetRenderTargetResource();
if (!RTResource)
{
return OutLDRValues;
}
FReadSurfaceDataFlags ReadSurfaceDataFlags;
FRenderTarget* RenderTarget = TextureRenderTarget->GameThread_GetRenderTargetResource();
const int32 NumPixelsToRead = TextureRenderTarget->SizeX * TextureRenderTarget->SizeY;
switch (TextureRenderTarget->GetFormat())
{
case PF_B8G8R8A8:
OutLDRValues.SetNumUninitialized(NumPixelsToRead);
if (!RenderTarget->ReadPixelsPtr(OutLDRValues.GetData(), ReadSurfaceDataFlags))
{
return OutLDRValues;
}
break;
case PF_FloatRGBA:
OutHDRValues.SetNumUninitialized(NumPixelsToRead);
if (!RenderTarget->ReadLinearColorPixelsPtr(OutHDRValues.GetData(), ReadSurfaceDataFlags))
{
for (auto i : OutHDRValues)
{
OutLDRValues.Add(i.ToFColor(true));
}
return OutLDRValues;
}
break;
default:
return OutLDRValues;
}
return OutLDRValues;
}
void RTtoBytes(UTextureRenderTarget2D* TextureRenderTarget, TArray<uint8>& DstData)
{
if (TextureRenderTarget) {
TArray<FColor> SrcData = readRT(TextureRenderTarget);
if (SrcData.Num() > 0) {
FImageUtils::CompressImageArray(TextureRenderTarget->SizeX, TextureRenderTarget->SizeY, SrcData, DstData);
}
}
}
bool Ubase64pluginBPLibrary::bytesToBase64(const TArray<uint8>& source, FString& out) {
if (source.Num() > 0)
{
out = FBase64::Encode(source);
return true;
}
out = FString();
return false;
}
bool Ubase64pluginBPLibrary::fileToBase64(FString filePath, FString& out) {
TArray<uint8> outArray;
if (FFileHelper::LoadFileToArray(outArray, *filePath)) {
//out=FBase64::Encode(outArray);
return bytesToBase64(outArray, out);
}
return false;
}
bool Ubase64pluginBPLibrary::renderTargetToBase64(UTextureRenderTarget2D* RT, FString& out) {
TArray<uint8> tempArr;
RTtoBytes(RT, tempArr);
return bytesToBase64(tempArr, out);
}
@@ -1,14 +0,0 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Modules/ModuleManager.h"
class Fbase64pluginModule : public IModuleInterface
{
public:
/** IModuleInterface implementation */
virtual void StartupModule() override;
virtual void ShutdownModule() override;
};
@@ -1,36 +0,0 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Kismet/BlueprintFunctionLibrary.h"
#include "base64pluginBPLibrary.generated.h"
/*
* Function library class.
* Each function in it is expected to be static and represents blueprint node that can be called in any blueprint.
*
* When declaring function you can define metadata for the node. Key function specifiers will be BlueprintPure and BlueprintCallable.
* BlueprintPure - means the function does not affect the owning object in any way and thus creates a node without Exec pins.
* BlueprintCallable - makes a function which can be executed in Blueprints - Thus it has Exec pins.
* DisplayName - full name of the node, shown when you mouse over the node and in the blueprint drop down menu.
* Its lets you name the node using characters not allowed in C++ function names.
* CompactNodeTitle - the word(s) that appear on the node.
* Keywords - the list of keywords that helps you to find node when you search for it using Blueprint drop-down menu.
* Good example is "Print String" node which you can find also by using keyword "log".
* Category - the category your node will be under in the Blueprint drop-down menu.
*
* For more info on custom blueprint nodes visit documentation:
* https://wiki.unrealengine.com/Custom_Blueprint_Node_Creation
*/
UCLASS()
class Ubase64pluginBPLibrary : public UBlueprintFunctionLibrary
{
GENERATED_UCLASS_BODY()
public:
UFUNCTION(BlueprintCallable,Category="base64Encoders")
static bool bytesToBase64(const TArray<uint8>& source, FString & out);
UFUNCTION(BlueprintCallable, Category = "base64Encoders")
static bool fileToBase64(FString filePath, FString & out);
UFUNCTION(BlueprintCallable, Category = "base64Encoders")
static bool renderTargetToBase64(UTextureRenderTarget2D * RT, FString & out);
};
@@ -1,53 +0,0 @@
// Some copyright should be here...
using UnrealBuildTool;
public class base64plugin : ModuleRules
{
public base64plugin(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicIncludePaths.AddRange(
new string[] {
// ... add public include paths required here ...
}
);
PrivateIncludePaths.AddRange(
new string[] {
// ... add other private include paths required here ...
}
);
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
// ... add other public dependencies that you statically link with here ...
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
// ... add private dependencies that you statically link with here ...
}
);
DynamicallyLoadedModuleNames.AddRange(
new string[]
{
// ... add any modules that your module loads dynamically here ...
}
);
}
}
-23
View File
@@ -1,23 +0,0 @@
{
"FileVersion": 3,
"Version": 1,
"VersionName": "1.0",
"FriendlyName": "base64plugin",
"Description": "used for encode to base64 string of bytes, file or renderTarget",
"Category": "Other",
"CreatedBy": "Andron",
"CreatedByURL": "",
"DocsURL": "",
"MarketplaceURL": "",
"SupportURL": "",
"EngineVersion": "5.1.0",
"CanContainContent": false,
"Installed": true,
"Modules": [
{
"Name": "base64plugin",
"Type": "Runtime",
"LoadingPhase": "PreLoadingScreen"
}
]
}