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

@@ -142,6 +142,61 @@ public sealed class RenderProcessingTests
Assert.Greater(Psnr(expected, corner.Frames[2]), 60);
}
/// <summary>
/// A crop in the view frame keeps its content through every orientation press: the capture after the press is the
/// plain capture turned, mirrored or flipped the same way.
/// </summary>
[Theory]
[Case(OrientationOp.RotateRight, 1, false, false)]
[Case(OrientationOp.RotateLeft, 3, false, false)]
[Case(OrientationOp.Mirror, 0, true, false)]
[Case(OrientationOp.Flip, 0, false, true)]
public async Task OrientationPressesKeepTheCroppedContent(OrientationOp op, int turns, bool mirror, bool flip)
{
var source = Source(4);
var framed = With(camera: new CameraSettings { Crop = [0.5, 0.25, 0.5, 0.5], Aspect = On("3:2") });
var (plain, before) = await CaptureAsync(Input(source, framed), Preset("png-sequence", 0, 0), cancellationToken: _context.Cancellation);
Assert.Equal((48, 32), (before.Width, before.Height));
var pressed = OrientationEdit.Apply(framed, op);
var (moved, after) = await CaptureAsync(Input(source, pressed), Preset("png-sequence", 0, 0), cancellationToken: _context.Cancellation);
Assert.Empty(after.Warnings);
using var expected = Geometry.FrameOrientationTests.Permuted(plain.Frames[2], turns, mirror, flip);
Assert.Equal((expected.Width, expected.Height), (after.Width, after.Height));
var psnr = Psnr(expected, moved.Frames[2]);
_context.Log($"{op}: {psnr:F1} dB");
Assert.Greater(psnr, 60);
Assert.True(expected.Data.SequenceEqual(moved.Frames[2].Data), "a quarter turn, a mirror and a flip move whole pixels");
}
[Test]
public async Task APortraitAspectTurnsAFixedPresetToPortrait()
{
var source = Source(4);
using var reference = source.Sequence.Render(2);
var project = With(camera: new CameraSettings { Aspect = On("9:16") });
var (encode, result) = await CaptureAsync(Input(source, project), Preset("png-sequence", 96, 64), cancellationToken: _context.Cancellation);
Assert.Equal((54, 96), (result.Width, result.Height));
Assert.Empty(result.Warnings);
using var expected = GeometryStage.Apply(reference, new GeometrySettings { Crop = new RectD(30, 0, 36, 64), OutputWidth = 54, OutputHeight = 96 });
Assert.Greater(Psnr(expected, encode.Frames[2]), 60);
}
[Test]
public async Task StraightenLevelsTheViewAndDecodesLarger()
{
var source = Source(4, width: 480, height: 320);
var project = With(camera: new CameraSettings { Straighten = -6 });
var (encode, result) = await CaptureAsync(Input(source, project), Preset("png-sequence", 96, 64), cancellationToken: _context.Cancellation);
var orientation = FrameOrientation.Of(project.Camera, 480, 320);
Assert.Equal((int)double.Ceiling(96 * orientation.CoverZoom), source.LargestRenderRequest);
Assert.Empty(result.Warnings);
using var full = source.Sequence.Render(1);
using var expected = GeometryStage.Apply(full, new GeometrySettings { OutputWidth = 96, OutputHeight = 64, Warp = orientation.ViewToFrame });
var psnr = Psnr(expected, encode.Frames[1]);
_context.Log($"straighten −6° vs a direct warp: {psnr:F1} dB, cover zoom {orientation.CoverZoom:F4}");
Assert.Greater(psnr, 28);
}
[Test]
public async Task VirtualCameraZoomsAndTheDecodeSizeFollowsTheNeed()
{