BitMiracle.LibJpeg.Classic.jpeg_compress_struct.jpeg_write_tables C# (CSharp) Method

jpeg_write_tables() public method

Alternate compression function: just write an abbreviated table file.
Before calling this, all parameters and a data destination must be set up.
To produce a pair of files containing abbreviated tables and abbreviated image data, one would proceed as follows:
Initialize JPEG object
Set JPEG parameters
Set destination to table file
jpeg_write_tables();
Set destination to image file
jpeg_start_compress(false);
Write data...
jpeg_finish_compress();

jpeg_write_tables has the side effect of marking all tables written (same as jpeg_suppress_tables(true)). Thus a subsequent jpeg_start_compress will not re-emit the tables unless it is passed write_all_tables=true.
public jpeg_write_tables ( ) : void
return void
        public void jpeg_write_tables()
        {
            if (m_global_state != JpegState.CSTATE_START)
                ERREXIT(J_MESSAGE_CODE.JERR_BAD_STATE, (int)m_global_state);

            /* (Re)initialize error mgr and destination modules */
            m_err.reset_error_mgr();
            m_dest.init_destination();

            /* Initialize the marker writer ... bit of a crock to do it here. */
            m_marker = new jpeg_marker_writer(this);

            /* Write them tables! */
            m_marker.write_tables_only();

            /* And clean up. */
            m_dest.term_destination();
        }