@@ -67,8 +67,8 @@ extern "C" {
6767 */
6868
6969typedef _Array_ptr < JSAMPLE > JSAMPROW ; /* ptr to one image row of pixel samples. */
70- typedef JSAMPROW * JSAMPARRAY ; /* ptr to some rows (a 2-D sample array) */
71- typedef JSAMPARRAY * JSAMPIMAGE ; /* a 3-D sample array: top index is color */
70+ typedef _Array_ptr < JSAMPROW > JSAMPARRAY ; /* ptr to some rows (a 2-D sample array) */
71+ typedef _Ptr < JSAMPARRAY > JSAMPIMAGE ; /* a 3-D sample array: top index is color */
7272
7373typedef JCOEF JBLOCK _Checked [64 ]; /* one block of coefficients */
7474typedef _Ptr < JBLOCK > JBLOCKROW ; /* pointer to one row of coefficient blocks */
@@ -287,9 +287,9 @@ struct jpeg_common_struct {
287287 */
288288};
289289
290- typedef struct jpeg_common_struct * j_common_ptr ;
291- typedef struct jpeg_compress_struct * j_compress_ptr ;
292- typedef struct jpeg_decompress_struct * j_decompress_ptr ;
290+ typedef _Ptr < struct jpeg_common_struct > j_common_ptr ;
291+ typedef _Ptr < struct jpeg_compress_struct > j_compress_ptr ;
292+ typedef _Ptr < struct jpeg_decompress_struct > j_decompress_ptr ;
293293
294294
295295/* Master record for a compression instance */
@@ -719,11 +719,11 @@ struct jpeg_decompress_struct {
719719
720720struct jpeg_error_mgr {
721721 /* Error exit handler: does not return to caller */
722- _Ptr < void (j_common_ptr cinfo : itype ( _Ptr < struct jpeg_common_struct > ) )> error_exit ;
722+ _Ptr < void (_Ptr < struct jpeg_common_struct > cinfo )> error_exit ;
723723 /* Conditionally emit a trace or warning message */
724724 _Ptr < void (_Ptr < struct jpeg_common_struct > cinfo , int msg_level )> emit_message ;
725725 /* Routine that actually outputs a trace or error message */
726- _Ptr < void (j_common_ptr cinfo )> output_message ;
726+ _Ptr < void (_Ptr < struct jpeg_common_struct > cinfo )> output_message ;
727727 /* Format a message string for the most recent JPEG error or message */
728728 _Ptr < void (_Ptr < struct jpeg_common_struct > cinfo , _Ptr < char > buffer )> format_message ;
729729#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */
@@ -859,7 +859,7 @@ struct jpeg_memory_mgr {
859859/* Routine signature for application-supplied marker processing methods.
860860 * Need not pass marker code since it is stored in cinfo->unread_marker.
861861 */
862- typedef boolean (* jpeg_marker_parser_method ) ( j_decompress_ptr cinfo );
862+ typedef _Ptr < boolean (j_decompress_ptr cinfo )> jpeg_marker_parser_method ;
863863
864864
865865/* Originally, this macro was used as a way of defining function prototypes
@@ -873,7 +873,7 @@ typedef boolean (*jpeg_marker_parser_method) (j_decompress_ptr cinfo);
873873
874874
875875/* Default error-management setup */
876- EXTERN ( struct jpeg_error_mgr * ) jpeg_std_error (struct jpeg_error_mgr * err );
876+ extern struct jpeg_error_mgr * jpeg_std_error (struct jpeg_error_mgr * err : itype ( _Ptr < struct jpeg_error_mgr > )) : itype ( _Ptr < struct jpeg_error_mgr > );
877877
878878/* Initialization of JPEG compression objects.
879879 * jpeg_create_compress() and jpeg_create_decompress() are the exported
@@ -888,86 +888,68 @@ EXTERN(struct jpeg_error_mgr *) jpeg_std_error(struct jpeg_error_mgr *err);
888888#define jpeg_create_decompress (cinfo ) \
889889 jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \
890890 (size_t)sizeof(struct jpeg_decompress_struct))
891- EXTERN (void ) jpeg_CreateCompress (j_compress_ptr cinfo , int version ,
892- size_t structsize );
893- EXTERN (void ) jpeg_CreateDecompress (j_decompress_ptr cinfo , int version ,
894- size_t structsize );
891+ EXTERN (void ) jpeg_CreateCompress (struct jpeg_compress_struct * cinfo : itype (j_compress_ptr ), int version , size_t structsize );
892+ EXTERN (void ) jpeg_CreateDecompress (struct jpeg_decompress_struct * cinfo : itype (j_decompress_ptr ), int version , size_t structsize );
895893/* Destruction of JPEG compression objects */
896- EXTERN (void ) jpeg_destroy_compress (j_compress_ptr cinfo );
897- EXTERN (void ) jpeg_destroy_decompress (j_decompress_ptr cinfo );
894+ EXTERN (void ) jpeg_destroy_compress (struct jpeg_compress_struct * cinfo : itype ( j_compress_ptr ) );
895+ EXTERN (void ) jpeg_destroy_decompress (struct jpeg_decompress_struct * cinfo : itype ( j_decompress_ptr ) );
898896
899897/* Standard data source and destination managers: stdio streams. */
900898/* Caller is responsible for opening the file before and closing after. */
901- EXTERN (void ) jpeg_stdio_dest (j_compress_ptr cinfo , FILE * outfile );
902- EXTERN (void ) jpeg_stdio_src (j_decompress_ptr cinfo , FILE * infile );
899+ EXTERN (void ) jpeg_stdio_dest (struct jpeg_compress_struct * cinfo : itype ( j_compress_ptr ) , FILE * outfile : itype ( _Ptr < FILE > ) );
900+ EXTERN (void ) jpeg_stdio_src (struct jpeg_decompress_struct * cinfo : itype ( j_decompress_ptr ) , FILE * infile : itype ( _Ptr < FILE > ) );
903901
904902#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED )
905903/* Data source and destination managers: memory buffers. */
906- EXTERN (void ) jpeg_mem_dest (j_compress_ptr cinfo , unsigned char * * outbuffer ,
907- unsigned long * outsize );
908- EXTERN (void ) jpeg_mem_src (j_decompress_ptr cinfo ,
909- const unsigned char * inbuffer , unsigned long insize );
904+ EXTERN (void ) jpeg_mem_dest (struct jpeg_compress_struct * cinfo : itype (j_compress_ptr ), unsigned char * * outbuffer : itype (_Ptr < _Ptr < unsigned char >>), unsigned long * outsize : itype (_Ptr < unsigned long> ));
905+ EXTERN (void ) jpeg_mem_src (struct jpeg_decompress_struct * cinfo : itype (j_decompress_ptr ), const unsigned char * inbuffer : itype (_Ptr < const unsigned char > ), unsigned long insize );
910906#endif
911907
912908/* Default parameter setup for compression */
913- EXTERN (void ) jpeg_set_defaults (j_compress_ptr cinfo );
909+ EXTERN (void ) jpeg_set_defaults (struct jpeg_compress_struct * cinfo : itype ( j_compress_ptr ) );
914910/* Compression parameter setup aids */
915- EXTERN (void ) jpeg_set_colorspace (j_compress_ptr cinfo ,
916- J_COLOR_SPACE colorspace );
917- EXTERN (void ) jpeg_default_colorspace (j_compress_ptr cinfo );
918- EXTERN (void ) jpeg_set_quality (j_compress_ptr cinfo , int quality ,
919- boolean force_baseline );
920- EXTERN (void ) jpeg_set_linear_quality (j_compress_ptr cinfo , int scale_factor ,
921- boolean force_baseline );
911+ EXTERN (void ) jpeg_set_colorspace (struct jpeg_compress_struct * cinfo : itype (j_compress_ptr ), J_COLOR_SPACE colorspace );
912+ EXTERN (void ) jpeg_default_colorspace (struct jpeg_compress_struct * cinfo : itype (j_compress_ptr ));
913+ EXTERN (void ) jpeg_set_quality (struct jpeg_compress_struct * cinfo : itype (j_compress_ptr ), int quality , boolean force_baseline );
914+ EXTERN (void ) jpeg_set_linear_quality (struct jpeg_compress_struct * cinfo : itype (j_compress_ptr ), int scale_factor , boolean force_baseline );
922915#if JPEG_LIB_VERSION >= 70
923- EXTERN (void ) jpeg_default_qtables (j_compress_ptr cinfo ,
924- boolean force_baseline );
916+ EXTERN (void ) jpeg_default_qtables (struct jpeg_compress_struct * cinfo : itype (j_compress_ptr ), boolean force_baseline );
925917#endif
926- EXTERN (void ) jpeg_add_quant_table (j_compress_ptr cinfo , int which_tbl ,
927- const unsigned int * basic_table ,
928- int scale_factor , boolean force_baseline );
918+ EXTERN (void ) jpeg_add_quant_table (struct jpeg_compress_struct * cinfo : itype (j_compress_ptr ), int which_tbl , const unsigned int * basic_table : itype (_Ptr < const unsigned int > ), int scale_factor , boolean force_baseline );
929919EXTERN (int ) jpeg_quality_scaling (int quality );
930- EXTERN (void ) jpeg_simple_progression (j_compress_ptr cinfo );
931- EXTERN (void ) jpeg_suppress_tables (j_compress_ptr cinfo , boolean suppress );
932- EXTERN ( JQUANT_TBL * ) jpeg_alloc_quant_table (j_common_ptr cinfo );
933- EXTERN ( JHUFF_TBL * ) jpeg_alloc_huff_table (j_common_ptr cinfo );
920+ EXTERN (void ) jpeg_simple_progression (struct jpeg_compress_struct * cinfo : itype ( j_compress_ptr ) );
921+ EXTERN (void ) jpeg_suppress_tables (struct jpeg_compress_struct * cinfo : itype ( j_compress_ptr ) , boolean suppress );
922+ extern JQUANT_TBL * jpeg_alloc_quant_table (struct jpeg_common_struct * cinfo : itype ( j_common_ptr )) : itype ( _Ptr < JQUANT_TBL > );
923+ extern JHUFF_TBL * jpeg_alloc_huff_table (struct jpeg_common_struct * cinfo : itype ( j_common_ptr )) : itype ( _Ptr < JHUFF_TBL > );
934924
935925/* Main entry points for compression */
936- EXTERN (void ) jpeg_start_compress (j_compress_ptr cinfo ,
937- boolean write_all_tables );
938- EXTERN (JDIMENSION ) jpeg_write_scanlines (j_compress_ptr cinfo ,
939- JSAMPARRAY scanlines ,
940- JDIMENSION num_lines );
941- EXTERN (void ) jpeg_finish_compress (j_compress_ptr cinfo );
926+ EXTERN (void ) jpeg_start_compress (struct jpeg_compress_struct * cinfo : itype (j_compress_ptr ), boolean write_all_tables );
927+ EXTERN (JDIMENSION ) jpeg_write_scanlines (struct jpeg_compress_struct * cinfo : itype (j_compress_ptr ), JSAMPLE * scanlines : itype (JSAMPARRAY ), JDIMENSION num_lines );
928+ EXTERN (void ) jpeg_finish_compress (struct jpeg_compress_struct * cinfo : itype (j_compress_ptr ));
942929
943930#if JPEG_LIB_VERSION >= 70
944931/* Precalculate JPEG dimensions for current compression parameters. */
945- EXTERN (void ) jpeg_calc_jpeg_dimensions (j_compress_ptr cinfo );
932+ EXTERN (void ) jpeg_calc_jpeg_dimensions (struct jpeg_compress_struct * cinfo : itype ( j_compress_ptr ) );
946933#endif
947934
948935/* Replaces jpeg_write_scanlines when writing raw downsampled data. */
949- EXTERN (JDIMENSION ) jpeg_write_raw_data (j_compress_ptr cinfo , JSAMPIMAGE data ,
950- JDIMENSION num_lines );
936+ EXTERN (JDIMENSION ) jpeg_write_raw_data (struct jpeg_compress_struct * cinfo : itype (j_compress_ptr ), JSAMPLE * data : itype (JSAMPIMAGE ), JDIMENSION num_lines );
951937
952938/* Write a special marker. See libjpeg.txt concerning safe usage. */
953- EXTERN (void ) jpeg_write_marker (j_compress_ptr cinfo , int marker ,
954- const JOCTET * dataptr , unsigned int datalen );
939+ EXTERN (void ) jpeg_write_marker (struct jpeg_compress_struct * cinfo : itype (j_compress_ptr ), int marker , const JOCTET * dataptr : itype (_Ptr < const JOCTET > ), unsigned int datalen );
955940/* Same, but piecemeal. */
956- EXTERN (void ) jpeg_write_m_header (j_compress_ptr cinfo , int marker ,
957- unsigned int datalen );
958- EXTERN (void ) jpeg_write_m_byte (j_compress_ptr cinfo , int val );
941+ EXTERN (void ) jpeg_write_m_header (struct jpeg_compress_struct * cinfo : itype (j_compress_ptr ), int marker , unsigned int datalen );
942+ EXTERN (void ) jpeg_write_m_byte (struct jpeg_compress_struct * cinfo : itype (j_compress_ptr ), int val );
959943
960944/* Alternate compression function: just write an abbreviated table file */
961- EXTERN (void ) jpeg_write_tables (j_compress_ptr cinfo );
945+ EXTERN (void ) jpeg_write_tables (struct jpeg_compress_struct * cinfo : itype ( j_compress_ptr ) );
962946
963947/* Write ICC profile. See libjpeg.txt for usage information. */
964- EXTERN (void ) jpeg_write_icc_profile (j_compress_ptr cinfo ,
965- const JOCTET * icc_data_ptr ,
966- unsigned int icc_data_len );
948+ EXTERN (void ) jpeg_write_icc_profile (struct jpeg_compress_struct * cinfo : itype (j_compress_ptr ), const JOCTET * icc_data_ptr : itype (_Ptr < const JOCTET > ), unsigned int icc_data_len );
967949
968950
969951/* Decompression startup: read start of JPEG datastream to see what's there */
970- EXTERN (int ) jpeg_read_header (j_decompress_ptr cinfo , boolean require_image );
952+ EXTERN (int ) jpeg_read_header (struct jpeg_decompress_struct * cinfo : itype ( j_decompress_ptr ) , boolean require_image );
971953/* Return value is one of: */
972954#define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */
973955#define JPEG_HEADER_OK 1 /* Found valid image datastream */
@@ -979,27 +961,22 @@ EXTERN(int) jpeg_read_header(j_decompress_ptr cinfo, boolean require_image);
979961 */
980962
981963/* Main entry points for decompression */
982- EXTERN (boolean ) jpeg_start_decompress (j_decompress_ptr cinfo );
983- EXTERN (JDIMENSION ) jpeg_read_scanlines (j_decompress_ptr cinfo ,
984- JSAMPARRAY scanlines ,
985- JDIMENSION max_lines );
986- EXTERN (JDIMENSION ) jpeg_skip_scanlines (j_decompress_ptr cinfo ,
987- JDIMENSION num_lines );
988- EXTERN (void ) jpeg_crop_scanline (j_decompress_ptr cinfo , JDIMENSION * xoffset ,
989- JDIMENSION * width );
990- EXTERN (boolean ) jpeg_finish_decompress (j_decompress_ptr cinfo );
964+ EXTERN (boolean ) jpeg_start_decompress (struct jpeg_decompress_struct * cinfo : itype (j_decompress_ptr ));
965+ EXTERN (JDIMENSION ) jpeg_read_scanlines (struct jpeg_decompress_struct * cinfo : itype (j_decompress_ptr ), JSAMPLE * scanlines : itype (JSAMPARRAY ), JDIMENSION max_lines );
966+ EXTERN (JDIMENSION ) jpeg_skip_scanlines (struct jpeg_decompress_struct * cinfo : itype (j_decompress_ptr ), JDIMENSION num_lines );
967+ EXTERN (void ) jpeg_crop_scanline (struct jpeg_decompress_struct * cinfo : itype (j_decompress_ptr ), JDIMENSION * xoffset : itype (_Ptr < JDIMENSION > ), JDIMENSION * width : itype (_Ptr < JDIMENSION > ));
968+ EXTERN (boolean ) jpeg_finish_decompress (struct jpeg_decompress_struct * cinfo : itype (j_decompress_ptr ));
991969
992970/* Replaces jpeg_read_scanlines when reading raw downsampled data. */
993- EXTERN (JDIMENSION ) jpeg_read_raw_data (j_decompress_ptr cinfo , JSAMPIMAGE data ,
994- JDIMENSION max_lines );
971+ EXTERN (JDIMENSION ) jpeg_read_raw_data (struct jpeg_decompress_struct * cinfo : itype (j_decompress_ptr ), JSAMPLE * data : itype (JSAMPIMAGE ), JDIMENSION max_lines );
995972
996973/* Additional entry points for buffered-image mode. */
997- EXTERN (boolean ) jpeg_has_multiple_scans (j_decompress_ptr cinfo );
998- EXTERN (boolean ) jpeg_start_output (j_decompress_ptr cinfo , int scan_number );
999- EXTERN (boolean ) jpeg_finish_output (j_decompress_ptr cinfo );
1000- EXTERN (boolean ) jpeg_input_complete (j_decompress_ptr cinfo );
1001- EXTERN (void ) jpeg_new_colormap (j_decompress_ptr cinfo );
1002- EXTERN (int ) jpeg_consume_input (j_decompress_ptr cinfo );
974+ EXTERN (boolean ) jpeg_has_multiple_scans (struct jpeg_decompress_struct * cinfo : itype ( j_decompress_ptr ) );
975+ EXTERN (boolean ) jpeg_start_output (struct jpeg_decompress_struct * cinfo : itype ( j_decompress_ptr ) , int scan_number );
976+ EXTERN (boolean ) jpeg_finish_output (struct jpeg_decompress_struct * cinfo : itype ( j_decompress_ptr ) );
977+ EXTERN (boolean ) jpeg_input_complete (struct jpeg_decompress_struct * cinfo : itype ( j_decompress_ptr ) );
978+ EXTERN (void ) jpeg_new_colormap (struct jpeg_decompress_struct * cinfo : itype ( j_decompress_ptr ) );
979+ EXTERN (int ) jpeg_consume_input (struct jpeg_decompress_struct * cinfo : itype ( j_decompress_ptr ) );
1003980/* Return value is one of: */
1004981/* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */
1005982#define JPEG_REACHED_SOS 1 /* Reached start of new scan */
@@ -1009,48 +986,41 @@ EXTERN(int) jpeg_consume_input(j_decompress_ptr cinfo);
1009986
1010987/* Precalculate output dimensions for current decompression parameters. */
1011988#if JPEG_LIB_VERSION >= 80
1012- EXTERN (void ) jpeg_core_output_dimensions (j_decompress_ptr cinfo );
989+ EXTERN (void ) jpeg_core_output_dimensions (struct jpeg_decompress_struct * cinfo : itype ( j_decompress_ptr ) );
1013990#endif
1014- EXTERN (void ) jpeg_calc_output_dimensions (j_decompress_ptr cinfo );
991+ EXTERN (void ) jpeg_calc_output_dimensions (struct jpeg_decompress_struct * cinfo : itype ( j_decompress_ptr ) );
1015992
1016993/* Control saving of COM and APPn markers into marker_list. */
1017- EXTERN (void ) jpeg_save_markers (j_decompress_ptr cinfo , int marker_code ,
1018- unsigned int length_limit );
994+ EXTERN (void ) jpeg_save_markers (struct jpeg_decompress_struct * cinfo : itype (j_decompress_ptr ), int marker_code , unsigned int length_limit );
1019995
1020996/* Install a special processing method for COM or APPn markers. */
1021- EXTERN (void ) jpeg_set_marker_processor (j_decompress_ptr cinfo ,
1022- int marker_code ,
1023- jpeg_marker_parser_method routine );
997+ EXTERN (void ) jpeg_set_marker_processor (struct jpeg_decompress_struct * cinfo : itype (j_decompress_ptr ), int marker_code , boolean ((* routine )(struct jpeg_decompress_struct * )) : itype (jpeg_marker_parser_method ));
1024998
1025999/* Read or write raw DCT coefficients --- useful for lossless transcoding. */
1026- EXTERN (jvirt_barray_ptr * ) jpeg_read_coefficients (j_decompress_ptr cinfo );
1027- EXTERN (void ) jpeg_write_coefficients (j_compress_ptr cinfo ,
1028- jvirt_barray_ptr * coef_arrays );
1029- EXTERN (void ) jpeg_copy_critical_parameters (j_decompress_ptr srcinfo ,
1030- j_compress_ptr dstinfo );
1000+ extern jvirt_barray_ptr * jpeg_read_coefficients (struct jpeg_decompress_struct * cinfo : itype (j_decompress_ptr )) : itype (_Ptr < jvirt_barray_ptr > );
1001+ EXTERN (void ) jpeg_write_coefficients (struct jpeg_compress_struct * cinfo : itype (j_compress_ptr ), jvirt_barray_ptr * coef_arrays : itype (_Ptr < jvirt_barray_ptr > ));
1002+ EXTERN (void ) jpeg_copy_critical_parameters (struct jpeg_decompress_struct * srcinfo : itype (j_decompress_ptr ), struct jpeg_compress_struct * dstinfo : itype (j_compress_ptr ));
10311003
10321004/* If you choose to abort compression or decompression before completing
10331005 * jpeg_finish_(de)compress, then you need to clean up to release memory,
10341006 * temporary files, etc. You can just call jpeg_destroy_(de)compress
10351007 * if you're done with the JPEG object, but if you want to clean it up and
10361008 * reuse it, call this:
10371009 */
1038- EXTERN (void ) jpeg_abort_compress (j_compress_ptr cinfo );
1039- EXTERN (void ) jpeg_abort_decompress (j_decompress_ptr cinfo );
1010+ EXTERN (void ) jpeg_abort_compress (struct jpeg_compress_struct * cinfo : itype ( j_compress_ptr ) );
1011+ EXTERN (void ) jpeg_abort_decompress (struct jpeg_decompress_struct * cinfo : itype ( j_decompress_ptr ) );
10401012
10411013/* Generic versions of jpeg_abort and jpeg_destroy that work on either
10421014 * flavor of JPEG object. These may be more convenient in some places.
10431015 */
1044- EXTERN (void ) jpeg_abort (j_common_ptr cinfo );
1045- EXTERN (void ) jpeg_destroy (j_common_ptr cinfo );
1016+ EXTERN (void ) jpeg_abort (struct jpeg_common_struct * cinfo : itype ( j_common_ptr ) );
1017+ EXTERN (void ) jpeg_destroy (struct jpeg_common_struct * cinfo : itype ( j_common_ptr ) );
10461018
10471019/* Default restart-marker-resync procedure for use by data source modules */
1048- EXTERN (boolean ) jpeg_resync_to_restart (j_decompress_ptr cinfo , int desired );
1020+ EXTERN (boolean ) jpeg_resync_to_restart (struct jpeg_decompress_struct * cinfo : itype ( j_decompress_ptr ) , int desired );
10491021
10501022/* Read ICC profile. See libjpeg.txt for usage information. */
1051- EXTERN (boolean ) jpeg_read_icc_profile (j_decompress_ptr cinfo ,
1052- JOCTET * * icc_data_ptr ,
1053- unsigned int * icc_data_len );
1023+ EXTERN (boolean ) jpeg_read_icc_profile (struct jpeg_decompress_struct * cinfo : itype (j_decompress_ptr ), JOCTET * * icc_data_ptr : itype (_Ptr < _Ptr < JOCTET >>), unsigned int * icc_data_len : itype (_Ptr < unsigned int > ));
10541024
10551025
10561026/* These marker codes are exported since applications and data source modules
0 commit comments