<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.40.0 

Copyright (C) The free-astro development team, 2019-2023

This file is part of Siril.

Siril is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Siril is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Siril.  If not, see <http://www.gnu.org/licenses/>.

-->
<interface>
  <requires lib="gtk+" version="3.22"/>
  <!-- interface-local-resource-path ../.. -->
  <!-- interface-css-provider-path siril.css -->
  <!-- interface-license-type gplv3 -->
  <!-- interface-name Siril -->
  <!-- interface-description Tool for astronomy image processing -->
  <!-- interface-copyright The free-astro development team, 2023 -->
  <object class="GtkAdjustment" id="adj_background_smoothing">
    <property name="upper">1</property>
    <property name="value">0.5</property>
    <property name="step-increment">0.01</property>
    <property name="page-increment">0.20</property>
  </object>
  <object class="GtkAdjustment" id="adj_background_tolerance">
    <property name="lower">0.01</property>
    <property name="upper">6</property>
    <property name="value">2</property>
    <property name="step-increment">0.10</property>
    <property name="page-increment">1</property>
  </object>
  <object class="GtkAdjustment" id="adjustment_background_nb_samples">
    <property name="lower">5</property>
    <property name="upper">100</property>
    <property name="value">20</property>
    <property name="step-increment">1</property>
    <property name="page-increment">10</property>
  </object>
  <object class="GtkDialog" id="background_extraction_dialog">
    <property name="width-request">400</property>
    <property name="height-request">200</property>
    <property name="can-focus">False</property>
    <property name="border-width">5</property>
    <property name="title" translatable="yes">Background Extraction</property>
    <property name="resizable">False</property>
    <property name="window-position">center</property>
    <property name="type-hint">dialog</property>
    <signal name="delete-event" handler="bge_hide_on_delete" swapped="no"/>
    <signal name="hide" handler="on_background_extraction_dialog_hide" swapped="no"/>
    <signal name="show" handler="on_background_extraction_dialog_show" swapped="no"/>
    <child internal-child="vbox">
      <object class="GtkBox" id="box_dialog_bkg">
        <property name="can-focus">False</property>
        <property name="orientation">vertical</property>
        <property name="spacing">10</property>
        <child internal-child="action_area">
          <object class="GtkButtonBox">
            <property name="can-focus">False</property>
            <property name="layout-style">end</property>
            <child>
              <object class="GtkButton" id="background_close_button">
                <property name="label" translatable="yes">Close</property>
                <property name="visible">True</property>
                <property name="can-focus">True</property>
                <property name="receives-default">True</property>
                <property name="tooltip-text" translatable="yes">Close the window.</property>
                <signal name="clicked" handler="on_background_close_button_clicked" swapped="no"/>
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="fill">True</property>
                <property name="position">0</property>
              </packing>
            </child>
            <child>
              <object class="GtkButton" id="background_ok_button">
                <property name="label" translatable="yes">Apply</property>
                <property name="visible">True</property>
                <property name="sensitive">False</property>
                <property name="can-focus">True</property>
                <property name="receives-default">True</property>
                <property name="tooltip-markup" translatable="yes">This will confirm the background model previously applied with the &lt;b&gt;Compute Background&lt;/b&gt; button. However, in the case of a sequence, if the &lt;b&gt;Apply to sequence&lt;/b&gt; button is checked, this will compute the model and apply it to the whole sequence.</property>
                <signal name="clicked" handler="on_background_ok_button_clicked" swapped="no"/>
                <style>
                  <class name="suggested-action"/>
                </style>
              </object>
              <packing>
                <property name="expand">True</property>
                <property name="fill">True</property>
                <property name="position">1</property>
              </packing>
            </child>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">False</property>
            <property name="position">0</property>
          </packing>
        </child>
        <child>
          <object class="GtkExpander">
            <property name="visible">True</property>
            <property name="can-focus">True</property>
            <property name="expanded">True</property>
            <child>
              <object class="GtkBox" id="background_box">
                <property name="visible">True</property>
                <property name="can-focus">False</property>
                <property name="orientation">vertical</property>
                <property name="spacing">10</property>
                <child>
                  <object class="GtkComboBoxText" id="background_extraction_combo">
                    <property name="visible">True</property>
                    <property name="can-focus">False</property>
                    <property name="tooltip-text" translatable="yes">Choose between interpolation methods.</property>
                    <property name="margin-top">5</property>
                    <property name="active">0</property>
                    <items>
                      <item translatable="yes">RBF</item>
                      <item translatable="yes">Polynomial</item>
                    </items>
                    <signal name="changed" handler="on_background_extraction_combo_changed" swapped="no"/>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">True</property>
                    <property name="position">0</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkNotebook" id="bkg_notebook_inter">
                    <property name="visible">True</property>
                    <property name="can-focus">False</property>
                    <property name="show-tabs">False</property>
                    <property name="show-border">False</property>
                    <child>
                      <object class="GtkBox">
                        <property name="visible">True</property>
                        <property name="can-focus">False</property>
                        <property name="orientation">vertical</property>
                        <child>
                          <object class="GtkBox">
                            <property name="visible">True</property>
                            <property name="can-focus">False</property>
                            <child>
                              <object class="GtkLabel" id="RBF_smoothing">
                                <property name="visible">True</property>
                                <property name="can-focus">False</property>
                                <property name="halign">start</property>
                                <property name="label" translatable="yes">Smoothing</property>
                              </object>
                              <packing>
                                <property name="expand">False</property>
                                <property name="fill">True</property>
                                <property name="position">0</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkSpinButton" id="spin_background_smoothing">
                                <property name="visible">True</property>
                                <property name="can-focus">True</property>
                                <property name="tooltip-text" translatable="yes">Number of sample per line that will be automatically placed.</property>
                                <property name="halign">end</property>
                                <property name="hexpand">True</property>
                                <property name="width-chars">6</property>
                                <property name="text">0.50</property>
                                <property name="input-purpose">digits</property>
                                <property name="input-hints">GTK_INPUT_HINT_NO_EMOJI | GTK_INPUT_HINT_NONE</property>
                                <property name="adjustment">adj_background_smoothing</property>
                                <property name="digits">2</property>
                                <property name="numeric">True</property>
                                <property name="value">0.5</property>
                              </object>
                              <packing>
                                <property name="expand">False</property>
                                <property name="fill">True</property>
                                <property name="position">1</property>
                              </packing>
                            </child>
                          </object>
                          <packing>
                            <property name="expand">False</property>
                            <property name="fill">True</property>
                            <property name="position">0</property>
                          </packing>
                        </child>
                        <child>
                          <object class="GtkScale">
                            <property name="visible">True</property>
                            <property name="can-focus">True</property>
                            <property name="tooltip-text" translatable="yes">Adjust the smoothing parameter for the interpolation method. A smoothing parameter that is too small may result in overshoots and undershoots between points in the background, while a smoothing parameter that is too large may not be suitable for large deviations in gradient.</property>
                            <property name="adjustment">adj_background_smoothing</property>
                            <property name="draw-value">False</property>
                          </object>
                          <packing>
                            <property name="expand">False</property>
                            <property name="fill">True</property>
                            <property name="position">1</property>
                          </packing>
                        </child>
                      </object>
                    </child>
                    <child type="tab">
                      <object class="GtkLabel">
                        <property name="visible">True</property>
                        <property name="can-focus">False</property>
                        <property name="label" translatable="yes">page 1</property>
                      </object>
                      <packing>
                        <property name="tab-fill">False</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkBox" id="background_box_poly">
                        <property name="visible">True</property>
                        <property name="can-focus">False</property>
                        <property name="valign">start</property>
                        <property name="spacing">10</property>
                        <child>
                          <object class="GtkLabel" id="background_label_degree">
                            <property name="visible">True</property>
                            <property name="can-focus">False</property>
                            <property name="halign">start</property>
                            <property name="margin-bottom">2</property>
                            <property name="label" translatable="yes">Degree order: </property>
                          </object>
                          <packing>
                            <property name="expand">False</property>
                            <property name="fill">True</property>
                            <property name="position">0</property>
                          </packing>
                        </child>
                        <child>
                          <object class="GtkComboBoxText" id="box_background_order">
                            <property name="visible">True</property>
                            <property name="can-focus">False</property>
                            <property name="tooltip-text" translatable="yes">Choose the degree order of the polynomial function used in the fit.
