refactor!: rename Titano to Chronos and move CI and releases to Gitea (#6)
CI / Build and test (push) Successful in 8m14s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 13m19s
CI / PostgreSQL 16 integration (push) Successful in 4m49s
CI / PostgreSQL 17 integration (push) Successful in 5m28s
CI / Docker image (push) Successful in 53s
Release / Server image (push) Failing after 10s
CI / Build and test (push) Successful in 8m14s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 13m19s
CI / PostgreSQL 16 integration (push) Successful in 4m49s
CI / PostgreSQL 17 integration (push) Successful in 5m28s
CI / Docker image (push) Successful in 53s
Release / Server image (push) Failing after 10s
The owner renamed the product and moved the repository to the self-hosted Gitea (https://gitea.encke-hake.ts.net/BalboSoft/Chronos) for more control, and asked for Actions and a first automatic release with the server package and the Windows exe (docs/requests/2026-10-23-chronos-gitea.md). - Chronos everywhere: a byte-exact rename of contents and paths, then a per-language review of the forms the old name's ending had dictated. - Gitea instead of GitHub: the update check, licence, issue and support links read ChronosReleasesUrl; the update check takes the highest stable version, offers a pre-release build its final release and reports a repository it cannot see as a failed check. EULA, security policy and Gitea issue forms live at the repository root. - Gitea Actions for the Linux act_runner (.gitea/workflows): CI, release, nightly image and performance gates in the .NET SDK container with git checkout and the system SQLite. The release cross-compiles the Windows programs, checks their icon, version and DPI manifest, packs installers and zips, publishes the Gitea release and pushes the server image (REGISTRY_TOKEN). Windows-only tests run in an opt-in job on a Windows runner (WINDOWS_RUNNER). - New Chronos.Tools commands: zip, gitea-release, postgres-ci (replaces the docker-exec script, which Gitea's service containers do not allow; the throw-away server runs without durability) and pe-check. - Timed tests take their budget from TestTiming (CHRONOS_TEST_TIME_FACTOR, 3 on the shared runner; the weekly performance gates keep theirs). BREAKING CHANGE: programs, settings, data folders, file types, environment variables and the Docker image use the new name; nothing is migrated from Titano, which never had a release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #6.
This commit is contained in:
1 parent
c99842cc86
commit
f2b58522b9
1801 files changed
+11804
-10676
No files matched your search
@@ -0,0 +1,56 @@
|
||||
using Chronos.Core.Imaging.Geometry;
|
||||
using Chronos.Testing;
|
||||
|
||||
namespace Chronos.Core.Tests.Geometry;
|
||||
|
||||
public sealed class Affine2DTests
|
||||
{
|
||||
[Test]
|
||||
public void CompositionAppliesInnerFirst()
|
||||
{
|
||||
var scale = Affine2D.Scaling(2, 3);
|
||||
var move = Affine2D.Translation(5, -1);
|
||||
var (x, y) = (move * scale).Apply(1, 1);
|
||||
Assert.Approximately(7, x, 1e-15);
|
||||
Assert.Approximately(2, y, 1e-15);
|
||||
Assert.Equal(move * scale, scale.Then(move));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InverseUndoesTheMap()
|
||||
{
|
||||
var map = Affine2D.Similarity(1.3, 0.4, 12, -7) * Affine2D.Scaling(1, 0.8);
|
||||
var inverse = map.Invert();
|
||||
Assert.True((inverse * map).IsIdentity(1e-12));
|
||||
Assert.True((map * inverse).IsIdentity(1e-12));
|
||||
var (x, y) = map.Apply(3.5, -2.25);
|
||||
var (bx, by) = inverse.Apply(x, y);
|
||||
Assert.Within(3.5, -2.25, bx, by, 1e-12);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SingularMapsDoNotInvert()
|
||||
{
|
||||
Assert.False(new Affine2D(1, 2, 2, 4, 0, 0).TryInvert(out _));
|
||||
Assert.Throws<InvalidOperationException>(() => Affine2D.Scaling(0, 1).Invert());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RotationAboutPivotKeepsThePivot()
|
||||
{
|
||||
var map = Affine2D.About(Affine2D.Rotation(0.7), 40, 30);
|
||||
var (x, y) = map.Apply(40, 30);
|
||||
Assert.Within(40, 30, x, y, 1e-12);
|
||||
var (vx, vy) = map.ApplyVector(1, 0);
|
||||
Assert.Within(double.Cos(0.7), double.Sin(0.7), vx, vy, 1e-15);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SimilarityDecomposes()
|
||||
{
|
||||
var map = Affine2D.Similarity(1.25, -0.3, 4, 5);
|
||||
Assert.Approximately(1.25, map.Scale, 1e-12);
|
||||
Assert.Approximately(-0.3, map.Angle, 1e-12);
|
||||
Assert.Approximately(1.25 * 1.25, map.Determinant, 1e-12);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using Chronos.Core.Imaging.Geometry;
|
||||
using Chronos.Testing;
|
||||
|
||||
namespace Chronos.Core.Tests.Geometry;
|
||||
|
||||
public sealed class AspectRatioTests
|
||||
{
|
||||
[Theory]
|
||||
[Case(1920.0, 1080.0, 1, 1, 420.0, 0.0, 1080.0, 1080.0)]
|
||||
[Case(1920.0, 1080.0, 9, 16, 656.25, 0.0, 607.5, 1080.0)]
|
||||
[Case(4000.0, 3000.0, 16, 9, 0.0, 375.0, 4000.0, 2250.0)]
|
||||
[Case(6000.0, 4000.0, 3, 2, 0.0, 0.0, 6000.0, 4000.0)]
|
||||
[Case(1080.0, 1920.0, 4, 5, 0.0, 285.0, 1080.0, 1350.0)]
|
||||
[Case(3840.0, 2160.0, 21, 9, 0.0, 257.142857142857, 3840.0, 1645.71428571429)]
|
||||
public void FitCropCentresTheLargestCrop(double bw, double bh, int w, int h, double x, double y, double cw, double ch)
|
||||
{
|
||||
var crop = AspectRatio.FitCrop(RectD.FromSize(bw, bh), AspectRatio.Custom(w, h).Resolve(bw, bh));
|
||||
Assert.Approximately(x, crop.X, 1e-9);
|
||||
Assert.Approximately(y, crop.Y, 1e-9);
|
||||
Assert.Approximately(cw, crop.Width, 1e-9);
|
||||
Assert.Approximately(ch, crop.Height, 1e-9);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[Case(-1.0, 100.0)]
|
||||
[Case(0.0, 280.0)]
|
||||
[Case(1.0, 460.0)]
|
||||
[Case(5.0, 460.0)]
|
||||
[Case(-0.5, 190.0)]
|
||||
public void FitCropOffsetMovesWithinTheSlack(double offset, double expectedX)
|
||||
{
|
||||
var crop = AspectRatio.FitCrop(new RectD(100, 50, 720, 360), 1.0, offset, offset);
|
||||
Assert.Approximately(expectedX, crop.X, 1e-9);
|
||||
Assert.Approximately(50, crop.Y, 1e-9);
|
||||
Assert.Approximately(360, crop.Width, 1e-9);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PresetsAndParsing()
|
||||
{
|
||||
Assert.Equal(AspectRatio.Widescreen, AspectRatio.Custom(32, 18));
|
||||
Assert.Equal("16:9", AspectRatio.Widescreen.ToString());
|
||||
Assert.Equal("9:16", AspectRatio.Vertical.ToString());
|
||||
Assert.Equal(8, AspectRatio.Presets.Count);
|
||||
Assert.Approximately(1.5, AspectRatio.Source.Resolve(6000, 4000), 1e-15);
|
||||
Assert.Approximately(21.0 / 9, AspectRatio.Cinema.Resolve(6000, 4000), 1e-15);
|
||||
Assert.True(AspectRatio.TryParse("4/5", out var portrait));
|
||||
Assert.Equal(AspectRatio.Portrait, portrait);
|
||||
Assert.True(AspectRatio.TryParse("source", out var source));
|
||||
Assert.True(source.IsSource);
|
||||
Assert.False(AspectRatio.TryParse("16:0", out _));
|
||||
Assert.False(AspectRatio.TryParse("wide", out _));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
using Chronos.Core.Imaging;
|
||||
using Chronos.Core.Imaging.Geometry;
|
||||
using Chronos.Core.Tests.Motion;
|
||||
using Chronos.Testing;
|
||||
|
||||
namespace Chronos.Core.Tests.Geometry;
|
||||
|
||||
public sealed class GeometryStageTests
|
||||
{
|
||||
private const int Size = 128;
|
||||
|
||||
private readonly TestContext _context;
|
||||
|
||||
public GeometryStageTests(TestContext context) => _context = context;
|
||||
|
||||
[Test]
|
||||
public void IdentityWarpReproducesTheImage()
|
||||
{
|
||||
using var source = Texture(sigma: 1.0);
|
||||
using var output = GeometryStage.Apply(source, new GeometrySettings());
|
||||
Assert.Equal(Size, output.Width);
|
||||
Assert.Equal(3, output.Channels);
|
||||
var psnr = SyntheticImages.Psnr(source.Plane(1), output.Plane(1), Size, 0, 0, Size, Size);
|
||||
_context.Log($"identity PSNR {psnr:F1} dB");
|
||||
Assert.GreaterOrEqual(psnr, 60);
|
||||
Assert.True(source.Data.SequenceEqual(output.Data));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void HalfPixelShiftAndBackStaysWithinBounds()
|
||||
{
|
||||
using var source = Texture(sigma: 2.0);
|
||||
using var shifted = new ImageBuffer(Size, Size);
|
||||
using var back = new ImageBuffer(Size, Size);
|
||||
GeometryStage.Warp(source, shifted, Affine2D.Translation(0.5, 0.5));
|
||||
GeometryStage.Warp(shifted, back, Affine2D.Translation(-0.5, -0.5));
|
||||
var psnr = SyntheticImages.Psnr(source.Plane(0), back.Plane(0), Size, 4, 4, Size - 4, Size - 4);
|
||||
_context.Log($"0.5 px round trip PSNR {psnr:F1} dB");
|
||||
Assert.GreaterOrEqual(psnr, 40);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void LinearRampsAreReproducedUnderSubPixelWarps()
|
||||
{
|
||||
using var ramp = new ImageBuffer(64, 64, 1);
|
||||
for (var y = 0; y < 64; y++)
|
||||
for (var x = 0; x < 64; x++)
|
||||
ramp[0, x, y] = 0.01f * x + 0.005f * y;
|
||||
using var output = new ImageBuffer(64, 64, 1);
|
||||
var map = Affine2D.About(Affine2D.Similarity(0.8, 0.2, 0, 0), 32, 32);
|
||||
GeometryStage.Warp(ramp, output, map);
|
||||
for (var y = 8; y < 56; y++)
|
||||
{
|
||||
for (var x = 8; x < 56; x++)
|
||||
{
|
||||
var (sx, sy) = map.Apply(x, y);
|
||||
Assert.Approximately(0.01 * sx + 0.005 * sy, output[0, x, y], 2e-6);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TransparentBordersCarryCoverage()
|
||||
{
|
||||
using var source = Texture(sigma: 1.0);
|
||||
using var output = GeometryStage.Apply(source, new GeometrySettings
|
||||
{
|
||||
Warp = Affine2D.Translation(-10, 0),
|
||||
Border = BorderMode.Transparent,
|
||||
});
|
||||
Assert.Equal(4, output.Channels);
|
||||
for (var y = 0; y < Size; y += 7)
|
||||
{
|
||||
Assert.Equal(0f, output[3, 3, y]);
|
||||
Assert.Equal(0f, output[0, 3, y]);
|
||||
Assert.Equal(1f, output[3, 40, y]);
|
||||
Assert.Equal(source[1, 30, y], output[1, 40, y]);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ClampReplicatesEdges()
|
||||
{
|
||||
using var source = Texture(sigma: 1.0);
|
||||
using var output = GeometryStage.Apply(source, new GeometrySettings { Warp = Affine2D.Translation(-10, 0) });
|
||||
for (var y = 0; y < Size; y += 5) Assert.Approximately(source[2, 0, y], output[2, 2, y], 1e-6);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PlanFitsAspectAndMapsPixelCentres()
|
||||
{
|
||||
var plan = GeometryStage.Plan(1920, 1080, new GeometrySettings { Aspect = AspectRatio.Square, OutputWidth = 540 });
|
||||
Assert.Equal(540, plan.OutputWidth);
|
||||
Assert.Equal(540, plan.OutputHeight);
|
||||
Assert.Equal(new RectD(420, 0, 1080, 1080), plan.Crop);
|
||||
var (x, y) = plan.OutputToSource.Apply(0, 0);
|
||||
Assert.Within(420.5, 0.5, x, y, 1e-12);
|
||||
|
||||
var cropped = GeometryStage.Plan(800, 600, new GeometrySettings { Crop = new RectD(100, 50, 200, 100), OutputWidth = 400, OutputHeight = 200 });
|
||||
Assert.Equal(new RectD(100, 50, 200, 100), cropped.Crop);
|
||||
var (cx, cy) = cropped.OutputToSource.Apply(0, 0);
|
||||
Assert.Within(99.75, 49.75, cx, cy, 1e-12);
|
||||
|
||||
var vertical = GeometryStage.Plan(1920, 1080, new GeometrySettings { Aspect = AspectRatio.Vertical, OutputHeight = 1920 });
|
||||
Assert.Equal(1080, vertical.OutputWidth);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DownscalingDoesNotAlias()
|
||||
{
|
||||
using var checker = new ImageBuffer(256, 256, 1);
|
||||
for (var y = 0; y < 256; y++)
|
||||
for (var x = 0; x < 256; x++)
|
||||
checker[0, x, y] = (x + y) % 2 == 0 ? 1f : 0f;
|
||||
using var small = GeometryStage.Apply(checker, new GeometrySettings { OutputWidth = 64 });
|
||||
Assert.Equal(64, small.Height);
|
||||
for (var y = 2; y < 62; y++)
|
||||
for (var x = 2; x < 62; x++)
|
||||
Assert.Approximately(0.5, small[0, x, y], 0.02);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CancellationStopsTheWarp()
|
||||
{
|
||||
using var source = Texture(sigma: 1.0);
|
||||
using var cts = new CancellationTokenSource();
|
||||
cts.Cancel();
|
||||
Assert.Throws<OperationCanceledException>(() => GeometryStage.Apply(source, new GeometrySettings(), cts.Token));
|
||||
}
|
||||
|
||||
private static ImageBuffer Texture(double sigma) =>
|
||||
SyntheticImages.ToRgb(SyntheticImages.Crop(SyntheticImages.Noise(Size, sigma, seed: 21), Size, 0, 0, Size, Size), Size, Size);
|
||||
}
|
||||
Reference in new issue
Block a user