⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ijl.pas

📁 TRY2LPR-1.0开源的车牌识别核心
💻 PAS
📖 第 1 页 / 共 4 页
字号:
    processor_type : TPROCESSOR_TYPE;

    raw_coefs : PRAW_DATA_TYPES_STATE;

    // Progressive mode members.
    progressive_found : Integer;
    coef_buffer       : PShort;

    // Upsampling mode members.
    upsampling_type    : TUPSAMPLING_TYPE;
    sampling_state_ptr : PSAMPLING_STATE;

    // Adobe APP14 segment variables
    AdobeVersion : Short;         // default = 100
    AdobeFlags0  : Short;         // default = 0
    AdobeFlags1  : Short;         // default = 0

    // JFIF APP0 segment variables
    jfif_app0_detected : Integer;
    jfif_app0_version  : Short;    // default = 0x0101
    jfif_app0_units    : UCHAR;    // default = 0 - pixel
    jfif_app0_Xdensity : Short;    // default = 1
    jfif_app0_Ydensity : Short;    // default = 1

    // comments related fields
    jpeg_comment      : PChar;     // default = NULL
    jpeg_comment_size : Short;     // default = 0

  end;


////////////////////////////////////////////////////////////////////////////
// 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.
//
//  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.
//
////////////////////////////////////////////////////////////////////////////

type
  PJPEG_CORE_PROPERTIES = ^TJPEG_CORE_PROPERTIES;
  TJPEG_CORE_PROPERTIES = record
    UseJPEGPROPERTIES : DWORD;               // default = 0

    // DIB specific I/O data specifiers.
    DIBBytes          : PByte;               // default = NULL
    DIBWidth          : DWORD;               // default = 0
    DIBHeight         : Integer;             // default = 0
    DIBPadBytes       : DWORD;               // default = 0
    DIBChannels       : DWORD;               // default = 3
    DIBColor          : TIJL_COLOR;          // default = IJL_BGR
    DIBSubsampling    : TIJL_DIBSUBSAMPLING; // default = IJL_NONE

    // JPEG specific I/O data specifiers.
    JPGFile           : PChar;               // default = NULL
    JPGBytes          : PByte;               // default = NULL
    JPGSizeBytes      : DWORD;               // default = 0
    JPGWidth          : DWORD;               // default = 0
    JPGHeight         : DWORD;               // default = 0
    JPGChannels       : DWORD;               // default = 3
    JPGColor          : TIJL_COLOR;          // default = IJL_YCBCR
    JPGSubsampling    : TIJL_JPGSUBSAMPLING; // default = IJL_411
    JPGThumbWidth     : DWORD;               // default = 0
    JPGThumbHeight    : DWORD;               // default = 0

    // JPEG conversion properties.
    cconversion_reqd  : DWORD;               // default = TRUE
    upsampling_reqd   : DWORD;               // default = TRUE
    jquality          : DWORD;               // default = 75

    Pad               : DWORD;               // 8-byte alignment!!!
    // Low-level properties.
    jprops            : TJPEG_PROPERTIES;
  end;


////////////////////////////////////////////////////////////////////////////
// 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.
//
////////////////////////////////////////////////////////////////////////////

const
  // 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;


/////////////////////////////////////////////////////////////////////////
//                     Function Prototypes (API Calls)                 //
/////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////
// 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.
//
////////////////////////////////////////////////////////////////////////////

function ijlInit(jcprops : PJPEG_CORE_PROPERTIES) : Integer; stdcall;


////////////////////////////////////////////////////////////////////////////
// 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.
//
////////////////////////////////////////////////////////////////////////////

function ijlFree(jcprops : PJPEG_CORE_PROPERTIES) : Integer; stdcall;


////////////////////////////////////////////////////////////////////////////
// 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.
//
////////////////////////////////////////////////////////////////////////////

function ijlRead(jcprops : PJPEG_CORE_PROPERTIES;
                 IoType  : TIJLIOTYPE) : Integer; stdcall;


////////////////////////////////////////////////////////////////////////////
// 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.
//
////////////////////////////////////////////////////////////////////////////

function ijlWrite(jcprops : PJPEG_CORE_PROPERTIES;
                  IoType  : TIJLIOTYPE) : Integer; stdcall;


////////////////////////////////////////////////////////////////////////////
// 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
//
////////////////////////////////////////////////////////////////////////////

function ijlGetLibVersion : PIJLibVersion; stdcall;


////////////////////////////////////////////////////////////////////////////
// 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
//
////////////////////////////////////////////////////////////////////////////

function ijlErrorStr(Code : Integer) : PChar; stdcall;


implementation

const
  ijlDLL = 'IJL15.DLL';

function ijlInit;          external ijlDLL;
function ijlFree;          external ijlDLL;
function ijlRead;          external ijlDLL;
function ijlWrite;         external ijlDLL;
function ijlGetLibVersion; external ijlDLL;
function ijlErrorStr;      external ijlDLL;


{
  -------------------------------------------
  $Log:: /Delphi Projects/Intel JPEG Librar $
 *
 * 3     20.04.99 18:50 Lee_step
 * IJL10 -> IJL20
 *
 * 2     26.10.98 9:13 Lee_step
 * Added ijlGetErrorStr
 *
 * 1     20.10.98 8:35 Lee_step
 * Renamed from IJLib.pas
 *
 * 4     17.10.98 16:25 Lee_step
 * Completed IJL interface.
 * Added 'Flush Cache' feature.
 *
 * 3     17.10.98 14:31 Lee_step
 * Fix IJL_JBUFF_WRITE
 *
 * 2     16.10.98 8:50 Lee_step
 *
 * 1     15.10.98 9:10 Lee_step
 *
 }
end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -