LibInsane: lis_option_descriptor Struct Reference

| LibInsane 1.0.10 Cross-platform Cross-API Cross-driver Cross-image-scanner Image Scan Library

Loading...
Searching...
No Matches
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:
[legend]

## Data Fields
const char * | name
const char * | title
const char * | desc
int | capabilities
| Option capabilities.
struct { |
enum lis_value_type type |
enum lis_unit unit |
} | value |
| Description of the type of values for this option.
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.
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:

- LIS_CAP_EMULATED
- LIS_CAP_AUTOMATIC
- LIS_CAP_HW_SELECT
- LIS_CAP_SW_SELECT
- LIS_CAP_INACTIVE

Definition at line 148 of file capi.h.

## ◆ [struct]

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]

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] | opt | option for which we want the value.
  [out] | value | option value. Type is defined by lis_option_descriptor::type .

Return values

  LIS_OK | value successful read. See LIS_IS_OK.
  LIS_ACCESS_DENIED | value cannot be read because the option is inactive. value may or may not be set. See LIS_IS_ERROR.
  LIS_IO_ERROR | things are going the wrong way. value may or may not be set. See LIS_IS_ERROR.

Definition at line 181 of file capi.h.

## ◆ list

struct lis_value_list lis_option_descriptor::list

If lis_option_descriptor::type == LIS_CONSTRAINT_LIST.

Definition at line 181 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]

union { ... } lis_option_descriptor::possible

Content undefined if lis_option_descriptor::type == LIS_CONSTRAINT_NONE.

## ◆ range

struct lis_value_range lis_option_descriptor::range

If lis_option_descriptor::type == LIS_CONSTRAINT_RANGE.

Definition at line 176 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] | opt | option for which we want the value.
  [in] | value | option 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_OK | value has been successfully set. See LIS_IS_OK.
  LIS_APPROXIMATE_VALUE | value has been successfully set, but value has been approximated. See LIS_IS_OK.
  LIS_ACCESS_DENIED | option is read-only. See LIS_IS_ERROR.
  LIS_INVALID_VALUE | value doesn't match in type or doesn't fit in expected constraints. See LIS_IS_ERROR.

Definition at line 181 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 154 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 155 of file capi.h.

## ◆ [struct]

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:

- /build/libinsane/src/libinsane/subprojects/libinsane/include/libinsane/capi.h