Expand description
Raw FFI bindings to libsane, the library of SANE (Scanner Access Now Easy).
The bindings are generated by bindgen from the system sane/sane.h at
build time, and libsane is linked through pkg-config (sane-backends).
For a safe API, use the libsane crate.
C enums (SANE_Status, SANE_Frame, …) are type aliases of integers
with one constant per value, because backends may return values the header
does not list. The function-like macros of sane.h are provided as
functions: SANE_VERSION_CODE, SANE_VERSION_MAJOR,
SANE_VERSION_MINOR, SANE_VERSION_BUILD, SANE_FIX,
SANE_UNFIX, SANE_OPTION_IS_ACTIVE and SANE_OPTION_IS_SETTABLE.
§System requirements
The SANE development files (libsane-dev on Debian and Ubuntu,
sane-backends-devel on Fedora, sane-backends on Homebrew), pkg-config,
and libclang for bindgen.
Structs§
Constants§
- SANE_
ACTION_ GET_ VALUE - SANE_
ACTION_ SET_ AUTO - SANE_
ACTION_ SET_ VALUE - SANE_
CAP_ ADVANCED - SANE_
CAP_ AUTOMATIC - SANE_
CAP_ EMULATED - SANE_
CAP_ HARD_ SELECT - SANE_
CAP_ INACTIVE - SANE_
CAP_ SOFT_ DETECT - SANE_
CAP_ SOFT_ SELECT - SANE_
CONSTRAINT_ NONE - SANE_
CONSTRAINT_ RANGE - SANE_
CONSTRAINT_ STRING_ LIST - SANE_
CONSTRAINT_ WORD_ LIST - SANE_
CURRENT_ MAJOR - SANE_
CURRENT_ MINOR - SANE_
FALSE - SANE_
FIXED_ SCALE_ SHIFT - SANE_
FRAME_ BLUE - SANE_
FRAME_ GRAY - SANE_
FRAME_ GREEN - SANE_
FRAME_ RED - SANE_
FRAME_ RGB - SANE_
INFO_ INEXACT - SANE_
INFO_ RELOAD_ OPTIONS - SANE_
INFO_ RELOAD_ PARAMS - SANE_
MAX_ PASSWORD_ LEN - SANE_
MAX_ USERNAME_ LEN - SANE_
STATUS_ ACCESS_ DENIED - SANE_
STATUS_ CANCELLED - SANE_
STATUS_ COVER_ OPEN - SANE_
STATUS_ DEVICE_ BUSY - SANE_
STATUS_ EOF - SANE_
STATUS_ GOOD - SANE_
STATUS_ HW_ LOCKED - The scanner mechanism is locked for transport.
- SANE_
STATUS_ INVAL - SANE_
STATUS_ IO_ ERROR - SANE_
STATUS_ JAMMED - SANE_
STATUS_ NO_ DOCS - SANE_
STATUS_ NO_ MEM - SANE_
STATUS_ UNSUPPORTED - SANE_
STATUS_ WARMING_ UP - The lamp is not ready, retry later.
- SANE_
TRUE - SANE_
TYPE_ BOOL - SANE_
TYPE_ BUTTON - SANE_
TYPE_ FIXED - SANE_
TYPE_ GROUP - SANE_
TYPE_ INT - SANE_
TYPE_ STRING - SANE_
UNIT_ BIT - SANE_
UNIT_ DPI - SANE_
UNIT_ MICROSECOND - SANE_
UNIT_ MM - SANE_
UNIT_ NONE - SANE_
UNIT_ PERCENT - SANE_
UNIT_ PIXEL
Functions§
- SANE_
FIX - Converts a floating point number to
SANE_Fixed(SANE_FIX). - SANE_
OPTION_ IS_ ACTIVE - Whether an option with these capabilities is active
(
SANE_OPTION_IS_ACTIVE). - SANE_
OPTION_ IS_ SETTABLE - Whether an option with these capabilities can be set by software
(
SANE_OPTION_IS_SETTABLE). - SANE_
UNFIX - Converts a
SANE_Fixedto a floating point number (SANE_UNFIX). - SANE_
VERSION_ BUILD - The build number of a version code (
SANE_VERSION_BUILD). - SANE_
VERSION_ CODE - Builds a version code from its parts (
SANE_VERSION_CODE). - SANE_
VERSION_ MAJOR - The major version of a version code (
SANE_VERSION_MAJOR). - SANE_
VERSION_ MINOR - The minor version of a version code (
SANE_VERSION_MINOR). - sane_
cancel ⚠ - sane_
close ⚠ - sane_
control_ ⚠option - sane_
exit ⚠ - sane_
get_ ⚠devices - sane_
get_ ⚠option_ descriptor - sane_
get_ ⚠parameters - sane_
get_ ⚠select_ fd - sane_
init ⚠ - sane_
open ⚠ - sane_
read ⚠ - sane_
set_ ⚠io_ mode - sane_
start ⚠ - sane_
strstatus ⚠
Type Aliases§
- SANE_
Action - SANE_
Auth_ Callback - SANE_
Bool - SANE_
Byte - SANE_
Char - SANE_
Constraint_ Type - SANE_
Fixed - SANE_
Frame - SANE_
Handle - SANE_
Int - SANE_
Status - SANE_
String - SANE_
String_ Const - SANE_
Unit - SANE_
Value_ Type - SANE_
Word