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

jpeg_write_marker() public method

Write a special marker.
This is only recommended for writing COM or APPn markers. Must be called after jpeg_compress_struct.jpeg_start_compress and before first call to jpeg_compress_struct.jpeg_write_scanlines or jpeg_compress_struct.jpeg_write_raw_data.
public jpeg_write_marker ( int marker, byte data ) : void
marker int Specify the marker type parameter as .COM for COM or /// .APP0 + n for APPn. (Actually, jpeg_write_marker will let you write any marker type, /// but we don't recommend writing any other kinds of marker)
data byte The data associated with the marker.
return void
        public void jpeg_write_marker(int marker, byte[] data)
        {
            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, data.Length);

            for (int i = 0; i < data.Length; i++)
                m_marker.write_marker_byte(data[i]);
        }