1 #ifndef __LIBINSANE_CAPI_H
2 #define __LIBINSANE_CAPI_H
125 #define LIS_CAP_EMULATED (1<<0)
126 #define LIS_CAP_AUTOMATIC (1<<1)
127 #define LIS_CAP_HW_SELECT (1<<2)
128 #define LIS_CAP_SW_SELECT (1<<3)
133 #define LIS_CAP_INACTIVE (1<<4)
135 #define LIS_OPT_IS_READABLE(opt_desc) (!((opt_desc)->capabilities & LIS_CAP_INACTIVE))
136 #define LIS_OPT_IS_WRITABLE(opt_desc) ((opt_desc)->capabilities & LIS_CAP_SW_SELECT)
207 #define LIS_SET_FLAG_INEXACT (1<<0)
208 #define LIS_SET_FLAG_MUST_RELOAD_OPTIONS (1<<1)
209 #define LIS_SET_FLAG_MUST_RELOAD_PARAMS (1<<2)
@ LIS_DEVICE_LOCATIONS_LOCAL_ONLY
@ LIS_DEVICE_LOCATIONS_ANY
lis_value_type
Variable type.
lis_img_format
Image format.
@ LIS_IMG_FORMAT_GRAYSCALE_8
@ LIS_IMG_FORMAT_FLASHPIX
@ LIS_IMG_FORMAT_RAW_RGB_24
Raw image, 24bits per pixel.
@ LIS_IMG_FORMAT_MEMORYBMP
void(* cleanup)(struct lis_api *impl)
cleanup the implementation.
enum lis_error(* list_devices)(struct lis_api *impl, enum lis_device_locations locs, struct lis_device_descriptor ***dev_infos)
Look for paper eaters.
enum lis_error(* get_device)(struct lis_api *impl, const char *dev_id, struct lis_item **item)
Open the access to a device.
Basic informations regarding a scanner.
char * dev_id
Device id to use to identify and access the scanner.
void(* close)(struct lis_item *self)
Close the access to a scanner.
enum lis_error(* scan_start)(struct lis_item *self, struct lis_scan_session **session)
Starts a scan session.
enum lis_error(* get_options)(struct lis_item *self, struct lis_option_descriptor ***descs)
Get item's options.
enum lis_error(* get_children)(struct lis_item *self, struct lis_item ***children)
Get item's children (usually scan sources).
Describes a scanner or source option and provides callback to read or change its value.
struct lis_option_descriptor::@1 constraint
Restrictions defining the possible values for this option.
struct lis_value_range range
union lis_option_descriptor::@1::@4 possible
struct lis_value_list list
struct lis_option_descriptor::@2 fn
struct lis_option_descriptor::@0 value
Description of the type of values for this option.
enum lis_error(* set_value)(struct lis_option_descriptor *self, union lis_value value, int *set_flags)
set the option value.
int capabilities
Option capabilities.
enum lis_error(* get_value)(struct lis_option_descriptor *self, union lis_value *value)
return the option value.
Describes what will be returned when scanning.
int height
Height of the image in pixels.
enum lis_img_format format
Image format. This value is guaranteed to be true when scanning.
size_t image_size
Estimated image size in bytes. Can be used to pre-allocate memory.
int width
Width of the image in pixels. This value is guaranteed to be true when scanning.
void(* cancel)(struct lis_scan_session *session)
Cancel the current scan session.
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.
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 ret...
enum lis_error(* scan_read)(struct lis_scan_session *session, void *out_buffer, size_t *buffer_size)
Read a chunk of the scanned image.
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 eac...
enum lis_img_format format