BitMiracle.LibJpeg.Classic.Internal.jpeg_color_deconverter.cmyk_rgb_convert C# (CSharp) Method

cmyk_rgb_convert() private method

Color conversion for CMYK -> RGB
private cmyk_rgb_convert ( ComponentBuffer input_buf, int input_row, byte output_buf, int output_row, int num_rows ) : void
input_buf ComponentBuffer
input_row int
output_buf byte
output_row int
num_rows int
return void
        private void cmyk_rgb_convert(ComponentBuffer[] input_buf, int input_row, byte[][] output_buf, int output_row, int num_rows)
        {
            int component0RowOffset = m_perComponentOffsets[0];
            int component1RowOffset = m_perComponentOffsets[1];
            int component2RowOffset = m_perComponentOffsets[2];
            int component3RowOffset = m_perComponentOffsets[3];

            for (int row = 0; row < num_rows; row++)
            {
                int columnOffset = 0;
                for (int col = 0; col < m_cinfo.m_output_width; col++)
                {
                    int c = input_buf[0][input_row + component0RowOffset][col];
                    int m = input_buf[1][input_row + component1RowOffset][col];
                    int y = input_buf[2][input_row + component2RowOffset][col];
                    int k = input_buf[3][input_row + component3RowOffset][col];

                    output_buf[output_row + row][columnOffset + JpegConstants.RGB_RED] = (byte)((c * k) / 255);
                    output_buf[output_row + row][columnOffset + JpegConstants.RGB_GREEN] = (byte)((m * k) / 255);
                    output_buf[output_row + row][columnOffset + JpegConstants.RGB_BLUE] = (byte)((y * k) / 255);
                    columnOffset += JpegConstants.RGB_PIXELSIZE;
                }

                input_row++;
            }
        }