1/*	$NetBSD: scanio.h,v 1.1 1996/02/18 20:33:18 mycroft Exp $	*/
2
3/*
4 * Copyright (c) 1995 Kenneth Stailey.  All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 *    notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 *    notice, this list of conditions and the following disclaimer in the
13 *    documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software
15 *    must display the following acknowledgement:
16 *	This product includes software developed by Kenneth Stailey.
17 * 4. The name of the author may not be used to endorse or promote products
18 *    derived from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32/*
33 * Definitions for PINT scanner drivers
34 */
35
36#ifndef _SYS_SCANIO_H_
37#define _SYS_SCANIO_H_
38
39/*
40 * XXX scancap make this sort of obsolete:
41 *
42 * Some comments about the values in the scan_io struct:
43 *
44 * All user-changeable values have minimum and maximum values for
45 * specific scanner types and are rejected by the special drivers if
46 * they are not in range. For values in the range, the driver selects
47 * the next physically possible setting for the particular scanner.
48 * So it is good practice to issue a SCIOCGET after a SCIOCSET to see
49 * what the driver has chosen.
50 *
51 * Brightness and contrast default to 100 (%) but scanners may support
52 * higher and/or lower values, though the maximum value is 255.
53 * velocity is the scan speed and defaults to 100 (%), only slower
54 * values may be possible.
55 */
56
57struct scan_io {
58	u_long	scan_width;		 /* width in 1/1200ths of an inch */
59	u_long	scan_height;		 /* height in 1/1200ths of an inch */
60#ifdef SCAN_BC
61# define scan_window_width scan_width
62# define scan_window_length scan_height
63#endif
64	u_short	scan_x_resolution;	/* horizontal resolution in dots-per-inch */
65	u_short	scan_y_resolution;	/* vertical resolution in dots-per-inch */
66	u_long	scan_x_origin;		/* horizontal coordinate of upper left corner */
67	u_long	scan_y_origin;		/* vertical coordinate of upper left corner */
68	u_char	scan_image_mode;	/* type of image data sent by scanner */
69	u_char	scan_brightness;	/* brightness control for those to can do it */
70	u_char	scan_contrast;		/* contrast control for those to can do it */
71	u_char	scan_quality;		/* speed of scan for instance */
72#ifdef SCAN_BC
73# define scan_velocity scan_quality
74#endif
75	u_long	scan_window_size;	/* size of window in bytes (ro) */
76	u_long	scan_lines;		/* number of pixels per column (ro) */
77	u_long	scan_pixels_per_line;	/* number of pixels per line (ro) */
78	u_short	scan_bits_per_pixel;	/* number of bits per pixel (ro) */
79	u_char	scan_scanner_type;	/* type of scanner (ro) */
80};
81
82/*
83 * defines for different commands
84 */
85
86#define SCIOCGET	_IOR('S', 1, struct scan_io) /* retrieve parameters */
87#define SCIOCSET	_IOW('S', 2, struct scan_io) /* set parameters */
88#define SCIOCRESTART	_IO('S', 3) /* restart scan */
89#define SCIOC_USE_ADF	_IO('S', 4) /* use ADF as paper source for next scan */
90				    /* even after close() */
91#ifdef SCAN_BC
92# define SCAN_GET	SCIOCGET
93# define SCAN_SET	SCIOCSET
94# define SCAN_REWIND	SCIOCRESTART
95# define SCAN_USE_ADF	SCIOC_USE_ADF
96#endif
97
98/*
99 * defines for scan_image_mode field
100 */
101
102#define SIM_BINARY_MONOCHROME	0
103#define SIM_DITHERED_MONOCHROME	1
104#define SIM_GRAYSCALE		2
105#define SIM_COLOR		5
106#define SIM_RED			103
107#define SIM_GREEN		104
108#define SIM_BLUE		105
109
110/*
111 * defines for different types of scanners & product names as comments
112 */
113
114#define RICOH_IS410	1	/* Ricoh IS-410 */
115#define FUJITSU_M3096G	2	/* Fujitsu M3096G */
116#ifdef SCAN_BC
117# define FUJITSU	2	/* Fujitsu M3096G (deprecated) */
118#endif
119#define HP_SCANJET_IIC	3	/* HP ScanJet IIc */
120#define RICOH_FS1	4	/* Ricoh FS1 */
121#define SHARP_JX600	5	/* Sharp JX600 */
122#define RICOH_IS50	6	/* Ricoh IS-50 */
123#define IBM_2456	7	/* IBM 2456 */
124#define UMAX_UC630	8	/* UMAX UC630 */
125#define UMAX_UG630	9	/* UMAX UG630 */
126#define MUSTEK_06000CX	10	/* Mustek MFS06000CX */
127#define MUSTEK_12000CX	11	/* Mustek MFS12000CX */
128#define EPSON_ES300C	12	/* epson es300c */
129
130#endif /* _SYS_SCANIO_H_ */
131