By default the value is of 4.
The higher the degree order is, the more complex the gradient can be removed.</property>
                            <property name="hexpand">True</property>
                            <property name="active">3</property>
                            <items>
                              <item>1</item>
                              <item>2</item>
                              <item>3</item>
                              <item>4</item>
                            </items>
                          </object>
                          <packing>
                            <property name="expand">False</property>
                            <property name="fill">True</property>
                            <property name="position">1</property>
                          </packing>
                        </child>
                      </object>
                      <packing>
                        <property name="position">1</property>
                      </packing>
                    </child>
                    <child type="tab">
                      <object class="GtkLabel">
                        <property name="visible">True</property>
                        <property name="can-focus">False</property>
                        <property name="label">page 1</property>
                      </object>
                      <packing>
                        <property name="position">1</property>
                        <property name="tab-fill">False</property>
                      </packing>
                    </child>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">True</property>
                    <property name="position">1</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkBox">
                    <property name="visible">True</property>
                    <property name="can-focus">False</property>
                    <child>
                      <object class="GtkLabel" id="background_label_samples">
                        <property name="visible">True</property>
                        <property name="can-focus">False</property>
                        <property name="halign">start</property>
                        <property name="label" translatable="yes">Samples per line</property>
                      </object>
                      <packing>
                        <property name="expand">False</property>
                        <property name="fill">True</property>
                        <property name="position">0</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkSpinButton" id="spin_background_nb_samples">
                        <property name="visible">True</property>
                        <property name="can-focus">True</property>
                        <property name="tooltip-text" translatable="yes">Number of sample per line that will be automatically placed.</property>
                        <property name="halign">end</property>
                        <property name="hexpand">True</property>
                        <property name="text">20</property>
                        <property name="input-purpose">digits</property>
                        <property name="input-hints">GTK_INPUT_HINT_NO_EMOJI | GTK_INPUT_HINT_NONE</property>
                        <property name="adjustment">adjustment_background_nb_samples</property>
                        <property name="numeric">True</property>
                        <property name="value">20</property>
                      </object>
                      <packing>
                        <property name="expand">False</property>
                        <property name="fill">True</property>
                        <property name="position">1</property>
                      </packing>
                    </child>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">True</property>
                    <property name="position">2</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkScale">
                    <property name="visible">True</property>
                    <property name="can-focus">True</property>
                    <property name="tooltip-text" translatable="yes">Number of sample per line that will be automatically placed.</property>
                    <property name="adjustment">adjustment_background_nb_samples</property>
                    <property name="draw-value">False</property>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">True</property>
                    <property name="position">3</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkBox">
                    <property name="visible">True</property>
                    <property name="can-focus">False</property>
                    <property name="spacing">6</property>
                    <child>
                      <object class="GtkLabel" id="background_label_tolorence">
                        <property name="visible">True</property>
                        <property name="can-focus">False</property>
                        <property name="tooltip-text" translatable="yes">Avoid generating banding by adding some random noise in the low dynamic background gradient.
