ImageGear for C and C++ on Windows v19.10 - Updated
IG_ISIS_drv_put_data
API Reference Guide > ISIS Component API Reference > ISIS Component Functions Reference > Single-Step Driver Control Functions > IG_ISIS_drv_put_data

Transfer data bytes.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_ISIS_drv_put_data(
        HISISDRV hDriver,
        LPBYTE lpBuffer,
        WORD wCount,
        AT_MODE nFlags
);

Arguments:

Name Type Description
hDriver HISISDRV The handle of the driver from which data is being transferred.
lpBuffer LPBYTE A pointer to the buffer that will hold the data to be transferred during the operation.
wCount WORD The number of bytes to transfer each time the IG_ISIS_drv_put_data function is called. wCount must be at least 1 and no more than 32767.
nFlags AT_MODE

A flag that specifies whether or not to wait until the number of bytes specified in wCount is available before transferring the data. The values of nFlags are as follows: (wWait Meaning)

  • IG_ISIS_DRV_DATAWAIT or 0 Wait until nFlags bytes are available or IG_ISIS_ERR_ENDZONE occurs before transferring any data.
  • IG_ISIS_DRV_DATANOWAIT Return as many bytes as are immediately available or nFlags bytes, whichever is less. Note that with many scanner drivers, IG_ISIS_drv_put_data waits for wCount bytes even when wWait is set to IG_ISIS_DRV_DATANOWAIT.

Return Value:

Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.

Supported Raster Image Formats:

This function does not process image pixels.

Remarks:

The IG_ISIS_drv_put_data function transfers data into or out of a driver.

The IG_ISIS_drv_put_data function is very similar in operation to the IG_ISIS_drv_run_step function. The primary difference is that IG_ISIS_drv_run_step operates on a handle to a run that has been established by a IG_ISIS_drv_run_start function while IG_ISIS_drv_put_data operates directly on a handle to a driver. Internally, a driver uses IG_ISIS_drv_put_data to transfer data to the next driver in an ISIS pipe. As an application developer, the following are cases when you may want to consider using IG_ISIS_drv_put_data:

IG_ISIS_drv_put_data must be called repeatedly until it returns a value of MAKELONG(0,IG_ISIS_ERR_ENDZONE) indicating that the run is complete. The wCount parameter of IG_ISIS_drv_put_data can be set to any value that fits in with your application's memory environment; an 8K byte buffer generally gives optimum performance.

You must check the return value of the IG_ISIS_drv_put_data and wait for IG_ISIS_ERR_ENDZONE before assuming data transfer is complete. Some three-pass color scanners take minutes to reset after each pass. Furthermore, when each pass completes, depending on the driver and the status of the wWait flag, you may get the remainder of the bytes from the current pass, or you may not get the remainder of the bytes until the scanner has completed enough of the next pass to give you wCount bytes (in which case part of the data in lpcBuffer will be one color and part will be another color).

IG_ISIS_drv_put_data is one of several hierarchical data transfer functions that are called automatically by the IG_ISIS_drv_run_zone function. The hierarchy of data transfer functions is:

 
Copy Code
IG_ISIS_drv_start_stack     IG_ISIS_drv_start_page          IG_ISIS_drv_start_zone               IG_ISIS_drv_forward                    IG_ISIS_drv_start_data                         IG_ISIS_drv_put_data          IG_ISIS_drv_end_zone     IG_ISIS_drv_end_pageIG_ISIS_drv_end_stack

IG_ISIS_drv_start_data must be called before calling IG_ISIS_drv_put_data.

It is possible (although not recommended) to use IG_ISIS_drv_put_data to put data from a scanner into memory without using a minidriver. This will work only when the scanner outputs data in the format that you want, and no other drivers are used to modify the data. If the scanner outputs uncompressed data and you need G4 data, you cannot use this function.

See Also:

IG_ISIS_drv_run_step

IG_ISIS_drv_start_data