moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kstars / kstars / indi / webcam / pwc-ioctl.h
blob49770362f7bcd9ff2fe00bc5b0260e3a40c8bd61
1 #ifndef PWC_IOCTL_H
2 #define PWC_IOCTL_H
4 /* (C) 2001-2002 Nemosoft Unv. webcam@smcc.demon.nl
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 /* This is pwc-ioctl.h belonging to PWC 8.6 */
23 /*
24 Changes
25 2001/08/03 Alvarado Added ioctl constants to access methods for
26 changing white balance and red/blue gains
29 /* These are private ioctl() commands, specific for the Philips webcams.
30 They contain functions not found in other webcams, and settings not
31 specified in the Video4Linux API.
33 The #define names are built up like follows:
34 VIDIOC VIDeo IOCtl prefix
35 PWC Philps WebCam
36 G optional: Get
37 S optional: Set
38 ... the function
44 /* The frame rate is encoded in the video_window.flags parameter using
45 the upper 16 bits, since some flags are defined nowadays. The following
46 defines provide a mask and shift to filter out this value.
48 In 'Snapshot' mode the camera freezes its automatic exposure and colour
49 balance controls.
51 #define PWC_FPS_SHIFT 16
52 #define PWC_FPS_MASK 0x00FF0000
53 #define PWC_FPS_FRMASK 0x003F0000
54 #define PWC_FPS_SNAPSHOT 0x00400000
58 struct pwc_probe
60 char name[32];
61 int type;
65 /* pwc_whitebalance.mode values */
66 #define PWC_WB_INDOOR 0
67 #define PWC_WB_OUTDOOR 1
68 #define PWC_WB_FL 2
69 #define PWC_WB_MANUAL 3
70 #define PWC_WB_AUTO 4
72 /* Used with VIDIOCPWC[SG]AWB (Auto White Balance).
73 Set mode to one of the PWC_WB_* values above.
74 *red and *blue are the respective gains of these colour components inside
75 the camera; range 0..65535
76 When 'mode' == PWC_WB_MANUAL, 'manual_red' and 'manual_blue' are set or read;
77 otherwise undefined.
78 'read_red' and 'read_blue' are read-only.
79 */
81 struct pwc_whitebalance
83 int mode;
84 int manual_red, manual_blue; /* R/W */
85 int read_red, read_blue; /* R/O */
88 /*
89 'control_speed' and 'control_delay' are used in automatic whitebalance mode,
90 and tell the camera how fast it should react to changes in lighting, and
91 with how much delay. Valid values are 0..65535.
93 struct pwc_wb_speed
95 int control_speed;
96 int control_delay;
100 /* Used with VIDIOCPWC[SG]LED */
101 struct pwc_leds
103 int led_on; /* Led on-time; range = 0..25000 */
104 int led_off; /* Led off-time; range = 0..25000 */
109 /* Restore user settings */
110 #define VIDIOCPWCRUSER _IO('v', 192)
111 /* Save user settings */
112 #define VIDIOCPWCSUSER _IO('v', 193)
113 /* Restore factory settings */
114 #define VIDIOCPWCFACTORY _IO('v', 194)
116 /* You can manipulate the compression factor. A compression preference of 0
117 means use uncompressed modes when available; 1 is low compression, 2 is
118 medium and 3 is high compression preferred. Of course, the higher the
119 compression, the lower the bandwidth used but more chance of artefacts
120 in the image. The driver automatically chooses a higher compression when
121 the preferred mode is not available.
123 /* Set preferred compression quality (0 = uncompressed, 3 = highest compression) */
124 #define VIDIOCPWCSCQUAL _IOW('v', 195, int)
125 /* Get preferred compression quality */
126 #define VIDIOCPWCGCQUAL _IOR('v', 195, int)
129 /* This is a probe function; since so many devices are supported, it
130 becomes difficult to include all the names in programs that want to
131 check for the enhanced Philips stuff. So in stead, try this PROBE;
132 it returns a structure with the original name, and the corresponding
133 Philips type.
134 To use, fill the structure with zeroes, call PROBE and if that succeeds,
135 compare the name with that returned from VIDIOCGCAP; they should be the
136 same. If so, you can be assured it is a Philips (OEM) cam and the type
137 is valid.
139 #define VIDIOCPWCPROBE _IOR('v', 199, struct pwc_probe)
141 /* Set AGC (Automatic Gain Control); int < 0 = auto, 0..65535 = fixed */
142 #define VIDIOCPWCSAGC _IOW('v', 200, int)
143 /* Get AGC; int < 0 = auto; >= 0 = fixed, range 0..65535 */
144 #define VIDIOCPWCGAGC _IOR('v', 200, int)
145 /* Set shutter speed; int < 0 = auto; >= 0 = fixed, range 0..65535 */
146 #define VIDIOCPWCSSHUTTER _IOW('v', 201, int)
148 /* Color compensation (Auto White Balance) */
149 #define VIDIOCPWCSAWB _IOW('v', 202, struct pwc_whitebalance)
150 #define VIDIOCPWCGAWB _IOR('v', 202, struct pwc_whitebalance)
152 /* Auto WB speed */
153 #define VIDIOCPWCSAWBSPEED _IOW('v', 203, struct pwc_wb_speed)
154 #define VIDIOCPWCGAWBSPEED _IOR('v', 203, struct pwc_wb_speed)
156 /* LEDs on/off/blink; int range 0..65535 */
157 #define VIDIOCPWCSLED _IOW('v', 205, struct pwc_leds)
158 #define VIDIOCPWCGLED _IOR('v', 205, struct pwc_leds)
160 /* Contour (sharpness); int < 0 = auto, 0..65536 = fixed */
161 #define VIDIOCPWCSCONTOUR _IOW('v', 206, int)
162 #define VIDIOCPWCGCONTOUR _IOR('v', 206, int)
164 /* Backlight compensation; 0 = off, otherwise on */
165 #define VIDIOCPWCSBACKLIGHT _IOW('v', 207, int)
166 #define VIDIOCPWCGBACKLIGHT _IOR('v', 207, int)
168 /* Flickerless mode; = 0 off, otherwise on */
169 #define VIDIOCPWCSFLICKER _IOW('v', 208, int)
170 #define VIDIOCPWCGFLICKER _IOR('v', 208, int)
172 /* Dynamic noise reduction; 0 off, 3 = high noise reduction */
173 #define VIDIOCPWCSDYNNOISE _IOW('v', 209, int)
174 #define VIDIOCPWCGDYNNOISE _IOR('v', 209, int)
176 #endif