![]() |
LibInsane
1.0.10
Cross-platform Cross-API Cross-driver Cross-image-scanner Image Scan Library
|
#include <capi.h>
Data Fields | |
enum lis_error(* | get_scan_parameters )(struct lis_scan_session *self, struct lis_scan_parameters *parameters) |
Returns a description of what will be returned when scanning. More... | |
int(* | end_of_feed )(struct lis_scan_session *session) |
Indicates if we have reached the end of the feed. Should be called at least each time end_of_page returns 1. More... | |
int(* | end_of_page )(struct lis_scan_session *session) |
Indicates if we have reached the end of the page being currently scanned. Should be called before each call to scan_read(). If an error must occur, it will occur on scan_read(). More... | |
enum lis_error(* | scan_read )(struct lis_scan_session *session, void *out_buffer, size_t *buffer_size) |
Read a chunk of the scanned image. More... | |
void(* | cancel )(struct lis_scan_session *session) |
Cancel the current scan session. More... | |
void(* lis_scan_session::cancel) (struct lis_scan_session *session) |
Cancel the current scan session.
This function stops the current scan session and releases any resource related to the scan session.
This function can safely be called at the end of a scan session to release resources. However, beware: Not all drivers handle gracefully scan cancellation while still scanning. Instead, you are advised to wait for the end of scan session and discard the images.
int(* lis_scan_session::end_of_feed) (struct lis_scan_session *session) |
Indicates if we have reached the end of the feed. Should be called at least each time end_of_page returns 1.
int(* lis_scan_session::end_of_page) (struct lis_scan_session *session) |
Indicates if we have reached the end of the page being currently scanned. Should be called before each call to scan_read(). If an error must occur, it will occur on scan_read().
enum lis_error(* lis_scan_session::get_scan_parameters) (struct lis_scan_session *self, struct lis_scan_parameters *parameters) |
Returns a description of what will be returned when scanning.
This is only an estimation.
Format is guaranteed to be right.
Width is always guaranteed
Beware: Height is never guaranteed (usually the scan will be shorted, but it may also be longer !).
Beware: Height may be -1 ! In that case, it means the height is not known beforehand (for instance with handheld scanners).
[in] | self | Item from which the scan will be done. |
[out] | parameters | Estimation of what will be scanned. |
LIS_OK | parameters has been set. |
enum lis_error(* lis_scan_session::scan_read) (struct lis_scan_session *session, void *out_buffer, size_t *buffer_size) |
Read a chunk of the scanned image.
[in] | session | Scan session. |
[out] | out_buffer | Image chunk. |
[in,out] | out_buffer_size | In: maximum number of bytes that can be put in out_buffer. Out: number of bytes read. If the value is 0, it does not mean end of page or end of file. It just means there was no data to ready yet. |
LIS_OK | A chunk of the current page/image has been read. |
LIS_CANCELLED | Scan has been cancelled by lis_scan_session::cancel() or by hardware. You can throw the image chunks you got away. Do not call again scan_read(). Do not call lis_scan_session::scan_read() or lis_scan_session::cancel() again. |
LIS_END_OF_PAGE | A whole page has been read. Call again lis_scan_session::scan_read() to read the next page. |
LIS_END_OF_FEED | A whole page feed has been read. Do not call lis_scan_session::cancel(). |
LIS_WARMING_UP | Scanner is warming up. No data available yet. Keep calling lis_scan_session::scan_read() until there is. |