?? jpeglib.h
字號:
* It contains strings numbered first_addon_message..last_addon_message. */ const char * const * addon_message_table; /* Non-library errors */ int first_addon_message; /* code for first string in addon table */ int last_addon_message; /* code for last string in addon table */};/* Progress monitor object */struct jpeg_progress_mgr { JMETHOD(void, progress_monitor, (j_common_ptr cinfo)); long pass_counter; /* work units completed in this pass */ long pass_limit; /* total number of work units in this pass */ int completed_passes; /* passes completed so far */ int total_passes; /* total number of passes expected */};/* Data destination object for compression */struct jpeg_destination_mgr { JOCTET * next_output_byte; /* => next byte to write in buffer */ size_t free_in_buffer; /* # of byte spaces remaining 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));};/* Data source object for decompression */struct jpeg_source_mgr { const JOCTET * next_input_byte; /* => next byte to read from buffer */ size_t bytes_in_buffer; /* # of bytes remaining 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));};/* Memory manager object. * Allocates "small" objects (a few K total), "large" objects (tens of K), * and "really big" objects (virtual arrays with backing store if needed). * The memory manager does not allow individual objects to be freed; rather, * each created object is assigned to a pool, and whole pools can be freed * at once. This is faster and more convenient than remembering exactly what * to free, especially where malloc()/free() are not too speedy. * NB: alloc routines never return NULL. They exit to error_exit if not * successful. */#define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */#define JPOOL_IMAGE 1 /* lasts until done with image/datastream */#define JPOOL_NUMPOOLS 2typedef struct jvirt_sarray_control * jvirt_sarray_ptr;typedef struct jvirt_barray_control * jvirt_barray_ptr;struct jpeg_memory_mgr { /* Method pointers */ JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id, size_t sizeofobject)); JMETHOD(void *, 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)); /* Limit on memory allocation for this JPEG object. (Note that this is * merely advisory, not a guaranteed maximum; it only affects the space * used for virtual-array buffers.) May be changed by outer application * after creating the JPEG object. */ long max_memory_to_use;};/* Routine signature for application-supplied marker processing methods. * Need not pass marker code since it is stored in cinfo->unread_marker. */typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));/* Declarations for routines called by application. * The JPP macro hides prototype parameters from compilers that can't cope. * Note JPP requires double parentheses. */#define JPP(arglist) arglist/* Default error-management setup */EXTERN(struct jpeg_error_mgr *) jpeg_std_error JPP((struct jpeg_error_mgr * err));/* Initialization of JPEG compression objects. * jpeg_create_compress() and jpeg_create_decompress() are the exported * names that applications should call. These expand to calls on * jpeg_CreateCompress and jpeg_CreateDecompress with additional information * passed for version mismatch checking. * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx. */#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));/* Destruction of JPEG compression objects */EXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo));EXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo));/* Standard data source and destination managers: stdio streams. *//* Caller is responsible for opening the file before and closing after. */EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile));EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile));EXTERN(void) jpeg_memory_src JPP((j_decompress_ptr cinfo,char* ,int));/* Default parameter setup for compression */EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));/* Compression parameter setup aids */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_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));/* Main entry points for compression */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));/* Replaces jpeg_write_scanlines when writing raw downsampled data. */EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo, JSAMPIMAGE data, JDIMENSION num_lines));/* Write a special marker. See libjpeg.doc concerning safe usage. */EXTERN(void) jpeg_write_marker JPP((j_compress_ptr cinfo, int marker, const JOCTET * dataptr, unsigned int datalen));/* Alternate compression function: just write an abbreviated table file */EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo));/* Decompression startup: read start of JPEG datastream to see what's there */EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo, boolean require_image));/* Return value is one of: */#define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */#define JPEG_HEADER_OK 1 /* Found valid image datastream */#define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream *//* If you pass require_image = TRUE (normal case), you need not check for * a TABLES_ONLY return code; an abbreviated file will cause an error exit. * JPEG_SUSPENDED is only possible if you use a data source module that can * give a suspension return (the stdio source module doesn't). *//* Main entry points for decompression */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));/* Replaces jpeg_read_scanlines when reading raw downsampled data. */EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo, JSAMPIMAGE data, JDIMENSION max_lines));/* Additional entry points for buffered-image mode. */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));/* Return value is one of: *//* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */#define JPEG_REACHED_SOS 1 /* Reached start of new scan */#define JPEG_REACHED_EOI 2 /* Reached end of image */#define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */#define JPEG_SCAN_COMPLETED 4 /* Completed last iMCU row of a scan *//* Precalculate output dimensions for current decompression parameters. */EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo));/* Install a special processing method for COM or APPn markers. */EXTERN(void) jpeg_set_marker_processor JPP((j_decompress_ptr cinfo, int marker_code, jpeg_marker_parser_method routine));/* Read or write raw DCT coefficients --- useful for lossless transcoding. */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));/* If you choose to abort compression or decompression before completing * jpeg_finish_(de)compress, then you need to clean up to release memory, * temporary files, etc. You can just call jpeg_destroy_(de)compress * if you're done with the JPEG object, but if you want to clean it up and * reuse it, call this: */EXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo));EXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo));/* Generic versions of jpeg_abort and jpeg_destroy that work on either * flavor of JPEG object. These may be more convenient in some places. */EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo));EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo));/* Default restart-marker-resync procedure for use by data source modules */EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo, int desired));/* These marker codes are exported since applications and data source modules * are likely to want to use them. */#define JPEG_RST0 0xD0 /* RST0 marker code */#define JPEG_EOI 0xD9 /* EOI marker code */#define JPEG_APP0 0xE0 /* APP0 marker code */#define JPEG_COM 0xFE /* COM marker code *//* If we have a brain-damaged compiler that emits warnings (or worse, errors) * for structure definitions that are never filled in, keep it quiet by * supplying dummy definitions for the various substructures. */#ifdef INCOMPLETE_TYPES_BROKEN#ifndef JPEG_INTERNALS /* will be defined in jpegint.h */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 /* JPEG_INTERNALS */#endif /* INCOMPLETE_TYPES_BROKEN *//* * The JPEG library modules define JPEG_INTERNALS before including this file. * The internal structure declarations are read only when that is true. * Applications using the library should not include jpegint.h, but may wish * to include jerror.h. */#ifdef JPEG_INTERNALS#include "jpegint.h" /* fetch private declarations */#include "jpg.h" /* fetch error codes too */#endif#endif /* JPEGLIB_H */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -