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

post_process_prepass() private method

Process some data in the first pass of 2-pass quantization.
private post_process_prepass ( ComponentBuffer input_buf, int &in_row_group_ctr, int in_row_groups_avail, int &out_row_ctr ) : void
input_buf ComponentBuffer
in_row_group_ctr int
in_row_groups_avail int
out_row_ctr int
return void
        private void post_process_prepass(ComponentBuffer[] input_buf, ref int in_row_group_ctr, int in_row_groups_avail, ref int out_row_ctr)
        {
            int old_next_row, num_rows;

            /* Reposition virtual buffer if at start of strip. */
            if (m_next_row == 0)
                m_buffer = m_whole_image.Access(m_starting_row, m_strip_height);

            /* Upsample some data (up to a strip height's worth). */
            old_next_row = m_next_row;
            m_cinfo.m_upsample.upsample(input_buf, ref in_row_group_ctr, in_row_groups_avail, m_buffer, ref m_next_row, m_strip_height);

            /* Allow quantizer to scan new data.  No data is emitted, */
            /* but we advance out_row_ctr so outer loop can tell when we're done. */
            if (m_next_row > old_next_row)
            {
                num_rows = m_next_row - old_next_row;
                m_cinfo.m_cquantize.color_quantize(m_buffer, old_next_row, null, 0, num_rows);
                out_row_ctr += num_rows;
            }

            /* Advance if we filled the strip. */
            if (m_next_row >= m_strip_height)
            {
                m_starting_row += m_strip_height;
                m_next_row = 0;
            }
        }