Home › Forums › TWAIN Classic › memory buffer transfer
- This topic has 0 replies, 1 voice, and was last updated 15 years, 11 months ago by guimadox.
- AuthorPosts
I would like to know if there is the possibility to have more information (or a piece of code) on the transfer of compressed images from a dataSource.
Suppose I want to emulate or to drive a scanner that is able to perform hardware compression (Jpeg, TIFFG4 … ).
I understand the I could use the buffered memory transfer through the triplet:
DG_IMAGE, DAT_IMAGEMEMXFER, MSG_GET and get the image in the buffer referenced by:
pMyXmemStruct->Memory.TheMem (*)but the question is:
In my own DataSource, what should I write in the buffer? A Jpeg file with or without header? or what? And in the case of a a TIFFG4 image?
Thank you in advance
guimadox
(*) here are the data structures used by the buffered memory transfer
typedef struct {
TW_UINT16 Compression; /* How the data is compressed */
TW_UINT32 BytesPerRow; /* Number of bytes in a row of data */
TW_UINT32 Columns; /* How many columns */
TW_UINT32 Rows; /* How many rows */
TW_UINT32 XOffset; /* How far from the side of the image */
TW_UINT32 YOffset; /* How far from the top of the image */
TW_UINT32 BytesWritten; /* How many bytes written in Memory */
TW_MEMORY Memory; /* Mem struct used to pass actual image data */
} TW_IMAGEMEMXFER, FAR * pTW_IMAGEMEMXFER;and:
typedef struct {
TW_UINT32 Flags; /* Any combination of the TWMF_ constants. */
TW_UINT32 Length; /* Number of bytes stored in buffer TheMem. */
TW_MEMREF TheMem; /* Pointer or handle to the allocated memory buffer. */
} TW_MEMORY, FAR * pTW_MEMORY;- AuthorPosts