xref: /third_party/backends/backend/s9036.h (revision 141cc406)
1/* sane - Scanner Access Now Easy.
2
3   This file (C) 1997 Ingo Schneider
4
5   This file is part of the SANE package.
6
7   SANE is free software; you can redistribute it and/or modify it under
8   the terms of the GNU General Public License as published by the Free
9   Software Foundation; either version 2 of the License, or (at your
10   option) any later version.
11
12   SANE is distributed in the hope that it will be useful, but WITHOUT
13   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15   for more details.
16
17   You should have received a copy of the GNU General Public License
18   along with sane; see the file COPYING.
19   If not, see <https://www.gnu.org/licenses/>.  */
20#ifndef s9036_h
21#define s9036_h
22
23enum S9036_Option
24  {
25    OPT_NUM_OPTS = 0,
26
27    OPT_MODE_GROUP,
28    OPT_DEPTH,
29    OPT_RESOLUTION,
30
31    OPT_GEOMETRY_GROUP,
32    OPT_TL_X,			/* top-left x */
33    OPT_TL_Y,			/* top-left y */
34    OPT_BR_X,			/* bottom-right x */
35    OPT_BR_Y,			/* bottom-right y */
36
37    OPT_ENHANCEMENT_GROUP,
38    OPT_BRIGHTNESS,
39    OPT_CONTRAST,
40    OPT_BRIGHT_ADJUST,
41    OPT_CONTR_ADJUST,
42
43    /* must come last: */
44    NUM_OPTIONS
45  };
46
47typedef struct S9036_Device
48  {
49    struct S9036_Device *next;
50    SANE_Device sane;
51    SANE_Handle handle;
52  }
53S9036_Device;
54
55typedef struct S9036_Scanner
56  {
57    /* all the state needed to define a scan request: */
58
59    SANE_Option_Descriptor opt[NUM_OPTIONS];
60    SANE_Word val[NUM_OPTIONS];
61
62    /* Parsed option values and variables that are valid only during
63       actual scanning: */
64    SANE_Bool scanning;
65    SANE_Parameters params;
66
67    size_t bufsize;		/* about SCSI_MAX_REQUEST_SIZE */
68    SANE_Byte *buffer;		/* buffer of size 'bufsize' */
69    SANE_Byte *bufstart;	/* Start of data for next read */
70    size_t in_buffer;		/* bytes already in buffer */
71
72    int lines_in_scanner;	/* Lines in scanner memory */
73    int lines_read;		/* Total lines read for now */
74
75    int fd;			/* SCSI filedescriptor */
76
77    /* scanner dependent/low-level state: */
78    S9036_Device *hw;
79
80  }
81S9036_Scanner;
82
83#endif /* s9036_h */
84