File indexing completed on 2024-05-18 08:30:03
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #ifndef JMESSAGE
0023 #ifndef JERROR_H
0024
0025 #define JMAKE_ENUM_LIST
0026 #else
0027
0028 #define JMESSAGE(code,string)
0029 #endif
0030 #endif
0031
0032 #ifdef JMAKE_ENUM_LIST
0033
0034 typedef enum {
0035
0036 #define JMESSAGE(code,string) code ,
0037
0038 #endif
0039
0040 JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d")
0041
0042
0043 JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix")
0044 JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix")
0045 JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode")
0046 JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS")
0047 JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request")
0048 JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range")
0049 JMESSAGE(JERR_BAD_DCTSIZE, "DCT scaled block size %dx%d not supported")
0050 JMESSAGE(JERR_BAD_DROP_SAMPLING,
0051 "Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c")
0052 JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition")
0053 JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace")
0054 JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace")
0055 JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length")
0056 JMESSAGE(JERR_BAD_LIB_VERSION,
0057 "Wrong JPEG library version: library is %d, caller expects %d")
0058 JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan")
0059 JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d")
0060 JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d")
0061 JMESSAGE(JERR_BAD_PROGRESSION,
0062 "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d")
0063 JMESSAGE(JERR_BAD_PROG_SCRIPT,
0064 "Invalid progressive parameters at scan script entry %d")
0065 JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors")
0066 JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d")
0067 JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d")
0068 JMESSAGE(JERR_BAD_STRUCT_SIZE,
0069 "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u")
0070 JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access")
0071 JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small")
0072 JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here")
0073 JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet")
0074 JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d")
0075 JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request")
0076 JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d")
0077 JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x")
0078 JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d")
0079 JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d")
0080 JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)")
0081 JMESSAGE(JERR_EMS_READ, "Read from EMS failed")
0082 JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed")
0083 JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan")
0084 JMESSAGE(JERR_FILE_READ, "Input file read error")
0085 JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?")
0086 JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet")
0087 JMESSAGE(JERR_HUFF_CLEN_OUTOFBOUNDS, "Huffman code size table out of bounds")
0088 JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry")
0089 JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels")
0090 JMESSAGE(JERR_INPUT_EMPTY, "Empty input file")
0091 JMESSAGE(JERR_INPUT_EOF, "Premature end of input file")
0092 JMESSAGE(JERR_MISMATCHED_QUANT_TABLE,
0093 "Cannot transcode due to multiple use of quantization table %d")
0094 JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data")
0095 JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change")
0096 JMESSAGE(JERR_NOTIMPL, "Not implemented yet")
0097 JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time")
0098 JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined")
0099 JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported")
0100 JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined")
0101 JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image")
0102 JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined")
0103 JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x")
0104 JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)")
0105 JMESSAGE(JERR_QUANT_COMPONENTS,
0106 "Cannot quantize more than %d color components")
0107 JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors")
0108 JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors")
0109 JMESSAGE(JERR_SOF_BEFORE, "Invalid JPEG file structure: %s before SOF")
0110 JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers")
0111 JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker")
0112 JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x")
0113 JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers")
0114 JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s")
0115 JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file")
0116 JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file")
0117 JMESSAGE(JERR_TFILE_WRITE,
0118 "Write failed on temporary file --- out of disk space?")
0119 JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines")
0120 JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x")
0121 JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up")
0122 JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation")
0123 JMESSAGE(JERR_XMS_READ, "Read from XMS failed")
0124 JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed")
0125 JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT)
0126 JMESSAGE(JMSG_VERSION, JVERSION)
0127 JMESSAGE(JTRC_16BIT_TABLES,
0128 "Caution: quantization tables are too coarse for baseline JPEG")
0129 JMESSAGE(JTRC_ADOBE,
0130 "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d")
0131 JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u")
0132 JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u")
0133 JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x")
0134 JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x")
0135 JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d")
0136 JMESSAGE(JTRC_DRI, "Define Restart Interval %u")
0137 JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u")
0138 JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u")
0139 JMESSAGE(JTRC_EOI, "End Of Image")
0140 JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d")
0141 JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d")
0142 JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,
0143 "Warning: thumbnail image size does not match data length %u")
0144 JMESSAGE(JTRC_JFIF_EXTENSION,
0145 "JFIF extension marker: type 0x%02x, length %u")
0146 JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image")
0147 JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u")
0148 JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x")
0149 JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u")
0150 JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors")
0151 JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors")
0152 JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization")
0153 JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d")
0154 JMESSAGE(JTRC_RST, "RST%d")
0155 JMESSAGE(JTRC_SMOOTH_NOTIMPL,
0156 "Smoothing not supported with nonstandard sampling ratios")
0157 JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d")
0158 JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d")
0159 JMESSAGE(JTRC_SOI, "Start of Image")
0160 JMESSAGE(JTRC_SOS, "Start Of Scan: %d components")
0161 JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d")
0162 JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d")
0163 JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s")
0164 JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s")
0165 JMESSAGE(JTRC_THUMB_JPEG,
0166 "JFIF extension marker: JPEG-compressed thumbnail image, length %u")
0167 JMESSAGE(JTRC_THUMB_PALETTE,
0168 "JFIF extension marker: palette thumbnail image, length %u")
0169 JMESSAGE(JTRC_THUMB_RGB,
0170 "JFIF extension marker: RGB thumbnail image, length %u")
0171 JMESSAGE(JTRC_UNKNOWN_IDS,
0172 "Unrecognized component IDs %d %d %d, assuming YCbCr")
0173 JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u")
0174 JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u")
0175 JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d")
0176 JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code")
0177 JMESSAGE(JWRN_BOGUS_PROGRESSION,
0178 "Inconsistent progression sequence for component %d coefficient %d")
0179 JMESSAGE(JWRN_EXTRANEOUS_DATA,
0180 "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x")
0181 JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment")
0182 JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code")
0183 JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d")
0184 JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file")
0185 JMESSAGE(JWRN_MUST_RESYNC,
0186 "Corrupt JPEG data: found marker 0x%02x instead of RST%d")
0187 JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG")
0188 JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines")
0189
0190 #ifdef JMAKE_ENUM_LIST
0191
0192 JMSG_LASTMSGCODE
0193 } J_MESSAGE_CODE;
0194
0195 #undef JMAKE_ENUM_LIST
0196 #endif
0197
0198
0199 #undef JMESSAGE
0200
0201
0202 #ifndef JERROR_H
0203 #define JERROR_H
0204
0205
0206
0207
0208
0209 #define ERREXIT(cinfo,code) \
0210 ((cinfo)->err->msg_code = (code), \
0211 (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
0212 #define ERREXIT1(cinfo,code,p1) \
0213 ((cinfo)->err->msg_code = (code), \
0214 (cinfo)->err->msg_parm.i[0] = (p1), \
0215 (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
0216 #define ERREXIT2(cinfo,code,p1,p2) \
0217 ((cinfo)->err->msg_code = (code), \
0218 (cinfo)->err->msg_parm.i[0] = (p1), \
0219 (cinfo)->err->msg_parm.i[1] = (p2), \
0220 (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
0221 #define ERREXIT3(cinfo,code,p1,p2,p3) \
0222 ((cinfo)->err->msg_code = (code), \
0223 (cinfo)->err->msg_parm.i[0] = (p1), \
0224 (cinfo)->err->msg_parm.i[1] = (p2), \
0225 (cinfo)->err->msg_parm.i[2] = (p3), \
0226 (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
0227 #define ERREXIT4(cinfo,code,p1,p2,p3,p4) \
0228 ((cinfo)->err->msg_code = (code), \
0229 (cinfo)->err->msg_parm.i[0] = (p1), \
0230 (cinfo)->err->msg_parm.i[1] = (p2), \
0231 (cinfo)->err->msg_parm.i[2] = (p3), \
0232 (cinfo)->err->msg_parm.i[3] = (p4), \
0233 (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
0234 #define ERREXIT6(cinfo,code,p1,p2,p3,p4,p5,p6) \
0235 ((cinfo)->err->msg_code = (code), \
0236 (cinfo)->err->msg_parm.i[0] = (p1), \
0237 (cinfo)->err->msg_parm.i[1] = (p2), \
0238 (cinfo)->err->msg_parm.i[2] = (p3), \
0239 (cinfo)->err->msg_parm.i[3] = (p4), \
0240 (cinfo)->err->msg_parm.i[4] = (p5), \
0241 (cinfo)->err->msg_parm.i[5] = (p6), \
0242 (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
0243 #define ERREXITS(cinfo,code,str) \
0244 ((cinfo)->err->msg_code = (code), \
0245 strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
0246 (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
0247
0248 #define MAKESTMT(stuff) do { stuff } while (0)
0249
0250
0251 #define WARNMS(cinfo,code) \
0252 ((cinfo)->err->msg_code = (code), \
0253 (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
0254 #define WARNMS1(cinfo,code,p1) \
0255 ((cinfo)->err->msg_code = (code), \
0256 (cinfo)->err->msg_parm.i[0] = (p1), \
0257 (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
0258 #define WARNMS2(cinfo,code,p1,p2) \
0259 ((cinfo)->err->msg_code = (code), \
0260 (cinfo)->err->msg_parm.i[0] = (p1), \
0261 (cinfo)->err->msg_parm.i[1] = (p2), \
0262 (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
0263
0264
0265 #define TRACEMS(cinfo,lvl,code) \
0266 ((cinfo)->err->msg_code = (code), \
0267 (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
0268 #define TRACEMS1(cinfo,lvl,code,p1) \
0269 ((cinfo)->err->msg_code = (code), \
0270 (cinfo)->err->msg_parm.i[0] = (p1), \
0271 (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
0272 #define TRACEMS2(cinfo,lvl,code,p1,p2) \
0273 ((cinfo)->err->msg_code = (code), \
0274 (cinfo)->err->msg_parm.i[0] = (p1), \
0275 (cinfo)->err->msg_parm.i[1] = (p2), \
0276 (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
0277 #define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \
0278 MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
0279 _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \
0280 (cinfo)->err->msg_code = (code); \
0281 (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
0282 #define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \
0283 MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
0284 _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
0285 (cinfo)->err->msg_code = (code); \
0286 (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
0287 #define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \
0288 MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
0289 _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
0290 _mp[4] = (p5); \
0291 (cinfo)->err->msg_code = (code); \
0292 (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
0293 #define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \
0294 MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
0295 _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
0296 _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \
0297 (cinfo)->err->msg_code = (code); \
0298 (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
0299 #define TRACEMSS(cinfo,lvl,code,str) \
0300 ((cinfo)->err->msg_code = (code), \
0301 strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
0302 (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
0303
0304 #endif