Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../proc/self/root/usr/include
File: jpeglib.h
/*
[0] Fix | Delete
* jpeglib.h
[1] Fix | Delete
*
[2] Fix | Delete
* This file was part of the Independent JPEG Group's software:
[3] Fix | Delete
* Copyright (C) 1991-1998, Thomas G. Lane.
[4] Fix | Delete
* Modified 2002-2009 by Guido Vollbeding.
[5] Fix | Delete
* libjpeg-turbo Modifications:
[6] Fix | Delete
* Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander.
[7] Fix | Delete
* Copyright (C) 2015, Google, Inc.
[8] Fix | Delete
* For conditions of distribution and use, see the accompanying README.ijg
[9] Fix | Delete
* file.
[10] Fix | Delete
*
[11] Fix | Delete
* This file defines the application interface for the JPEG library.
[12] Fix | Delete
* Most applications using the library need only include this file,
[13] Fix | Delete
* and perhaps jerror.h if they want to know the exact error codes.
[14] Fix | Delete
*/
[15] Fix | Delete
[16] Fix | Delete
#ifndef JPEGLIB_H
[17] Fix | Delete
#define JPEGLIB_H
[18] Fix | Delete
[19] Fix | Delete
/*
[20] Fix | Delete
* First we include the configuration files that record how this
[21] Fix | Delete
* installation of the JPEG library is set up. jconfig.h can be
[22] Fix | Delete
* generated automatically for many systems. jmorecfg.h contains
[23] Fix | Delete
* manual configuration options that most people need not worry about.
[24] Fix | Delete
*/
[25] Fix | Delete
[26] Fix | Delete
#ifndef JCONFIG_INCLUDED /* in case jinclude.h already did */
[27] Fix | Delete
#include "jconfig.h" /* widely used configuration options */
[28] Fix | Delete
#endif
[29] Fix | Delete
#include "jmorecfg.h" /* seldom changed options */
[30] Fix | Delete
[31] Fix | Delete
[32] Fix | Delete
#ifdef __cplusplus
[33] Fix | Delete
#ifndef DONT_USE_EXTERN_C
[34] Fix | Delete
extern "C" {
[35] Fix | Delete
#endif
[36] Fix | Delete
#endif
[37] Fix | Delete
[38] Fix | Delete
[39] Fix | Delete
/* Various constants determining the sizes of things.
[40] Fix | Delete
* All of these are specified by the JPEG standard, so don't change them
[41] Fix | Delete
* if you want to be compatible.
[42] Fix | Delete
*/
[43] Fix | Delete
[44] Fix | Delete
#define DCTSIZE 8 /* The basic DCT block is 8x8 samples */
[45] Fix | Delete
#define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */
[46] Fix | Delete
#define NUM_QUANT_TBLS 4 /* Quantization tables are numbered 0..3 */
[47] Fix | Delete
#define NUM_HUFF_TBLS 4 /* Huffman tables are numbered 0..3 */
[48] Fix | Delete
#define NUM_ARITH_TBLS 16 /* Arith-coding tables are numbered 0..15 */
[49] Fix | Delete
#define MAX_COMPS_IN_SCAN 4 /* JPEG limit on # of components in one scan */
[50] Fix | Delete
#define MAX_SAMP_FACTOR 4 /* JPEG limit on sampling factors */
[51] Fix | Delete
/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard;
[52] Fix | Delete
* the PostScript DCT filter can emit files with many more than 10 blocks/MCU.
[53] Fix | Delete
* If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU
[54] Fix | Delete
* to handle it. We even let you do this from the jconfig.h file. However,
[55] Fix | Delete
* we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe
[56] Fix | Delete
* sometimes emits noncompliant files doesn't mean you should too.
[57] Fix | Delete
*/
[58] Fix | Delete
#define C_MAX_BLOCKS_IN_MCU 10 /* compressor's limit on blocks per MCU */
[59] Fix | Delete
#ifndef D_MAX_BLOCKS_IN_MCU
[60] Fix | Delete
#define D_MAX_BLOCKS_IN_MCU 10 /* decompressor's limit on blocks per MCU */
[61] Fix | Delete
#endif
[62] Fix | Delete
[63] Fix | Delete
[64] Fix | Delete
/* Data structures for images (arrays of samples and of DCT coefficients).
[65] Fix | Delete
*/
[66] Fix | Delete
[67] Fix | Delete
typedef JSAMPLE *JSAMPROW; /* ptr to one image row of pixel samples. */
[68] Fix | Delete
typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */
[69] Fix | Delete
typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */
[70] Fix | Delete
[71] Fix | Delete
typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */
[72] Fix | Delete
typedef JBLOCK *JBLOCKROW; /* pointer to one row of coefficient blocks */
[73] Fix | Delete
typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */
[74] Fix | Delete
typedef JBLOCKARRAY *JBLOCKIMAGE; /* a 3-D array of coefficient blocks */
[75] Fix | Delete
[76] Fix | Delete
typedef JCOEF *JCOEFPTR; /* useful in a couple of places */
[77] Fix | Delete
[78] Fix | Delete
[79] Fix | Delete
/* Types for JPEG compression parameters and working tables. */
[80] Fix | Delete
[81] Fix | Delete
[82] Fix | Delete
/* DCT coefficient quantization tables. */
[83] Fix | Delete
[84] Fix | Delete
typedef struct {
[85] Fix | Delete
/* This array gives the coefficient quantizers in natural array order
[86] Fix | Delete
* (not the zigzag order in which they are stored in a JPEG DQT marker).
[87] Fix | Delete
* CAUTION: IJG versions prior to v6a kept this array in zigzag order.
[88] Fix | Delete
*/
[89] Fix | Delete
UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */
[90] Fix | Delete
/* This field is used only during compression. It's initialized FALSE when
[91] Fix | Delete
* the table is created, and set TRUE when it's been output to the file.
[92] Fix | Delete
* You could suppress output of a table by setting this to TRUE.
[93] Fix | Delete
* (See jpeg_suppress_tables for an example.)
[94] Fix | Delete
*/
[95] Fix | Delete
boolean sent_table; /* TRUE when table has been output */
[96] Fix | Delete
} JQUANT_TBL;
[97] Fix | Delete
[98] Fix | Delete
[99] Fix | Delete
/* Huffman coding tables. */
[100] Fix | Delete
[101] Fix | Delete
typedef struct {
[102] Fix | Delete
/* These two fields directly represent the contents of a JPEG DHT marker */
[103] Fix | Delete
UINT8 bits[17]; /* bits[k] = # of symbols with codes of */
[104] Fix | Delete
/* length k bits; bits[0] is unused */
[105] Fix | Delete
UINT8 huffval[256]; /* The symbols, in order of incr code length */
[106] Fix | Delete
/* This field is used only during compression. It's initialized FALSE when
[107] Fix | Delete
* the table is created, and set TRUE when it's been output to the file.
[108] Fix | Delete
* You could suppress output of a table by setting this to TRUE.
[109] Fix | Delete
* (See jpeg_suppress_tables for an example.)
[110] Fix | Delete
*/
[111] Fix | Delete
boolean sent_table; /* TRUE when table has been output */
[112] Fix | Delete
} JHUFF_TBL;
[113] Fix | Delete
[114] Fix | Delete
[115] Fix | Delete
/* Basic info about one component (color channel). */
[116] Fix | Delete
[117] Fix | Delete
typedef struct {
[118] Fix | Delete
/* These values are fixed over the whole image. */
[119] Fix | Delete
/* For compression, they must be supplied by parameter setup; */
[120] Fix | Delete
/* for decompression, they are read from the SOF marker. */
[121] Fix | Delete
int component_id; /* identifier for this component (0..255) */
[122] Fix | Delete
int component_index; /* its index in SOF or cinfo->comp_info[] */
[123] Fix | Delete
int h_samp_factor; /* horizontal sampling factor (1..4) */
[124] Fix | Delete
int v_samp_factor; /* vertical sampling factor (1..4) */
[125] Fix | Delete
int quant_tbl_no; /* quantization table selector (0..3) */
[126] Fix | Delete
/* These values may vary between scans. */
[127] Fix | Delete
/* For compression, they must be supplied by parameter setup; */
[128] Fix | Delete
/* for decompression, they are read from the SOS marker. */
[129] Fix | Delete
/* The decompressor output side may not use these variables. */
[130] Fix | Delete
int dc_tbl_no; /* DC entropy table selector (0..3) */
[131] Fix | Delete
int ac_tbl_no; /* AC entropy table selector (0..3) */
[132] Fix | Delete
[133] Fix | Delete
/* Remaining fields should be treated as private by applications. */
[134] Fix | Delete
[135] Fix | Delete
/* These values are computed during compression or decompression startup: */
[136] Fix | Delete
/* Component's size in DCT blocks.
[137] Fix | Delete
* Any dummy blocks added to complete an MCU are not counted; therefore
[138] Fix | Delete
* these values do not depend on whether a scan is interleaved or not.
[139] Fix | Delete
*/
[140] Fix | Delete
JDIMENSION width_in_blocks;
[141] Fix | Delete
JDIMENSION height_in_blocks;
[142] Fix | Delete
/* Size of a DCT block in samples. Always DCTSIZE for compression.
[143] Fix | Delete
* For decompression this is the size of the output from one DCT block,
[144] Fix | Delete
* reflecting any scaling we choose to apply during the IDCT step.
[145] Fix | Delete
* Values from 1 to 16 are supported.
[146] Fix | Delete
* Note that different components may receive different IDCT scalings.
[147] Fix | Delete
*/
[148] Fix | Delete
#if JPEG_LIB_VERSION >= 70
[149] Fix | Delete
int DCT_h_scaled_size;
[150] Fix | Delete
int DCT_v_scaled_size;
[151] Fix | Delete
#else
[152] Fix | Delete
int DCT_scaled_size;
[153] Fix | Delete
#endif
[154] Fix | Delete
/* The downsampled dimensions are the component's actual, unpadded number
[155] Fix | Delete
* of samples at the main buffer (preprocessing/compression interface), thus
[156] Fix | Delete
* downsampled_width = ceil(image_width * Hi/Hmax)
[157] Fix | Delete
* and similarly for height. For decompression, IDCT scaling is included, so
[158] Fix | Delete
* downsampled_width = ceil(image_width * Hi/Hmax * DCT_[h_]scaled_size/DCTSIZE)
[159] Fix | Delete
*/
[160] Fix | Delete
JDIMENSION downsampled_width; /* actual width in samples */
[161] Fix | Delete
JDIMENSION downsampled_height; /* actual height in samples */
[162] Fix | Delete
/* This flag is used only for decompression. In cases where some of the
[163] Fix | Delete
* components will be ignored (eg grayscale output from YCbCr image),
[164] Fix | Delete
* we can skip most computations for the unused components.
[165] Fix | Delete
*/
[166] Fix | Delete
boolean component_needed; /* do we need the value of this component? */
[167] Fix | Delete
[168] Fix | Delete
/* These values are computed before starting a scan of the component. */
[169] Fix | Delete
/* The decompressor output side may not use these variables. */
[170] Fix | Delete
int MCU_width; /* number of blocks per MCU, horizontally */
[171] Fix | Delete
int MCU_height; /* number of blocks per MCU, vertically */
[172] Fix | Delete
int MCU_blocks; /* MCU_width * MCU_height */
[173] Fix | Delete
int MCU_sample_width; /* MCU width in samples, MCU_width*DCT_[h_]scaled_size */
[174] Fix | Delete
int last_col_width; /* # of non-dummy blocks across in last MCU */
[175] Fix | Delete
int last_row_height; /* # of non-dummy blocks down in last MCU */
[176] Fix | Delete
[177] Fix | Delete
/* Saved quantization table for component; NULL if none yet saved.
[178] Fix | Delete
* See jdinput.c comments about the need for this information.
[179] Fix | Delete
* This field is currently used only for decompression.
[180] Fix | Delete
*/
[181] Fix | Delete
JQUANT_TBL *quant_table;
[182] Fix | Delete
[183] Fix | Delete
/* Private per-component storage for DCT or IDCT subsystem. */
[184] Fix | Delete
void *dct_table;
[185] Fix | Delete
} jpeg_component_info;
[186] Fix | Delete
[187] Fix | Delete
[188] Fix | Delete
/* The script for encoding a multiple-scan file is an array of these: */
[189] Fix | Delete
[190] Fix | Delete
typedef struct {
[191] Fix | Delete
int comps_in_scan; /* number of components encoded in this scan */
[192] Fix | Delete
int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */
[193] Fix | Delete
int Ss, Se; /* progressive JPEG spectral selection parms */
[194] Fix | Delete
int Ah, Al; /* progressive JPEG successive approx. parms */
[195] Fix | Delete
} jpeg_scan_info;
[196] Fix | Delete
[197] Fix | Delete
/* The decompressor can save APPn and COM markers in a list of these: */
[198] Fix | Delete
[199] Fix | Delete
typedef struct jpeg_marker_struct *jpeg_saved_marker_ptr;
[200] Fix | Delete
[201] Fix | Delete
struct jpeg_marker_struct {
[202] Fix | Delete
jpeg_saved_marker_ptr next; /* next in list, or NULL */
[203] Fix | Delete
UINT8 marker; /* marker code: JPEG_COM, or JPEG_APP0+n */
[204] Fix | Delete
unsigned int original_length; /* # bytes of data in the file */
[205] Fix | Delete
unsigned int data_length; /* # bytes of data saved at data[] */
[206] Fix | Delete
JOCTET *data; /* the data contained in the marker */
[207] Fix | Delete
/* the marker length word is not counted in data_length or original_length */
[208] Fix | Delete
};
[209] Fix | Delete
[210] Fix | Delete
/* Known color spaces. */
[211] Fix | Delete
[212] Fix | Delete
#define JCS_EXTENSIONS 1
[213] Fix | Delete
#define JCS_ALPHA_EXTENSIONS 1
[214] Fix | Delete
[215] Fix | Delete
typedef enum {
[216] Fix | Delete
JCS_UNKNOWN, /* error/unspecified */
[217] Fix | Delete
JCS_GRAYSCALE, /* monochrome */
[218] Fix | Delete
JCS_RGB, /* red/green/blue as specified by the RGB_RED,
[219] Fix | Delete
RGB_GREEN, RGB_BLUE, and RGB_PIXELSIZE macros */
[220] Fix | Delete
JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */
[221] Fix | Delete
JCS_CMYK, /* C/M/Y/K */
[222] Fix | Delete
JCS_YCCK, /* Y/Cb/Cr/K */
[223] Fix | Delete
JCS_EXT_RGB, /* red/green/blue */
[224] Fix | Delete
JCS_EXT_RGBX, /* red/green/blue/x */
[225] Fix | Delete
JCS_EXT_BGR, /* blue/green/red */
[226] Fix | Delete
JCS_EXT_BGRX, /* blue/green/red/x */
[227] Fix | Delete
JCS_EXT_XBGR, /* x/blue/green/red */
[228] Fix | Delete
JCS_EXT_XRGB, /* x/red/green/blue */
[229] Fix | Delete
/* When out_color_space it set to JCS_EXT_RGBX, JCS_EXT_BGRX, JCS_EXT_XBGR,
[230] Fix | Delete
or JCS_EXT_XRGB during decompression, the X byte is undefined, and in
[231] Fix | Delete
order to ensure the best performance, libjpeg-turbo can set that byte to
[232] Fix | Delete
whatever value it wishes. Use the following colorspace constants to
[233] Fix | Delete
ensure that the X byte is set to 0xFF, so that it can be interpreted as an
[234] Fix | Delete
opaque alpha channel. */
[235] Fix | Delete
JCS_EXT_RGBA, /* red/green/blue/alpha */
[236] Fix | Delete
JCS_EXT_BGRA, /* blue/green/red/alpha */
[237] Fix | Delete
JCS_EXT_ABGR, /* alpha/blue/green/red */
[238] Fix | Delete
JCS_EXT_ARGB, /* alpha/red/green/blue */
[239] Fix | Delete
JCS_RGB565 /* 5-bit red/6-bit green/5-bit blue */
[240] Fix | Delete
} J_COLOR_SPACE;
[241] Fix | Delete
[242] Fix | Delete
/* DCT/IDCT algorithm options. */
[243] Fix | Delete
[244] Fix | Delete
typedef enum {
[245] Fix | Delete
JDCT_ISLOW, /* slow but accurate integer algorithm */
[246] Fix | Delete
JDCT_IFAST, /* faster, less accurate integer method */
[247] Fix | Delete
JDCT_FLOAT /* floating-point: accurate, fast on fast HW */
[248] Fix | Delete
} J_DCT_METHOD;
[249] Fix | Delete
[250] Fix | Delete
#ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */
[251] Fix | Delete
#define JDCT_DEFAULT JDCT_ISLOW
[252] Fix | Delete
#endif
[253] Fix | Delete
#ifndef JDCT_FASTEST /* may be overridden in jconfig.h */
[254] Fix | Delete
#define JDCT_FASTEST JDCT_IFAST
[255] Fix | Delete
#endif
[256] Fix | Delete
[257] Fix | Delete
/* Dithering options for decompression. */
[258] Fix | Delete
[259] Fix | Delete
typedef enum {
[260] Fix | Delete
JDITHER_NONE, /* no dithering */
[261] Fix | Delete
JDITHER_ORDERED, /* simple ordered dither */
[262] Fix | Delete
JDITHER_FS /* Floyd-Steinberg error diffusion dither */
[263] Fix | Delete
} J_DITHER_MODE;
[264] Fix | Delete
[265] Fix | Delete
[266] Fix | Delete
/* Common fields between JPEG compression and decompression master structs. */
[267] Fix | Delete
[268] Fix | Delete
#define jpeg_common_fields \
[269] Fix | Delete
struct jpeg_error_mgr *err; /* Error handler module */\
[270] Fix | Delete
struct jpeg_memory_mgr *mem; /* Memory manager module */\
[271] Fix | Delete
struct jpeg_progress_mgr *progress; /* Progress monitor, or NULL if none */\
[272] Fix | Delete
void *client_data; /* Available for use by application */\
[273] Fix | Delete
boolean is_decompressor; /* So common code can tell which is which */\
[274] Fix | Delete
int global_state /* For checking call sequence validity */
[275] Fix | Delete
[276] Fix | Delete
/* Routines that are to be used by both halves of the library are declared
[277] Fix | Delete
* to receive a pointer to this structure. There are no actual instances of
[278] Fix | Delete
* jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct.
[279] Fix | Delete
*/
[280] Fix | Delete
struct jpeg_common_struct {
[281] Fix | Delete
jpeg_common_fields; /* Fields common to both master struct types */
[282] Fix | Delete
/* Additional fields follow in an actual jpeg_compress_struct or
[283] Fix | Delete
* jpeg_decompress_struct. All three structs must agree on these
[284] Fix | Delete
* initial fields! (This would be a lot cleaner in C++.)
[285] Fix | Delete
*/
[286] Fix | Delete
};
[287] Fix | Delete
[288] Fix | Delete
typedef struct jpeg_common_struct *j_common_ptr;
[289] Fix | Delete
typedef struct jpeg_compress_struct *j_compress_ptr;
[290] Fix | Delete
typedef struct jpeg_decompress_struct *j_decompress_ptr;
[291] Fix | Delete
[292] Fix | Delete
[293] Fix | Delete
/* Master record for a compression instance */
[294] Fix | Delete
[295] Fix | Delete
struct jpeg_compress_struct {
[296] Fix | Delete
jpeg_common_fields; /* Fields shared with jpeg_decompress_struct */
[297] Fix | Delete
[298] Fix | Delete
/* Destination for compressed data */
[299] Fix | Delete
struct jpeg_destination_mgr *dest;
[300] Fix | Delete
[301] Fix | Delete
/* Description of source image --- these fields must be filled in by
[302] Fix | Delete
* outer application before starting compression. in_color_space must
[303] Fix | Delete
* be correct before you can even call jpeg_set_defaults().
[304] Fix | Delete
*/
[305] Fix | Delete
[306] Fix | Delete
JDIMENSION image_width; /* input image width */
[307] Fix | Delete
JDIMENSION image_height; /* input image height */
[308] Fix | Delete
int input_components; /* # of color components in input image */
[309] Fix | Delete
J_COLOR_SPACE in_color_space; /* colorspace of input image */
[310] Fix | Delete
[311] Fix | Delete
double input_gamma; /* image gamma of input image */
[312] Fix | Delete
[313] Fix | Delete
/* Compression parameters --- these fields must be set before calling
[314] Fix | Delete
* jpeg_start_compress(). We recommend calling jpeg_set_defaults() to
[315] Fix | Delete
* initialize everything to reasonable defaults, then changing anything
[316] Fix | Delete
* the application specifically wants to change. That way you won't get
[317] Fix | Delete
* burnt when new parameters are added. Also note that there are several
[318] Fix | Delete
* helper routines to simplify changing parameters.
[319] Fix | Delete
*/
[320] Fix | Delete
[321] Fix | Delete
#if JPEG_LIB_VERSION >= 70
[322] Fix | Delete
unsigned int scale_num, scale_denom; /* fraction by which to scale image */
[323] Fix | Delete
[324] Fix | Delete
JDIMENSION jpeg_width; /* scaled JPEG image width */
[325] Fix | Delete
JDIMENSION jpeg_height; /* scaled JPEG image height */
[326] Fix | Delete
/* Dimensions of actual JPEG image that will be written to file,
[327] Fix | Delete
* derived from input dimensions by scaling factors above.
[328] Fix | Delete
* These fields are computed by jpeg_start_compress().
[329] Fix | Delete
* You can also use jpeg_calc_jpeg_dimensions() to determine these values
[330] Fix | Delete
* in advance of calling jpeg_start_compress().
[331] Fix | Delete
*/
[332] Fix | Delete
#endif
[333] Fix | Delete
[334] Fix | Delete
int data_precision; /* bits of precision in image data */
[335] Fix | Delete
[336] Fix | Delete
int num_components; /* # of color components in JPEG image */
[337] Fix | Delete
J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
[338] Fix | Delete
[339] Fix | Delete
jpeg_component_info *comp_info;
[340] Fix | Delete
/* comp_info[i] describes component that appears i'th in SOF */
[341] Fix | Delete
[342] Fix | Delete
JQUANT_TBL *quant_tbl_ptrs[NUM_QUANT_TBLS];
[343] Fix | Delete
#if JPEG_LIB_VERSION >= 70
[344] Fix | Delete
int q_scale_factor[NUM_QUANT_TBLS];
[345] Fix | Delete
#endif
[346] Fix | Delete
/* ptrs to coefficient quantization tables, or NULL if not defined,
[347] Fix | Delete
* and corresponding scale factors (percentage, initialized 100).
[348] Fix | Delete
*/
[349] Fix | Delete
[350] Fix | Delete
JHUFF_TBL *dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
[351] Fix | Delete
JHUFF_TBL *ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
[352] Fix | Delete
/* ptrs to Huffman coding tables, or NULL if not defined */
[353] Fix | Delete
[354] Fix | Delete
UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
[355] Fix | Delete
UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
[356] Fix | Delete
UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
[357] Fix | Delete
[358] Fix | Delete
int num_scans; /* # of entries in scan_info array */
[359] Fix | Delete
const jpeg_scan_info *scan_info; /* script for multi-scan file, or NULL */
[360] Fix | Delete
/* The default value of scan_info is NULL, which causes a single-scan
[361] Fix | Delete
* sequential JPEG file to be emitted. To create a multi-scan file,
[362] Fix | Delete
* set num_scans and scan_info to point to an array of scan definitions.
[363] Fix | Delete
*/
[364] Fix | Delete
[365] Fix | Delete
boolean raw_data_in; /* TRUE=caller supplies downsampled data */
[366] Fix | Delete
boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */
[367] Fix | Delete
boolean optimize_coding; /* TRUE=optimize entropy encoding parms */
[368] Fix | Delete
boolean CCIR601_sampling; /* TRUE=first samples are cosited */
[369] Fix | Delete
#if JPEG_LIB_VERSION >= 70
[370] Fix | Delete
boolean do_fancy_downsampling; /* TRUE=apply fancy downsampling */
[371] Fix | Delete
#endif
[372] Fix | Delete
int smoothing_factor; /* 1..100, or 0 for no input smoothing */
[373] Fix | Delete
J_DCT_METHOD dct_method; /* DCT algorithm selector */
[374] Fix | Delete
[375] Fix | Delete
/* The restart interval can be specified in absolute MCUs by setting
[376] Fix | Delete
* restart_interval, or in MCU rows by setting restart_in_rows
[377] Fix | Delete
* (in which case the correct restart_interval will be figured
[378] Fix | Delete
* for each scan).
[379] Fix | Delete
*/
[380] Fix | Delete
unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */
[381] Fix | Delete
int restart_in_rows; /* if > 0, MCU rows per restart interval */
[382] Fix | Delete
[383] Fix | Delete
/* Parameters controlling emission of special markers. */
[384] Fix | Delete
[385] Fix | Delete
boolean write_JFIF_header; /* should a JFIF marker be written? */
[386] Fix | Delete
UINT8 JFIF_major_version; /* What to write for the JFIF version number */
[387] Fix | Delete
UINT8 JFIF_minor_version;
[388] Fix | Delete
/* These three values are not used by the JPEG code, merely copied */
[389] Fix | Delete
/* into the JFIF APP0 marker. density_unit can be 0 for unknown, */
[390] Fix | Delete
/* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */
[391] Fix | Delete
/* ratio is defined by X_density/Y_density even when density_unit=0. */
[392] Fix | Delete
UINT8 density_unit; /* JFIF code for pixel size units */
[393] Fix | Delete
UINT16 X_density; /* Horizontal pixel density */
[394] Fix | Delete
UINT16 Y_density; /* Vertical pixel density */
[395] Fix | Delete
boolean write_Adobe_marker; /* should an Adobe marker be written? */
[396] Fix | Delete
[397] Fix | Delete
/* State variable: index of next scanline to be written to
[398] Fix | Delete
* jpeg_write_scanlines(). Application may use this to control its
[399] Fix | Delete
* processing loop, e.g., "while (next_scanline < image_height)".
[400] Fix | Delete
*/
[401] Fix | Delete
[402] Fix | Delete
JDIMENSION next_scanline; /* 0 .. image_height-1 */
[403] Fix | Delete
[404] Fix | Delete
/* Remaining fields are known throughout compressor, but generally
[405] Fix | Delete
* should not be touched by a surrounding application.
[406] Fix | Delete
*/
[407] Fix | Delete
[408] Fix | Delete
/*
[409] Fix | Delete
* These fields are computed during compression startup
[410] Fix | Delete
*/
[411] Fix | Delete
boolean progressive_mode; /* TRUE if scan script uses progressive mode */
[412] Fix | Delete
int max_h_samp_factor; /* largest h_samp_factor */
[413] Fix | Delete
int max_v_samp_factor; /* largest v_samp_factor */
[414] Fix | Delete
[415] Fix | Delete
#if JPEG_LIB_VERSION >= 70
[416] Fix | Delete
int min_DCT_h_scaled_size; /* smallest DCT_h_scaled_size of any component */
[417] Fix | Delete
int min_DCT_v_scaled_size; /* smallest DCT_v_scaled_size of any component */
[418] Fix | Delete
#endif
[419] Fix | Delete
[420] Fix | Delete
JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */
[421] Fix | Delete
/* The coefficient controller receives data in units of MCU rows as defined
[422] Fix | Delete
* for fully interleaved scans (whether the JPEG file is interleaved or not).
[423] Fix | Delete
* There are v_samp_factor * DCTSIZE sample rows of each component in an
[424] Fix | Delete
* "iMCU" (interleaved MCU) row.
[425] Fix | Delete
*/
[426] Fix | Delete
[427] Fix | Delete
/*
[428] Fix | Delete
* These fields are valid during any one scan.
[429] Fix | Delete
* They describe the components and MCUs actually appearing in the scan.
[430] Fix | Delete
*/
[431] Fix | Delete
int comps_in_scan; /* # of JPEG components in this scan */
[432] Fix | Delete
jpeg_component_info *cur_comp_info[MAX_COMPS_IN_SCAN];
[433] Fix | Delete
/* *cur_comp_info[i] describes component that appears i'th in SOS */
[434] Fix | Delete
[435] Fix | Delete
JDIMENSION MCUs_per_row; /* # of MCUs across the image */
[436] Fix | Delete
JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
[437] Fix | Delete
[438] Fix | Delete
int blocks_in_MCU; /* # of DCT blocks per MCU */
[439] Fix | Delete
int MCU_membership[C_MAX_BLOCKS_IN_MCU];
[440] Fix | Delete
/* MCU_membership[i] is index in cur_comp_info of component owning */
[441] Fix | Delete
/* i'th block in an MCU */
[442] Fix | Delete
[443] Fix | Delete
int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */
[444] Fix | Delete
[445] Fix | Delete
#if JPEG_LIB_VERSION >= 80
[446] Fix | Delete
int block_size; /* the basic DCT block size: 1..16 */
[447] Fix | Delete
const int *natural_order; /* natural-order position array */
[448] Fix | Delete
int lim_Se; /* min( Se, DCTSIZE2-1 ) */
[449] Fix | Delete
#endif
[450] Fix | Delete
[451] Fix | Delete
/*
[452] Fix | Delete
* Links to compression subobjects (methods and private variables of modules)
[453] Fix | Delete
*/
[454] Fix | Delete
struct jpeg_comp_master *master;
[455] Fix | Delete
struct jpeg_c_main_controller *main;
[456] Fix | Delete
struct jpeg_c_prep_controller *prep;
[457] Fix | Delete
struct jpeg_c_coef_controller *coef;
[458] Fix | Delete
struct jpeg_marker_writer *marker;
[459] Fix | Delete
struct jpeg_color_converter *cconvert;
[460] Fix | Delete
struct jpeg_downsampler *downsample;
[461] Fix | Delete
struct jpeg_forward_dct *fdct;
[462] Fix | Delete
struct jpeg_entropy_encoder *entropy;
[463] Fix | Delete
jpeg_scan_info *script_space; /* workspace for jpeg_simple_progression */
[464] Fix | Delete
int script_space_size;
[465] Fix | Delete
};
[466] Fix | Delete
[467] Fix | Delete
[468] Fix | Delete
/* Master record for a decompression instance */
[469] Fix | Delete
[470] Fix | Delete
struct jpeg_decompress_struct {
[471] Fix | Delete
jpeg_common_fields; /* Fields shared with jpeg_compress_struct */
[472] Fix | Delete
[473] Fix | Delete
/* Source of compressed data */
[474] Fix | Delete
struct jpeg_source_mgr *src;
[475] Fix | Delete
[476] Fix | Delete
/* Basic description of image --- filled in by jpeg_read_header(). */
[477] Fix | Delete
/* Application may inspect these values to decide how to process image. */
[478] Fix | Delete
[479] Fix | Delete
JDIMENSION image_width; /* nominal image width (from SOF marker) */
[480] Fix | Delete
JDIMENSION image_height; /* nominal image height */
[481] Fix | Delete
int num_components; /* # of color components in JPEG image */
[482] Fix | Delete
J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
[483] Fix | Delete
[484] Fix | Delete
/* Decompression processing parameters --- these fields must be set before
[485] Fix | Delete
* calling jpeg_start_decompress(). Note that jpeg_read_header() initializes
[486] Fix | Delete
* them to default values.
[487] Fix | Delete
*/
[488] Fix | Delete
[489] Fix | Delete
J_COLOR_SPACE out_color_space; /* colorspace for output */
[490] Fix | Delete
[491] Fix | Delete
unsigned int scale_num, scale_denom; /* fraction by which to scale image */
[492] Fix | Delete
[493] Fix | Delete
double output_gamma; /* image gamma wanted in output */
[494] Fix | Delete
[495] Fix | Delete
boolean buffered_image; /* TRUE=multiple output passes */
[496] Fix | Delete
boolean raw_data_out; /* TRUE=downsampled data wanted */
[497] Fix | Delete
[498] Fix | Delete
J_DCT_METHOD dct_method; /* IDCT algorithm selector */
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function