What Is SANE? | ||
SANE, an acronym for "Scanner Access Now Easy," is an image-capture API. The API provides standardized access to any raster-image scanner, camera, or other kinds of image-acquisition devices. Version 1.03 is the current version. | An application that uses the SANE interface is called a SANE frontend. A driver that implements the SANE interface is called a SANE backend. A meta backend provides some means to manage one or more other backends. | |
SANE was introduced a few years after TWAIN to support (and standardize) image acquisition on Unix and Linux platforms, because TWAIN could not (and still is not able to) do the job. Although SANE originated for Unix and Linux, it has been ported to Mac OS X, OS/2, and other operating systems. | ||
SANE API The SANE API was written in the C language. Just as TWAIN supplies the twain.h header file for inclusion in TWAIN-based source code, SANE supplies the sane.h header file for inclusion in SANE-based source code. The sane.h header file largely consists of type and function declarations. The type declarations range from simple types, such as SANE_Bool, SANE_Int, and SANE_String, to complex types, such as SANE_Option_Descriptor. A total of 14 functions compose the API:
An application calls sane_init() to begin interacting with SANE. The application next typically calls sane_get_devices() to obtain a list of accessible devices. A device will be picked from this list and its name passed to sane_open() to open the device. Once the device is open, its controls can be set up or queried. This occurs in a loop, where each iteration invokes sane_get_option_descriptor() to obtain a control's descriptor, followed by sane_control_option() to query or set up the control. Device setup is followed by image acquisition. This task begins with a call to sane_start(), and continues with a loop where sane_get_parameters() and then sane_read() are invoked. Image acquisition continues until sane_read() returns end-of-file, or the user chooses to terminate image acquisition (assuming the application allows image acquisition to be cancelled), whereby the application invokes sane_cancel(). Following image acquisition, sane_close() is invoked and the open device is closed. sane_exit() is then called to break the application's connection with the SANE back end. | ||
SANE is an application programming interface (API) that provides standardized access to any raster image scanner hardware. The standardized interface allows to write just one driver for each scanner device instead of one driver for each scanner and application. The reduction in the number of required drivers provides significant savings in development time. More importantly, SANE raises the level at which applications can work. As such, it will enable applications that were previously unheard of in the UNIX world. While SANE is primarily targeted at a UNIX environment, the standard has been carefully designed to make it possible to implement the API on virtually any hardware or operating system. | | |
Monday, November 19, 2007
What Is SANE?
Posted by Sen SD at 10:13 PM
Labels: Technologies
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment