// Compression module initialization routines

        /// <summary>
        /// Initialization of a JPEG compression object
        /// </summary>
        private void initialize()
        {
            /* Zero out pointers to permanent structures. */
            m_progress = null;
            m_dest = null;
            m_comp_info = null;

            for (int i = 0; i < JpegConstants.NUM_QUANT_TBLS; i++)
                m_quant_tbl_ptrs[i] = null;

            for (int i = 0; i < JpegConstants.NUM_HUFF_TBLS; i++)
            {
                m_dc_huff_tbl_ptrs[i] = null;
                m_ac_huff_tbl_ptrs[i] = null;
            }

            m_script_space = null;

            /* OK, I'm ready */
            m_global_state = JpegState.CSTATE_START;
        }
 /// <summary>
 /// Sets output stream.
 /// </summary>
 /// <param name="outfile">The output stream.</param>
 /// <remarks>The caller must have already opened the stream, and is responsible
 /// for closing it after finishing compression.</remarks>
 /// <seealso href="07136fd7-d482-48de-b88c-1a4b9658c69e.htm" target="_self">Compression details</seealso>
 public void jpeg_stdio_dest(Stream outfile)
 {
     m_dest = new my_destination_mgr(this, outfile);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Initialization of a JPEG compression object
        /// </summary>
        private void initialize()
        {
            /* Zero out pointers to permanent structures. */
            m_progress = null;
            m_dest = null;
            m_comp_info = null;

            for (int i = 0; i < JpegConstants.NUM_QUANT_TBLS; i++)
            {
                m_quant_tbl_ptrs[i] = null;
                q_scale_factor[i] = 100;
            }

            for (int i = 0; i < JpegConstants.NUM_HUFF_TBLS; i++)
            {
                m_dc_huff_tbl_ptrs[i] = null;
                m_ac_huff_tbl_ptrs[i] = null;
            }

            /* Must do it here for emit_dqt in case jpeg_write_tables is used */
            block_size = JpegConstants.DCTSIZE;
            natural_order = JpegUtils.jpeg_natural_order;
            lim_Se = JpegConstants.DCTSIZE2 - 1;

            m_script_space = null;

            /* OK, I'm ready */
            m_global_state = JpegState.CSTATE_START;
        }