Release 1.1.4: replace noisy preview modes with patch denoising and fixed stretch
All checks were successful
Release AstroFrame / packages (push) Successful in 59s

This commit is contained in:
Elijah 2026-10-04 14:27:04 -07:00
parent d3362c8341
commit b8ffe97c46
17 changed files with 143 additions and 270 deletions

View file

@ -30,7 +30,7 @@ public sealed partial class MainWindow:Window
readonly DispatcherTimer memoryTimer=new(){Interval=TimeSpan.FromSeconds(1)};
StarInspector? starInspector;
readonly Border previewPanel,comparisonBorder,previewControls;
readonly ComboBox previewMode=new(){ItemsSource=new[]{"Frame view","Nebula view","Asinh view","Color nebula"},SelectedIndex=0,MinWidth=150};
readonly ComboBox previewMode=new(){ItemsSource=new[]{"Frame view","Denoised"},SelectedIndex=0,MinWidth=150};
readonly Slider displayStretch=new(){Minimum=.08,Maximum=.40,Value=.18};
readonly StackPanel inspector=new(){Spacing=9};
readonly Grid previewWorkspace=new(){ColumnDefinitions=new("*,0"),Margin=new(0,8,0,6)};
@ -59,7 +59,7 @@ public sealed partial class MainWindow:Window
// Keep the native slider's input behavior; give its thumb a visible silver face and room for the full circle.
Styles.Add(new Style(x=>x.OfType<Slider>().Template().OfType<Avalonia.Controls.Primitives.Thumb>()){Setters={new Setter(Avalonia.Controls.Primitives.TemplatedControl.TemplateProperty,new FuncControlTemplate<Avalonia.Controls.Primitives.Thumb>((_,_)=>new Border{Width=20,Height=20,CornerRadius=new(10),Background=Palette.Accent,BorderBrush=Palette.Panel,BorderThickness=new(3),HorizontalAlignment=HorizontalAlignment.Center,VerticalAlignment=VerticalAlignment.Center}))}});
previewMode.SelectionChanged+=(_,_)=>{preview.SetMode((PreviewMode)Math.Max(0,previewMode.SelectedIndex));comparison.SetMode((PreviewMode)Math.Max(0,previewMode.SelectedIndex));};
ToolTip.SetTip(previewMode,"Frame: original grayscale stretch. Nebula: smooth faint detail with less star dominance. Asinh: an alternative smooth stretch. Color: sky-neutralized Bayer RGB when available. Display options do not change analysis.");
ToolTip.SetTip(previewMode,"Frame: original grayscale preview. Denoised: reduce preview noise while keeping the original stretch parameters. Display options do not change analysis.");
displayStretch.PropertyChanged+=(_,e)=>{if(e.Property==Slider.ValueProperty){stretchValue.Text=displayStretch.Value.ToString("0.00");preview.Stretch=comparison.Stretch=displayStretch.Value;preview.RefreshDisplay();comparison.RefreshDisplay();}};
Title="AstroFrame";Width=1450;Height=940;MinWidth=1120;MinHeight=740;Background=Palette.Background;FontFamily="Inter";FontSize=13;
ExtendClientAreaToDecorationsHint=true;ExtendClientAreaChromeHints=Avalonia.Platform.ExtendClientAreaChromeHints.PreferSystemChrome;ExtendClientAreaTitleBarHeightHint=36;
@ -170,9 +170,9 @@ public sealed partial class MainWindow:Window
var f=rejected?project.Frames.FirstOrDefault(x=>x.Effective==Verdict.Reject):project.Frames.FirstOrDefault(x=>x.Target.Contains("1432"));
if(f==null)return;sessions.SelectedItem=f.Session;filter.SelectedIndex=rejected?2:0;spatial.IsChecked=rejected;compare.IsChecked=rejected;frames.SelectedItem=f;Select(f);
}
public void CaptureExposure(string filename,bool nebula=false)
public void CaptureExposure(string filename)
{
if(project==null)return;var f=project.Frames.First(x=>x.Name.Contains(filename,StringComparison.OrdinalIgnoreCase));sessions.SelectedItem=f.Session;filter.SelectedIndex=0;spatial.IsChecked=false;compare.IsChecked=false;previewMode.SelectedIndex=nebula?1:0;frames.SelectedItem=f;Select(f);
if(project==null)return;var f=project.Frames.First(x=>x.Name.Contains(filename,StringComparison.OrdinalIgnoreCase));sessions.SelectedItem=f.Session;filter.SelectedIndex=0;spatial.IsChecked=false;compare.IsChecked=false;previewMode.SelectedIndex=0;frames.SelectedItem=f;Select(f);
}
public Task WaitForPreviews()=>Task.WhenAll(preview.Loading,comparison.Loading);
public void CaptureMetric(string name)
@ -181,7 +181,7 @@ public sealed partial class MainWindow:Window
if(index<0)throw new ArgumentException("Unknown quality metric",nameof(name));metric.SelectedIndex=index;
}
public void CapturePreviewMode(int mode)
{if(mode<0||mode>3)throw new ArgumentOutOfRangeException(nameof(mode));previewMode.SelectedIndex=mode;}
{if(mode<0||mode>1)throw new ArgumentOutOfRangeException(nameof(mode));previewMode.SelectedIndex=mode;}
public async Task SmokeTest(string report)
{
if(project==null)throw new InvalidOperationException("Project not loaded");
@ -202,7 +202,7 @@ public sealed partial class MainWindow:Window
filter.SelectedIndex=0;sort.SelectedIndex=2;Check(visible[0].StarCount==visible.Min(f=>f.StarCount),"metric sorting");
metric.SelectedIndex=Array.FindIndex(QualityChart.Metrics,m=>m.Name=="Background");Check(chart.Metric.Name=="Background","graph metric switching");
await WaitForPreviews();Check(preview.HasImage,"latest preview loads after rapid exposure switching");
previewMode.SelectedIndex=1;displayStretch.Value=.26;Check(preview.Nebula&&Math.Abs(preview.Stretch-.26)<.001,"nebula view and adjustable stretch render without changing classification");
previewMode.SelectedIndex=1;displayStretch.Value=.26;await WaitForPreviews();Check(preview.Mode==PreviewMode.Denoised&&Math.Abs(preview.Stretch-.26)<.001,"denoised view and adjustable stretch render without changing classification");
Width=1120;Height=740;await Task.Delay(100);Check(Bounds.Width>=1120,"minimum window size");
compare.IsChecked=false;await Task.Delay(100);
Check(this.GetVisualDescendants().OfType<QualityChart>().Count()==1,"one selectable quality graph");