/// <summary> /// Alternate compression function: just write an abbreviated table file. /// </summary> /// <remarks>Before calling this, all parameters and a data destination must be set up.<br/> /// /// To produce a pair of files containing abbreviated tables and abbreviated /// image data, one would proceed as follows:<br/> /// /// <c>Initialize JPEG object<br/> /// Set JPEG parameters<br/> /// Set destination to table file<br/> /// <see cref="jpeg_compress_struct.jpeg_write_tables">jpeg_write_tables();</see><br/> /// Set destination to image file<br/> /// <see cref="jpeg_compress_struct.jpeg_start_compress">jpeg_start_compress(false);</see><br/> /// Write data...<br/> /// <see cref="jpeg_compress_struct.jpeg_finish_compress">jpeg_finish_compress();</see><br/> /// </c><br/> /// /// jpeg_write_tables has the side effect of marking all tables written /// (same as <see cref="jpeg_compress_struct.jpeg_suppress_tables">jpeg_suppress_tables(true)</see>). /// Thus a subsequent <see cref="jpeg_compress_struct.jpeg_start_compress">jpeg_start_compress</see> /// will not re-emit the tables unless it is passed <c>write_all_tables=true</c>. /// </remarks> 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(); }