Implemented ShareX sample
このコミットが含まれているのは:
1 親
1861fe3218
コミット
2dd0549eec
2ファイル変更
+47
-2
検索条件に一致するファイルはありません
@@ -1,12 +1,44 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using ShareX.HelpersLib;
|
||||
|
||||
namespace ComputeSharp.ShareX
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
static void Main()
|
||||
{
|
||||
Console.WriteLine("Hello World!");
|
||||
Console.WriteLine(">> Loading image");
|
||||
|
||||
string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "city.jpg");
|
||||
|
||||
using Bitmap sourceBitmap = new(path);
|
||||
|
||||
Console.WriteLine(">> Blurring on CPU");
|
||||
|
||||
using Bitmap resultBitmapCpu = ConvolutionMatrixManager.GaussianBlur(60, 60, 10).Apply(sourceBitmap);
|
||||
|
||||
string resultPathCpu = Path.Combine(
|
||||
Path.GetRelativePath(Path.GetDirectoryName(path)!, @"..\..\..\"),
|
||||
$"{Path.GetFileNameWithoutExtension(path)}_cpu{Path.GetExtension(path)}");
|
||||
|
||||
Console.WriteLine(">> Saving image");
|
||||
|
||||
resultBitmapCpu.Save(resultPathCpu);
|
||||
|
||||
Console.WriteLine(">> Blurring on GPU");
|
||||
|
||||
using Bitmap resultBitmapGpu = HlslConvolutionManager.Create(60, 10).Apply(sourceBitmap);
|
||||
|
||||
string resultPathGpu = Path.Combine(
|
||||
Path.GetRelativePath(Path.GetDirectoryName(path)!, @"..\..\..\"),
|
||||
$"{Path.GetFileNameWithoutExtension(path)}_gpu{Path.GetExtension(path)}");
|
||||
|
||||
Console.WriteLine(">> Saving image");
|
||||
|
||||
resultBitmapGpu.Save(resultPathGpu);
|
||||
}
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする