1 /* sane - Scanner Access Now Easy.
2    Copyright (C) 2007 Jeremy Johnson
3    This file is part of a SANE backend for Ricoh IS450
4    and IS420 family of HS2P Scanners using the SCSI controller.
5 
6    This file is part of the SANE package.
7 
8    This program is free software; you can redistribute it and/or
9    modify it under the terms of the GNU General Public License as
10    published by the Free Software Foundation; either version 2 of the
11    License, or (at your option) any later version.
12 
13    This program is distributed in the hope that it will be useful, but
14    WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16    General Public License for more details.
17 
18    You should have received a copy of the GNU General Public License
19    along with this program.  If not, see <https://www.gnu.org/licenses/>.
20 
21    As a special exception, the authors of SANE give permission for
22    additional uses of the libraries contained in this release of SANE.
23 
24    The exception is that, if you link a SANE library with other files
25    to produce an executable, this does not by itself cause the
26    resulting executable to be covered by the GNU General Public
27    License.  Your use of that executable is in no way restricted on
28    account of linking the SANE library code into it.
29 
30    This exception does not, however, invalidate any other reasons why
31    the executable file might be covered by the GNU General Public
32    License.
33 
34    If you submit changes to SANE to the maintainers to be included in
35    a subsequent release, you agree by submitting the changes that
36    those changes may be distributed with this exception intact.
37 
38    If you write modifications of your own for SANE, it is your choice
39    whether to permit this exception to apply to your modifications.
40    If you do not wish that, delete this exception notice. */
41 
42 
43 #define SANE_NAME_INQUIRY  "inquiry"
44 #define SANE_TITLE_INQUIRY "Inquiry Data"
45 #define SANE_DESC_INQUIRY  "Displays scanner inquiry data"
46 
47 #define SANE_TITLE_SCAN_MODE_GROUP "Scan Mode"
48 #define SANE_TITLE_GEOMETRY_GROUP "Geometry"
49 #define SANE_TITLE_FEEDER_GROUP "Feeder"
50 
51 #define SANE_TITLE_ENHANCEMENT_GROUP "Enhancement"
52 #define SANE_TITLE_ICON_GROUP "Icon"
53 #define SANE_TITLE_BARCODE_GROUP "Barcode"
54 
55 #define SANE_TITLE_MISCELLANEOUS_GROUP "Miscellaneous"
56 
57 #define SANE_NAME_AUTOBORDER "autoborder"
58 #define SANE_TITLE_AUTOBORDER "Autoborder"
59 #define SANE_DESC_AUTOBORDER "Enable Automatic Border Detection"
60 
61 #define SANE_NAME_COMPRESSION "compression"
62 #define SANE_TITLE_COMPRESSION "Data Compression"
63 #define SANE_DESC_COMPRESSION "Sets the compression mode of the scanner"
64 
65 #define SANE_NAME_ROTATION "rotation"
66 #define SANE_TITLE_ROTATION "Page Rotation"
67 #define SANE_DESC_ROTATION "Sets the page rotation mode of the scanner"
68 
69 #define SANE_NAME_DESKEW "deskew"
70 #define SANE_TITLE_DESKEW "Page Deskew"
71 #define SANE_DESC_DESKEW "Enable Deskew Mode"
72 
73 #define SANE_NAME_TIMEOUT_ADF "timeout-adf"
74 #define SANE_TITLE_TIMEOUT_ADF "ADF Timeout"
75 #define SANE_DESC_TIMEOUT_ADF "Sets the timeout in seconds for the ADF"
76 
77 #define SANE_NAME_TIMEOUT_MANUAL "timeout-manual"
78 #define SANE_TITLE_TIMEOUT_MANUAL "Manual Timeout"
79 #define SANE_DESC_TIMEOUT_MANUAL "Sets the timeout in seconds for manual feeder"
80 
81 #define SANE_NAME_BATCH "batch"
82 #define SANE_TITLE_BATCH "Batch"
83 #define SANE_DESC_BATCH "Enable Batch Mode"
84 
85 #define SANE_NAME_CHECK_ADF "check-adf"
86 #define SANE_TITLE_CHECK_ADF "Check ADF"
87 #define SANE_DESC_CHECK_ADF "Check ADF Status prior to starting scan"
88 
89 #define SANE_NAME_PREFEED "prefeed"
90 #define SANE_TITLE_PREFEED "Prefeed"
91 #define SANE_DESC_PREFEED "Prefeed"
92 
93 #define SANE_NAME_DUPLEX "duplex"
94 #define SANE_TITLE_DUPLEX "Duplex"
95 #define SANE_DESC_DUPLEX "Enable Duplex (Dual-Sided) Scanning"
96 
97 #define SANE_NAME_ENDORSER  "endorser"
98 #define SANE_TITLE_ENDORSER "Endorser"
99 #define SANE_DESC_ENDORSER  "Print up to 19 character string on each sheet"
100 
101 #define SANE_NAME_ENDORSER_STRING  "endorser-string"
102 #define SANE_TITLE_ENDORSER_STRING "Endorser String"
103 #define SANE_DESC_ENDORSER_STRING  "valid characters: [0-9][ :#`'-./][A-Z][a-z]"
104 
105 #define SANE_NAME_BARCODE_SEARCH_COUNT "barcode-search-count"
106 #define SANE_TITLE_BARCODE_SEARCH_COUNT "Barcode Search Count"
107 #define SANE_DESC_BARCODE_SEARCH_COUNT "Number of barcodes to search for in the scanned image"
108 
109 #define SANE_NAME_BARCODE_HMIN "barcode-hmin"
110 #define SANE_TITLE_BARCODE_HMIN "Barcode Minimum Height"
111 #define SANE_DESC_BARCODE_HMIN "Sets the Barcode Minimum Height (larger values increase recognition speed)"
112 
113 #define SANE_NAME_BARCODE_SEARCH_MODE "barcode-search-mode"
114 #define SANE_TITLE_BARCODE_SEARCH_MODE "Barcode Search Mode"
115 #define SANE_DESC_BARCODE_SEARCH_MODE "Chooses the orientation of barcodes to be searched"
116 
117 #define SANE_NAME_BARCODE_SEARCH_TIMEOUT "barcode-search-timeout"
118 #define SANE_TITLE_BARCODE_SEARCH_TIMEOUT "Barcode Search Timeout"
119 #define SANE_DESC_BARCODE_SEARCH_TIMEOUT "Sets the timeout for barcode searching"
120 
121 #define SANE_NAME_BARCODE_SEARCH_BAR "barcode-search-bar"
122 #define SANE_TITLE_BARCODE_SEARCH_BAR "Barcode Search Bar"
123 #define SANE_DESC_BARCODE_SEARCH_BAR "Specifies the barcode type to search for"
124 
125 #define SANE_NAME_SECTION "section"
126 #define SANE_TITLE_SECTION "Image/Barcode Search Sections"
127 #define SANE_DESC_SECTION "Specifies an image section and/or a barcode search region"
128 
129 #define SANE_NAME_BARCODE_RELMAX "barcode-relmax"
130 #define SANE_TITLE_BARCODE_RELMAX "Barcode RelMax"
131 #define SANE_DESC_BARCODE_RELMAX "Specifies the maximum relation from the widest to the smallest bar"
132 
133 #define SANE_NAME_BARCODE_BARMIN "barcode-barmin"
134 #define SANE_TITLE_BARCODE_BARMIN "Barcode Bar Minimum"
135 #define SANE_DESC_BARCODE_BARMIN "Specifies the minimum number of bars in Bar/Patch code"
136 
137 #define SANE_NAME_BARCODE_BARMAX "barcode-barmax"
138 #define SANE_TITLE_BARCODE_BARMAX "Barcode Bar Maximum"
139 #define SANE_DESC_BARCODE_BARMAX "Specifies the maximum number of bars in a Bar/Patch code"
140 
141 #define SANE_NAME_BARCODE_CONTRAST "barcode-contrast"
142 #define SANE_TITLE_BARCODE_CONTRAST "Barcode Contrast"
143 #define SANE_DESC_BARCODE_CONTRAST "Specifies the image contrast used in decoding.  Use higher values when " \
144 "there are more white pixels in the code"
145 
146 #define SANE_NAME_BARCODE_PATCHMODE "barcode-patchmode"
147 #define SANE_TITLE_BARCODE_PATCHMODE "Barcode Patch Mode"
148 #define SANE_DESC_BARCODE_PATCHMODE "Controls Patch Code detection."
149 
150 #define SANE_NAME_SCAN_WAIT_MODE "scan-wait-mode"
151 #define SANE_TITLE_SCAN_WAIT_MODE "Scan Wait Mode "
152 #define SANE_DESC_SCAN_WAIT_MODE "Enables the scanner's start button"
153 
154 #define SANE_NAME_ACE_FUNCTION "ace-function"
155 #define SANE_TITLE_ACE_FUNCTION "ACE Function"
156 #define SANE_DESC_ACE_FUNCTION "ACE Function"
157 
158 #define SANE_NAME_ACE_SENSITIVITY "ace-sensitivity"
159 #define SANE_TITLE_ACE_SENSITIVITY "ACE Sensitivity"
160 #define SANE_DESC_ACE_SENSITIVITY "ACE Sensitivity"
161 
162 #define SANE_NAME_ICON_WIDTH "icon-width"
163 #define SANE_TITLE_ICON_WIDTH "Icon Width"
164 #define SANE_DESC_ICON_WIDTH "Width of icon (thumbnail) image in pixels"
165 
166 #define SANE_NAME_ICON_LENGTH "icon-length"
167 #define SANE_TITLE_ICON_LENGTH "Icon Length"
168 #define SANE_DESC_ICON_LENGTH "Length of icon (thumbnail) image in pixels"
169 
170 #define SANE_NAME_ORIENTATION "orientation"
171 #define SANE_TITLE_ORIENTATION "Paper Orientation"
172 #define SANE_DESC_ORIENTATION "[Portrait]/Landscape" \
173 
174 #define SANE_NAME_PAPER_SIZE "paper-size"
175 #define SANE_TITLE_PAPER_SIZE "Paper Size"
176 #define SANE_DESC_PAPER_SIZE "Specify the scan window geometry by specifying the paper size " \
177 "of the documents to be scanned"
178 
179 #define SANE_NAME_PADDING "padding"
180 #define SANE_TITLE_PADDING "Padding"
181 #define SANE_DESC_PADDING "Pad if media length is less than requested"
182 
183 #define SANE_NAME_AUTO_SIZE "auto-size"
184 #define SANE_TITLE_AUTO_SIZE "Auto Size"
185 #define SANE_DESC_AUTO_SIZE "Automatic Paper Size Determination"
186 
187 #define SANE_NAME_BINARYFILTER "binary-filter"
188 #define SANE_TITLE_BINARYFILTER "Binary Filter"
189 #define SANE_DESC_BINARYFILTER "Binary Filter"
190 
191 #define SANE_NAME_SMOOTHING "smoothing"
192 #define SANE_TITLE_SMOOTHING "Smoothing"
193 #define SANE_DESC_SMOOTHING "Binary Smoothing Filter"
194 
195 #define SANE_NAME_NOISEREMOVAL "noise-removal"
196 #define SANE_TITLE_NOISEREMOVAL "Noise Removal"
197 #define SANE_DESC_NOISEREMOVAL "Binary Noise Removal Filter"
198 
199 #define SANE_NAME_NOISEMATRIX "noise-removal-matrix"
200 #define SANE_TITLE_NOISEMATRIX "Noise Removal Matrix"
201 #define SANE_DESC_NOISEMATRIX "Noise Removal Matrix"
202 
203 #define SANE_NAME_GRAYFILTER "gray-filter"
204 #define SANE_TITLE_GRAYFILTER "Gray Filter"
205 #define SANE_DESC_GRAYFILTER "Gray Filter"
206 
207 #define SANE_NAME_HALFTONE_CODE "halftone-type"
208 #define SANE_TITLE_HALFTONE_CODE "Halftone Type"
209 #define SANE_DESC_HALFTONE_CODE  "Dither or Error Diffusion"
210 
211 /*
212 #define SANE_NAME_HALFTONE_PATTERN "pattern"
213 #define SANE_TITLE_HALFTONE_PATTERN "Pattern"
214 #define SANE_DESC_HALFTONE_PATTERN  "10 built-in halftone patterns + 2 user patterns"
215 */
216 
217 #define SANE_NAME_ERRORDIFFUSION "error-diffusion"
218 #define SANE_TITLE_ERRORDIFFUSION "Error Diffusion"
219 #define SANE_DESC_ERRORDIFFUSION  "Useful for documents with both text and images"
220 
221 /*
222 #define SANE_NAME_HALFTONE "halftone"
223 #define SANE_TITLE_HALFTONE "Halftone"
224 #define SANE_DESC_HALFTONE "Choose a dither pattern or error diffusion"
225 
226 #define SANE_NAME_NEGATIVE "negative image"
227 #define SANE_TITLE_NEGATIVE "Negative Image"
228 #define SANE_DESC_NEGATIVE "Reverse Image Format"
229 
230 #define SANE_NAME_BRIGHTNESS "brightness"
231 #define SANE_TITLE_BRIGHTNESS "Brightness"
232 #define SANE_DESC_BRIGHTNESS "Brightness"
233 
234 #define SANE_NAME_THRESHOLD "threshold"
235 #define SANE_TITLE_THRESHOLD "Threshold"
236 #define SANE_DESC_THRESHOLD "Threshold"
237 */
238 
239 #define SANE_NAME_GAMMA "gamma"
240 #define SANE_TITLE_GAMMA "Gamma"
241 #define SANE_DESC_GAMMA "Gamma Correction"
242 
243 #define SANE_NAME_AUTOSEP "auto-separation"
244 #define SANE_TITLE_AUTOSEP "Automatic Separation"
245 #define SANE_DESC_AUTOSEP "Automatic Separation"
246 
247 #define SANE_NAME_AUTOBIN "auto-binarization"
248 #define SANE_TITLE_AUTOBIN "Automatic Binarization"
249 #define SANE_DESC_AUTOBIN "Automatic Binarization"
250 
251 #define SANE_NAME_WHITE_BALANCE "white-balance"
252 #define SANE_TITLE_WHITE_BALANCE "White Balance"
253 #define SANE_DESC_WHITE_BALANCE  "White Balance"
254 
255 #define SANE_NAME_PADDING_TYPE "padding-type"
256 #define SANE_TITLE_PADDING_TYPE "Padding Type"
257 #define SANE_DESC_PADDING_TYPE  "Padding Type"
258 
259 #define SANE_NAME_BITORDER "bit-order"
260 #define SANE_TITLE_BITORDER "Bit Order"
261 #define SANE_DESC_BITORDER  "Bit Order"
262 
263 #define SANE_NAME_SELF_DIAGNOSTICS "self-diagnostics"
264 #define SANE_TITLE_SELF_DIAGNOSTICS "Self Diagnostics"
265 #define SANE_DESC_SELF_DIAGNOSTICS "Self Diagnostics"
266 
267 #define SANE_NAME_OPTICAL_ADJUSTMENT "optical-adjustment"
268 #define SANE_TITLE_OPTICAL_ADJUSTMENT "Optical Adjustment"
269 #define SANE_DESC_OPTICAL_ADJUSTMENT "Optical Adjustment"
270 
271 typedef enum
272 {
273   OPT_NUM_OPTS = 0,
274 
275   OPT_MODE_GROUP,
276   OPT_INQUIRY,			/* inquiry string */
277   OPT_PREVIEW,
278   OPT_SCAN_MODE,		/* scan mode */
279   OPT_RESOLUTION,
280   OPT_X_RESOLUTION,
281   OPT_Y_RESOLUTION,
282   OPT_COMPRESSION,		/* hardware compression */
283 
284   OPT_GEOMETRY_GROUP,
285   /*OPT_AUTOBORDER,       automatic border detection */
286   /*OPT_ROTATION,         hardware rotation */
287   /*OPT_DESKEW,           hardware deskew */
288   OPT_PAGE_ORIENTATION,		/* portrait, landscape */
289   OPT_PAPER_SIZE,		/* paper size */
290   OPT_TL_X,			/* top-left x */
291   OPT_TL_Y,			/* top-left y */
292   OPT_BR_X,			/* bottom-right x */
293   OPT_BR_Y,			/* bottom-right y */
294   OPT_PADDING,			/* Pad to requested length */
295   OPT_AUTO_SIZE,		/* Automatic Size Recognition */
296 
297   OPT_FEEDER_GROUP,
298   OPT_SCAN_SOURCE,		/* scan source (eg. Flatbed, ADF) */
299   OPT_DUPLEX,			/* scan both sides of the page */
300   OPT_SCAN_WAIT_MODE,		/* Enables the scanner's Start Button */
301   OPT_PREFEED,
302   OPT_ENDORSER,			/* Endorser (off,on) */
303   OPT_ENDORSER_STRING,		/* Endorser String */
304   /*OPT_BATCH,              scan in batch mode */
305   /*OPT_TIMEOUT_MANUAL,     timeout in seconds with manual feed */
306   /*OPT_TIMEOUT_ADF,        timeout in seconds with ADF */
307   /*OPT_CHECK_ADF,          check for page in ADF before scanning */
308 
309   OPT_ENHANCEMENT_GROUP,
310   /* OPT_ACE_FUNCTION,
311      OPT_ACE_SENSITIVITY, */
312   OPT_BRIGHTNESS,		/* Brightness */
313   OPT_THRESHOLD,		/* Threshold */
314   OPT_CONTRAST,			/* Contrast */
315   OPT_NEGATIVE,			/* Negative (reverse image) */
316   OPT_GAMMA,			/* Gamma Correction */
317   OPT_CUSTOM_GAMMA,
318   OPT_GAMMA_VECTOR_GRAY,
319   OPT_HALFTONE_CODE,		/* Halftone Code    */
320   OPT_HALFTONE_PATTERN,		/* Halftone Pattern */
321   OPT_GRAYFILTER,		/* MRIF */
322   OPT_SMOOTHING,		/* Smoothing */
323   OPT_NOISEREMOVAL,		/* Noise Removal */
324   OPT_AUTOSEP,			/* Auto Separation */
325   OPT_AUTOBIN,			/* Auto Binarization */
326   OPT_WHITE_BALANCE,
327 
328   OPT_MISCELLANEOUS_GROUP,
329   OPT_PADDING_TYPE,
330   /*OPT_BITORDER,      */
331   OPT_SELF_DIAGNOSTICS,
332   OPT_OPTICAL_ADJUSTMENT,
333   /*
334      OPT_PARITION_FUNCTION
335      OPT_SECTION
336    */
337 
338   OPT_DATA_GROUP,
339   OPT_UPDATE,
340   OPT_NREGX_ADF,
341   OPT_NREGY_ADF,
342   OPT_NREGX_BOOK,
343   OPT_NREGY_BOOK,
344   OPT_NSCANS_ADF,
345   OPT_NSCANS_BOOK,
346   OPT_LAMP_TIME,
347   OPT_EO_ODD,
348   OPT_EO_EVEN,
349   OPT_BLACK_LEVEL_ODD,
350   OPT_BLACK_LEVEL_EVEN,
351   OPT_WHITE_LEVEL_ODD,
352   OPT_WHITE_LEVEL_EVEN,
353   OPT_DENSITY,
354   OPT_FIRST_ADJ_WHITE_ODD,
355   OPT_FIRST_ADJ_WHITE_EVEN,
356   OPT_NREGX_REVERSE,
357   OPT_NREGY_REVERSE,
358   OPT_NSCANS_REVERSE_ADF,
359   OPT_REVERSE_TIME,
360   OPT_NCHARS,
361 
362   NUM_OPTIONS			/* must come last: */
363 } HS2P_Option;
364