📄 twain.h
字号:
#define MSG_GETDEFAULT 0x0003 /* Get default (e.g. power up) value */
#define MSG_GETFIRST 0x0004 /* Get first of a series of items, e.g. DSs */
#define MSG_GETNEXT 0x0005 /* Iterate through a series of items. */
#define MSG_SET 0x0006 /* Set one or more values */
#define MSG_RESET 0x0007 /* Set current value to default value */
/* Messages used with DAT_NULL */
#define MSG_XFERREADY 0x0101 /* The data source has data ready */
#define MSG_CLOSEDSREQ 0x0102 /* Request for App. to close DS */
/* Messages used with a pointer to a DAT_STATUS structure */
#define MSG_CHECKSTATUS 0x0201 /* Get status information */
/* Messages used with a pointer to DAT_PARENT data */
#define MSG_OPENDSM 0x0301 /* Open the DSM */
#define MSG_CLOSEDSM 0x0302 /* Close the DSM */
/* Messages used with a pointer to a DAT_IDENTITY structure */
#define MSG_OPENDS 0x0401 /* Open a data source */
#define MSG_CLOSEDS 0x0402 /* Close a data source */
#define MSG_USERSELECT 0x0403 /* Put up a dialog of all DS */
/* Messages used with a pointer to a DAT_USERINTERFACE structure */
#define MSG_DISABLEDS 0x0501 /* Disable data transfer in the DS */
#define MSG_ENABLEDS 0x0502 /* Enable data transfer in the DS */
/* Messages used with a pointer to a DAT_EVENT structure */
#define MSG_PROCESSEVENT 0x0601
/* Messages used with a pointer to a DAT_PENDINGXFERS structure */
#define MSG_ENDXFER 0x0701
/****************************************************************************
* Capabilities *
****************************************************************************/
#define CAP_CUSTOMBASE 0x8000 /* Base of custom capabilities */
/* all data sources are REQUIRED to support these caps */
#define CAP_XFERCOUNT 0x0001
/* image data sources are REQUIRED to support these caps */
#define ICAP_COMPRESSION 0x0100
#define ICAP_PIXELTYPE 0x0101
#define ICAP_UNITS 0x0102 /* default is TWUN_INCHES */
#define ICAP_XFERMECH 0x0103
/* all data sources MAY support these caps */
#define CAP_AUTHOR 0x1000
#define CAP_CAPTION 0x1001
#define CAP_FEEDERENABLED 0x1002
#define CAP_FEEDERLOADED 0x1003
#define CAP_TIMEDATE 0x1004
#define CAP_SUPPORTEDCAPS 0x1005
#define CAP_EXTENDEDCAPS 0x1006
#define CAP_AUTOFEED 0x1007
#define CAP_CLEARPAGE 0x1008
#define CAP_FEEDPAGE 0x1009
#define CAP_REWINDPAGE 0x100a
#define CAP_INDICATORS 0x100b /* Added 1.1 */
#define CAP_SUPPORTEDCAPSEXT 0x100c /* Added 1.6 */
#define CAP_PAPERDETECTABLE 0x100d /* Added 1.6 */
#define CAP_UICONTROLLABLE 0x100e /* Added 1.6 */
#define CAP_DEVICEONLINE 0x100d /* Added 1.6 */
/* image data sources MAY support these caps */
#define ICAP_AUTOBRIGHT 0x1100
#define ICAP_BRIGHTNESS 0x1101
#define ICAP_CONTRAST 0x1103
#define ICAP_CUSTHALFTONE 0x1104
#define ICAP_EXPOSURETIME 0x1105
#define ICAP_FILTER 0x1106
#define ICAP_FLASHUSED 0x1107
#define ICAP_GAMMA 0x1108
#define ICAP_HALFTONES 0x1109
#define ICAP_HIGHLIGHT 0x110a
#define ICAP_IMAGEFILEFORMAT 0x110c
#define ICAP_LAMPSTATE 0x110d
#define ICAP_LIGHTSOURCE 0x110e
#define ICAP_ORIENTATION 0x1110
#define ICAP_PHYSICALWIDTH 0x1111
#define ICAP_PHYSICALHEIGHT 0x1112
#define ICAP_SHADOW 0x1113
#define ICAP_FRAMES 0x1114
#define ICAP_XNATIVERESOLUTION 0x1116
#define ICAP_YNATIVERESOLUTION 0x1117
#define ICAP_XRESOLUTION 0x1118
#define ICAP_YRESOLUTION 0x1119
#define ICAP_MAXFRAMES 0x111a
#define ICAP_TILES 0x111b
#define ICAP_BITORDER 0x111c
#define ICAP_CCITTKFACTOR 0x111d
#define ICAP_LIGHTPATH 0x111e
#define ICAP_PIXELFLAVOR 0x111f
#define ICAP_PLANARCHUNKY 0x1120
#define ICAP_ROTATION 0x1121
#define ICAP_SUPPORTEDSIZES 0x1122
#define ICAP_THRESHOLD 0x1123
#define ICAP_XSCALING 0x1124
#define ICAP_YSCALING 0x1125
#define ICAP_BITORDERCODES 0x1126
#define ICAP_PIXELFLAVORCODES 0x1127
#define ICAP_JPEGPIXELTYPE 0x1128
#define ICAP_TIMEFILL 0x112a
#define ICAP_BITDEPTH 0x112b
#define ICAP_BITDEPTHREDUCTION 0x112c /* Added 1.5 */
#define ICAP_UNDEFINEDIMAGESIZE 0X112d /* Added 1.6 */
/***************************************************************************
* Return Codes and Condition Codes section *
***************************************************************************/
/* Return Codes: DSM_Entry and DS_Entry may return any one of these values. */
#define TWRC_CUSTOMBASE 0x8000
#define TWRC_SUCCESS 0
#define TWRC_FAILURE 1 /* App may get TW_STATUS for info on failure */
#define TWRC_CHECKSTATUS 2 /* "tried hard"; get status */
#define TWRC_CANCEL 3
#define TWRC_DSEVENT 4
#define TWRC_NOTDSEVENT 5
#define TWRC_XFERDONE 6
#define TWRC_ENDOFLIST 7 /* After MSG_GETNEXT if nothing left */
/* Condition Codes: App gets these by doing DG_CONTROL DAT_STATUS MSG_GET. */
#define TWCC_CUSTOMBASE 0x8000
#define TWCC_SUCCESS 0 /* It worked! */
#define TWCC_BUMMER 1 /* Failure due to unknown causes */
#define TWCC_LOWMEMORY 2 /* Not enough memory to perform operation */
#define TWCC_NODS 3 /* No Data Source */
#define TWCC_MAXCONNECTIONS 4 /* DS is connected to max possible apps */
#define TWCC_OPERATIONERROR 5 /* DS or DSM reported error, app shouldn't */
#define TWCC_BADCAP 6 /* Unknown capability */
#define TWCC_BADPROTOCOL 9 /* Unrecognized MSG DG DAT combination */
#define TWCC_BADVALUE 10 /* Data parameter out of range */
#define TWCC_SEQERROR 11 /* DG DAT MSG out of expected sequence */
#define TWCC_BADDEST 12 /* Unknown destination App/Src in DSM_Entry */
#define TWCC_CAPUNSUPPORTED 13 /* Capability not supported by source */
#define TWCC_CAPBADOPERATION 14 /* Operation not supported by capability */
#define TWCC_CAPSEQERROR 15 /* Capability has dependancy on other capability */
/****************************************************************************
* Entry Points *
****************************************************************************/
/**********************************************************************
* Function: DSM_Entry, the only entry point into the Data Source Manager.
*
* Parameters:
* pOrigin Identifies the source module of the message. This could
* identify an Application, a Source, or the Source Manager.
*
* pDest Identifies the destination module for the message.
* This could identify an application or a data source.
* If this is NULL, the message goes to the Source Manager.
*
* DG The Data Group.
* Example: DG_IMAGE.
*
* DAT The Data Attribute Type.
* Example: DAT_IMAGEMEMXFER.
*
* MSG The message. Messages are interpreted by the destination module
* with respect to the Data Group and the Data Attribute Type.
* Example: MSG_GET.
*
* pData A pointer to the data structure or variable identified
* by the Data Attribute Type.
* Example: (TW_MEMREF)&ImageMemXfer
* where ImageMemXfer is a TW_IMAGEMEMXFER structure.
*
* Returns:
* ReturnCode
* Example: TWRC_SUCCESS.
*
********************************************************************/
/* Don't mangle the name "DSM_Entry" if we're compiling in C++! */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#ifdef _MSWIN_
TW_UINT16 FAR PASCAL DSM_Entry( pTW_IDENTITY pOrigin,
pTW_IDENTITY pDest,
TW_UINT32 DG,
TW_UINT16 DAT,
TW_UINT16 MSG,
TW_MEMREF pData);
typedef TW_UINT16 (FAR PASCAL *DSMENTRYPROC)(pTW_IDENTITY, pTW_IDENTITY,
TW_UINT32, TW_UINT16,
TW_UINT16, TW_MEMREF);
#else /* _MSWIN_ */
FAR PASCAL TW_UINT16 DSM_Entry( pTW_IDENTITY pOrigin,
pTW_IDENTITY pDest,
TW_UINT32 DG,
TW_UINT16 DAT,
TW_UINT16 MSG,
TW_MEMREF pData);
typedef TW_UINT16 (*DSMENTRYPROC)(pTW_IDENTITY, pTW_IDENTITY,
TW_UINT32, TW_UINT16,
TW_UINT16, TW_MEMREF);
#endif /* _MSWIN_ */
#ifdef __cplusplus
}
#endif /* cplusplus */
/**********************************************************************
* Function: DS_Entry, the entry point provided by a Data Source.
*
* Parameters:
* pOrigin Identifies the source module of the message. This could
* identify an application or the Data Source Manager.
*
* DG The Data Group.
* Example: DG_IMAGE.
*
* DAT The Data Attribute Type.
* Example: DAT_IMAGEMEMXFER.
*
* MSG The message. Messages are interpreted by the data source
* with respect to the Data Group and the Data Attribute Type.
* Example: MSG_GET.
*
* pData A pointer to the data structure or variable identified
* by the Data Attribute Type.
* Example: (TW_MEMREF)&ImageMemXfer
* where ImageMemXfer is a TW_IMAGEMEMXFER structure.
*
* Returns:
* ReturnCode
* Example: TWRC_SUCCESS.
*
* Note:
* The DSPROC type is only used by an application when it calls
* a Data Source directly, bypassing the Data Source Manager.
*
********************************************************************/
/* Don't mangle the name "DS_Entry" if we're compiling in C++! */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#ifdef _MSWIN_
TW_UINT16 FAR PASCAL DS_Entry( pTW_IDENTITY pOrigin,
TW_UINT32 DG,
TW_UINT16 DAT,
TW_UINT16 MSG,
TW_MEMREF pData);
typedef TW_UINT16 (FAR PASCAL *DSENTRYPROC)(pTW_IDENTITY,
TW_UINT32, TW_UINT16,
TW_UINT16, TW_MEMREF);
#else /* _MSWIN_ */
FAR PASCAL TW_UINT16 DS_Entry( pTW_IDENTITY pOrigin,
TW_UINT32 DG,
TW_UINT16 DAT,
TW_UINT16 MSG,
TW_MEMREF pData);
typedef TW_UINT16 (*DSENTRYPROC)(pTW_IDENTITY,
TW_UINT32, TW_UINT16,
TW_UINT16, TW_MEMREF);
#endif /* _MSWIN_ */
#ifdef __cplusplus
}
#endif /* cplusplus */
/* SDH - 02/08/95 - TWUNK */
/* Force 32-bit twain to use same packing of twain structures as existing */
/* 16-bit twain. This allows 16/32-bit thunking. */
//#ifdef WIN32
// #pragma pack (pop, before_twain)
//#else /* WIN32 */
//#endif /* WIN32 */
#endif /* TWAIN */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -