feat(app): editor session, project history, local source, preview renderer and export planner
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
19 files changed
+2146
No files matched your search
@@ -0,0 +1,69 @@
|
||||
using Titano.Core.Analysis;
|
||||
using Titano.Core.Analysis.Deep;
|
||||
using Titano.Core.Imaging;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Core.Project;
|
||||
using Titano.Data.Archiving.Jobs;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
|
||||
/// <summary>
|
||||
/// Where the sequence open in the editor lives: the local archive (<see cref="LocalSequenceSource"/>) or a server the
|
||||
/// client is connected to (a source that reads proxies and posts jobs to the API). The editor reads frames, saves the
|
||||
/// project and queues jobs only through this interface.
|
||||
/// </summary>
|
||||
public interface ISequenceSource : IAsyncDisposable
|
||||
{
|
||||
/// <summary>Everything the editor shows of the sequence; read off the UI thread.</summary>
|
||||
/// <exception cref="InvalidDataException">The project cannot be read (corrupt, or written by a newer Titano).</exception>
|
||||
Task<SequenceContent> LoadAsync(CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Frame <paramref name="index"/> in linear light, oriented, long edge at most <paramref name="maxLongEdge"/>; null
|
||||
/// when the frame cannot be read. The caller owns the buffer.
|
||||
/// </summary>
|
||||
ValueTask<ImageBuffer?> DecodeAsync(int index, int maxLongEdge, DecodePurpose purpose, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Stores <paramref name="project"/>, edited from <paramref name="basis"/> (the version last loaded or saved). A
|
||||
/// change made meanwhile by someone else is kept where this edit left the value alone (<see cref="ProjectMerge"/>).
|
||||
/// Returns the stored project.
|
||||
/// </summary>
|
||||
Task<ProjectSettings> SaveProjectAsync(ProjectSettings project, ProjectSettings basis, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>Queues an analysis or render job for the sequence; returns the job id.</summary>
|
||||
Task<Guid> SubmitAsync(ArchiveJobRequest request, CancellationToken cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>A sequence as the editor opens it.</summary>
|
||||
/// <param name="Frames">Frame rows in index order.</param>
|
||||
/// <param name="Light">Light analysis of the frame metadata (BRIEF §10.1).</param>
|
||||
/// <param name="Deep">The saved deep analysis when it describes the current frames, else null.</param>
|
||||
/// <param name="SourceWidth">Dominant oriented full-resolution width (0 when unknown).</param>
|
||||
/// <param name="ExportsFolder">Default output folder of renders; null when the sequence is not on this PC.</param>
|
||||
/// <param name="Renders">Finished renders, newest first.</param>
|
||||
public sealed record SequenceContent(
|
||||
Sequence Sequence,
|
||||
IReadOnlyList<Frame> Frames,
|
||||
ProjectSettings Project,
|
||||
LightAnalysisReport Light,
|
||||
DeepAnalysisReport? Deep,
|
||||
int SourceWidth,
|
||||
int SourceHeight,
|
||||
string? ExportsFolder,
|
||||
IReadOnlyList<Render> Renders)
|
||||
{
|
||||
/// <summary>Flags of frames that never reach a render (as the render job skips them).</summary>
|
||||
public const FrameFlags NotRendered = FrameFlags.Missing | FrameFlags.Corrupt | FrameFlags.Excluded | FrameFlags.Undecodable;
|
||||
|
||||
public int Count => Frames.Count;
|
||||
|
||||
/// <summary>Frames the render skips besides the project's exclusions.</summary>
|
||||
public IEnumerable<int> NotRenderable()
|
||||
{
|
||||
for (var i = 0; i < Frames.Count; i++)
|
||||
{
|
||||
if ((Frames[i].Flags & NotRendered) != 0) yield return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user