home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / epsonsan.zip / epson_17062002.h < prev   
C/C++ Source or Header  |  2002-08-16  |  4KB  |  138 lines

  1. /* epson.h - SANE library for Epson flatbed scanners.
  2.  
  3.    based on Kazuhiro Sasayama previous
  4.    Work on epson.[ch] file from the SANE package.
  5.  
  6.    original code taken from sane-0.71
  7.    Copyright (C) 1997 Hypercore Software Design, Ltd.
  8.  
  9.    modifications
  10.    Copyright (C) 1998 Christian Bucher
  11.    Copyright (C) 1998 Kling & Hautzinger GmbH
  12.  
  13.    This file is part of the SANE package.
  14.  
  15.    This program is free software; you can redistribute it and/or
  16.    modify it under the terms of the GNU General Public License as
  17.    published by the Free Software Foundation; either version 2 of the
  18.    License, or (at your option) any later version.
  19.  
  20.    This program is distributed in the hope that it will be useful, but
  21.    WITHOUT ANY WARRANTY; without even the implied warranty of
  22.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  23.    General Public License for more details.
  24.  
  25.    You should have received a copy of the GNU General Public License
  26.    along with this program; if not, write to the Free Software
  27.    Foundation, Inc., 59 Temple Place - Suite 330, Boston,
  28.    MA 02111-1307, USA.
  29.  
  30.    As a special exception, the authors of SANE give permission for
  31.    additional uses of the libraries contained in this release of SANE.
  32.  
  33.    The exception is that, if you link a SANE library with other files
  34.    to produce an executable, this does not by itself cause the
  35.    resulting executable to be covered by the GNU General Public
  36.    License.  Your use of that executable is in no way restricted on
  37.    account of linking the SANE library code into it.
  38.  
  39.    This exception does not, however, invalidate any other reasons why
  40.    the executable file might be covered by the GNU General Public
  41.    License.
  42.  
  43.    If you submit changes to SANE to the maintainers to be included in
  44.    a subsequent release, you agree by submitting the changes that
  45.    those changes may be distributed with this exception intact.
  46.  
  47.    If you write modifications of your own for SANE, it is your choice
  48.    whether to permit this exception to apply to your modifications.
  49.    If you do not wish that, delete this exception notice.  */
  50.  
  51. #ifndef epson_h
  52. #define epson_h 1
  53.  
  54.  
  55. typedef struct {
  56.     int command;
  57.     char code;
  58.     char *name;
  59.     int enabled;
  60.     int length;
  61. } CmdEntry;
  62.  
  63.  
  64. enum {
  65.     OPT_NUM_OPTS = 0,
  66.     OPT_MODE_GROUP,
  67.     OPT_FILMTYPE,
  68.     OPT_EJECT,
  69.     OPT_CALIBRATE,
  70.     OPT_BAY,
  71.     OPT_MODE,
  72.     OPT_HALFTONE,
  73.     OPT_DROPOUT,
  74.     OPT_BRIGHTNESS,
  75.     OPT_SHARPNESS,
  76.     OPT_RESOLUTION,
  77.     OPT_GAMMA,
  78.     OPT_COLOUR,
  79.     OPT_ZOOM,
  80.     OPT_GEOMETRY_GROUP,
  81.     OPT_TL_X,
  82.     OPT_TL_Y,
  83.     OPT_BR_X,
  84.     OPT_BR_Y,
  85.     OPT_ORIENTATION,
  86.     NUM_OPTIONS
  87.   };
  88.  
  89. /*
  90.  *    Scanner data where there is one copy per Device Type
  91.  */
  92. struct Epson_Device
  93.   {
  94.     SANE_Device sane;
  95.     SANE_Int type;
  96.     SANE_Int level;
  97.     SANE_Range dpi_range;
  98.     SANE_Range x_range;
  99.     SANE_Range y_range;
  100.     SANE_Bool is_scsi;
  101.     SANE_Int *res_list;
  102.     SANE_Int res_list_size;
  103.     CmdEntry    *cmd2;
  104.     struct Epson_Device *next;
  105.   };
  106.  
  107. typedef struct Epson_Device Epson_Device;
  108.  
  109. #define EPSON_MAX_BAY    6
  110.  
  111. /*
  112.  *    Scanner data where there is one copy per Device in use
  113.  */
  114. struct Epson_Scanner
  115.   {
  116.     int fd;
  117.     int        needinit;            /* Set if we need the scanner to be re-initialised */
  118.     Epson_Device *hw;
  119.     SANE_Option_Descriptor opt[NUM_OPTIONS];
  120.     unsigned long val[NUM_OPTIONS];
  121.     SANE_Parameters params;
  122.     SANE_Bool block;
  123.     SANE_Bool eof;
  124.     SANE_Byte *buf, *end, *ptr;
  125.     SANE_Bool canceling;
  126.     struct {
  127.         int        calibrated;
  128.         unsigned char        tvaltable[4];
  129.         int        film_type;
  130.         unsigned char gammatableR[256], gammatableG[256], gammatableB[256];
  131.     } bay[EPSON_MAX_BAY];
  132.     struct Epson_Scanner *next;
  133.   };
  134.  
  135. typedef struct Epson_Scanner Epson_Scanner;
  136.  
  137. #endif /* not epson_h */
  138.