ハーネスのケースと基準値を加える

このコミットが含まれているのは:
routersys committed 2026-10-25 13:06:31 +09:00
1 親 25278a5b84
コミット 1a62017331
3ファイル変更
+322 -7

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

+27
ファイルの表示
@@ -0,0 +1,27 @@
using System.Reflection;
using YukkuriMovieMaker.Plugin;
namespace PartialInnerOutline.Harness;
internal static class BrushPluginHost
{
const string HostAssemblyName = "YukkuriMovieMaker";
const string SolidColorPluginTypeName = "YukkuriMovieMaker.Plugin.Brush.SolidColorBrushPlugin";
static readonly Lock Gate = new();
static bool registered;
public static void Register()
{
lock (Gate)
{
if (registered)
return;
var type = Assembly.Load(HostAssemblyName).GetType(SolidColorPluginTypeName, throwOnError: true)!;
var plugin = (IPlugin)Activator.CreateInstance(type, nonPublic: true)!;
typeof(PluginLoader).GetProperty(nameof(PluginLoader.Plugins))!.SetValue(null, new[] { plugin });
registered = true;
}
}
}
+72 -7
ファイルの表示
@@ -1,21 +1,86 @@
using YukkuriMovieMaker.Plugin.Effects;
using System.Globalization;
using YukkuriMovieMaker.Commons;
using YukkuriMovieMaker.Json;
using YukkuriMovieMaker.Project;
namespace PartialInnerOutline.Harness;
internal static class HarnessCases
{
public static IEnumerable<(string Name, IVideoEffect Effect, IReadOnlyList<int> Frames)> All()
public static IEnumerable<(string Name, PartialInnerOutlineEffect Effect, IReadOnlyList<int> Frames)> All()
{
yield break;
yield return ("default", Create(), [0]);
yield return ("thickness-animated-frames", Create(effect => effect.Thickness.CopyFrom(Linear(1d, 24d))), [0, 100, 200, 299]);
yield return ("band-direction-animated-frames", Create(effect => effect.BandDirection.CopyFrom(Linear(0d, 360d))), [0, 100, 200, 299]);
yield return ("band-position-animated-frames", Create(effect => effect.BandPosition.CopyFrom(Linear(-100d, 100d))), [0, 100, 200, 299]);
yield return ("blur-animated-frames", Create(effect => effect.Blur.CopyFrom(Linear(0d, 12d))), [0, 100, 200, 299]);
yield return ("thickness-1", Create(effect => effect.Thickness.Values[0].Value = 1), [0]);
yield return ("thickness-8", Create(effect => effect.Thickness.Values[0].Value = 8), [0]);
yield return ("thickness-24", Create(effect => effect.Thickness.Values[0].Value = 24), [0]);
yield return ("quality-3", Create(effect => effect.Quality.Values[0].Value = 3), [0]);
yield return ("quality-8", Create(effect => effect.Quality.Values[0].Value = 8), [0]);
yield return ("smoothness-0", Create(effect => effect.Smoothness.Values[0].Value = 0), [0]);
yield return ("smoothness-50", Create(effect => effect.Smoothness.Values[0].Value = 50), [0]);
yield return ("angular", Create(effect => { effect.Thickness.Values[0].Value = 12; effect.IsAngular = true; }), [0]);
yield return ("band-direction-0", Create(effect => effect.BandDirection.Values[0].Value = 0), [0]);
yield return ("band-direction-45", Create(effect => effect.BandDirection.Values[0].Value = 45), [0]);
yield return ("band-direction-180-position-60", Create(effect => { effect.BandDirection.Values[0].Value = 180; effect.BandPosition.Values[0].Value = 60; }), [0]);
yield return ("band-position-minus-60", Create(effect => effect.BandPosition.Values[0].Value = -60), [0]);
yield return ("band-position-60", Create(effect => effect.BandPosition.Values[0].Value = 60), [0]);
yield return ("band-width-30", Create(effect => effect.BandWidth.Values[0].Value = 30), [0]);
yield return ("band-width-200", Create(effect => effect.BandWidth.Values[0].Value = 200), [0]);
yield return ("band-softness-0", Create(effect => effect.BandSoftness.Values[0].Value = 0), [0]);
yield return ("band-softness-100", Create(effect => effect.BandSoftness.Values[0].Value = 100), [0]);
yield return ("opacity-0", Create(effect => effect.Opacity.Values[0].Value = 0), [0]);
yield return ("opacity-50", Create(effect => effect.Opacity.Values[0].Value = 50), [0]);
yield return ("blur-4", Create(effect => effect.Blur.Values[0].Value = 4), [0]);
yield return ("blur-12", Create(effect => effect.Blur.Values[0].Value = 12), [0]);
yield return ("blend-add", Create(effect => effect.Blend = Blend.Add), [0]);
yield return ("blend-multiply", Create(effect => effect.Blend = Blend.Multiply), [0]);
yield return ("outline-only", Create(effect => effect.IsOutlineOnly = true), [0]);
}
public static IEnumerable<(string Name, Func<IVideoEffect> Create, Action<IVideoEffect> Change, int Frame)> Transitions()
public static IEnumerable<(string Name, Func<PartialInnerOutlineEffect> Create, Action<PartialInnerOutlineEffect> Change, int Frame)> Transitions()
{
yield break;
yield return ("thickness-3-to-10", () => Create(), effect => effect.Thickness.Values[0].Value = 10, 0);
yield return ("thickness-10-to-3", () => Create(effect => effect.Thickness.Values[0].Value = 10), effect => effect.Thickness.Values[0].Value = 3, 0);
yield return ("thickness-3-to-0", () => Create(), effect => effect.Thickness.Values[0].Value = 0, 0);
yield return ("thickness-0-to-3", () => Create(effect => effect.Thickness.Values[0].Value = 0), effect => effect.Thickness.Values[0].Value = 3, 0);
yield return ("quality-64-to-8", () => Create(), effect => effect.Quality.Values[0].Value = 8, 0);
yield return ("smoothness-100-to-0", () => Create(), effect => effect.Smoothness.Values[0].Value = 0, 0);
yield return ("angular-off-to-on", () => Create(), effect => effect.IsAngular = true, 0);
yield return ("band-direction-90-to-0", () => Create(), effect => effect.BandDirection.Values[0].Value = 0, 0);
yield return ("band-position-0-to-50", () => Create(), effect => effect.BandPosition.Values[0].Value = 50, 0);
yield return ("band-width-100-to-30", () => Create(), effect => effect.BandWidth.Values[0].Value = 30, 0);
yield return ("band-softness-30-to-0", () => Create(), effect => effect.BandSoftness.Values[0].Value = 0, 0);
yield return ("opacity-100-to-50", () => Create(), effect => effect.Opacity.Values[0].Value = 50, 0);
yield return ("opacity-100-to-0", () => Create(), effect => effect.Opacity.Values[0].Value = 0, 0);
yield return ("opacity-0-to-100", () => Create(effect => effect.Opacity.Values[0].Value = 0), effect => effect.Opacity.Values[0].Value = 100, 0);
yield return ("blur-0-to-8", () => Create(), effect => effect.Blur.Values[0].Value = 8, 0);
yield return ("blend-normal-to-multiply", () => Create(), effect => effect.Blend = Blend.Multiply, 0);
yield return ("blend-multiply-to-add", () => Create(effect => effect.Blend = Blend.Multiply), effect => effect.Blend = Blend.Add, 0);
yield return ("outline-only-off-to-on", () => Create(), effect => effect.IsOutlineOnly = true, 0);
yield return ("outline-only-on-to-off", () => Create(effect => effect.IsOutlineOnly = true), effect => effect.IsOutlineOnly = false, 0);
}
public static IEnumerable<(string Name, IVideoEffect Effect)> Benchmarks()
public static IEnumerable<(string Name, PartialInnerOutlineEffect Effect)> Benchmarks()
{
yield break;
yield return ("default", Create());
yield return ("thickness-24", Create(effect => effect.Thickness.Values[0].Value = 24));
yield return ("thickness-animated", Create(effect => effect.Thickness.CopyFrom(Linear(1d, 24d))));
yield return ("band-direction-animated", Create(effect => effect.BandDirection.CopyFrom(Linear(0d, 360d))));
yield return ("blur-animated", Create(effect => effect.Blur.CopyFrom(Linear(0d, 12d))));
}
static Animation Linear(double from, double to)
=> Json.LoadFromText<Animation>(string.Create(CultureInfo.InvariantCulture, $$"""{"AnimationType":"直線移動","Values":[{"Value":{{from}}},{"Value":{{to}}}]}""")) ?? throw new HarnessException("アニメーションを読み込めません。");
public static PartialInnerOutlineEffect Create(Action<PartialInnerOutlineEffect>? configure = null)
{
BrushPluginHost.Register();
var effect = new PartialInnerOutlineEffect();
((dynamic)effect.Brush.Parameter).Color = System.Windows.Media.Colors.Crimson;
configure?.Invoke(effect);
return effect;
}
}
+223
ファイルの表示
@@ -0,0 +1,223 @@
{
"adapter": "Intel(R) Iris(R) Xe Graphics",
"driver": "32.0.101.7085",
"input": "synthetic 640x480 89838D8976198E40",
"canvas": "1280x720",
"cases": [
{
"name": "default",
"frames": [
0
],
"hash": "80E3F994F559192E3AAD3880D63A3DDCB082068369D980F7C5A3192C65805E85"
},
{
"name": "thickness-animated-frames",
"frames": [
0,
100,
200,
299
],
"hash": "52165447E3A9E4AB51C590CBCC4ED6D185DC39FD9923DE8543A96C7151F29874"
},
{
"name": "band-direction-animated-frames",
"frames": [
0,
100,
200,
299
],
"hash": "4B1EF8FB97FD55FAB81BF97F33738E6EBD2111465A68C26D2E9A33045B7A1AE0"
},
{
"name": "band-position-animated-frames",
"frames": [
0,
100,
200,
299
],
"hash": "06354627B871591F1E325FF2909D20CD2722CC94B81D7A1ED3E570C18916CD50"
},
{
"name": "blur-animated-frames",
"frames": [
0,
100,
200,
299
],
"hash": "C5ECB468FE6FAC1A82D0D30692AC78FCC7A1A5C3DF2F1C89982DCD50EA332466"
},
{
"name": "thickness-1",
"frames": [
0
],
"hash": "AC13DC6F17724D83ECE9E8208D8BAA29BC42BBBA6EA684E719A31B312D7DC94E"
},
{
"name": "thickness-8",
"frames": [
0
],
"hash": "0B39863016618CB5B4389D093F3B02975096F8419A86DBD1859C7F8AFBCE9D04"
},
{
"name": "thickness-24",
"frames": [
0
],
"hash": "69F4BF304C947A9EA5FA374F1416DA3A5A29ED21F90BFA66C1A76331C4A5A5EC"
},
{
"name": "quality-3",
"frames": [
0
],
"hash": "0ED5D81E3FB472ECFBF75FD26750DE9C7B0CEA9560F4A50B9E23BE45B70DB9B8"
},
{
"name": "quality-8",
"frames": [
0
],
"hash": "B0CA4F4523342DE33EFFCB8B78D6994AB1F0D28DC019A34CAEAD8509A5803C07"
},
{
"name": "smoothness-0",
"frames": [
0
],
"hash": "84A5C36E15A18A87954FC4D41A16C182B90F821177FFA08E641AA1B9FF476D20"
},
{
"name": "smoothness-50",
"frames": [
0
],
"hash": "9A1DB3B2CE6E601DCE4339673F1FB6AA1A8B9217AE472E1FFF5793AEEEC4BBA3"
},
{
"name": "angular",
"frames": [
0
],
"hash": "6489DFBEFA599C97A55360D2F46A52DF2E3945A535AD7C268BDBB67444C7280D"
},
{
"name": "band-direction-0",
"frames": [
0
],
"hash": "78964B616B97CD1976CC90FCFFBAD55BC66A4F5429BE45A67DE59D74A1706924"
},
{
"name": "band-direction-45",
"frames": [
0
],
"hash": "B0C94A6FAA93770A193F77D57E2DA08C6FBF8094A56A613CAA86C85DDFF391E1"
},
{
"name": "band-direction-180-position-60",
"frames": [
0
],
"hash": "83B5D9E2EB4AF36B33AA75C8CBCCE081ACE51D501D937D313D6031CD44FDDD5F"
},
{
"name": "band-position-minus-60",
"frames": [
0
],
"hash": "A9888B8BB3007ACABE5ACFF4C320624320CD10EB0069BB6D4B3795E8D41C544D"
},
{
"name": "band-position-60",
"frames": [
0
],
"hash": "620295BF1C3195ACC9AFB07AF31D89C8BB697795C65B3747EADDCCF6C90C1138"
},
{
"name": "band-width-30",
"frames": [
0
],
"hash": "25D5DE8E0D23037BEC72AC53ED7E18ECED0C7C7B44B12400A52E4668B5AA87AC"
},
{
"name": "band-width-200",
"frames": [
0
],
"hash": "D894A40AB1E0AE4346BC23E66EB14BC524A23DAFA9F813580DEC10EBE9BC6B3E"
},
{
"name": "band-softness-0",
"frames": [
0
],
"hash": "41EE8736988B19805724386B2FB7622504BF657DC5B60E7D638C8875B62A82F3"
},
{
"name": "band-softness-100",
"frames": [
0
],
"hash": "34FDB5ABD0428D5868B34CD123913AAA19FEC848DFCAE77B92E383F83407E4EE"
},
{
"name": "opacity-0",
"frames": [
0
],
"hash": "0A700F76CEDDBAD7C4B6A2C19D46939C1A93940E86C6EFEF1E5A53DB48D2A020"
},
{
"name": "opacity-50",
"frames": [
0
],
"hash": "F641BC48C3096A104C12519EE2CA40BFCD77DA8359C648AA6BA9356958DC8782"
},
{
"name": "blur-4",
"frames": [
0
],
"hash": "A707F6EFF0BC9AD4847B38C84541B056FA976782E3D857AEAD11535EC31C1393"
},
{
"name": "blur-12",
"frames": [
0
],
"hash": "F94C5B356122C6ACE07BC52CAF72FB0F4D739861CCF9E028C0951B4DF13E8246"
},
{
"name": "blend-add",
"frames": [
0
],
"hash": "CF6DA6B2E42DC7378F5EEA57BDA95A9ECCC375A023BA407313A7B99969F15FE0"
},
{
"name": "blend-multiply",
"frames": [
0
],
"hash": "FFCCAD8DD4F0D73070070A3DA418C278D0D7A4EDCF4F36E1F422071FA0359381"
},
{
"name": "outline-only",
"frames": [
0
],
"hash": "6FC7737B6FA5A62A4195299EF27BBF92058A1613D9F240B0C4E17F82CEBCC95A"
}
]
}