This should be enabled for non-stretched images.</property>
                        <property name="halign">start</property>
                        <property name="label" translatable="yes">Grid tolerance</property>
                      </object>
                      <packing>
                        <property name="expand">False</property>
                        <property name="fill">True</property>
                        <property name="position">0</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkSpinButton">
                        <property name="visible">True</property>
                        <property name="can-focus">True</property>
                        <property name="tooltip-text" translatable="yes">Tolerance factor of global sample rejection, in mad units (median + this * mad). By decreasing this value, Siril will be more restrictive to select background samples.</property>
                        <property name="text">2.00</property>
                        <property name="input-purpose">digits</property>
                        <property name="input-hints">GTK_INPUT_HINT_NO_EMOJI | GTK_INPUT_HINT_NONE</property>
                        <property name="adjustment">adj_background_tolerance</property>
                        <property name="digits">2</property>
                        <property name="numeric">True</property>
                        <property name="value">2</property>
                      </object>
                      <packing>
                        <property name="expand">True</property>
                        <property name="fill">True</property>
                        <property name="position">1</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkCheckButton" id="subsky_keep_samples">
                        <property name="label" translatable="yes">Keep all samples</property>
                        <property name="visible">True</property>
                        <property name="can-focus">True</property>
                        <property name="receives-default">False</property>
                        <property name="tooltip-text" translatable="yes">Override tolerance and keep all samples. May be useful in cases of extreme gradients if tolerance 6 is insufficient: you will need to remove samples from astronomical objects manually.</property>
                        <property name="halign">end</property>
                        <property name="draw-indicator">True</property>
                      </object>
                      <packing>
                        <property name="expand">True</property>
                        <property name="fill">True</property>
                        <property name="position">2</property>
                      </packing>
                    </child>
                  </object>
                  <packing>
                    <property name="expand">True</property>
                    <property name="fill">True</property>
                    <property name="position">4</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkScale" id="scale_background_tolerance">
                    <property name="visible">True</property>
                    <property name="can-focus">True</property>
                    <property name="tooltip-text" translatable="yes">Tolerance of global sample rejection, in sigma units. By decreasing this value, Siril will be more restrictive to select background samples.</property>
                    <property name="hexpand">True</property>
                    <property name="adjustment">adj_background_tolerance</property>
                    <property name="digits">2</property>
                    <property name="draw-value">False</property>
                    <property name="value-pos">bottom</property>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">True</property>
                    <property name="position">5</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkCheckButton" id="bkg_dither_button">
                    <property name="label" translatable="yes">Add dither</property>
                    <property name="visible">True</property>
                    <property name="can-focus">True</property>
                    <property name="receives-default">False</property>
                    <property name="tooltip-text" translatable="yes">Hit this option when color banding is produced after background extraction.
