📄 ptapi.h
字号:
+--------------------------------------------------------------------------------------*/
/* Status of an operation */
#define PT_QRENCODE_FAIL 0x00000000 //An operation is Failed.
#define PT_QRENCODE_SUCCESS 0x00000001 //An operation is successful.
#define PT_QRENCODE_ALLOC_ERROR 0x00000200 //Error while allocating the memory.
#define PT_QRENCODE_DATA_BIG 0x00000201 //Data to be encoded is too big.
#define PT_QRENCODE_SIZE_SMALL 0x00000202 //The size of image to be pasted the symbol is too small.
#define PT_QRENCODE_IMAGE_INVALID 0x00000203 //The image to be pasted is invalid.
/* QR Code ECC level constants */
#define PT_QR_ECCLEVEL_L 0x0001 //Use ECC level L. (7% )
#define PT_QR_ECCLEVEL_M 0x0000 //Use ECC level M. (15%)
#define PT_QR_ECCLEVEL_Q 0x0003 //Use ECC level Q. (25%)
#define PT_QR_ECCLEVEL_H 0x0002 //Use ECC level H. (30%)
/* QR Code version constants */
#define PT_QR_VERSION_AUTO 0x0000 //Decide the version by the engine,then use the smallest version that can contain the data.
/* QR Code mask number constants */
#define PT_QR_MASKNUMBER_AUTO 0x0008 //Decide the mask number by the engine.
/*--------------------------------------------------------------------------------------+
| STRUCTURES SECTION |
| Please refer to the SDK manul for more detail. |
+---------------------------------------------------------------------------------------*/
/*The PTQRENCODE structure contains the information related to QR Code barcodes*/
typedef struct tagPTQRENCODE
{
char* pData; //Pointer to the data to be encoded.
int nDataLength; //Length of the data in bytes.
WORD wVersion; //The version of the QR Code.
WORD wMaskNumber; //The mask number of the QR Code
WORD wEccLevel; //Determines the ECC level for encoding a QR Code symbol.
WORD wModule; //The smallest element size in pixels.
WORD wGroupTotal; //The number of symbols that belong to the group.
WORD wGroupIndex; //The index of the symbol in the group
WORD wLeftSpace; //The left space of the symbol in pixels while generating the image.
WORD wRightSpace; //The right space of the symbol in pixels while generating the image.
WORD wTopSpace; //The top space of the symbol in pixels while generating the image.
WORD wBottomSpace; //The bottom space of the symbol in pixels while generating the image.
}PTQRENCODE, *pPTQRENCODE;
/*--------------------------------------------------------------------------------------+
| FUNCTIONS SECTION |
| Please refer to the SDK manul for more detail. |
+--------------------------------------------------------------------------------------*/
/*Verify the licnese key for the engine.*/
int PtQREncodeRegister
(
char* pKeyStr //Pointer to the string of license key.
);
/*Initialize the PTQRENCODE structure with default values.*/
void PtQREncodeInit
(
PTQRENCODE* pEncode //Pointer to a PTQRENCODE structure.
);
/*Encode a QR Code symbol and then generate an image.*/
int PtQREncode
(
PTQRENCODE* pEncode, //Pointer to a PTQRENCODE structure.
PTIMAGE* pImage //Pointer to a PTIMAGE structure.
);
/*Encode a QR Code symbol and then paste the symbol to an existing image.*/
int PtQREncodeToImage
(
PTQRENCODE* pEncode, //Pointer to a PTQRENCODE structure.
PTIMAGE* pDstImg, //Pointer to a PTIMAGE structure.
int StartX, //The x-coordinate in pixels, of the upper-left corner of the destination rectangle.
int StartY //The y-coordinate in pixels, of the upper-left corner of the destination rectangle.
);
// * **********************************************************
// * QR Code symbol reading APIs and definitions
// * **********************************************************
/*--------------------------------------------------------------------------------------+
| DEFINES SECTION |
+--------------------------------------------------------------------------------------*/
/* Status of an operation */
#define PT_QRDECODE_FAIL 0x00000000//An error occurred in an operation.
#define PT_QRDECODE_SUCCESS 0x00000001//An operation is successful.
#define PT_QRDECODE_ALLOC_ERROR 0x00000300//Error while allocating the memory.
#define PT_QRDECODE_IMAGE_INVALID 0x00000301//The image to be decode is invalid.
#define PT_QRDECODE_PARAMETERS_INVALID 0x00000302//The parameters input to a function are invalid.
/*--------------------------------------------------------------------------------------+
| FUNCTIONS SECTION |
| Please refer to the SDK manul for more detail. |
+--------------------------------------------------------------------------------------*/
/*Verify the licnese key for the engine.*/
int PtQRDecodeRegister
(
char* pKeyStr //Pointer to the string of license key.
);
/*Initialize the PTTOTALBARCODEINFO structure.*/
void PtQRDecodeInit
(
PTTOTALBARCODEINFO* pInfo //Pointer to a PTTOTALBARCODEINFO structure.
);
/*Decode QR Code barcode from an image.*/
int PtQRDecode
(
PTIMAGE* pImage, //Pointer to a PTIMAGE structure.
PTDECODEPARA* pPara, //Pointer to a PTDECODEPARA structure
PTTOTALBARCODEINFO* pInfo //Pointer to a PTTOTALBARCODEINFO structure.
);
/*Decode QR Code barcode from an image file. The function supports multiframes image, such as tiff*/
int PtQRDecodeFromFile
(
const char* FileName, //Name of the image file.
PTDECODEPARA* pPara, //Pointer to a PTDECODEPARA structure.
PTTOTALBARCODEINFO* pInfo //Pointer to a PTTOTALBARCODEINFO structure.
);
/*Free the memory allocated in the function PtQRDecode.*/
void PtQRDecodeFree
(
PTTOTALBARCODEINFO* pInfo //Pointer to a PTTOTALBARCODEINFO structure.
);
// * **********************************************************
// * Data Matrix symbol writing APIs and definitions
// * **********************************************************
#if !defined( PT_DMENCODE_API )
#define PT_DMENCODE_API __declspec( dllimport )
#endif
/*--------------------------------------------------------------------------------------+
| DEFINES SECTION |
+--------------------------------------------------------------------------------------*/
/* Status of an operation */
#define PT_DMENCODE_FAIL 0x00000000 //An operation is Failed.
#define PT_DMENCODE_SUCCESS 0x00000001 //An operation is successful.
#define PT_DMENCODE_ALLOC_ERROR 0x00000200 //Error while allocating the memory.
#define PT_DMENCODE_DATA_BIG 0x00000201 //Data to be encoded is too big.
#define PT_DMENCODE_SIZE_SMALL 0x00000202 //The size of image to be pasted the symbol is too small.
#define PT_DMENCODE_IMAGE_INVALID 0x00000203 //The image to be pasted is invalid.
/* Symbol size */
#define PT_DM_SQUARE_AUTO 0 //Use the smallest square size that can contain the data.
#define PT_DM_10x10 1 //Data Matrix Type 10x10.
#define PT_DM_12x12 2 //Data Matrix Type 12x12.
#define PT_DM_14x14 3 //Data Matrix Type 14x14.
#define PT_DM_16x16 4 //Data Matrix Type 16x16.
#define PT_DM_18x18 5 //Data Matrix Type 18x18.
#define PT_DM_20x20 6 //Data Matrix Type 20x20.
#define PT_DM_22x22 7 //Data Matrix Type 22x22.
#define PT_DM_24x24 8 //Data Matrix Type 24x24.
#define PT_DM_26x26 9 //Data Matrix Type 26x26.
#define PT_DM_32x32 10 //Data Matrix Type 32x32.
#define PT_DM_36x36 11 //Data Matrix Type 36x36.
#define PT_DM_40x40 12 //Data Matrix Type 40x40.
#define PT_DM_44x44 13 //Data Matrix Type 44x44.
#define PT_DM_48x48 14 //Data Matrix Type 48x48.
#define PT_DM_52x52 15 //Data Matrix Type 52x52.
#define PT_DM_64x64 16 //Data Matrix Type 64x64.
#define PT_DM_72x72 17 //Data Matrix Type 72x72.
#define PT_DM_80x80 18 //Data Matrix Type 80x80.
#define PT_DM_88x88 19 //Data Matrix Type 88x88.
#define PT_DM_96x96 20 //Data Matrix Type 96x96.
#define PT_DM_104x104 21 //Data Matrix Type 104x104.
#define PT_DM_120x120 22 //Data Matrix Type 120x120.
#define PT_DM_132x132 23 //Data Matrix Type 132x132.
#define PT_DM_144x144 24 //Data Matrix Type 144x144.
#define PT_DM_8x18 25 //Data Matrix Type 8x18.
#define PT_DM_8x32 26 //Data Matrix Type 8x32.
#define PT_DM_12x26 27 //Data Matrix Type 12x26.
#define PT_DM_12x36 28 //Data Matrix Type 12x36.
#define PT_DM_16x36 29 //Data Matrix Type 16x36.
#define PT_DM_16x48 30 //Data Matrix Type 16x48.
#define PT_DM_RECTANGLE_AUTO 31 //use the smallest rectangular size that can contain the data.
/*--------------------------------------------------------------------------------------+
| STRUCTURES SECTION |
| Please refer to the SDK manul for more detail. |
+---------------------------------------------------------------------------------------*/
/*The PTDMENCODE structure contains the information related to Data Matrix Code barcodes*/
typedef struct tagPTDMENCODE
{
char* pData; //Pointer to the data to be encoded.
int nDataLength; //Length of the data in bytes.
WORD wSymbolSize; //The symbol size.
WORD wModule; //The size of one module in pixels.
WORD wGroupTotal; //The number of symbols that belong to the group.
WORD wGroupIndex; //The index of the symbol in the group.
WORD wFileIDHigh; //The high byte of the file ID number.
WORD wFileIDLow; //The low byte of the file ID number.
WORD wLeftSpace; //The left space of the symbol in pixels while generating the image.
WORD wRightSpace; //The right space of the symbol in pixels while generating the image.
WORD wTopSpace; //The top space of the symbol in pixels while generating the image.
WORD wBottomSpace; //The bottom space of the symbol in pixels while generating the image.
}PTDMENCODE, *pPTDMENCODE;
/*--------------------------------------------------------------------------------------+
| FUNCTIONS SECTION |
| Please refer to the SDK manul for more detail. |
+--------------------------------------------------------------------------------------*/
/*Verify the licnese key for the engine.*/
int PtDMEncodeRegister
(
char* pKeyStr //Pointer to the string of license key.
);
/*Initialize the PTDMENCODE structure with default values.*/
void PtDMEncodeInit
(
PTDMENCODE* pEncode //Pointer to a PTDMENCODE structure.
);
/*Encode a Data Matrix symbol and then generate an image.*/
int PtDMEncode
(
PTDMENCODE* pEncode, //Pointer to a PTDMENCODE structure.
PTIMAGE* pImage //Pointer to a PTIMAGE structure.
);
/*Encode a Data Matrix symbol and then paste the symbol to an existing image.*/
int PtDMEncodeToImage
(
PTDMENCODE* pEncode, //Pointer to a PTDMENCODE structure.
PTIMAGE* pDstImg, //Pointer to a PTIMAGE structure.
int StartX, //The x-coordinate in pixels, of the upper-left corner of the destination rectangle.
int StartY //The y-coordinate in pixels, of the upper-left corner of the destination rectangle.
);
// * **********************************************************
// * Data Matrix symbol reading APIs and definitions
// * **********************************************************
/*--------------------------------------------------------------------------------------+
| DEFINES SECTION |
+--------------------------------------------------------------------------------------*/
/* Status of an operation */
#define PT_DMDECODE_FAIL 0x00000000//An error occurred in an operation.
#define PT_DMDECODE_SUCCESS 0x00000001//An operation is successful.
#define PT_DMDECODE_ALLOC_ERROR 0x00000300//Error while allocating the memory.
#define PT_DMDECODE_IMAGE_INVALID 0x00000301//The image to be decode is invalid.
#define PT_DMDECODE_PARAMETERS_INVALID 0x00000302//The parameters input to a function are invalid.
/*--------------------------------------------------------------------------------------+
| FUNCTIONS SECTION |
| Please refer to the SDK manul for more detail. |
+--------------------------------------------------------------------------------------*/
/*Verify the licnese key for the engine.*/
int PtDMDecodeRegister
(
char* pKeyStr //Pointer to the string of license key.
);
/*Initialize the PTTOTALBARCODEINFO structure.*/
void PtDMDecodeInit
(
PTTOTALBARCODEINFO* pInfo //Pointer to a PTTOTALBARCODEINFO structure.
);
/*Decode DM Code barcode from an image.*/
int PtDMDecode
(
PTIMAGE* pImage, //Pointer to a PTIMAGE structure.
PTDECODEPARA* pPara, //Pointer to a PTDECODEPARA structure
PTTOTALBARCODEINFO* pInfo //Pointer to a PTTOTALBARCODEINFO structure.
);
/*Decode Data Matrix symbol from an image file. The function supports multiframes image, such as tiff*/
int PtDMDecodeFromFile
(
const char* FileName, //Name of the image file.
PTDECODEPARA* pPara, //Pointer to a PTDECODEPARA structure.
PTTOTALBARCODEINFO* pInfo //Pointer to a PTTOTALBARCODEINFO structure.
);
/*Free the memory allocated in the function PtDMDecode.*/
void PtDMDecodeFree
(
PTTOTALBARCODEINFO* pInfo //Pointer to a PTTOTALBARCODEINFO structure.
);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -