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

Describes a scanner or source option and provides callback to read or change its value. More...

#include <capi.h>

Collaboration diagram for lis_option_descriptor:
Collaboration graph
[legend]

Data Fields

const char * name
 
const char * title
 
const char * desc
 
int capabilities
 Option capabilities. More...
 
struct {
   enum lis_value_type   type
 
   enum lis_unit   unit
 
value
 Description of the type of values for this option. More...
 
struct {
enum  { LIS_CONSTRAINT_NONE , LIS_CONSTRAINT_RANGE , LIS_CONSTRAINT_LIST }
 
   enum lis_option_descriptor:: { ... }    type
 
   union {
      struct lis_value_range   range
 
      struct lis_value_list   list
 
   }   possible
 
constraint
 Restrictions defining the possible values for this option. More...
 
struct {
   enum lis_error(*   get_value )(struct lis_option_descriptor
      *self, union lis_value *value)
 return the option value. More...
 
   enum lis_error(*   set_value )(struct lis_option_descriptor
      *self, union lis_value value,
      int *set_flags)
 set the option value. More...
 
fn
 

Detailed Description

Describes a scanner or source option and provides callback to read or change its value.

Definition at line 120 of file capi.h.

Field Documentation

◆ capabilities

int lis_option_descriptor::capabilities

Option capabilities.

Bit fields:

Definition at line 148 of file capi.h.

◆ 

struct { ... } lis_option_descriptor::constraint

Restrictions defining the possible values for this option.

◆ desc

const char* lis_option_descriptor::desc

Human readable description (usually in English).

Definition at line 123 of file capi.h.

◆ 

struct { ... } lis_option_descriptor::fn

Functions to read and set the option value

◆ get_value

enum lis_error(* lis_option_descriptor::get_value) (struct lis_option_descriptor *self, union lis_value *value)

return the option value.

No need to free the value. However further calls to this library functions may modify the value. Depending on the backend and the driver, setting another value may also change this value. If you need to keep the value, you should copy the value.

Parameters
[in]optoption for which we want the value.
[out]valueoption value. Type is defined by lis_option_descriptor::type .
Return values
LIS_OKvalue successful read. See LIS_IS_OK.
LIS_ACCESS_DENIEDvalue cannot be read because the option is inactive. value may or may not be set. See LIS_IS_ERROR.
LIS_IO_ERRORthings are going the wrong way. value may or may not be set. See LIS_IS_ERROR.

Definition at line 148 of file capi.h.

◆ list

struct lis_value_list lis_option_descriptor::list

If lis_option_descriptor::type == LIS_CONSTRAINT_LIST.

Definition at line 148 of file capi.h.

◆ name

const char* lis_option_descriptor::name

option name / identifier (ex: "source", "resolution", etc).

Definition at line 121 of file capi.h.

◆ 

union { ... } lis_option_descriptor::possible

◆ range

struct lis_value_range lis_option_descriptor::range

If lis_option_descriptor::type == LIS_CONSTRAINT_RANGE.

Definition at line 148 of file capi.h.

◆ set_value

enum lis_error(* lis_option_descriptor::set_value) (struct lis_option_descriptor *self, union lis_value value, int *set_flags)

set the option value.

Parameters
[in]optoption for which we want the value.
[in]valueoption value. Type is defined by lis_option_descriptor::type.
[out]set_flags(can be NULL). Indicates side effect of setting this value.
Return values
LIS_OKvalue has been successfully set. See LIS_IS_OK.
LIS_APPROXIMATE_VALUEvalue has been successfully set, but value has been approximated. See LIS_IS_OK.
LIS_ACCESS_DENIEDoption is read-only. See LIS_IS_ERROR.
LIS_INVALID_VALUEvalue doesn't match in type or doesn't fit in expected constraints. See LIS_IS_ERROR.

Definition at line 148 of file capi.h.

◆ title

const char* lis_option_descriptor::title

Human readable title (usually in English).

Definition at line 122 of file capi.h.

◆ type [1/2]

enum lis_value_type lis_option_descriptor::type

Type of this option.

Definition at line 148 of file capi.h.

◆  [2/2]

enum { ... } lis_option_descriptor::type

Type of constaint

◆ unit

enum lis_unit lis_option_descriptor::unit

Unit of this value. Only useful for integers and float

Definition at line 148 of file capi.h.

◆ 

struct { ... } lis_option_descriptor::value

Description of the type of values for this option.


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