Dither is an intentionally applied form of noise used to randomize quantization error, preventing large-scale patterns such as color banding in images.</property>
                    <property name="halign">start</property>
                    <property name="draw-indicator">True</property>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">True</property>
                    <property name="position">6</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkBox" id="box_generate">
                    <property name="visible">True</property>
                    <property name="can-focus">False</property>
                    <child>
                      <object class="GtkButton" id="background_generate">
                        <property name="label" translatable="yes">Generate</property>
                        <property name="visible">True</property>
                        <property name="can-focus">True</property>
                        <property name="receives-default">True</property>
                        <property name="tooltip-text" translatable="yes">Click here to generate the automatically defined samples.

When processing a sequence the samples shown are only for guidance to see the effect of setting samples_per_line and grid tolerance on sample placement: samples will automatically be created for each frame in the sequence.</property>
                        <property name="halign">center</property>
                        <property name="valign">center</property>
                        <signal name="clicked" handler="on_background_generate_clicked" swapped="no"/>
                        <style>
                          <class name="suggested-action"/>
                        </style>
                      </object>
                      <packing>
                        <property name="expand">False</property>
                        <property name="fill">True</property>
                        <property name="position">0</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkButton" id="background_clear_all">
                        <property name="label" translatable="yes">Clear</property>
                        <property name="visible">True</property>
                        <property name="can-focus">True</property>
                        <property name="receives-default">True</property>
                        <property name="tooltip-text" translatable="yes">Click here to clear all the samples.</property>
                        <property name="halign">center</property>
                        <property name="valign">center</property>
                        <signal name="clicked" handler="on_background_clear_all_clicked" swapped="no"/>
                      </object>
                      <packing>
                        <property name="expand">False</property>
                        <property name="fill">True</property>
                        <property name="pack-type">end</property>
                        <property name="position">1</property>
                      </packing>
                    </child>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">True</property>
                    <property name="position">7</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkLabel" id="label_samples">
                    <property name="visible">True</property>
                    <property name="can-focus">False</property>
                    <property name="label" translatable="yes">You also can set samples manually.
Left click adds samples while right click removes them.</property>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">True</property>
                    <property name="position">8</property>
                  </packing>
                </child>
              </object>
            </child>
            <child type="label">
              <object class="GtkLabel">
                <property name="visible">True</property>
                <property name="can-focus">False</property>
                <property name="label" translatable="yes">Interpolation Method</property>
                <attributes>
                  <attribute name="weight" value="bold"/>
                </attributes>
              </object>
            </child>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="position">0</property>
          </packing>
        </child>
        <child>
          <object class="GtkExpander">
            <property name="visible">True</property>
            <property name="can-focus">True</property>
            <property name="expanded">True</property>
            <child>
              <object class="GtkComboBoxText" id="box_background_correction">
                <property name="visible">True</property>
                <property name="can-focus">False</property>
                <property name="tooltip-text" translatable="yes">Choose the type of correction you want apply:
