BitMiracle.LibJpeg.Classic.Internal.jpeg_d_post_controller.post_process_1pass C# (CSharp) Method

post_process_1pass() private method

Process some data in the one-pass (strip buffer) case. This is used for color precision reduction as well as one-pass quantization.
private post_process_1pass ( ComponentBuffer input_buf, int &in_row_group_ctr, int in_row_groups_avail, byte output_buf, int &out_row_ctr, int out_rows_avail ) : void
input_buf ComponentBuffer
in_row_group_ctr int
in_row_groups_avail int
output_buf byte
out_row_ctr int
out_rows_avail int
return void
        private void post_process_1pass(ComponentBuffer[] input_buf, ref int in_row_group_ctr, int in_row_groups_avail, byte[][] output_buf, ref int out_row_ctr, int out_rows_avail)
        {
            /* Fill the buffer, but not more than what we can dump out in one go. */
            /* Note we rely on the upsampler to detect bottom of image. */
            int max_rows = out_rows_avail - out_row_ctr;
            if (max_rows > m_strip_height)
                max_rows = m_strip_height;

            int num_rows = 0;
            m_cinfo.m_upsample.upsample(input_buf, ref in_row_group_ctr, in_row_groups_avail, m_buffer, ref num_rows, max_rows);

            /* Quantize and emit data. */
            m_cinfo.m_cquantize.color_quantize(m_buffer, 0, output_buf, out_row_ctr, num_rows);
            out_row_ctr += num_rows;
        }