summaryrefslogtreecommitdiff
path: root/doc/sane-test.man
blob: 194fd8b14fd4dd4bddc5b25a7772dcda7642a603 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
.TH sane\-test 5 "14 Jul 2008" "@PACKAGEVERSION@" "SANE Scanner Access Now Easy"
.IX sane\-test
.SH NAME
sane\-test \- SANE backend for testing frontends
.SH DESCRIPTION
The
.B sane\-test
library implements a SANE (Scanner Access Now Easy) backend that allows
testing the SANE installation and SANE frontends.  It provides access to a
(nearly) unlimited number of virtual devices.  There is no support for real
scanners or cameras.  However, the backend simulates scanning and setting
options.
.PP
The idea is not only to find bugs in frontends but also to show all
capabilities of SANE.  Therefore
.B sane\-test
implements functions and options that are not (or seldom) found in other
backends.
.PP
The backend is commented out in
.IR @CONFIGDIR@/dll.conf ,
so either the comment
character must be removed or the backend must be called explicitly.  E.g.
.I scanimage \-d test
or
.IR "xscanimage test" .


.SH SCAN MODE OPTIONS
Option
.B mode
selects the scan mode (Gray or Color).
.PP
Option
.B depth
determines the number of bits per sample (1. 8, or 16).  Keep in mind, that
this value refers to the sample, not the pixel.  So depth=16 results in 48
bits per pixel in color mode. The most usual combinations are mode=Gray,
depth=1 for lineart, mode=Gray, depth=8 for gray and mode=Color, depth=8 for
color mode.  The combination of color and 1-bit mode is quite obscure (8
colors) but allowed in the SANE standard. However, the meaning of bits is not
defined. Currently 1 = high intensity and 0 = low intensity is used.
.PP
Setting option
.B hand\-scanner
results in the test-backend behaving like a hand-scanner.  Hand-scanners do
not know the image height a priori.  Instead, they return a height of \-1.
Setting this option allows one to test whether a frontend can handle this
correctly.  This option also enables a fixed width of 11 cm.
.PP
Setting option
.B three\-pass
simulates a three-pass scanner.  Older color scanners needed to scan the image
once per color (red/green/blue) to get the full image.  Therefore, in this mode
three single frames are transmitted in color mode.
.PP
Option
.B three\-pass\-order
provides support for changing the order of the three frames (see option
three-pass above).  A frontend should support all orders.
.PP
Option
.B resolution
sets the resolution of the image in dots per inch.
.PP
.PP
Option
.B source
can be used to simulate an Automatic Document Feeder (ADF). After 10 scans, the
ADF will be "empty".
.PP

.SH SPECIAL OPTIONS
Option
.B test\-picture
allows one to set the image that's returned to the frontend.  While "Solid white"
and "Solid black" are quite obvious, the other options need some more
explanation.  Color patterns are used to determine if all modes and their
colors are represented correctly by the frontend.  The grid should look like the
same in every mode and resolution.  A table of all the test pictures can be
found at:
.IR http://www.meier\-geinitz.de/sane/test\-backend/test\-pictures.html .
.PP
If option
.B invert\-endianness
is set, the upper and lower bytes of image data in 16 bit modes are exchanged.
This option can be used to test the 16 bit modes of frontends, e.g. if the
frontend uses the correct endianness.
.PP
If option
.B read\-limit
is set, the maximum amount of data transferred with each call to
.BR sane_read ()
is limited.
.PP
Option
.B read\-limit\-size
sets the limit for option read-limit.  A low limit slows down scanning.  It
can be used to detect errors in frontend that occur because of wrong
assumptions on the size of the buffer or timing problems.
.PP
Option
.B read\-delay
enables delaying data to the frontend.
.PP
Option
.B read\-delay\-duration
selects the number of microseconds the backends waits after each transfer of a
buffer.  This option is useful to find timing-related bugs, especially if
used over the network.
.PP
If option
.B read\-return\-value
is different from "Default", the selected status will be returned by every
call to
.BR sane_read ().
This is useful to test the frontend's handling of the SANE statuses.
.PP
If option
.B ppl\-loss
is different from 0, it determines the number of pixels that are "lost" at the
end of each line.  That means, lines are padded with unused data.
.PP
Option
.B fuzzy\-parameters
selects that fuzzy (inexact) parameters are returned as long as the scan
hasn't been started.  This option can be used to test if the frontend uses the
parameters it got before the start of the scan (which it shouldn't).
.PP
Option
.B non\-blocking
determines if non-blocking IO for
.BR sane_read ()
should be used if supported by the frontend.
.PP
If option
.B select\-fd
is set, the backend offers a select filedescriptor for detecting if
.BR sane_read()
will return data.
.PP
If option
.B enable\-test\-options
is set, a fairly big list of options for testing the various SANE option
types is enabled.
.PP
Option
.B print\-options
can be used to print a list of all options to standard error.
.PP

.SH GEOMETRY OPTIONS
Option
.B tl\-x
determines the top-left x position of the scan area.
.PP
Option
.B tl\-y
determines the top-left y position of the scan area.
.PP
Option
.B br\-x
determines the bottom-right x position of the scan area.
.PP
Option
.B br\-y
determines the bottom-right y position of the scan area.
.PP

.SH BOOL TEST OPTIONS
There are 6 bool test options in total.  Each option is numbered.  (3/6)
means: this is option 3 of 6.  The numbering scheme is intended for easier
detection of options not displayed by the frontend (because of missing support
or bugs).
.PP
Option
.B bool\-soft\-select\-soft\-detect
(1/6) is a bool test option that has soft select and soft detect (and
advanced) capabilities.  That's just a normal bool option.
.PP
Option
.B bool\-hard\-select\-soft\-detect
(2/6) is a bool test option that has hard select and soft detect (and
advanced) capabilities.  That means the option can't be set by the frontend
but by the user (e.g. by pressing a button at the device).
.PP
Option
.B bool\-hard\-select
(3/6) is a bool test option that has hard select (and advanced) capabilities.
That means the option can't be set by the frontend but by the user (e.g. by
pressing a button at the device) and can't be read by the frontend.
.PP
Option
.B bool\-soft\-detect
(4/6) is a bool test option that has soft detect (and advanced)
capabilities.  That means the option is read-only.
.PP
Option
.B bool\-soft\-select\-soft\-detect\-emulated
(5/6) is a Bool test option that has soft select, soft detect, and emulated
(and advanced) capabilities.
.PP
Option
.B bool\-soft\-select\-soft\-detect\-auto
(6/6) is a Bool test option that has soft select, soft detect, and automatic
(and advanced) capabilities.  This option can be automatically set by the
backend.
.PP

