kopia lustrzana https://gitlab.com/sane-project/backends
Remove unused definitions from mustek_usb2_high.h and ensure that the remaining ones are used consistently.
rodzic
d1851a6512
commit
2404326dde
|
|
@ -140,7 +140,7 @@ static Scanner_Model mustek_A2nu2_model = {
|
|||
SANE_FIX (1.46 * MM_PER_INCH), /* Size of scan area in TA mode in mm (x) */
|
||||
SANE_FIX (6.45 * MM_PER_INCH), /* Size of scan area in TA mode in mm (y) */
|
||||
|
||||
0, /* Order of the CCD/CIS colors 0:RO_RGB 1:RO_BGR */
|
||||
RO_RGB, /* Order of the CCD/CIS colors */
|
||||
SANE_FIX (2.0), /* Default gamma value */
|
||||
|
||||
SANE_FALSE, /* Is this a CIS scanner? */
|
||||
|
|
@ -155,14 +155,13 @@ static SANE_Bool StartScan (void);
|
|||
static SANE_Bool ReadScannedData (LPIMAGEROWS pImageRows);
|
||||
static SANE_Bool StopScan (void);
|
||||
static SANE_Bool IsTAConnected (void);
|
||||
static void AutoLevel (SANE_Byte *lpSource, SCANMODE scanMode, unsigned short ScanLines,
|
||||
static void AutoLevel (SANE_Byte *lpSource, COLORMODE colorMode, unsigned short ScanLines,
|
||||
unsigned int BytesPerLine);
|
||||
static size_t max_string_size (const SANE_String_Const strings[]);
|
||||
static SANE_Status calc_parameters (Mustek_Scanner * s);
|
||||
#ifdef SANE_UNUSED
|
||||
static SANE_Bool GetGammaInfo (LPGAMMAINFO pGamaInfo);
|
||||
static SANE_Bool GetKeyStatus (SANE_Byte * pKey);
|
||||
static void QBetChange (SANE_Byte *lpSource, SCANMODE scanMode, unsigned short ScanLines,
|
||||
static void QBetChange (SANE_Byte *lpSource, COLORMODE colorMode, unsigned short ScanLines,
|
||||
unsigned int BytesPerLine);
|
||||
static void QBETDetectAutoLevel (void *pDIB, unsigned int ImageWidth, unsigned int ImageHeight);
|
||||
#endif
|
||||
|
|
@ -197,43 +196,43 @@ calc_parameters (Mustek_Scanner * s)
|
|||
{
|
||||
s->params.format = SANE_FRAME_RGB;
|
||||
s->params.depth = 16;
|
||||
s->setpara.smScanMode = SM_RGB48;
|
||||
s->setpara.cmColorMode = CM_RGB48;
|
||||
if (s->val[OPT_PREVIEW].w)
|
||||
{
|
||||
DBG (DBG_DET, "calc_parameters : preview set ScanMode SM_RGB24\n");
|
||||
DBG (DBG_DET, "calc_parameters : preview set ColorMode CM_RGB24\n");
|
||||
s->params.depth = 8;
|
||||
s->setpara.smScanMode = SM_RGB24;
|
||||
s->setpara.cmColorMode = CM_RGB24;
|
||||
}
|
||||
}
|
||||
else if (strcmp (val, "Color24") == 0)
|
||||
{
|
||||
s->params.format = SANE_FRAME_RGB;
|
||||
s->params.depth = 8;
|
||||
s->setpara.smScanMode = SM_RGB24;
|
||||
s->setpara.cmColorMode = CM_RGB24;
|
||||
}
|
||||
else if (strcmp (val, "Gray16") == 0)
|
||||
{
|
||||
s->params.format = SANE_FRAME_GRAY;
|
||||
s->params.depth = 16;
|
||||
s->setpara.smScanMode = SM_GRAY16;
|
||||
s->setpara.cmColorMode = CM_GRAY16;
|
||||
if (s->val[OPT_PREVIEW].w)
|
||||
{
|
||||
s->params.depth = 8;
|
||||
DBG (DBG_DET, "calc_parameters : preview set ScanMode SM_GRAY\n");
|
||||
s->setpara.smScanMode = SM_GRAY;
|
||||
DBG (DBG_DET, "calc_parameters : preview set ColorMode CM_GRAY8\n");
|
||||
s->setpara.cmColorMode = CM_GRAY8;
|
||||
}
|
||||
}
|
||||
else if (strcmp (val, "Gray8") == 0)
|
||||
{
|
||||
s->params.format = SANE_FRAME_GRAY;
|
||||
s->params.depth = 8;
|
||||
s->setpara.smScanMode = SM_GRAY;
|
||||
s->setpara.cmColorMode = CM_GRAY8;
|
||||
}
|
||||
else if (strcmp (val, SANE_VALUE_SCAN_MODE_LINEART) == 0)
|
||||
{
|
||||
s->params.format = SANE_FRAME_GRAY;
|
||||
s->params.depth = 1;
|
||||
s->setpara.smScanMode = SM_TEXT;
|
||||
s->setpara.cmColorMode = CM_TEXT;
|
||||
}
|
||||
|
||||
/*set Scan Source */
|
||||
|
|
@ -520,47 +519,6 @@ static SANE_Bool g_bIsFirstGetNegData = TRUE;
|
|||
static SANE_Bool g_bIsMallocNegData = FALSE;
|
||||
static unsigned int g_dwAlreadyGetNegLines = 0;
|
||||
|
||||
#ifdef SANE_UNUSED
|
||||
/**********************************************************************
|
||||
Get gamma input/output bit count
|
||||
Parameters:
|
||||
pGammaInfo: the gamma information
|
||||
Return value:
|
||||
TRUE if the operation success, FALSE otherwise
|
||||
***********************************************************************/
|
||||
static SANE_Bool
|
||||
GetGammaInfo (LPGAMMAINFO pGammaInfo)
|
||||
{
|
||||
DBG (DBG_FUNC, "GetGammaInfo: start\n");
|
||||
|
||||
switch (pGammaInfo->smScanMode)
|
||||
{
|
||||
case SM_GRAY:
|
||||
pGammaInfo->wInputGammaBits = 12;
|
||||
pGammaInfo->wOutputGammaBits = 8;
|
||||
break;
|
||||
case SM_RGB24:
|
||||
pGammaInfo->wInputGammaBits = 12;
|
||||
pGammaInfo->wOutputGammaBits = 8;
|
||||
break;
|
||||
case SM_GRAY16:
|
||||
pGammaInfo->wInputGammaBits = 16;
|
||||
pGammaInfo->wOutputGammaBits = 16;
|
||||
break;
|
||||
case SM_RGB48:
|
||||
pGammaInfo->wInputGammaBits = 16;
|
||||
pGammaInfo->wOutputGammaBits = 16;
|
||||
break;
|
||||
default:
|
||||
pGammaInfo->wInputGammaBits = 0;
|
||||
pGammaInfo->wOutputGammaBits = 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
DBG (DBG_FUNC, "GetGammaInfo: exit\n");
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
/**********************************************************************
|
||||
set scan parameters
|
||||
Parameters:
|
||||
|
|
@ -589,30 +547,11 @@ SetParameters (LPSETPARAMETERS pSetParameters)
|
|||
}
|
||||
|
||||
/*1. Scan mode */
|
||||
switch (pSetParameters->smScanMode)
|
||||
{
|
||||
case SM_TEXT:
|
||||
g_tiTarget.cmColorMode = CM_TEXT;
|
||||
break;
|
||||
case SM_GRAY:
|
||||
g_tiTarget.cmColorMode = CM_GRAY8;
|
||||
break;
|
||||
case SM_GRAY16:
|
||||
g_tiTarget.cmColorMode = CM_GRAY16;
|
||||
break;
|
||||
case SM_RGB24:
|
||||
g_tiTarget.cmColorMode = CM_RGB24;
|
||||
break;
|
||||
case SM_RGB48:
|
||||
g_tiTarget.cmColorMode = CM_RGB48;
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
g_tiTarget.cmColorMode = pSetParameters->cmColorMode;
|
||||
|
||||
/*2. Scan source */
|
||||
g_ssScanSource = pSetParameters->ssScanSource;
|
||||
g_tiTarget.bScanSource = pSetParameters->ssScanSource;
|
||||
g_tiTarget.ssScanSource = pSetParameters->ssScanSource;
|
||||
|
||||
|
||||
if (SS_Reflective == pSetParameters->ssScanSource)
|
||||
|
|
@ -620,8 +559,7 @@ SetParameters (LPSETPARAMETERS pSetParameters)
|
|||
g_ScanType = ST_Reflective;
|
||||
}
|
||||
else if (SS_Positive == pSetParameters->ssScanSource
|
||||
|| SS_Negative == pSetParameters->ssScanSource
|
||||
|| SS_ADF == pSetParameters->ssScanSource)
|
||||
|| SS_Negative == pSetParameters->ssScanSource)
|
||||
{
|
||||
g_ScanType = ST_Transparent;
|
||||
}
|
||||
|
|
@ -693,7 +631,7 @@ SetParameters (LPSETPARAMETERS pSetParameters)
|
|||
g_tiTarget.wHeight);
|
||||
|
||||
/*5.Prepare */
|
||||
if (FALSE == MustScanner_Prepare (g_tiTarget.bScanSource))
|
||||
if (FALSE == MustScanner_Prepare (g_tiTarget.ssScanSource))
|
||||
{
|
||||
DBG (DBG_ERR, "SetParameters: MustScanner_Prepare fail\n");
|
||||
return FALSE;
|
||||
|
|
@ -701,7 +639,7 @@ SetParameters (LPSETPARAMETERS pSetParameters)
|
|||
|
||||
/*6. Linear threshold */
|
||||
if (pSetParameters->wLinearThreshold > 256
|
||||
&& pSetParameters->smScanMode == SM_TEXT)
|
||||
&& pSetParameters->cmColorMode == CM_TEXT)
|
||||
{
|
||||
DBG (DBG_ERR, "SetParameters: LinearThreshold error\n");
|
||||
return FALSE;
|
||||
|
|
@ -718,8 +656,8 @@ SetParameters (LPSETPARAMETERS pSetParameters)
|
|||
g_pGammaTable = pSetParameters->pGammaTable;
|
||||
g_isSelfGamma = FALSE;
|
||||
}
|
||||
else if (pSetParameters->smScanMode == SM_GRAY
|
||||
|| pSetParameters->smScanMode == SM_RGB24)
|
||||
else if (pSetParameters->cmColorMode == CM_GRAY8
|
||||
|| pSetParameters->cmColorMode == CM_RGB24)
|
||||
{
|
||||
unsigned short i;
|
||||
SANE_Byte byGammaData;
|
||||
|
|
@ -751,8 +689,8 @@ SetParameters (LPSETPARAMETERS pSetParameters)
|
|||
*(g_pGammaTable + i + 8192) = byGammaData;
|
||||
}
|
||||
}
|
||||
else if (pSetParameters->smScanMode == SM_GRAY16
|
||||
|| pSetParameters->smScanMode == SM_RGB48)
|
||||
else if (pSetParameters->cmColorMode == CM_GRAY16
|
||||
|| pSetParameters->cmColorMode == CM_RGB48)
|
||||
{
|
||||
unsigned int i, wGammaData;
|
||||
g_pGammaTable = (unsigned short *) malloc (sizeof (unsigned short) * 65536 * 3);
|
||||
|
|
@ -1140,12 +1078,12 @@ GetKeyStatus (SANE_Byte * pKey)
|
|||
Deal with the image with auto level
|
||||
Parameters:
|
||||
lpSource: the data of image
|
||||
scanMode: the scan mode
|
||||
colorMode: the color mode
|
||||
ScanLines: the rows of image
|
||||
BytesPerLine: the bytes of per line
|
||||
***********************************************************************/
|
||||
static void
|
||||
AutoLevel (SANE_Byte *lpSource, SCANMODE scanMode, unsigned short ScanLines,
|
||||
AutoLevel (SANE_Byte *lpSource, COLORMODE colorMode, unsigned short ScanLines,
|
||||
unsigned int BytesPerLine)
|
||||
{
|
||||
int ii;
|
||||
|
|
@ -1167,7 +1105,7 @@ AutoLevel (SANE_Byte *lpSource, SCANMODE scanMode, unsigned short ScanLines,
|
|||
|
||||
DBG (DBG_FUNC, "AutoLevel: start\n");
|
||||
|
||||
if (scanMode != CM_RGB24ext)
|
||||
if (colorMode != CM_RGB24ext)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -1685,12 +1623,12 @@ QBETDetectAutoLevel (void *pDIB, unsigned int ImageWidth, unsigned int ImageHeig
|
|||
Change the image data and deal with auto level
|
||||
Parameters:
|
||||
lpSource: the data of image
|
||||
scanMode: the scan mode
|
||||
colorMode: the color mode
|
||||
ScanLines: the rows of image
|
||||
BytesPerLine: the bytes of per line
|
||||
***********************************************************************/
|
||||
static void
|
||||
QBetChange (SANE_Byte *lpSource, SCANMODE scanMode, unsigned short ScanLines,
|
||||
QBetChange (SANE_Byte *lpSource, COLORMODE colorMode, unsigned short ScanLines,
|
||||
unsigned int BytesPerLine)
|
||||
{
|
||||
unsigned short i, j;
|
||||
|
|
@ -1704,7 +1642,7 @@ QBetChange (SANE_Byte *lpSource, SCANMODE scanMode, unsigned short ScanLines,
|
|||
unsigned int ImageHeight = ScanLines;
|
||||
SANE_Byte *pbmpdata = (SANE_Byte *) lpSource;
|
||||
|
||||
if (scanMode != CM_RGB24ext)
|
||||
if (colorMode != CM_RGB24ext)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -2283,8 +2221,8 @@ sane_start (SANE_Handle handle)
|
|||
s->setpara.wLinearThreshold);
|
||||
DBG (DBG_INFO, "Sane_start:setpara ,setpara.wTargetDPI=%d\n",
|
||||
s->setpara.wTargetDPI);
|
||||
DBG (DBG_INFO, "Sane_start:setpara ,setpara.smScanMode=%d\n",
|
||||
s->setpara.smScanMode);
|
||||
DBG (DBG_INFO, "Sane_start:setpara ,setpara.cmColorMode=%d\n",
|
||||
s->setpara.cmColorMode);
|
||||
DBG (DBG_INFO, "Sane_start:setpara ,setpara.ssScanSource =%d\n",
|
||||
s->setpara.ssScanSource);
|
||||
DBG (DBG_INFO, "Sane_start:setpara ,setpara.pGammaTable =%p\n",
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ static SANE_Bool MustScanner_Init (void);
|
|||
static SANE_Bool MustScanner_GetScannerState (void);
|
||||
static SANE_Bool MustScanner_PowerControl (SANE_Bool isLampOn, SANE_Bool isTALampOn);
|
||||
static SANE_Bool MustScanner_BackHome (void);
|
||||
static SANE_Bool MustScanner_Prepare (SANE_Byte bScanSource);
|
||||
static SANE_Bool MustScanner_Prepare (SCANSOURCE ssScanSource);
|
||||
#ifdef SANE_UNUSED
|
||||
static SANE_Bool MustScanner_AdjustOffset (int nTimes, SANE_Bool * bDirection, SANE_Byte * bOffset,
|
||||
SANE_Byte * bLastMin, SANE_Byte * bLastOffset,
|
||||
|
|
@ -342,12 +342,12 @@ MustScanner_BackHome ()
|
|||
/**********************************************************************
|
||||
prepare the scan image
|
||||
Parameters:
|
||||
bScanSource: the scan source
|
||||
ssScanSource: the scan source
|
||||
Return value:
|
||||
TRUE if operation is success, FALSE otherwise
|
||||
***********************************************************************/
|
||||
static SANE_Bool
|
||||
MustScanner_Prepare (SANE_Byte bScanSource)
|
||||
MustScanner_Prepare (SCANSOURCE ssScanSource)
|
||||
{
|
||||
DBG (DBG_FUNC, "MustScanner_Prepare: call in\n");
|
||||
|
||||
|
|
@ -365,7 +365,7 @@ MustScanner_Prepare (SANE_Byte bScanSource)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (SS_Reflective == bScanSource)
|
||||
if (SS_Reflective == ssScanSource)
|
||||
{
|
||||
DBG (DBG_FUNC, "MustScanner_Prepare:ScanSource is SS_Reflective\n");
|
||||
if (STATUS_GOOD != Asic_TurnLamp (&g_chip, TRUE))
|
||||
|
|
@ -381,7 +381,7 @@ MustScanner_Prepare (SANE_Byte bScanSource)
|
|||
return FALSE;
|
||||
}
|
||||
}
|
||||
else if (SS_Positive == bScanSource)
|
||||
else if (SS_Positive == ssScanSource)
|
||||
{
|
||||
DBG (DBG_FUNC, "MustScanner_Prepare:ScanSource is SS_Positive\n");
|
||||
if (STATUS_GOOD != Asic_TurnTA (&g_chip, TRUE))
|
||||
|
|
@ -396,7 +396,7 @@ MustScanner_Prepare (SANE_Byte bScanSource)
|
|||
return FALSE;
|
||||
}
|
||||
}
|
||||
else if (SS_Negative == bScanSource)
|
||||
else if (SS_Negative == ssScanSource)
|
||||
{
|
||||
DBG (DBG_FUNC, "MustScanner_Prepare:ScanSource is SS_Negative\n");
|
||||
|
||||
|
|
|
|||
|
|
@ -50,45 +50,40 @@
|
|||
|
||||
/* 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
|
||||
|
||||
/*pixel flavor*/
|
||||
typedef SANE_Byte PIXELFLAVOR, *LPPIXELFLAVOR;
|
||||
typedef SANE_Byte PIXELFLAVOR;
|
||||
#define PF_BlackIs0 0x00
|
||||
#define PF_WhiteIs0 0x01
|
||||
|
||||
/*scan source*/
|
||||
typedef SANE_Byte SCANSOURCE, *LPSCANSOURCE;
|
||||
typedef SANE_Byte SCANSOURCE;
|
||||
#define SS_Reflective 0x00
|
||||
#define SS_Positive 0x01
|
||||
#define SS_Negative 0x02
|
||||
#define SS_ADF 0x03
|
||||
|
||||
/*RGB order*/
|
||||
typedef unsigned short RGBORDER, *LPRGBORDER;
|
||||
typedef unsigned short RGBORDER;
|
||||
#define RO_RGB 0x00
|
||||
#define RO_BGR 0x01
|
||||
|
||||
/* structures use in parameters of export function*/
|
||||
typedef unsigned char SCANTYPE;
|
||||
#define ST_Reflective 0x00
|
||||
#define ST_Transparent 0x01
|
||||
|
||||
typedef struct tagGAMMAINFO
|
||||
typedef enum tagCOLORMODE
|
||||
{
|
||||
SCANMODE smScanMode;
|
||||
unsigned short wInputGammaBits;
|
||||
unsigned short wOutputGammaBits;
|
||||
} GAMMAINFO, *LPGAMMAINFO;
|
||||
CM_RGB48 = 0,
|
||||
CM_RGB24 = 4,
|
||||
CM_GRAY16 = 5,
|
||||
CM_GRAY10 = 8,
|
||||
CM_GRAY8 = 9,
|
||||
CM_TEXT = 10,
|
||||
CM_RGB24ext = 15,
|
||||
CM_GRAY16ext = 16,
|
||||
CM_GRAY8ext = 20
|
||||
} COLORMODE;
|
||||
|
||||
/* structures use in parameters of export function*/
|
||||
|
||||
typedef struct tagGETPARAMETERS
|
||||
{
|
||||
|
|
@ -110,7 +105,7 @@ typedef struct tagSETPARAMETERS
|
|||
{
|
||||
FRAME fmArea;
|
||||
unsigned short wTargetDPI;
|
||||
SCANMODE smScanMode;
|
||||
COLORMODE cmColorMode;
|
||||
unsigned short wLinearThreshold; /*threshold for Line art mode */
|
||||
PIXELFLAVOR pfPixelFlavor;
|
||||
SCANSOURCE ssScanSource;
|
||||
|
|
@ -125,115 +120,6 @@ typedef struct tagIMAGEROWS
|
|||
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;
|
||||
|
|
@ -243,7 +129,7 @@ typedef struct tagTARGETIMAGE
|
|||
unsigned short wY;
|
||||
unsigned short wWidth;
|
||||
unsigned short wHeight;
|
||||
SANE_Byte bScanSource;
|
||||
SCANSOURCE ssScanSource;
|
||||
} TARGETIMAGE, *PTARGETIMAGE;
|
||||
|
||||
typedef struct tagSUGGESTSETTING
|
||||
|
|
@ -259,5 +145,55 @@ typedef struct tagSUGGESTSETTING
|
|||
} SUGGESTSETTING, *PSUGGESTSETTING;
|
||||
|
||||
|
||||
/*Macro define*/
|
||||
|
||||
#define R_GAIN 0
|
||||
#define G_GAIN 0
|
||||
#define B_GAIN 0
|
||||
#define R_DIRECTION 0
|
||||
#define G_DIRECTION 0
|
||||
#define B_DIRECTION 0
|
||||
|
||||
/* use for adjust AD's offset*/
|
||||
|
||||
/* for Reflective*/
|
||||
#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_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
|
||||
|
||||
/*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 TRAN_START_POS 4550
|
||||
|
||||
/* in 300dpi*/
|
||||
#define MAX_SCANNING_WIDTH 2550 /*just for A4 */
|
||||
#define MAX_SCANNING_HEIGHT 3540 /*just for A4 */
|
||||
|
||||
/*enable gamma*/
|
||||
#define ENABLE_GAMMA
|
||||
|
||||
/*save debug image*/
|
||||
/*#define DEBUG_SAVE_IMAGE*/
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue