This commit is contained in:
AUnicornWithNoLife 2023-02-13 09:58:11 +00:00
parent 87f56d55de
commit 7387b2c777
3 changed files with 37 additions and 14 deletions

View File

@ -1,7 +1,4 @@
using ComputeSharp; using ComputeSharp;
using System.Xml.Linq;
using Windows.Devices.Geolocation;
using static Cupola.Program;
namespace Cupola namespace Cupola
{ {
@ -110,10 +107,15 @@ namespace Cupola
return outputImages; return outputImages;
} }
private static ReadWriteTexture2D<Bgra32, float4>[] Load(string dir) public static ReadWriteTexture2D<Bgra32, float4>[] Load(string dir)
{ {
string[] files = Directory.GetFiles(dir); string[] files = Directory.GetFiles(dir);
return Load(files);
}
public static ReadWriteTexture2D<Bgra32, float4>[] Load(string[] files)
{
ReadWriteTexture2D<Bgra32, float4>[] images = new ReadWriteTexture2D<Bgra32, Float4>[files.Length]; ReadWriteTexture2D<Bgra32, float4>[] images = new ReadWriteTexture2D<Bgra32, Float4>[files.Length];
for (int i = 0; i < files.Length; i++) for (int i = 0; i < files.Length; i++)

View File

@ -5,15 +5,30 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Tranquility" xmlns:local="clr-namespace:Tranquility"
mc:Ignorable="d" mc:Ignorable="d"
Title="MainWindow" Height="450" Width="539"> Title="Tranquility" Height="450" Width="539">
<Grid> <Grid>
<Button Content="Load" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Height="35" Width="65" Click="LoadFilesClick"/> <Grid.ColumnDefinitions>
<Button Content="Run" HorizontalAlignment="Left" Margin="249,10,0,0" VerticalAlignment="Top" Height="35" Width="65"/> <ColumnDefinition Width="*"/>
<Button Content="Save" HorizontalAlignment="Left" Margin="249,389,0,0" VerticalAlignment="Top" Height="35" Width="280"/> <ColumnDefinition Width="*"/>
<ProgressBar HorizontalAlignment="Left" Height="35" Margin="319,10,0,0" VerticalAlignment="Top" Width="210"/> </Grid.ColumnDefinitions>
<TextBox HorizontalAlignment="Left" Margin="80,10,0,0" TextWrapping="Wrap" Text="INPUT FOLDER" VerticalAlignment="Top" Width="164" Height="35"/> <Grid x:Name="Left" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" Height="NaN" Margin="0,0,0,0" VerticalAlignment="Stretch" Width="NaN">
<TextBox HorizontalAlignment="Left" Margin="10,50,0,0" TextWrapping="Wrap" Text="INPUT FILES" VerticalAlignment="Top" Width="234" Height="374"/> <Grid.ColumnDefinitions>
<Image HorizontalAlignment="Left" Height="332" Margin="249,50,0,0" VerticalAlignment="Top" Width="281"/> <ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button x:Name="Load" Content="Load" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Height="35" Width="65" Click="LoadFilesClick"/>
<TextBox x:Name="Input_Folder" Margin="80,10,10,0" TextWrapping="Wrap" Text="INPUT FOLDER" VerticalAlignment="Top" Height="35"/>
<TextBox x:Name="Input_Files" TextWrapping="Wrap" Text="INPUT FILES" Margin="10,50,10,10"/>
</Grid>
<Grid x:Name="Right" Grid.ColumnSpan="2" Height="NaN" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="NaN">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button x:Name="Run" Content="Run" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Height="35" Width="64" Grid.Column="1"/>
<ProgressBar x:Name="Progress" Height="35" Margin="78,10,10,0" VerticalAlignment="Top" Grid.Column="1"/>
<Image x:Name="Preview" Grid.Column="1" Margin="12,53,12,56"/>
<Button x:Name="Save" Content="Save" Margin="10,0,10,10" Grid.Column="1" Height="35" VerticalAlignment="Bottom"/>
</Grid>
</Grid> </Grid>
</Window> </Window>

View File

@ -1,6 +1,8 @@
using System.Windows; using System.Windows;
using Microsoft.WindowsAPICodePack.Dialogs; using Microsoft.WindowsAPICodePack.Dialogs;
using WinRT; using WinRT;
using Cupola;
using System.IO;
namespace Tranquility namespace Tranquility
{ {
@ -9,6 +11,8 @@ namespace Tranquility
/// </summary> /// </summary>
public partial class MainWindow : Window public partial class MainWindow : Window
{ {
string[]? files;
public MainWindow() public MainWindow()
{ {
InitializeComponent(); InitializeComponent();
@ -16,7 +20,9 @@ namespace Tranquility
private void LoadFilesClick(object sender, RoutedEventArgs e) private void LoadFilesClick(object sender, RoutedEventArgs e)
{ {
string file = OpenFolder(); string file = OpenFolder();
files = Directory.GetFiles(file);
} }
private static string? OpenFolder() private static string? OpenFolder()