From edbe492f423de1d05d7f7047667850da764ecc04 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 2 Sep 2019 01:08:46 +0200 Subject: [PATCH 1/4] Added base gaussian blur processor --- .../Processor/HlslGaussianBlurProcessor.cs | 55 +++++++++++ .../HlslGaussianBlurProcessor{TPixel}.cs | 97 +++++++++++++++++++ 2 files changed, 152 insertions(+) create mode 100644 samples/ComputeSharp.BokehBlur/Processor/HlslGaussianBlurProcessor.cs create mode 100644 samples/ComputeSharp.BokehBlur/Processor/HlslGaussianBlurProcessor{TPixel}.cs diff --git a/samples/ComputeSharp.BokehBlur/Processor/HlslGaussianBlurProcessor.cs b/samples/ComputeSharp.BokehBlur/Processor/HlslGaussianBlurProcessor.cs new file mode 100644 index 00000000..7a26434a --- /dev/null +++ b/samples/ComputeSharp.BokehBlur/Processor/HlslGaussianBlurProcessor.cs @@ -0,0 +1,55 @@ +using ComputeSharp.BokehBlur.Processor; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; + +namespace SixLabors.ImageSharp.Processing.Processors.Convolution +{ + /// + /// Defines Gaussian blur by a (Sigma, Radius) pair + /// + public sealed class HlslGaussianBlurProcessor : IImageProcessor + { + /// + /// The default value for . + /// + public const float DefaultSigma = 3f; + + /// + /// Initializes a new instance of the class + /// + public HlslGaussianBlurProcessor() : this(DefaultSigma, 9) { } + + /// + /// Initializes a new instance of the class + /// + /// The radius value representing the size of the area to sample + public HlslGaussianBlurProcessor(int radius) : this(radius / 3F, radius) { } + + /// + /// Initializes a new instance of the class + /// + /// The sigma value representing the weight of the blur + /// The radius value representing the size of the area to sample (this should be at least twice the sigma value) + public HlslGaussianBlurProcessor(float sigma, int radius) + { + Sigma = sigma; + Radius = radius; + } + + /// + /// Gets the sigma value representing the weight of the blur + /// + public float Sigma { get; } + + /// + /// Gets the radius defining the size of the area to sample + /// + public int Radius { get; } + + /// + public IImageProcessor CreatePixelSpecificProcessor(Image source, Rectangle sourceRectangle) where TPixel : struct, IPixel + { + return new HlslGaussianBlurProcessor(this, source, sourceRectangle); + } + } +} diff --git a/samples/ComputeSharp.BokehBlur/Processor/HlslGaussianBlurProcessor{TPixel}.cs b/samples/ComputeSharp.BokehBlur/Processor/HlslGaussianBlurProcessor{TPixel}.cs new file mode 100644 index 00000000..42673721 --- /dev/null +++ b/samples/ComputeSharp.BokehBlur/Processor/HlslGaussianBlurProcessor{TPixel}.cs @@ -0,0 +1,97 @@ +using System; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Processing.Processors.Convolution; +using SixLabors.Primitives; + +namespace ComputeSharp.BokehBlur.Processor +{ + /// + /// Applies Gaussian blur processing to an image. + /// + /// The pixel format. + internal class HlslGaussianBlurProcessor : IImageProcessor where TPixel : struct, IPixel + { + /// + /// The 1D kernel to apply + /// + private readonly float[] Kernel; + + /// + /// The source instance to modify + /// + private readonly Image Source; + + /// + /// Initializes a new instance of the class + /// + /// The defining the processor parameters + /// The source for the current processor instance + /// The source area to process for the current processor instance + public HlslGaussianBlurProcessor(HlslGaussianBlurProcessor definition, Image source, Rectangle sourceRectangle) + { + int kernelSize = definition.Radius * 2 + 1; + Kernel = CreateGaussianBlurKernel(kernelSize, definition.Sigma); + Source = source; + } + + /// + /// Creates a 1 dimensional Gaussian kernel using the Gaussian G(x) function + /// + private static float[] CreateGaussianBlurKernel(int size, float weight) + { + float[] kernel = new float[size]; + ref float rKernel = ref kernel[0]; + + float sum = 0F; + float midpoint = (size - 1) / 2F; + + for (int i = 0; i < size; i++) + { + float x = i - midpoint; + float gx = Gaussian(x, weight); + sum += gx; + Unsafe.Add(ref rKernel, i) = gx; + } + + // Normalize kernel so that the sum of all weights equals 1 + for (int i = 0; i < size; i++) + { + Unsafe.Add(ref rKernel, i) /= sum; + } + + return kernel; + } + + /// + /// Implementation of 1D Gaussian G(x) function + /// + /// The x provided to G(x) + /// The spread of the blur + /// The Gaussian G(x) + private static float Gaussian(float x, float sigma) + { + const float Numerator = 1.0f; + float denominator = MathF.Sqrt(2 * MathF.PI) * sigma; + + float exponentNumerator = -x * x; + float exponentDenominator = 2 * sigma * sigma; + + float left = Numerator / denominator; + float right = MathF.Exp(exponentNumerator / exponentDenominator); + + return left * right; + } + + /// + public void Apply() + { + + } + + /// + public void Dispose() { } + } +} From 12e8a6e6802c6a85357d37bc3fbf5d4baf2d8e7b Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 2 Sep 2019 01:35:03 +0200 Subject: [PATCH 2/4] Implemented HLSL gaussian blur --- .../Processor/HlslGaussianBlurProcessor.cs | 5 +- .../HlslGaussianBlurProcessor{TPixel}.cs | 112 +++++++++++++++++- 2 files changed, 114 insertions(+), 3 deletions(-) diff --git a/samples/ComputeSharp.BokehBlur/Processor/HlslGaussianBlurProcessor.cs b/samples/ComputeSharp.BokehBlur/Processor/HlslGaussianBlurProcessor.cs index 7a26434a..66e25f7f 100644 --- a/samples/ComputeSharp.BokehBlur/Processor/HlslGaussianBlurProcessor.cs +++ b/samples/ComputeSharp.BokehBlur/Processor/HlslGaussianBlurProcessor.cs @@ -1,8 +1,9 @@ -using ComputeSharp.BokehBlur.Processor; +using SixLabors.ImageSharp; using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Processors.Convolution +namespace ComputeSharp.BokehBlur.Processor { /// /// Defines Gaussian blur by a (Sigma, Radius) pair diff --git a/samples/ComputeSharp.BokehBlur/Processor/HlslGaussianBlurProcessor{TPixel}.cs b/samples/ComputeSharp.BokehBlur/Processor/HlslGaussianBlurProcessor{TPixel}.cs index 42673721..d57335e1 100644 --- a/samples/ComputeSharp.BokehBlur/Processor/HlslGaussianBlurProcessor{TPixel}.cs +++ b/samples/ComputeSharp.BokehBlur/Processor/HlslGaussianBlurProcessor{TPixel}.cs @@ -1,9 +1,12 @@ using System; +using System.Numerics; using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Threading.Tasks; using SixLabors.ImageSharp; +using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing.Processors; -using SixLabors.ImageSharp.Processing.Processors.Convolution; using SixLabors.Primitives; namespace ComputeSharp.BokehBlur.Processor @@ -88,7 +91,114 @@ namespace ComputeSharp.BokehBlur.Processor /// public void Apply() { + using Image source = Source.CloneAs(); + Span sourceSpan = MemoryMarshal.Cast(source.GetPixelSpan()); + using ReadWriteBuffer sourceBuffer = Gpu.Default.AllocateReadWriteBuffer(sourceSpan); + using ReadWriteBuffer firstPassBuffer = Gpu.Default.AllocateReadWriteBuffer(sourceBuffer.Size); + using ReadOnlyBuffer kernelBuffer = Gpu.Default.AllocateReadOnlyBuffer(Kernel); + + ApplyVerticalConvolution(sourceBuffer, firstPassBuffer, kernelBuffer); + ApplyHorizontalConvolution(firstPassBuffer, sourceBuffer, kernelBuffer); + + sourceBuffer.GetData(sourceSpan); + WriteResultData(source); + } + + /// + /// Performs a vertical 1D complex convolution with the specified parameters + /// + /// The source to read data from + /// The target to write the results to + /// The with the values for the current complex kernel + private void ApplyVerticalConvolution( + ReadWriteBuffer source, + ReadWriteBuffer target, + ReadOnlyBuffer kernel) + { + int height = Source.Height; + int width = Source.Width; + int maxY = height - 1; + int maxX = width - 1; + int kernelLength = kernel.Size; + + Gpu.Default.For(width, height, id => + { + Vector4 result = Vector4.Zero; + int radiusY = kernelLength >> 1; + int sourceOffsetColumnBase = id.X; + + for (int i = 0; i < kernelLength; i++) + { + int offsetY = Hlsl.Clamp(id.Y + i - radiusY, 0, maxY); + int offsetX = Hlsl.Clamp(sourceOffsetColumnBase, 0, maxX); + Vector4 color = source[offsetY * width + offsetX]; + + result += kernel[i] * color; + } + + int offsetXY = id.Y * width + id.X; + target[offsetXY] = result; + }); + } + + /// + /// Performs an horizontal 1D complex convolution with the specified parameters + /// + /// The source to read data from + /// The target to write the results to + /// The with the values for the current complex kernel + private void ApplyHorizontalConvolution( + ReadWriteBuffer source, + ReadWriteBuffer target, + ReadOnlyBuffer kernel) + { + int height = Source.Height; + int width = Source.Width; + int maxY = height - 1; + int maxX = width - 1; + int kernelLength = kernel.Size; + + Gpu.Default.For(width, height, id => + { + Vector4 result = Vector4.Zero; + int radiusX = kernelLength >> 1; + int sourceOffsetColumnBase = id.X; + int offsetY = Hlsl.Clamp(id.Y, 0, maxY); + int offsetXY; + + for (int i = 0; i < kernelLength; i++) + { + int offsetX = Hlsl.Clamp(sourceOffsetColumnBase + i - radiusX, 0, maxX); + offsetXY = offsetY * width + offsetX; + Vector4 color = source[offsetXY]; + + result += kernel[i] * color; + } + + offsetXY = id.Y * width + id.X; + target[offsetXY] = result; + }); + } + + /// + /// Writes the final data to the source image + /// + /// The source to read from + private void WriteResultData(Image image) + { + int width = Source.Width; + + Parallel.For(0, Source.Height, y => + { + ref TPixel rPixel = ref Source.GetPixelRowSpan(y).GetPinnableReference(); + ref Vector4 r4 = ref MemoryMarshal.Cast(image.GetPixelRowSpan(y)).GetPinnableReference(); + + for (int x = 0; x < width; x++) + { + Unsafe.Add(ref rPixel, x).FromVector4(Unsafe.Add(ref r4, x)); + } + }); } /// From 3db5c31aabec90212a9c9aea7616bf8c48c9ce52 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 2 Sep 2019 02:19:56 +0200 Subject: [PATCH 3/4] Added gaussian blur to processing samples --- .gitignore | 1 + samples/ComputeSharp.BokehBlur/Program.cs | 26 ++++++++++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 109cd325..23c39fe0 100644 --- a/.gitignore +++ b/.gitignore @@ -331,3 +331,4 @@ ASALocalRun/ # Sample bokeh blur image **/*_bokeh.jpg +**/*_gaussian.jpg diff --git a/samples/ComputeSharp.BokehBlur/Program.cs b/samples/ComputeSharp.BokehBlur/Program.cs index 4c970cb4..d31184db 100644 --- a/samples/ComputeSharp.BokehBlur/Program.cs +++ b/samples/ComputeSharp.BokehBlur/Program.cs @@ -5,6 +5,7 @@ using ComputeSharp.BokehBlur.Processor; using SixLabors.ImageSharp; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; namespace ComputeSharp.BokehBlur { @@ -14,16 +15,25 @@ namespace ComputeSharp.BokehBlur { Console.WriteLine(">> Loading image"); string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "city.jpg"); - using Image image = Image.Load(path); + using Image image = Image.Load(path); - Console.WriteLine(">> Applying blur"); - image.Mutate(c => c.ApplyProcessor(new HlslBokehBlurProcessor(80, 2, 3))); + // Apply a series of processors and save the results + foreach (var effect in new (string Name, IImageProcessor Processor)[] + { + ("bokeh", new HlslBokehBlurProcessor(80, 2, 3)), + ("gaussian", new HlslGaussianBlurProcessor(80)) + }) + { + Console.WriteLine($">> Applying {effect.Name}"); + using Image copy = image.Clone(); + copy.Mutate(c => c.ApplyProcessor(effect.Processor)); - Console.WriteLine(">> Saving to disk"); - string targetPath = Path.Combine( - Path.GetRelativePath(Path.GetDirectoryName(path), @"..\..\..\"), - $"{Path.GetFileNameWithoutExtension(path)}_bokeh{Path.GetExtension(path)}"); - image.Save(targetPath); + Console.WriteLine($">> Saving {effect.Name} to disk"); + string targetPath = Path.Combine( + Path.GetRelativePath(Path.GetDirectoryName(path), @"..\..\..\"), + $"{Path.GetFileNameWithoutExtension(path)}_{effect.Name}{Path.GetExtension(path)}"); + copy.Save(targetPath); + } } } } From 19095a81b78242a019f8c18f3e03aa930fe77d48 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 2 Sep 2019 02:22:52 +0200 Subject: [PATCH 4/4] Code refactoring --- ComputeSharp.sln | 72 +++++++++--------- .../ComputeSharp.ImageProcessing.csproj} | 0 .../Processors}/HlslBokehBlurProcessor.cs | 2 +- .../HlslBokehBlurProcessor{TPixel}.cs | 2 +- .../Processors}/HlslGaussianBlurProcessor.cs | 2 +- .../HlslGaussianBlurProcessor{TPixel}.cs | 2 +- .../Program.cs | 4 +- .../city.jpg | Bin 8 files changed, 42 insertions(+), 42 deletions(-) rename samples/{ComputeSharp.BokehBlur/ComputeSharp.BokehBlur.csproj => ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj} (100%) rename samples/{ComputeSharp.BokehBlur/Processor => ComputeSharp.ImageProcessing/Processors}/HlslBokehBlurProcessor.cs (98%) rename samples/{ComputeSharp.BokehBlur/Processor => ComputeSharp.ImageProcessing/Processors}/HlslBokehBlurProcessor{TPixel}.cs (99%) rename samples/{ComputeSharp.BokehBlur/Processor => ComputeSharp.ImageProcessing/Processors}/HlslGaussianBlurProcessor.cs (97%) rename samples/{ComputeSharp.BokehBlur/Processor => ComputeSharp.ImageProcessing/Processors}/HlslGaussianBlurProcessor{TPixel}.cs (99%) rename samples/{ComputeSharp.BokehBlur => ComputeSharp.ImageProcessing}/Program.cs (94%) rename samples/{ComputeSharp.BokehBlur => ComputeSharp.ImageProcessing}/city.jpg (100%) diff --git a/ComputeSharp.sln b/ComputeSharp.sln index 0f5c5fb0..4f97f672 100644 --- a/ComputeSharp.sln +++ b/ComputeSharp.sln @@ -5,7 +5,7 @@ VisualStudioVersion = 16.0.29201.188 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp", "src\ComputeSharp\ComputeSharp.csproj", "{314EB353-E7E3-4146-8111-685CC83EC1DE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputeSharp.Core", "src\ComputeSharp.Core\ComputeSharp.Core.csproj", "{9F9581FB-6EF7-418E-BFA5-0EFED874E980}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Core", "src\ComputeSharp.Core\ComputeSharp.Core.csproj", "{9F9581FB-6EF7-418E-BFA5-0EFED874E980}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Graphics", "src\ComputeSharp.Graphics\ComputeSharp.Graphics.csproj", "{2499CC74-BC9A-4B30-A3B6-05F9C7BF9B34}" EndProject @@ -15,7 +15,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{0ED8 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Benchmark", "samples\ComputeSharp.Benchmark\ComputeSharp.Benchmark.csproj", "{34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.BokehBlur", "samples\ComputeSharp.BokehBlur\ComputeSharp.BokehBlur.csproj", "{524CC5DD-1DEE-4A30-9515-AB90965E5207}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.ImageProcessing", "samples\ComputeSharp.ImageProcessing\ComputeSharp.ImageProcessing.csproj", "{524CC5DD-1DEE-4A30-9515-AB90965E5207}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Sample", "samples\ComputeSharp.Sample\ComputeSharp.Sample.csproj", "{7A48A85D-8866-4DED-A404-653ED09BF396}" EndProject @@ -40,6 +40,22 @@ Global Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {314EB353-E7E3-4146-8111-685CC83EC1DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {314EB353-E7E3-4146-8111-685CC83EC1DE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {314EB353-E7E3-4146-8111-685CC83EC1DE}.Debug|x64.ActiveCfg = Debug|Any CPU + {314EB353-E7E3-4146-8111-685CC83EC1DE}.Debug|x64.Build.0 = Debug|Any CPU + {314EB353-E7E3-4146-8111-685CC83EC1DE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {314EB353-E7E3-4146-8111-685CC83EC1DE}.Release|Any CPU.Build.0 = Release|Any CPU + {314EB353-E7E3-4146-8111-685CC83EC1DE}.Release|x64.ActiveCfg = Release|Any CPU + {314EB353-E7E3-4146-8111-685CC83EC1DE}.Release|x64.Build.0 = Release|Any CPU + {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Debug|x64.ActiveCfg = Debug|Any CPU + {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Debug|x64.Build.0 = Debug|Any CPU + {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Release|Any CPU.Build.0 = Release|Any CPU + {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Release|x64.ActiveCfg = Release|Any CPU + {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Release|x64.Build.0 = Release|Any CPU {2499CC74-BC9A-4B30-A3B6-05F9C7BF9B34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2499CC74-BC9A-4B30-A3B6-05F9C7BF9B34}.Debug|Any CPU.Build.0 = Debug|Any CPU {2499CC74-BC9A-4B30-A3B6-05F9C7BF9B34}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -56,14 +72,22 @@ Global {23AE6EED-79CD-4ADD-9A85-0148BD957D19}.Release|Any CPU.Build.0 = Release|Any CPU {23AE6EED-79CD-4ADD-9A85-0148BD957D19}.Release|x64.ActiveCfg = Release|Any CPU {23AE6EED-79CD-4ADD-9A85-0148BD957D19}.Release|x64.Build.0 = Release|Any CPU - {314EB353-E7E3-4146-8111-685CC83EC1DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {314EB353-E7E3-4146-8111-685CC83EC1DE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {314EB353-E7E3-4146-8111-685CC83EC1DE}.Debug|x64.ActiveCfg = Debug|Any CPU - {314EB353-E7E3-4146-8111-685CC83EC1DE}.Debug|x64.Build.0 = Debug|Any CPU - {314EB353-E7E3-4146-8111-685CC83EC1DE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {314EB353-E7E3-4146-8111-685CC83EC1DE}.Release|Any CPU.Build.0 = Release|Any CPU - {314EB353-E7E3-4146-8111-685CC83EC1DE}.Release|x64.ActiveCfg = Release|Any CPU - {314EB353-E7E3-4146-8111-685CC83EC1DE}.Release|x64.Build.0 = Release|Any CPU + {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Debug|x64.ActiveCfg = Debug|Any CPU + {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Debug|x64.Build.0 = Debug|Any CPU + {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Release|Any CPU.Build.0 = Release|Any CPU + {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Release|x64.ActiveCfg = Release|Any CPU + {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Release|x64.Build.0 = Release|Any CPU + {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Debug|Any CPU.Build.0 = Debug|Any CPU + {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Debug|x64.ActiveCfg = Debug|Any CPU + {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Debug|x64.Build.0 = Debug|Any CPU + {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Release|Any CPU.ActiveCfg = Release|Any CPU + {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Release|Any CPU.Build.0 = Release|Any CPU + {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Release|x64.ActiveCfg = Release|Any CPU + {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Release|x64.Build.0 = Release|Any CPU {7A48A85D-8866-4DED-A404-653ED09BF396}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7A48A85D-8866-4DED-A404-653ED09BF396}.Debug|Any CPU.Build.0 = Debug|Any CPU {7A48A85D-8866-4DED-A404-653ED09BF396}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -88,40 +112,16 @@ Global {E889E6D6-A814-4950-AAC1-68F1ECFC5BD6}.Release|Any CPU.Build.0 = Release|Any CPU {E889E6D6-A814-4950-AAC1-68F1ECFC5BD6}.Release|x64.ActiveCfg = Release|Any CPU {E889E6D6-A814-4950-AAC1-68F1ECFC5BD6}.Release|x64.Build.0 = Release|Any CPU - {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Debug|x64.ActiveCfg = Debug|Any CPU - {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Debug|x64.Build.0 = Debug|Any CPU - {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Release|Any CPU.Build.0 = Release|Any CPU - {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Release|x64.ActiveCfg = Release|Any CPU - {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Release|x64.Build.0 = Release|Any CPU - {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Debug|Any CPU.Build.0 = Debug|Any CPU - {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Debug|x64.ActiveCfg = Debug|Any CPU - {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Debug|x64.Build.0 = Debug|Any CPU - {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Release|Any CPU.ActiveCfg = Release|Any CPU - {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Release|Any CPU.Build.0 = Release|Any CPU - {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Release|x64.ActiveCfg = Release|Any CPU - {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Release|x64.Build.0 = Release|Any CPU - {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Debug|x64.ActiveCfg = Debug|Any CPU - {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Debug|x64.Build.0 = Debug|Any CPU - {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Release|Any CPU.Build.0 = Release|Any CPU - {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Release|x64.ActiveCfg = Release|Any CPU - {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution + {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} + {524CC5DD-1DEE-4A30-9515-AB90965E5207} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} {7A48A85D-8866-4DED-A404-653ED09BF396} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} {E91F4D24-922A-4921-A8D7-9C45A143C45D} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} {E889E6D6-A814-4950-AAC1-68F1ECFC5BD6} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} - {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} - {524CC5DD-1DEE-4A30-9515-AB90965E5207} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4664C5E3-0340-4E22-BCFD-98AAEDF5F2DC} diff --git a/samples/ComputeSharp.BokehBlur/ComputeSharp.BokehBlur.csproj b/samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj similarity index 100% rename from samples/ComputeSharp.BokehBlur/ComputeSharp.BokehBlur.csproj rename to samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj diff --git a/samples/ComputeSharp.BokehBlur/Processor/HlslBokehBlurProcessor.cs b/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor.cs similarity index 98% rename from samples/ComputeSharp.BokehBlur/Processor/HlslBokehBlurProcessor.cs rename to samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor.cs index 858e7a79..c62cd173 100644 --- a/samples/ComputeSharp.BokehBlur/Processor/HlslBokehBlurProcessor.cs +++ b/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Primitives; -namespace ComputeSharp.BokehBlur.Processor +namespace ComputeSharp.BokehBlur.Processors { /// /// Applies bokeh blur processing to the image diff --git a/samples/ComputeSharp.BokehBlur/Processor/HlslBokehBlurProcessor{TPixel}.cs b/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor{TPixel}.cs similarity index 99% rename from samples/ComputeSharp.BokehBlur/Processor/HlslBokehBlurProcessor{TPixel}.cs rename to samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor{TPixel}.cs index 948a5bab..0ae26d58 100644 --- a/samples/ComputeSharp.BokehBlur/Processor/HlslBokehBlurProcessor{TPixel}.cs +++ b/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor{TPixel}.cs @@ -13,7 +13,7 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Primitives; -namespace ComputeSharp.BokehBlur.Processor +namespace ComputeSharp.BokehBlur.Processors { /// /// Applies bokeh blur processing to the image diff --git a/samples/ComputeSharp.BokehBlur/Processor/HlslGaussianBlurProcessor.cs b/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor.cs similarity index 97% rename from samples/ComputeSharp.BokehBlur/Processor/HlslGaussianBlurProcessor.cs rename to samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor.cs index 66e25f7f..c32bc696 100644 --- a/samples/ComputeSharp.BokehBlur/Processor/HlslGaussianBlurProcessor.cs +++ b/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Primitives; -namespace ComputeSharp.BokehBlur.Processor +namespace ComputeSharp.BokehBlur.Processors { /// /// Defines Gaussian blur by a (Sigma, Radius) pair diff --git a/samples/ComputeSharp.BokehBlur/Processor/HlslGaussianBlurProcessor{TPixel}.cs b/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor{TPixel}.cs similarity index 99% rename from samples/ComputeSharp.BokehBlur/Processor/HlslGaussianBlurProcessor{TPixel}.cs rename to samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor{TPixel}.cs index d57335e1..274f3228 100644 --- a/samples/ComputeSharp.BokehBlur/Processor/HlslGaussianBlurProcessor{TPixel}.cs +++ b/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor{TPixel}.cs @@ -9,7 +9,7 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Primitives; -namespace ComputeSharp.BokehBlur.Processor +namespace ComputeSharp.BokehBlur.Processors { /// /// Applies Gaussian blur processing to an image. diff --git a/samples/ComputeSharp.BokehBlur/Program.cs b/samples/ComputeSharp.ImageProcessing/Program.cs similarity index 94% rename from samples/ComputeSharp.BokehBlur/Program.cs rename to samples/ComputeSharp.ImageProcessing/Program.cs index d31184db..9aaac4e1 100644 --- a/samples/ComputeSharp.BokehBlur/Program.cs +++ b/samples/ComputeSharp.ImageProcessing/Program.cs @@ -1,13 +1,13 @@ using System; using System.IO; using System.Reflection; -using ComputeSharp.BokehBlur.Processor; +using ComputeSharp.BokehBlur.Processors; using SixLabors.ImageSharp; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp.Processing.Processors; -namespace ComputeSharp.BokehBlur +namespace ComputeSharp.ImageProcessing { class Program { diff --git a/samples/ComputeSharp.BokehBlur/city.jpg b/samples/ComputeSharp.ImageProcessing/city.jpg similarity index 100% rename from samples/ComputeSharp.BokehBlur/city.jpg rename to samples/ComputeSharp.ImageProcessing/city.jpg