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,195 @@
|
||||
using Chronos.Core.Advice;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Core.Render;
|
||||
using Chronos.Ui.Visuals;
|
||||
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>The measuring tools of the Exposure tab (BRIEF §12.3 "luminance/waveform charts").</summary>
|
||||
public enum ExposureChart
|
||||
{
|
||||
/// <summary>Measured luminance against the target curve, sky region and exposure steps.</summary>
|
||||
Luminance,
|
||||
|
||||
/// <summary>Frame-to-frame luminance change before and after the correction.</summary>
|
||||
Flicker,
|
||||
|
||||
/// <summary>Luma waveform of the corrected frame on screen.</summary>
|
||||
Waveform,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Exposure (BRIEF §12.3): deflicker, regions, holy-grail transitions and white balance. The luminance chart shows the
|
||||
/// measured luminance (Sun) against the target curve the corrections produce (Accent), the sky region (dashed) and the
|
||||
/// exposure steps as received; the flicker chart the frame-to-frame change before and after correction; the waveform
|
||||
/// the luma distribution of the corrected frame on screen.
|
||||
/// </summary>
|
||||
public sealed class ExposureTab : EditorTab
|
||||
{
|
||||
private IReadOnlyList<ChartSeries> _series = [];
|
||||
private IReadOnlyList<ChartLegendItem> _legend = [];
|
||||
private IReadOnlyList<TimelineMarker> _markers = [];
|
||||
private string? _summary;
|
||||
private ExposureChart _chartMode;
|
||||
|
||||
public ExposureTab(EditorViewModel editor)
|
||||
: base(editor, "Exposure", AdvisorSection.Exposure)
|
||||
{
|
||||
var s = editor.Session;
|
||||
// The same rule as the Edit path's (EditorSettings.Applies): a row shown n/a is never asked for.
|
||||
string? NoDeflicker(ProjectSettings p) =>
|
||||
EditorSettings.Applies(EditorSettings.DeflickerWindow, p, s.Content.Deep) ? null : Loc.L("Tooltips.Editor.NotApplicable.DeflickerOff");
|
||||
string? NoHolyGrail(ProjectSettings p) =>
|
||||
EditorSettings.Applies(EditorSettings.TransitionLength, p, s.Content.Deep) ? null : Loc.L("Tooltips.Editor.NotApplicable.HolyGrailOff");
|
||||
Rows =
|
||||
[
|
||||
new AutoSwitchRow(s, EditorSettings.Deflicker, "Editor.Exposure.Deflicker", "Tooltips.Editor.Exposure.Deflicker"),
|
||||
new AutoNumberRow<int>(s, EditorSettings.DeflickerWindow, "Editor.Exposure.Window", "Tooltips.Editor.Exposure.Window", 5, 151, 2, "0", NoDeflicker),
|
||||
new AutoNumberRow<double>(s, EditorSettings.DeflickerStrength, "Editor.Exposure.Strength", "Tooltips.Editor.Exposure.Strength", 0, 1, 0.05, "0.00", NoDeflicker),
|
||||
new AutoChoiceRow<RegionMode>(s, EditorSettings.Regions, "Editor.Exposure.Regions", "Tooltips.Editor.Exposure.Regions",
|
||||
[
|
||||
new Choice(RegionMode.Off, "Editor.Value.Off"), new Choice(RegionMode.Auto, "Editor.Regions.Auto"),
|
||||
new Choice(RegionMode.Horizon, "Editor.Regions.Horizon"), new Choice(RegionMode.Luminance, "Editor.Regions.Luminance"),
|
||||
], NoDeflicker),
|
||||
new AutoSwitchRow(s, EditorSettings.HolyGrail, "Editor.Exposure.HolyGrail", "Tooltips.Editor.Exposure.HolyGrail"),
|
||||
new AutoNumberRow<int>(s, EditorSettings.TransitionLength, "Editor.Exposure.Transitions", "Tooltips.Editor.Exposure.Transitions", 0, 120, 1, "0", NoHolyGrail),
|
||||
new AutoSwitchRow(s, EditorSettings.WhiteBalance, "Editor.Exposure.WhiteBalance", "Tooltips.Editor.Exposure.WhiteBalance"),
|
||||
new InfoRow("Editor.Exposure.Temperature", "Tooltips.Editor.Exposure.Temperature", Temperature),
|
||||
new NumberRow(s, "Editor.Exposure.Offset", "Tooltips.Editor.Exposure.Offset", -3, 3, 0.1, p => p.Exposure.ExposureOffsetEv,
|
||||
(p, v) => p with { Exposure = p.Exposure with { ExposureOffsetEv = v } }, v => Loc.L("Editor.Value.Ev", EditorText.Ev(v))),
|
||||
];
|
||||
Refresh();
|
||||
BuildChart();
|
||||
}
|
||||
|
||||
/// <summary>Luminance, flicker or waveform (the switch beside the chart).</summary>
|
||||
public ExposureChart ChartMode
|
||||
{
|
||||
get => _chartMode;
|
||||
set
|
||||
{
|
||||
if (!Set(ref _chartMode, value)) return;
|
||||
OnPropertyChanged(nameof(IsLuminance));
|
||||
OnPropertyChanged(nameof(IsFlicker));
|
||||
OnPropertyChanged(nameof(IsWaveform));
|
||||
BuildChart();
|
||||
Editor.OnWaveformNeeded();
|
||||
}
|
||||
}
|
||||
|
||||
// The switch's radio buttons: checking one chooses its chart; the group's unchecking of the others is ignored.
|
||||
public bool IsLuminance { get => _chartMode == ExposureChart.Luminance; set => Choose(value, ExposureChart.Luminance); }
|
||||
|
||||
public bool IsFlicker { get => _chartMode == ExposureChart.Flicker; set => Choose(value, ExposureChart.Flicker); }
|
||||
|
||||
public bool IsWaveform { get => _chartMode == ExposureChart.Waveform; set => Choose(value, ExposureChart.Waveform); }
|
||||
|
||||
/// <summary>"luma of frame 0413".</summary>
|
||||
public string WaveformTitle => Loc.L("Editor.Chart.WaveformOf", (Editor.CurrentIndex + 1).ToString("D4", Loc.Culture));
|
||||
|
||||
public IReadOnlyList<ChartSeries> Series { get => _series; private set => Set(ref _series, value); }
|
||||
|
||||
public IReadOnlyList<ChartLegendItem> Legend { get => _legend; private set => Set(ref _legend, value); }
|
||||
|
||||
public IReadOnlyList<TimelineMarker> Markers { get => _markers; private set => Set(ref _markers, value); }
|
||||
|
||||
/// <summary>"flicker −67 % · max step 0.21 EV".</summary>
|
||||
public string? Summary { get => _summary; private set => Set(ref _summary, value); }
|
||||
|
||||
public Func<double, string> YFormatter => _chartMode == ExposureChart.Flicker ? v => Loc.L("Editor.Value.Ev", EditorText.Ev(v)) : v => v.ToString("0.0", Loc.Culture);
|
||||
|
||||
public override void OnContentChanged()
|
||||
{
|
||||
base.OnContentChanged();
|
||||
BuildChart();
|
||||
}
|
||||
|
||||
public override void OnCorrectionsChanged() => BuildChart();
|
||||
|
||||
public override void OnCurrentFrameChanged() => OnPropertyChanged(nameof(WaveformTitle));
|
||||
|
||||
private void Choose(bool chosen, ExposureChart chart)
|
||||
{
|
||||
if (chosen) ChartMode = chart;
|
||||
}
|
||||
|
||||
private (string?, string?) Temperature()
|
||||
{
|
||||
if (Editor.Session.Content.Deep is not { } deep) return (null, Loc.L("Tooltips.Editor.NotApplicable.NeedsAnalysis"));
|
||||
if (deep.WhiteBalance is { KelvinLow: { } low, KelvinHigh: { } high })
|
||||
return (Loc.L("Editor.Value.Kelvin", RoundToTens(low).ToString("N0", Loc.Culture), RoundToTens(high).ToString("N0", Loc.Culture)), null);
|
||||
return (null, Loc.L("Tooltips.Editor.NotApplicable.Kelvin"));
|
||||
}
|
||||
|
||||
/// <summary>Kelvin shown to the nearest ten (Math.Round takes no negative digit count).</summary>
|
||||
internal static double RoundToTens(double kelvin) => double.Round(kelvin / 10) * 10;
|
||||
|
||||
private void BuildChart()
|
||||
{
|
||||
var content = Editor.Session.Content;
|
||||
var n = content.Count;
|
||||
var corrections = Editor.Corrections is { } c && c.FrameCount == n ? c : null;
|
||||
double[] measured = corrections?.MeasuredLogLuminance is { } m && m.Any(double.IsFinite)
|
||||
? m
|
||||
: content.Deep is { } deep ? [.. deep.Frames.LogLuminance.Select(v => v ?? double.NaN)] : [.. content.Frames.Select(f => f.MeanLogLuminance ?? double.NaN)];
|
||||
var markers = EditorViewModel.StepMarkers(content);
|
||||
var series = new List<ChartSeries>();
|
||||
var legend = new List<ChartLegendItem>();
|
||||
if (_chartMode == ExposureChart.Flicker)
|
||||
{
|
||||
series.Add(new ChartSeries(Loc.L("Editor.Chart.FlickerBefore"), Steps(measured), "Brush.Sun"));
|
||||
legend.Add(new ChartLegendItem(Loc.L("Editor.Chart.FlickerBefore"), "Brush.Sun"));
|
||||
if (corrections is not null && measured.Any(double.IsFinite))
|
||||
{
|
||||
series.Add(new ChartSeries(Loc.L("Editor.Chart.FlickerAfter"), Steps(corrections.TargetLogLuminance()), "Brush.Accent") { Thickness = 2 });
|
||||
legend.Add(new ChartLegendItem(Loc.L("Editor.Chart.FlickerAfter"), "Brush.Accent"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
series.Add(new ChartSeries(Loc.L("Editor.Chart.Measured"), measured, "Brush.Sun"));
|
||||
legend.Add(new ChartLegendItem(Loc.L("Editor.Chart.Measured"), "Brush.Sun"));
|
||||
if (corrections is not null && measured.Any(double.IsFinite))
|
||||
{
|
||||
series.Add(new ChartSeries(Loc.L("Editor.Chart.Target"), corrections.TargetLogLuminance(), "Brush.Accent") { Thickness = 2 });
|
||||
legend.Add(new ChartLegendItem(Loc.L("Editor.Chart.Target"), "Brush.Accent"));
|
||||
}
|
||||
if (content.Deep is { Regions: not null } withSky && withSky.Frames.SkyLogLuminance.Any(v => v is not null))
|
||||
{
|
||||
series.Add(new ChartSeries(Loc.L("Editor.Chart.Sky"), withSky.Frames.SkyLogLuminance.Select(v => v ?? double.NaN).ToArray(), "Brush.Region")
|
||||
{ Dash = LineDash.Dashed });
|
||||
legend.Add(new ChartLegendItem(Loc.L("Editor.Chart.Sky"), "Brush.Region", LegendSwatch.DashedLine));
|
||||
}
|
||||
}
|
||||
if (markers.Count > 0) legend.Add(new ChartLegendItem(Loc.L("Editor.Chart.Steps"), "Brush.Sun", LegendSwatch.Triangle));
|
||||
Series = series;
|
||||
Legend = legend;
|
||||
Markers = markers;
|
||||
Summary = SummaryOf(corrections);
|
||||
OnPropertyChanged(nameof(YFormatter));
|
||||
}
|
||||
|
||||
/// <summary>Change from the previous usable frame, in EV (NaN where either is unusable).</summary>
|
||||
private static double[] Steps(double[] logLuminance)
|
||||
{
|
||||
var steps = new double[logLuminance.Length];
|
||||
var previous = double.NaN;
|
||||
for (var i = 0; i < steps.Length; i++)
|
||||
{
|
||||
steps[i] = logLuminance[i] - previous;
|
||||
if (double.IsFinite(logLuminance[i])) previous = logLuminance[i];
|
||||
}
|
||||
return steps;
|
||||
}
|
||||
|
||||
private static string? SummaryOf(RenderCorrections? corrections)
|
||||
{
|
||||
if (corrections is null) return null;
|
||||
var parts = new List<string>();
|
||||
if (corrections.Report.Deflicker is { FlickerBefore: > 0 } d)
|
||||
parts.Add(Loc.L("Editor.Exposure.FlickerChange", double.Round((d.FlickerAfter / d.FlickerBefore - 1) * 100).ToString("+0;−0;0", Loc.Culture)));
|
||||
if (corrections.Report.MaxTargetStepEv is { } step) parts.Add(Loc.L("Editor.Exposure.MaxStep", step.ToString("0.00", Loc.Culture)));
|
||||
return parts.Count == 0 ? null : string.Join(Loc.Separator, parts);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user