diff --git a/src/PicView.Avalonia/ImageEffects/ImageEffectsHelper.cs b/src/PicView.Avalonia/ImageEffects/ImageEffectsHelper.cs new file mode 100644 index 00000000..d77a1b2e --- /dev/null +++ b/src/PicView.Avalonia/ImageEffects/ImageEffectsHelper.cs @@ -0,0 +1,25 @@ +using Avalonia.Media.Imaging; +using ImageMagick; +using PicView.Avalonia.ImageHandling; + +namespace PicView.Avalonia.ImageEffects; + +public static class ImageEffectsHelper +{ + public static async Task GetRadialBlur(string file) + { + using var magick = new MagickImage(); + await magick.ReadAsync(file).ConfigureAwait(false); + // Apply radial blur + magick.AdaptiveBlur(10); + + // Create a new morphology settings + var morphology = new MorphologySettings + { + Kernel = Kernel.DoG, + Method = MorphologyMethod.Convolve + }; + magick.Morphology(morphology); + return magick.ToWriteableBitmap(); + } +} diff --git a/src/PicView.Avalonia/PicViewTheme/Controls/ButtonSpinner.axaml b/src/PicView.Avalonia/PicViewTheme/Controls/ButtonSpinner.axaml new file mode 100644 index 00000000..ec89fba4 --- /dev/null +++ b/src/PicView.Avalonia/PicViewTheme/Controls/ButtonSpinner.axaml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/PicView.Avalonia/PicViewTheme/Controls/NumericUpDown.axaml b/src/PicView.Avalonia/PicViewTheme/Controls/NumericUpDown.axaml new file mode 100644 index 00000000..352cc5a3 --- /dev/null +++ b/src/PicView.Avalonia/PicViewTheme/Controls/NumericUpDown.axaml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/PicView.Avalonia/PicViewTheme/Index.axaml b/src/PicView.Avalonia/PicViewTheme/Index.axaml index 62899ad2..6c785315 100644 --- a/src/PicView.Avalonia/PicViewTheme/Index.axaml +++ b/src/PicView.Avalonia/PicViewTheme/Index.axaml @@ -11,6 +11,7 @@ + @@ -20,6 +21,7 @@ + diff --git a/src/PicView.Avalonia/Views/EffectsView.axaml b/src/PicView.Avalonia/Views/EffectsView.axaml index 5bb19232..a8e4278d 100644 --- a/src/PicView.Avalonia/Views/EffectsView.axaml +++ b/src/PicView.Avalonia/Views/EffectsView.axaml @@ -30,7 +30,7 @@ Fill="{DynamicResource MainBorderColor}" Height="15" HorizontalAlignment="Center" - Margin="0,0,120,-5" + Margin="0,0,122,-5" Stroke="{DynamicResource MainBorderColor}" Width="2" /> @@ -54,7 +54,7 @@ x:Name="BrightnessSlider"> - + @@ -62,22 +62,23 @@ - + x:Name="ResetBrightnessBtn" /> @@ -92,7 +93,7 @@ Fill="{DynamicResource MainBorderColor}" Height="15" HorizontalAlignment="Center" - Margin="0,0,120,-5" + Margin="0,0,122,-5" Stroke="{DynamicResource MainBorderColor}" Width="2" /> @@ -102,7 +103,6 @@ + x:Name="ContrastSlider"> + + + + + + + + + + + + - + x:Name="ResetContrastBtn" /> @@ -178,33 +191,6 @@ Value="0" x:Name="BlurSlider" /> - - - - - - - - -