public void write_file_header()
{
emit_marker(JPEG_MARKER.SOI); /* first the SOI */
/* SOI is defined to reset restart interval to 0 */
m_last_restart_interval = 0;
if (m_cinfo.m_write_JFIF_header) /* next an optional JFIF APP0 */
emit_jfif_app0();
if (m_cinfo.m_write_Adobe_marker) /* next an optional Adobe APP14 */
emit_adobe_app14();
}
/// <summary> /// Master selection of compression modules for transcoding. /// </summary> private void transencode_master_selection(jvirt_array<JBLOCK>[] coef_arrays) { /* Although we don't actually use input_components for transcoding, * jcmaster.c's initial_setup will complain if input_components is 0. */ m_input_components = 1; /* Initialize master control (includes parameter checking/processing) */ jinit_c_master_control(true /* transcode only */); /* Entropy encoding: only Huffman coding supported. */ if (m_progressive_mode) m_entropy = new phuff_entropy_encoder(this); else m_entropy = new huff_entropy_encoder(this); /* We need a special coefficient buffer controller. */ m_coef = new my_trans_c_coef_controller(this, coef_arrays); m_marker = new jpeg_marker_writer(this); /* Write the datastream header (SOI, JFIF) immediately. * Frame and scan headers are postponed till later. * This lets application insert special markers after the SOI. */ m_marker.write_file_header(); }