Compare commits

..

17 Commits

Author SHA1 Message Date
AUnicornWithNoLife
a142e02729 Update Cupola.csproj 2023-06-24 23:06:56 +01:00
AUnicornWithNoLife
e7b6dc2db2 fiixed issue with pulling license from wrong repo (oops) 2023-06-24 22:04:13 +01:00
AUnicornWithNoLife
a2acf4301e
Update readme.md 2023-06-16 08:52:59 +01:00
AUnicornWithNoLife
ea6bab8dc7 nuget fu 2023-03-09 10:02:30 +00:00
AUnicornWithNoLife
bc6f8f34cd
Create LICENSE 2023-03-09 09:53:58 +00:00
AUnicornWithNoLife
5877455e72 Merge branch 'main' of https://github.com/AUnicornWithNoLife/Cupola 2023-03-09 09:47:17 +00:00
AUnicornWithNoLife
f20998ceba
Update readme.md 2023-03-09 09:40:16 +00:00
AUnicornWithNoLife
ba829037ab
Update readme.md 2023-03-09 09:39:50 +00:00
AUnicornWithNoLife
e7767e8288 fixed main view 2023-02-16 10:37:45 +00:00
AUnicornWithNoLife
e635d4fc49 simplify 2023-02-16 10:31:49 +00:00
AUnicornWithNoLife
93ce80144b opt + bug fix 2023-02-13 17:16:32 +00:00
AUnicornWithNoLife
903ffdf219 opt 2023-02-13 17:03:12 +00:00
AUnicornWithNoLife
a5deee579f opt 2023-02-13 17:01:47 +00:00
AUnicornWithNoLife
b0a06ac3fc Merge branch 'main' of https://github.com/AUnicornWithNoLife/Cupola 2023-02-13 12:51:04 +00:00
AUnicornWithNoLife
2e11ce385c
Update readme.md 2023-02-13 12:49:53 +00:00
AUnicornWithNoLife
aa45c0e090 work 2023-02-13 12:39:34 +00:00
AUnicornWithNoLife
4f9ff38f3d better ui 2023-02-13 12:25:46 +00:00
7 changed files with 115 additions and 28 deletions

View File

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

View File

@ -5,6 +5,11 @@
<TargetFramework>net7.0-windows10.0.17763.0</TargetFramework> <TargetFramework>net7.0-windows10.0.17763.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<IncludeSymbols>True</IncludeSymbols>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Title>Cupola</Title>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -13,4 +18,11 @@
<PackageReference Include="System.Drawing.Common" Version="7.0.0" /> <PackageReference Include="System.Drawing.Common" Version="7.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Update="LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
</Project> </Project>

21
Cupola/LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 AUnicornWithNoLife
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 AUnicornWithNoLife
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -7,28 +7,14 @@
mc:Ignorable="d" mc:Ignorable="d"
Title="Tranquility" Height="450" Width="539"> Title="Tranquility" Height="450" Width="539">
<Grid> <Grid>
<Grid.ColumnDefinitions> <Button x:Name="Load" Content="Load" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Height="35" Width="65" Click="LoadFilesClick"/>
<ColumnDefinition Width="*"/> <TextBox x:Name="Input_Folder" Margin="80,10,10,0" TextWrapping="Wrap" Text="INPUT FOLDER" VerticalAlignment="Top" Height="35" IsReadOnly="True"/>
<ColumnDefinition Width="*"/> <TextBox x:Name="Input_Files" TextWrapping="Wrap" Text="INPUT FILES" Margin="10,50,10,50" IsReadOnly="True"/>
</Grid.ColumnDefinitions> <Button x:Name="Run" Content="Run" Click="RunOp" Margin="80,0,0,10" HorizontalAlignment="Left" Width="65" Height="35" VerticalAlignment="Bottom"/>
<Grid x:Name="Left" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" Height="NaN" Margin="0,0,0,0" VerticalAlignment="Stretch" Width="NaN"> <ProgressBar x:Name="Progress" Height="35" Margin="150,0,10,10" VerticalAlignment="Bottom"/>
<Grid.ColumnDefinitions> <ComboBox x:Name="Options" Margin="10,0,0,10" SelectedIndex="0" HorizontalAlignment="Left" Width="65" Height="35" VerticalAlignment="Bottom">
<ColumnDefinition Width="*"/> <ListBoxItem x:Name="Picture_Option" Content="Picture" VerticalAlignment="Center"/>
<ColumnDefinition Width="*"/> <ListBoxItem x:Name="Video_Option" Content="Video" VerticalAlignment="Center"/>
</Grid.ColumnDefinitions> </ComboBox>
<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" Click="Run"/>
<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

@ -14,7 +14,6 @@ namespace Tranquility
public partial class MainWindow : Window public partial class MainWindow : Window
{ {
string[]? files; string[]? files;
ReadWriteTexture2D<Bgra32, float4>? finalImage;
public MainWindow() public MainWindow()
{ {
@ -50,14 +49,58 @@ namespace Tranquility
return null; return null;
} }
private void Run(object sender, RoutedEventArgs e) private void RunOp(object sender, RoutedEventArgs e)
{ {
if (files == null) if (files == null)
throw new Exception("Please select files before running"); 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); ReadWriteTexture2D<Bgra32, float4>[] images = Cupola.Cupola.Load(files);
finalImage = Cupola.Cupola.RunSingle(images); Progress.Value = 30;
if (opt == 0)
{
ReadWriteTexture2D<Bgra32, float4> finalImage = Cupola.Cupola.RunSingle(images);
Progress.Value = 90;
CommonSaveFileDialog saveFileDialog = new CommonSaveFileDialog();
saveFileDialog.DefaultExtension = ".jpg";
saveFileDialog.EnsurePathExists = true;
CommonFileDialogResult result = saveFileDialog.ShowDialog();
if (result != CommonFileDialogResult.Ok)
throw new Exception("please set location valid OKAY");
finalImage.Save(saveFileDialog.FileName);
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");
}
} }
} }
} }

View File

@ -2,4 +2,8 @@
Generate long exposure images (or video) from a video Generate long exposure images (or video) from a video
unfortunatly this only runs on windows, since System.Drawing.Common only works on windows on .net 6 unfortunatly this only runs on windows, since computesharp utilizes the DirectX api (in theory you can run this under linux using wine + dxvk (i would recommend if you want to use this, launch it from steam with proton)) (also, if you want to run this under macOS, you will have to use the game porting toolkit, as it uses directX 12)
Cupola - API
Tranquility - WPF app to use Cupola with a nice GUI (tranquility is probably gonna be moved into a seperate repo at some point)