24 #ifndef JCONFIG_INCLUDED
25 #include "../jpeg-6/jconfig.h"
27 #include "../jpeg-6/jmorecfg.h"
34 #define JPEG_LIB_VERSION 60
44 #define NUM_QUANT_TBLS 4
45 #define NUM_HUFF_TBLS 4
46 #define NUM_ARITH_TBLS 16
47 #define MAX_COMPS_IN_SCAN 4
48 #define MAX_SAMP_FACTOR 4
56 #define C_MAX_BLOCKS_IN_MCU 10
57 #ifndef D_MAX_BLOCKS_IN_MCU
58 #define D_MAX_BLOCKS_IN_MCU 10
67 #ifdef HAVE_PROTOTYPES
68 #define JMETHOD(type,methodname,arglist) type (*methodname) arglist
70 #define JMETHOD(type,methodname,arglist) type (*methodname) ()
224 #define JDCT_DEFAULT JDCT_ISLOW
227 #define JDCT_FASTEST JDCT_IFAST
241 #define jpeg_common_fields \
242 struct jpeg_error_mgr * err; \
243 struct jpeg_memory_mgr * mem; \
244 struct jpeg_progress_mgr * progress; \
245 boolean is_decompressor; \
639 #define JMSG_LENGTH_MAX 200
647 #define JMSG_STR_PARM_MAX 80
689 JMETHOD(
void, progress_monitor, (j_common_ptr cinfo));
719 JMETHOD(
boolean, resync_to_restart, (j_decompress_ptr cinfo,
int desired));
735 #define JPOOL_PERMANENT 0
736 #define JPOOL_IMAGE 1
737 #define JPOOL_NUMPOOLS 2
746 size_t sizeofobject));
748 size_t sizeofobject));
769 jvirt_sarray_ptr ptr,
774 jvirt_barray_ptr ptr,
793 typedef JMETHOD(
boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));
801 #ifdef HAVE_PROTOTYPES
802 #define JPP(arglist) arglist
804 #define JPP(arglist) ()
815 #ifdef NEED_SHORT_EXTERNAL_NAMES
816 #define jpeg_std_error jStdError
817 #define jpeg_create_compress jCreaCompress
818 #define jpeg_create_decompress jCreaDecompress
819 #define jpeg_destroy_compress jDestCompress
820 #define jpeg_destroy_decompress jDestDecompress
821 #define jpeg_stdio_dest jStdDest
822 #define jpeg_stdio_src jStdSrc
823 #define jpeg_set_defaults jSetDefaults
824 #define jpeg_set_colorspace jSetColorspace
825 #define jpeg_default_colorspace jDefColorspace
826 #define jpeg_set_quality jSetQuality
827 #define jpeg_set_linear_quality jSetLQuality
828 #define jpeg_add_quant_table jAddQuantTable
829 #define jpeg_quality_scaling jQualityScaling
830 #define jpeg_simple_progression jSimProgress
831 #define jpeg_suppress_tables jSuppressTables
832 #define jpeg_alloc_quant_table jAlcQTable
833 #define jpeg_alloc_huff_table jAlcHTable
834 #define jpeg_start_compress jStrtCompress
835 #define jpeg_write_scanlines jWrtScanlines
836 #define jpeg_finish_compress jFinCompress
837 #define jpeg_write_raw_data jWrtRawData
838 #define jpeg_write_marker jWrtMarker
839 #define jpeg_write_tables jWrtTables
840 #define jpeg_read_header jReadHeader
841 #define jpeg_start_decompress jStrtDecompress
842 #define jpeg_read_scanlines jReadScanlines
843 #define jpeg_finish_decompress jFinDecompress
844 #define jpeg_read_raw_data jReadRawData
845 #define jpeg_has_multiple_scans jHasMultScn
846 #define jpeg_start_output jStrtOutput
847 #define jpeg_finish_output jFinOutput
848 #define jpeg_input_complete jInComplete
849 #define jpeg_new_colormap jNewCMap
850 #define jpeg_consume_input jConsumeInput
851 #define jpeg_calc_output_dimensions jCalcDimensions
852 #define jpeg_set_marker_processor jSetMarker
853 #define jpeg_read_coefficients jReadCoefs
854 #define jpeg_write_coefficients jWrtCoefs
855 #define jpeg_copy_critical_parameters jCopyCrit
856 #define jpeg_abort_compress jAbrtCompress
857 #define jpeg_abort_decompress jAbrtDecompress
858 #define jpeg_abort jAbort
859 #define jpeg_destroy jDestroy
860 #define jpeg_resync_to_restart jResyncRestart
886 boolean force_baseline));
889 boolean force_baseline));
891 const unsigned int *basic_table,
893 boolean force_baseline));
903 boolean write_all_tables));
916 const JOCTET *dataptr,
unsigned int datalen));
923 boolean require_image));
925 #define JPEG_SUSPENDED 0
926 #define JPEG_HEADER_OK 1
927 #define JPEG_HEADER_TABLES_ONLY 2
948 EXTERN boolean jpeg_start_output
JPP((j_decompress_ptr cinfo,
950 EXTERN boolean jpeg_finish_output
JPP((j_decompress_ptr cinfo));
952 EXTERN void jpeg_new_colormap
JPP((j_decompress_ptr cinfo));
956 #define JPEG_REACHED_SOS 1
957 #define JPEG_REACHED_EOI 2
958 #define JPEG_ROW_COMPLETED 3
959 #define JPEG_SCAN_COMPLETED 4
967 jpeg_marker_parser_method routine));
972 jvirt_barray_ptr * coef_arrays));
974 j_compress_ptr dstinfo));
1000 #define JPEG_RST0 0xD0
1001 #define JPEG_EOI 0xD9
1002 #define JPEG_APP0 0xE0
1003 #define JPEG_COM 0xFE
1011 #ifdef INCOMPLETE_TYPES_BROKEN
1012 #ifndef JPEG_INTERNALS
1046 #ifdef JPEG_INTERNALS
1047 #include "../jpeg-6/jpegint.h"
1048 #include "../jpeg-6/jerror.h"
boolean write_Adobe_marker
METHODDEF void emit_message(j_common_ptr cinfo, int msg_level)
struct jpeg_c_prep_controller * prep
boolean do_block_smoothing
struct jpeg_decompress_struct * j_decompress_ptr
UINT8 arith_ac_K[NUM_ARITH_TBLS]
METHODDEF void FAR * alloc_large(j_common_ptr cinfo, int pool_id, size_t sizeofobject)
JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]
JDIMENSION downsampled_width
jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]
METHODDEF void term_destination(j_compress_ptr cinfo)
struct jpeg_forward_dct * fdct
GLOBAL void jpeg_start_compress(j_compress_ptr cinfo, boolean write_all_tables)
GLOBAL boolean jpeg_start_decompress(j_decompress_ptr cinfo)
METHODDEF void term_source(j_decompress_ptr cinfo)
struct jpeg_d_post_controller * post
J_COLOR_SPACE jpeg_color_space
struct jpeg_input_controller * inputctl
jpeg_component_info * comp_info
struct jpeg_d_main_controller * main
JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]
UINT8 arith_dc_U[NUM_ARITH_TBLS]
boolean do_fancy_upsampling
boolean enable_2pass_quant
struct jpeg_common_struct * j_common_ptr
const jpeg_scan_info * scan_info
struct jpeg_marker_reader * marker
struct jpeg_d_coef_controller * coef
METHODDEF void self_destruct(j_common_ptr cinfo)
GLOBAL JHUFF_TBL * jpeg_alloc_huff_table(j_common_ptr cinfo)
struct jpeg_color_converter * cconvert
boolean enable_external_quant
const char *const * addon_message_table
GLOBAL void jpeg_suppress_tables(j_compress_ptr cinfo, boolean suppress)
GLOBAL void jpeg_write_marker(j_compress_ptr cinfo, int marker, const JOCTET *dataptr, unsigned int datalen)
JMETHOD(void, error_exit,(j_common_ptr cinfo))
JMETHOD(void *, alloc_small,(j_common_ptr cinfo, int pool_id, size_t sizeofobject))
struct jpeg_compress_struct * j_compress_ptr
JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]
int desired_number_of_colors
JDIMENSION MCU_rows_in_scan
GLOBAL void jpeg_set_linear_quality(j_compress_ptr cinfo, int scale_factor, boolean force_baseline)
struct jpeg_entropy_encoder * entropy
METHODDEF void output_message(j_common_ptr cinfo)
boolean write_JFIF_header
METHODDEF void init_source(j_decompress_ptr cinfo)
UINT8 arith_dc_L[NUM_ARITH_TBLS]
GLOBAL void jpeg_stdio_dest(j_compress_ptr cinfo, FILE *outfile)
J_COLOR_SPACE in_color_space
JDIMENSION width_in_blocks
boolean two_pass_quantize
METHODDEF boolean empty_output_buffer(j_compress_ptr cinfo)
J_COLOR_SPACE out_color_space
METHODDEF JBLOCKARRAY access_virt_barray(j_common_ptr cinfo, jvirt_barray_ptr ptr, JDIMENSION start_row, JDIMENSION num_rows, boolean writable)
int MCU_membership[C_MAX_BLOCKS_IN_MCU]
UINT8 arith_ac_K[NUM_ARITH_TBLS]
JDIMENSION height_in_blocks
GLOBAL void jpeg_create_decompress(j_decompress_ptr cinfo)
GLOBAL void jpeg_destroy(j_common_ptr cinfo)
union jpeg_error_mgr::@90 msg_parm
GLOBAL JDIMENSION jpeg_read_scanlines(j_decompress_ptr cinfo, JSAMPARRAY scanlines, JDIMENSION max_lines)
struct jpeg_c_coef_controller * coef
JBLOCKARRAY * JBLOCKIMAGE
GLOBAL boolean jpeg_input_complete(j_decompress_ptr cinfo)
JDIMENSION total_iMCU_rows
METHODDEF void realize_virt_arrays(j_common_ptr cinfo)
JSAMPLE * sample_range_limit
METHODDEF JSAMPARRAY alloc_sarray(j_common_ptr cinfo, int pool_id, JDIMENSION samplesperrow, JDIMENSION numrows)
GLOBAL void jpeg_finish_compress(j_compress_ptr cinfo)
unsigned int restart_interval
struct jpeg_color_quantizer * cquantize
METHODDEF jvirt_barray_ptr request_virt_barray(j_common_ptr cinfo, int pool_id, boolean pre_zero, JDIMENSION blocksperrow, JDIMENSION numrows, JDIMENSION maxaccess)
GLsizei GLsizei GLenum GLenum const GLvoid * data
UINT8 arith_dc_U[NUM_ARITH_TBLS]
#define C_MAX_BLOCKS_IN_MCU
METHODDEF JBLOCKARRAY alloc_barray(j_common_ptr cinfo, int pool_id, JDIMENSION blocksperrow, JDIMENSION numrows)
struct jpeg_destination_mgr * dest
struct jpeg_marker_writer * marker
struct jpeg_downsampler * downsample
GLOBAL void jpeg_abort_decompress(j_decompress_ptr cinfo)
METHODDEF void free_pool(j_common_ptr cinfo, int pool_id)
GLOBAL void jpeg_set_colorspace(j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
JMETHOD(void, progress_monitor,(j_common_ptr cinfo))
struct jpeg_decomp_master * master
METHODDEF void error_exit(j_common_ptr cinfo)
struct jpeg_c_main_controller * main
GLOBAL void jpeg_default_colorspace(j_compress_ptr cinfo)
METHODDEF void reset_error_mgr(j_common_ptr cinfo)
boolean enable_1pass_quant
J_DITHER_MODE dither_mode
GLOBAL void jpeg_set_quality(j_compress_ptr cinfo, int quality, boolean force_baseline)
unsigned int restart_interval
GLOBAL JDIMENSION jpeg_read_raw_data(j_decompress_ptr cinfo, JSAMPIMAGE data, JDIMENSION max_lines)
#define JMETHOD(type, methodname, arglist)
struct jpeg_color_deconverter * cconvert
GLOBAL boolean jpeg_finish_decompress(j_decompress_ptr cinfo)
#define JMSG_STR_PARM_MAX
METHODDEF void format_message(j_common_ptr cinfo, char *buffer)
JDIMENSION MCU_rows_in_scan
JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]
struct jvirt_barray_control * jvirt_barray_ptr
struct jpeg_source_mgr * src
JDIMENSION output_scanline
static WindowRef ValidModeCallbackProc inCallback OSStatus err
METHODDEF void init_destination(j_compress_ptr cinfo)
GLOBAL void jpeg_destroy_decompress(j_decompress_ptr cinfo)
JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]
#define D_MAX_BLOCKS_IN_MCU
METHODDEF jvirt_sarray_ptr request_virt_sarray(j_common_ptr cinfo, int pool_id, boolean pre_zero, JDIMENSION samplesperrow, JDIMENSION numrows, JDIMENSION maxaccess)
METHODDEF JSAMPARRAY access_virt_sarray(j_common_ptr cinfo, jvirt_sarray_ptr ptr, JDIMENSION start_row, JDIMENSION num_rows, boolean writable)
GLOBAL void jpeg_add_quant_table(j_compress_ptr cinfo, int which_tbl, const unsigned int *basic_table, int scale_factor, boolean force_baseline)
const char *const * jpeg_message_table
GLOBAL JDIMENSION jpeg_write_scanlines(j_compress_ptr cinfo, JSAMPARRAY scanlines, JDIMENSION num_lines)
GLOBAL void jpeg_create_compress(j_compress_ptr cinfo)
JDIMENSION input_iMCU_row
GLOBAL int jpeg_quality_scaling(int quality)
struct jpeg_upsampler * upsample
METHODDEF void * alloc_small(j_common_ptr cinfo, int pool_id, size_t sizeofobject)
jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]
GLOBAL boolean jpeg_resync_to_restart(j_decompress_ptr cinfo, int desired)
GLOBAL void jpeg_abort(j_common_ptr cinfo)
int MCU_membership[D_MAX_BLOCKS_IN_MCU]
METHODDEF void skip_input_data(j_decompress_ptr cinfo, long num_bytes)
GLOBAL struct jpeg_error_mgr * jpeg_std_error(struct jpeg_error_mgr *err)
JMETHOD(void, init_source,(j_decompress_ptr cinfo))
JMETHOD(void, init_destination,(j_compress_ptr cinfo))
UINT8 arith_dc_L[NUM_ARITH_TBLS]
JDIMENSION output_iMCU_row
METHODDEF boolean fill_input_buffer(j_decompress_ptr cinfo)
GLOBAL JQUANT_TBL * jpeg_alloc_quant_table(j_common_ptr cinfo)
GLOBAL jvirt_barray_ptr * jpeg_read_coefficients(j_decompress_ptr cinfo)
GLOBAL void jpeg_destroy_compress(j_compress_ptr cinfo)
int(* coef_bits)[DCTSIZE2]
GLOBAL void jpeg_write_coefficients(j_compress_ptr cinfo, jvirt_barray_ptr *coef_arrays)
GLOBAL void jpeg_set_marker_processor(j_decompress_ptr cinfo, int marker_code, jpeg_marker_parser_method routine)
GLOBAL void jpeg_set_defaults(j_compress_ptr cinfo)
GLOBAL void jpeg_copy_critical_parameters(j_decompress_ptr srcinfo, j_compress_ptr dstinfo)
const JOCTET * next_input_byte
GLOBAL boolean jpeg_has_multiple_scans(j_decompress_ptr cinfo)
struct jpeg_inverse_dct * idct
GLOBAL int jpeg_read_header(j_decompress_ptr cinfo, boolean require_image)
JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]
JOCTET * next_output_byte
struct jpeg_entropy_decoder * entropy
GLOBAL void jpeg_calc_output_dimensions(j_decompress_ptr cinfo)
JDIMENSION total_iMCU_rows
GLOBAL void jpeg_stdio_src(j_decompress_ptr cinfo, unsigned char *infile)
GLOBAL void jpeg_abort_compress(j_compress_ptr cinfo)
GLOBAL JDIMENSION jpeg_write_raw_data(j_compress_ptr cinfo, JSAMPIMAGE data, JDIMENSION num_lines)
GLOBAL void jpeg_simple_progression(j_compress_ptr cinfo)
GLOBAL void jpeg_write_tables(j_compress_ptr cinfo)
struct jvirt_sarray_control * jvirt_sarray_ptr
#define MAX_COMPS_IN_SCAN
jpeg_component_info * comp_info
struct jpeg_comp_master * master
J_COLOR_SPACE jpeg_color_space
JDIMENSION downsampled_height
GLOBAL int jpeg_consume_input(j_decompress_ptr cinfo)
int actual_number_of_colors