広いカーネル半径の余白と届く範囲の試験を追加する

このコミットが含まれているのは:
routersys committed 2026-10-01 20:18:06 +09:00
1 親 06ba0070e9
コミット 2434dbf08b
2ファイル変更
+38

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

+23
ファイルの表示
@@ -204,6 +204,29 @@ public sealed class WaveOpticsEffectProcessorTests
AssertSameAsSource(rendering, source);
}
[Theory]
[InlineData(40, 8192 - 40 * 2, true)]
[InlineData(40, 8192 - 40 * 2 + 1, false)]
[InlineData(63, 8192 - 64 * 2, true)]
[InlineData(63, 8192 - 64 * 2 + 1, false)]
public void AWideKernelRadiusKeepsRoomForItsOwnMargin(int radius, int width, bool blurred)
{
using var devices = new GraphicsDevices();
using var context = devices.CreateContext();
if (blurred)
RequireInterop(context);
using var source = SourceImage.Solid(context, width, 8, Gray);
using var processor = new WaveOpticsEffect { KernelRadius = radius }.CreateVideoEffect(context);
processor.SetInput(source.Bitmap);
var rendering = RenderFrame(context, processor, 0);
if (blurred)
Assert.True(HasLightOutside(rendering, source));
else
AssertSameAsSource(rendering, source);
}
public static readonly TheoryData<string, Action<WaveOpticsEffect>> Animations = new()
{
{ nameof(WaveOpticsEffect.Amount), effect => effect.Amount.CopyFrom(Linear(20d, 100d)) },
+15
ファイルの表示
@@ -246,6 +246,21 @@ public sealed class WaveOpticsPipelineTests
Assert.Equal((40 - 5, 40 - 5, 56 + 5, 56 + 5), bounds);
}
[Theory]
[InlineData(40)]
[InlineData(WaveOpticsSettings.MaximumKernelRadius)]
public void AWideKernelRadiusCarriesTheBlurToItsEdge(int radius)
{
using var pipeline = CreatePipeline();
var start = radius + 8;
var size = start * 2 + 32;
var source = Square(size, size, start, start, 32, 32);
var bounds = LitBounds(Render(pipeline, source, size, size, Parameters(gain: 4f, kernelRadius: radius, fNumber: 32f, pixelPitch: 0.25f)), size);
Assert.Equal((start - radius, start - radius, start + 32 + radius, start + 32 + radius), bounds);
}
[Fact]
public void TheGainScalesTheBlurredImage()
{