Included sample image for the bokeh blur effect

このコミットが含まれているのは:
Sergio Pedri committed 2019-08-19 11:03:52 +02:00
1 親 741d9e833b
コミット 3b40f815fd
4ファイル変更
+19 -9

検索条件に一致するファイルはありません

+3
ファイルの表示
@@ -328,3 +328,6 @@ ASALocalRun/
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Sample bokeh blur image
**/*_bokeh.jpg
+10
ファイルの表示
@@ -5,6 +5,16 @@
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<None Remove="city.jpg" />
</ItemGroup>
<ItemGroup>
<Content Include="city.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.0-beta0006" />
</ItemGroup>
+6 -9
ファイルの表示
@@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using ComputeSharp.Graphics.Buffers;
@@ -12,15 +13,10 @@ namespace ComputeSharp.BokehBlur
{
class Program
{
/// <summary>
/// The path of the image to process (the modified version will be saved as a copy)
/// </summary>
private const string ImagePath = @"";
/// <summary>
/// The radius of the bokeh blur effect to apply
/// </summary>
private const int Radius = 32;
private const int Radius = 48;
/// <summary>
/// The gamma exposure value to use when applying the effect
@@ -31,7 +27,8 @@ namespace ComputeSharp.BokehBlur
{
// Load the input image
Console.WriteLine(">> Loading image");
using Image<Rgba32> image = Image.Load(ImagePath);
string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "city.jpg");
using Image<Rgba32> image = Image.Load(path);
var (height, width) = (image.Height, image.Width);
// Get the vector buffer
@@ -135,8 +132,8 @@ namespace ComputeSharp.BokehBlur
// Save the resulting image
Console.WriteLine(">> Saving to disk");
string targetPath = Path.Combine(
Path.GetDirectoryName(ImagePath),
$"{Path.GetFileNameWithoutExtension(ImagePath)}_bokeh{Path.GetExtension(ImagePath)}");
Path.GetRelativePath(Path.GetDirectoryName(path), @"..\..\..\"),
$"{Path.GetFileNameWithoutExtension(path)}_bokeh{Path.GetExtension(path)}");
image.Save(targetPath);
}
}
バイナリ
ファイルの表示
バイナリファイルは表示されません。

変更後

幅:  |  高さ:  |  サイズ: 1.3 MiB