/// <summary> /// Sets processor for special marker. /// </summary> /// <param name="marker_code">The marker code.</param> /// <param name="routine">The processor.</param> /// <remarks>Allows you to supply your own routine to process /// COM and/or APPn markers on-the-fly as they are read. /// </remarks> /// <seealso href="81c88818-a5d7-4550-9ce5-024a768f7b1e.htm" target="_self">Special markers</seealso> public void jpeg_set_marker_processor(int marker_code, jpeg_marker_parser_method routine) { m_marker.jpeg_set_marker_processor(marker_code, routine); }
// Install a special processing method for COM or APPn markers. public static void jpeg_set_marker_processor(jpeg_decompress cinfo, int marker_code, jpeg_marker_parser_method routine) { my_marker_reader marker=(my_marker_reader)cinfo.marker; if(marker_code==(int)JPEG_MARKER.M_COM) marker.process_COM=routine; else if(marker_code>=(int)JPEG_MARKER.M_APP0&&marker_code<=(int)JPEG_MARKER.M_APP15) marker.process_APPn[marker_code-(int)JPEG_MARKER.M_APP0]=routine; else ERREXIT1(cinfo, J_MESSAGE_CODE.JERR_UNKNOWN_MARKER, marker_code); }