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

+61
View File
@@ -0,0 +1,61 @@
using System.Globalization;
using Chronos.Core.Analysis;
using Chronos.Core.Imaging;
using Chronos.Core.Imaging.Color;
using Chronos.Core.Project;
namespace Chronos.Core.Render;
/// <summary>
/// The last pixel step of every output frame (owner review 1, R6), shared by the render, the editor's preview, the server
/// and the render nodes: the colour look (<see cref="LookFilter"/>) and then the highlight knee, in linear light, after
/// stacking, interpolation and motion blur and before the encoder. The knee comes last so it compresses any overshoot the
/// look leaves. Measuring, flow and stacking never see either.
/// </summary>
public static class FrameFinish
{
/// <summary>
/// The knee a render applies: <paramref name="highlightKnee"/> when it lies in (0, 1), else none, with
/// <c>Export.Render.KneeIgnored</c> added to <paramref name="warnings"/> for a value out of range.
/// </summary>
public static double? Knee(double? highlightKnee, ICollection<RenderWarning>? warnings = null)
{
if (highlightKnee is not { } knee) return null;
if (knee is > 0 and < 1) return knee;
warnings?.Add(new RenderWarning("Export.Render.KneeIgnored", knee.ToString(CultureInfo.InvariantCulture)));
return null;
}
/// <summary>
/// The look a render applies: null for none, the identity, or a filter this Chronos does not know, which adds
/// <c>Export.Render.LookIgnored</c> to <paramref name="warnings"/>.
/// </summary>
public static LookSettings? Look(LookSettings? look, ICollection<RenderWarning>? warnings = null)
{
if (look is null || look.IsIdentity) return null;
if (LookFilter.IsKnown(look.Filter)) return look;
warnings?.Add(new RenderWarning("Export.Render.LookIgnored", look.Filter ?? string.Empty));
return null;
}
/// <summary>The share of a look applied: its strength clamped to 0..1, 1 when not given (or not finite).</summary>
public static double Strength(LookSettings look)
{
ArgumentNullException.ThrowIfNull(look);
return look.Strength is { } strength && double.IsFinite(strength) ? double.Clamp(strength, 0, 1) : 1;
}
/// <summary>Neither a look nor a knee would change a frame.</summary>
public static bool IsIdentity(LookSettings? look, double? knee) => (look is null || look.IsIdentity || !LookFilter.IsKnown(look.Filter)) && knee is not (> 0 and < 1);
/// <summary>
/// Finishes a linear-light output <paramref name="frame"/> in place: <paramref name="look"/> (none when null, the
/// identity or unknown), then the soft highlight knee when <paramref name="knee"/> lies in (0, 1).
/// </summary>
public static void Apply(ImageBuffer frame, LookSettings? look, double? knee)
{
ArgumentNullException.ThrowIfNull(frame);
if (look is { IsIdentity: false } && LookFilter.IsKnown(look.Filter)) LookFilter.Apply(frame, look.Filter, Strength(look));
if (knee is > 0 and < 1 and var k) ExposureProcessor.Apply(frame, 0, null, k);
}
}