sane.h   sane.h 
/* sane - Scanner Access Now Easy. /* sane - Scanner Access Now Easy.
Copyright (C) 1996 David Mosberger-Tang and Andreas Beck Copyright (C) 1997 David Mosberger-Tang and Andreas Beck
This file is part of the SANE package. This file is part of the SANE package.
SANE is free software; you can redistribute it and/or modify it under This file is in the public domain. You may use and modify it as
the terms of the GNU General Public License as published by the Free you see fit, as long as this copyright message is included and
Software Foundation; either version 2 of the License, or (at your that there is an indication as to what modifications have been
option) any later version. made (if any).
SANE is distributed in the hope that it will be useful, but WITHOUT SANE is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License FITNESS FOR A PARTICULAR PURPOSE.
for more details.
You should have received a copy of the GNU General Public License
along with sane; see the file COPYING. If not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
This file declares SANE application interface. See the SANE This file declares SANE application interface. See the SANE
standard for a detailed explanation of the interface. */ standard for a detailed explanation of the interface. */
#ifndef sane_h #ifndef sane_h
#define sane_h #define sane_h
#define SANE_CURRENT_MAJOR 0 #define SANE_CURRENT_MAJOR 0
#define SANE_VERSION_CODE(major, minor, build) \ #define SANE_VERSION_CODE(major, minor, build) \
( (((SANE_Word) (major) & 0xff) << 24) \ ( (((SANE_Word) (major) & 0xff) << 24) \
skipping to change at line 42 skipping to change at line 37
#define SANE_VERSION_MINOR(code) ((((SANE_Word)(code)) >> 16) & 0xf f) #define SANE_VERSION_MINOR(code) ((((SANE_Word)(code)) >> 16) & 0xf f)
#define SANE_VERSION_BUILD(code) ((((SANE_Word)(code)) >> 0) & 0xfff f) #define SANE_VERSION_BUILD(code) ((((SANE_Word)(code)) >> 0) & 0xfff f)
#define SANE_FALSE 0 #define SANE_FALSE 0
#define SANE_TRUE 1 #define SANE_TRUE 1
typedef unsigned char SANE_Byte; typedef unsigned char SANE_Byte;
typedef int SANE_Word; typedef int SANE_Word;
typedef SANE_Word SANE_Bool; typedef SANE_Word SANE_Bool;
typedef SANE_Word SANE_Int; typedef SANE_Word SANE_Int;
typedef char *SANE_String; typedef char SANE_Char;
typedef const char *SANE_String_Const; /* const SANE_String is NOT the same typedef SANE_Char *SANE_String;
*/ typedef const SANE_Char *SANE_String_Const;
typedef void *SANE_Handle; typedef void *SANE_Handle;
typedef SANE_Word SANE_Fixed; typedef SANE_Word SANE_Fixed;
#define SANE_FIXED_SCALE_SHIFT 16 #define SANE_FIXED_SCALE_SHIFT 16
#define SANE_FIX(v) ((SANE_Word) ((v) * (1 << SANE_FIXED_SCALE_SHIFT))) #define SANE_FIX(v) ((SANE_Word) ((v) * (1 << SANE_FIXED_SCALE_SHIFT)))
#define SANE_UNFIX(v) ((double)(v) / (1 << SANE_FIXED_SCALE_SHIFT)) #define SANE_UNFIX(v) ((double)(v) / (1 << SANE_FIXED_SCALE_SHIFT))
typedef enum typedef enum
{ {
SANE_STATUS_GOOD = 0, /* everything A-OK */ SANE_STATUS_GOOD = 0, /* everything A-OK */
SANE_STATUS_UNSUPPORTED, /* operation is not supported */ SANE_STATUS_UNSUPPORTED, /* operation is not supported */
SANE_STATUS_CANCELLED, /* operation was cancelled */ SANE_STATUS_CANCELLED, /* operation was cancelled */
SANE_STATUS_DEVICE_BUSY, /* device is busy; try again later */ SANE_STATUS_DEVICE_BUSY, /* device is busy; try again later */
SANE_STATUS_AGAIN, /* currently, no data available; try again * /
SANE_STATUS_INVAL, /* data is invalid (includes no dev at open) */ SANE_STATUS_INVAL, /* data is invalid (includes no dev at open) */
SANE_STATUS_EOF, /* no more data available (end-of-file) */ SANE_STATUS_EOF, /* no more data available (end-of-file) */
SANE_STATUS_JAMMED, /* document feeder jammed */ SANE_STATUS_JAMMED, /* document feeder jammed */
SANE_STATUS_NO_DOCS, /* document feeder out of documents */ SANE_STATUS_NO_DOCS, /* document feeder out of documents */
SANE_STATUS_COVER_OPEN, /* scanner cover is open */ SANE_STATUS_COVER_OPEN, /* scanner cover is open */
SANE_STATUS_IO_ERROR, /* error during device I/O */ SANE_STATUS_IO_ERROR, /* error during device I/O */
SANE_STATUS_NO_MEM /* out of memory */ SANE_STATUS_NO_MEM, /* out of memory */
SANE_STATUS_ACCESS_DENIED /* access to resource has been denied */
} }
SANE_Status; SANE_Status;
typedef enum typedef enum
{ {
SANE_TYPE_BOOL = 0, SANE_TYPE_BOOL = 0,
SANE_TYPE_INT, SANE_TYPE_INT,
SANE_TYPE_FIXED, SANE_TYPE_FIXED,
SANE_TYPE_STRING, SANE_TYPE_STRING,
SANE_TYPE_BUTTON, SANE_TYPE_BUTTON,
skipping to change at line 105 skipping to change at line 101
SANE_String_Const type; /* device type (e.g., "flatbed scanner") */ SANE_String_Const type; /* device type (e.g., "flatbed scanner") */
} }
SANE_Device; SANE_Device;
#define SANE_CAP_SOFT_SELECT (1 << 0) #define SANE_CAP_SOFT_SELECT (1 << 0)
#define SANE_CAP_HARD_SELECT (1 << 1) #define SANE_CAP_HARD_SELECT (1 << 1)
#define SANE_CAP_SOFT_DETECT (1 << 2) #define SANE_CAP_SOFT_DETECT (1 << 2)
#define SANE_CAP_EMULATED (1 << 3) #define SANE_CAP_EMULATED (1 << 3)
#define SANE_CAP_AUTOMATIC (1 << 4) #define SANE_CAP_AUTOMATIC (1 << 4)
#define SANE_CAP_INACTIVE (1 << 5) #define SANE_CAP_INACTIVE (1 << 5)
#define SANE_CAP_ADVANCED (1 << 6)
#define SANE_OPTION_IS_ACTIVE(cap) (((cap) & SANE_CAP_INACTIVE) == 0) #define SANE_OPTION_IS_ACTIVE(cap) (((cap) & SANE_CAP_INACTIVE) == 0)
#define SANE_OPTION_IS_SETTABLE(cap) (((cap) & SANE_CAP_SOFT_SELECT) != 0 ) #define SANE_OPTION_IS_SETTABLE(cap) (((cap) & SANE_CAP_SOFT_SELECT) != 0 )
#define SANE_INFO_INEXACT (1 << 0) #define SANE_INFO_INEXACT (1 << 0)
#define SANE_INFO_RELOAD_OPTIONS (1 << 1) #define SANE_INFO_RELOAD_OPTIONS (1 << 1)
#define SANE_INFO_RELOAD_PARAMS (1 << 2) #define SANE_INFO_RELOAD_PARAMS (1 << 2)
typedef enum typedef enum
{ {
skipping to change at line 172 skipping to change at line 169
SANE_FRAME_RGB, /* pixel-interleaved red/green/blue bands */ SANE_FRAME_RGB, /* pixel-interleaved red/green/blue bands */
SANE_FRAME_RED, /* red band only */ SANE_FRAME_RED, /* red band only */
SANE_FRAME_GREEN, /* green band only */ SANE_FRAME_GREEN, /* green band only */
SANE_FRAME_BLUE /* blue band only */ SANE_FRAME_BLUE /* blue band only */
} }
SANE_Frame; SANE_Frame;
typedef struct typedef struct
{ {
SANE_Frame format; SANE_Frame format;
SANE_Bool first_frame; SANE_Bool last_frame;
SANE_Int bytes_per_line; SANE_Int bytes_per_line;
SANE_Int pixels_per_line; SANE_Int pixels_per_line;
SANE_Int lines; SANE_Int lines;
SANE_Int depth; SANE_Int depth;
} }
SANE_Parameters; SANE_Parameters;
extern SANE_Status sane_init (SANE_Int * version_code); struct SANE_Auth_Data;
extern SANE_Status sane_exit (void);
extern SANE_Status sane_get_devices (const SANE_Device *** device_list); #define SANE_MAX_USERNAME_LEN 256
#define SANE_MAX_PASSWORD_LEN 256
typedef void (*SANE_Auth_Callback) (SANE_String_Const resource,
SANE_Char username[SANE_MAX_USERNAME_LEN
],
SANE_Char password[SANE_MAX_PASSWORD_LEN
]);
extern SANE_Status sane_init (SANE_Int * version_code,
SANE_Auth_Callback authorize);
extern void sane_exit (void);
extern SANE_Status sane_get_devices (const SANE_Device *** device_list,
SANE_Bool local_only);
extern SANE_Status sane_open (SANE_String_Const devicename, extern SANE_Status sane_open (SANE_String_Const devicename,
SANE_Handle * handle); SANE_Handle * handle);
extern SANE_Status sane_close (SANE_Handle handle); extern void sane_close (SANE_Handle handle);
extern const SANE_Option_Descriptor * extern const SANE_Option_Descriptor *
sane_get_option_descriptor (SANE_Handle handle, SANE_Int option); sane_get_option_descriptor (SANE_Handle handle, SANE_Int option);
extern SANE_Status sane_control_option (SANE_Handle handle, SANE_Int option , extern SANE_Status sane_control_option (SANE_Handle handle, SANE_Int option ,
SANE_Action action, void *value, SANE_Action action, void *value,
SANE_Int * info); SANE_Int * info);
extern SANE_Status sane_get_parameters (SANE_Handle handle, extern SANE_Status sane_get_parameters (SANE_Handle handle,
SANE_Parameters * params); SANE_Parameters * params);
extern SANE_Status sane_start (SANE_Handle handle); extern SANE_Status sane_start (SANE_Handle handle);
extern SANE_Status sane_read (SANE_Handle handle, SANE_Byte * data, extern SANE_Status sane_read (SANE_Handle handle, SANE_Byte * data,
SANE_Int max_length, SANE_Int * length); SANE_Int max_length, SANE_Int * length);
extern SANE_Status sane_cancel (SANE_Handle handle); extern void sane_cancel (SANE_Handle handle);
extern SANE_Status sane_set_io_mode (SANE_Handle handle, extern SANE_Status sane_set_io_mode (SANE_Handle handle,
SANE_Bool non_blocking); SANE_Bool non_blocking);
extern SANE_Status sane_get_select_fd (SANE_Handle handle, extern SANE_Status sane_get_select_fd (SANE_Handle handle,
SANE_Int * fd); SANE_Int * fd);
extern const SANE_String_Const sane_strstatus (SANE_Status status); extern SANE_String_Const sane_strstatus (SANE_Status status);
#endif /* sane_h */ #endif /* sane_h */
 End of changes. 12 change blocks. 
23 lines changed or deleted 32 lines changed or added


 saneopts.h   saneopts.h 
skipping to change at line 28 skipping to change at line 28
This file declares common option names, titles, and descriptions. A This file declares common option names, titles, and descriptions. A
backend is not limited to these options but for the sake of backend is not limited to these options but for the sake of
consistency it's better to use options declared here when appropriate. consistency it's better to use options declared here when appropriate.
*/ */
#ifndef saneopts_h #ifndef saneopts_h
#define saneopts_h #define saneopts_h
/* This _must_ be the first option (index 0): */ /* This _must_ be the first option (index 0): */
#define SANE_NAME_NUM_OPTIONS "" /* never settable */ #define SANE_NAME_NUM_OPTIONS "" /* never settable */
#define SANE_NAME_PREVIEW "preview"
#define SANE_NAME_GRAY_PREVIEW "preview-in-gray"
#define SANE_NAME_BIT_DEPTH "depth" #define SANE_NAME_BIT_DEPTH "depth"
#define SANE_NAME_SCAN_MODE "mode" #define SANE_NAME_SCAN_MODE "mode"
#define SANE_NAME_SCAN_SPEED "speed" #define SANE_NAME_SCAN_SPEED "speed"
#define SANE_NAME_SCAN_SOURCE "source" #define SANE_NAME_SCAN_SOURCE "source"
#define SANE_NAME_BACKTRACK "backtrack" #define SANE_NAME_BACKTRACK "backtrack"
/* Most user-interfaces will let the user specify the scan area as the /* Most user-interfaces will let the user specify the scan area as the
top-left corner and the width/height of the scan area. The reason top-left corner and the width/height of the scan area. The reason
the backend interface uses the top-left/bottom-right corner is so the backend interface uses the top-left/bottom-right corner is so
that the scan area values can be properly constraint independent of that the scan area values can be properly constraint independent of
any other option value. */ any other option value. */
#define SANE_NAME_SCAN_TL_X "tl-x" #define SANE_NAME_SCAN_TL_X "tl-x"
#define SANE_NAME_SCAN_TL_Y "tl-y" #define SANE_NAME_SCAN_TL_Y "tl-y"
#define SANE_NAME_SCAN_BR_X "br-x" #define SANE_NAME_SCAN_BR_X "br-x"
#define SANE_NAME_SCAN_BR_Y "br-y" #define SANE_NAME_SCAN_BR_Y "br-y"
#define SANE_NAME_SCAN_RESOLUTION "resolution" #define SANE_NAME_SCAN_RESOLUTION "resolution"
#define SANE_NAME_GAMMA_LENGTH "gamma-length" #define SANE_NAME_CUSTOM_GAMMA "custom-gamma"
#define SANE_NAME_GAMMA_VECTOR "gamma-table" #define SANE_NAME_GAMMA_VECTOR "gamma-table"
#define SANE_NAME_GAMMA_VECTOR_R "red-gamma-table" #define SANE_NAME_GAMMA_VECTOR_R "red-gamma-table"
#define SANE_NAME_GAMMA_VECTOR_G "green-gamma-table" #define SANE_NAME_GAMMA_VECTOR_G "green-gamma-table"
#define SANE_NAME_GAMMA_VECTOR_B "blue-gamma-table" #define SANE_NAME_GAMMA_VECTOR_B "blue-gamma-table"
#define SANE_NAME_BRIGHTNESS "brightness" #define SANE_NAME_BRIGHTNESS "brightness"
#define SANE_NAME_CONTRAST "contrast" #define SANE_NAME_CONTRAST "contrast"
#define SANE_NAME_GRAIN_SIZE "grain" #define SANE_NAME_GRAIN_SIZE "grain"
#define SANE_NAME_HALFTONE "halftoning" #define SANE_NAME_HALFTONE "halftoning"
#define SANE_NAME_BLACKLEVEL "blacklevel" #define SANE_NAME_BLACK_LEVEL "black-level"
#define SANE_NAME_WHITELEVEL "whitelevel" #define SANE_NAME_WHITE_LEVEL "white-level"
#define SANE_NAME_HUE "hue" #define SANE_NAME_HUE "hue"
#define SANE_NAME_SATURATION "saturation" #define SANE_NAME_SATURATION "saturation"
#define SANE_NAME_FILE "filename" #define SANE_NAME_FILE "filename"
#define SANE_NAME_HALFTONE_DIMENSION "halftone-size" #define SANE_NAME_HALFTONE_DIMENSION "halftone-size"
#define SANE_NAME_HALFTONE_PATTERN "halftone-pattern" #define SANE_NAME_HALFTONE_PATTERN "halftone-pattern"
#define SANE_TITLE_NUM_OPTIONS "Number of options" #define SANE_TITLE_NUM_OPTIONS "Number of options"
#define SANE_TITLE_PREVIEW "Preview"
#define SANE_TITLE_GRAY_PREVIEW "Force monochrome preview"
#define SANE_TITLE_BIT_DEPTH "Bit depth" #define SANE_TITLE_BIT_DEPTH "Bit depth"
#define SANE_TITLE_SCAN_MODE "Scan mode" #define SANE_TITLE_SCAN_MODE "Scan mode"
#define SANE_TITLE_SCAN_SPEED "Scan speed" #define SANE_TITLE_SCAN_SPEED "Scan speed"
#define SANE_TITLE_SCAN_SOURCE "Scan source" #define SANE_TITLE_SCAN_SOURCE "Scan source"
#define SANE_TITLE_BACKTRACK "Force backtracking" #define SANE_TITLE_BACKTRACK "Force backtracking"
#define SANE_TITLE_SCAN_TL_X "Top-left x position of scan area" #define SANE_TITLE_SCAN_TL_X "Top-left x"
#define SANE_TITLE_SCAN_TL_Y "Top-left y position of scan area" #define SANE_TITLE_SCAN_TL_Y "Top-left y"
#define SANE_TITLE_SCAN_BR_X "Bottom-right x position of scan are #define SANE_TITLE_SCAN_BR_X "Bottom-right x"
a" #define SANE_TITLE_SCAN_BR_Y "Bottom-right y"
#define SANE_TITLE_SCAN_BR_Y "Bottom-right y position of scan are
a"
#define SANE_TITLE_SCAN_RESOLUTION "Scan resolution" #define SANE_TITLE_SCAN_RESOLUTION "Scan resolution"
#define SANE_TITLE_GAMMA_LENGTH "Gamma table length" #define SANE_TITLE_CUSTOM_GAMMA "Use custom gamma table"
#define SANE_TITLE_GAMMA_VECTOR "Gamma table" #define SANE_TITLE_GAMMA_VECTOR "Image intensity"
#define SANE_TITLE_GAMMA_VECTOR_R "Red gamma table" #define SANE_TITLE_GAMMA_VECTOR_R "Red intensity"
#define SANE_TITLE_GAMMA_VECTOR_G "Green gamma table" #define SANE_TITLE_GAMMA_VECTOR_G "Green intensity"
#define SANE_TITLE_GAMMA_VECTOR_B "Blue gamma table" #define SANE_TITLE_GAMMA_VECTOR_B "Blue intensity"
#define SANE_TITLE_BRIGHTNESS "Brightness" #define SANE_TITLE_BRIGHTNESS "Brightness"
#define SANE_TITLE_CONTRAST "Contrast" #define SANE_TITLE_CONTRAST "Contrast"
#define SANE_TITLE_GRAIN_SIZE "Grain size" #define SANE_TITLE_GRAIN_SIZE "Grain size"
#define SANE_TITLE_HALFTONE "Halftoning" #define SANE_TITLE_HALFTONE "Halftoning"
#define SANE_TITLE_BLACKLEVEL "Blacklevel" #define SANE_TITLE_BLACK_LEVEL "Black level"
#define SANE_TITLE_WHITELEVEL "Whitelevel" #define SANE_TITLE_WHITE_LEVEL "White level"
#define SANE_TITLE_HUE "Hue" #define SANE_TITLE_HUE "Hue"
#define SANE_TITLE_SATURATION "Saturation" #define SANE_TITLE_SATURATION "Saturation"
#define SANE_TITLE_FILE "Filename" #define SANE_TITLE_FILE "Filename"
#define SANE_TITLE_HALFTONE_DIMENSION "Halftone pattern size" #define SANE_TITLE_HALFTONE_DIMENSION "Halftone pattern size"
#define SANE_TITLE_HALFTONE_PATTERN "Halftone pattern" #define SANE_TITLE_HALFTONE_PATTERN "Halftone pattern"
/* Descriptive/help strings for above options: */ /* Descriptive/help strings for above options: */
#define SANE_DESC_NUM_OPTIONS \ #define SANE_DESC_NUM_OPTIONS \
"Read-only option that specifies how many options a specific devices " \ "Read-only option that specifies how many options a specific devices " \
"supports." "supports."
#define SANE_DESC_PREVIEW \
"Request a preview-quality scan."
#define SANE_DESC_GRAY_PREVIEW \
"Request that all previews are done in monochrome mode. On a three-pass "
\
" scanner this cuts down the number of passes to one and on a one-pass " \
"scanner, it reduces the memory requirements and scan-time of the preview."
#define SANE_DESC_BIT_DEPTH \ #define SANE_DESC_BIT_DEPTH \
"Number of bits per sample, typical values are 1 for \"line-art\" and 8 " \ "Number of bits per sample, typical values are 1 for \"line-art\" and 8 " \
"for multibit scans." "for multibit scans."
#define SANE_DESC_SCAN_MODE \ #define SANE_DESC_SCAN_MODE \
"Selects the scan mode (e.g., lineart,monochrome, or color)." "Selects the scan mode (e.g., lineart,monochrome, or color)."
#define SANE_DESC_SCAN_SPEED \ #define SANE_DESC_SCAN_SPEED \
"Determines the speed at which the scan proceeds." "Determines the speed at which the scan proceeds."
skipping to change at line 124 skipping to change at line 136
#define SANE_DESC_SCAN_BR_X \ #define SANE_DESC_SCAN_BR_X \
"Bottom-right x position of scan area." "Bottom-right x position of scan area."
#define SANE_DESC_SCAN_BR_Y \ #define SANE_DESC_SCAN_BR_Y \
"Bottom-right y position of scan area." "Bottom-right y position of scan area."
#define SANE_DESC_SCAN_RESOLUTION \ #define SANE_DESC_SCAN_RESOLUTION \
"Sets the resolution of the scanned image." "Sets the resolution of the scanned image."
#define SANE_DESC_GAMMA_LENGTH \ #define SANE_DESC_CUSTOM_GAMMA \
"Length of gamma-correction table. A length of 0 implies that a built" \ "Determines whether a builtin or a custom gamma-table should be used."
"in gamma correction is to be used (e.g., a simple linear table)."
#define SANE_DESC_GAMMA_VECTOR \ #define SANE_DESC_GAMMA_VECTOR \
"Gamma-correction table. In color mode this option equally affects the " \ "Gamma-correction table. In color mode this option equally affects the " \
"red, green, and blue channels simultaneously (i.e., it is an intensity " \ "red, green, and blue channels simultaneously (i.e., it is an intensity " \
"gamma table)." "gamma table)."
#define SANE_DESC_GAMMA_VECTOR_R \ #define SANE_DESC_GAMMA_VECTOR_R \
"Gamma-correction table for the red band." "Gamma-correction table for the red band."
#define SANE_DESC_GAMMA_VECTOR_G \ #define SANE_DESC_GAMMA_VECTOR_G \
skipping to change at line 155 skipping to change at line 166
#define SANE_DESC_CONTRAST \ #define SANE_DESC_CONTRAST \
"Controls the contrast of the acquired image." "Controls the contrast of the acquired image."
#define SANE_DESC_GRAIN_SIZE \ #define SANE_DESC_GRAIN_SIZE \
"Selects the \"graininess\" of the acquired image. Smaller values " \ "Selects the \"graininess\" of the acquired image. Smaller values " \
"result in sharper images." "result in sharper images."
#define SANE_DESC_HALFTONE \ #define SANE_DESC_HALFTONE \
"Selects whether the acquired image should be halftoned (dithered)." "Selects whether the acquired image should be halftoned (dithered)."
#define SANE_DESC_BLACKLEVEL \ #define SANE_DESC_BLACK_LEVEL \
"Selects what radiance level should be considered \"black\"." "Selects what radiance level should be considered \"black\"."
#define SANE_DESC_WHITELEVEL \ #define SANE_DESC_WHITE_LEVEL \
"Selects what radiance level should be considered \"white\"." "Selects what radiance level should be considered \"white\"."
#define SANE_DESC_HUE \ #define SANE_DESC_HUE \
"Controls the \"hue\" (blue-level) of the acquired image." "Controls the \"hue\" (blue-level) of the acquired image."
#define SANE_DESC_SATURATION \ #define SANE_DESC_SATURATION \
"The saturation level controls the amount of \"blooming\" that occurs when " \ "The saturation level controls the amount of \"blooming\" that occurs when " \
"acquiring an image with a camera. Larger values cause more blooming." "acquiring an image with a camera. Larger values cause more blooming."
#define SANE_DESC_FILE "The filename of the image to be loaded." #define SANE_DESC_FILE "The filename of the image to be loaded."
 End of changes. 11 change blocks. 
21 lines changed or deleted 31 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/