1
13
14
15
16
17
23
24
25
26
27
28
29
30
31
32
33
34
35
36
39
40
41
42
43
44
45
49
50
51
52
53
54
55
56
57
64
65
66
67
68
69
70
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
105
106
107
108
109
110
111
112
113
114
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
148
149
150
155
156
157
163
164
165
169
170
171
172
173
174
175
176
177
178
179
180
184
185
186
187
188
189
190
191
192
193
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
231
232
233
234
235
236
237
238
239
240
241
246
247
248
249
250
257
258
262
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
287
288
289
290
291
292
293
294
295
302
303
304
305
306
307
313
314
315
316
317
318
319
320
321
322
323
324
327
328
329
330
331
332
333
334
335
336
337
338
342
343
344
345
346
347
348
349
350
351
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
377
378
379
380
383
384
387
388
389
390
391
392
393
394
395
400
401
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
489
490
491
492
493
494
497
498
502
503
509
510
511
512
515
516
520
521
522
525
526
527
528
532
533
534
535
542
543
544
548
549
552
553
554
555
556
557
558
559
560
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
582
583
584
585
586
587
588
589
590
591
592
593
594
598
599
600
603
604
607
608
609
610
611
612
613
614
621
622
623
624
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
645
646
647
648
649
653
654
655
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
698
699
700
704
705
706
707
708
709
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
838
839
840
841
842
843
844
845
848
849
850
851
855
856
857
858
859
860
861
862
863
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
938
941
944
945
946
947
948
949
950
951
952
953
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1087
1088
1089
1090
1093
1094
1095
1096
1097
1098
1099
1100
1101
1104
1105
1106
1107
1108
1109
1110
1111
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1150
1151
1152
1155
1156
1157
1158
1159
1160
1161
1162
/* ... */
#ifndef JPEGLIB_H
#define JPEGLIB_H
/* ... */
#ifndef JCONFIG_INCLUDED
#include "jconfig.h"
#endif
#include "jmorecfg.h"
#ifdef __cplusplus
#ifndef DONT_USE_EXTERN_C
extern "C" {
#endif
#endif
/* ... */
#define JPEG_LIB_VERSION 80
#define JPEG_LIB_VERSION_MAJOR 8
#define JPEG_LIB_VERSION_MINOR 4
/* ... */
#define DCTSIZE 8
#define DCTSIZE2 64
#define NUM_QUANT_TBLS 4
#define NUM_HUFF_TBLS 4
#define NUM_ARITH_TBLS 16
#define MAX_COMPS_IN_SCAN 4
#define MAX_SAMP_FACTOR 4
/* ... */
#define C_MAX_BLOCKS_IN_MCU 10
11 defines#ifndef D_MAX_BLOCKS_IN_MCU
#define D_MAX_BLOCKS_IN_MCU 10
#endif
/* ... */
typedef JSAMPLE FAR *JSAMPROW;
typedef JSAMPROW *JSAMPARRAY;
typedef JSAMPARRAY *JSAMPIMAGE;
typedef JCOEF JBLOCK[DCTSIZE2];
typedef JBLOCK FAR *JBLOCKROW;
typedef JBLOCKROW *JBLOCKARRAY;
typedef JBLOCKARRAY *JBLOCKIMAGE;
typedef JCOEF FAR *JCOEFPTR;
typedef struct {
/* ... */
UINT16 quantval[DCTSIZE2];
/* ... */
boolean sent_table;
...} JQUANT_TBL;
typedef struct {
UINT8 bits[17];
UINT8 huffval[256];
/* ... */
boolean sent_table;
...} JHUFF_TBL;
typedef struct {
int component_id;
int component_index;
int h_samp_factor;
int v_samp_factor;
int quant_tbl_no;
int dc_tbl_no;
int ac_tbl_no;
/* ... */
JDIMENSION width_in_blocks;
JDIMENSION height_in_blocks;
/* ... */
int DCT_h_scaled_size;
int DCT_v_scaled_size;
/* ... */
JDIMENSION downsampled_width;
JDIMENSION downsampled_height;
/* ... */
boolean component_needed;
int MCU_width;
int MCU_height;
int MCU_blocks;
int MCU_sample_width;
int last_col_width;
int last_row_height;
/* ... */
JQUANT_TBL * quant_table;
void * dct_table;
...} jpeg_component_info;
typedef struct {
int comps_in_scan;
int component_index[MAX_COMPS_IN_SCAN];
int Ss, Se;
int Ah, Al;
...} jpeg_scan_info;
typedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr;
struct jpeg_marker_struct {
jpeg_saved_marker_ptr next;
UINT8 marker;
unsigned int original_length;
unsigned int data_length;
JOCTET FAR * data;
...};
typedef enum {
JCS_UNKNOWN,
JCS_GRAYSCALE,
JCS_RGB,
JCS_YCbCr,
JCS_CMYK,
JCS_YCCK
...} J_COLOR_SPACE;
typedef enum {
JDCT_ISLOW,
JDCT_IFAST,
JDCT_FLOAT
...} J_DCT_METHOD;
#ifndef JDCT_DEFAULT
#define JDCT_DEFAULT JDCT_ISLOW
#endif
#ifndef JDCT_FASTEST
#define JDCT_FASTEST JDCT_IFAST
#endif
typedef enum {
JDITHER_NONE,
JDITHER_ORDERED,
JDITHER_FS
...} J_DITHER_MODE;
#define jpeg_common_fields \
struct jpeg_error_mgr * err; \
struct jpeg_memory_mgr * mem; \
struct jpeg_progress_mgr * progress; \
void * client_data; \
boolean is_decompressor; \
int global_state ...
/* ... */
struct jpeg_common_struct {
jpeg_common_fields;
/* ... */
...};
typedef struct jpeg_common_struct * j_common_ptr;
typedef struct jpeg_compress_struct * j_compress_ptr;
typedef struct jpeg_decompress_struct * j_decompress_ptr;
struct jpeg_compress_struct {
jpeg_common_fields;
struct jpeg_destination_mgr * dest;
/* ... */
JDIMENSION image_width;
JDIMENSION image_height;
int input_components;
J_COLOR_SPACE in_color_space;
double input_gamma;
/* ... */
unsigned int scale_num, scale_denom;
JDIMENSION jpeg_width;
JDIMENSION jpeg_height;
/* ... */
int data_precision;
int num_components;
J_COLOR_SPACE jpeg_color_space;
jpeg_component_info * comp_info;
JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
int q_scale_factor[NUM_QUANT_TBLS];
/* ... */
JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
UINT8 arith_dc_L[NUM_ARITH_TBLS];
UINT8 arith_dc_U[NUM_ARITH_TBLS];
UINT8 arith_ac_K[NUM_ARITH_TBLS];
int num_scans;
const jpeg_scan_info * scan_info;
/* ... */
boolean raw_data_in;
boolean arith_code;
boolean optimize_coding;
boolean CCIR601_sampling;
boolean do_fancy_downsampling;
int smoothing_factor;
J_DCT_METHOD dct_method;
/* ... */
unsigned int restart_interval;
int restart_in_rows;
boolean write_JFIF_header;
UINT8 JFIF_major_version;
UINT8 JFIF_minor_version;
UINT8 density_unit;
UINT16 X_density;
UINT16 Y_density;
boolean write_Adobe_marker;
/* ... */
JDIMENSION next_scanline;
/* ... */
/* ... */
boolean progressive_mode;
int max_h_samp_factor;
int max_v_samp_factor;
int min_DCT_h_scaled_size;
int min_DCT_v_scaled_size;
JDIMENSION total_iMCU_rows;
/* ... */
/* ... */
int comps_in_scan;
jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
JDIMENSION MCUs_per_row;
JDIMENSION MCU_rows_in_scan;
int blocks_in_MCU;
int MCU_membership[C_MAX_BLOCKS_IN_MCU];
int Ss, Se, Ah, Al;
int block_size;
const int * natural_order;
int lim_Se;
/* ... */
struct jpeg_comp_master * master;
struct jpeg_c_main_controller * main;
struct jpeg_c_prep_controller * prep;
struct jpeg_c_coef_controller * coef;
struct jpeg_marker_writer * marker;
struct jpeg_color_converter * cconvert;
struct jpeg_downsampler * downsample;
struct jpeg_forward_dct * fdct;
struct jpeg_entropy_encoder * entropy;
jpeg_scan_info * script_space;
int script_space_size;
...};
struct jpeg_decompress_struct {
jpeg_common_fields;
struct jpeg_source_mgr * src;
JDIMENSION image_width;
JDIMENSION image_height;
int num_components;
J_COLOR_SPACE jpeg_color_space;
/* ... */
J_COLOR_SPACE out_color_space;
unsigned int scale_num, scale_denom;
double output_gamma;
boolean buffered_image;
boolean raw_data_out;
J_DCT_METHOD dct_method;
boolean do_fancy_upsampling;
boolean do_block_smoothing;
boolean quantize_colors;
J_DITHER_MODE dither_mode;
boolean two_pass_quantize;
int desired_number_of_colors;
boolean enable_1pass_quant;
boolean enable_external_quant;
boolean enable_2pass_quant;
/* ... */
JDIMENSION output_width;
JDIMENSION output_height;
int out_color_components;
int output_components;
/* ... */
int rec_outbuf_height;
/* ... */
/* ... */
int actual_number_of_colors;
JSAMPARRAY colormap;
/* ... */
/* ... */
JDIMENSION output_scanline;
/* ... */
int input_scan_number;
JDIMENSION input_iMCU_row;
/* ... */
int output_scan_number;
JDIMENSION output_iMCU_row;
/* ... */
int (*coef_bits)[DCTSIZE2];
/* ... */
/* ... */
JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
/* ... */
int data_precision;
jpeg_component_info * comp_info;
boolean is_baseline;
boolean progressive_mode;
boolean arith_code;
UINT8 arith_dc_L[NUM_ARITH_TBLS];
UINT8 arith_dc_U[NUM_ARITH_TBLS];
UINT8 arith_ac_K[NUM_ARITH_TBLS];
unsigned int restart_interval;
/* ... */
boolean saw_JFIF_marker;
UINT8 JFIF_major_version;
UINT8 JFIF_minor_version;
UINT8 density_unit;
UINT16 X_density;
UINT16 Y_density;
boolean saw_Adobe_marker;
UINT8 Adobe_transform;
boolean CCIR601_sampling;
/* ... */
jpeg_saved_marker_ptr marker_list;
/* ... */
/* ... */
int max_h_samp_factor;
int max_v_samp_factor;
int min_DCT_h_scaled_size;
int min_DCT_v_scaled_size;
JDIMENSION total_iMCU_rows;
/* ... */
JSAMPLE * sample_range_limit;
/* ... */
int comps_in_scan;
jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
JDIMENSION MCUs_per_row;
JDIMENSION MCU_rows_in_scan;
int blocks_in_MCU;
int MCU_membership[D_MAX_BLOCKS_IN_MCU];
int Ss, Se, Ah, Al;
/* ... */
int block_size;
const int * natural_order;
int lim_Se;
/* ... */
int unread_marker;
/* ... */
struct jpeg_decomp_master * master;
struct jpeg_d_main_controller * main;
struct jpeg_d_coef_controller * coef;
struct jpeg_d_post_controller * post;
struct jpeg_input_controller * inputctl;
struct jpeg_marker_reader * marker;
struct jpeg_entropy_decoder * entropy;
struct jpeg_inverse_dct * idct;
struct jpeg_upsampler * upsample;
struct jpeg_color_deconverter * cconvert;
struct jpeg_color_quantizer * cquantize;
...};
/* ... */
struct jpeg_error_mgr {
JMETHOD(void, error_exit, (j_common_ptr cinfo));
JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level));
JMETHOD(void, output_message, (j_common_ptr cinfo));
JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer));
#define JMSG_LENGTH_MAX 200
JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));
/* ... */
int msg_code;
#define JMSG_STR_PARM_MAX 80
union {
int i[8];
char s[JMSG_STR_PARM_MAX];
...} msg_parm;
int trace_level;
/* ... */
long num_warnings;
/* ... */
const char * const * jpeg_message_table;
int last_jpeg_message;
/* ... */
const char * const * addon_message_table;
int first_addon_message;
int last_addon_message;
...};
struct jpeg_progress_mgr {
JMETHOD(void, progress_monitor, (j_common_ptr cinfo));
long pass_counter;
long pass_limit;
int completed_passes;
int total_passes;
...};
struct jpeg_destination_mgr {
JOCTET * next_output_byte;
size_t free_in_buffer;
JMETHOD(void, init_destination, (j_compress_ptr cinfo));
JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo));
JMETHOD(void, term_destination, (j_compress_ptr cinfo));
...};
struct jpeg_source_mgr {
const JOCTET * next_input_byte;
size_t bytes_in_buffer;
JMETHOD(void, init_source, (j_decompress_ptr cinfo));
JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo));
JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes));
JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired));
JMETHOD(void, term_source, (j_decompress_ptr cinfo));
...};
/* ... */
#define JPOOL_PERMANENT 0
#define JPOOL_IMAGE 1
#define JPOOL_NUMPOOLS 2
typedef struct jvirt_sarray_control * jvirt_sarray_ptr;
typedef struct jvirt_barray_control * jvirt_barray_ptr;
struct jpeg_memory_mgr {
JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id,
size_t sizeofobject));
JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id,
size_t sizeofobject));
JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id,
JDIMENSION samplesperrow,
JDIMENSION numrows));
JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id,
JDIMENSION blocksperrow,
JDIMENSION numrows));
JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo,
int pool_id,
boolean pre_zero,
JDIMENSION samplesperrow,
JDIMENSION numrows,
JDIMENSION maxaccess));
JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo,
int pool_id,
boolean pre_zero,
JDIMENSION blocksperrow,
JDIMENSION numrows,
JDIMENSION maxaccess));
JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo));
JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo,
jvirt_sarray_ptr ptr,
JDIMENSION start_row,
JDIMENSION num_rows,
boolean writable));
JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo,
jvirt_barray_ptr ptr,
JDIMENSION start_row,
JDIMENSION num_rows,
boolean writable));
JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id));
JMETHOD(void, self_destruct, (j_common_ptr cinfo));
/* ... */
long max_memory_to_use;
long max_alloc_chunk;
...};
/* ... */
typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));
/* ... */
#ifdef HAVE_PROTOTYPES
#define JPP(arglist) arglist
#else
#define JPP(arglist) ()
#endif
/* ... */
#ifdef NEED_SHORT_EXTERNAL_NAMES
#define jpeg_std_error jStdError
#define jpeg_CreateCompress jCreaCompress
#define jpeg_CreateDecompress jCreaDecompress
#define jpeg_destroy_compress jDestCompress
#define jpeg_destroy_decompress jDestDecompress
#define jpeg_stdio_dest jStdDest
#define jpeg_stdio_src jStdSrc
#define jpeg_mem_dest jMemDest
#define jpeg_mem_src jMemSrc
#define jpeg_set_defaults jSetDefaults
#define jpeg_set_colorspace jSetColorspace
#define jpeg_default_colorspace jDefColorspace
#define jpeg_set_quality jSetQuality
#define jpeg_set_linear_quality jSetLQuality
#define jpeg_default_qtables jDefQTables
#define jpeg_add_quant_table jAddQuantTable
#define jpeg_quality_scaling jQualityScaling
#define jpeg_simple_progression jSimProgress
#define jpeg_suppress_tables jSuppressTables
#define jpeg_alloc_quant_table jAlcQTable
#define jpeg_alloc_huff_table jAlcHTable
#define jpeg_start_compress jStrtCompress
#define jpeg_write_scanlines jWrtScanlines
#define jpeg_finish_compress jFinCompress
#define jpeg_calc_jpeg_dimensions jCjpegDimensions
#define jpeg_write_raw_data jWrtRawData
#define jpeg_write_marker jWrtMarker
#define jpeg_write_m_header jWrtMHeader
#define jpeg_write_m_byte jWrtMByte
#define jpeg_write_tables jWrtTables
#define jpeg_read_header jReadHeader
#define jpeg_start_decompress jStrtDecompress
#define jpeg_read_scanlines jReadScanlines
#define jpeg_finish_decompress jFinDecompress
#define jpeg_read_raw_data jReadRawData
#define jpeg_has_multiple_scans jHasMultScn
#define jpeg_start_output jStrtOutput
#define jpeg_finish_output jFinOutput
#define jpeg_input_complete jInComplete
#define jpeg_new_colormap jNewCMap
#define jpeg_consume_input jConsumeInput
#define jpeg_core_output_dimensions jCoreDimensions
#define jpeg_calc_output_dimensions jCalcDimensions
#define jpeg_save_markers jSaveMarkers
#define jpeg_set_marker_processor jSetMarker
#define jpeg_read_coefficients jReadCoefs
#define jpeg_write_coefficients jWrtCoefs
#define jpeg_copy_critical_parameters jCopyCrit
#define jpeg_abort_compress jAbrtCompress
#define jpeg_abort_decompress jAbrtDecompress
#define jpeg_abort jAbort
#define jpeg_destroy jDestroy
#define jpeg_resync_to_restart jResyncRestart
/* ... */#endif
EXTERN(struct jpeg_error_mgr *) jpeg_std_error
JPP((struct jpeg_error_mgr * err));
/* ... */
#define jpeg_create_compress(cinfo) \
jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \
(size_t) sizeof(struct jpeg_compress_struct))...
#define jpeg_create_decompress(cinfo) \
jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \
(size_t) sizeof(struct jpeg_decompress_struct))...
EXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo,
int version, size_t structsize));
EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo,
int version, size_t structsize));
EXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo));
EXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo));
#ifdef JFILE
EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, JFILE * outfile));
EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, JFILE * infile));/* ... */
#endif
EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,
unsigned char ** outbuffer,
unsigned long * outsize));
EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo,
unsigned char * inbuffer,
unsigned long insize));
EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));
EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo,
J_COLOR_SPACE colorspace));
EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo));
EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality,
boolean force_baseline));
EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo,
int scale_factor,
boolean force_baseline));
EXTERN(void) jpeg_default_qtables JPP((j_compress_ptr cinfo,
boolean force_baseline));
EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl,
const unsigned int *basic_table,
int scale_factor,
boolean force_baseline));
EXTERN(int) jpeg_quality_scaling JPP((int quality));
EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo));
EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,
boolean suppress));
EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));
EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));
EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,
boolean write_all_tables));
EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo,
JSAMPARRAY scanlines,
JDIMENSION num_lines));
EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo));
EXTERN(void) jpeg_calc_jpeg_dimensions JPP((j_compress_ptr cinfo));
EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo,
JSAMPIMAGE data,
JDIMENSION num_lines));
EXTERN(void) jpeg_write_marker
JPP((j_compress_ptr cinfo, int marker,
const JOCTET * dataptr, unsigned int datalen));
EXTERN(void) jpeg_write_m_header
JPP((j_compress_ptr cinfo, int marker, unsigned int datalen));
EXTERN(void) jpeg_write_m_byte
JPP((j_compress_ptr cinfo, int val));
EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo));
EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,
boolean require_image));
#define JPEG_SUSPENDED 0
#define JPEG_HEADER_OK 1
#define JPEG_HEADER_TABLES_ONLY 2
/* ... */
EXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo));
EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo,
JSAMPARRAY scanlines,
JDIMENSION max_lines));
EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo));
EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo,
JSAMPIMAGE data,
JDIMENSION max_lines));
EXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo));
EXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo,
int scan_number));
EXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo));
EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo));
EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo));
EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo));
#define JPEG_REACHED_SOS 1
#define JPEG_REACHED_EOI 2
#define JPEG_ROW_COMPLETED 3
#define JPEG_SCAN_COMPLETED 4
EXTERN(void) jpeg_core_output_dimensions JPP((j_decompress_ptr cinfo));
EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo));
EXTERN(void) jpeg_save_markers
JPP((j_decompress_ptr cinfo, int marker_code,
unsigned int length_limit));
EXTERN(void) jpeg_set_marker_processor
JPP((j_decompress_ptr cinfo, int marker_code,
jpeg_marker_parser_method routine));
EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo));
EXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo,
jvirt_barray_ptr * coef_arrays));
EXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo,
j_compress_ptr dstinfo));
/* ... */
EXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo));
EXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo));
/* ... */
EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo));
EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo));
EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo,
int desired));
/* ... */
#define JPEG_RST0 0xD0
#define JPEG_EOI 0xD9
#define JPEG_APP0 0xE0
#define JPEG_COM 0xFE
/* ... */
#ifdef INCOMPLETE_TYPES_BROKEN
#ifndef JPEG_INTERNALS
struct jvirt_sarray_control { long dummy; };
struct jvirt_barray_control { long dummy; };
struct jpeg_comp_master { long dummy; };
struct jpeg_c_main_controller { long dummy; };
struct jpeg_c_prep_controller { long dummy; };
struct jpeg_c_coef_controller { long dummy; };
struct jpeg_marker_writer { long dummy; };
struct jpeg_color_converter { long dummy; };
struct jpeg_downsampler { long dummy; };
struct jpeg_forward_dct { long dummy; };
struct jpeg_entropy_encoder { long dummy; };
struct jpeg_decomp_master { long dummy; };
struct jpeg_d_main_controller { long dummy; };
struct jpeg_d_coef_controller { long dummy; };
struct jpeg_d_post_controller { long dummy; };
struct jpeg_input_controller { long dummy; };
struct jpeg_marker_reader { long dummy; };
struct jpeg_entropy_decoder { long dummy; };
struct jpeg_inverse_dct { long dummy; };
struct jpeg_upsampler { long dummy; };
struct jpeg_color_deconverter { long dummy; };
struct jpeg_color_quantizer { long dummy; };/* ... */
#endif /* ... */
#endif
/* ... */
#ifdef JPEG_INTERNALS
#include "jpegint.h"
#include "jerror.h"
/* ... */#endif
#ifdef __cplusplus
#ifndef DONT_USE_EXTERN_C
}extern "C" { ... }
#endif
#endif
/* ... */
#endif