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

jpeg_write_m_header() public method

Writes special marker's header.
After calling this method you need to call jpeg_compress_struct.jpeg_write_m_byte exactly the number of times given in the length parameter.
This method lets you empty the output buffer partway through a marker, which might be important when using a suspending data destination module. In any case, if you are using a suspending destination, you should flush its buffer after inserting any special markers.
public jpeg_write_m_header ( int marker, int datalen ) : void
marker int Special marker.
datalen int Length of data associated with the marker.
return void
        public void jpeg_write_m_header(int marker, int datalen)
        {
            if (m_next_scanline != 0 || (m_global_state != JpegState.CSTATE_SCANNING && m_global_state != JpegState.CSTATE_RAW_OK && m_global_state != JpegState.CSTATE_WRCOEFS))
                ERREXIT(J_MESSAGE_CODE.JERR_BAD_STATE, (int)m_global_state);

            m_marker.write_marker_header(marker, datalen);
        }