DATATRANSFER

Summary

The DATATRANSFER structure provides information about data transferring.

Syntax

typedef struct _DATATRANSFER 
{ 
   L_UINT uStructSize; 
   L_INT nFillOrder; 
   L_INT nBufMemCompression; 
   L_INT nTransferMode; 
   L_INT nScanFileFormat; 
   L_INT nMemBufSize; 
   L_BOOL bSaveToOneFile; 
   L_BOOL bAppendToFile; 
   L_BOOL bDumpMemBufsToFile; 
   L_TCHAR szFileName [250]; 
} DATATRANSFER,  * pDATATRANSFER; 

Members

L_UINT uStructSize

Size of this structure in bytes, for versioning. Use the sizeof() operator to calculate this value.

L_INT nFillOrder

Indicates how bytes in the image are to be filled by the source. Possible values are (according to the TWAIN specification):

Value Meaning
TWBO_LSBFIRST Bytes are to be transferred with the least significant byte first.
TWBO_MSBFIRST Bytes are to be transferred with the most significant byte first.

L_INT nBufMemCompression

Specifies the compression to be used when having the transfer mode set to be memory. Possible values are (according to the TWAIN specification):

Value Meaning
TWCP_NONE No compression is to be used.
TWCP_PACKBITS Pack Bits compression.
TWCP_GROUP31D CCITT Group 3 compression with no End of Line.
TWCP_GROUP31DEOL CCITT Group 3 compression with End of Line.
TWCP_GROUP32D CCITT Group 3 compression (use cap for K Factor).
TWCP_GROUP4 CCITT Group 4 compression.
TWCP_JPEG JPEG compression.
TWCP_LZW LZW compression (like gifs).
TWCP_JBIG JBIG compression, used mostly for bitonal images.
TWCP_PNG PNG compressed.
TWCP_RLE4 RLE4 compression.
TWCP_RLE8 RLE8 compression.
TWCP_BITFIELDS Bit Fields compression.

L_INT nTransferMode

Transfer mode to be used by the TWAIN source. Possible values are (according to the TWAIN specification):

Value Meaning
TWSX_NATIVE Native transfer mode.
TWSX_MEMORY Memory buffered transfer mode. The source will be transferring strips of data to the application according to the buffer size given.
TWSX_FILE File transfer mode. This will use a specified file to have the image data saved to. This will have a certain format specified by the properties.

L_INT nScanFileFormat

Output file format. Valid values depend on the transfer mode used.

L_INT nMemBufSize

Specifies the memory buffer size to be used in data transfer.

L_BOOL bSaveToOneFile

Flag that indicates whether to save multiple pages to a single file. Possible values are:

Value Meaning
TRUE Save to a single file.
FALSE Do not save to a single file.

L_BOOL bAppendToFile

Flag that indicates whether to append pages to the end of the file when saving a multipage file. Possible values are:

Value Meaning
TRUE Append pages to the end of the file.
FALSE Do not append pages to the end of the file.

L_BOOL bDumpMemBufsToFile

Flag that indicates whether to use the file name specified in szFileName field to dump the memory buffers received from the scanner. In this case the Bitmap Handle will not get the Bitmap Data, all the data will be saved to the file. Possible values:

Value Meaning
TRUE Use file name.
FALSE Do not use file name.

L_TCHAR szFileName

Character string that contains the file name used in the file transfer mode. Use this member only if:

The nTransferMode member is set to TWSX_FILE.

Or

The nTransferMode member is set to TWSX_MEMORY and the bDumpMemBufsToFile member is set to TRUE.

Comments

pDATATRANSFER is a pointer to a DATATRANSFER structure. Where the function parameter type is pDATATRANSFER, you can declare a DATATRANSFER variable, update the structure's fields and pass the variable's address in the parameter. Declaring a pDATATRANSFER variable is necessary only if your program requires a pointer.

If the nTransferMode member value is set to TWSX_MEMORY and the bDumpMemBufsToFile member value is set to TRUE, then the L_TwainAcquire and L_TwainAcquireList functions will dump the memory buffers received from the scanner (whether compressed or not) directly to the output file specified by szFileName member.

If the nTransferMode member value is set to TWSX_MEMORY, the nBufMemCompression member is set to values other than TWCP_NONE, and the bDumpMemBufsToFile member value is set to FALSE, then the L_TwainAcquire and L_TwainAcquireList functions will decompress the memory buffers received from the scanner, and generate a BITMAPHANDLE as a result.

This generated BITMAPHANDLE will be returned in the pBitmap parameter of LTWAINBITMAPCALLBACK function when it is fired by calling the L_TwainAcquire function, or added to the bitmap list pointed to by the hBitmap parameter of L_TwainAcquireList function when this function is being used.

Usage

Help Version 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS TWAIN C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.