summaryrefslogtreecommitdiff
path: root/backend/agfafocus.h
blob: 036a656ac85bfbf369b049dca9469b6471b08233 (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
/* sane - Scanner Access Now Easy.

   This file (C) 1997 Ingo Schneider
             (C) 1998 Karl Anders Øygard

   This file is part of the SANE package.

   SANE is free software; you can redistribute it and/or modify it under
   the terms of the GNU General Public License as published by the Free
   Software Foundation; either version 2 of the License, or (at your
   option) any later version.

   SANE is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   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.  */

#ifndef agfafocus_h
#define agfafocus_h

enum AgfaFocus_Scanner_Type
  {
    AGFAGRAY64,
    AGFALINEART,
    AGFAGRAY256,
    AGFACOLOR
  };

typedef enum
  {
    LINEART,
    GRAY6BIT,
    GRAY8BIT,
    COLOR18BIT,
    COLOR24BIT
  }
AgfaFocus_Scanner_Mode;

enum AgfaFocus_Option
  {
    OPT_NUM_OPTS = 0,

    OPT_MODE_GROUP,
    OPT_MODE,
    OPT_HALFTONE_PATTERN,	/* halftone matrix */
    OPT_RESOLUTION,
    OPT_SOURCE,
    OPT_QUALITY,                /* quality calibration */

    OPT_GEOMETRY_GROUP,
    OPT_TL_X,			/* top-left x */
    OPT_TL_Y,			/* top-left y */
    OPT_BR_X,			/* bottom-right x */
    OPT_BR_Y,			/* bottom-right y */

    OPT_ENHANCEMENT_GROUP,
    OPT_EXPOSURE,
    OPT_BRIGHTNESS,
    OPT_CONTRAST,
    OPT_AUTO_BRIGHTNESS,
    OPT_AUTO_CONTRAST,
    OPT_ATTENUATION_RED,
    OPT_ATTENUATION_BLUE,
    OPT_ATTENUATION_GREEN,
    OPT_SHARPEN,		/* sharpening */

    /* must come last: */
    NUM_OPTIONS
  };


typedef struct AgfaFocus_Device
  {
    struct AgfaFocus_Device *next;
    SANE_Device sane;
    SANE_Handle handle;

    SANE_Word type;
    SANE_Bool transparent;
    SANE_Bool analoglog;
    SANE_Bool tos5;
    SANE_Bool quality;
    SANE_Bool disconnect;
    SANE_Bool upload_user_defines;
  }
AgfaFocus_Device;

typedef struct AgfaFocus_Scanner
  {
    /* all the state needed to define a scan request: */

    SANE_Option_Descriptor opt[NUM_OPTIONS];
    Option_Value val[NUM_OPTIONS];

    /* Parsed option values and variables that are valid only during
       actual scanning: */
    SANE_Bool scanning;
    SANE_Int pass;
    SANE_Parameters params;

    AgfaFocus_Scanner_Mode mode;

    SANE_Int image_composition;
    SANE_Int bpp;
    SANE_Int halftone;
    SANE_Int original;
    SANE_Int exposure;
    SANE_Int r_att;
    SANE_Int g_att;
    SANE_Int b_att;
    SANE_Int tonecurve;
    SANE_Int quality;
    SANE_Bool edge;
    SANE_Bool lin_log;

    int lines_available;	/* Lines in scanner memory */

    int fd;			/* SCSI filedescriptor */
    SANE_Pid reader_pid;		/* process id of reader */
    int pipe;			/* pipe to reader process */
    int reader_pipe;		/* pipe from reader process */

    /* scanner dependent/low-level state: */
    AgfaFocus_Device *hw;
  }
AgfaFocus_Scanner;

#endif /* agfafocus_h */