Subtraction: it is mainly used to correct additive effects, such as gradients caused by light pollution or by the Moon.
Division: it is mainly used to correct multiplicative phenomena, such as vignetting or differential atmospheric absorption for example. However, this kind of operation should be done by master-flat correction.</property>
                <property name="valign">start</property>
                <property name="margin-top">5</property>
                <property name="active">0</property>
                <items>
                  <item translatable="yes">Subtraction</item>
                  <item translatable="yes">Division</item>
                </items>
              </object>
            </child>
            <child type="label">
              <object class="GtkLabel">
                <property name="visible">True</property>
                <property name="can-focus">False</property>
                <property name="label" translatable="yes">Correction</property>
                <attributes>
                  <attribute name="weight" value="bold"/>
                </attributes>
              </object>
            </child>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="position">1</property>
          </packing>
        </child>
        <child>
          <object class="GtkButton" id="bkg_compute_bkg">
            <property name="label" translatable="yes">Compute Background</property>
            <property name="visible">True</property>
            <property name="can-focus">True</property>
            <property name="receives-default">True</property>
            <property name="tooltip-text" translatable="yes">This will compute the synthetic background and will apply the selected correction. The model is always computed from the original image kept in memory allowing the user to work iteratively.</property>
            <signal name="clicked" handler="on_bkg_compute_bkg_clicked" swapped="no"/>
            <style>
              <class name="suggested-action"/>
            </style>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="position">2</property>
          </packing>
        </child>
        <child>
          <object class="GtkButton" id="bkg_show_original">
            <property name="label" translatable="yes">Show original image</property>
            <property name="visible">True</property>
            <property name="sensitive">False</property>
            <property name="can-focus">True</property>
            <property name="receives-default">True</property>
            <property name="tooltip-text" translatable="yes">Keep pressing this button to see the original image.</property>
            <signal name="button-press-event" handler="on_bkg_show_original_button_press_event" swapped="no"/>
            <signal name="button-release-event" handler="on_bkg_show_original_button_release_event" swapped="no"/>
            <signal name="enter-notify-event" handler="on_bkg_show_original_enter_notify_event" swapped="no"/>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="position">3</property>
          </packing>
        </child>
        <child>
          <object class="GtkBox">
            <property name="visible">True</property>
            <property name="can-focus">False</property>
            <property name="spacing">5</property>
            <child>
              <object class="GtkCheckButton" id="checkBkgSeq">
                <property name="label" translatable="yes">Apply to sequence</property>
                <property name="visible">True</property>
                <property name="can-focus">True</property>
                <property name="receives-default">False</property>
                <property name="tooltip-text" translatable="yes">If a sequence is loaded and this is activated, perform the processing on all images of the sequence instead of only the loaded image.</property>
                <property name="draw-indicator">True</property>
                <signal name="toggled" handler="on_checkBkgSeq_toggled" swapped="no"/>
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="fill">True</property>
                <property name="position">0</property>
              </packing>
            </child>
            <child>
              <object class="GtkLabel" id="label1">
                <property name="visible">True</property>
                <property name="can-focus">False</property>
                <property name="label" translatable="yes">Output prefix:</property>
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="fill">True</property>
                <property name="position">1</property>
              </packing>
            </child>
            <child>
              <object class="GtkEntry" id="entryBkgSeq">
                <property name="visible">True</property>
                <property name="can-focus">True</property>
                <property name="tooltip-text" translatable="yes">Prefix of the image names resulting from the background extraction process.</property>
                <property name="max-length">10</property>
                <property name="width-chars">10</property>
                <property name="text">bkg_</property>
                <property name="input-hints">GTK_INPUT_HINT_NO_EMOJI | GTK_INPUT_HINT_NONE</property>
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="fill">True</property>
                <property name="position">2</property>
              </packing>
            </child>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="position">4</property>
          </packing>
        </child>
      </object>
    </child>
  </object>
</interface>
