📄 ijl.h
字号:
int cconversion_reqd; /* default = TRUE */ int upsampling_reqd; /* default = TRUE */ int jquality; /* default = 75 */ int jinterleaveType; /* default = 0 */ int numxMCUs; /* default = 0 */ int numyMCUs; /* default = 0 */ /* Tables. */ int nqtables; int maxquantindex; int nhuffActables; int nhuffDctables; int maxhuffindex; QUANT_TABLE jFmtQuant[4]; HUFFMAN_TABLE jFmtAcHuffman[4]; HUFFMAN_TABLE jFmtDcHuffman[4]; short* jEncFmtQuant[4]; HUFFMAN_TABLE* jEncFmtAcHuffman[4]; HUFFMAN_TABLE* jEncFmtDcHuffman[4]; /* Allow user-defined tables. */ int use_external_qtables; int use_external_htables; JPEGQuantTable rawquanttables[4]; JPEGHuffTable rawhufftables[8]; char HuffIdentifierAC[4]; char HuffIdentifierDC[4]; /* Frame specific members. */ FRAME jframe; int needframe; /* SCAN persistent members. */ SCAN* jscan; /* State members. */ STATE state; int SawAdobeMarker; int AdobeXform; /* ROI decoder members. */ ENTROPYSTRUCT* rowoffsets; /* Intermediate buffers. */ unsigned char* MCUBuf; unsigned char tMCUBuf[720*2]; /* Processor detected. */ PROCESSOR_TYPE processor_type; RAW_DATA_TYPES_STATE* raw_coefs; /* Progressive mode members. */ int progressive_found; short* coef_buffer; /* Upsampling mode members. */ UPSAMPLING_TYPE upsampling_type; SAMPLING_STATE* sampling_state_ptr; /* Adobe APP14 segment variables */ unsigned short AdobeVersion; /* default = 100 */ unsigned short AdobeFlags0; /* default = 0 */ unsigned short AdobeFlags1; /* default = 0 */ /* JFIF APP0 segment variables */ int jfif_app0_detected; unsigned short jfif_app0_version; /* default = 0x0101 */ unsigned char jfif_app0_units; /* default = 0 - pixel */ unsigned short jfif_app0_Xdensity; /* default = 1 */ unsigned short jfif_app0_Ydensity; /* default = 1 */ /* comments related fields */ char* jpeg_comment; /* default = NULL */ unsigned short jpeg_comment_size; /* default = 0 */} JPEG_PROPERTIES;/*D*////////////////////////////////////////////////////////////////////////////// Name: JPEG_CORE_PROPERTIES//// Purpose: This is the primary data structure between the IJL and// the external user. It stores JPEG state information// and controls the IJL. It is user-modifiable.//// See the Developer's Guide for details on appropriate usage.//// Context: Used by all low-level IJL routines to store// pseudo-global information.//// Fields://// UseJPEGPROPERTIES Set this flag != 0 if you wish to override// the JPEG_CORE_PROPERTIES "IN" parameters with// the JPEG_PROPERTIES parameters.//// DIBBytes IN: Pointer to buffer of uncompressed data.// DIBWidth IN: Width of uncompressed data.// DIBHeight IN: Height of uncompressed data.// DIBPadBytes IN: Padding (in bytes) at end of each// row in the uncompressed data.// DIBChannels IN: Number of components in the// uncompressed data.// DIBColor IN: Color space of uncompressed data.// DIBSubsampling IN: Required to be IJL_NONE or IJL_422.//// JPGFile IN: Pointer to file based JPEG.// JPGBytes IN: Pointer to buffer based JPEG.// JPGSizeBytes IN: Max buffer size. Used with JPGBytes.// OUT: Number of compressed bytes written.// JPGWidth IN: Width of JPEG image.// OUT: After reading (except READHEADER).// JPGHeight IN: Height of JPEG image.// OUT: After reading (except READHEADER).// JPGChannels IN: Number of components in JPEG image.// OUT: After reading (except READHEADER).// JPGColor IN: Color space of JPEG image.// JPGSubsampling IN: Subsampling of JPEG image.// OUT: After reading (except READHEADER).// JPGThumbWidth OUT: JFIF embedded thumbnail width [0-255].// JPGThumbHeight OUT: JFIF embedded thumbnail height [0-255].//// cconversion_reqd OUT: If color conversion done on decode, TRUE.// upsampling_reqd OUT: If upsampling done on decode, TRUE.// jquality IN: [0-100] where highest quality is 100.//// jprops "Low-Level" IJL data structure.//////////////////////////////////////////////////////////////////////////////*D*/typedef struct _JPEG_CORE_PROPERTIES{ int UseJPEGPROPERTIES; /* default = 0 */ /* DIB specific I/O data specifiers. */ unsigned char* DIBBytes; /* default = NULL */ int DIBWidth; /* default = 0 */ int DIBHeight; /* default = 0 */ int DIBPadBytes; /* default = 0 */ int DIBChannels; /* default = 3 */ IJL_COLOR DIBColor; /* default = IJL_BGR */ IJL_DIBSUBSAMPLING DIBSubsampling; /* default = IJL_NONE */ /* JPEG specific I/O data specifiers. */ const char* JPGFile; /* default = NULL */ unsigned char* JPGBytes; /* default = NULL */ int JPGSizeBytes; /* default = 0 */ int JPGWidth; /* default = 0 */ int JPGHeight; /* default = 0 */ int JPGChannels; /* default = 3 */ IJL_COLOR JPGColor; /* default = IJL_YCBCR */ IJL_JPGSUBSAMPLING JPGSubsampling; /* default = IJL_411 */ int JPGThumbWidth; /* default = 0 */ int JPGThumbHeight; /* default = 0 */ /* JPEG conversion properties. */ int cconversion_reqd; /* default = TRUE */ int upsampling_reqd; /* default = TRUE */ int jquality; /* default = 75 */ /* Low-level properties. */ JPEG_PROPERTIES jprops;} JPEG_CORE_PROPERTIES;/*D*////////////////////////////////////////////////////////////////////////////// Name: IJLERR//// Purpose: Listing of possible "error" codes returned by the IJL.//// See the Developer's Guide for details on appropriate usage.//// Context: Used for error checking.//////////////////////////////////////////////////////////////////////////////*D*/typedef enum _IJLERR{ /* The following "error" values indicate an "OK" condition. */ IJL_OK = 0, IJL_INTERRUPT_OK = 1, IJL_ROI_OK = 2, /* The following "error" values indicate an error has occurred. */ IJL_EXCEPTION_DETECTED = -1, IJL_INVALID_ENCODER = -2, IJL_UNSUPPORTED_SUBSAMPLING = -3, IJL_UNSUPPORTED_BYTES_PER_PIXEL = -4, IJL_MEMORY_ERROR = -5, IJL_BAD_HUFFMAN_TABLE = -6, IJL_BAD_QUANT_TABLE = -7, IJL_INVALID_JPEG_PROPERTIES = -8, IJL_ERR_FILECLOSE = -9, IJL_INVALID_FILENAME = -10, IJL_ERROR_EOF = -11, IJL_PROG_NOT_SUPPORTED = -12, IJL_ERR_NOT_JPEG = -13, IJL_ERR_COMP = -14, IJL_ERR_SOF = -15, IJL_ERR_DNL = -16, IJL_ERR_NO_HUF = -17, IJL_ERR_NO_QUAN = -18, IJL_ERR_NO_FRAME = -19, IJL_ERR_MULT_FRAME = -20, IJL_ERR_DATA = -21, IJL_ERR_NO_IMAGE = -22, IJL_FILE_ERROR = -23, IJL_INTERNAL_ERROR = -24, IJL_BAD_RST_MARKER = -25, IJL_THUMBNAIL_DIB_TOO_SMALL = -26, IJL_THUMBNAIL_DIB_WRONG_COLOR = -27, IJL_BUFFER_TOO_SMALL = -28, IJL_UNSUPPORTED_FRAME = -29, IJL_ERR_COM_BUFFER = -30, IJL_RESERVED = -99} IJLERR;/* /////////////////////////////////////////////////////////////////////////// Function Prototypes (API Calls) /////////////////////////////////////////////////////////////////////////// *//*F*////////////////////////////////////////////////////////////////////////////// Name: ijlInit//// Purpose: Used to initalize the IJL.//// See the Developer's Guide for details on appropriate usage.//// Context: Always call this before anything else.// Also, only call this with a new jcprops structure, or// after calling IJL_Free. Otherwise, dynamically// allocated memory may be leaked.//// Returns: Any IJLERR value. IJL_OK indicates success.//// Parameters:// jcprops Pointer to an externally allocated// JPEG_CORE_PROPERTIES structure.//////////////////////////////////////////////////////////////////////////////*F*/IJLAPI(IJLERR, ijlInit, ( JPEG_CORE_PROPERTIES* jcprops ));/*F*////////////////////////////////////////////////////////////////////////////// Name: ijlFree//// Purpose: Used to properly close down the IJL.//// See the Developer's Guide for details on appropriate usage.//// Context: Always call this when done using the IJL to perform// clean-up of dynamically allocated memory.// Note, IJL_Init will have to be called to use the// IJL again.//// Returns: Any IJLERR value. IJL_OK indicates success.//// Parameters:// jcprops Pointer to an externally allocated// JPEG_CORE_PROPERTIES structure.//////////////////////////////////////////////////////////////////////////////*F*/IJLAPI(IJLERR, ijlFree, ( JPEG_CORE_PROPERTIES* jcprops ));/*F*////////////////////////////////////////////////////////////////////////////// Name: IJL_Read//// Purpose: Used to read JPEG data (entropy, or header, or both) into// a user-supplied buffer (to hold the image data) and/or// into the JPEG_CORE_PROPERTIES structure (to hold the// header info).//// Context: See the Developer's Guide for a detailed description// on the use of this function. The jcprops main data// members are checked for consistency.//// Returns: Any IJLERR value. IJL_OK indicates success.//// Parameters:// jcprops Pointer to an externally allocated// JPEG_CORE_PROPERTIES structure.// iotype Specifies what type of read operation to perform.//////////////////////////////////////////////////////////////////////////////*F*/IJLAPI(IJLERR, ijlRead, ( JPEG_CORE_PROPERTIES* jcprops, IJLIOTYPE iotype ));/*F*////////////////////////////////////////////////////////////////////////////// Name: ijlWrite//// Purpose: Used to write JPEG data (entropy, or header, or both) into// a user-supplied buffer (to hold the image data) and/or// into the JPEG_CORE_PROPERTIES structure (to hold the// header info).//// Context: See the Developer's Guide for a detailed description// on the use of this function. The jcprops main data// members are checked for consistency.//// Returns: Any IJLERR value. IJL_OK indicates success.//// Parameters:// jcprops Pointer to an externally allocated// JPEG_CORE_PROPERTIES structure.// iotype Specifies what type of write operation to perform.//////////////////////////////////////////////////////////////////////////////*F*/IJLAPI(IJLERR, ijlWrite, ( JPEG_CORE_PROPERTIES* jcprops, IJLIOTYPE iotype ));/*F*////////////////////////////////////////////////////////////////////////////// Name: ijlGetLibVersion//// Purpose: To identify the version number of the IJL.//// Context: Call to get the IJL version number.//// Returns: pointer to IJLibVersion struct//// Parameters: none//////////////////////////////////////////////////////////////////////////////*F*/IJLAPI(const IJLibVersion*, ijlGetLibVersion, (void));/*F*////////////////////////////////////////////////////////////////////////////// Name: ijlErrorStr//// Purpose: Gets the string to describe error code.//// Context: Is called to get descriptive string on arbitrary IJLERR code.//// Returns: pointer to string//// Parameters: IJLERR - IJL error code//////////////////////////////////////////////////////////////////////////////*F*/IJLAPI(const char*, ijlErrorStr, (IJLERR code));#if defined( __cplusplus )}#endif#endif /* __IJL_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -