画像加工にGPU委譲の明示フラグを追加

このコミットが含まれているのは:
routersys committed 2026-07-05 16:12:26 +09:00
1 親 50b20e3060
コミット ce7b15121c
1ファイル変更
+6 -6
+6 -6
ファイルの表示
@@ -511,7 +511,7 @@ namespace LuaScript
private byte[]? _resizeSource;
private byte[]? _resizeBuffer;
public unsafe void FillBuffer(double r, double g, double b, double a, int x, int y, int w, int h)
public unsafe void FillBuffer(double r, double g, double b, double a, int x, int y, int w, int h, bool accelerate = false)
{
EnsurePixelBuffer();
if (_pixelBuffer is null)
@@ -526,7 +526,7 @@ namespace LuaScript
if (x1 <= x0 || y1 <= y0)
return;
if (PixelProcessor?.TryFill(_pixelBuffer, cw, ch, r, g, b, a, x0, y0, x1 - x0, y1 - y0) == true)
if (accelerate && PixelProcessor?.TryFill(_pixelBuffer, cw, ch, r, g, b, a, x0, y0, x1 - x0, y1 - y0) == true)
{
_isPixelsDirty = true;
return;
@@ -621,7 +621,7 @@ namespace LuaScript
}
}
public unsafe void Convolve(double[] kernel, int size, double divisor, double offset)
public unsafe void Convolve(double[] kernel, int size, double divisor, double offset, bool accelerate = false)
{
EnsurePixelBuffer();
if (_pixelBuffer is null)
@@ -629,7 +629,7 @@ namespace LuaScript
int cw = ImageWidth;
int ch = ImageHeight;
if (PixelProcessor?.TryConvolve(_pixelBuffer, cw, ch, kernel, size, divisor, offset) == true)
if (accelerate && PixelProcessor?.TryConvolve(_pixelBuffer, cw, ch, kernel, size, divisor, offset) == true)
{
_isPixelsDirty = true;
return;
@@ -639,7 +639,7 @@ namespace LuaScript
PixelBufferSoftwareProcessor.Convolve(_pixelBuffer, cw, ch, kernel, size, divisor, offset, ref _convolveSource);
}
public unsafe void Resize(int newWidth, int newHeight, bool linear)
public unsafe void Resize(int newWidth, int newHeight, bool linear, bool accelerate = false)
{
EnsurePixelBuffer();
if (_pixelBuffer is null)
@@ -650,7 +650,7 @@ namespace LuaScript
int cw = ImageWidth;
int ch = ImageHeight;
if (PixelProcessor?.TryResize(_pixelBuffer, cw, ch, newWidth, newHeight, linear, out var processed) == true && processed is not null)
if (accelerate && PixelProcessor?.TryResize(_pixelBuffer, cw, ch, newWidth, newHeight, linear, out var processed) == true && processed is not null)
{
ReplaceBuffer(processed, newWidth, newHeight);
return;