Next Up Previous Contents

4.4 Code Flow

Code Flow

sane_init()
sane_get_devices()
- select the scanner you want to use

/ sane_open();
|
| / - use
| | sane_get_option_descriptor() and
| | sane_control_option()
| \ to set the options you would like.
|
| / sane_start()        set up everything for the scan.
| | sane_get_parms()    get the parameters. If you don't like them,
| |                      you can go to sane_stop() ...
| | - if params is not NULL use
| | sane-read()
| | to get the image, until it returns EOF or
| | a user pressed the cancel-button.
| \ go back to sane_start,in case there are more channels or images.
| sane_cancel()
|
\ sane_close()

sane_exit()

sane_init and sane_exit are intended to set up the whole library. This is especially needed for the wrapper library that will detect all available sources here.

sane_get_devices will return all found devices.

When you have chosen the device to use, you


Next Up Previous Contents