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

#include <capi.h>

Data Fields

const char * name
 
enum lis_item_type type
 
enum lis_error(* get_children )(struct lis_item *self, struct lis_item ***children)
 Get item's children (usually scan sources). More...
 
enum lis_error(* get_options )(struct lis_item *self, struct lis_option_descriptor ***descs)
 Get item's options. More...
 
enum lis_error(* scan_start )(struct lis_item *self, struct lis_scan_session **session)
 Starts a scan session. More...
 
void(* close )(struct lis_item *self)
 Close the access to a scanner. More...
 

Detailed Description

Represents either a device (a scanner, a scanner-printer, etc) or a sub-device (Flatbed of a scanner, Automatic document feeder of a printer, etc).

Similar to a WIAItem in WIA API.

Definition at line 356 of file capi.h.

Field Documentation

◆ close

void(* lis_item::close) (struct lis_item *self)

Close the access to a scanner.

Will free all the child items of this root item and all the option descriptors. No need to call this method on child items (will do nothing). Call it only on the root item.

Will also be done automatically if you call lis_api::cleanup(). (TODO(Jflesch): normalizer)

Definition at line 408 of file capi.h.

◆ get_children

enum lis_error(* lis_item::get_children) (struct lis_item *self, struct lis_item ***children)

Get item's children (usually scan sources).

Without workarounds or normalizers:

  • Sane: will return an empty list.
  • WIA: will return device sources (Flatbed, Automatic Document Feeder, etc).

Warning: When calling this method, previous child items obtained from the same item with this method may be invalidated/freed.

Parameters
[in]selfUsually a scanner (see lis_api::get_device()).
[out]childrenUsually scanner sources. List will be NULL terminated.
Return values
LIS_OKchildren has been set to a valid array of items. See LIS_IS_OK.

Definition at line 357 of file capi.h.

◆ get_options

enum lis_error(* lis_item::get_options) (struct lis_item *self, struct lis_option_descriptor ***descs)

Get item's options.

Warning: When calling this method, previous option descriptors obtained from the same item with this method may be invalidated/freed !

Parameters
[in]selfItem from which we want the option list.
[out]descsOption list. NULL terminated.
Return values
LIS_OKdescs has been set.

Definition at line 357 of file capi.h.

◆ name

const char* lis_item::name

Item name

Definition at line 357 of file capi.h.

◆ scan_start

enum lis_error(* lis_item::scan_start) (struct lis_item *self, struct lis_scan_session **session)

Starts a scan session.

Warning
This operation may take many seconds.
Parameters
[in]selfItem from which to scan.
[out]sessionScan session.
Return values
LIS_OKScan of the first page has started.

Definition at line 357 of file capi.h.

◆ type

enum lis_item_type lis_item::type

Definition at line 357 of file capi.h.


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