LibInsane  1.0.10
Cross-platform Cross-API Cross-driver Cross-image-scanner Image Scan Library
Data Fields
lis_scan_session Struct Reference

#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...
 

Detailed Description

Definition at line 261 of file capi.h.

Field Documentation

◆ cancel

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.

Definition at line 338 of file capi.h.

◆ end_of_feed

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.

Definition at line 290 of file capi.h.

◆ end_of_page

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().

Definition at line 297 of file capi.h.

◆ get_scan_parameters

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).

Parameters
[in]selfItem from which the scan will be done.
[out]parametersEstimation of what will be scanned.
Return values
LIS_OKparameters has been set.

Definition at line 257 of file capi.h.

◆ scan_read

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.

Parameters
[in]sessionScan session.
[out]out_bufferImage chunk.
[in,out]out_buffer_sizeIn: 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.
Warning
You're advised to NOT use LIS_IS_OK(). You can however use safely LIS_IS_ERROR().
You should manage every non-error return value carefully.
It may return 0 bytes. It does not mean end-of-page/end-of-page. It just means no data at the moment.
Return values
LIS_OKA chunk of the current page/image has been read.
LIS_CANCELLEDScan 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_PAGEA whole page has been read. Call again lis_scan_session::scan_read() to read the next page.
LIS_END_OF_FEEDA whole page feed has been read. Do not call lis_scan_session::cancel().
LIS_WARMING_UPScanner is warming up. No data available yet. Keep calling lis_scan_session::scan_read() until there is.
Warning
This operation may take many seconds.

Definition at line 297 of file capi.h.


The documentation for this struct was generated from the following file: