📄 libjpeg.pas
字号:
* calling jpeg_start_decompress(). Note that jpeg_read_header() initializes * them to default values. *) out_color_space: J_COLOR_SPACE; (* colorspace for output *) scale_num, scale_denom: uint; (* fraction by which to scale image *) output_gamma: double; (* image gamma wanted in output *) buffered_image: boolean; (* TRUE=multiple output passes *) raw_data_out: boolean ; (* TRUE=downsampled data wanted *) dct_method: J_DCT_METHOD ; (* IDCT algorithm selector *) do_fancy_upsampling: boolean ; (* TRUE=apply fancy upsampling *) do_block_smoothing: boolean ; (* TRUE=apply interblock smoothing *) quantize_colors: boolean ; (* TRUE=colormapped output wanted *) (* the following are ignored if not quantize_colors: *) dither_mode: J_DITHER_MODE ; (* type of color dithering to use *) two_pass_quantize: boolean ; (* TRUE=use two-pass color quantization *) desired_number_of_colors: int ; (* max # colors to use in created colormap *) (* these are significant only in buffered-image mode: *) enable_1pass_quant: boolean ; (* enable future use of 1-pass quantizer *) enable_external_quant: boolean ;(* enable future use of external colormap *) enable_2pass_quant: boolean ; (* enable future use of 2-pass quantizer *) (* Description of actual output image that will be returned to application. * These fields are computed by jpeg_start_decompress(). * You can also use jpeg_calc_output_dimensions() to determine these values * in advance of calling jpeg_start_decompress(). *) output_width: JDIMENSION ; (* scaled image width *) output_height: JDIMENSION ; (* scaled image height *) out_color_components: int ; (* # of color components in out_color_space *) output_components: int ; (* # of color components returned *) (* output_components is 1 (a colormap index) when quantizing colors; * otherwise it equals out_color_components. *) rec_outbuf_height: int ; (* min recommended height of scanline buffer *) (* If the buffer passed to jpeg_read_scanlines() is less than this many rows * high, space and time will be wasted due to unnecessary data copying. * Usually rec_outbuf_height will be 1 or 2, at most 4. *) (* When quantizing colors, the output colormap is described by these fields. * The application can supply a colormap by setting colormap non-NULL before * calling jpeg_start_decompress; otherwise a colormap is created during * jpeg_start_decompress or jpeg_start_output. * The map has out_color_components rows and actual_number_of_colors columns. *) actual_number_of_colors: int ; (* number of entries in use *) colormap: JSAMPARRAY ; (* The color map as a 2-D pixel array *) (* State variables: these variables indicate the progress of decompression. * The application may examine these but must not modify them. *) (* Row index of next scanline to be read from jpeg_read_scanlines(). * Application may use this to control its processing loop, e.g., * "while (output_scanline < output_height)". *) output_scanline: JDIMENSION ; (* 0 .. output_height-1 *) (* Current input scan number and number of iMCU rows completed in scan. * These indicate the progress of the decompressor input side. *) input_scan_number: int ; (* Number of SOS markers seen so far *) input_iMCU_row: JDIMENSION ; (* Number of iMCU rows completed *) (* The "output scan number" is the notional scan being displayed by the * output side. The decompressor will not allow output scan/row number * to get ahead of input scan/row, but it can fall arbitrarily far behind. *) output_scan_number: int ; (* Nominal scan number being displayed *) output_iMCU_row: JDIMENSION ; (* Number of iMCU rows read *) (* Current progression status. coef_bits[c][i] indicates the precision * with which component c's DCT coefficient i (in zigzag order) is known. * It is -1 when no data has yet been received, otherwise it is the point * transform (shift) value for the most recent scan of the coefficient * (thus, 0 at completion of the progression). * This pointer is NULL when reading a non-progressive file. *) coef_bits: pcoef_bits; (* -1 or current Al value for each coef *) (* Internal JPEG parameters --- the application usually need not look at * these fields. Note that the decompressor output side may not use * any parameters that can change between scans. *) (* Quantization and Huffman tables are carried forward across input * datastreams when processing abbreviated JPEG datastreams. *) quant_tbl_ptrs: array [0..NUM_QUANT_TBLS-1] of PJQUANT_TBL; (* ptrs to coefficient quantization tables, or NULL if not defined *) dc_huff_tbl_ptrs: array [0..NUM_HUFF_TBLS-1] of PJHUFF_TBL; ac_huff_tbl_ptrs: array [0..NUM_HUFF_TBLS-1] of PJHUFF_TBL; (* ptrs to Huffman coding tables, or NULL if not defined *) (* These parameters are never carried across datastreams, since they * are given in SOF/SOS markers or defined to be reset by SOI. *) data_precision: int ; (* bits of precision in image data *) comp_info: pjpeg_component_info; (* comp_info[i] describes component that appears i'th in SOF *) progressive_mode: boolean ; (* TRUE if SOFn specifies progressive mode *) arith_code: boolean ; (* TRUE=arithmetic coding, FALSE=Huffman *) arith_dc_L: array [0..NUM_ARITH_TBLS-1] of UINT8; (* L values for DC arith-coding tables *) arith_dc_U: array [0..NUM_ARITH_TBLS-1] of UINT8; (* U values for DC arith-coding tables *) arith_ac_K: array [0..NUM_ARITH_TBLS-1] of UINT8; (* Kx values for AC arith-coding tables *) restart_interval: uint ; (* MCUs per restart interval, or 0 for no restart *) (* These fields record data obtained from optional markers recognized by * the JPEG library. *) saw_JFIF_marker: boolean ; (* TRUE iff a JFIF APP0 marker was found *) (* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: *) JFIF_major_version: UINT8 ; (* JFIF version number *) JFIF_minor_version: UINT8 ; density_unit: UINT8 ; (* JFIF code for pixel size units *) X_density: UINT16 ; (* Horizontal pixel density *) Y_density: UINT16 ; (* Vertical pixel density *) saw_Adobe_marker: boolean ; (* TRUE iff an Adobe APP14 marker was found *) Adobe_transform: UINT8 ; (* Color transform code from Adobe marker *) CCIR601_sampling: boolean ; (* TRUE=first samples are cosited *) (* Aside from the specific data retained from APPn markers known to the * library, the uninterpreted contents of any or all APPn and COM markers * can be saved in a list for examination by the application. *) marker_list: jpeg_saved_marker_ptr ; (* Head of list of saved markers *) (* Remaining fields are known throughout decompressor, but generally * should not be touched by a surrounding application. *) (* * These fields are computed during decompression startup *) max_h_samp_factor: int ; (* largest h_samp_factor *) max_v_samp_factor: int ; (* largest v_samp_factor *) min_DCT_scaled_size: int ; (* smallest DCT_scaled_size of any component *) total_iMCU_rows: JDIMENSION ; (* # of iMCU rows in image *) (* The coefficient controller's input and output progress is measured in * units of "iMCU" (interleaved MCU) rows. These are the same as MCU rows * in fully interleaved JPEG scans, but are used whether the scan is * interleaved or not. We define an iMCU row as v_samp_factor DCT block * rows of each component. Therefore, the IDCT output contains * v_samp_factor*DCT_scaled_size sample rows of a component per iMCU row. *) sample_range_limit: PJSAMPLE; (* table for fast range-limiting *) (* * These fields are valid during any one scan. * They describe the components and MCUs actually appearing in the scan. * Note that the decompressor output side must not use these fields. *) comps_in_scan: int ; (* # of JPEG components in this scan *) cur_comp_info: array [0..MAX_COMPS_IN_SCAN-1] of pjpeg_component_info; (* *cur_comp_info[i] describes component that appears i'th in SOS *) MCUs_per_row: JDIMENSION ; (* # of MCUs across the image *) MCU_rows_in_scan: JDIMENSION ; (* # of MCU rows in the image *) blocks_in_MCU: int ; (* # of DCT blocks per MCU *) MCU_membership: array [0..D_MAX_BLOCKS_IN_MCU-1] of int; (* MCU_membership[i] is index in cur_comp_info of component owning *) (* i'th block in an MCU *) Ss, Se, Ah, Al: int; (* progressive JPEG parameters for scan *) (* This field is shared between entropy decoder and marker parser. * It is either zero or the code of a JPEG marker that has been * read from the data source, but has not yet been processed. *) unread_marker: int ; (* * Links to decompression subobjects (methods, private variables of modules) *) master: pjpeg_decomp_master; main: pjpeg_d_main_controller; coef: pjpeg_d_coef_controller; post: pjpeg_d_post_controller; inputctl: pjpeg_input_controller; marker: pjpeg_marker_reader; entropy: pjpeg_entropy_decoder; idct: pjpeg_inverse_dct; upsample: pjpeg_upsampler; cconvert: pjpeg_color_deconverter; cquantize: pjpeg_color_quantizer; end; pjpeg_compress_struct = ^jpeg_compress_struct; jpeg_compress_struct = record
err: pjpeg_error_mgr; (* Error handler module *) mem: pjpeg_memory_mgr; (* Memory manager module *)
progress: pjpeg_progress_mgr; (* Progress monitor, or NULL if none *) client_data: Pointer; (* Available for use by application *) is_decompressor: Boolean; (* So common code can tell which is which *) global_state: int; (* For checking call sequence validity *)
(* Destination for compressed data *) dest: pjpeg_destination_mgr; (* Description of source image --- these fields must be filled in by * outer application before starting compression. in_color_space must * be correct before you can even call jpeg_set_defaults(). *) image_width: JDIMENSION; (* input image width *) image_height: JDIMENSION; (* input image height *) input_components: int; (* # of color components in input image *) in_color_space: J_COLOR_SPACE; (* colorspace of input image *) input_gamma: double; (* image gamma of input image *) (* Compression parameters --- these fields must be set before calling * jpeg_start_compress(). We recommend calling jpeg_set_defaults() to * initialize everything to reasonable defaults, then changing anything * the application specifically wants to change. That way you won't get * burnt when new parameters are added. Also note that there are several * helper routines to simplify changing parameters. *) data_precision: int; (* bits of precision in image data *) num_components: int; (* # of color components in JPEG image *) jpeg_color_space: J_COLOR_SPACE; (* colorspace of JPEG image *) comp_info: pjpeg_component_info; (* comp_info[i] describes component that appears i'th in SOF *) quant_tbl_ptrs: array [0..NUM_QUANT_TBLS-1] of PJQUANT_TBL; (* ptrs to coefficient quantization tables, or NULL if not defined *) dc_huff_tbl_ptrs: array [0..NUM_HUFF_TBLS-1] of PJHUFF_TBL; ac_huff_tbl_ptrs: array [0..NUM_HUFF_TBLS-1] of PJHUFF_TBL; (* ptrs to Huffman coding tables, or NULL if not defined *) arith_dc_L: array [0..NUM_ARITH_TBLS-1] of UINT8; (* L values for DC arith-coding tables *) arith_dc_U: array [0..NUM_ARITH_TBLS-1] of UINT8; (* U values for DC arith-coding tables *) arith_ac_K: array [0..NUM_ARITH_TBLS-1] of UINT8; (* Kx values for AC arith-coding tables *) num_scans: int; (* # of entries in scan_info array *) scan_info: pjpeg_scan_info; (* script for multi-scan file, or NULL *) (* The default value of scan_info is NULL, which causes a single-scan * sequential JPEG file to be emitted. To create a multi-scan file, * set num_scans and scan_info to point to an array of scan definitions. *) raw_data_in: boolean; (* TRUE=caller supplies downsampled data *) arith_code: boolean; (* TRUE=arithmetic coding, FALSE=Huffman *) optimize_coding: boolean; (* TRUE=optimize entropy encoding parms *) CCIR601_sampling: boolean; (* TRUE=first samples are cosited *) smoothing_factor: int; (* 1..100, or 0 for no input smoothing *) dct_method: J_DCT_METHOD; (* DCT algorithm selector *) (* The restart interval can be specified in absolute MCUs by setting
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -