📄 twain.h
字号:
} TW_JPEGCOMPRESSION, FAR * pTW_JPEGCOMPRESSION;
/* DAT_PALETTE8. Color palette when TWPT_PALETTE pixels xfer'd in mem buf. */
typedef struct {
TW_UINT16 NumColors; /* Number of colors in the color table. */
TW_UINT16 PaletteType; /* TWPA_xxxx, specifies type of palette. */
TW_ELEMENT8 Colors[256]; /* Array of palette values starts here. */
} TW_PALETTE8, FAR * pTW_PALETTE8;
/* DAT_PENDINGXFERS. Used with MSG_ENDXFER to indicate additional data. */
typedef struct {
TW_UINT16 Count; /* Number of additional "images" pending. */
TW_UINT32 Reserved;
} TW_PENDINGXFERS, FAR * pTW_PENDINGXFERS;
/* DAT_RGBRESPONSE */
typedef struct {
TW_ELEMENT8 Response[1];
} TW_RGBRESPONSE, FAR * pRGBRESPONSE;
/* DAT_SETUPFILEXFER. Sets up DS to app data transfer via a file. */
typedef struct {
TW_STR255 FileName;
TW_UINT16 Format; /* Any TWFF_ constant */
TW_INT16 VRefNum; /* Used for Mac only */
} TW_SETUPFILEXFER, FAR * pTW_SETUPFILEXFER;
/* DAT_SETUPMEMXFER. Sets up DS to app data transfer via a memory buffer. */
typedef struct {
TW_UINT32 MinBufSize;
TW_UINT32 MaxBufSize;
TW_UINT32 Preferred;
} TW_SETUPMEMXFER, FAR * pTW_SETUPMEMXFER;
/* DAT_STATUS. App gets detailed status info from a data source with this. */
typedef struct {
TW_UINT16 ConditionCode; /* Any TWCC_ constant */
TW_UINT16 Reserved; /* Future expansion space */
} TW_STATUS, FAR * pTW_STATUS;
/* DAT_USERINTERFACE. Coordinates UI between app and data source. */
typedef struct {
TW_BOOL ShowUI; /* TRUE if DS should bring up its UI */
TW_BOOL ModalUI; /* For Mac only - true if the DS's UI is modal */
TW_HANDLE hParent; /* For windows only - App window handle */
} TW_USERINTERFACE, FAR * pTW_USERINTERFACE;
/* SDH - 03/21/95 - TWUNK */
/* DAT_TWUNKIDENTITY. Provides DS identity and 'other' information necessary */
/* across thunk link. */
typedef struct {
TW_IDENTITY identity; /* Identity of data source. */
TW_STR255 dsPath; /* Full path and file name of data source. */
} TW_TWUNKIDENTITY, FAR * pTW_TWUNKIDENTITY;
/* SDH - 03/21/95 - TWUNK */
/* Provides DS_Entry parameters over thunk link. */
typedef struct
{
TW_INT8 destFlag; /* TRUE if dest is not NULL */
TW_IDENTITY dest; /* Identity of data source (if used) */
TW_INT32 dataGroup; /* DSM_Entry dataGroup parameter */
TW_INT16 dataArgType; /* DSM_Entry dataArgType parameter */
TW_INT16 message; /* DSM_Entry message parameter */
TW_INT32 pDataSize; /* Size of pData (0 if NULL) */
// TW_MEMREF pData; /* Based on implementation specifics, a */
/* pData parameter makes no sense in this */
/* structure, but data (if provided) will be*/
/* appended in the data block. */
} TW_TWUNKDSENTRYPARAMS, FAR * pTW_TWUNKDSENTRYPARAMS;
/* SDH - 03/21/95 - TWUNK */
/* Provides DS_Entry results over thunk link. */
typedef struct
{
TW_UINT16 returnCode; /* Thunker DsEntry return code. */
TW_UINT16 conditionCode; /* Thunker DsEntry condition code. */
TW_INT32 pDataSize; /* Size of pData (0 if NULL) */
// TW_MEMREF pData; /* Based on implementation specifics, a */
/* pData parameter makes no sense in this */
/* structure, but data (if provided) will be*/
/* appended in the data block. */
} TW_TWUNKDSENTRYRETURN, FAR * pTW_TWUNKDSENTRYRETURN;
/* WJD - 950818 */
/* Added for 1.6 Specification */
/* TWAIN 1.6 CAP_SUPPORTEDCAPSEXT structure */
typedef struct
{
TW_UINT16 Cap; /* Which CAP/ICAP info is relevant to */
TW_UINT16 Properties; /* Messages this CAP/ICAP supports */
} TW_CAPEXT, FAR * pTW_CAPEXT;
/****************************************************************************
* Generic Constants *
****************************************************************************/
#define TWON_PROTOCOLMINOR 6 /* Changed for Version 1.6 */
#define TWON_PROTOCOLMAJOR 1
#define TWON_ARRAY 3 /* indicates TW_ARRAY container */
#define TWON_ENUMERATION 4 /* indicates TW_ENUMERATION container */
#define TWON_ONEVALUE 5 /* indicates TW_ONEVALUE container */
#define TWON_RANGE 6 /* indicates TW_RANGE container */
#define TWON_ICONID 962 /* res Id of icon used in USERSELECT lbox */
#define TWON_DSMID 461 /* res Id of the DSM version num resource */
#define TWON_DSMCODEID 63 /* res Id of the Mac SM Code resource */
#define TWON_DONTCARE8 0xff
#define TWON_DONTCARE16 0xffff
#define TWON_DONTCARE32 0xffffffff
/* Flags used in TW_MEMORY structure. */
#define TWMF_APPOWNS 0x1
#define TWMF_DSMOWNS 0x2
#define TWMF_DSOWNS 0x4
#define TWMF_POINTER 0x8
#define TWMF_HANDLE 0x10
/* Palette types for TW_PALETTE8 */
#define TWPA_RGB 0
#define TWPA_GRAY 1
#define TWPA_CMY 2
/* There are four containers used for capabilities negotiation:
* TWON_ONEVALUE, TWON_RANGE, TWON_ENUMERATION, TWON_ARRAY
* In each container structure ItemType can be TWTY_INT8, TWTY_INT16, etc.
* The kind of data stored in the container can be determined by doing
* DCItemSize[ItemType] where the following is defined in TWAIN glue code:
* DCItemSize[]= { sizeof(TW_INT8),
* sizeof(TW_INT16),
* etc.
* sizeof(TW_UINT32) };
*
*/
#define TWTY_INT8 0x0000 /* Means Item is a TW_INT8 */
#define TWTY_INT16 0x0001 /* Means Item is a TW_INT16 */
#define TWTY_INT32 0x0002 /* Means Item is a TW_INT32 */
#define TWTY_UINT8 0x0003 /* Means Item is a TW_UINT8 */
#define TWTY_UINT16 0x0004 /* Means Item is a TW_UINT16 */
#define TWTY_UINT32 0x0005 /* Means Item is a TW_UINT32 */
#define TWTY_BOOL 0x0006 /* Means Item is a TW_BOOL */
#define TWTY_FIX32 0x0007 /* Means Item is a TW_FIX32 */
#define TWTY_FRAME 0x0008 /* Means Item is a TW_FRAME */
#define TWTY_STR32 0x0009 /* Means Item is a TW_STR32 */
#define TWTY_STR64 0x000a /* Means Item is a TW_STR64 */
#define TWTY_STR128 0x000b /* Means Item is a TW_STR128 */
#define TWTY_STR255 0x000c /* Means Item is a TW_STR255 */
/****************************************************************************
* Capability Constants *
****************************************************************************/
/* ICAP_BITORDER values (BO_ means Bit Order) */
#define TWBO_LSBFIRST 0
#define TWBO_MSBFIRST 1
/* ICAP_COMPRESSION values (CP_ means ComPression ) */
#define TWCP_NONE 0
#define TWCP_PACKBITS 1
#define TWCP_GROUP31D 2 /* Follows CCITT spec (no End Of Line) */
#define TWCP_GROUP31DEOL 3 /* Follows CCITT spec (has End Of Line) */
#define TWCP_GROUP32D 4 /* Follows CCITT spec (use cap for K Factor) */
#define TWCP_GROUP4 5 /* Follows CCITT spec */
#define TWCP_JPEG 6 /* Use capability for more info */
#define TWCP_LZW 7 /* Must license from Unisys and IBM to use */
/* ICAP_IMAGEFILEFORMAT values (FF_means File Format) */
#define TWFF_TIFF 0 /* Tagged Image File Format */
#define TWFF_PICT 1 /* Macintosh PICT */
#define TWFF_BMP 2 /* Windows Bitmap */
#define TWFF_XBM 3 /* X-Windows Bitmap */
#define TWFF_JFIF 4 /* JPEG File Interchange Format */
/* ICAP_FILTER values (FT_ means Filter Type) */
#define TWFT_RED 0
#define TWFT_GREEN 1
#define TWFT_BLUE 2
#define TWFT_NONE 3
#define TWFT_WHITE 4
#define TWFT_CYAN 5
#define TWFT_MAGENTA 6
#define TWFT_YELLOW 7
#define TWFT_BLACK 8
/* ICAP_LIGHTPATH values (LP_ means Light Path) */
#define TWLP_REFLECTIVE 0
#define TWLP_TRANSMISSIVE 1
/* ICAP_LIGHTSOURCE values (LS_ means Light Source) */
#define TWLS_RED 0
#define TWLS_GREEN 1
#define TWLS_BLUE 2
#define TWLS_NONE 3
#define TWLS_WHITE 4
#define TWLS_UV 5
#define TWLS_IR 6
/* ICAP_ORIENTATION values (OR_ means ORientation) */
#define TWOR_ROT0 0
#define TWOR_ROT90 1
#define TWOR_ROT180 2
#define TWOR_ROT270 3
#define TWOR_PORTRAIT TWOR_ROT0
#define TWOR_LANDSCAPE TWOR_ROT270
/* ICAP_PLANARCHUNKY values (PC_ means Planar/Chunky ) */
#define TWPC_CHUNKY 0
#define TWPC_PLANAR 1
/* ICAP_PIXELFLAVOR values (PF_ means Pixel Flavor) */
#define TWPF_CHOCOLATE 0 /* zero pixel represents darkest shade */
#define TWPF_VANILLA 1 /* zero pixel represents lightest shade */
/* ICAP_PIXELTYPE values (PT_ means Pixel Type) */
#define TWPT_BW 0 /* Black and White */
#define TWPT_GRAY 1
#define TWPT_RGB 2
#define TWPT_PALETTE 3
#define TWPT_CMY 4
#define TWPT_CMYK 5
#define TWPT_YUV 6
#define TWPT_YUVK 7
#define TWPT_CIEXYZ 8
/* ICAP_SUPPORTEDSIZES values (SS_ means Supported Sizes) */
#define TWSS_NONE 0
#define TWSS_A4LETTER 1
#define TWSS_B5LETTER 2
#define TWSS_USLETTER 3
#define TWSS_USLEGAL 4
/* Added 1.5 */
#define TWSS_A5 5
#define TWSS_B4 6
#define TWSS_B6 7
#define TWSS_B 8
/* ICAP_XFERMECH values (SX_ means Setup XFer) */
#define TWSX_NATIVE 0
#define TWSX_FILE 1
#define TWSX_MEMORY 2
/* ICAP_UNITS values (UN_ means UNits) */
#define TWUN_INCHES 0
#define TWUN_CENTIMETERS 1
#define TWUN_PICAS 2
#define TWUN_POINTS 3
#define TWUN_TWIPS 4
#define TWUN_PIXELS 5
/* Added 1.5 */
/* ICAP_BITDEPTHREDUCTION values (BR_ means Bitdepth Reduction) */
#define TWBR_THRESHOLD 0
#define TWBR_HALFTONE 1
#define TWBR_CUSTHALFTONE 2
#define TWBR_DIFFUSION 3
/****************************************************************************
* Country Constants *
****************************************************************************/
#define TWCY_AFGHANISTAN 1001
#define TWCY_ALGERIA 213
#define TWCY_AMERICANSAMOA 684
#define TWCY_ANDORRA 033
#define TWCY_ANGOLA 1002
#define TWCY_ANGUILLA 8090
#define TWCY_ANTIGUA 8091
#define TWCY_ARGENTINA 54
#define TWCY_ARUBA 297
#define TWCY_ASCENSIONI 247
#define TWCY_AUSTRALIA 61
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -