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

quantize3() private method

Map some rows of pixels to the output colormapped representation. Fast path for out_color_components==3, no dithering
private quantize3 ( 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
return void
        private void quantize3(byte[][] input_buf, int in_row, byte[][] output_buf, int out_row, int num_rows)
        {
            int width = m_cinfo.m_output_width;

            for (int row = 0; row < num_rows; row++)
            {
                int inIndex = 0;
                int inRow = in_row + row;

                int outIndex = 0;
                int outRow = out_row + row;

                for (int col = width; col > 0; col--)
                {
                    int pixcode = m_colorindex[0][m_colorindexOffset[0] + input_buf[inRow][inIndex]];
                    inIndex++;

                    pixcode += m_colorindex[1][m_colorindexOffset[1] + input_buf[inRow][inIndex]];
                    inIndex++;

                    pixcode += m_colorindex[2][m_colorindexOffset[2] + input_buf[inRow][inIndex]];
                    inIndex++;

                    output_buf[outRow][outIndex] = (byte)pixcode;
                    outIndex++;
                }
            }
        }