diff --git a/i18n/en/Editor.resx b/i18n/en/Editor.resx index 2de00b56..4e0abcf9 100644 --- a/i18n/en/Editor.resx +++ b/i18n/en/Editor.resx @@ -4,5 +4,236 @@ 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Analyse + Analysis queued + {0}invariant + Source + Back + Add keyframe + Aspect + Horizontal centre + Vertical centre + Crop bottom + Crop left + Crop right + Crop top + Keyframes + Keyframe {0} of {1} · {2} + {0} keyframe + {0} keyframes + Horizontal placement + Vertical placement + Remove keyframe + Zoom + cloud cover % + Flicker + change after correction + frame-to-frame change + 0 % + 100 % + 50 % + Luminance + measured luminance + Not analysed yet + horizontal path + vertical path + video frames per photo + sky region + stars per Mpx + exposure steps as received + Chart + target curve + Waveform + luma of frame {0} Pick a sequence in the Library + This sequence is no longer in the archive.long + Jobs cannot run until the archive index is open.long + The settings of this sequence cannot be read.long + The settings of this sequence were changed elsewhere at the same time.long + about {0} + Add to queue + Batch… + {0} bppinvariant + Choose folder… + Codec + Colour + Container + Rec.709 {0}-bitinvariant + Encoder + Auto + File name + {0} fpsinvariant + Frame rate + hardware + Height + Previous renders: {0} · last {1}long + Previous renders: {0} · last {1}long + history + In batch + {0} Mb/sinvariant + No renders yet + Output · {0} + Export preset + Quality + Quality {0} + Recommended + Render now + Resolution + Result + show file + Save to + Sequence exports/ + Estimated size + software + Estimated time + No encoder here + Width + Deflicker + flicker {0} % + Holy grail + max step {0} EV + Exposure offset + Regions + Strength + Colour temperature + Transitions + White balance smoothing + Deflicker window + Filmstrip + Balanced + Best + Draft + finvariant + Exposure + Flags + ISOinvariant + #invariant + Size + Decode + Time + Exclude + Exclude frame + excluded + Excluded + None + black + corrupt + duplicate + missing + unreadable + white + hero + Hero frame + Not set + Frame {0} + Include + Include frame + No warnings + {0} preview + Set hero + Warnings + Opening sequence + Cut: pause or gap + Keyframe + Exposure step {0} EV + Step {0} EV not received + Motion blur + crop {0} % + Flow quality + pan {0} px/frame + shake {0} px + Shutter angle + Path smoothing + Stabilise + {0}: {1} → {2}invariant + {0} setting changed + {0} settings changed + Nothing to change + Optimise all + Optimise section + Preview + 1:1invariant + Preview 10 s + Compare + Crop mask + Crop result + Exit full screen + Full screen + output {0} + {0} of {1} + Pause + Play + Regions + Shot data + This frame cannot be read. + Vectors + original | corrected + Auto + Horizon + Luminance + Render · {0} + Render finished + Render queued + Show in folder + Render + Reset + Back to Auto + Changes not saved + Retry + Sections + f/{0}invariant + {0} mminvariant + ISO {0}invariant + {0} sinvariant + Length + Mean + Median + Stacking + No star field found + Star field found + Star trails + {0:N0} frame + {0:N0} frames + {0} s interval + source {0} + {0} warning + {0} warnings + Camera + Export + Exposure + Frames + Motion + Stack + Time + Speed curve + Fit to duration + Timing + output {0} % + {0:N0} frame → {1} · {2} fpslong + {0:N0} frames → {1} · {2} fpslong + Render plan + Playback rate + source {0} % + Adaptive + Constant + Interpolated + Remapped + Discard change + Keep editing + The last change to {0} could not be saved: {1}long + Unsaved change + Centred + {0}°invariant + {0} EVinvariant + {0} fpsinvariant + {0:N0} frame + {0:N0} frames + {0}–{1} Kinvariant + None + {0}invariant + Off + On + {0} pxinvariant + {0}invariant + {0}×invariant diff --git a/i18n/en/Export.resx b/i18n/en/Export.resx index 34850b65..bd544a1a 100644 --- a/i18n/en/Export.resx +++ b/i18n/en/Export.resx @@ -4,6 +4,22 @@ 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + APNGinvariant + AV1invariant + GIFinvariant + H.264 Highinvariant + HEVC Maininvariant + HEVC Main10invariant + JPEGinvariant + Linear DNG + MJPEGinvariant + PNGinvariant + TIFF 16-bitinvariant + APNGinvariant + AVIinvariant + GIFinvariant + Image sequence + MP4invariant {0}-bit output is not available with this encoder; encoding at {1}-bit.long; {0} requested bit depth; {1} bit depth used Bit rate capped at {1} bit/s, the maximum of level {0}.long; {0} codec level name; {1} maximum bit rate in bit/s No {0} encoder on this PC; H.264 is used instead.long; {0} codec name diff --git a/i18n/en/Tooltips.resx b/i18n/en/Tooltips.resx index ba7e3fda..c5736197 100644 --- a/i18n/en/Tooltips.resx +++ b/i18n/en/Tooltips.resx @@ -20,6 +20,124 @@ Dismiss Open the folder with the log files Return to the advisor's value + Read every frame again and refresh the analysis · Ctrl+Shift+A + Read every frame again and refresh the analysis · about {0} · Ctrl+Shift+A + An analysis of this sequence is already queued or running + Auto: no advice yet, the engine’s default applies; Analyse lets the advisor decide + Back to Library + An analysis or render of this sequence is running; settings wait until it ends + Add a keyframe at the current frame + Output aspect ratio; a preset with a fixed size uses its own + Horizontal centre of the selected keyframe’s view + Vertical centre of the selected keyframe’s view + Cuts this share of the frame on that side; aspect and placement then apply inside the crop + Zoom keyframes over the sequence: double-click adds · drag moves · Delete removes · arrows nudge + This frame already has a keyframe; select it on the curve to edit it + Virtual-camera keyframes: zoom and framing at chosen frames, eased in between + Select a keyframe on the curve first + Moves the crop left or right inside the frame + Moves the crop up or down inside the frame + Remove the selected keyframe + Zoom of the selected keyframe; 1 shows the whole crop, more zooms in and softens + Frame-to-frame brightness change before and after the correction + Measured luminance against the target curve, sky region and exposure steps + Video frames each photo is shown for, cuts marked · click shows that frame + Click or drag to show that frame + Luma waveform of the frame on screen: exposure and clipping at a glance + Luma of the corrected frame across the picture: white at the top, black at the bottom + Add this render to the queue and keep editing + Apply this sequence preset to every section · {0} + Queue every ticked preset as one job; the sequence is prepared once + Tick presets on the cards first + Average bit rate; more keeps detail and gradients, files grow + Video or image codec; 10-bit HEVC keeps sky gradients clean + Rec.709 colour; 10-bit avoids banding in skies, HDR is not offered + MP4, AVI, GIF, APNG or a folder of images; the codec list follows + Encoder on this PC; Auto prefers hardware + Where renders go: {0} + Frames per second of the video file + Auto: the preset’s {0} fps + Return to the preset’s frame rate + Output height in pixels; empty follows the width · Enter applies, Esc reverts + Open Jobs filtered on this sequence + Include this preset when Batch queues the render + Tokens: {date} {title} {preset} {codec} {width} {height} {fps} · Enter applies, Esc reverts + Render with {0}; editing a value makes it Custom + Image quality; 95 looks lossless, lower makes smaller files + Advisor pick: {0} + Enter a size between 16 and 16384 pixels + Output width in pixels; empty uses the preset or the source · Enter applies, Esc reverts + Removes frame-to-frame brightness flicker; off keeps the camera’s own exposure + Turns ISO, shutter and aperture steps into smooth ramps; off keeps the jumps + Brightens or darkens the whole video after correction, in stops + Sky and landscape get their own curve; off treats the frame as one + How much of the measured flicker is removed; 1.0 removes it all + Colour temperature range measured over the sequence + Frames over which each ISO, shutter or aperture step is spread; 0 keeps the steps + Smooths the colour ratios so auto white balance stops flickering while the sunset drift stays + Frames used to estimate the flicker-free curve; too short leaves flicker, too long flattens real light changes + Click or drag to show a frame; markers show exposure steps, warnings and keyframes + Leave this frame out of every render; the photo is not deleted + Show the first frame concerned + Make this the hero frame; the editor opens on it + Use this frame in renders again + Sort by this column; click again to reverse + Click a row to show the frame + Adds blur along the motion like a slower shutter; costs optical flow on every frame + Optical flow precision for blur and synthesised frames; Best is the slowest + Target shutter angle; 180° is the film look, more smears moving things + Frames over which the camera path is smoothed; too high crops more on deliberate pans + Removes camera shake by cropping slightly; the crop grows with the shake + Not applicable: motion blur is off + Not applicable: deflicker is off + Not applicable: holy grail is off + Not applicable: the frames sit off the daylight locus (night or mixed light) + Not applicable: this format is lossless + Needs the deep analysis: press Analyse + Not applicable: used only by motion blur and interpolated timing + Not applicable: stabilisation is off + Not applicable: stacking is off + Let the advisor set every section from the analysis and list what changed + The advisor never stacks on its own: a median erases moving stars + Apply the advisor’s heavier choices for this section and list what changed · Ctrl+Z undoes + Pause · Space + Play the frames · Space; arrows step one frame + Show pixels at 1:1 without interpolation · Ctrl+1; Ctrl+0 fits + Play ten seconds of the video’s frames with the current settings + Wipe compare: original on the left, corrected on the right; drag the line + Dim what the output cuts (what I lose) + Show the whole frame and darken what the output will cut + Hide what the output cuts (how it will look) + Close full screen · Esc + Full screen at native resolution · Esc closes + Show the sky and landscape boundary used by region deflicker + Show or hide the shot data + Overlay the motion to the next frame measured by the engine + Drag the line to compare · drag to pan · wheel zooms · double-click 1:1 + Render with the selected preset; progress in the job bar · Ctrl+R + Fix the file name first: {0} + Every frame is excluded: include some in the Frames tab + The frame size is unknown: the frames could not be read + Working out the render; ready in a moment + Show the rendered file in Explorer + Choose another preset + Return every control of this section to Auto · Ctrl+Z undoes + Try to save now; saving is also retried automatically + Frames combined into each output frame; trails and smoothing grow with it + Median and mean remove noise and moving things; star trails keep the brightest pixels + Crop, aspect, virtual camera moves + Presets, output, batch, history + Deflicker, regions, day-night transitions, white balance + Frame table, warnings, exclusions + Motion blur, optical flow, stabilisation + Median and star-trail stacking + Frame rate, timing mode, speed curve + Output time to source position: double-click adds a point · drag moves · Delete removes · arrows nudge + Scales the timing so the video lasts this long; off keeps the playback rate + Constant: one frame per photo; Adaptive: follows capture time; Interpolated: fills gaps; Remapped: follows the curve + Photos shown per second of video; more plays the sequence faster + Close without the change; the stored settings stay as they were + Stay in the editor; saving is retried in the background Stop this job; Retry continues later from its last checkpoint Hide finished jobs from the list; they stay in the history Every job diff --git a/i18n/it/Editor.it.resx b/i18n/it/Editor.it.resx index a0b523f2..2d7f8f68 100644 --- a/i18n/it/Editor.it.resx +++ b/i18n/it/Editor.it.resx @@ -4,5 +4,214 @@ 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Analizza + Analisi in coda + Sorgente + Indietro + Aggiungi chiave + Formato + Centro orizzontale + Centro verticale + Ritaglio in basso + Ritaglio a sinistra + Ritaglio a destra + Ritaglio in alto + Fotogrammi chiave + Chiave {0} di {1} · {2} + {0} chiave + {0} chiavi + Posizione orizzontale + Posizione verticale + Rimuovi chiave + Zoom + copertura nuvolosa % + Sfarfallio + variazione dopo la correzione + variazione tra fotogrammi + 0% + 100% + 50% + Luminanza + luminanza misurata + Non ancora analizzata + percorso orizzontale + percorso verticale + fotogrammi video per foto + regione del cielo + stelle per Mpx + salti di esposizione ricevuti + Grafico + curva obiettivo + Forma d’onda + luma del fotogramma {0} Scegli una sequenza in Libreria + Questa sequenza non è più nell’archivio. + I lavori non possono partire finché l’indice dell’archivio non è aperto. + Le impostazioni di questa sequenza non sono leggibili. + Le impostazioni di questa sequenza sono state modificate altrove nello stesso momento. + circa {0} + Metti in coda + In serie… + Scegli cartella… + Codec + Colore + Contenitore + Encoder + Auto + Nome file + Fotogrammi/s + hardware + Altezza + Render precedenti: {0} · ultimo {1} + Render precedenti: {0} · ultimo {1} + cronologia + In serie + Ancora nessun render + Uscita · {0} + Preset di esportazione + Qualità + Qualità {0} + Consigliato + Renderizza ora + Risoluzione + Risultato + mostra file + Salva in + exports/ della sequenza + Dimensione stimata + software + Tempo stimato + Nessun encoder qui + Larghezza + Deflicker + flicker {0} % + Holy grail + salto max {0} EV + Compensazione + Regioni + Intensità + Temperatura colore + Transizioni + Bilanciamento uniforme + Finestra deflicker + Pellicola + Bilanciata + Massima + Bozza + Esposizione + Note + Dimensioni + Decodifica + Ora + Escludi + Escludi fotogramma + escluso + Esclusi + Nessuno + nero + danneggiato + duplicato + mancante + illeggibile + bianco + copertina + Copertina + Non impostata + Fotogramma {0} + Includi + Includi fotogramma + Nessun avviso + anteprima {0} + Imposta copertina + Avvisi + Apertura sequenza + Taglio: pausa o vuoto + Fotogramma chiave + Salto di esposizione {0} EV + Salto {0} EV non ricevuto + Mosso + ritaglio {0} % + Qualità del flusso + panoramica {0} px/fotogr. + tremolio {0} px + Angolo otturatore + Smussatura percorso + Stabilizza + {0} impostazione cambiata + {0} impostazioni cambiate + Niente da cambiare + Ottimizza tutto + Ottimizza sezione + Anteprima + Anteprima 10 s + Confronta + Maschera ritaglio + Risultato ritaglio + Esci da schermo intero + Schermo intero + uscita {0} + {0} di {1} + Pausa + Riproduci + Regioni + Dati di scatto + Questo fotogramma non si può leggere. + Vettori + originale | corretto + Auto + Orizzonte + Luminanza + Renderizza · {0} + Render completato + Render in coda + Mostra nella cartella + Renderizza + Ripristina + Torna ad Auto + Modifiche non salvate + Riprova + Sezioni + Lunghezza + Media + Mediana + Stacking + Nessun campo stellare + Campo stellare trovato + Scie stellari + {0:N0} fotogramma + {0:N0} fotogrammi + intervallo {0} s + sorgente {0} + {0} avviso + {0} avvisi + Inquadratura + Esporta + Esposizione + Fotogrammi + Movimento + Stacking + Tempo + Curva di velocità + Adatta alla durata + Tempi + uscita {0} % + {0:N0} fotogramma → {1} · {2} fps + {0:N0} fotogrammi → {1} · {2} fps + Piano di render + Velocità + sorgente {0} % + Adattivo + Costante + Interpolato + Su curva + Scarta modifica + Continua a modificare + L’ultima modifica a {0} non è stata salvata: {1} + Modifica non salvata + Centrato + {0:N0} fotogramma + {0:N0} fotogrammi + Nessuno + Disattivo + Attivo diff --git a/i18n/it/Export.it.resx b/i18n/it/Export.it.resx index da3ab965..03ca3056 100644 --- a/i18n/it/Export.it.resx +++ b/i18n/it/Export.it.resx @@ -4,6 +4,8 @@ 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + DNG lineare + Sequenza di immagini Uscita a {0} bit non disponibile con questo encoder; codifica a {1} bit. Bit rate limitato a {1} bit/s, il massimo del livello {0}. Nessun encoder {0} su questo PC; viene usato H.264. diff --git a/i18n/it/Tooltips.it.resx b/i18n/it/Tooltips.it.resx index ab58c062..a71de24b 100644 --- a/i18n/it/Tooltips.it.resx +++ b/i18n/it/Tooltips.it.resx @@ -20,6 +20,124 @@ Chiudi Apri la cartella dei file di log Torna al valore consigliato + Rilegge ogni fotogramma e aggiorna l’analisi · Ctrl+Maiusc+A + Rilegge ogni fotogramma e aggiorna l’analisi · circa {0} · Ctrl+Maiusc+A + Un’analisi di questa sequenza è già in coda o in corso + Auto: ancora nessun consiglio, vale il valore predefinito; Analizza lascia decidere al consulente + Torna alla Libreria + È in corso un’analisi o un render di questa sequenza; le impostazioni attendono la fine + Aggiunge una chiave al fotogramma corrente + Formato dell’uscita; un preset con dimensioni fisse usa il proprio + Centro orizzontale dell’inquadratura della chiave scelta + Centro verticale dell’inquadratura della chiave scelta + Taglia questa parte del fotogramma su quel lato; formato e posizione valgono poi dentro il ritaglio + Fotogrammi chiave dello zoom: doppio clic aggiunge · trascina sposta · Canc rimuove · le frecce spostano di poco + Questo fotogramma ha già un fotogramma chiave; selezionalo sulla curva per modificarlo + Chiavi della camera virtuale: zoom e inquadratura in fotogrammi scelti, raccordati tra loro + Seleziona prima un fotogramma chiave sulla curva + Sposta il ritaglio a sinistra o a destra nel fotogramma + Sposta il ritaglio in alto o in basso nel fotogramma + Rimuove la chiave selezionata + Zoom della chiave scelta; 1 mostra tutto il ritaglio, di più ingrandisce e ammorbidisce + Variazione di luminosità tra fotogrammi prima e dopo la correzione + Luminanza misurata rispetto alla curva obiettivo, regione del cielo e salti di esposizione + Fotogrammi video per ogni foto, con i tagli segnati · un clic mostra quel fotogramma + Clic o trascina per mostrare quel fotogramma + Forma d’onda della luma del fotogramma a schermo: esposizione e clipping a colpo d’occhio + Luma del fotogramma corretto lungo l’immagine: bianco in alto, nero in basso + Mette in coda questo render; puoi continuare a modificare + Applica questo preset di sequenza a tutte le sezioni · {0} + Mette in coda i preset spuntati come un unico lavoro; la sequenza si prepara una volta + Spunta prima i preset sulle schede + Bit rate medio; di più conserva dettagli e sfumature, i file crescono + Codec video o immagine; HEVC a 10 bit mantiene pulite le sfumature del cielo + Colore Rec.709; 10 bit evitano il banding nel cielo, l’HDR non è disponibile + MP4, AVI, GIF, APNG o una cartella di immagini; l’elenco dei codec si adegua + Encoder di questo PC; Auto preferisce l’hardware + Dove vanno i render: {0} + Fotogrammi al secondo del file video + Auto: i {0} fps del preset + Torna ai fotogrammi al secondo del preset + Altezza in pixel; vuoto segue la larghezza · Invio applica, Esc annulla + Apre Lavori filtrati su questa sequenza + Include questo preset quando In serie mette in coda il render + Segnaposto: {date} {title} {preset} {codec} {width} {height} {fps} · Invio applica, Esc annulla + Renderizza con {0}; modificare un valore lo rende Personalizzato + Qualità dell’immagine; 95 sembra senza perdite, meno fa file più piccoli + Scelta del consulente: {0} + Inserisci una dimensione tra 16 e 16384 pixel + Larghezza in pixel; vuoto usa il preset o la sorgente · Invio applica, Esc annulla + Elimina lo sfarfallio di luminosità tra fotogrammi; spento lascia l’esposizione della fotocamera + Trasforma i salti di ISO, tempo e diaframma in rampe morbide; spento li lascia + Schiarisce o scurisce tutto il video dopo la correzione, in stop + Cielo e paesaggio hanno una curva ciascuno; spento tratta il fotogramma come uno + Quanto dello sfarfallio misurato viene tolto; 1,0 lo toglie tutto + Intervallo di temperatura colore misurato nella sequenza + Fotogrammi su cui si distribuisce ogni salto di ISO, tempo o diaframma; 0 lascia i salti + Smussa i rapporti di colore: il bilanciamento automatico smette di sfarfallare e la deriva del tramonto resta + Fotogrammi usati per stimare la curva senza sfarfallio; troppo corta lo lascia, troppo lunga appiattisce i veri cambi di luce + Clic o trascina per mostrare un fotogramma; i segni indicano salti di esposizione, avvisi e fotogrammi chiave + Lascia fuori questo fotogramma da ogni render; la foto non viene eliminata + Mostra il primo fotogramma interessato + Rende questo fotogramma la copertina; l’editor si apre qui + Usa di nuovo questo fotogramma nei render + Ordina per questa colonna; un altro clic inverte + Fai clic su una riga per mostrare il fotogramma + Aggiunge mosso lungo il movimento come un tempo più lungo; richiede il flusso ottico su ogni fotogramma + Precisione del flusso ottico per mosso e fotogrammi sintetici; Massima è la più lenta + Angolo otturatore obiettivo; 180° è l’aspetto cinema, di più impasta ciò che si muove + Fotogrammi su cui si smussa il percorso della camera; troppi ritagliano di più nelle panoramiche volute + Elimina il tremolio con un leggero ritaglio; il ritaglio cresce col tremolio + Non applicabile: il mosso è spento + Non applicabile: il deflicker è spento + Non applicabile: l’holy grail è spento + Non applicabile: i fotogrammi sono fuori dal luogo della luce diurna (notte o luce mista) + Non applicabile: questo formato è senza perdite + Serve l’analisi approfondita: premi Analizza + Non applicabile: serve solo al mosso e ai tempi interpolati + Non applicabile: la stabilizzazione è spenta + Non applicabile: lo stacking è spento + Lascia che il consulente imposti ogni sezione dall’analisi ed elenchi cosa è cambiato + Il consulente non fa mai stacking da solo: una mediana cancella le stelle in movimento + Applica le scelte più incisive del consulente per questa sezione ed elenca cosa è cambiato · Ctrl+Z annulla + Pausa · Spazio + Riproduce i fotogrammi · Spazio; le frecce avanzano di uno + Mostra i pixel 1:1 senza interpolazione · Ctrl+1; Ctrl+0 adatta + Riproduce dieci secondi dei fotogrammi del video con le impostazioni attuali + Confronto a tendina: originale a sinistra, corretto a destra; trascina la linea + Scurisce ciò che l’uscita taglia (cosa perdo) + Mostra tutto il fotogramma e scurisce ciò che l’uscita taglierà + Nasconde ciò che l’uscita taglia (come apparirà) + Chiudi schermo intero · Esc + Schermo intero alla risoluzione nativa · Esc chiude + Mostra il confine tra cielo e paesaggio usato dal deflicker per regioni + Mostra o nasconde i dati di scatto + Sovrappone il movimento verso il fotogramma successivo misurato dal motore + Trascina la linea per confrontare · trascina per spostare · la rotellina ingrandisce · doppio clic 1:1 + Renderizza con il preset scelto; avanzamento nella barra dei lavori · Ctrl+R + Correggi prima il nome del file: {0} + Tutti i fotogrammi sono esclusi: includine alcuni nella scheda Fotogrammi + La dimensione dei fotogrammi è sconosciuta: non è stato possibile leggerli + Calcolo del render in corso; pronto tra un attimo + Mostra il file del render in Esplora file + Scegli un altro preset + Riporta in Auto ogni controllo di questa sezione · Ctrl+Z annulla + Prova a salvare ora; il salvataggio viene anche ritentato da solo + Fotogrammi combinati in ogni fotogramma d’uscita; scie e levigatura crescono con esso + Mediana e media tolgono rumore e ciò che si muove; le scie stellari tengono i pixel più luminosi + Ritaglio, formato, movimenti della camera virtuale + Preset, uscita, serie, cronologia + Deflicker, regioni, transizioni giorno-notte, bilanciamento del bianco + Tabella dei fotogrammi, avvisi, esclusioni + Mosso, flusso ottico, stabilizzazione + Stacking a mediana e scie stellari + Frequenza fotogrammi, modo dei tempi, curva di velocità + Tempo del video verso posizione nella sequenza: doppio clic aggiunge un punto · trascina sposta · Canc rimuove · le frecce spostano di poco + Scala i tempi perché il video duri così; spento mantiene la velocità + Costante: un fotogramma per foto; Adattivo: segue l’ora di scatto; Interpolato: riempie i vuoti; Su curva: segue la curva + Foto mostrate per secondo di video; di più accelera la sequenza + Chiude senza la modifica; le impostazioni salvate restano com’erano + Resta nell’editor; il salvataggio viene ritentato in background Ferma questa attività; Riprova la continua più tardi dall'ultimo punto di ripresa Nasconde le attività concluse dall'elenco; restano nella cronologia Tutte le attività diff --git a/src/Titano.App/DesignTime/SampleData.cs b/src/Titano.App/DesignTime/SampleData.cs index 348785f7..6f7afad2 100644 --- a/src/Titano.App/DesignTime/SampleData.cs +++ b/src/Titano.App/DesignTime/SampleData.cs @@ -1,14 +1,24 @@ using System.IO; using System.Net; using Titano.App.About; +using Titano.App.Editor; using Titano.App.Infrastructure; using Titano.App.Server; using Titano.App.Settings; +using Titano.Core.Advice; +using Titano.Core.Analysis; +using Titano.Core.Analysis.Deep; +using Titano.Core.Archiving; using Titano.Core.Codecs.Jpeg; +using Titano.Core.Diagnostics.Synthetic; using Titano.Core.Imaging; +using Titano.Core.Imaging.Decoders; +using Titano.Core.Metadata; using Titano.Core.Model; +using Titano.Core.Project; using Titano.Core.Video; using Titano.Data; +using Titano.Data.Archiving; using Titano.Data.Jobs; using Titano.Data.Sync; using Titano.Protocol; @@ -195,6 +205,180 @@ public sealed class SampleData """{"exposure":{"deflickerWindow":{"isAuto":false,"manual":""" + frames.ToString(System.Globalization.CultureInfo.InvariantCulture) + "}}}"; } + /// + /// The sequence editor's sample: a second archive holding a synthetic harbour sunset of real JPEG frames with Exif + /// (flicker, two received exposure steps, white-balance drift, a horizon), indexed by a scan, analysed (light and + /// deep, saved as analysis.json), advised into project.json with one manual value and three camera + /// keyframes, and given two past renders. + /// + /// The sequence id to open in the editor. + public async Task FillEditorAsync() + { + var db = _db ?? throw new InvalidOperationException("OpenEmptyAsync first."); + var archives = _services.Archives ?? throw new InvalidOperationException("The archive engine is not attached."); + var root = Path.Combine(_services.Environment.DataDirectory, "editor-archive"); + var archive = await archives.CreateAsync(root, "Editor sample"); + var sunset = SyntheticSequence.Create(EditorSunset); + var folder = Path.Combine(root, "2026", "2026-09-28 Canon EOS R5"); + Directory.CreateDirectory(folder); + for (var i = 0; i < sunset.Count; i++) + { + using var image = SunsetFrame(sunset, i); + var exif = ExifWriter.BuildJpegApp1(sunset.Metadata[i]); + File.WriteAllBytes(Path.Combine(folder, $"IMG_{4211 + i:0000}.JPG"), JpegEncoder.Encode(image, new JpegEncodeOptions { Quality = 88, App1Segments = [exif[4..]] })); + } + await archives.Indexer.ScanAsync(archive, ScanMode.Full, null, _ => ValueTask.CompletedTask, CancellationToken.None); + var id = (await db.Sequences.ListLocationsAsync(archive.Id)).Single().Id; + await archives.SetSequenceInfoAsync(id, "Harbour sunset", ["sunset", "harbour"], 4, null); + + var source = new LocalSequenceSource(db, id, DecoderFactory.CreateClient(null), null); + var content = await source.LoadAsync(CancellationToken.None); + var deep = await DeepAnalyzer.AnalyzeAsync(new SunsetFrames(sunset)); + var sequence = content.Sequence; + deep.Save(new ArchivePaths(root).Sequence(sequence.Folder).AnalysisPath); + var advice = Advisor.Recommend(content.Light, deep, SequenceContext.FromFrames(content.Frames)); + // As a user leaves it: the advice applied, one value taken over by hand (Sun track) and a slow push-in. + var advised = Advisor.Apply(content.Project, advice); + var project = advised with + { + Exposure = advised.Exposure with { DeflickerStrength = advised.Exposure.DeflickerStrength.WithManual(0.8) }, + Camera = advised.Camera with { Keyframes = [new CameraKey(0, 0.5, 0.5, 1, 0), new CameraKey(48, 0.6, 0.46, 1.4, 0), new CameraKey(95, 0.64, 0.4, 1.9, 0)] }, + }; + await source.SaveProjectAsync(project, content.Project, CancellationToken.None); + await db.Sequences.RecordAnalysisAsync(id, SequenceStatus.AnalyzedLight | SequenceStatus.AnalyzedDeep | SequenceStatus.HasWarnings, SequenceStatus.None, + advice.Findings.Count(f => f.Severity >= FindingSeverity.Warning), AnalysisSummary.From(deep).ToJson()); + foreach (var (preset, codec, width, height, daysAgo, bytes) in new[] { ("4K archive", "hevc", 3840, 2160, 7, 2_210_000_000L), ("1080p share", "h264", 1920, 1080, 3, 412_000_000L) }) + { + await db.Renders.InsertAsync(new Render + { + Id = Guid.CreateVersion7(), + SequenceId = id, + PresetName = preset, + OutputPath = Path.Combine(folder, "exports", $"2026-09-28 Harbour sunset - {preset}.mp4"), + Codec = codec, + Width = width, + Height = height, + Fps = 24, + DurationSeconds = 5, + Bytes = bytes, + Created = DateTimeOffset.UtcNow.AddDays(-daysAgo), + ProducedBy = "studio-pc", + }); + } + return id; + } + + /// A deep analysis of half way through: the editor's busy state (settings wait, viewing stays live). + public async Task MarkAnalysingAsync(Guid sequenceId) + { + var db = _db ?? throw new InvalidOperationException("OpenEmptyAsync first."); + var now = DateTimeOffset.UtcNow; + await db.Jobs.EnqueueAsync(new Job + { + Id = Guid.CreateVersion7(), + Kind = JobKind.DeepAnalyse, + TargetIds = [sequenceId], + TargetLabel = "Harbour sunset", + State = JobState.Running, + Priority = JobPriority.User, + ProgressDone = 40, + ProgressTotal = 96, + ItemsPerSecond = 12, + NodeId = Environment.MachineName, + Attempts = 1, + Created = now.AddSeconds(-5), + Started = now.AddSeconds(-4), + }); + } + + /// A two-minute sunset at 2 s intervals: darkening scene, flicker, two shutter steps the pixels received, warming light. + private static readonly SyntheticSequenceOptions EditorSunset = new() + { + Width = 600, + Height = 400, + FrameCount = 96, + Seed = 28, + Start = new DateTime(2026, 9, 28, 18, 2, 11), + IntervalSeconds = 2, + StartEv = 0.5, + EndEv = -2.5, + FlickerEv = 0.12, + ExposureSteps = [new SyntheticExposureStep(32, -1), new SyntheticExposureStep(64, -1)], + HorizonFraction = 0.62, + HorizonWave = 0.02, + SkyLevel = 0.32, + LandLevel = 0.06, + StartKelvin = 5600, + EndKelvin = 3200, + WhiteBalanceJitter = 0.03, + NoiseSigma = 0.002, + BaseExposureTime = 1.0 / 125, + BaseFNumber = 8, + BaseIso = 100, + CameraMake = "Canon", + CameraModel = "Canon EOS R5", + Lens = "RF15-35mm F2.8 L IS USM", + }; + + /// + /// The synthetic frame (its exposure truth: scene, steps, flicker, white balance) coloured as a harbour sunset: a + /// blue-to-amber sky gradient normalised to unit luminance, so the measured luminance keeps the truth, and a setting sun. + /// + private static ImageBuffer SunsetFrame(SyntheticSequence sequence, int index) + { + var image = sequence.Render(index); + var (w, h) = (image.Width, image.Height); + var t = index / (double)(sequence.Count - 1); + var horizon = sequence.Options.HorizonFraction * h; + var (sunX, sunY) = (w * 0.64, h * (0.28 + 0.3 * t)); + var gain = Math.Pow(2, sequence.SceneEv[index] + sequence.ExposureOffsetEv[index] + sequence.FlickerEv[index]); + double[][] sky = [Linear("#2A2F6B"), Linear("#8E3F57"), Linear("#E07A48"), Linear("#F5B45E")]; + var land = Linear("#3A3540"); + for (var y = 0; y < h; y++) + { + double[] colour; + if (y < horizon) + { + var f = y / horizon * (sky.Length - 1); + var k = Math.Min((int)f, sky.Length - 2); + colour = [.. Enumerable.Range(0, 3).Select(c => sky[k][c] + (sky[k + 1][c] - sky[k][c]) * (f - k))]; + } + else + { + colour = land; + } + var luminance = 0.2126 * colour[0] + 0.7152 * colour[1] + 0.0722 * colour[2]; + for (var x = 0; x < w; x++) + { + var d = Math.Sqrt((x - sunX) * (x - sunX) + (y - sunY) * (y - sunY)); + var sun = y < horizon ? gain * 4 * Math.Exp(-d * d / 220) : 0; + for (var c = 0; c < 3; c++) + { + var plane = image.Plane(c); + plane[y * w + x] = (float)(plane[y * w + x] * colour[c] / luminance + sun * (c == 0 ? 1.0 : c == 1 ? 0.75 : 0.45)); + } + } + } + return image; + } + + private static double[] Linear(string hex) + { + var rgb = Convert.FromHexString(hex.TrimStart('#')); + return [.. rgb.Select(v => ColorSpace.SrgbToLinear(v / 255.0))]; + } + + /// The sunset as the deep analysis reads it (the pixels written to the JPEGs, before compression). + private sealed class SunsetFrames(SyntheticSequence sequence) : IFrameSource + { + public int Count => sequence.Count; + + public LightFrame Metadata(int index) => LightFrame.From(sequence.Metadata[index], index); + + public ValueTask LoadAsync(int index, int maxLongEdge, CancellationToken cancellationToken) => + ValueTask.FromResult(SunsetFrame(sequence, index)); + } + private IEnumerable<(Sequence Sequence, string[] Colours, bool Raw)> Sequences(Guid archiveId) { var now = new DateTime(2026, 9, 28, 18, 2, 11); @@ -456,14 +640,14 @@ public sealed class SampleData lock (_sequences) return Task.FromResult(_sequences[id].Dto); } - public Task GetManifestAsync(Guid id, CancellationToken cancellationToken) + public Task GetManifestAsync(Guid id, CancellationToken cancellationToken) { lock (_sequences) { var (dto, settings, frames) = _sequences[id]; var hasProxy = (dto.Status & (long)SequenceStatus.ProxiesBuilt) != 0; var created = new DateTimeOffset(2026, 9, 20, 21, 0, 0, TimeSpan.Zero); - return Task.FromResult(new SequenceManifest(id, dto.FramesVersion, dto.SettingsVersion, settings, dto.Tags, + return Task.FromResult(new Protocol.SequenceManifest(id, dto.FramesVersion, dto.SettingsVersion, settings, dto.Tags, [.. frames.Select((frame, i) => new ManifestFrame(frame, i, $"IMG_{i + 1:0000}.JPG", 24_000_000, Convert.ToHexStringLower(System.Security.Cryptography.SHA256.HashData(BitConverter.GetBytes(i))), hasProxy, true))], [.. Enumerable.Range(0, dto.RenderedCount).Select(i => new RenderDto(Guid.CreateVersion7(), i == 0 ? "4K HEVC" : "1080p H.264", "hevc", diff --git a/src/Titano.App/Editor/CameraTab.cs b/src/Titano.App/Editor/CameraTab.cs new file mode 100644 index 00000000..b346e4ca --- /dev/null +++ b/src/Titano.App/Editor/CameraTab.cs @@ -0,0 +1,339 @@ +using System.Collections.ObjectModel; +using System.Windows; +using System.Windows.Input; +using Titano.App.Infrastructure; +using Titano.Core.Advice; +using Titano.Core.Export; +using Titano.Core.Localization; +using Titano.Core.Mathematics; +using Titano.Core.Project; +using Titano.Ui.Mvvm; +using Titano.Ui.Visuals; + +namespace Titano.App.Editor; + +/// +/// Camera (BRIEF §12.3): the free crop of the frame (margins), the output aspect and its placement inside the crop, and +/// virtual-camera keyframes edited as a zoom curve over the sequence (X = frame, Y = zoom) with the selected keyframe's +/// framing below. +/// +public sealed class CameraTab : EditorTab +{ + /// Zoom at the top of the curve editor. + public const double MaxZoom = 4; + + private int _selectedKey = -1; + + public CameraTab(EditorViewModel editor) + : base(editor, "Camera", AdvisorSection.Camera) + { + var s = editor.Session; + Rows = + [ + CropRow(s, CropSide.Left, "Editor.Camera.CropLeft"), + CropRow(s, CropSide.Right, "Editor.Camera.CropRight"), + CropRow(s, CropSide.Top, "Editor.Camera.CropTop"), + CropRow(s, CropSide.Bottom, "Editor.Camera.CropBottom"), + new AutoChoiceRow(s, EditorSettings.Aspect, "Editor.Camera.Aspect", "Tooltips.Editor.Camera.Aspect", + [ + new Choice("source", "Editor.Aspect.Source"), new Choice("16:9", "Editor.Aspect.Ratio", "16:9"), new Choice("21:9", "Editor.Aspect.Ratio", "21:9"), + new Choice("4:3", "Editor.Aspect.Ratio", "4:3"), new Choice("3:2", "Editor.Aspect.Ratio", "3:2"), new Choice("1:1", "Editor.Aspect.Ratio", "1:1"), + new Choice("9:16", "Editor.Aspect.Ratio", "9:16"), new Choice("4:5", "Editor.Aspect.Ratio", "4:5"), + ]), + new NumberRow(s, "Editor.Camera.OffsetX", "Tooltips.Editor.Camera.OffsetX", -1, 1, 0.05, p => p.Camera.OffsetX, + (p, v) => p with { Camera = p.Camera with { OffsetX = v } }, EditorText.Placement), + new NumberRow(s, "Editor.Camera.OffsetY", "Tooltips.Editor.Camera.OffsetY", -1, 1, 0.05, p => p.Camera.OffsetY, + (p, v) => p with { Camera = p.Camera with { OffsetY = v } }, EditorText.Placement), + ]; + AddKeyCommand = new RelayCommand(AddKey, () => !Editor.IsBusy && Keys.All(k => k.Frame != Editor.CurrentIndex)); + RemoveKeyCommand = new RelayCommand(RemoveKey, () => !Editor.IsBusy && SelectedKey >= 0); + CommitCurveCommand = new RelayCommand(CommitCurve); + Refresh(); + } + + /// Keyframes as curve points: X = frame / (count − 1), Y = (zoom − 1) / ( − 1). Edited in place by the curve editor. + public ObservableCollection KeyPoints { get; } = []; + + public int SelectedKey + { + get => _selectedKey; + set + { + if (!Set(ref _selectedKey, value)) return; + OnSelectedKeyChanged(); + } + } + + public bool HasSelectedKey => SelectedKey >= 0 && SelectedKey < Keys.Count; + + /// Framing of the selected keyframe: centre (0–1) and zoom. + public double SelectedCenterX + { + get => HasSelectedKey ? Keys[SelectedKey].CenterX : 0.5; + set => EditSelected(k => k with { CenterX = double.Clamp(value, 0, 1) }); + } + + public double SelectedCenterY + { + get => HasSelectedKey ? Keys[SelectedKey].CenterY : 0.5; + set => EditSelected(k => k with { CenterY = double.Clamp(value, 0, 1) }); + } + + public double SelectedZoom + { + get => HasSelectedKey ? Keys[SelectedKey].Zoom : 1; + set => EditSelected(k => k with { Zoom = double.Clamp(value, 1, MaxZoom) }); + } + + public string SelectedZoomText => Loc.L("Editor.Value.Zoom", SelectedZoom.ToString("0.00", Loc.Culture)); + + /// "Keyframe 2 of 3 · frame 0413". + public string KeyText => HasSelectedKey + ? Loc.L("Editor.Camera.KeyOf", SelectedKey + 1, Keys.Count, (Keys[SelectedKey].Frame + 1).ToString("D4", Loc.Culture)) + : Loc.Plural("Editor.Camera.Keys", Keys.Count); + + public double Playhead => Editor.FrameCount > 1 ? (double)Editor.CurrentIndex / (Editor.FrameCount - 1) : double.NaN; + + public Func XFormatter => x => EditorText.Position((int)double.Round(x * (Editor.FrameCount - 1)), Editor.FrameCount); + + public Func YFormatter { get; } = y => Loc.L("Editor.Value.Zoom", (1 + y * (MaxZoom - 1)).ToString("0.00", Loc.Culture)); + + public ICommand AddKeyCommand { get; } + + public ICommand RemoveKeyCommand { get; } + + /// What Add keyframe does, or why it cannot run now. + public string AddKeyToolTip => Loc.L(Editor.IsBusy ? "Tooltips.Editor.Busy" + : Keys.Any(k => k.Frame == Editor.CurrentIndex) ? "Tooltips.Editor.Camera.KeyExists" : "Tooltips.Editor.Camera.AddKey"); + + /// How to edit the keyframe curve, or why it waits. + public string CurveToolTip => Loc.L(Editor.IsBusy ? "Tooltips.Editor.Busy" : "Tooltips.Editor.Camera.Curve"); + + public string RemoveKeyToolTip => Loc.L(Editor.IsBusy ? "Tooltips.Editor.Busy" : HasSelectedKey ? "Tooltips.Editor.Camera.RemoveKey" : "Tooltips.Editor.Camera.NoKey"); + + /// Run by the curve editor after each finished edit. + public ICommand CommitCurveCommand { get; } + + /// Keyframes in frame order (the order of ). + private List Keys => [.. Editor.Session.Project.Camera.Keyframes.OrderBy(k => k.Frame)]; + + public override void Refresh() + { + base.Refresh(); + var points = Keys.Select(ToPoint).ToList(); + if (!points.SequenceEqual(KeyPoints)) + { + KeyPoints.Clear(); + foreach (var p in points) KeyPoints.Add(p); + } + if (SelectedKey >= Keys.Count) SelectedKey = Keys.Count - 1; + OnSelectedKeyChanged(); + } + + /// The curve editor finished an edit (add, move, delete): the points become the keyframes, keeping each one's framing. + public void CommitCurve() + { + var old = Keys; + var keys = new List(); + foreach (var point in KeyPoints.OrderBy(p => p.X)) + { + var frame = (int)double.Round(point.X * double.Max(1, Editor.FrameCount - 1)); + var zoom = 1 + double.Clamp(point.Y, 0, 1) * (MaxZoom - 1); + var nearest = old.MinBy(k => int.Abs(k.Frame - frame)); + keys.Add(nearest is null ? new CameraKey(frame, 0.5, 0.5, zoom, 0) : nearest with { Frame = frame, Zoom = zoom }); + } + Editor.Session.Edit(p => p with { Camera = p.Camera with { Keyframes = [.. keys.DistinctBy(k => k.Frame)] } }); + } + + public override void OnCurrentFrameChanged() + { + OnPropertyChanged(nameof(Playhead)); + OnPropertyChanged(nameof(AddKeyToolTip)); + } + + public override void OnBusyChanged() + { + base.OnBusyChanged(); + OnPropertyChanged(nameof(AddKeyToolTip)); + OnPropertyChanged(nameof(RemoveKeyToolTip)); + OnPropertyChanged(nameof(CurveToolTip)); + } + + /// A margin of the free crop (); all zero = the whole frame. + private static NumberRow CropRow(EditorSession session, CropSide side, string headerKey) => new(session, headerKey, "Tooltips.Editor.Camera.Crop", 0, + CropMargins.MaxMargin, 0.01, p => CropMargins.Of(p.Camera.Crop)[(int)side], + (p, v) => p with { Camera = p.Camera with { Crop = CropMargins.With(p.Camera.Crop, side, v) } }, v => Formatting.Percent(v)); + + private Point ToPoint(CameraKey key) => new(Editor.FrameCount > 1 ? (double)key.Frame / (Editor.FrameCount - 1) : 0, (key.Zoom - 1) / (MaxZoom - 1)); + + private void AddKey() + { + var frame = Editor.CurrentIndex; + var key = new CameraKey(frame, 0.5, 0.5, 1, 0); + Editor.Session.Edit(p => p with { Camera = p.Camera with { Keyframes = [.. p.Camera.Keyframes.Append(key).OrderBy(k => k.Frame)] } }); + SelectedKey = Keys.FindIndex(k => k.Frame == frame); + } + + private void RemoveKey() + { + if (!HasSelectedKey) return; + var frame = Keys[SelectedKey].Frame; + Editor.Session.Edit(p => p with { Camera = p.Camera with { Keyframes = [.. p.Camera.Keyframes.Where(k => k.Frame != frame)] } }); + } + + private void EditSelected(Func change) + { + if (!HasSelectedKey) return; + var index = SelectedKey; + Editor.Session.Edit(p => + { + var keys = p.Camera.Keyframes.OrderBy(k => k.Frame).ToList(); + keys[index] = change(keys[index]); + return p with { Camera = p.Camera with { Keyframes = keys } }; + }, "Camera.Key"); + } + + private void OnSelectedKeyChanged() + { + OnPropertyChanged(nameof(HasSelectedKey)); + OnPropertyChanged(nameof(RemoveKeyToolTip)); + OnPropertyChanged(nameof(SelectedCenterX)); + OnPropertyChanged(nameof(SelectedCenterY)); + OnPropertyChanged(nameof(SelectedZoom)); + OnPropertyChanged(nameof(SelectedZoomText)); + OnPropertyChanged(nameof(KeyText)); + } +} + +/// +/// Time (BRIEF §12.3): timing mode, playback rate, fit-to duration, the plan chart (video frames each photo gets, cuts +/// marked, the plan in numbers) and the time-remap curve (output time → source position, Fritsch–Carlson as the render +/// evaluates it). +/// +public sealed class TimeTab : EditorTab +{ + private Func? _evaluator; + private string? _planText; + private IReadOnlyList _planSeries = []; + private IReadOnlyList _planMarkers = []; + + public TimeTab(EditorViewModel editor) + : base(editor, "Time", AdvisorSection.Timing) + { + var s = editor.Session; + Rows = + [ + new AutoChoiceRow(s, EditorSettings.TimingMode, "Editor.Time.Mode", "Tooltips.Editor.Time.Mode", + [ + new Choice(TimingMode.Constant, "Editor.Timing.Constant"), new Choice(TimingMode.Adaptive, "Editor.Timing.Adaptive"), + new Choice(TimingMode.Interpolated, "Editor.Timing.Interpolated"), new Choice(TimingMode.Remapped, "Editor.Timing.Remapped"), + ]), + new AutoChoiceRow(s, EditorSettings.FrameRate, "Editor.Time.Rate", "Tooltips.Editor.Time.Rate", + [.. ExportPresets.FrameRates.Select(r => new Choice(FrameRateText.Format(r), "Editor.Value.Fps", EditorText.FrameRate(r)))]), + new NumberRow(s, "Editor.Time.Fit", "Tooltips.Editor.Time.Fit", 0, 600, 5, p => p.Timing.FitToSeconds ?? 0, + (p, v) => p with { Timing = p.Timing with { FitToSeconds = v > 0 ? v : null } }, + v => v > 0 ? Formatting.Duration(TimeSpan.FromSeconds(v)) : Loc.L("Editor.Value.Off")), + ]; + CommitCurveCommand = new RelayCommand(CommitCurve); + Refresh(); + } + + /// Remap control points (output fraction → source fraction), edited in place by the curve editor. + public ObservableCollection RemapPoints { get; } = []; + + /// The monotone spline through . + public Func? Evaluator { get => _evaluator; private set => Set(ref _evaluator, value); } + + /// Run by the curve editor after each finished edit. + public ICommand CommitCurveCommand { get; } + + /// How to edit the remap curve, or why it waits. + public string CurveToolTip => Loc.L(Editor.IsBusy ? "Tooltips.Editor.Busy" : "Tooltips.Editor.Time.Curve"); + + /// "3,600 frames → 2 min 30 s · 24 fps". + public string? PlanText { get => _planText; private set => Set(ref _planText, value); } + + /// Video frames each photo is shown for (0 = skipped by a speed-up, gap = excluded), over the sequence. + public IReadOnlyList PlanSeries { get => _planSeries; private set => Set(ref _planSeries, value); } + + /// Cuts of the plan (deliberate pauses, gaps, long exclusion runs). + public IReadOnlyList PlanMarkers { get => _planMarkers; private set => Set(ref _planMarkers, value); } + + public IReadOnlyList PlanLegend { get; } = [new(Loc.L("Editor.Chart.Shown"), "Brush.Accent")]; + + public Func PlanFormatter { get; } = v => v.ToString("0.#", Loc.Culture); + + public double Playhead => Editor.FrameCount > 1 ? (double)Editor.CurrentIndex / (Editor.FrameCount - 1) : double.NaN; + + public Func XFormatter { get; } = x => Loc.L("Editor.Time.Output", (x * 100).ToString("0", Loc.Culture)); + + public Func YFormatter { get; } = y => Loc.L("Editor.Time.Source", (y * 100).ToString("0", Loc.Culture)); + + public override void Refresh() + { + base.Refresh(); + var curve = Editor.Session.Project.Timing.RemapCurve; + var points = curve.Select(p => new Point(p.X, p.Y)).ToList(); + if (!points.SequenceEqual(RemapPoints)) + { + RemapPoints.Clear(); + foreach (var p in points) RemapPoints.Add(p); + } + Evaluator = Spline(points); + } + + public override void OnPlanChanged() + { + if (Editor.Plan is not { } plan) + { + PlanText = null; + PlanSeries = []; + PlanMarkers = []; + return; + } + var render = plan.Setup.Plan; + PlanText = Loc.Plural("Editor.Time.Plan", render.Frames.Count, Formatting.Duration(TimeSpan.FromSeconds(render.DurationSeconds)), + EditorText.FrameRate(render.FrameRate)); + var shown = new double[Editor.FrameCount]; + Array.Fill(shown, double.NaN); + foreach (var index in render.IncludedFrames) shown[index] = 0; + foreach (var frame in render.Frames) + { + var index = int.Clamp((int)double.Round(frame.SourcePosition), 0, shown.Length - 1); + shown[index] = (double.IsNaN(shown[index]) ? 0 : shown[index]) + frame.Slots; + } + PlanSeries = [new ChartSeries(Loc.L("Editor.Chart.Shown"), shown, "Brush.Accent")]; + PlanMarkers = [.. render.IncludedFrames.Where(render.IsCutBefore).Select(i => new TimelineMarker(i, MarkerKind.Warning, Loc.L("Editor.Marker.Cut")))]; + } + + /// The curve editor finished an edit: the points become the remap curve, and the timing mode follows it. + public void CommitCurve() + { + var curve = RemapPoints.OrderBy(p => p.X).Select(p => new CurvePoint(double.Clamp(p.X, 0, 1), double.Clamp(p.Y, 0, 1))).ToList(); + Editor.Session.Edit(p => p with + { + Timing = p.Timing with + { + RemapCurve = curve, + Mode = EditorSettings.TimingMode.Effective(p, null) == TimingMode.Remapped ? p.Timing.Mode : p.Timing.Mode.WithManual(TimingMode.Remapped), + }, + }); + } + + public override void OnCurrentFrameChanged() => OnPropertyChanged(nameof(Playhead)); + + public override void OnBusyChanged() + { + base.OnBusyChanged(); + OnPropertyChanged(nameof(CurveToolTip)); + } + + private static Func? Spline(IReadOnlyList points) + { + if (points.Count < 2) return null; + var ordered = points.OrderBy(p => p.X).DistinctBy(p => p.X).ToList(); + if (ordered.Count < 2) return null; + var spline = new MonotoneSpline([.. ordered.Select(p => p.X)], [.. ordered.Select(p => p.Y)]); + return x => double.Clamp(spline.Evaluate(x), 0, 1); + } +} diff --git a/src/Titano.App/Editor/CardColumns.cs b/src/Titano.App/Editor/CardColumns.cs new file mode 100644 index 00000000..c64190e2 --- /dev/null +++ b/src/Titano.App/Editor/CardColumns.cs @@ -0,0 +1,17 @@ +using System.Globalization; +using System.Windows.Data; + +namespace Titano.App.Editor; + +/// Columns of the Export tab's preset grid: as many as fit at (four at 1440 px, three at 1200 px). +public sealed class CardColumns : IValueConverter +{ + public const double MinCardWidth = 200; + + public static CardColumns Instance { get; } = new(); + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) => + value is double width && double.IsFinite(width) ? int.Max(1, (int)(width / MinCardWidth)) : 4; + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotSupportedException(); +} diff --git a/src/Titano.App/Editor/CropMargins.cs b/src/Titano.App/Editor/CropMargins.cs new file mode 100644 index 00000000..d82ab593 --- /dev/null +++ b/src/Titano.App/Editor/CropMargins.cs @@ -0,0 +1,37 @@ +namespace Titano.App.Editor; + +/// Margins of the free crop, in the order of (opposites differ in the lowest bit). +public enum CropSide +{ + Left, + Right, + Top, + Bottom, +} + +/// +/// The Camera tab's crop margins over CameraSettings.Crop (a normalised x, y, width, height rectangle, null for the +/// whole frame): each margin at most , opposite margins leaving at least . +/// +public static class CropMargins +{ + public const double MaxMargin = 0.45; + + public const double MinSize = 0.1; + + /// Left, right, top and bottom margins of (zeros for none or an invalid one, which the render ignores too). + public static double[] Of(double[]? crop) => crop is [var x, var y, var w, var h] && double.IsFinite(x + y + w + h) + ? [double.Clamp(x, 0, 1), double.Clamp(1 - x - w, 0, 1), double.Clamp(y, 0, 1), double.Clamp(1 - y - h, 0, 1)] + : [0, 0, 0, 0]; + + /// with one margin changed; null when no margin is left (the whole frame). + public static double[]? With(double[]? crop, CropSide side, double value) + { + var margins = Of(crop); + var opposite = (int)side ^ 1; + margins[(int)side] = double.Clamp(value, 0, double.Min(MaxMargin, 1 - MinSize - margins[opposite])); + if (margins.All(m => m == 0)) return null; + var (left, right, top, bottom) = (margins[0], margins[1], margins[2], margins[3]); + return [left, top, 1 - left - right, 1 - top - bottom]; + } +} diff --git a/src/Titano.App/Editor/CurveCommit.cs b/src/Titano.App/Editor/CurveCommit.cs new file mode 100644 index 00000000..5c79f29d --- /dev/null +++ b/src/Titano.App/Editor/CurveCommit.cs @@ -0,0 +1,28 @@ +using System.Windows; +using System.Windows.Input; +using Titano.Ui.Visuals; + +namespace Titano.App.Editor; + +/// Runs a command after every finished edit of a (add, move, delete, nudge). +public static class CurveCommit +{ + public static readonly DependencyProperty CommandProperty = DependencyProperty.RegisterAttached( + "Command", typeof(ICommand), typeof(CurveCommit), new PropertyMetadata(null, OnCommandChanged)); + + public static ICommand? GetCommand(DependencyObject d) => (ICommand?)d.GetValue(CommandProperty); + + public static void SetCommand(DependencyObject d, ICommand? value) => d.SetValue(CommandProperty, value); + + private static void OnCommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + if (d is not CurveEditor editor) return; + editor.EditCompleted -= OnEditCompleted; + if (e.NewValue is not null) editor.EditCompleted += OnEditCompleted; + } + + private static void OnEditCompleted(object sender, RoutedEventArgs e) + { + if (GetCommand((DependencyObject)sender) is { } command && command.CanExecute(null)) command.Execute(null); + } +} diff --git a/src/Titano.App/Editor/EditorImages.cs b/src/Titano.App/Editor/EditorImages.cs new file mode 100644 index 00000000..ce709f30 --- /dev/null +++ b/src/Titano.App/Editor/EditorImages.cs @@ -0,0 +1,85 @@ +using System.Windows.Media; +using System.Windows.Media.Imaging; +using Titano.Core.Diagnostics; +using Titano.Core.Imaging; +using Titano.Ui.Visuals; + +namespace Titano.App.Editor; + +/// Linear-light frames as frozen sRGB bitmaps the UI thread can show (created on any thread). +public static class EditorImages +{ + public static BitmapSource ToBitmap(ImageBuffer image) + { + ArgumentNullException.ThrowIfNull(image); + var channels = int.Min(3, image.Channels); + var pixels = PixelConvert.ToInterleaved8(image, channels); + var format = channels == 1 ? PixelFormats.Gray8 : PixelFormats.Rgb24; + var bitmap = BitmapSource.Create(image.Width, image.Height, 96, 96, format, null, pixels, image.Width * channels); + bitmap.Freeze(); + return bitmap; + } + + /// A waveform as an opacity mask (white, alpha = density) so the view paints it in a theme brush. + public static BitmapSource ToMask(LumaWaveform waveform) + { + ArgumentNullException.ThrowIfNull(waveform); + var pixels = new byte[waveform.Density.Length * 4]; + for (var i = 0; i < waveform.Density.Length; i++) + { + var alpha = waveform.Density[i]; + pixels[4 * i] = pixels[4 * i + 1] = pixels[4 * i + 2] = pixels[4 * i + 3] = alpha; + } + var bitmap = BitmapSource.Create(waveform.Columns, waveform.Rows, 96, 96, PixelFormats.Pbgra32, null, pixels, waveform.Columns * 4); + bitmap.Freeze(); + return bitmap; + } +} + +/// +/// Filmstrip thumbnails decoded through the editor's (embedded previews when large +/// enough), at most a few at a time so scrolling the strip never floods the decoders. +/// +public sealed class EditorThumbnails(ISequenceSource source, int count) : IThumbnailSource +{ + private readonly SemaphoreSlim _decoders = new(int.Clamp(Environment.ProcessorCount / 2, 2, 6)); + private int _pending; + + public int Count { get; } = count; + + /// Thumbnails requested and not yet returned (capture and tests wait for them). + public int Pending => Volatile.Read(ref _pending); + + public async ValueTask GetAsync(int index, int pixelWidth, CancellationToken cancellationToken) + { + Interlocked.Increment(ref _pending); + try + { + return await DecodeAsync(index, pixelWidth, cancellationToken); + } + finally + { + Interlocked.Decrement(ref _pending); + } + } + + private async Task DecodeAsync(int index, int pixelWidth, CancellationToken cancellationToken) + { + await _decoders.WaitAsync(cancellationToken); + try + { + // Long edge for frames up to 16:9 tall or wide; the cache rounds requests, so nearby widths share a decode. + using var frame = await source.DecodeAsync(index, int.Clamp(pixelWidth, 32, 512), DecodePurpose.Thumbnail, cancellationToken); + return frame is null ? null : EditorImages.ToBitmap(frame); + } + catch (Exception ex) when (ex is not OperationCanceledException) + { + Log.Debug("editor", $"No thumbnail for frame {index}: {ex.Message}"); + return null; + } + finally + { + _decoders.Release(); + } + } +} diff --git a/src/Titano.App/Editor/EditorMeasures.xaml b/src/Titano.App/Editor/EditorMeasures.xaml new file mode 100644 index 00000000..cf5f6426 --- /dev/null +++ b/src/Titano.App/Editor/EditorMeasures.xaml @@ -0,0 +1,259 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Titano.App/Editor/EditorPanels.xaml b/src/Titano.App/Editor/EditorPanels.xaml new file mode 100644 index 00000000..0ce71b18 --- /dev/null +++ b/src/Titano.App/Editor/EditorPanels.xaml @@ -0,0 +1,443 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +