1141cc406Sopenharmony_ci/* sane - Scanner Access Now Easy. 2141cc406Sopenharmony_ci Copyright (C) 1997 David Mosberger-Tang 3141cc406Sopenharmony_ci Updates and bugfixes (C) 2002. 2003 Henning Meier-Geinitz 4141cc406Sopenharmony_ci 5141cc406Sopenharmony_ci This file is part of the SANE package. 6141cc406Sopenharmony_ci 7141cc406Sopenharmony_ci As a special exception, the authors of SANE give permission for 8141cc406Sopenharmony_ci additional uses of the libraries contained in this release of SANE. 9141cc406Sopenharmony_ci 10141cc406Sopenharmony_ci The exception is that, if you link a SANE library with other files 11141cc406Sopenharmony_ci to produce an executable, this does not by itself cause the 12141cc406Sopenharmony_ci resulting executable to be covered by the GNU General Public 13141cc406Sopenharmony_ci License. Your use of that executable is in no way restricted on 14141cc406Sopenharmony_ci account of linking the SANE library code into it. 15141cc406Sopenharmony_ci 16141cc406Sopenharmony_ci This exception does not, however, invalidate any other reasons why 17141cc406Sopenharmony_ci the executable file might be covered by the GNU General Public 18141cc406Sopenharmony_ci License. 19141cc406Sopenharmony_ci 20141cc406Sopenharmony_ci If you submit changes to SANE to the maintainers to be included in 21141cc406Sopenharmony_ci a subsequent release, you agree by submitting the changes that 22141cc406Sopenharmony_ci those changes may be distributed with this exception intact. 23141cc406Sopenharmony_ci 24141cc406Sopenharmony_ci If you write modifications of your own for SANE, it is your choice 25141cc406Sopenharmony_ci whether to permit this exception to apply to your modifications. 26141cc406Sopenharmony_ci If you do not wish that, delete this exception notice. 27141cc406Sopenharmony_ci*/ 28141cc406Sopenharmony_ci 29141cc406Sopenharmony_ci#ifndef v4l_h 30141cc406Sopenharmony_ci#define v4l_h 31141cc406Sopenharmony_ci 32141cc406Sopenharmony_ci#include <../include/sane/sane.h> 33141cc406Sopenharmony_ci 34141cc406Sopenharmony_ci#define MAX_CHANNELS 32 35141cc406Sopenharmony_ci 36141cc406Sopenharmony_citypedef enum 37141cc406Sopenharmony_ci{ 38141cc406Sopenharmony_ci V4L_RES_LOW = 0, 39141cc406Sopenharmony_ci V4L_RES_HIGH 40141cc406Sopenharmony_ci} 41141cc406Sopenharmony_ciV4L_Resolution; 42141cc406Sopenharmony_ci 43141cc406Sopenharmony_citypedef enum 44141cc406Sopenharmony_ci{ 45141cc406Sopenharmony_ci OPT_NUM_OPTS = 0, 46141cc406Sopenharmony_ci 47141cc406Sopenharmony_ci OPT_MODE_GROUP, 48141cc406Sopenharmony_ci OPT_MODE, 49141cc406Sopenharmony_ci OPT_CHANNEL, 50141cc406Sopenharmony_ci 51141cc406Sopenharmony_ci OPT_GEOMETRY_GROUP, 52141cc406Sopenharmony_ci OPT_TL_X, /* top-left x */ 53141cc406Sopenharmony_ci OPT_TL_Y, /* top-left y */ 54141cc406Sopenharmony_ci OPT_BR_X, /* bottom-right x */ 55141cc406Sopenharmony_ci OPT_BR_Y, /* bottom-right y */ 56141cc406Sopenharmony_ci 57141cc406Sopenharmony_ci OPT_ENHANCEMENT_GROUP, 58141cc406Sopenharmony_ci OPT_BRIGHTNESS, 59141cc406Sopenharmony_ci OPT_HUE, 60141cc406Sopenharmony_ci OPT_COLOR, 61141cc406Sopenharmony_ci OPT_CONTRAST, 62141cc406Sopenharmony_ci OPT_WHITE_LEVEL, 63141cc406Sopenharmony_ci 64141cc406Sopenharmony_ci /* must come last: */ 65141cc406Sopenharmony_ci NUM_OPTIONS 66141cc406Sopenharmony_ci} 67141cc406Sopenharmony_ciV4L_Option; 68141cc406Sopenharmony_ci 69141cc406Sopenharmony_citypedef struct V4L_Device 70141cc406Sopenharmony_ci{ 71141cc406Sopenharmony_ci struct V4L_Device *next; 72141cc406Sopenharmony_ci SANE_Device sane; 73141cc406Sopenharmony_ci} 74141cc406Sopenharmony_ciV4L_Device; 75141cc406Sopenharmony_ci 76141cc406Sopenharmony_citypedef struct V4L_Scanner 77141cc406Sopenharmony_ci{ 78141cc406Sopenharmony_ci struct V4L_Scanner *next; 79141cc406Sopenharmony_ci 80141cc406Sopenharmony_ci SANE_Option_Descriptor opt[NUM_OPTIONS]; 81141cc406Sopenharmony_ci Option_Value val[NUM_OPTIONS]; 82141cc406Sopenharmony_ci V4L_Resolution resolution; 83141cc406Sopenharmony_ci SANE_Parameters params; 84141cc406Sopenharmony_ci SANE_String_Const devicename; /* Name of the Device */ 85141cc406Sopenharmony_ci int fd; /* Filedescriptor */ 86141cc406Sopenharmony_ci SANE_Int user_corner; /* bitmask of user-selected coordinates */ 87141cc406Sopenharmony_ci SANE_Bool scanning; 88141cc406Sopenharmony_ci SANE_Bool deliver_eof; 89141cc406Sopenharmony_ci SANE_Bool is_mmap; /* Do we use mmap ? */ 90141cc406Sopenharmony_ci /* state for reading a frame: */ 91141cc406Sopenharmony_ci size_t num_bytes; /* # of bytes read so far */ 92141cc406Sopenharmony_ci size_t bytes_per_frame; /* total number of bytes in frame */ 93141cc406Sopenharmony_ci struct video_capability capability; 94141cc406Sopenharmony_ci struct video_picture pict; 95141cc406Sopenharmony_ci struct video_window window; 96141cc406Sopenharmony_ci struct video_mbuf mbuf; 97141cc406Sopenharmony_ci struct video_mmap mmap; 98141cc406Sopenharmony_ci SANE_String_Const channel[MAX_CHANNELS]; 99141cc406Sopenharmony_ci SANE_Int buffercount; 100141cc406Sopenharmony_ci} 101141cc406Sopenharmony_ciV4L_Scanner; 102141cc406Sopenharmony_ci 103141cc406Sopenharmony_ci#endif /* v4l_h */ 104