Next Up Previous Contents Index
The SANE Environment

3 The SANE Environment

SANE is defined as a C-callable library interface. Accessing a raster scanner device typically consists of two phases: first, various controls of the scanner need to be setup or queried. In the second phase, one or more images are acquired.

Since the device controls are widely different from device to device, SANE provides a generic interface that makes it easy for a frontend to give a user access to all controls without having to understand each and every device control. The design principle used here is to abstract each device control into a SANE option. An option is a self-describing name/value pair. For example, the brightness control of a camera might be represented by an option called brightness whose value is an integer in the range from 0 to 255.

With self-describing options, a backend need not be concerned with presentation issues: the backend simply provides a list of options that describe all the controls available in the device. Similarly, there are benefits to the frontend: it need not be concerned with the meaning of each option. It simply provides means to present and alter the options defined by the backend.

3.1 Attaching to a SANE backend

3.2 Image Data Format

Next Up Previous Contents Index