BitMiracle.LibJpeg.Classic.Internal.my_1pass_cquantizer.create_odither_tables C# (CSharp) Method

create_odither_tables() private method

Create the ordered-dither tables. Components having the same number of representative colors may share a dither table.
private create_odither_tables ( ) : void
return void
        private void create_odither_tables()
        {
            for (int i = 0; i < m_cinfo.m_out_color_components; i++)
            {
                int nci = m_Ncolors[i]; /* # of distinct values for this color */

                /* search for matching prior component */
                int foundPos = -1;
                for (int j = 0; j < i; j++)
                {
                    if (nci == m_Ncolors[j])
                    {
                        foundPos = j;
                        break;
                    }
                }

                if (foundPos == -1)
                {
                    /* need a new table? */
                    m_odither[i] = make_odither_array(nci);
                }
                else
                    m_odither[i] = m_odither[foundPos];
            }
        }