Beispiel #1
0
 private void matrixSize_SelectedIndexChanged(object sender, System.EventArgs e)
 {
     if (doEvents)
     {
         if (predefinedMatrix.SelectedIndex == 3)                 // save previous matrix before showing the new one
         {
             this.saveMatrix(this.currentConfig);
         }
         MatrixConfig conf = getCurrentConfig();
         if (matrixSize.SelectedIndex == 0)                 // 4x4
         {
             if (predefinedMatrix.SelectedIndex == 3)       // custom 4x4
             {
                 enable4x4Matrix();
             }
             i4x4Matrix();
             loadMatrix(this.I4x4L);
         }
         else if (matrixSize.SelectedIndex == 1)                 // 8x8
         {
             if (predefinedMatrix.SelectedIndex == 3)
             {
                 enable8x8Matrix();
             }
             matrixType.Items.Clear();
             matrixType.Items.Add("I");
             matrixType.Items.Add("P");
             matrixType.SelectedIndex = 0;
             loadMatrix(this.I8x8);
         }
     }
     this.currentConfig = this.getCurrentConfig();
 }
Beispiel #2
0
        /// <summary>
        /// gets all the data from the GUI to identify which type of matrix we're currently looking at
        /// </summary>
        /// <returns>the struct containing all the data</returns>
        private MatrixConfig getCurrentConfig()
        {
            MatrixConfig conf = new MatrixConfig();

            conf.size = matrixSize.SelectedIndex;
            conf.type = matrixType.SelectedIndex;
            return(conf);
        }
Beispiel #3
0
        private void matrixType_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (doEvents)
            {
                if (predefinedMatrix.SelectedIndex == 3)                 // save previous matrix before showing the new one
                {
                    this.saveMatrix(this.currentConfig);
                }
                if (matrixSize.SelectedIndex == 0)                 // 4x4
                {
                    switch (matrixType.SelectedIndex)
                    {
                    case 0:                             // I luma
                        loadMatrix(this.I4x4L);
                        break;

                    case 1:
                        loadMatrix(this.I4x4CU);
                        break;

                    case 2:
                        loadMatrix(this.I4x4CY);
                        break;

                    case 3:
                        loadMatrix(this.P4x4L);
                        break;

                    case 4:
                        loadMatrix(this.P4x4CU);
                        break;

                    case 5:
                        loadMatrix(this.P4x4CY);
                        break;
                    }
                }
                else                 // 8x8
                {
                    switch (matrixType.SelectedIndex)
                    {
                    case 0:
                        this.loadMatrix(this.I8x8);
                        break;

                    case 1:
                        this.loadMatrix(this.P8x8);
                        break;
                    }
                }
                this.currentConfig = this.getCurrentConfig();
            }
        }
Beispiel #4
0
        /// <summary>
        /// saves the matrix currently configured in the gui into the appropriate internal matrix
        /// used when changing between a matrix size / subtype
        /// </summary>
        /// <param name="config">the current matrix configuration</param>
        private void saveMatrix(MatrixConfig config)
        {
            if (config.size == 0)             // 4x4 matrix
            {
                switch (config.type)
                {
                case 0:                         // I4x4L
                    this.I4x4L = this.getCurrentMatrix();
                    break;

                case 1:                         // I4x4CU
                    this.I4x4CU = this.getCurrentMatrix();
                    break;

                case 2:                         // I4x4CY
                    this.I4x4CY = this.getCurrentMatrix();
                    break;

                case 3:
                    this.P4x4L = this.getCurrentMatrix();
                    break;

                case 4:
                    this.P4x4CU = this.getCurrentMatrix();
                    break;

                case 5:
                    this.P4x4CY = this.getCurrentMatrix();
                    break;

                case -1:                         // first time, load I4x4L
                    this.I4x4L = this.getCurrentMatrix();
                    break;
                }
            }
            else if (config.size == 1)             // 8x8 matrix
            {
                if (config.type == 0)              // I8x8
                {
                    this.I8x8 = this.getCurrentMatrix();
                }
                else if (config.type == 1)                 // P8x8
                {
                    this.P8x8 = this.getCurrentMatrix();
                }
                else
                {
                    this.I8x8 = this.getCurrentMatrix();
                }
            }
        }
