kopia lustrzana https://gitlab.com/sane-project/backends
revert mustek_usb2 backend upgrade
Instead of 100+ revert commits, I've lumped everything into a single commit. This removes all ofmerge-requests/1/headdedf0ac30
throughdb7f038f1
, plus the parts of497d59180
which were specific to mustek_usb2
rodzic
21c5f4d814
commit
e6a249e042
|
@ -770,13 +770,15 @@ EXTRA_DIST += mustek_usb.conf.in
|
|||
# TODO: Why are these distributed but not compiled?
|
||||
EXTRA_DIST += mustek_usb_high.c mustek_usb_high.h mustek_usb_low.c mustek_usb_low.h mustek_usb_mid.c mustek_usb_mid.h
|
||||
|
||||
libmustek_usb2_la_SOURCES = mustek_usb2.c mustek_usb2.h mustek_usb2_high.c mustek_usb2_high.h mustek_usb2_asic.c mustek_usb2_asic.h
|
||||
libmustek_usb2_la_SOURCES = mustek_usb2.c mustek_usb2.h
|
||||
libmustek_usb2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=mustek_usb2
|
||||
|
||||
nodist_libsane_mustek_usb2_la_SOURCES = mustek_usb2-s.c
|
||||
libsane_mustek_usb2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=mustek_usb2
|
||||
libsane_mustek_usb2_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS)
|
||||
libsane_mustek_usb2_la_LIBADD = $(COMMON_LIBS) libmustek_usb2.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo $(MATH_LIB) $(PTHREAD_LIBS) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS)
|
||||
# TODO: Why are these distributed but not compiled?
|
||||
EXTRA_DIST += mustek_usb2_asic.c mustek_usb2_asic.h mustek_usb2_high.c mustek_usb2_high.h mustek_usb2_reflective.c mustek_usb2_transparent.c
|
||||
|
||||
libnec_la_SOURCES = nec.c nec.h
|
||||
libnec_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=nec
|
||||
|
|
|
@ -316,9 +316,7 @@ libmustek_usb_la_LIBADD =
|
|||
am_libmustek_usb_la_OBJECTS = libmustek_usb_la-mustek_usb.lo
|
||||
libmustek_usb_la_OBJECTS = $(am_libmustek_usb_la_OBJECTS)
|
||||
libmustek_usb2_la_LIBADD =
|
||||
am_libmustek_usb2_la_OBJECTS = libmustek_usb2_la-mustek_usb2.lo \
|
||||
libmustek_usb2_la-mustek_usb2_high.lo \
|
||||
libmustek_usb2_la-mustek_usb2_asic.lo
|
||||
am_libmustek_usb2_la_OBJECTS = libmustek_usb2_la-mustek_usb2.lo
|
||||
libmustek_usb2_la_OBJECTS = $(am_libmustek_usb2_la_OBJECTS)
|
||||
libnec_la_LIBADD =
|
||||
am_libnec_la_OBJECTS = libnec_la-nec.lo
|
||||
|
@ -1783,7 +1781,6 @@ GPHOTO2_LIBS = @GPHOTO2_LIBS@
|
|||
GREP = @GREP@
|
||||
HAVE_GPHOTO2 = @HAVE_GPHOTO2@
|
||||
IEEE1284_LIBS = @IEEE1284_LIBS@
|
||||
INCLUDES = @INCLUDES@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_LOCKPATH = @INSTALL_LOCKPATH@
|
||||
|
@ -1955,6 +1952,7 @@ FIRMWARE_DIRS = artec_eplus48u gt68xx snapscan epjitsu
|
|||
# TODO: Why are these distributed but not compiled?
|
||||
# TODO: Why are these distributed but not compiled?
|
||||
# TODO: Why are these distributed but not compiled?
|
||||
# TODO: Why are these distributed but not compiled?
|
||||
# TODO: Why is this distributed but not installed?
|
||||
EXTRA_DIST = sane_strstatus.c stubs.c saned.conf.in abaton.conf.in \
|
||||
agfafocus.conf.in apple.conf.in artec.conf.in \
|
||||
|
@ -1988,7 +1986,9 @@ EXTRA_DIST = sane_strstatus.c stubs.c saned.conf.in abaton.conf.in \
|
|||
mustek_pp_cis.c mustek_pp_cis.h mustek_pp_null.c \
|
||||
mustek_usb.conf.in mustek_usb_high.c mustek_usb_high.h \
|
||||
mustek_usb_low.c mustek_usb_low.h mustek_usb_mid.c \
|
||||
mustek_usb_mid.h nec.conf.in net.conf.in niash_core.c \
|
||||
mustek_usb_mid.h mustek_usb2_asic.c mustek_usb2_asic.h \
|
||||
mustek_usb2_high.c mustek_usb2_high.h mustek_usb2_reflective.c \
|
||||
mustek_usb2_transparent.c nec.conf.in net.conf.in niash_core.c \
|
||||
niash_core.h niash_xfer.c niash_xfer.h pie.conf.in \
|
||||
pieusb.conf.in p5.conf.in p5_device.c pixma.conf.in \
|
||||
pixma_sane_options.c pixma_sane_options.h plustek.conf.in \
|
||||
|
@ -2485,7 +2485,7 @@ nodist_libsane_mustek_usb_la_SOURCES = mustek_usb-s.c
|
|||
libsane_mustek_usb_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=mustek_usb
|
||||
libsane_mustek_usb_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS)
|
||||
libsane_mustek_usb_la_LIBADD = $(COMMON_LIBS) libmustek_usb.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) $(RESMGR_LIBS)
|
||||
libmustek_usb2_la_SOURCES = mustek_usb2.c mustek_usb2.h mustek_usb2_high.c mustek_usb2_high.h mustek_usb2_asic.c mustek_usb2_asic.h
|
||||
libmustek_usb2_la_SOURCES = mustek_usb2.c mustek_usb2.h
|
||||
libmustek_usb2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=mustek_usb2
|
||||
nodist_libsane_mustek_usb2_la_SOURCES = mustek_usb2-s.c
|
||||
libsane_mustek_usb2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=mustek_usb2
|
||||
|
@ -3482,8 +3482,6 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmustek_la-mustek.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmustek_pp_la-mustek_pp.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmustek_usb2_la-mustek_usb2.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmustek_usb2_la-mustek_usb2_asic.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmustek_usb2_la-mustek_usb2_high.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmustek_usb_la-mustek_usb.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnec_la-nec.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnet_la-net.Plo@am__quote@
|
||||
|
@ -4307,20 +4305,6 @@ libmustek_usb2_la-mustek_usb2.lo: mustek_usb2.c
|
|||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmustek_usb2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmustek_usb2_la-mustek_usb2.lo `test -f 'mustek_usb2.c' || echo '$(srcdir)/'`mustek_usb2.c
|
||||
|
||||
libmustek_usb2_la-mustek_usb2_high.lo: mustek_usb2_high.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmustek_usb2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmustek_usb2_la-mustek_usb2_high.lo -MD -MP -MF $(DEPDIR)/libmustek_usb2_la-mustek_usb2_high.Tpo -c -o libmustek_usb2_la-mustek_usb2_high.lo `test -f 'mustek_usb2_high.c' || echo '$(srcdir)/'`mustek_usb2_high.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmustek_usb2_la-mustek_usb2_high.Tpo $(DEPDIR)/libmustek_usb2_la-mustek_usb2_high.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mustek_usb2_high.c' object='libmustek_usb2_la-mustek_usb2_high.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmustek_usb2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmustek_usb2_la-mustek_usb2_high.lo `test -f 'mustek_usb2_high.c' || echo '$(srcdir)/'`mustek_usb2_high.c
|
||||
|
||||
libmustek_usb2_la-mustek_usb2_asic.lo: mustek_usb2_asic.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmustek_usb2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmustek_usb2_la-mustek_usb2_asic.lo -MD -MP -MF $(DEPDIR)/libmustek_usb2_la-mustek_usb2_asic.Tpo -c -o libmustek_usb2_la-mustek_usb2_asic.lo `test -f 'mustek_usb2_asic.c' || echo '$(srcdir)/'`mustek_usb2_asic.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmustek_usb2_la-mustek_usb2_asic.Tpo $(DEPDIR)/libmustek_usb2_la-mustek_usb2_asic.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mustek_usb2_asic.c' object='libmustek_usb2_la-mustek_usb2_asic.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmustek_usb2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmustek_usb2_la-mustek_usb2_asic.lo `test -f 'mustek_usb2_asic.c' || echo '$(srcdir)/'`mustek_usb2_asic.c
|
||||
|
||||
libnec_la-nec.lo: nec.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnec_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnec_la-nec.lo -MD -MP -MF $(DEPDIR)/libnec_la-nec.Tpo -c -o libnec_la-nec.lo `test -f 'nec.c' || echo '$(srcdir)/'`nec.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnec_la-nec.Tpo $(DEPDIR)/libnec_la-nec.Plo
|
||||
|
|
Plik diff jest za duży
Load Diff
|
@ -49,16 +49,25 @@
|
|||
#ifndef MUSTEK_USB2_H
|
||||
#define MUSTEK_USB2_H
|
||||
|
||||
#include "mustek_usb2_high.h"
|
||||
#ifndef SANE_I18N
|
||||
#define SANE_I18N(text) text
|
||||
#endif
|
||||
|
||||
#define ENABLE(OPTION) s->opt[OPTION].cap &= ~SANE_CAP_INACTIVE
|
||||
#define DISABLE(OPTION) s->opt[OPTION].cap |= SANE_CAP_INACTIVE
|
||||
#define IS_ACTIVE(OPTION) (((s->opt[OPTION].cap) & SANE_CAP_INACTIVE) == 0)
|
||||
/* RIE: return if error */
|
||||
#define RIE(function) do {status = function; if (status != SANE_STATUS_GOOD) \
|
||||
return status;} while (SANE_FALSE)
|
||||
|
||||
#define SCAN_BUFFER_SIZE (64 * 1024)
|
||||
#define MAX_RESOLUTIONS 12
|
||||
#define MAX_BUTTONS 5
|
||||
#define DEF_LINEARTTHRESHOLD 128
|
||||
#define PER_ADD_START_LINES 0
|
||||
#define PRE_ADD_START_X 0
|
||||
|
||||
|
||||
enum
|
||||
enum Mustek_Usb_Option
|
||||
{
|
||||
OPT_NUM_OPTS = 0,
|
||||
OPT_MODE_GROUP,
|
||||
|
@ -67,89 +76,83 @@ enum
|
|||
OPT_RESOLUTION,
|
||||
OPT_PREVIEW,
|
||||
|
||||
OPT_DEBUG_GROUP,
|
||||
OPT_AUTO_WARMUP,
|
||||
|
||||
OPT_ENHANCEMENT_GROUP,
|
||||
OPT_THRESHOLD,
|
||||
OPT_GAMMA_VALUE,
|
||||
|
||||
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_SENSORS_GROUP,
|
||||
OPT_BUTTON_1,
|
||||
OPT_BUTTON_2,
|
||||
OPT_BUTTON_3,
|
||||
OPT_BUTTON_4,
|
||||
OPT_BUTTON_5,
|
||||
|
||||
/* must come last: */
|
||||
NUM_OPTIONS
|
||||
};
|
||||
|
||||
|
||||
typedef struct
|
||||
typedef struct Scanner_Model
|
||||
{
|
||||
/** @name Identification */
|
||||
/*@{ */
|
||||
|
||||
/** A single lowercase word to be used in the configuration file. */
|
||||
SANE_String_Const name;
|
||||
|
||||
/** Device vendor string. */
|
||||
SANE_String_Const vendor_name;
|
||||
SANE_String_Const vendor;
|
||||
|
||||
/** Device model name. */
|
||||
SANE_String_Const model_name;
|
||||
SANE_String_Const model;
|
||||
|
||||
/** USB vendor and product ID */
|
||||
unsigned short vendor_id;
|
||||
unsigned short product_id;
|
||||
|
||||
const Scanner_ModelParams * scanner_params;
|
||||
/** Name of the firmware file. */
|
||||
SANE_String_Const firmware_name;
|
||||
|
||||
/** @name Scanner model parameters */
|
||||
/*@{ */
|
||||
SANE_Word dpi_values[MAX_RESOLUTIONS]; /* possible resolutions */
|
||||
SANE_Range x_range; /* size of scan area in mm */
|
||||
SANE_Range y_range;
|
||||
SANE_Range x_range_ta; /* size of scan area in TA mode in mm */
|
||||
SANE_Range y_range_ta;
|
||||
|
||||
SANE_Bool isRGBInvert; /* order of the CCD/CIS colors:
|
||||
RGB if SANE_False, BGR otherwise */
|
||||
SANE_Int dpi_values[MAX_RESOLUTIONS]; /* possible resolutions */
|
||||
SANE_Fixed x_offset; /* Start of scan area in mm */
|
||||
SANE_Fixed y_offset; /* Start of scan area in mm */
|
||||
SANE_Fixed x_size; /* Size of scan area in mm */
|
||||
SANE_Fixed y_size; /* Size of scan area in mm */
|
||||
|
||||
SANE_Int buttons; /* number of buttons on the scanner */
|
||||
/* option names, titles, and descriptions for the buttons */
|
||||
SANE_String_Const button_name[MAX_BUTTONS];
|
||||
SANE_String_Const button_title[MAX_BUTTONS];
|
||||
SANE_String_Const button_desc[MAX_BUTTONS];
|
||||
SANE_Fixed x_offset_ta; /* Start of scan area in TA mode in mm */
|
||||
SANE_Fixed y_offset_ta; /* Start of scan area in TA mode in mm */
|
||||
SANE_Fixed x_size_ta; /* Size of scan area in TA mode in mm */
|
||||
SANE_Fixed y_size_ta; /* Size of scan area in TA mode in mm */
|
||||
|
||||
|
||||
RGBORDER line_mode_color_order; /* Order of the CCD/CIS colors */
|
||||
SANE_Fixed default_gamma_value; /* Default gamma value */
|
||||
|
||||
SANE_Bool is_cis; /* Is this a CIS or CCD scanner? */
|
||||
|
||||
SANE_Word flags; /* Which hacks are needed for this scanner? */
|
||||
/*@} */
|
||||
} Scanner_Model;
|
||||
|
||||
typedef struct Scanner_Device
|
||||
typedef struct Mustek_Scanner
|
||||
{
|
||||
struct Scanner_Device * next;
|
||||
/* all the state needed to define a scan request: */
|
||||
struct Mustek_Scanner *next;
|
||||
|
||||
const Scanner_Model * model;
|
||||
SANE_String name;
|
||||
SANE_Bool present;
|
||||
} Scanner_Device;
|
||||
|
||||
typedef struct Scanner_Handle
|
||||
{
|
||||
struct Scanner_Handle * next;
|
||||
|
||||
const Scanner_Model * model;
|
||||
SANE_Option_Descriptor opt[NUM_OPTIONS];
|
||||
Option_Value val[NUM_OPTIONS];
|
||||
SANE_Parameters params;
|
||||
|
||||
Scanner_State state;
|
||||
|
||||
unsigned short *gamma_table;
|
||||
SANE_Parameters params; /**< SANE Parameters */
|
||||
Scanner_Model model;
|
||||
SETPARAMETERS setpara;
|
||||
GETPARAMETERS getpara;
|
||||
SANE_Bool bIsScanning;
|
||||
SANE_Bool bIsReading;
|
||||
SANE_Word read_rows; /* number of image lines left to read */
|
||||
SANE_Byte * scan_buf;
|
||||
SANE_Byte * scan_buf_start;
|
||||
SANE_Int scan_buf_len;
|
||||
} Scanner_Handle;
|
||||
SANE_Word read_rows; /* transfer image's lines */
|
||||
SANE_Byte *Scan_data_buf; /*store Scanned data for transfer */
|
||||
SANE_Byte *Scan_data_buf_start; /*point to data need to transfer */
|
||||
size_t scan_buffer_len; /* length of data buf */
|
||||
}
|
||||
Mustek_Scanner;
|
||||
|
||||
#endif
|
||||
|
|
Plik diff jest za duży
Load Diff
Plik diff jest za duży
Load Diff
Plik diff jest za duży
Load Diff
|
@ -48,129 +48,216 @@
|
|||
#ifndef MUSTEK_USB2_HIGH_H
|
||||
#define MUSTEK_USB2_HIGH_H
|
||||
|
||||
#include "mustek_usb2_asic.h"
|
||||
/* const use in structures*/
|
||||
|
||||
/*scan mode*/
|
||||
typedef unsigned short SCANMODE, *LPSCANMODE;
|
||||
#define SM_TEXT 0x00
|
||||
#define SM_GRAY 0x01
|
||||
#define SM_RGB24 0x02
|
||||
#define SM_GRAY10 0x03
|
||||
#define SM_RGB30 0x04
|
||||
#define SM_GRAY12 0x05
|
||||
#define SM_RGB36 0x06
|
||||
#define SM_GRAY14 0x07
|
||||
#define SM_RGB42 0x08
|
||||
#define SM_GRAY16 0x09
|
||||
#define SM_RGB48 0x0a
|
||||
|
||||
typedef enum
|
||||
/*pixel flavor*/
|
||||
typedef SANE_Byte PIXELFLAVOR, *LPPIXELFLAVOR;
|
||||
#define PF_BlackIs0 0x00
|
||||
#define PF_WhiteIs0 0x01
|
||||
|
||||
/*scan source*/
|
||||
typedef SANE_Byte SCANSOURCE, *LPSCANSOURCE;
|
||||
#define SS_Reflective 0x00
|
||||
#define SS_Positive 0x01
|
||||
#define SS_Negative 0x02
|
||||
#define SS_ADF 0x03
|
||||
|
||||
/*RGB order*/
|
||||
typedef unsigned short RGBORDER, *LPRGBORDER;
|
||||
#define RO_RGB 0x00
|
||||
#define RO_BGR 0x01
|
||||
|
||||
/* structures use in parameters of export function*/
|
||||
|
||||
typedef struct tagGAMMAINFO
|
||||
{
|
||||
CM_RGB48,
|
||||
CM_RGB24,
|
||||
CM_GRAY16,
|
||||
CM_GRAY8,
|
||||
CM_TEXT
|
||||
} COLORMODE;
|
||||
SCANMODE smScanMode;
|
||||
unsigned short wInputGammaBits;
|
||||
unsigned short wOutputGammaBits;
|
||||
} GAMMAINFO, *LPGAMMAINFO;
|
||||
|
||||
|
||||
typedef struct
|
||||
typedef struct tagGETPARAMETERS
|
||||
{
|
||||
COLORMODE cmColorMode;
|
||||
unsigned short wSourceXDPI;
|
||||
unsigned short wSourceYDPI;
|
||||
unsigned int dwLineByteWidth;
|
||||
unsigned int dwLength;
|
||||
} GETPARAMETERS, *LPGETPARAMETERS;
|
||||
|
||||
typedef struct tagFRAME
|
||||
{
|
||||
unsigned short x1;
|
||||
unsigned short y1;
|
||||
unsigned short x2;
|
||||
unsigned short y2;
|
||||
} FRAME, *LPFRAME;
|
||||
|
||||
typedef struct tagSETPARAMETERS
|
||||
{
|
||||
FRAME fmArea;
|
||||
unsigned short wTargetDPI;
|
||||
SCANMODE smScanMode;
|
||||
unsigned short wLinearThreshold; /*threshold for Line art mode */
|
||||
PIXELFLAVOR pfPixelFlavor;
|
||||
SCANSOURCE ssScanSource;
|
||||
unsigned short * pGammaTable;
|
||||
} SETPARAMETERS, *LPSETPARAMETERS;
|
||||
|
||||
typedef struct tagIMAGEROWS
|
||||
{
|
||||
RGBORDER roRgbOrder;
|
||||
unsigned short wWantedLineNum;
|
||||
unsigned short wXferedLineNum;
|
||||
SANE_Byte * pBuffer;
|
||||
} IMAGEROWS, *LPIMAGEROWS;
|
||||
|
||||
|
||||
/*Macro define*/
|
||||
|
||||
#define R_GAIN 0
|
||||
#define G_GAIN 0
|
||||
#define B_GAIN 0
|
||||
#define R_OFFSET 0
|
||||
#define G_OFFSET 0
|
||||
#define B_OFFSET 0
|
||||
#define R_DIRECTION 0
|
||||
#define G_DIRECTION 0
|
||||
#define B_DIRECTION 0
|
||||
|
||||
/* use for adjust AD's offset*/
|
||||
|
||||
/* for Reflective*/
|
||||
#define REFL_DARK_MAX_LEVEL 20
|
||||
#define REFL_DARK_MIN_LEVEL 10
|
||||
#define REFL_WHITE_MAX_LEVEL 220
|
||||
#define REFL_WHITE_MIN_LEVEL 210
|
||||
#define REFL_MAX_LEVEL_RANGE 210
|
||||
#define REFL_MIN_LEVEL_RANGE 190
|
||||
|
||||
/*for Transparent*/
|
||||
#define TRAN_DARK_MAX_LEVEL 20
|
||||
#define TRAN_DARK_MIN_LEVEL 10
|
||||
#define TRAN_WHITE_MAX_LEVEL 220
|
||||
#define TRAN_WHITE_MIN_LEVEL 210
|
||||
#define TRAN_MAX_LEVEL_RANGE 210
|
||||
#define TRAN_MIN_LEVEL_RANGE 190
|
||||
|
||||
|
||||
/* in 600 dpi*/
|
||||
#define FIND_LEFT_TOP_WIDTH_IN_DIP 512
|
||||
#define FIND_LEFT_TOP_HEIGHT_IN_DIP 180
|
||||
#define FIND_LEFT_TOP_CALIBRATE_RESOLUTION 600
|
||||
|
||||
#define TA_FIND_LEFT_TOP_WIDTH_IN_DIP 2668
|
||||
#define TA_FIND_LEFT_TOP_HEIGHT_IN_DIP 300
|
||||
|
||||
#define TA_MOTOR_BACK_STEP_AFTER_FIND_BOUNDARY 150
|
||||
#define TA_MOTOR_FORWARD_STEP_AFTER_READ_WHITE_DATA 1100
|
||||
|
||||
/*must be 8x*/
|
||||
#define LINE_CALIBRATION__16BITS_HEIGHT 40
|
||||
|
||||
/* the length from block bar to start Calibration position*/
|
||||
#define BEFORE_SCANNING_MOTOR_FORWARD_PIXEL 40
|
||||
|
||||
#define PRE_MOVE_MOTOR_LENGTH_IN_DPI 1450
|
||||
|
||||
/* if the motor is 1/8 step, setup MOTOR_STEP_MULTI as 8
|
||||
if the motor is 1/4 step, setup MOTOR_STEP_MULTI as 4
|
||||
if the motor is full step, setup MOTOR_STEP_MULTI as 1
|
||||
#define MOTOR_EIGHTH_STEP*/
|
||||
#ifdef MOTOR_EIGHTH_STEP
|
||||
#define MOTOR_STEP_MULTI 8
|
||||
#define GPIO_95_Config 0x68
|
||||
#else
|
||||
#define MOTOR_STEP_MULTI 4
|
||||
|
||||
#define GPIO_95_Config 0x60
|
||||
#endif
|
||||
|
||||
#define TRAN_START_POS 4550
|
||||
|
||||
/* in 300dpi*/
|
||||
#define MAX_SCANNING_WIDTH 2550 /*just for A4 */
|
||||
#define MAX_SCANNING_HEIGHT 3540 /*just for A4 */
|
||||
|
||||
#define INIFILENAME "./msam.ini"
|
||||
|
||||
/*enable gamma*/
|
||||
#define ENABLE_GAMMA
|
||||
|
||||
/*save debug image*/
|
||||
/*#define DEBUG_SAVE_IMAGE*/
|
||||
|
||||
/*type define*/
|
||||
typedef unsigned char SCANTYPE;
|
||||
#define ST_Reflective 0x00
|
||||
#define ST_Transparent 0x01
|
||||
|
||||
typedef enum tagCOLORMODE
|
||||
{
|
||||
CM_RGB48 = 0,
|
||||
CM_RGB42 = 1,
|
||||
CM_RGB36 = 2,
|
||||
CM_RGB30 = 3,
|
||||
CM_RGB24 = 4,
|
||||
CM_GRAY16 = 5,
|
||||
CM_GRAY14 = 6,
|
||||
CM_GRAY12 = 7,
|
||||
CM_GRAY10 = 8,
|
||||
CM_GRAY8 = 9,
|
||||
CM_TEXT = 10,
|
||||
CM_RGB48ext = 11,
|
||||
CM_RGB42ext = 12,
|
||||
CM_RGB36ext = 13,
|
||||
CM_RGB30ext = 14,
|
||||
CM_RGB24ext = 15,
|
||||
CM_GRAY16ext = 16,
|
||||
CM_GRAY14ext = 17,
|
||||
CM_GRAY12ext = 18,
|
||||
CM_GRAY10ext = 19,
|
||||
CM_GRAY8ext = 20,
|
||||
CM_TEXText = 21
|
||||
} COLORMODE, *PCOLORMODE;
|
||||
|
||||
typedef struct tagTARGETIMAGE
|
||||
{
|
||||
SANE_Bool isOptimalSpeed;
|
||||
COLORMODE cmColorMode;
|
||||
unsigned short wDpi;
|
||||
unsigned short wX;
|
||||
unsigned short wY;
|
||||
unsigned short wWidth;
|
||||
unsigned short wHeight;
|
||||
SANE_Byte bScanSource;
|
||||
} TARGETIMAGE, *PTARGETIMAGE;
|
||||
|
||||
typedef struct tagSUGGESTSETTING
|
||||
{
|
||||
COLORMODE cmScanMode;
|
||||
unsigned short wXDpi;
|
||||
unsigned short wYDpi;
|
||||
unsigned short wX;
|
||||
unsigned short wY;
|
||||
unsigned short wWidth;
|
||||
unsigned short wHeight;
|
||||
unsigned short wLineartThreshold;
|
||||
} TARGETIMAGE;
|
||||
unsigned int dwBytesPerRow;
|
||||
} SUGGESTSETTING, *PSUGGESTSETTING;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int nSecLength, nDarkSecLength;
|
||||
int nSecNum, nDarkSecNum;
|
||||
int nPowerNum;
|
||||
unsigned short wStartPosition;
|
||||
} CALIBRATIONPARAM;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const ASIC_ModelParams * asic_params;
|
||||
|
||||
unsigned int calibrationStartPos;
|
||||
unsigned int calibrationTaStartPos;
|
||||
} Scanner_ModelParams;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SANE_Bool bOpened;
|
||||
SANE_Bool bPrepared;
|
||||
SANE_Bool isCanceled;
|
||||
SANE_Bool bFirstReadImage;
|
||||
|
||||
const Scanner_ModelParams * params;
|
||||
|
||||
SANE_Byte * pReadImageHead;
|
||||
unsigned short * pGammaTable;
|
||||
ASIC chip;
|
||||
|
||||
TARGETIMAGE Target;
|
||||
unsigned int BytesPerRow;
|
||||
unsigned int SWBytesPerRow;
|
||||
unsigned short SWWidth;
|
||||
unsigned short SWHeight;
|
||||
|
||||
unsigned int wtheReadyLines;
|
||||
unsigned int wMaxScanLines;
|
||||
unsigned int dwScannedTotalLines;
|
||||
unsigned int dwTotalTotalXferLines;
|
||||
|
||||
pthread_t threadid_readimage;
|
||||
pthread_mutex_t scannedLinesMutex;
|
||||
pthread_mutex_t readyLinesMutex;
|
||||
|
||||
/* even & odd sensor problem */
|
||||
unsigned short wPixelDistance;
|
||||
unsigned short wLineDistance;
|
||||
unsigned short wScanLinesPerBlock;
|
||||
|
||||
/* for modifying the last point */
|
||||
SANE_Bool bIsFirstReadBefData;
|
||||
SANE_Byte * pBefLineImageData;
|
||||
unsigned int dwAlreadyGetLines;
|
||||
} Scanner_State;
|
||||
|
||||
|
||||
#define _MAX(a,b) ((a)>(b)?(a):(b))
|
||||
#define _MIN(a,b) ((a)<(b)?(a):(b))
|
||||
|
||||
/* used for adjusting the AD offset */
|
||||
#define WHITE_MAX_LEVEL 220
|
||||
#define WHITE_MIN_LEVEL 210
|
||||
#define MAX_LEVEL_RANGE 210
|
||||
#define MIN_LEVEL_RANGE 190
|
||||
|
||||
/* 600 dpi */
|
||||
#define FIND_LEFT_TOP_WIDTH_IN_DIP 512
|
||||
#define FIND_LEFT_TOP_HEIGHT_IN_DIP 180
|
||||
#define FIND_LEFT_TOP_CALIBRATE_RESOLUTION 600
|
||||
|
||||
#define TA_FIND_LEFT_TOP_WIDTH_IN_DIP 2668
|
||||
#define TA_FIND_LEFT_TOP_HEIGHT_IN_DIP 300
|
||||
|
||||
#define LINE_CALIBRATION_HEIGHT 40
|
||||
|
||||
#define IMAGE_BUFFER_SIZE (24 * 1024 * 1024)
|
||||
#define BLOCK_SIZE (64 * 1024)
|
||||
#define CALIBRATION_BLOCK_SIZE (64 * 1024)
|
||||
|
||||
/*#define DEBUG_SAVE_IMAGE*/
|
||||
|
||||
|
||||
extern const Scanner_ModelParams paramsMustekBP2448TAPro;
|
||||
extern const Scanner_ModelParams paramsMicrotek4800H48U;
|
||||
|
||||
void Scanner_Init (Scanner_State * st, const Scanner_ModelParams * params);
|
||||
SANE_Status Scanner_PowerControl (Scanner_State * st, SANE_Bool isLampOn,
|
||||
SANE_Bool isTALampOn);
|
||||
SANE_Status Scanner_BackHome (Scanner_State * st);
|
||||
SANE_Status Scanner_IsTAConnected (Scanner_State * st, SANE_Bool * pHasTA);
|
||||
SANE_Status Scanner_GetKeyStatus (Scanner_State * st, SANE_Byte * pKey);
|
||||
SANE_Status Scanner_GetRows (Scanner_State * st, SANE_Byte * pBlock,
|
||||
unsigned short * pNumRows,
|
||||
SANE_Bool isOrderInvert);
|
||||
SANE_Status Scanner_StopScan (Scanner_State * st);
|
||||
SANE_Status Scanner_Reset (Scanner_State * st);
|
||||
SANE_Status Scanner_SetupScan (Scanner_State * st, TARGETIMAGE * pTarget);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
Plik diff jest za duży
Load Diff
Plik diff jest za duży
Load Diff
Ładowanie…
Reference in New Issue