BitMiracle.LibJpeg.Classic.Internal.jpeg_color_converter.grayscale_convert C# (CSharp) Method

grayscale_convert() private method

Convert some rows of samples to the JPEG colorspace. This version handles grayscale output with no conversion. The source can be either plain grayscale or YCC (since Y == gray).
private grayscale_convert ( byte input_buf, int input_row, byte output_buf, int output_row, int num_rows ) : void
input_buf byte
input_row int
output_buf byte
output_row int
num_rows int
return void
        private void grayscale_convert(byte[][] input_buf, int input_row, byte[][][] output_buf, int output_row, int num_rows)
        {
            int num_cols = m_cinfo.m_image_width;
            int instride = m_cinfo.m_input_components;

            for (int row = 0; row < num_rows; row++)
            {
                int columnOffset = 0;
                for (int col = 0; col < num_cols; col++)
                {
                    /* don't need GETJSAMPLE() here */
                    output_buf[0][output_row][col] = input_buf[input_row + row][columnOffset];
                    columnOffset += instride;
                }

                output_row++;
            }
        }