Exemplo n.º 1
0
 private void BayerDlg_Load(object sender, EventArgs e)
 {
     if (m_pBayer == null)
     {
         MessageBox.Show("No Bayer object specified");
         this.Close();
         return;
     }
     m_Align  = m_pBayer.Align;
     m_Method = m_pBayer.Method;
     m_pImageWnd.TrackerEnable = true;
     UpdateInterface();
 }
Exemplo n.º 2
0
        private void UpdateInterface()
        {
            SapBayer.AlignMode         AlignCap  = m_pBayer.AvailAlign;
            SapBayer.CalculationMethod MethodCap = m_pBayer.AvailMethod;

            switch (m_Align)
            {
            case SapBayer.AlignMode.BGGR: radioButton_Align_BG_GR.Checked = true; break;

            case SapBayer.AlignMode.GBRG: radioButton_Align_GB_RG.Checked = true; break;

            case SapBayer.AlignMode.GRBG: radioButton_Align_GR_BG.Checked = true; break;

            case SapBayer.AlignMode.RGGB: radioButton_Align_RG_GB.Checked = true; break;
            }

            // Check which alignment is available
            radioButton_Align_GB_RG.Enabled = (AlignCap & SapBayer.AlignMode.GBRG) > 0;
            radioButton_Align_BG_GR.Enabled = (AlignCap & SapBayer.AlignMode.BGGR) > 0;
            radioButton_Align_GR_BG.Enabled = (AlignCap & SapBayer.AlignMode.GRBG) > 0;
            radioButton_Align_RG_GB.Enabled = (AlignCap & SapBayer.AlignMode.RGGB) > 0;

            switch (m_Method)
            {
            case SapBayer.CalculationMethod.Method1: radioButton_Method1.Checked = true; break;

            case SapBayer.CalculationMethod.Method2: radioButton_Method2.Checked = true; break;

            case SapBayer.CalculationMethod.Method3: radioButton_Method3.Checked = true; break;

            case SapBayer.CalculationMethod.Method4: radioButton_Method4.Checked = true; break;

            case SapBayer.CalculationMethod.Method5: radioButton_Method5.Checked = true; break;

            case SapBayer.CalculationMethod.Method6: radioButton_Method6.Checked = true; break;
            }

            // Check which interpolation method is available
            radioButton_Method1.Enabled = (MethodCap & SapBayer.CalculationMethod.Method1) > 0;
            radioButton_Method2.Enabled = (MethodCap & SapBayer.CalculationMethod.Method2) > 0;
            radioButton_Method3.Enabled = (MethodCap & SapBayer.CalculationMethod.Method3) > 0;
            radioButton_Method4.Enabled = (MethodCap & SapBayer.CalculationMethod.Method4) > 0;
            radioButton_Method5.Enabled = (MethodCap & SapBayer.CalculationMethod.Method5) > 0;
            radioButton_Method6.Enabled = (MethodCap & SapBayer.CalculationMethod.Method6) > 0;


            // Initialize gain values
            SapDataFRGB wbGain = m_pBayer.WBGain;

            textBox_Red_Gain.Text   = wbGain.Red.ToString();
            textBox_Green_Gain.Text = wbGain.Green.ToString();
            textBox_Blue_Gain.Text  = wbGain.Blue.ToString();

            button_AutoWhite.Enabled = m_pImageWnd != null;

            // Initialize Gamma correction factor
            textBox_Gamma.Text     = m_pBayer.Gamma.ToString();
            checkBox_Gamma.Checked = m_pBayer.LutEnable;

            // Check if bayer decoder is enabled and if a lookup table is available
            textBox_Gamma.Enabled  = m_pBayer.Enabled && checkBox_Gamma.Checked;
            checkBox_Gamma.Enabled = m_pBayer.Enabled;

            // Disable Apply button until something change
            button_Apply.Enabled = false;
        }
Exemplo n.º 3
0
 private void radioButton_Align_GR_BG_CheckedChanged(object sender, EventArgs e)
 {
     m_Align = SapBayer.AlignMode.GRBG;
     OnChange();
 }
Exemplo n.º 4
0
 private void radioButton_Align_RG_GB_CheckedChanged(object sender, EventArgs e)
 {
     m_Align = SapBayer.AlignMode.RGGB;
     OnChange();
 }