opt + bug fix

This commit is contained in:
AUnicornWithNoLife 2023-02-13 17:16:32 +00:00
parent 903ffdf219
commit 93ce80144b
2 changed files with 37 additions and 12 deletions

View File

@ -71,7 +71,7 @@ namespace Cupola
ReadWriteTexture2D<Bgra32, Float4> brightest = images[0];
ReadWriteTexture2D<Bgra32, Float4> output = images[0];
outputImages[0] = output;
outputImages[0] = images[0];
for (int i = 1; i < images.Length; i++)
{

View File

@ -14,7 +14,6 @@ namespace Tranquility
public partial class MainWindow : Window
{
string[]? files;
ReadWriteTexture2D<Bgra32, float4>? finalImage;
public MainWindow()
{
@ -55,13 +54,19 @@ namespace Tranquility
if (files == null)
throw new Exception("Please select files before running");
int opt; // 0 - Picture, 1 - Video
opt = Options.SelectedIndex;
Progress.Value = 10;
ReadWriteTexture2D<Bgra32, float4>[] images = Cupola.Cupola.Load(files);
Progress.Value = 30;
finalImage = Cupola.Cupola.RunSingle(images);
if (opt == 0)
{
ReadWriteTexture2D<Bgra32, float4> finalImage = Cupola.Cupola.RunSingle(images);
Progress.Value = 90;
@ -77,5 +82,25 @@ namespace Tranquility
Progress.Value = 100;
}
else if (opt == 1)
{
ReadWriteTexture2D<Bgra32, float4>[] finalImages = Cupola.Cupola.RunMulti(images);
Progress.Value = 90;
string save = OpenFolder();
for (int i = 0; i < finalImages.Length; i++)
{
finalImages[i].Save(save + "\\" + i.ToString() + ".jpg");
}
}
else
{
throw new Exception("invalid option please die");
}
}
}
}