feat(editor): visual crop, rotate/mirror/flip/straighten, colour looks (owner review 1 phase 4) (#26)
CI / Build and test (push) Successful in 8m19s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 12m9s
CI / PostgreSQL 16 integration (push) Successful in 7m49s
CI / PostgreSQL 17 integration (push) Successful in 7m19s
CI / Docker image (push) Successful in 46s
Release / Server image (push) Successful in 1m14s

Owner review 1 R5 + R6. Camera rotation, mirror, flip, straighten and crop handles locked to the output; an Exposure Look group; Export output size ("proportions win"); settings format 2 with older-node gates. Also fixes project text and hashes differing between Windows and Linux.

Closes #19
Closes #20

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 #26.
This commit is contained in:
Alby96andClaude Opus 5.5 authored and Alby96 committed 2026-11-05 01:09:09 +01:00
1 parent db389a54f2
commit 188b2c2e55
355 files changed
+10549 -1061

No files matched your search

+46 -1
View File
@@ -1,4 +1,6 @@
using Chronos.App.Infrastructure;
using Chronos.Core.Advice;
using Chronos.Core.Imaging.Color;
using Chronos.Core.Localization;
using Chronos.Core.Project;
using Chronos.Core.Render;
@@ -20,7 +22,7 @@ public enum ExposureChart
}
/// <summary>
/// Exposure (BRIEF §12.3): deflicker, regions, holy-grail transitions and white balance. The luminance chart shows the
/// Exposure (BRIEF §12.3): deflicker, regions, holy-grail transitions, white balance and the look. 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.
@@ -58,11 +60,54 @@ public sealed class ExposureTab : EditorTab
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))),
.. LookRows(s),
];
Refresh();
BuildChart();
}
/// <summary>
/// The Look group at the end of the step (owner review 1, R6): the filter (None, Mono, Sepia, Warm, Cool, Vivid, Muted,
/// Fade) and its strength, "n/a" without a filter. The look is a project setting outside Exposure, so moving these never
/// measures again (<see cref="WithLook"/>).
/// </summary>
public static IReadOnlyList<SettingRow> LookRows(EditorSession session)
{
ArgumentNullException.ThrowIfNull(session);
string? NoLook(ProjectSettings p) => HasFilter(p) ? null : Loc.L("Tooltips.Editor.NotApplicable.NoLook");
return
[
new GroupRow("Editor.Look.Group", "Tooltips.Editor.Look.Group"),
new ChoiceRow(session, "Editor.Look.Filter", "Tooltips.Editor.Look.Filter",
[.. LookFilter.Names.Select(n => new Choice(n, "Editor.Look." + char.ToUpperInvariant(n[0]) + n[1..]))],
p => p.Look?.Filter ?? LookFilter.None, (p, v) => WithLook(p, (string)v, p.Look?.Strength)),
new NumberRow(session, "Editor.Look.Strength", "Tooltips.Editor.Look.Strength", MinimumStrength, 1, 0.01, p => HasFilter(p) ? p.Look!.Strength ?? 1 : 1,
(p, v) => WithLook(p, p.Look?.Filter, double.Round(v, 2)), v => Formatting.Percent(v), NoLook),
];
}
/// <summary>
/// The Strength row's lowest value: None is the one way to a look that changes nothing, so the editor never stores a
/// filter at 0 % (an identity look that would still change the project's text and hash).
/// </summary>
public const double MinimumStrength = 0.01;
/// <summary>
/// <paramref name="project"/> with the look <paramref name="filter"/> at <paramref name="strength"/>: none when the filter
/// is None or the strength 0 (so a project without a look keeps settings format 1 and its text: the editor writes
/// <c>Look = null</c> whenever the look is the identity), the strength omitted at 100 %. Values of a newer Chronos
/// inside the look are kept.
/// </summary>
public static ProjectSettings WithLook(ProjectSettings project, string? filter, double? strength)
{
ArgumentNullException.ThrowIfNull(project);
if (filter is null || filter == LookFilter.None || strength is <= 0) return project with { Look = null };
var look = (project.Look ?? new LookSettings()) with { Filter = filter, Strength = strength is >= 1 ? null : strength };
return project with { Look = look };
}
private static bool HasFilter(ProjectSettings project) => project.Look?.Filter is { } filter && filter != LookFilter.None && LookFilter.IsKnown(filter);
/// <summary>Luminance, flicker or waveform (the switch beside the chart).</summary>
public ExposureChart ChartMode
{