BitMiracle.LibJpeg.Classic.Internal.jpeg_comp_master.prepare_for_pass C# (CSharp) Method

prepare_for_pass() public method

Per-pass setup. This is called at the beginning of each pass. We determine which modules will be active during this pass and give them appropriate start_pass calls. We also set is_last_pass to indicate whether any more passes will be required.
public prepare_for_pass ( ) : void
return void
        public void prepare_for_pass()
        {
            switch (m_pass_type)
            {
                case c_pass_type.main_pass:
                    prepare_for_main_pass();
                    break;
                case c_pass_type.huff_opt_pass:
                    if (!prepare_for_huff_opt_pass())
                        break;
                    prepare_for_output_pass();
                    break;
                case c_pass_type.output_pass:
                    prepare_for_output_pass();
                    break;
                default:
                    m_cinfo.ERREXIT(J_MESSAGE_CODE.JERR_NOT_COMPILED);
                    break;
            }

            m_is_last_pass = (m_pass_number == m_total_passes - 1);

            /* Set up progress monitor's pass info if present */
            if (m_cinfo.m_progress != null)
            {
                m_cinfo.m_progress.Completed_passes = m_pass_number;
                m_cinfo.m_progress.Total_passes = m_total_passes;
            }
        }