/* Copyright UNmisterIZE(Sebastien Durocher) 2025 All Rights Reserved.

Project: NoiseMapGenerator Plugin
File: NoiseMapGenerator.h
*/
#pragma once

#include "CoreMinimal.h"
#include "NoiseMapGeneratorSettings.h"

class UTexture2D;

struct FNoiseBakeSettings
{
	int32 Width = 1024;
	int32 Height = 1024;
	int32 TileRepeats = 1;
	int32 Seed = 1337;
	int32 Octaves = 5;
	float Frequency = 0.25f;
	float Lacunarity = 2.0f;
	float Gain = 0.5f;
	bool  bNormalize = true;
	ENoiseMode Mode = ENoiseMode::FBM;
	ENoiseAlgorithm Algorithm = ENoiseAlgorithm::Perlin;
	ENoiseOutputMode OutputMode = ENoiseOutputMode::Grayscale;
	FString OutputPath = TEXT("/Game/Noise");
	FString BaseName   = TEXT("T_Noise");
	bool    bOverwrite = false;
	bool    bGenerateMips = false;
};

class NOISEMAPGENERATOR_API FNoiseMapGenerator

{
public:
	static bool GeneratePixels(const FNoiseBakeSettings& S, int32 RepeatsUV, TArray<FColor>& OutPixels, int32& OutW, int32& OutH);
	static void BakeNoiseTexture(const FNoiseBakeSettings& Settings);
	static void BakeFromPixels(const FNoiseBakeSettings& S, const TArray<FColor>& Pixels, int32 W, int32 H);
};