44#ifndef JCONFIG_INCLUDED
51#ifndef DONT_USE_EXTERN_C
60#define JPEG_LIB_VERSION 90
61#define JPEG_LIB_VERSION_MAJOR 9
62#define JPEG_LIB_VERSION_MINOR 5
72#define NUM_QUANT_TBLS 4
73#define NUM_HUFF_TBLS 4
74#define NUM_ARITH_TBLS 16
75#define MAX_COMPS_IN_SCAN 4
76#define MAX_SAMP_FACTOR 4
84#define C_MAX_BLOCKS_IN_MCU 10
85#ifndef D_MAX_BLOCKS_IN_MCU
86#define D_MAX_BLOCKS_IN_MCU 10
95typedef JSAMPLE FAR *JSAMPROW;
96typedef JSAMPROW *JSAMPARRAY;
97typedef JSAMPARRAY *JSAMPIMAGE;
99typedef JCOEF JBLOCK[DCTSIZE2];
100typedef JBLOCK FAR *JBLOCKROW;
101typedef JBLOCKROW *JBLOCKARRAY;
102typedef JBLOCKARRAY *JBLOCKIMAGE;
104typedef JCOEF FAR *JCOEFPTR;
117 UINT16 quantval[DCTSIZE2];
168 JDIMENSION width_in_blocks;
169 JDIMENSION height_in_blocks;
175 int DCT_h_scaled_size;
176 int DCT_v_scaled_size;
184 JDIMENSION downsampled_width;
185 JDIMENSION downsampled_height;
194 boolean component_needed;
201 int MCU_sample_width;
220 int component_index[MAX_COMPS_IN_SCAN];
230 jpeg_saved_marker_ptr next;
232 unsigned int original_length;
233 unsigned int data_length;
256 JCT_SUBTRACT_GREEN = 1
268#define JDCT_DEFAULT JDCT_ISLOW
271#define JDCT_FASTEST JDCT_IFAST
285#define jpeg_common_fields \
286 struct jpeg_error_mgr * err; \
287 struct jpeg_memory_mgr * mem; \
288 struct jpeg_progress_mgr * progress; \
289 void * client_data; \
290 boolean is_decompressor; \
323 JDIMENSION image_width;
324 JDIMENSION image_height;
325 int input_components;
326 J_COLOR_SPACE in_color_space;
338 unsigned int scale_num, scale_denom;
340 JDIMENSION jpeg_width;
341 JDIMENSION jpeg_height;
352 J_COLOR_SPACE jpeg_color_space;
358 int q_scale_factor[NUM_QUANT_TBLS];
363 JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
364 JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
367 UINT8 arith_dc_L[NUM_ARITH_TBLS];
368 UINT8 arith_dc_U[NUM_ARITH_TBLS];
369 UINT8 arith_ac_K[NUM_ARITH_TBLS];
380 boolean optimize_coding;
381 boolean CCIR601_sampling;
382 boolean do_fancy_downsampling;
383 int smoothing_factor;
384 J_DCT_METHOD dct_method;
391 unsigned int restart_interval;
396 boolean write_JFIF_header;
397 UINT8 JFIF_major_version;
398 UINT8 JFIF_minor_version;
406 boolean write_Adobe_marker;
408 J_COLOR_TRANSFORM color_transform;
416 JDIMENSION next_scanline;
425 boolean progressive_mode;
426 int max_h_samp_factor;
427 int max_v_samp_factor;
429 int min_DCT_h_scaled_size;
430 int min_DCT_v_scaled_size;
432 JDIMENSION total_iMCU_rows;
447 JDIMENSION MCUs_per_row;
448 JDIMENSION MCU_rows_in_scan;
451 int MCU_membership[C_MAX_BLOCKS_IN_MCU];
458 const int * natural_order;
474 int script_space_size;
735 JMETHOD(
void, emit_message, (
j_common_ptr cinfo,
int msg_level));
739 JMETHOD(
void, format_message, (
j_common_ptr cinfo,
char * buffer));
740#define JMSG_LENGTH_MAX 200
748#define JMSG_STR_PARM_MAX 80
751 char s[JMSG_STR_PARM_MAX];
776 const char *
const * jpeg_message_table;
777 int last_jpeg_message;
781 const char *
const * addon_message_table;
782 int first_addon_message;
783 int last_addon_message;
794 int completed_passes;
802 JOCTET * next_output_byte;
803 size_t free_in_buffer;
814 const JOCTET * next_input_byte;
815 size_t bytes_in_buffer;
836#define JPOOL_PERMANENT 0
838#define JPOOL_NUMPOOLS 2
840typedef struct jvirt_sarray_control * jvirt_sarray_ptr;
841typedef struct jvirt_barray_control * jvirt_barray_ptr;
846 JMETHOD(
void *, alloc_small, (
j_common_ptr cinfo,
int pool_id,
847 size_t sizeofobject));
848 JMETHOD(
void FAR *, alloc_large, (
j_common_ptr cinfo,
int pool_id,
849 size_t sizeofobject));
850 JMETHOD(JSAMPARRAY, alloc_sarray, (
j_common_ptr cinfo,
int pool_id,
851 JDIMENSION samplesperrow,
852 JDIMENSION numrows));
853 JMETHOD(JBLOCKARRAY, alloc_barray, (
j_common_ptr cinfo,
int pool_id,
854 JDIMENSION blocksperrow,
855 JDIMENSION numrows));
856 JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (
j_common_ptr cinfo,
859 JDIMENSION samplesperrow,
861 JDIMENSION maxaccess));
862 JMETHOD(jvirt_barray_ptr, request_virt_barray, (
j_common_ptr cinfo,
865 JDIMENSION blocksperrow,
867 JDIMENSION maxaccess));
868 JMETHOD(
void, realize_virt_arrays, (
j_common_ptr cinfo));
869 JMETHOD(JSAMPARRAY, access_virt_sarray, (
j_common_ptr cinfo,
870 jvirt_sarray_ptr ptr,
871 JDIMENSION start_row,
874 JMETHOD(JBLOCKARRAY, access_virt_barray, (
j_common_ptr cinfo,
875 jvirt_barray_ptr ptr,
876 JDIMENSION start_row,
879 JMETHOD(
void, free_pool, (
j_common_ptr cinfo,
int pool_id));
887 long max_memory_to_use;
890 long max_alloc_chunk;
897typedef JMETHOD(
boolean, jpeg_marker_parser_method, (
j_decompress_ptr cinfo));
905#ifdef HAVE_PROTOTYPES
906#define JPP(arglist) arglist
908#define JPP(arglist) ()
919#ifdef NEED_SHORT_EXTERNAL_NAMES
920#define jpeg_std_error jStdError
921#define jpeg_CreateCompress jCreaCompress
922#define jpeg_CreateDecompress jCreaDecompress
923#define jpeg_destroy_compress jDestCompress
924#define jpeg_destroy_decompress jDestDecompress
925#define jpeg_stdio_dest jStdDest
926#define jpeg_stdio_src jStdSrc
927#define jpeg_mem_dest jMemDest
928#define jpeg_mem_src jMemSrc
929#define jpeg_set_defaults jSetDefaults
930#define jpeg_set_colorspace jSetColorspace
931#define jpeg_default_colorspace jDefColorspace
932#define jpeg_set_quality jSetQuality
933#define jpeg_set_linear_quality jSetLQuality
934#define jpeg_default_qtables jDefQTables
935#define jpeg_add_quant_table jAddQuantTable
936#define jpeg_quality_scaling jQualityScaling
937#define jpeg_simple_progression jSimProgress
938#define jpeg_suppress_tables jSuppressTables
939#define jpeg_alloc_quant_table jAlcQTable
940#define jpeg_alloc_huff_table jAlcHTable
941#define jpeg_std_huff_table jStdHTable
942#define jpeg_start_compress jStrtCompress
943#define jpeg_write_scanlines jWrtScanlines
944#define jpeg_finish_compress jFinCompress
945#define jpeg_calc_jpeg_dimensions jCjpegDimensions
946#define jpeg_write_raw_data jWrtRawData
947#define jpeg_write_marker jWrtMarker
948#define jpeg_write_m_header jWrtMHeader
949#define jpeg_write_m_byte jWrtMByte
950#define jpeg_write_tables jWrtTables
951#define jpeg_read_header jReadHeader
952#define jpeg_start_decompress jStrtDecompress
953#define jpeg_read_scanlines jReadScanlines
954#define jpeg_finish_decompress jFinDecompress
955#define jpeg_read_raw_data jReadRawData
956#define jpeg_has_multiple_scans jHasMultScn
957#define jpeg_start_output jStrtOutput
958#define jpeg_finish_output jFinOutput
959#define jpeg_input_complete jInComplete
960#define jpeg_new_colormap jNewCMap
961#define jpeg_consume_input jConsumeInput
962#define jpeg_core_output_dimensions jCoreDimensions
963#define jpeg_calc_output_dimensions jCalcDimensions
964#define jpeg_save_markers jSaveMarkers
965#define jpeg_set_marker_processor jSetMarker
966#define jpeg_read_coefficients jReadCoefs
967#define jpeg_write_coefficients jWrtCoefs
968#define jpeg_copy_critical_parameters jCopyCrit
969#define jpeg_abort_compress jAbrtCompress
970#define jpeg_abort_decompress jAbrtDecompress
971#define jpeg_abort jAbort
972#define jpeg_destroy jDestroy
973#define jpeg_resync_to_restart jResyncRestart
988#define jpeg_create_compress(cinfo) \
989 jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \
990 (size_t) sizeof(struct jpeg_compress_struct))
991#define jpeg_create_decompress(cinfo) \
992 jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \
993 (size_t) sizeof(struct jpeg_decompress_struct))
995 int version,
size_t structsize));
997 int version,
size_t structsize));
1012EXTERN(
void) jpeg_stdio_dest JPP((
j_compress_ptr cinfo, FILE * outfile));
1038 unsigned char ** outbuffer,
1052 const unsigned char * inbuffer,
1059 J_COLOR_SPACE colorspace));
1061EXTERN(
void) jpeg_set_quality JPP((
j_compress_ptr cinfo,
int quality,
1062 boolean force_baseline));
1065 boolean force_baseline));
1067 boolean force_baseline));
1068EXTERN(
void) jpeg_add_quant_table JPP((
j_compress_ptr cinfo,
int which_tbl,
1069 const unsigned int *basic_table,
1071 boolean force_baseline));
1072EXTERN(
int) jpeg_quality_scaling JPP((
int quality));
1079 boolean isDC,
int tblno));
1083 boolean write_all_tables));
1084EXTERN(JDIMENSION) jpeg_write_scanlines JPP((
j_compress_ptr cinfo,
1085 JSAMPARRAY scanlines,
1086 JDIMENSION num_lines));
1090EXTERN(
void) jpeg_calc_jpeg_dimensions JPP((
j_compress_ptr cinfo));
1095 JDIMENSION num_lines));
1098EXTERN(
void) jpeg_write_marker
1100 const JOCTET * dataptr,
unsigned int datalen));
1102EXTERN(
void) jpeg_write_m_header
1104EXTERN(
void) jpeg_write_m_byte
1129 boolean require_image));
1131#define JPEG_SUSPENDED 0
1132#define JPEG_HEADER_OK 1
1133#define JPEG_HEADER_TABLES_ONLY 2
1167 JSAMPARRAY scanlines,
1168 JDIMENSION max_lines));
1185 JDIMENSION max_lines,
1186 JDIMENSION *offset));
1204 JDIMENSION max_lines));
1216#define JPEG_REACHED_SOS 1
1217#define JPEG_REACHED_EOI 2
1218#define JPEG_ROW_COMPLETED 3
1219#define JPEG_SCAN_COMPLETED 4
1226EXTERN(
void) jpeg_save_markers
1228 unsigned int length_limit));
1231EXTERN(
void) jpeg_set_marker_processor
1233 jpeg_marker_parser_method routine));
1236EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((
j_decompress_ptr cinfo));
1238 jvirt_barray_ptr * coef_arrays));
1266#define JPEG_RST0 0xD0
1267#define JPEG_EOI 0xD9
1268#define JPEG_APP0 0xE0
1269#define JPEG_COM 0xFE
1277#ifdef INCOMPLETE_TYPES_BROKEN
1278#ifndef JPEG_INTERNALS
1279struct jvirt_sarray_control {
long dummy; };
1280struct jvirt_barray_control {
long dummy; };
1312#ifdef JPEG_INTERNALS
1318#ifndef DONT_USE_EXTERN_C
boolean jpeg_finish_decompress(j_decompress_ptr cinfo)
void jpeg_mem_src(j_decompress_ptr cinfo, const unsigned char *inbuffer, size_t insize)
JDIMENSION jpeg_read_mcus(j_decompress_ptr cinfo, JSAMPARRAY mcus, JDIMENSION max_lines, JDIMENSION *offset)
void jpeg_destroy_decompress(j_decompress_ptr cinfo)
JDIMENSION jpeg_read_scanlines(j_decompress_ptr cinfo, JSAMPARRAY scanlines, JDIMENSION max_lines)
void jpeg_stdio_src(j_decompress_ptr cinfo, FILE *infile)
int jpeg_read_header(j_decompress_ptr cinfo, boolean require_image)
void jpeg_fd_src(j_decompress_ptr cinfo, int infd)
boolean jpeg_start_decompress(j_decompress_ptr cinfo)
Definition: jpeglib.h:129
Definition: jpeglib.h:112
Definition: jpegint.h:253
Definition: jpegint.h:261
Definition: jpeglib.h:297
Definition: jpeglib.h:145
Definition: jpeglib.h:312
Definition: jpegint.h:177
Definition: jpegint.h:169
Definition: jpegint.h:188
Definition: jpegint.h:148
Definition: jpeglib.h:480
JDIMENSION output_offset
Definition: jpeglib.h:561
J_DCT_METHOD dct_method
Definition: jpeglib.h:509
JDIMENSION total_iMCU_rows
Definition: jpeglib.h:659
J_DITHER_MODE dither_mode
Definition: jpeglib.h:515
int output_scan_number
Definition: jpeglib.h:573
int data_precision
Definition: jpeglib.h:607
UINT8 density_unit
Definition: jpeglib.h:629
boolean saw_Adobe_marker
Definition: jpeglib.h:632
int Al
Definition: jpeglib.h:690
JSAMPARRAY colormap
Definition: jpeglib.h:549
int out_color_components
Definition: jpeglib.h:531
JDIMENSION image_height
Definition: jpeglib.h:490
int rec_outbuf_height
Definition: jpeglib.h:536
jpeg_saved_marker_ptr marker_list
Definition: jpeglib.h:644
UINT16 Y_density
Definition: jpeglib.h:631
boolean enable_2pass_quant
Definition: jpeglib.h:521
boolean saw_JFIF_marker
Definition: jpeglib.h:625
JDIMENSION MCUs_per_row
Definition: jpeglib.h:680
int comps_in_scan
Definition: jpeglib.h:675
boolean arith_code
Definition: jpeglib.h:614
unsigned int scale_num
Definition: jpeglib.h:501
int input_scan_number
Definition: jpeglib.h:566
unsigned int scale_denom
Definition: jpeglib.h:502
int unread_marker
Definition: jpeglib.h:702
boolean raw_data_out
Definition: jpeglib.h:507
int max_v_samp_factor
Definition: jpeglib.h:654
int block_size
Definition: jpeglib.h:694
boolean do_block_smoothing
Definition: jpeglib.h:511
boolean two_pass_quantize
Definition: jpeglib.h:516
int actual_number_of_colors
Definition: jpeglib.h:548
UINT8 arith_dc_U[NUM_ARITH_TBLS]
Definition: jpeglib.h:617
JDIMENSION output_height
Definition: jpeglib.h:530
UINT16 X_density
Definition: jpeglib.h:630
int desired_number_of_colors
Definition: jpeglib.h:517
UINT8 JFIF_major_version
Definition: jpeglib.h:627
UINT8 arith_dc_L[NUM_ARITH_TBLS]
Definition: jpeglib.h:616
int min_DCT_v_scaled_size
Definition: jpeglib.h:657
boolean enable_external_quant
Definition: jpeglib.h:520
JDIMENSION output_scanline
Definition: jpeglib.h:559
JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]
Definition: jpeglib.h:595
int blocks_in_MCU
Definition: jpeglib.h:683
jpeg_common_fields
Definition: jpeglib.h:481
const int * natural_order
Definition: jpeglib.h:695
int MCU_membership[D_MAX_BLOCKS_IN_MCU]
Definition: jpeglib.h:688
boolean do_fancy_upsampling
Definition: jpeglib.h:510
jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]
Definition: jpeglib.h:678
UINT8 arith_ac_K[NUM_ARITH_TBLS]
Definition: jpeglib.h:618
boolean enable_1pass_quant
Definition: jpeglib.h:519
J_COLOR_SPACE out_color_space
Definition: jpeglib.h:499
JDIMENSION image_width
Definition: jpeglib.h:489
int output_components
Definition: jpeglib.h:532
int min_DCT_h_scaled_size
Definition: jpeglib.h:656
unsigned int restart_interval
Definition: jpeglib.h:620
boolean is_baseline
Definition: jpeglib.h:612
double output_gamma
Definition: jpeglib.h:504
int lim_Se
Definition: jpeglib.h:696
J_COLOR_SPACE jpeg_color_space
Definition: jpeglib.h:492
JSAMPLE * sample_range_limit
Definition: jpeglib.h:668
JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]
Definition: jpeglib.h:598
JDIMENSION MCU_rows_in_scan
Definition: jpeglib.h:681
boolean progressive_mode
Definition: jpeglib.h:613
J_COLOR_TRANSFORM color_transform
Definition: jpeglib.h:636
UINT8 JFIF_minor_version
Definition: jpeglib.h:628
int num_components
Definition: jpeglib.h:491
JDIMENSION output_iMCU_row
Definition: jpeglib.h:574
JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]
Definition: jpeglib.h:601
JDIMENSION output_width
Definition: jpeglib.h:529
UINT8 Adobe_transform
Definition: jpeglib.h:633
boolean buffered_image
Definition: jpeglib.h:506
boolean CCIR601_sampling
Definition: jpeglib.h:638
int max_h_samp_factor
Definition: jpeglib.h:653
struct jpeg_source_mgr * src
Definition: jpeglib.h:484
JDIMENSION input_iMCU_row
Definition: jpeglib.h:567
int(* coef_bits)[DCTSIZE2]
Definition: jpeglib.h:583
boolean quantize_colors
Definition: jpeglib.h:513
Definition: jpeglib.h:801
Definition: jpegint.h:101
Definition: jpegint.h:220
Definition: jpegint.h:124
Definition: jpeglib.h:731
Definition: jpegint.h:117
Definition: jpegint.h:232
Definition: jpegint.h:200
Definition: jpeglib.h:229
Definition: jpegint.h:131
Definition: jpeglib.h:844
Definition: jpeglib.h:789
Definition: jpeglib.h:218
Definition: jpeglib.h:813
Definition: jpegint.h:239