コード例 #1
0
 public SettingsPanel()
 {
     radio_HDR.Add(new RadioButton {
         Content = "Robertson"
     }, () => new RobertsonHDRSolver());
     radio_HDR.Add(new RadioButton {
         Content = "Enhanced Robertson"
     }, () => new EnhancedRobertsonHDRSolver());
     radio_ToneMapping.Add(new RadioButton {
         Content = "Heat Map"
     }, () => new HeatMapToneMapping());
     radio_ToneMapping.Add(new RadioButton {
         Content = "Global Operator"
     }, () => new GlobalOperatorToneMapping());
     radio_ToneMapping.Add(new RadioButton {
         Content = "Test"
     }, () => new TestToneMappingSolver());
     for (int i = 0; i < 2; i++)
     {
         textBoxes_tone_params.Add(new TextBox {
             MinWidth = 100
         });
     }
     InitializeViews();
     instance = this;
 }
コード例 #2
0
 public GlobalOperatorToneMapping()
 {
     if (!double.TryParse(SettingsPanel.ToneArg(0), out alpha))
     {
         alpha = 0.18;                                                       // low key: 0.18, high key: 0.5
     }
     if (!double.TryParse(SettingsPanel.ToneArg(1), out Lwhite))
     {
         Lwhite = 3;
     }
 }
コード例 #3
0
 void InitializeViews()
 {
     this.Content = new Grid
     {
         RowDefinitions =
         {
             new RowDefinition {
                 Height = new GridLength(1, GridUnitType.Auto)
             },
             new RowDefinition {
                 Height = new GridLength(2, GridUnitType.Star)
             },
             new RowDefinition {
                 Height = new GridLength(1, GridUnitType.Auto)
             },
             new RowDefinition {
                 Height = new GridLength(6, GridUnitType.Star)
             }
         },
         ColumnDefinitions =
         {
             new ColumnDefinition {
                 Width = new GridLength(9, GridUnitType.Star)
             },
             new ColumnDefinition {
                 Width = new GridLength(7, GridUnitType.Star)
             }
         },
         Children =
         {
             new WrapPanel
             {
                 Children =
                 {
                     new Button {
                         Content = "Open"
                     }.Set(() => sourceImagePanel.OpenImages()),
                     new Button {
                         Content = "Generate"
                     }.Set(async() => targetImagePanel.ShowImage(await settingsPanel.ProcessImage(sourceImagePanel.GetImages()))),
                     new Button {
                         Content = "Save"
                     }.Set(() => targetImagePanel.SaveImage())
                 }
             }.Set(0, 0),
             new LogPanel().Set(1, 0),
             new Label          {
                 Content = "Settings:"
             }.Set(2, 0),
             (settingsPanel = new SettingsPanel()).Set(3, 0),
             new Label          {
                 Content = "Source Images:"
             }.Set(0, 1),
             (sourceImagePanel = new SourceImagePanel()).Set(1, 1),
             new Label          {
                 Content = "Result Image:"
             }.Set(2, 1),
             (targetImagePanel = new TargetImagePanel()).Set(3, 1)
         }
     };
 }