Beispiel #5
0
        /// <summary>
        /// loads the matrix specified in the current configuration
        /// </summary>
        /// <param name="config">the configuration pointing out which matrix is to be loaded</param>
        private void loadMatrix(MatrixConfig config)
        {
            if (config.size == 0)             // 4x4 matrix
            {
                switch (config.type)
                {
                case 0:                         // I4x4L
                    this.loadMatrix(this.I4x4L);
                    break;

                case 1:                         // I4x4CU
                    this.loadMatrix(this.I4x4CU);
                    break;

                case 2:                         // I4x4CY
                    this.loadMatrix(this.I4x4CY);
                    break;

                case 3:
                    this.loadMatrix(this.P4x4L);
                    break;

                case 4:
                    this.loadMatrix(this.P4x4CU);
                    break;

                case 5:
                    this.loadMatrix(this.P4x4CY);
                    break;
                }
            }
            else if (config.size == 1)             // 8x8 matrix
            {
                if (config.type == 0)              // I8x8
                {
                    this.loadMatrix(this.I8x8);
                }
                else if (config.type == 1)                 // P8x8
                {
                    this.loadMatrix(this.P8x8);
                }
            }
        }
 /// <summary>
 /// gets all the data from the GUI to identify which type of matrix we're currently looking at
 /// </summary>
 /// <returns>the struct containing all the data</returns>
 private MatrixConfig getCurrentConfig()
 {
     MatrixConfig conf = new MatrixConfig();
     conf.size = matrixSize.SelectedIndex;
     conf.type = matrixType.SelectedIndex;
     return conf;
 }
 /// <summary>
 /// saves the matrix currently configured in the gui into the appropriate internal matrix
 /// used when changing between a matrix size / subtype
 /// </summary>
 /// <param name="config">the current matrix configuration</param>
 private void saveMatrix(MatrixConfig config)
 {
     if (config.size == 0) // 4x4 matrix
     {
         switch (config.type)
         {
             case 0: // I4x4L
                 this.I4x4L = this.getCurrentMatrix();
                 break;
             case 1: // I4x4CU
                 this.I4x4CU = this.getCurrentMatrix();
                 break;
             case 2: // I4x4CY
                 this.I4x4CY = this.getCurrentMatrix();
                 break;
             case 3:
                 this.P4x4L = this.getCurrentMatrix();
                 break;
             case 4:
                 this.P4x4CU = this.getCurrentMatrix();
                 break;
             case 5:
                 this.P4x4CY = this.getCurrentMatrix();
                 break;
             case -1: // first time, load I4x4L
                 this.I4x4L = this.getCurrentMatrix();
                 break;
         }
     }
     else if (config.size == 1) // 8x8 matrix
     {
         if (config.type == 0) // I8x8
             this.I8x8 = this.getCurrentMatrix();
         else if (config.type == 1) // P8x8
             this.P8x8 = this.getCurrentMatrix();
         else
             this.I8x8 = this.getCurrentMatrix();
     }
 }
 private void matrixType_SelectedIndexChanged(object sender, System.EventArgs e)
 {
     if (doEvents)
     {
         if (predefinedMatrix.SelectedIndex == 3) // save previous matrix before showing the new one
             this.saveMatrix(this.currentConfig);
         if (matrixSize.SelectedIndex == 0) // 4x4
         {
             switch (matrixType.SelectedIndex)
             {
                 case 0: // I luma
                     loadMatrix(this.I4x4L);
                     break;
                 case 1:
                     loadMatrix(this.I4x4CU);
                     break;
                 case 2:
                     loadMatrix(this.I4x4CY);
                     break;
                 case 3:
                     loadMatrix(this.P4x4L);
                     break;
                 case 4:
                     loadMatrix(this.P4x4CU);
                     break;
                 case 5:
                     loadMatrix(this.P4x4CY);
                     break;
             }
         }
         else // 8x8
         {
             switch (matrixType.SelectedIndex)
             {
                 case 0:
                     this.loadMatrix(this.I8x8);
                     break;
                 case 1:
                     this.loadMatrix(this.P8x8);
                     break;
             }
         }
         this.currentConfig = this.getCurrentConfig();
     }
 }
 private void matrixSize_SelectedIndexChanged(object sender, System.EventArgs e)
 {
     if (doEvents)
     {
         if (predefinedMatrix.SelectedIndex == 3) // save previous matrix before showing the new one
             this.saveMatrix(this.currentConfig);
         MatrixConfig conf = getCurrentConfig();
         if (matrixSize.SelectedIndex == 0) // 4x4
         {
             if (predefinedMatrix.SelectedIndex == 3) // custom 4x4
                 enable4x4Matrix();
             i4x4Matrix();
             loadMatrix(this.I4x4L);
         }
         else if (matrixSize.SelectedIndex == 1) // 8x8
         {
             if (predefinedMatrix.SelectedIndex == 3)
                 enable8x8Matrix();
             matrixType.Items.Clear();
             matrixType.Items.Add("I");
             matrixType.Items.Add("P");
             matrixType.SelectedIndex = 0;
             loadMatrix(this.I8x8);
         }
     }
     this.currentConfig = this.getCurrentConfig();
 }
 /// <summary>
 /// loads the matrix specified in the current configuration
 /// </summary>
 /// <param name="config">the configuration pointing out which matrix is to be loaded</param>
 private void loadMatrix(MatrixConfig config)
 {
     if (config.size == 0) // 4x4 matrix
     {
         switch (config.type)
         {
             case 0: // I4x4L
                 this.loadMatrix(this.I4x4L);
                 break;
             case 1: // I4x4CU
                 this.loadMatrix(this.I4x4CU);
                 break;
             case 2: // I4x4CY
                 this.loadMatrix(this.I4x4CY);
                 break;
             case 3:
                 this.loadMatrix(this.P4x4L);
                 break;
             case 4:
                 this.loadMatrix(this.P4x4CU);
                 break;
             case 5:
                 this.loadMatrix(this.P4x4CY);
                 break;
         }
     }
     else if (config.size == 1) // 8x8 matrix
     {
         if (config.type == 0) // I8x8
             this.loadMatrix(this.I8x8);
         else if (config.type == 1) // P8x8
             this.loadMatrix(this.P8x8);
     }
 }