1 /* |
1 /* |
2 * jpeglib.h |
2 * jpeglib.h |
3 * |
3 * |
4 * Copyright (C) 1991-1998, Thomas G. Lane. |
4 * Copyright (C) 1991-1998, Thomas G. Lane. |
|
5 * Modified 2002-2009 by Guido Vollbeding. |
5 * This file is part of the Independent JPEG Group's software. |
6 * This file is part of the Independent JPEG Group's software. |
6 * For conditions of distribution and use, see the accompanying README file. |
7 * For conditions of distribution and use, see the accompanying README file. |
7 * |
8 * |
8 * This file defines the application interface for the JPEG library. |
9 * This file defines the application interface for the JPEG library. |
9 * Most applications using the library need only include this file, |
10 * Most applications using the library need only include this file, |
24 #include "jconfig.h" /* widely used configuration options */ |
25 #include "jconfig.h" /* widely used configuration options */ |
25 #endif |
26 #endif |
26 #include "jmorecfg.h" /* seldom changed options */ |
27 #include "jmorecfg.h" /* seldom changed options */ |
27 |
28 |
28 |
29 |
|
30 #ifdef __cplusplus |
|
31 #ifndef DONT_USE_EXTERN_C |
|
32 extern "C" { |
|
33 #endif |
|
34 #endif |
|
35 |
29 /* Version ID for the JPEG library. |
36 /* Version ID for the JPEG library. |
30 * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60". |
37 * Might be useful for tests like "#if JPEG_LIB_VERSION >= 80". |
31 */ |
38 */ |
32 |
39 |
33 #define JPEG_LIB_VERSION 62 /* Version 6b */ |
40 #define JPEG_LIB_VERSION 80 /* Version 8.0 */ |
34 |
41 |
35 |
42 |
36 /* Various constants determining the sizes of things. |
43 /* Various constants determining the sizes of things. |
37 * All of these are specified by the JPEG standard, so don't change them |
44 * All of these are specified by the JPEG standard, so don't change them |
38 * if you want to be compatible. |
45 * if you want to be compatible. |
136 * Any dummy blocks added to complete an MCU are not counted; therefore |
143 * Any dummy blocks added to complete an MCU are not counted; therefore |
137 * these values do not depend on whether a scan is interleaved or not. |
144 * these values do not depend on whether a scan is interleaved or not. |
138 */ |
145 */ |
139 JDIMENSION width_in_blocks; |
146 JDIMENSION width_in_blocks; |
140 JDIMENSION height_in_blocks; |
147 JDIMENSION height_in_blocks; |
141 /* Size of a DCT block in samples. Always DCTSIZE for compression. |
148 /* Size of a DCT block in samples, |
142 * For decompression this is the size of the output from one DCT block, |
149 * reflecting any scaling we choose to apply during the DCT step. |
143 * reflecting any scaling we choose to apply during the IDCT step. |
150 * Values from 1 to 16 are supported. |
144 * Values of 1,2,4,8 are likely to be supported. Note that different |
151 * Note that different components may receive different DCT scalings. |
145 * components may receive different IDCT scalings. |
152 */ |
146 */ |
153 int DCT_h_scaled_size; |
147 int DCT_scaled_size; |
154 int DCT_v_scaled_size; |
148 /* The downsampled dimensions are the component's actual, unpadded number |
155 /* The downsampled dimensions are the component's actual, unpadded number |
149 * of samples at the main buffer (preprocessing/compression interface), thus |
156 * of samples at the main buffer (preprocessing/compression interface); |
150 * downsampled_width = ceil(image_width * Hi/Hmax) |
157 * DCT scaling is included, so |
151 * and similarly for height. For decompression, IDCT scaling is included, so |
158 * downsampled_width = ceil(image_width * Hi/Hmax * DCT_h_scaled_size/DCTSIZE) |
152 * downsampled_width = ceil(image_width * Hi/Hmax * DCT_scaled_size/DCTSIZE) |
159 * and similarly for height. |
153 */ |
160 */ |
154 JDIMENSION downsampled_width; /* actual width in samples */ |
161 JDIMENSION downsampled_width; /* actual width in samples */ |
155 JDIMENSION downsampled_height; /* actual height in samples */ |
162 JDIMENSION downsampled_height; /* actual height in samples */ |
156 /* This flag is used only for decompression. In cases where some of the |
163 /* This flag is used only for decompression. In cases where some of the |
157 * components will be ignored (eg grayscale output from YCbCr image), |
164 * components will be ignored (eg grayscale output from YCbCr image), |
162 /* These values are computed before starting a scan of the component. */ |
169 /* These values are computed before starting a scan of the component. */ |
163 /* The decompressor output side may not use these variables. */ |
170 /* The decompressor output side may not use these variables. */ |
164 int MCU_width; /* number of blocks per MCU, horizontally */ |
171 int MCU_width; /* number of blocks per MCU, horizontally */ |
165 int MCU_height; /* number of blocks per MCU, vertically */ |
172 int MCU_height; /* number of blocks per MCU, vertically */ |
166 int MCU_blocks; /* MCU_width * MCU_height */ |
173 int MCU_blocks; /* MCU_width * MCU_height */ |
167 int MCU_sample_width; /* MCU width in samples, MCU_width*DCT_scaled_size */ |
174 int MCU_sample_width; /* MCU width in samples: MCU_width * DCT_h_scaled_size */ |
168 int last_col_width; /* # of non-dummy blocks across in last MCU */ |
175 int last_col_width; /* # of non-dummy blocks across in last MCU */ |
169 int last_row_height; /* # of non-dummy blocks down in last MCU */ |
176 int last_row_height; /* # of non-dummy blocks down in last MCU */ |
170 |
177 |
171 /* Saved quantization table for component; NULL if none yet saved. |
178 /* Saved quantization table for component; NULL if none yet saved. |
172 * See jdinput.c comments about the need for this information. |
179 * See jdinput.c comments about the need for this information. |
289 * the application specifically wants to change. That way you won't get |
296 * the application specifically wants to change. That way you won't get |
290 * burnt when new parameters are added. Also note that there are several |
297 * burnt when new parameters are added. Also note that there are several |
291 * helper routines to simplify changing parameters. |
298 * helper routines to simplify changing parameters. |
292 */ |
299 */ |
293 |
300 |
|
301 unsigned int scale_num, scale_denom; /* fraction by which to scale image */ |
|
302 |
|
303 JDIMENSION jpeg_width; /* scaled JPEG image width */ |
|
304 JDIMENSION jpeg_height; /* scaled JPEG image height */ |
|
305 /* Dimensions of actual JPEG image that will be written to file, |
|
306 * derived from input dimensions by scaling factors above. |
|
307 * These fields are computed by jpeg_start_compress(). |
|
308 * You can also use jpeg_calc_jpeg_dimensions() to determine these values |
|
309 * in advance of calling jpeg_start_compress(). |
|
310 */ |
|
311 |
294 int data_precision; /* bits of precision in image data */ |
312 int data_precision; /* bits of precision in image data */ |
295 |
313 |
296 int num_components; /* # of color components in JPEG image */ |
314 int num_components; /* # of color components in JPEG image */ |
297 J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ |
315 J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ |
298 |
316 |
299 jpeg_component_info * comp_info; |
317 jpeg_component_info * comp_info; |
300 /* comp_info[i] describes component that appears i'th in SOF */ |
318 /* comp_info[i] describes component that appears i'th in SOF */ |
301 |
319 |
302 JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; |
320 JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; |
303 /* ptrs to coefficient quantization tables, or NULL if not defined */ |
321 int q_scale_factor[NUM_QUANT_TBLS]; |
304 |
322 /* ptrs to coefficient quantization tables, or NULL if not defined, |
|
323 * and corresponding scale factors (percentage, initialized 100). |
|
324 */ |
|
325 |
305 JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; |
326 JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; |
306 JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; |
327 JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; |
307 /* ptrs to Huffman coding tables, or NULL if not defined */ |
328 /* ptrs to Huffman coding tables, or NULL if not defined */ |
308 |
329 |
309 UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ |
330 UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ |
310 UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ |
331 UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ |
311 UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ |
332 UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ |
312 |
333 |
313 int num_scans; /* # of entries in scan_info array */ |
334 int num_scans; /* # of entries in scan_info array */ |
319 |
340 |
320 boolean raw_data_in; /* TRUE=caller supplies downsampled data */ |
341 boolean raw_data_in; /* TRUE=caller supplies downsampled data */ |
321 boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ |
342 boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ |
322 boolean optimize_coding; /* TRUE=optimize entropy encoding parms */ |
343 boolean optimize_coding; /* TRUE=optimize entropy encoding parms */ |
323 boolean CCIR601_sampling; /* TRUE=first samples are cosited */ |
344 boolean CCIR601_sampling; /* TRUE=first samples are cosited */ |
|
345 boolean do_fancy_downsampling; /* TRUE=apply fancy downsampling */ |
324 int smoothing_factor; /* 1..100, or 0 for no input smoothing */ |
346 int smoothing_factor; /* 1..100, or 0 for no input smoothing */ |
325 J_DCT_METHOD dct_method; /* DCT algorithm selector */ |
347 J_DCT_METHOD dct_method; /* DCT algorithm selector */ |
326 |
348 |
327 /* The restart interval can be specified in absolute MCUs by setting |
349 /* The restart interval can be specified in absolute MCUs by setting |
328 * restart_interval, or in MCU rows by setting restart_in_rows |
350 * restart_interval, or in MCU rows by setting restart_in_rows |
362 */ |
384 */ |
363 boolean progressive_mode; /* TRUE if scan script uses progressive mode */ |
385 boolean progressive_mode; /* TRUE if scan script uses progressive mode */ |
364 int max_h_samp_factor; /* largest h_samp_factor */ |
386 int max_h_samp_factor; /* largest h_samp_factor */ |
365 int max_v_samp_factor; /* largest v_samp_factor */ |
387 int max_v_samp_factor; /* largest v_samp_factor */ |
366 |
388 |
|
389 int min_DCT_h_scaled_size; /* smallest DCT_h_scaled_size of any component */ |
|
390 int min_DCT_v_scaled_size; /* smallest DCT_v_scaled_size of any component */ |
|
391 |
367 JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */ |
392 JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */ |
368 /* The coefficient controller receives data in units of MCU rows as defined |
393 /* The coefficient controller receives data in units of MCU rows as defined |
369 * for fully interleaved scans (whether the JPEG file is interleaved or not). |
394 * for fully interleaved scans (whether the JPEG file is interleaved or not). |
370 * There are v_samp_factor * DCTSIZE sample rows of each component in an |
395 * There are v_samp_factor * DCTSIZE sample rows of each component in an |
371 * "iMCU" (interleaved MCU) row. |
396 * "iMCU" (interleaved MCU) row. |
386 int MCU_membership[C_MAX_BLOCKS_IN_MCU]; |
411 int MCU_membership[C_MAX_BLOCKS_IN_MCU]; |
387 /* MCU_membership[i] is index in cur_comp_info of component owning */ |
412 /* MCU_membership[i] is index in cur_comp_info of component owning */ |
388 /* i'th block in an MCU */ |
413 /* i'th block in an MCU */ |
389 |
414 |
390 int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ |
415 int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ |
|
416 |
|
417 int block_size; /* the basic DCT block size: 1..16 */ |
|
418 const int * natural_order; /* natural-order position array */ |
|
419 int lim_Se; /* min( Se, DCTSIZE2-1 ) */ |
391 |
420 |
392 /* |
421 /* |
393 * Links to compression subobjects (methods and private variables of modules) |
422 * Links to compression subobjects (methods and private variables of modules) |
394 */ |
423 */ |
395 struct jpeg_comp_master * master; |
424 struct jpeg_comp_master * master; |
533 int data_precision; /* bits of precision in image data */ |
562 int data_precision; /* bits of precision in image data */ |
534 |
563 |
535 jpeg_component_info * comp_info; |
564 jpeg_component_info * comp_info; |
536 /* comp_info[i] describes component that appears i'th in SOF */ |
565 /* comp_info[i] describes component that appears i'th in SOF */ |
537 |
566 |
|
567 boolean is_baseline; /* TRUE if Baseline SOF0 encountered */ |
538 boolean progressive_mode; /* TRUE if SOFn specifies progressive mode */ |
568 boolean progressive_mode; /* TRUE if SOFn specifies progressive mode */ |
539 boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ |
569 boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ |
540 |
570 |
541 UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ |
571 UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ |
542 UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ |
572 UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ |
573 * These fields are computed during decompression startup |
603 * These fields are computed during decompression startup |
574 */ |
604 */ |
575 int max_h_samp_factor; /* largest h_samp_factor */ |
605 int max_h_samp_factor; /* largest h_samp_factor */ |
576 int max_v_samp_factor; /* largest v_samp_factor */ |
606 int max_v_samp_factor; /* largest v_samp_factor */ |
577 |
607 |
578 int min_DCT_scaled_size; /* smallest DCT_scaled_size of any component */ |
608 int min_DCT_h_scaled_size; /* smallest DCT_h_scaled_size of any component */ |
|
609 int min_DCT_v_scaled_size; /* smallest DCT_v_scaled_size of any component */ |
579 |
610 |
580 JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */ |
611 JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */ |
581 /* The coefficient controller's input and output progress is measured in |
612 /* The coefficient controller's input and output progress is measured in |
582 * units of "iMCU" (interleaved MCU) rows. These are the same as MCU rows |
613 * units of "iMCU" (interleaved MCU) rows. These are the same as MCU rows |
583 * in fully interleaved JPEG scans, but are used whether the scan is |
614 * in fully interleaved JPEG scans, but are used whether the scan is |
584 * interleaved or not. We define an iMCU row as v_samp_factor DCT block |
615 * interleaved or not. We define an iMCU row as v_samp_factor DCT block |
585 * rows of each component. Therefore, the IDCT output contains |
616 * rows of each component. Therefore, the IDCT output contains |
586 * v_samp_factor*DCT_scaled_size sample rows of a component per iMCU row. |
617 * v_samp_factor*DCT_v_scaled_size sample rows of a component per iMCU row. |
587 */ |
618 */ |
588 |
619 |
589 JSAMPLE * sample_range_limit; /* table for fast range-limiting */ |
620 JSAMPLE * sample_range_limit; /* table for fast range-limiting */ |
590 |
621 |
591 /* |
622 /* |
604 int MCU_membership[D_MAX_BLOCKS_IN_MCU]; |
635 int MCU_membership[D_MAX_BLOCKS_IN_MCU]; |
605 /* MCU_membership[i] is index in cur_comp_info of component owning */ |
636 /* MCU_membership[i] is index in cur_comp_info of component owning */ |
606 /* i'th block in an MCU */ |
637 /* i'th block in an MCU */ |
607 |
638 |
608 int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ |
639 int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ |
|
640 |
|
641 /* These fields are derived from Se of first SOS marker. |
|
642 */ |
|
643 int block_size; /* the basic DCT block size: 1..16 */ |
|
644 const int * natural_order; /* natural-order position array for entropy decode */ |
|
645 int lim_Se; /* min( Se, DCTSIZE2-1 ) for entropy decode */ |
609 |
646 |
610 /* This field is shared between entropy decoder and marker parser. |
647 /* This field is shared between entropy decoder and marker parser. |
611 * It is either zero or the code of a JPEG marker that has been |
648 * It is either zero or the code of a JPEG marker that has been |
612 * read from the data source, but has not yet been processed. |
649 * read from the data source, but has not yet been processed. |
613 */ |
650 */ |
834 #define jpeg_CreateDecompress jCreaDecompress |
871 #define jpeg_CreateDecompress jCreaDecompress |
835 #define jpeg_destroy_compress jDestCompress |
872 #define jpeg_destroy_compress jDestCompress |
836 #define jpeg_destroy_decompress jDestDecompress |
873 #define jpeg_destroy_decompress jDestDecompress |
837 #define jpeg_stdio_dest jStdDest |
874 #define jpeg_stdio_dest jStdDest |
838 #define jpeg_stdio_src jStdSrc |
875 #define jpeg_stdio_src jStdSrc |
|
876 #define jpeg_mem_dest jMemDest |
|
877 #define jpeg_mem_src jMemSrc |
839 #define jpeg_set_defaults jSetDefaults |
878 #define jpeg_set_defaults jSetDefaults |
840 #define jpeg_set_colorspace jSetColorspace |
879 #define jpeg_set_colorspace jSetColorspace |
841 #define jpeg_default_colorspace jDefColorspace |
880 #define jpeg_default_colorspace jDefColorspace |
842 #define jpeg_set_quality jSetQuality |
881 #define jpeg_set_quality jSetQuality |
843 #define jpeg_set_linear_quality jSetLQuality |
882 #define jpeg_set_linear_quality jSetLQuality |
|
883 #define jpeg_default_qtables jDefQTables |
844 #define jpeg_add_quant_table jAddQuantTable |
884 #define jpeg_add_quant_table jAddQuantTable |
845 #define jpeg_quality_scaling jQualityScaling |
885 #define jpeg_quality_scaling jQualityScaling |
846 #define jpeg_simple_progression jSimProgress |
886 #define jpeg_simple_progression jSimProgress |
847 #define jpeg_suppress_tables jSuppressTables |
887 #define jpeg_suppress_tables jSuppressTables |
848 #define jpeg_alloc_quant_table jAlcQTable |
888 #define jpeg_alloc_quant_table jAlcQTable |
849 #define jpeg_alloc_huff_table jAlcHTable |
889 #define jpeg_alloc_huff_table jAlcHTable |
850 #define jpeg_start_compress jStrtCompress |
890 #define jpeg_start_compress jStrtCompress |
851 #define jpeg_write_scanlines jWrtScanlines |
891 #define jpeg_write_scanlines jWrtScanlines |
852 #define jpeg_finish_compress jFinCompress |
892 #define jpeg_finish_compress jFinCompress |
|
893 #define jpeg_calc_jpeg_dimensions jCjpegDimensions |
853 #define jpeg_write_raw_data jWrtRawData |
894 #define jpeg_write_raw_data jWrtRawData |
854 #define jpeg_write_marker jWrtMarker |
895 #define jpeg_write_marker jWrtMarker |
855 #define jpeg_write_m_header jWrtMHeader |
896 #define jpeg_write_m_header jWrtMHeader |
856 #define jpeg_write_m_byte jWrtMByte |
897 #define jpeg_write_m_byte jWrtMByte |
857 #define jpeg_write_tables jWrtTables |
898 #define jpeg_write_tables jWrtTables |
864 #define jpeg_start_output jStrtOutput |
905 #define jpeg_start_output jStrtOutput |
865 #define jpeg_finish_output jFinOutput |
906 #define jpeg_finish_output jFinOutput |
866 #define jpeg_input_complete jInComplete |
907 #define jpeg_input_complete jInComplete |
867 #define jpeg_new_colormap jNewCMap |
908 #define jpeg_new_colormap jNewCMap |
868 #define jpeg_consume_input jConsumeInput |
909 #define jpeg_consume_input jConsumeInput |
|
910 #define jpeg_core_output_dimensions jCoreDimensions |
869 #define jpeg_calc_output_dimensions jCalcDimensions |
911 #define jpeg_calc_output_dimensions jCalcDimensions |
870 #define jpeg_save_markers jSaveMarkers |
912 #define jpeg_save_markers jSaveMarkers |
871 #define jpeg_set_marker_processor jSetMarker |
913 #define jpeg_set_marker_processor jSetMarker |
872 #define jpeg_read_coefficients jReadCoefs |
914 #define jpeg_read_coefficients jReadCoefs |
873 #define jpeg_write_coefficients jWrtCoefs |
915 #define jpeg_write_coefficients jWrtCoefs |
908 /* Standard data source and destination managers: stdio streams. */ |
950 /* Standard data source and destination managers: stdio streams. */ |
909 /* Caller is responsible for opening the file before and closing after. */ |
951 /* Caller is responsible for opening the file before and closing after. */ |
910 EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile)); |
952 EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile)); |
911 EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile)); |
953 EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile)); |
912 |
954 |
|
955 /* Data source and destination managers: memory buffers. */ |
|
956 EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo, |
|
957 unsigned char ** outbuffer, |
|
958 unsigned long * outsize)); |
|
959 EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo, |
|
960 unsigned char * inbuffer, |
|
961 unsigned long insize)); |
|
962 |
913 /* Default parameter setup for compression */ |
963 /* Default parameter setup for compression */ |
914 EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo)); |
964 EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo)); |
915 /* Compression parameter setup aids */ |
965 /* Compression parameter setup aids */ |
916 EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo, |
966 EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo, |
917 J_COLOR_SPACE colorspace)); |
967 J_COLOR_SPACE colorspace)); |
919 EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality, |
969 EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality, |
920 boolean force_baseline)); |
970 boolean force_baseline)); |
921 EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo, |
971 EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo, |
922 int scale_factor, |
972 int scale_factor, |
923 boolean force_baseline)); |
973 boolean force_baseline)); |
|
974 EXTERN(void) jpeg_default_qtables JPP((j_compress_ptr cinfo, |
|
975 boolean force_baseline)); |
924 EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl, |
976 EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl, |
925 const unsigned int *basic_table, |
977 const unsigned int *basic_table, |
926 int scale_factor, |
978 int scale_factor, |
927 boolean force_baseline)); |
979 boolean force_baseline)); |
928 EXTERN(int) jpeg_quality_scaling JPP((int quality)); |
980 EXTERN(int) jpeg_quality_scaling JPP((int quality)); |
938 EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo, |
990 EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo, |
939 JSAMPARRAY scanlines, |
991 JSAMPARRAY scanlines, |
940 JDIMENSION num_lines)); |
992 JDIMENSION num_lines)); |
941 EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo)); |
993 EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo)); |
942 |
994 |
|
995 /* Precalculate JPEG dimensions for current compression parameters. */ |
|
996 EXTERN(void) jpeg_calc_jpeg_dimensions JPP((j_compress_ptr cinfo)); |
|
997 |
943 /* Replaces jpeg_write_scanlines when writing raw downsampled data. */ |
998 /* Replaces jpeg_write_scanlines when writing raw downsampled data. */ |
944 EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo, |
999 EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo, |
945 JSAMPIMAGE data, |
1000 JSAMPIMAGE data, |
946 JDIMENSION num_lines)); |
1001 JDIMENSION num_lines)); |
947 |
1002 |
948 /* Write a special marker. See libjpeg.doc concerning safe usage. */ |
1003 /* Write a special marker. See libjpeg.txt concerning safe usage. */ |
949 EXTERN(void) jpeg_write_marker |
1004 EXTERN(void) jpeg_write_marker |
950 JPP((j_compress_ptr cinfo, int marker, |
1005 JPP((j_compress_ptr cinfo, int marker, |
951 const JOCTET * dataptr, unsigned int datalen)); |
1006 const JOCTET * dataptr, unsigned int datalen)); |
952 /* Same, but piecemeal. */ |
1007 /* Same, but piecemeal. */ |
953 EXTERN(void) jpeg_write_m_header |
1008 EXTERN(void) jpeg_write_m_header |
997 #define JPEG_REACHED_EOI 2 /* Reached end of image */ |
1052 #define JPEG_REACHED_EOI 2 /* Reached end of image */ |
998 #define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */ |
1053 #define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */ |
999 #define JPEG_SCAN_COMPLETED 4 /* Completed last iMCU row of a scan */ |
1054 #define JPEG_SCAN_COMPLETED 4 /* Completed last iMCU row of a scan */ |
1000 |
1055 |
1001 /* Precalculate output dimensions for current decompression parameters. */ |
1056 /* Precalculate output dimensions for current decompression parameters. */ |
|
1057 EXTERN(void) jpeg_core_output_dimensions JPP((j_decompress_ptr cinfo)); |
1002 EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo)); |
1058 EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo)); |
1003 |
1059 |
1004 /* Control saving of COM and APPn markers into marker_list. */ |
1060 /* Control saving of COM and APPn markers into marker_list. */ |
1005 EXTERN(void) jpeg_save_markers |
1061 EXTERN(void) jpeg_save_markers |
1006 JPP((j_decompress_ptr cinfo, int marker_code, |
1062 JPP((j_decompress_ptr cinfo, int marker_code, |