API Reference Guide > ISIS Component API Reference > ISIS Component Functions Reference > Pipe Functions > IG_ISIS_drv_load |
Load a driver into memory.
Copy Code
|
|
---|---|
AT_ERRCOUNT ACCUAPI IG_ISIS_drv_load( LPSTR lpszRoot, LPSTR lpszName, LPHISISDRV lphDriver, AT_MODE nFlags ); |
Name | Type | Description | ||
---|---|---|---|---|
lpszRoot | LPSTR | Reserved for future use. Currently lpszRoot must be (char FAR *) 0. Future implementations may allow an application to specify where to find a driver or other special information. | ||
lpszName | LPSTR |
Driver name string or pointer to a callback function.
|
||
lphDriver | LPHISISDRV | A pointer to a buffer to accept the handle to the driver returned when the driver loads. This handle references the driver until the driver is removed from memory with IG_ISIS_drv_unload. | ||
nFlags | AT_MODE |
A bit field containing one or more of the following values. Currently, four bits of nFlags are defined:
|
Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.
This function does not process image pixels.
IG_ISIS_drv_load loads a driver into memory so that it may be initialized and linked into an ISIS pipe.
You must load each driver that you intend to use, initialize it, then link it with other (previously-loaded and initialized) drivers to form an ISIS pipe. To do this, you use a combination of IG_ISIS_drv_load, IG_ISIS_drv_init, and IG_ISIS_drv_link or IG_ISIS_drv_split. For applications that require simple linear ISIS pipes with no special processing or minidrivers, it is much less work to use the IG_ISIS_drv_load_init_pipe function which can load, initialize, and link all specified drivers in one operation.
Once loaded, initialized, and linked, the driver (and all other linked drivers in the pipe) are used by IG_ISIS_run_zone to process pages as specified by each driver. For example, an application could load a scanner driver, a file compression driver, and a file writing driver to scan, compress and save a file in one operation. In this scenario, three separate drivers need to be loaded, initialized, and linked.
There are several good reasons to use the three separate functions for loading, initializing, and linking drivers as opposed to the single IG_ISIS_drv_load_init_pipe:
The foundation of using ISIS is understanding ISIS pipes. An ISIS pipe is a linked set of drivers that is established prior to any scanning or image processing. Once all desired drivers are linked, IG_ISIS_run_zone is used to invoke the pipe, causing each driver to perform its intended operation in turn. This pipe structure requires that the desired functionality be implemented as drivers, and allows large image files to be processed without copying the image data from one full-page buffer to another. The result is much faster and more efficient than alternative image processing schemes.
Driver Loading Algorithm:
The toolkit uses a special driver loading algorithm to ensure that your application loads the correct version of a driver, even when multiple versions of a driver exist. Keep in mind that some version of the driver you are trying to load may already be loaded in memory, due to some other application or another instance of your application. Once a driver is loaded, loading it again simply references the same driver with a new instance handle. It is not possible to load different copies of a file of the same name.
Each time your application loads a driver that is not already in memory, the toolkit goes through this special driver loading algorithm to:
Your application must check that the specified driver was indeed loaded by IG_ISIS_drv_load before performing any other operations. If, for example, IG_ISIS_drv_init (which should be the very next function call) tries to initialize a driver that is not loaded, unpredictable results will occur, possibly including system crashes. |