.SH INT TEST OPTIONS
There are 6 int test options in total.
.PP
Option
.B int
(1/6) is an int test option with no unit and no constraint set.
.PP
Option
.B int\-constraint\-range
(2/6) is an int test option with unit pixel and constraint range set.  Minimum
is 4, maximum 192, and quant is 2.
.PP
Option
.B int\-constraint\-word\-list
(3/6) is an int test option with unit bits and constraint word list set.
.PP
Option
.B int\-constraint\-array
(4/6) is an int test option with unit mm and using an array without
constraints.
.PP
Option
.B int\-constraint\-array\-constraint\-range
(5/6) is an int test option with unit mm and using an array with a range
constraint.  Minimum is 4, maximum 192, and quant is 2.
.PP
Option
.B int\-constraint\-array\-constraint\-word\-list
(6/6) is an int test option with unit percent and using an array a word list
constraint.

.SH FIXED TEST OPTIONS
There are 3 fixed test options in total.
.PP
Option
.B fixed
(1/3) is a fixed test option with no unit and no constraint set.
.PP
Option
.B fixed\-constraint\-range
(2/3) is a fixed test option with unit microsecond and constraint range
set. Minimum is \-42.17, maximum 32767.9999, and quant is 2.0.
.PP
Option
.B fixed\-constraint\-word\-list
(3/3) is a Fixed test option with no unit and constraint word list set.
.PP

.SH STRING TEST OPTIONS
There are 3 string test options in total.
.PP
Option
.B string
(1/3) is a string test option without constraint.
.PP
Option
.B string\-constraint\-string\-list
(2/3) is a string test option with string list constraint.
.PP
Option
.B string\-constraint\-long\-string\-list
(3/3) is a string test option with string list constraint. Contains some more
entries...
.PP

.SH BUTTON TEST OPTION
Option
.B button
(1/1) is a Button test option. Prints some text...
.PP

.SH FILES
.TP
.I @CONFIGDIR@/test.conf
The backend configuration file (see also description of
.B SANE_CONFIG_DIR
below). The initial values of most of the basic SANE options can be configured
in this file. A template containing all the default values is provided
together with this backend. One of the more interesting values may be
.BR number_of_devices .
It can be used to check the frontend's ability to show a long list of devices.
The config values concerning resolution and geometry can be useful to test
the handling of big file sizes.

.TP
.I @LIBDIR@/libsane\-test.a
The static library implementing this backend.
.TP
.I @LIBDIR@/libsane\-test.so
The shared library implementing this backend (present on systems that
support dynamic loading).

.SH ENVIRONMENT
.TP
.B SANE_CONFIG_DIR
This environment variable specifies the list of directories that may
contain the configuration file.  On *NIX systems, the directories are
separated by a colon (`:'), under OS/2, they are separated by a
semi-colon (`;').  If this variable is not set, the configuration file
is searched in two default directories: first, the current working
directory (".") and then in
.IR @CONFIGDIR@ .
If the value of the
environment variable ends with the directory separator character, then
the default directories are searched after the explicitly specified
directories.  For example, setting
.B SANE_CONFIG_DIR
to "/tmp/config:" would result in directories
.IR tmp/config ,
.IR . ,
and
.I "@CONFIGDIR@"
being searched (in this order).
.TP
.B SANE_DEBUG_TEST
If the library was compiled with debug support enabled, this
environment variable controls the debug level for this backend.  Higher
debug levels increase the verbosity of the output.

Example:
export SANE_DEBUG_TEST=4

.SH "SEE ALSO"
.BR sane (7),
.BR scanimage (1),
.BR xscanimage (1)
.br
.IR http://www.meier\-geinitz.de/sane/test\-backend/


.SH AUTHOR
Henning Meier-Geinitz
.RI < henning@meier\-geinitz.de >

.SH BUGS
\- config file values aren't tested for correctness