BitMiracle.LibJpeg.Classic.Internal.my_2pass_cquantizer.pass2_no_dither C# (CSharp) Метод

pass2_no_dither() приватный Метод

Map some rows of pixels to the output colormapped representation. This version performs no dithering
private pass2_no_dither ( byte input_buf, int in_row, byte output_buf, int out_row, int num_rows ) : void
input_buf byte
in_row int
output_buf byte
out_row int
num_rows int
Результат void
        private void pass2_no_dither(byte[][] input_buf, int in_row, byte[][] output_buf, int out_row, int num_rows)
        {
            for (int row = 0; row < num_rows; row++)
            {
                int inRow = row + in_row;
                int inIndex = 0;
                int outIndex = 0;
                int outRow = out_row + row;
                for (int col = m_cinfo.m_output_width; col > 0; col--)
                {
                    /* get pixel value and index into the cache */
                    int c0 = (int)input_buf[inRow][inIndex] >> C0_SHIFT;
                    inIndex++;

                    int c1 = (int)input_buf[inRow][inIndex] >> C1_SHIFT;
                    inIndex++;

                    int c2 = (int)input_buf[inRow][inIndex] >> C2_SHIFT;
                    inIndex++;

                    int hRow = c0;
                    int hColumn = c1 * HIST_C2_ELEMS + c2;

                    /* If we have not seen this color before, find nearest colormap entry */
                    /* and update the cache */
                    if (m_histogram[hRow][hColumn] == 0)
                        fill_inverse_cmap(c0, c1, c2);

                    /* Now emit the colormap index for this cell */
                    output_buf[outRow][outIndex] = (byte)(m_histogram[hRow][hColumn] - 1);
                    outIndex++;
                }
            }
        }