1 /* sane - Scanner Access Now Easy.
2 
3    This file (C) 1997 Ingo Schneider
4              (C) 1998 Karl Anders Øygard
5 
6    This file is part of the SANE package.
7 
8    SANE is free software; you can redistribute it and/or modify it under
9    the terms of the GNU General Public License as published by the Free
10    Software Foundation; either version 2 of the License, or (at your
11    option) any later version.
12 
13    SANE is distributed in the hope that it will be useful, but WITHOUT
14    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16    for more details.
17 
18    You should have received a copy of the GNU General Public License
19    along with sane; see the file COPYING.
20    If not, see <https://www.gnu.org/licenses/>.  */
21 
22 #ifndef agfafocus_h
23 #define agfafocus_h
24 
25 enum AgfaFocus_Scanner_Type
26   {
27     AGFAGRAY64,
28     AGFALINEART,
29     AGFAGRAY256,
30     AGFACOLOR
31   };
32 
33 typedef enum
34   {
35     LINEART,
36     GRAY6BIT,
37     GRAY8BIT,
38     COLOR18BIT,
39     COLOR24BIT
40   }
41 AgfaFocus_Scanner_Mode;
42 
43 enum AgfaFocus_Option
44   {
45     OPT_NUM_OPTS = 0,
46 
47     OPT_MODE_GROUP,
48     OPT_MODE,
49     OPT_HALFTONE_PATTERN,	/* halftone matrix */
50     OPT_RESOLUTION,
51     OPT_SOURCE,
52     OPT_QUALITY,                /* quality calibration */
53 
54     OPT_GEOMETRY_GROUP,
55     OPT_TL_X,			/* top-left x */
56     OPT_TL_Y,			/* top-left y */
57     OPT_BR_X,			/* bottom-right x */
58     OPT_BR_Y,			/* bottom-right y */
59 
60     OPT_ENHANCEMENT_GROUP,
61     OPT_EXPOSURE,
62     OPT_BRIGHTNESS,
63     OPT_CONTRAST,
64     OPT_AUTO_BRIGHTNESS,
65     OPT_AUTO_CONTRAST,
66     OPT_ATTENUATION_RED,
67     OPT_ATTENUATION_BLUE,
68     OPT_ATTENUATION_GREEN,
69     OPT_SHARPEN,		/* sharpening */
70 
71     /* must come last: */
72     NUM_OPTIONS
73   };
74 
75 
76 typedef struct AgfaFocus_Device
77   {
78     struct AgfaFocus_Device *next;
79     SANE_Device sane;
80     SANE_Handle handle;
81 
82     SANE_Word type;
83     SANE_Bool transparent;
84     SANE_Bool analoglog;
85     SANE_Bool tos5;
86     SANE_Bool quality;
87     SANE_Bool disconnect;
88     SANE_Bool upload_user_defines;
89   }
90 AgfaFocus_Device;
91 
92 typedef struct AgfaFocus_Scanner
93   {
94     /* all the state needed to define a scan request: */
95 
96     SANE_Option_Descriptor opt[NUM_OPTIONS];
97     Option_Value val[NUM_OPTIONS];
98 
99     /* Parsed option values and variables that are valid only during
100        actual scanning: */
101     SANE_Bool scanning;
102     SANE_Int pass;
103     SANE_Parameters params;
104 
105     AgfaFocus_Scanner_Mode mode;
106 
107     SANE_Int image_composition;
108     SANE_Int bpp;
109     SANE_Int halftone;
110     SANE_Int original;
111     SANE_Int exposure;
112     SANE_Int r_att;
113     SANE_Int g_att;
114     SANE_Int b_att;
115     SANE_Int tonecurve;
116     SANE_Int quality;
117     SANE_Bool edge;
118     SANE_Bool lin_log;
119 
120     int lines_available;	/* Lines in scanner memory */
121 
122     int fd;			/* SCSI filedescriptor */
123     SANE_Pid reader_pid;		/* process id of reader */
124     int pipe;			/* pipe to reader process */
125     int reader_pipe;		/* pipe from reader process */
126 
127     /* scanner dependent/low-level state: */
128     AgfaFocus_Device *hw;
129   }
130 AgfaFocus_Scanner;
131 
132 #endif /* agfafocus_h */
133