Major update. Better support for LM983x based devices.

DEVEL_2_0_BRANCH-1
Gerhard Jaeger 2002-08-16 11:43:30 +00:00
rodzic 101a96218f
commit 28edd2af4d
15 zmienionych plików z 1266 dodań i 763 usunięć

Plik diff jest za duży Load Diff

Wyświetl plik

@ -16,6 +16,7 @@
* 0.41 - added _PTDRV_ADJUST call
* 0.42 - added setmap function
* fixed the stopscan problem, that causes a crash in the kernel module
* 0.43 - no changes
*
*.............................................................................
*

Wyświetl plik

@ -22,6 +22,7 @@
* 0.42 - added FLAG_CUSTOM_GAMMA and _MAP_ definitions
* changed IOCTL interface to allow downloadable MAPS
* added error codes
* 0.43 - added tpa entry for AdjDef
*
*.............................................................................
*
@ -234,6 +235,7 @@ typedef struct {
int lampOff;
int lampOffOnEnd;
int warmup;
int enableTpa;
OffsDef pos; /* for adjusting normal scan area */
OffsDef tpa; /* for adjusting transparency scan area */

Wyświetl plik

@ -15,6 +15,7 @@
* added setmap function
* changed detection stuff, so we first check whether
* the vendor and product Ids match with the ones in our list
* 0.43 - cleanup
*
*.............................................................................
*
@ -133,6 +134,13 @@ static void usb_initDev( pPlustek_Device dev, int idx, int handle, int vendor )
}
}
if( vendor == 0x04B8 ) {
if( dev->adj.enableTpa ) {
DBG( _DBG_INFO, "Enabled TPA for EPSON\n" );
dev->usbDev.Caps.wFlags |= DEVCAPSFLAG_TPA;
}
}
dev->usbDev.currentLamp = usb_GetLampStatus( dev );
usb_ResetRegisters( dev );
@ -373,13 +381,14 @@ static int usbDev_open( const char *dev_name, void *misc )
return -1;
}
#if 0
#if 1
dev->fd = handle;
usbio_ResetLM983x( dev );
usbio_ResetLM983x ( dev );
usb_IsScannerReady( dev );
dev->fd = -1;
#endif
#else
sanei_lm983x_reset( handle );
#endif
/*
* Plustek uses the misc IO 1/2 to get the PCB ID
@ -469,8 +478,8 @@ static int usbDev_getCaps( Plustek_Device *dev )
return 0;
}
/*.............................................................................
*
/** usbDev_getLensInfo
* set the info for the scan-area.
*/
static int usbDev_getLensInfo( Plustek_Device *dev, pLensInfo lens )
{
@ -499,30 +508,15 @@ static int usbDev_getLensInfo( Plustek_Device *dev, pLensInfo lens )
lens->rDpiY.wMax = (dev->usbDev.Caps.OpticDpi.x *16);
lens->rDpiY.wPhyMax = (dev->usbDev.Caps.OpticDpi.x * 2);
return 0;
}
lens->rDpiY.wMin = dev->usbDev.Caps.Normal.MinDpi.y;
/*
* HEINER: workaround - remove it!!!!
*/
static ImgDef xxx;
/*.............................................................................
* HEINER: No function, should be removed from backend and driver as well
*/
static int usbDev_putImgInfo( Plustek_Device *dev, pImgDef img )
{
DBG( _DBG_INFO, "usbDev_putImgInfo()\n" );
_VAR_NOT_USED(dev);
memcpy( &xxx, img, sizeof(ImgDef));
DBG( _DBG_INFO, "wMAX=%u, WPHYMAX=%u\n", lens->rDpiY.wMax, lens->rDpiY.wPhyMax );
return 0;
}
/*.............................................................................
*
/** usbDev_getCropInfo
* function to set the image relevant stuff
*/
static int usbDev_getCropInfo( Plustek_Device *dev, pCropInfo ci )
{
@ -532,8 +526,6 @@ static int usbDev_getCropInfo( Plustek_Device *dev, pCropInfo ci )
_VAR_NOT_USED(dev);
memcpy( &ci->ImgDef, &xxx, sizeof(ImgDef));
usb_GetImageInfo( &ci->ImgDef, &size );
ci->dwPixelsPerLine = size.dwPixels;
@ -628,6 +620,13 @@ static int usbDev_setScanEnv( Plustek_Device *dev, pScanInfo si )
SCANFLAG_DWORDBoundary | SCANFLAG_RightAlign |
SCANFLAG_StillModule | SCANDEF_Adf | SCANDEF_ContinuousScan);
if( !(SCANDEF_QualityScan & si->ImgDef.dwFlag)) {
DBG( _DBG_INFO, "Preview Mode set!\n" );
} else {
DBG( _DBG_INFO, "Preview Mode NOT set!\n" );
dev->scanning.dwFlag |= SCANDEF_QualityScan;
}
dev->scanning.sParam.siThreshold = si->siBrightness;
dev->scanning.sParam.brightness = si->siBrightness;
dev->scanning.sParam.contrast = si->siContrast;
@ -736,18 +735,28 @@ static int usbDev_startScan( Plustek_Device *dev, pStartScan start )
DBG( _DBG_INFO, "usbDev_startScan()\n" );
/* HEINER: PReview currently not working correctly */
#if 0
if( scanning->dwFlag & SCANDEF_QualityScan )
a_bRegs[0x0a] = 0;
else
a_bRegs[0x0a] = 1;
#endif
a_bRegs[0x0a] = 0;
/* Allocate shading buffer */
if((dev->scanning.dwFlag & SCANDEF_Adf) &&
(dev->scanning.dwFlag & SCANDEF_ContinuousScan)) {
dev->scanning.fCalibrated = SANE_TRUE;
} else {
dev->scanning.fCalibrated = SANE_FALSE;
iSkipLinesForADF = 0;
}
scanning->sParam.PhyDpi.x = usb_SetAsicDpiX( dev, scanning->sParam.UserDpi.x );
scanning->sParam.PhyDpi.x = usb_SetAsicDpiX(dev,scanning->sParam.UserDpi.x);
scanning->sParam.PhyDpi.y = usb_SetAsicDpiY(dev,scanning->sParam.UserDpi.y);
scanning->pScanBuffer = (u_char*)malloc( dev->usbDev.dwBufferSize );
if( NULL != scanning->pScanBuffer ) {
@ -774,11 +783,9 @@ static int usbDev_readImage( struct Plustek_Device *dev,
SANE_Byte *buf, unsigned long data_length )
{
int result, lines;
u_long dw;
struct timeval t;
u_long dw;
pScanDef scanning = &dev->scanning;
pDCapsDef scaps = &dev->usbDev.Caps;
pHWDef hw = &dev->usbDev.HwSetting;
DBG( _DBG_INFO, "usbDev_readImage()\n" );
@ -787,23 +794,6 @@ static int usbDev_readImage( struct Plustek_Device *dev,
*/
usb_ModuleStatus( dev );
/*
* wait until warmup period has been elapsed
*/
DBG(_DBG_INFO,"Warmup: Waiting %lu seconds\n",dev->usbDev.dwWarmup );
do {
gettimeofday( &t, NULL);
dw = t.tv_sec - dev->usbDev.dwTicksLampOn;
if( usb_IsEscPressed()) {
DBG( _DBG_INFO, "ReadImage() - Cancel detected...\n" );
return 0;
}
} while( dw < dev->usbDev.dwWarmup );
result = usb_DoCalibration( dev );
if( SANE_TRUE != result ) {
DBG( _DBG_INFO, "calibration failed!!!\n" );
@ -811,7 +801,6 @@ static int usbDev_readImage( struct Plustek_Device *dev,
}
DBG( _DBG_INFO, "calibration done.\n" );
if( !( scanning->dwFlag & SCANFLAG_Scanning )) {
usleep( 10 * 1000 );
@ -893,23 +882,13 @@ static int usbDev_readImage( struct Plustek_Device *dev,
break;
case SENSORORDER_bgr:
if( hw->ScannerModel == MODEL_Tokyo600 ) {
scanning->Red.pb = scanning->pbScanBufBegin;
scanning->Green.pb = scanning->pbScanBufBegin +
scanning->dwLinesDiscard *
scanning->sParam.Size.dwPhyBytes;
scanning->Blue.pb = scanning->pbScanBufBegin +
scanning->dwLinesDiscard *
scanning->Blue.pb = scanning->pbScanBufBegin;
scanning->Green.pb = scanning->pbScanBufBegin +
scanning->dwLinesDiscard *
scanning->sParam.Size.dwPhyBytes;
scanning->Red.pb = scanning->pbScanBufBegin +
scanning->dwLinesDiscard *
scanning->sParam.Size.dwPhyBytes * 2UL;
} else {
scanning->Blue.pb = scanning->pbScanBufBegin;
scanning->Green.pb = scanning->pbScanBufBegin +
scanning->dwLinesDiscard *
scanning->sParam.Size.dwPhyBytes;
scanning->Red.pb = scanning->pbScanBufBegin +
scanning->dwLinesDiscard *
scanning->sParam.Size.dwPhyBytes * 2UL;
}
}
/* double it for last channel */
@ -950,8 +929,8 @@ static int usbDev_readImage( struct Plustek_Device *dev,
return _E_INTERNAL;
}
scanning->dwFlag |= SCANFLAG_Scanning;
scanning->dwFlag |= SCANFLAG_Scanning;
if( scanning->sParam.UserDpi.y != scanning->sParam.PhyDpi.y ) {
@ -1007,7 +986,7 @@ static int usbDev_readImage( struct Plustek_Device *dev,
DBG(_DBG_INFO,"dwBytesLine = %lu\n",scanning->dwBytesLine );
scanning->pbGetDataBuf = scanning->pbScanBufBegin;
lines = usb_ReadData( dev );
if( 0 == lines )
return _E_DATAREAD;

Wyświetl plik

@ -14,6 +14,8 @@
* 0.42 - added MODEL_NOPLUSTEK
* replaced fLM9831 by chip (valid entries: _LM9831, _LM9832, _LM9833)
* added _WAF_MISC_IO3_LAMP for UMAX 3400
* 0.43 - added _WAF_MISC_IOx_LAMP (x=1,2,4,5)
* added CLKDef
*
*.............................................................................
*
@ -126,15 +128,6 @@ typedef enum _CHIPSET
_LM9833
} eChipDef;
typedef enum
{
MODEL_KaoHsiung,
MODEL_HuaLien,
MODEL_Tokyo600,
MODEL_NOPLUSTEK
} eModelDef;
/* ScanParam.bCalibration */
enum _SHADINGID
{
@ -178,10 +171,41 @@ enum _WORKAROUNDS
{
_WAF_NONE = 0x00000000, /* no fix anywhere needed */
_WAF_BSHIFT7_BUG = 0x00000001, /* to fix U12 bug in 14bit mode */
_WAF_MISC_IO6_LAMP = 0x00000002, /* to make EPSON1250 lamp work */
_WAF_MISC_IO3_LAMP = 0x00000004 /* to make Umax 3400 lamp work */
_WAF_MISC_IO_LAMPS = 0x00000002, /* special lamp switching */
_WAF_BLACKFINE = 0x00000004 /* use black calibration strip */
};
enum _LAMPS
{
_NO_MIO = 0,
_MIO1 = 0x0001,
_MIO2 = 0x0002,
_MIO3 = 0x0004,
_MIO4 = 0x0008,
_MIO5 = 0x0010,
_MIO6 = 0x0020
};
#define _TPA(flag) ((u_long)(flag << 16))
#define _HAS_TPA(flag) (flag & 0xFFFF0000)
#define _GET_TPALAMP(flag) (flag >> 16)
/* motor types */
typedef enum
{
MODEL_KaoHsiung = 0,
MODEL_HuaLien,
MODEL_Tokyo600,
MODEL_NOPLUSTEK_600, /* for 600 dpi models */
MODEL_NOPLUSTEK_1200, /* for 1200 dpi models */
MODEL_MUSTEK600, /* for BearPaw 1200 */
MODEL_MUSTEK1200, /* for BearPaw 2400 */
MODEL_HP, /* for HP2x00 */
MODEL_LAST
} eModelDef;
#define _IS_PLUSTEKMOTOR(x) (x<=MODEL_Tokyo600)
/* Generic usage */
enum _CHANNEL
{
@ -255,6 +279,7 @@ typedef struct DevCaps
u_char bPCB; /* PCB ID */
u_long workaroundFlag; /* Flag to allow special work arounds, see */
/* _WORKAROUNDS */
u_long lamp; /* for lamp: loword: normal, hiword: tpa */
} DCapsDef, *pDCapsDef;
@ -331,8 +356,8 @@ typedef struct HWDefault
u_char bReg_0x5d;
u_char bReg_0x5e;
eChipDef chip; /* chiptype */
eModelDef ScannerModel; /* to identify Model */
eChipDef chip; /* chiptype */
eModelDef motorModel; /* to identify used motor */
} HWDef, *pHWDef;
@ -354,11 +379,7 @@ typedef struct DeviceDef
u_long dwTicksLampOn; /* The ticks when lamp turns on */
u_long dwLampOnPeriod; /* How many seconds to keep lamp on */
SANE_Bool bLampOffOnEnd; /* switch lamp off on end or keep cur. state*/
/* HEINER: REMOVE */
int currentLamp; /* The lamp ID */
#if 0
u_char bLastColor; /* The last color channel comes from CCD */
#endif
u_char bStepsToReverse; /* reg 0x50, this value is from registry */
u_long dwBufferSize; /* */
@ -434,7 +455,7 @@ typedef struct
struct Plustek_Device;
/*
/**
*
*/
typedef struct ScanDef
@ -490,6 +511,49 @@ typedef struct ScanDef
} ScanDef, *pScanDef;
#define _MAX_CLK 10
/**
*
*/
typedef struct
{
u_char pwm;
u_char pwm_duty;
} MDef, *pMDef;
/**
* array used to get motor-settings and mclk-settings
*/
static int dpi_ranges[] = { 75,100,150,200,300,400,600,800,1200,2400 };
/**
*
*/
typedef struct {
eModelDef motorModel;
u_char pwm_fast;
u_char pwm_duty_fast;
u_char mclk_fast;
/*
* here we define some ranges for better supporting
* non-Plustek devices with it's different hardware
* we can set the MCLK and the motor PWM stuff for color
* and gray modes
* 0 1 2 3 4 5 6 7 8 9
* <= 75 <=100 <=150 <=200 <=300 <=400 <=600 <= 800 <=1200 <=2400DPI
*/
MDef motor_sets[_MAX_CLK];
double color_mclk[_MAX_CLK];
double gray_mclk[_MAX_CLK];
} ClkMotorDef, *pClkMotorDef;
#endif /* guard __PLUSTEK_USB_H__ */
/* END PLUSTEK-USB.H ........................................................*/

Wyświetl plik

@ -14,6 +14,7 @@
* 0.42 - added warmup stuff
* added UMAX 3400 stuff
* fixed problem with minimum wait time...
* 0.43 - added usb_switchLamp for non-Plustek devices
*
*.............................................................................
*
@ -71,8 +72,28 @@ static SANE_Bool fModuleFirstHome; /* HEINER: this has to be initialized */
static SANE_Bool fLastScanIsAdf;
static u_char a_bRegs[0x80];
/*.............................................................................
*
/** usb_GetMotorSet
* according to the model, the function returns the address of
* the corresponding entry of the Motor table
*/
static pClkMotorDef usb_GetMotorSet( eModelDef model )
{
int i;
for( i = 0; i < MODEL_LAST; i++ ) {
if( model == Motors[i].motorModel ) {
return &(Motors[i]);
}
}
return NULL;
}
/** switch motor on or off
* @param handle - handle to open USB device
* @param fOn - SANE_TRUE means motor on, SANE_FALSE means motor off
* @return always SANE_TRUE
*/
static SANE_Bool usb_MotorOn( int handle, SANE_Bool fOn )
{
@ -168,11 +189,12 @@ static SANE_Bool usb_SensorPaper( int handle )
static SANE_Bool usb_ModuleMove( pPlustek_Device dev,
u_char bAction, u_long dwStep )
{
SANE_Status res;
u_char bReg2, reg7;
u_short wFastFeedStepSize;
double dMaxMoveSpeed;
pHWDef hw = &dev->usbDev.HwSetting;
SANE_Status res;
u_char bReg2, reg7, mclk_div;
u_short wFastFeedStepSize;
double dMaxMoveSpeed;
pClkMotorDef clk;
pHWDef hw = &dev->usbDev.HwSetting;
/* Check if LM9831 is ready for setting command */
if( bAction != MOVE_ToPaperSensor &&
@ -235,8 +257,13 @@ static SANE_Bool usb_ModuleMove( pPlustek_Device dev,
dMaxMoveSpeed = hw->dMaxMoveSpeed;
}
clk = usb_GetMotorSet( hw->motorModel );
mclk_div = clk->mclk_fast;
wFastFeedStepSize = (u_short)(dwCrystalFrequency /
(6UL * 8UL * 1 * dMaxMoveSpeed * 4 * hw->wMotorDpi));
((u_long)mclk_div * 8UL * 1 *
dMaxMoveSpeed * 4 * hw->wMotorDpi));
a_bRegs[0x48] = (u_char)(wFastFeedStepSize >> 8);
a_bRegs[0x49] = (u_char)(wFastFeedStepSize & 0xFF);
@ -253,7 +280,7 @@ static SANE_Bool usb_ModuleMove( pPlustek_Device dev,
*/
/* MCLK divider = 6 */
if( !usbio_WriteReg(dev->fd, 0x08, 0x0A))
if( !usbio_WriteReg(dev->fd, 0x08, (mclk_div-1)*2 /*0x0A*/))
return SANE_FALSE;
/* 8 bits/pixel, HDPI divider = 12 */
@ -361,6 +388,7 @@ static SANE_Bool usb_ModuleMove( pPlustek_Device dev,
*/
static SANE_Bool usb_ModuleToHome( pPlustek_Device dev, SANE_Bool fWait )
{
u_char mclk_div;
u_char value;
pDCapsDef scaps = &dev->usbDev.Caps;
pHWDef hw = &dev->usbDev.HwSetting;
@ -381,7 +409,7 @@ static SANE_Bool usb_ModuleToHome( pPlustek_Device dev, SANE_Bool fWait )
if( fModuleFirstHome ) {
fModuleFirstHome = SANE_FALSE;
if( hw->ScannerModel != MODEL_Tokyo600 )
if( hw->motorModel != MODEL_Tokyo600 )
usb_ModuleMove( dev, MOVE_Forward, hw->wMotorDpi / 2);
}
@ -390,7 +418,7 @@ static SANE_Bool usb_ModuleToHome( pPlustek_Device dev, SANE_Bool fWait )
u_short wFastFeedStepSize;
if( hw->ScannerModel == MODEL_Tokyo600 ) {
if( hw->motorModel == MODEL_Tokyo600 ) {
usbio_WriteReg( dev->fd, 0x07, 0 );
} else {
@ -399,58 +427,82 @@ static SANE_Bool usb_ModuleToHome( pPlustek_Device dev, SANE_Bool fWait )
usleep(200*1000);
}
/* Compute fast feed step size, use equation 3 and equation 8 */
wFastFeedStepSize = (u_short)(dwCrystalFrequency / (6UL * 8UL * 1 *
if(!_IS_PLUSTEKMOTOR(hw->motorModel)) {
pClkMotorDef clk;
clk = usb_GetMotorSet( hw->motorModel );
a_bRegs[0x56] = clk->pwm_fast;
a_bRegs[0x57] = clk->pwm_duty_fast;
mclk_div = clk->mclk_fast;
} else {
mclk_div = 6;
if( scaps->OpticDpi.x == 1200 || scaps->bPCB == 2) {
switch( hw->motorModel ) {
case MODEL_KaoHsiung:
case MODEL_HuaLien:
default:
a_bRegs[0x56] = 1;
a_bRegs[0x57] = 63;
break;
}
} else { /* if(Device.Caps.OpticDpi.x == 600) */
switch( hw->motorModel ) {
case MODEL_Tokyo600:
a_bRegs[0x56] = 4;
a_bRegs[0x57] = 4; /* 2; */
break;
case MODEL_HuaLien:
if( dev->caps.dwFlag & SFLAG_ADF ) {
a_bRegs[0x56] = 64; /* 32; */
a_bRegs[0x57] = 4; /* 16; */
} else {
a_bRegs[0x56] = 32;
a_bRegs[0x57] = 16;
}
break;
case MODEL_KaoHsiung:
default:
a_bRegs[0x56] = 64;
a_bRegs[0x57] = 20;
break;
}
}
}
/* Compute fast feed step size, use equation 3 and equation 8
* assumptions: MCLK = 6, Lineratemode (CM=1)
*/
wFastFeedStepSize = (u_short)(dwCrystalFrequency / (mclk_div * 8 * 1 *
hw->dMaxMotorSpeed * 4 * hw->wMotorDpi));
a_bRegs[0x48] = (u_char)(wFastFeedStepSize >> 8);
a_bRegs[0x49] = (u_char)(wFastFeedStepSize & 0xFF);
a_bRegs[0x4a] = 0;
a_bRegs[0x4b] = 0;
if( scaps->OpticDpi.x == 1200 || scaps->bPCB == 2) {
switch( hw->ScannerModel ) {
case MODEL_KaoHsiung:
case MODEL_HuaLien:
default:
a_bRegs[0x56] = 1;
a_bRegs[0x57] = 63;
break;
}
} else { /* if(Device.Caps.OpticDpi.x == 600) */
switch( hw->ScannerModel ) {
case MODEL_Tokyo600:
a_bRegs[0x56] = 4;
a_bRegs[0x57] = 4; /* 2; */
break;
case MODEL_HuaLien:
if( dev->caps.dwFlag & SFLAG_ADF ) {
a_bRegs[0x56] = 64; /* 32; */
a_bRegs[0x57] = 4; /* 16; */
} else {
a_bRegs[0x56] = 32;
a_bRegs[0x57] = 16;
}
break;
case MODEL_KaoHsiung:
default:
a_bRegs[0x56] = 64;
a_bRegs[0x57] = 20;
break;
}
}
a_bRegs[0x45] |= 0x10;
DBG( _DBG_INFO, "MOTOR-Settings: PWM=0x%02x, PWM_DUTY=0x%02x 0x%02x\n",
a_bRegs[0x56], a_bRegs[0x57], a_bRegs[0x45] );
/* The setting for chassis moving is:
* MCLK divider = 6, 8 bits/pixel, HDPI divider = 12,
* no integration time adjustment and 1 channel grayscale
*/
/* MCLK divider = 6 */
if( !usbio_WriteReg(dev->fd, 0x08, 0x0A))
value = (u_char)((mclk_div-1) * 2);
DBG( _DBG_INFO, "MCLK_FFW = %u --> 0x%02x\n", mclk_div, value );
if( !usbio_WriteReg(dev->fd, 0x08, value))
return SANE_FALSE;
/* 8 bits/pixel, HDPI divider = 12 */
@ -473,14 +525,14 @@ static SANE_Bool usb_ModuleToHome( pPlustek_Device dev, SANE_Bool fWait )
usbio_WriteReg(dev->fd, 0x0a, 0);
if( hw->ScannerModel == MODEL_HuaLien && scaps->OpticDpi.x == 600 )
if( hw->motorModel == MODEL_HuaLien && scaps->OpticDpi.x == 600 )
usleep(100 * 1000);
if( !usbio_WriteReg(dev->fd, 0x07, 2))
return SANE_FALSE;
#if 0
if(Device.HwSetting.ScannerModel == MODEL_Tokyo600)
if(Device.HwSetting.motorModel == MODEL_Tokyo600)
{
DWORD dwSpeedUp = GetTickCount () + 250;
@ -537,12 +589,13 @@ static SANE_Bool usb_MotorSelect( pPlustek_Device dev, SANE_Bool fADF )
pDCapsDef sCaps = &dev->usbDev.Caps;
pHWDef hw = &dev->usbDev.HwSetting;
if( hw->ScannerModel == MODEL_NOPLUSTEK )
if(!_IS_PLUSTEKMOTOR(hw->motorModel)) {
return SANE_TRUE;
}
if( fADF ) {
if( sCaps->bCCD == 4 ) {
if( sCaps->bCCD == kNEC3778 ) {
hw->wMotorDpi = 300;
hw->dMaxMotorSpeed = 1.5;
@ -553,7 +606,7 @@ static SANE_Bool usb_MotorSelect( pPlustek_Device dev, SANE_Bool fADF )
} else {
if( sCaps->bCCD == 4 ) {
if( sCaps->bCCD == kNEC3778 ) {
hw->wMotorDpi = 600;
hw->dMaxMotorSpeed = 1.1;
@ -571,7 +624,46 @@ static SANE_Bool usb_MotorSelect( pPlustek_Device dev, SANE_Bool fADF )
return SANE_TRUE;
}
/**
/** according to the flag field, we return the register and
* it's maks to turn on/off the lamp.
* @param flag - field to check
* @param reg - pointer to a var to receive the register value
* @param msk - pointer to a var to receive the mask value
* @return Nothing
*/
static void usb_GetLampRegAndMask( u_long flag, SANE_Byte *reg, SANE_Byte *msk )
{
if( _MIO6 == ( _MIO6 & flag )) {
*reg = 0x5b;
*msk = 0x80;
} else if( _MIO5 == ( _MIO5 & flag )) {
*reg = 0x5b;
*msk = 0x08;
} else if( _MIO4 == ( _MIO4 & flag )) {
*reg = 0x5a;
*msk = 0x80;
} else if( _MIO3 == ( _MIO3 & flag )) {
*reg = 0x5a;
*msk = 0x08;
} else if( _MIO2 == ( _MIO2 & flag )) {
*reg = 0x59;
*msk = 0x80;
} else if( _MIO1 == ( _MIO1 & flag )) {
*reg = 0x59;
*msk = 0x08;
} else {
*reg = 0;
*msk = 0;
}
}
/** usb_Get
* This function returns the current lamp in use.
* For non Plustek devices, it always returns DEV_LampReflection.
* @param dev - pointer to our device structure,
@ -585,6 +677,7 @@ static int usb_GetLampStatus( pPlustek_Device dev )
int iLampStatus = 0;
pHWDef hw = &dev->usbDev.HwSetting;
pDCapsDef sc = &dev->usbDev.Caps;
SANE_Byte reg, msk, val;
if( NULL == hw ) {
@ -592,10 +685,26 @@ static int usb_GetLampStatus( pPlustek_Device dev )
return -1;
}
if((_WAF_MISC_IO6_LAMP == (_WAF_MISC_IO6_LAMP & sc->workaroundFlag)) ||
(_WAF_MISC_IO3_LAMP == (_WAF_MISC_IO3_LAMP & sc->workaroundFlag))) {
/* do we use the misc I/O pins for switchwing the lamp ? */
if( _WAF_MISC_IO_LAMPS & sc->workaroundFlag ) {
iLampStatus |= DEV_LampReflection;
usb_GetLampRegAndMask( sc->lamp, &reg, &msk );
/* check if the lamp is on */
usbio_ReadReg( dev->fd, reg, &val );
DBG( _DBG_INFO, "REG[0x%02x] = 0x%02x (msk=0x%02x)\n", reg, val, msk );
if( val & msk )
iLampStatus |= DEV_LampReflection;
/* if the device supports a TPA, we check this here */
if( sc->wFlags & DEVCAPSFLAG_TPA ) {
usb_GetLampRegAndMask( _GET_TPALAMP(sc->lamp), &reg, &msk );
usbio_ReadReg( dev->fd, reg, &val );
DBG( _DBG_INFO, "REG[0x%02x] = 0x%02x (msk=0x%02x)\n",reg,val,msk);
if( val & msk )
iLampStatus |= DEV_LampTPA;
}
} else {
@ -603,26 +712,64 @@ static int usb_GetLampStatus( pPlustek_Device dev )
if((a_bRegs[0x29] & 3) == 1) {
if((a_bRegs[0x2e] * 256 + a_bRegs[0x2f]) > hw->wLineEnd )
/* HEINER: BETTER define register to check ! */
if(!_IS_PLUSTEKMOTOR(hw->motorModel)) {
iLampStatus |= DEV_LampReflection;
if((a_bRegs[0x36] * 256 + a_bRegs[0x37]) > hw->wLineEnd )
iLampStatus |= DEV_LampTPA;
}
} else {
if((a_bRegs[0x2e] * 256 + a_bRegs[0x2f]) > hw->wLineEnd )
iLampStatus |= DEV_LampReflection;
if((a_bRegs[0x36] * 256 + a_bRegs[0x37]) > hw->wLineEnd )
iLampStatus |= DEV_LampTPA;
}
}
}
DBG( _DBG_INFO, "LAMP-STATUS: 0x%08x\n", iLampStatus );
return iLampStatus;
}
/*.............................................................................
/** usb_switchLamp
* used for all devices that use some misc I/O pins to switch the lamp
*/
static SANE_Bool usb_switchLamp( pPlustek_Device dev, SANE_Bool on )
{
SANE_Byte reg, msk;
pScanDef scanning = &dev->scanning;
pDCapsDef sc = &dev->usbDev.Caps;
if((scanning->sParam.bSource == SOURCE_Negative) ||
(scanning->sParam.bSource == SOURCE_Transparency))
usb_GetLampRegAndMask( _GET_TPALAMP(sc->lamp), &reg, &msk );
else
usb_GetLampRegAndMask( sc->lamp, &reg, &msk );
if( 0 == reg )
return SANE_FALSE; /* no need to switch something */
if( on )
a_bRegs[reg] |= msk;
else
a_bRegs[reg] &= ~msk;
DBG( _DBG_INFO, "Switch Lamp: %u, regs[0x%02x] = 0x%02x\n",
on, reg, a_bRegs[reg] );
usbio_WriteReg( dev->fd, reg, a_bRegs[reg] );
return SANE_TRUE;
}
/** usb_LedOn
*
*/
static void usb_LedOn( pPlustek_Device dev, SANE_Bool fOn )
static void usb_LedOn( pPlustek_Device dev, SANE_Bool fOn )
{
u_char value;
if( dev->usbDev.HwSetting.ScannerModel != MODEL_HuaLien )
if( dev->usbDev.HwSetting.motorModel != MODEL_HuaLien )
return;
value = a_bRegs[0x0d];
@ -639,14 +786,14 @@ static void usb_LedOn( pPlustek_Device dev, SANE_Bool fOn )
}
}
/*.............................................................................
/** usb_LampOn
*
*/
static SANE_Bool usb_LampOn( pPlustek_Device dev,
SANE_Bool fOn, SANE_Bool fResetTimer )
{
pScanDef scanning = &dev->scanning;
pDCapsDef sc = &dev->usbDev.Caps;
pScanDef scanning = &dev->scanning;
pHWDef hw = &dev->usbDev.HwSetting;
int iLampStatus = usb_GetLampStatus( dev );
int lampId = -1;
@ -678,23 +825,9 @@ static SANE_Bool usb_LampOn( pPlustek_Device dev,
memset( &a_bRegs[0x29], 0, (0x37-0x29+1));
/*
* EPSON specific stuff
*/
a_bRegs[0x29] = hw->bReg_0x29;
if(_WAF_MISC_IO6_LAMP==(_WAF_MISC_IO6_LAMP & sc->workaroundFlag)) {
a_bRegs[0x5b] = 0x94;
usbio_WriteReg( dev->fd, 0x5b, a_bRegs[0x5b] );
} else if(_WAF_MISC_IO3_LAMP ==
(_WAF_MISC_IO3_LAMP & sc->workaroundFlag)) {
a_bRegs[0x5a] |= 0x08;
usbio_WriteReg( dev->fd, 0x5a, a_bRegs[0x5a] );
} else {
if( !usb_switchLamp(dev, SANE_TRUE )) {
if( lampId == DEV_LampReflection ) {
a_bRegs[0x2e] = 16383 / 256;
@ -706,8 +839,8 @@ static SANE_Bool usb_LampOn( pPlustek_Device dev,
a_bRegs[0x37] = 16383 % 256;
}
}
if( hw->ScannerModel == MODEL_NOPLUSTEK ) {
if( _WAF_MISC_IO_LAMPS & sc->workaroundFlag ) {
a_bRegs[0x2c] = hw->red_lamp_on / 256;
a_bRegs[0x2d] = hw->red_lamp_on & 0xFF;
@ -727,7 +860,7 @@ static SANE_Bool usb_LampOn( pPlustek_Device dev,
sanei_lm983x_write( dev->fd, 0x29,
&a_bRegs[0x29], 0x37-0x29+1, SANE_TRUE );
if( lampId != dev->usbDev.currentLamp ) {
dev->usbDev.currentLamp = lampId;
@ -751,23 +884,7 @@ static SANE_Bool usb_LampOn( pPlustek_Device dev,
memset( &a_bRegs[0x29], 0, 0x37-0x29+1 );
a_bRegs[0x29] = hw->bReg_0x29;
/*
* EPSON specific stuff
*/
if(_WAF_MISC_IO6_LAMP==(_WAF_MISC_IO6_LAMP & sc->workaroundFlag)) {
a_bRegs[0x5b] = 0x14;
usbio_WriteReg( dev->fd, 0x5b, a_bRegs[0x5b] );
} else if( _WAF_MISC_IO3_LAMP ==
(_WAF_MISC_IO3_LAMP & sc->workaroundFlag)) {
a_bRegs[0x5a] &= ~0x08;
usbio_WriteReg( dev->fd, 0x5a, a_bRegs[0x5a] );
} else {
if( !usb_switchLamp(dev, SANE_FALSE )) {
if( iStatusChange & DEV_LampReflection ) {
a_bRegs[0x2e] = 16383 / 256;
@ -780,7 +897,7 @@ static SANE_Bool usb_LampOn( pPlustek_Device dev,
}
}
if( hw->ScannerModel == MODEL_NOPLUSTEK ) {
if( _WAF_MISC_IO_LAMPS & sc->workaroundFlag ) {
a_bRegs[0x2c] = hw->red_lamp_on / 256;
a_bRegs[0x2d] = hw->red_lamp_on & 0xFF;
@ -832,6 +949,7 @@ static void usb_ResetRegisters( pPlustek_Device dev )
{
pHWDef hw = &dev->usbDev.HwSetting;
DBG( _DBG_INFO, "RESETTING REGISTERS\n" );
memset( a_bRegs, 0, sizeof(a_bRegs));
memcpy( a_bRegs+0x0b, &hw->bSensorConfiguration, 4 );
@ -848,7 +966,7 @@ static void usb_ResetRegisters( pPlustek_Device dev )
memcpy( a_bRegs+0x54, &hw->bReg_0x54, 0x5e - 0x54 + 1 );
}
/*.............................................................................
/** usb_ModuleStatus
*
*/
static SANE_Bool usb_ModuleStatus( pPlustek_Device dev )
@ -856,8 +974,9 @@ static SANE_Bool usb_ModuleStatus( pPlustek_Device dev )
u_char value;
pHWDef hw = &dev->usbDev.HwSetting;
/* HEINER: Maybe needed to avoid recalibration!!! */
#if 0
if(Calibration.fCalibrated)
if( dev->scanning.fCalibrated )
return SANE_TRUE;
#endif
@ -910,6 +1029,9 @@ static void usb_LampTimerIrq( int sig )
dev_xxx->fd = handle;
}
}
/* needs to be recalibrated */
dev_xxx->scanning.fCalibrated = SANE_FALSE;
if( -1 != dev_xxx->fd )
usb_LampOn( dev_xxx, SANE_FALSE, SANE_FALSE );
@ -920,7 +1042,7 @@ static void usb_LampTimerIrq( int sig )
}
}
/*.............................................................................
/** usb_StartLampTimer
*
*/
static void usb_StartLampTimer( pPlustek_Device dev )
@ -961,7 +1083,7 @@ static void usb_StartLampTimer( pPlustek_Device dev )
}
}
/*.............................................................................
/** usb_StopLampTimer
*
*/
static void usb_StopLampTimer( pPlustek_Device dev )

Wyświetl plik

@ -12,6 +12,7 @@
* 0.40 - starting version of the USB support
* 0.41 - fixed the 14bit problem for LM9831 devices
* 0.42 - no changes
* 0.43 - no changes
*
*.............................................................................
*

Wyświetl plik

@ -11,6 +11,7 @@
* 0.40 - starting version of the USB support
* 0.41 - fixed brightness problem for lineart mode
* 0.42 - removed preset of linear gamma tables
* 0.43 - no changes
*
*.............................................................................
*
@ -171,7 +172,7 @@ static SANE_Bool usb_MapDownload( pPlustek_Device dev, u_char bDataType )
} else {
fInverse = 0;
}
if( /*scanning->dwFlag & SCANFLAG_Pseudo48 && */
scanning->sParam.bSource == SOURCE_Negative ) {
fInverse ^= 1;
@ -181,7 +182,7 @@ static SANE_Bool usb_MapDownload( pPlustek_Device dev, u_char bDataType )
!(scanning->dwFlag & SCANFLAG_Pseudo48)) {
fInverse ^= 1;
}
if( fInverse ) {
u_char map[_MAP_SIZE];

Wyświetl plik

@ -11,6 +11,7 @@
* 0.40 - starting version of the USB support
* 0.41 - minor fixes
* 0.42 - added some stuff for CIS devices
* 0.43 - no changes
*
*.............................................................................
*
@ -146,6 +147,7 @@ static u_short usb_SetAsicDpiX( pPlustek_Device dev, u_short xdpi )
xdpi < 150 &&
scanning->sParam.bDataType == SCANDATATYPE_BW ) {
xdpi = 150;
DBG( _DBG_INFO, "LIMIT XDPI to %udpi\n", xdpi );
}
m_dHDPIDivider = (double)scaps->OpticDpi.x / xdpi;
@ -195,6 +197,7 @@ static u_short usb_SetAsicDpiX( pPlustek_Device dev, u_short xdpi )
if( a_bRegs[0x0a] )
a_bRegs[0x09] -= ((a_bRegs[0x0a] >> 2) + 2);
DBG( _DBG_INFO, "HDPI: %.3f\n", m_dHDPIDivider );
return (u_short)((double)scaps->OpticDpi.x / m_dHDPIDivider);
}
@ -223,8 +226,8 @@ static u_short usb_SetAsicDpiY( pPlustek_Device dev, u_short ydpi )
if( wDpi > sCaps->OpticDpi.y * 2 )
wDpi = sCaps->OpticDpi.y * 2;
if((hw->ScannerModel == MODEL_Tokyo600) ||
(hw->ScannerModel == MODEL_NOPLUSTEK)) {
if( (hw->motorModel == MODEL_Tokyo600) ||
!_IS_PLUSTEKMOTOR(hw->motorModel)) {
/* return wDpi; */
} else if( sCaps->wFlags & DEVCAPSFLAG_Adf && sCaps->OpticDpi.x == 600 ) {
/* for ADF scanner color mode 300 dpi big noise */
@ -355,7 +358,7 @@ static void usb_GetScanRect( pPlustek_Device dev, pScanParam pParam )
}
wLineEnd = wDataPixelStart + (u_short)(m_dHDPIDivider * pParam->Size.dwPhyPixels + 0.5);
DBG( _DBG_INFO, "DataPixelStart=0x%04x, LineEnd=0x%04x\n",
DBG( _DBG_INFO, "DataPixelStart=%u, LineEnd=%u\n",
wDataPixelStart, wLineEnd );
a_bRegs[0x22] = _HIBYTE( wDataPixelStart );
@ -366,7 +369,7 @@ static void usb_GetScanRect( pPlustek_Device dev, pScanParam pParam )
/* Y origin */
if( pParam->bCalibration == PARAM_Scan ) {
if( hw->ScannerModel == MODEL_Tokyo600 ) {
if( hw->motorModel == MODEL_Tokyo600 ) {
if(pParam->PhyDpi.x <= 75)
pParam->Origin.y += 20;
@ -408,8 +411,8 @@ static void usb_GetScanRect( pPlustek_Device dev, pScanParam pParam )
if (pParam->bDataType == SCANDATATYPE_Gray)
pParam->Origin.y += 4;
}
}
/* Add gray mode offset (Green offset, we assume the CCD are
* always be RGB or BGR order).
*/
@ -420,7 +423,7 @@ static void usb_GetScanRect( pPlustek_Device dev, pScanParam pParam )
pParam->Origin.y = (u_short)((u_long)pParam->Origin.y * hw->wMotorDpi / 300UL);
/* Something wrong, but I can not find it. */
if( hw->ScannerModel == MODEL_HuaLien && sCaps->OpticDpi.x == 600)
if( hw->motorModel == MODEL_HuaLien && sCaps->OpticDpi.x == 600)
pParam->Origin.y = pParam->Origin.y * 297 / 298;
DBG( _DBG_INFO, "Full Steps to Skip at Start = 0x%04x\n", pParam->Origin.y );
@ -492,6 +495,9 @@ static double usb_GetMCLKDivider( pPlustek_Device dev, pScanParam pParam )
else
m_bIntTimeAdjust = ceil( 5.3/*6.0*/ / (m_dHDPIDivider*m_dMCLKDivider));
DBG( _DBG_INFO, "Integration Time Adjust = %u (HDPI=%.3f,MCLKD=%.3f)\n",
m_bIntTimeAdjust, m_dHDPIDivider, m_dMCLKDivider );
if( pParam->bCalibration == PARAM_Scan ) {
/* Compare Integration with USB speed to find the best ITA value */
@ -503,7 +509,7 @@ static double usb_GetMCLKDivider( pPlustek_Device dev, pScanParam pParam )
m_bIntTimeAdjust++;
}
if( hw->ScannerModel == MODEL_HuaLien &&
if( hw->motorModel == MODEL_HuaLien &&
sCaps->bCCD == kNEC3799 && m_bIntTimeAdjust > bMaxITA) {
m_bIntTimeAdjust = bMaxITA;
}
@ -574,16 +580,18 @@ static double usb_GetMCLKDivider( pPlustek_Device dev, pScanParam pParam )
* 4e pause limit
* 52:53 dpd
*/
#if 0
#if 1
{
/*#define PCTR 2000000*/
#define PCTR 1000000 /* --> typical transfer rate... */
#define MCLKDIV_SCALING 2
int minmclk, maxmclk, mclkdiv, max_mclkdiv, min_mclkdiv;
int stepsize;
int j;
int pixelbits, pixelsperline;
unsigned long PCTransferRate = 2000000;
unsigned long PCTransferRate = PCTR;
double dpi;
double min_integration_time;
@ -619,8 +627,8 @@ static double usb_GetMCLKDivider( pPlustek_Device dev, pScanParam pParam )
maxmclk = (int) (32.5*MCLKDIV_SCALING + .5); /*round to be sure proper int*/
DBG( _DBG_INFO, "lower mclkdiv limit=%f\n",(double)minmclk/MCLKDIV_SCALING );
DBG( _DBG_INFO, "upper mclkdiv limit=%f\n",(double)maxmclk/MCLKDIV_SCALING );
DBG( _DBG_INFO2, "lower mclkdiv limit=%f\n",(double)minmclk/MCLKDIV_SCALING );
DBG( _DBG_INFO2, "upper mclkdiv limit=%f\n",(double)maxmclk/MCLKDIV_SCALING );
/*
* 2. calculate ideal mclk divider from average pc transfer rate
@ -650,33 +658,36 @@ static double usb_GetMCLKDivider( pPlustek_Device dev, pScanParam pParam )
dwCrystalFrequency
/((double) 8. * m_wLineLength * PCTransferRate));
DBG( _DBG_INFO, "mclkdiv before limit=%f\n", (double)mclkdiv/MCLKDIV_SCALING);
DBG( _DBG_INFO2, "mclkdiv before limit=%f\n", (double)mclkdiv/MCLKDIV_SCALING);
mclkdiv = usb_max( mclkdiv,minmclk );
mclkdiv = usb_min( mclkdiv,maxmclk );
DBG( _DBG_INFO, "mclkdiv after limit=%f\n", (double)mclkdiv/MCLKDIV_SCALING);
DBG( _DBG_INFO2, "mclkdiv after limit=%f\n", (double)mclkdiv/MCLKDIV_SCALING);
#if 0
if (PCTransferRate == 2000000)
#if 1
/* limited by the transfer speed... */
if (PCTransferRate == PCTR)
{
{
int mult,timeadj;
mult = timeadj =Hardware.merlininfo.timeadj;
mult = timeadj = m_bIntTimeAdjust;
if (!mult) mult++;
while (mclkdiv*dpi*mult < 6.*MCLKDIV_SCALING)
{
mclkdiv++; //for now
mclkdiv++; /* for now */
}
Hardware.merlininfo.timeadj = regs[0x19] = timeadj;
/* Hardware.merlininfo.timeadj = regs[0x19] = timeadj; */
}
Hardware.NSCStatusOut("PCrate mclkdiv=%f",(double)mclkdiv/MCLKDIV_SCALING);
return mclkdiv; //computing rate
DBG( _DBG_INFO, "PC-Rate mclkdiv=%f\n", (double)mclkdiv/MCLKDIV_SCALING );
/* return mclkdiv; */
return m_dMCLKDivider; /* = ((double)mclkdiv/MCLKDIV_SCALING); */
}
#endif
DBG( _DBG_INFO, "mclkdiv=%f\n",(double)mclkdiv/MCLKDIV_SCALING );
DBG( _DBG_INFO, "pixel bytes per line=%d\n",pixelsperline*m_bCM);
DBG( _DBG_INFO, "linewidth=%d\n", m_wLineLength);
DBG( _DBG_INFO2, "mclkdiv=%f\n",(double)mclkdiv/MCLKDIV_SCALING );
DBG( _DBG_INFO2, "pixel bytes per line=%d\n",pixelsperline*m_bCM);
DBG( _DBG_INFO2, "linewidth=%d\n", m_wLineLength);
/*
* 3. calculate max mclk divider based on max integration time
@ -689,12 +700,12 @@ static double usb_GetMCLKDivider( pPlustek_Device dev, pScanParam pParam )
dwCrystalFrequency * hw->dIntegrationTimeLowLamp
/((double) 1000. * 8 * m_bCM * m_wLineLength));
DBG( _DBG_INFO, "max mclkdiv before limit=%f\n", (double)max_mclkdiv/MCLKDIV_SCALING);
DBG( _DBG_INFO2, "max mclkdiv before limit=%f\n", (double)max_mclkdiv/MCLKDIV_SCALING);
max_mclkdiv = usb_max( max_mclkdiv,minmclk );
max_mclkdiv = usb_min( max_mclkdiv,maxmclk );
DBG( _DBG_INFO, "max mclkdiv after limit=%f\n", (double)max_mclkdiv/MCLKDIV_SCALING);
DBG( _DBG_INFO2, "max mclkdiv after limit=%f\n", (double)max_mclkdiv/MCLKDIV_SCALING);
/*
* 4. calculate min mclk divider based on max motor speed
@ -706,12 +717,12 @@ static double usb_GetMCLKDivider( pPlustek_Device dev, pScanParam pParam )
((double) stepsize * hw->dMaxMotorSpeed *8 * m_bCM *
hw->wMotorDpi * 4.));
DBG( _DBG_INFO, "min mclkdiv before limit=%f\n", (double)min_mclkdiv/MCLKDIV_SCALING);
DBG( _DBG_INFO2, "min mclkdiv before limit=%f\n", (double)min_mclkdiv/MCLKDIV_SCALING);
min_mclkdiv = usb_max( min_mclkdiv,minmclk );
min_mclkdiv = usb_min( min_mclkdiv,maxmclk );
DBG( _DBG_INFO, "min mclkdiv after limit=%f\n", (double)min_mclkdiv/MCLKDIV_SCALING);
DBG( _DBG_INFO2, "min mclkdiv after limit=%f\n", (double)min_mclkdiv/MCLKDIV_SCALING);
/* 5.Check if stepsize must be adjusted because max integration
* time gives too fast motor speed
@ -729,7 +740,7 @@ static double usb_GetMCLKDivider( pPlustek_Device dev, pScanParam pParam )
stepsize = (int)ceil(x);
DBG( _DBG_INFO, "step size for mclk calc=%d\n", stepsize );
DBG( _DBG_INFO2, "step size for mclk calc=%d\n", stepsize );
#if 0
Hardware.LimitStepSize(stepsize,regs);
@ -765,7 +776,7 @@ static double usb_GetMCLKDivider( pPlustek_Device dev, pScanParam pParam )
}
}
/*Hardware.merlininfo.timeadj = a_bRegs[0x19] = timeadj; */
DBG( _DBG_INFO, "time adj=%d\n", timeadj);
DBG( _DBG_INFO2, "time adj=%d\n", timeadj);
x = stepsize;
if( timeadj )
@ -923,121 +934,139 @@ static void usb_GetLineLength( pPlustek_Device dev )
m_wLineLength = tr / m_bLineRateColor;
}
/*.............................................................................
*
/** usb_GetMotorParam
* registers 0x56, 0x57
*/
static void usb_GetMotorParam( pPlustek_Device dev, pScanParam pParam )
{
pDCapsDef sCaps = &dev->usbDev.Caps;
pHWDef hw = &dev->usbDev.HwSetting;
int idx, i;
pClkMotorDef clk;
pMDef md;
pDCapsDef sCaps = &dev->usbDev.Caps;
pHWDef hw = &dev->usbDev.HwSetting;
if( sCaps->OpticDpi.x == 1200 ) {
switch( hw->ScannerModel ) {
case MODEL_NOPLUSTEK:
break;
case MODEL_HuaLien:
case MODEL_KaoHsiung:
default:
if(pParam->PhyDpi.x <= 200)
{
a_bRegs[0x56] = 1;
a_bRegs[0x57] = 48; /* 63; */
}
else if(pParam->PhyDpi.x <= 300)
{
a_bRegs[0x56] = 2; /* 8; */
a_bRegs[0x57] = 48; /* 56; */
}
else if(pParam->PhyDpi.x <= 400)
{
a_bRegs[0x56] = 8;
a_bRegs[0x57] = 48;
}
else if(pParam->PhyDpi.x <= 600)
{
a_bRegs[0x56] = 2; /* 10; */
a_bRegs[0x57] = 48; /* 56; */
}
else /* pParam->PhyDpi.x == 1200) */
{
a_bRegs[0x56] = 1; /* 8; */
a_bRegs[0x57] = 48; /* 56; */
}
break;
if( !_IS_PLUSTEKMOTOR(hw->motorModel)) {
clk = usb_GetMotorSet( hw->motorModel );
md = clk->motor_sets;
idx = 0;
for( i = 0; i < _MAX_CLK; i++ ) {
if( pParam->PhyDpi.x <= dpi_ranges[i] )
break;
idx++;
}
} else {
switch ( hw->ScannerModel ) {
if( idx >= _MAX_CLK )
idx = _MAX_CLK - 1;
case MODEL_NOPLUSTEK:
break;
a_bRegs[0x56] = md[idx].pwm;
a_bRegs[0x57] = md[idx].pwm_duty;
case MODEL_Tokyo600:
a_bRegs[0x56] = 16;
a_bRegs[0x57] = 4; /* 2; */
break;
case MODEL_HuaLien:
{
if(pParam->PhyDpi.x <= 200)
{
a_bRegs[0x56] = 64; /* 24; */
a_bRegs[0x57] = 4; /* 16; */
}
else if(pParam->PhyDpi.x <= 300)
{
a_bRegs[0x56] = 64; /* 16; */
a_bRegs[0x57] = 4; /* 16; */
}
else if(pParam->PhyDpi.x <= 400)
{
a_bRegs[0x56] = 64; /* 16; */
a_bRegs[0x57] = 4; /* 16; */
}
else /* if(pParam->PhyDpi.x <= 600) */
{
/* HEINER: check ADF stuff... */
#if 0
if(ScanInf.m_fADF)
{
a_bRegs[0x56] = 8;
a_bRegs[0x57] = 48;
}
else
#endif
{
a_bRegs[0x56] = 64; /* 2; */
a_bRegs[0x57] = 4; /* 48; */
}
}
}
break;
case MODEL_KaoHsiung:
default:
if(pParam->PhyDpi.x <= 200)
{
a_bRegs[0x56] = 24;
a_bRegs[0x57] = 16;
}
else if(pParam->PhyDpi.x <= 300)
{
a_bRegs[0x56] = 16;
a_bRegs[0x57] = 16;
}
else if(pParam->PhyDpi.x <= 400)
{
a_bRegs[0x56] = 16;
a_bRegs[0x57] = 16;
}
else /* if(pParam->PhyDpi.x <= 600) */
{
a_bRegs[0x56] = 2;
a_bRegs[0x57] = 48;
}
break;
}
} else {
if( sCaps->OpticDpi.x == 1200 ) {
switch( hw->motorModel ) {
case MODEL_HuaLien:
case MODEL_KaoHsiung:
default:
if(pParam->PhyDpi.x <= 200)
{
a_bRegs[0x56] = 1;
a_bRegs[0x57] = 48; /* 63; */
}
else if(pParam->PhyDpi.x <= 300)
{
a_bRegs[0x56] = 2; /* 8; */
a_bRegs[0x57] = 48; /* 56; */
}
else if(pParam->PhyDpi.x <= 400)
{
a_bRegs[0x56] = 8;
a_bRegs[0x57] = 48;
}
else if(pParam->PhyDpi.x <= 600)
{
a_bRegs[0x56] = 2; /* 10; */
a_bRegs[0x57] = 48; /* 56; */
}
else /* pParam->PhyDpi.x == 1200) */
{
a_bRegs[0x56] = 1; /* 8; */
a_bRegs[0x57] = 48; /* 56; */
}
break;
}
} else {
switch ( hw->motorModel ) {
case MODEL_Tokyo600:
a_bRegs[0x56] = 16;
a_bRegs[0x57] = 4; /* 2; */
break;
case MODEL_HuaLien:
{
if(pParam->PhyDpi.x <= 200)
{
a_bRegs[0x56] = 64; /* 24; */
a_bRegs[0x57] = 4; /* 16; */
}
else if(pParam->PhyDpi.x <= 300)
{
a_bRegs[0x56] = 64; /* 16; */
a_bRegs[0x57] = 4; /* 16; */
}
else if(pParam->PhyDpi.x <= 400)
{
a_bRegs[0x56] = 64; /* 16; */
a_bRegs[0x57] = 4; /* 16; */
}
else /* if(pParam->PhyDpi.x <= 600) */
{
/* HEINER: check ADF stuff... */
#if 0
if(ScanInf.m_fADF)
{
a_bRegs[0x56] = 8;
a_bRegs[0x57] = 48;
}
else
#endif
{
a_bRegs[0x56] = 64; /* 2; */
a_bRegs[0x57] = 4; /* 48; */
}
}
}
break;
case MODEL_KaoHsiung:
default:
if(pParam->PhyDpi.x <= 200)
{
a_bRegs[0x56] = 24;
a_bRegs[0x57] = 16;
}
else if(pParam->PhyDpi.x <= 300)
{
a_bRegs[0x56] = 16;
a_bRegs[0x57] = 16;
}
else if(pParam->PhyDpi.x <= 400)
{
a_bRegs[0x56] = 16;
a_bRegs[0x57] = 16;
}
else /* if(pParam->PhyDpi.x <= 600) */
{
a_bRegs[0x56] = 2;
a_bRegs[0x57] = 48;
}
break;
}
}
}
DBG( _DBG_INFO, "MOTOR-Settings: PWM=0x%02x, PWM_DUTY=0x%02x\n",
a_bRegs[0x56], a_bRegs[0x57] );
}
/*.............................................................................
@ -1092,7 +1121,7 @@ static void usb_GetPauseLimit( pPlustek_Device dev, pScanParam pParam )
m_dwPauseLimit, a_bRegs[0x4e], a_bRegs[0x4f] );
}
/**
/** usb_GetScanLinesAndSize
*
*/
static void usb_GetScanLinesAndSize( pPlustek_Device dev, pScanParam pParam )
@ -1115,7 +1144,7 @@ static void usb_GetScanLinesAndSize( pPlustek_Device dev, pScanParam pParam )
pParam->Size.dwTotalBytes = pParam->Size.dwPhyBytes * pParam->Size.dwPhyLines;
}
/*.............................................................................
/** function to preset/reset the merlin registers
*
*/
static SANE_Bool usb_SetScanParameters( pPlustek_Device dev, pScanParam pParam )
@ -1199,6 +1228,7 @@ static SANE_Bool usb_SetScanParameters( pPlustek_Device dev, pScanParam pParam )
4 * hw->wMotorDpi));
if( m_bIntTimeAdjust != 0 )
m_wFastFeedStepSize /= m_bIntTimeAdjust;
if(a_bRegs[0x0a])
m_wFastFeedStepSize *= ((a_bRegs[0x0a] >> 2) + 2);
a_bRegs[0x48] = _HIBYTE( m_wFastFeedStepSize );
@ -1253,6 +1283,7 @@ static SANE_Bool usb_SetScanParameters( pPlustek_Device dev, pScanParam pParam )
/* 0x03 - 0x05 */
_UIO(sanei_lm983x_write( dev->fd, 0x03, &a_bRegs[0x03], 3, SANE_TRUE));
/* 0x5C - 0x7F */
_UIO(sanei_lm983x_write( dev->fd, 0x5C, &a_bRegs[0x5C], 0x7F - 0x5C +1, SANE_TRUE));
@ -1321,7 +1352,6 @@ static SANE_Bool usb_ScanBegin( pPlustek_Device dev, SANE_Bool fAutoPark )
/* Download map & Shading data */
if(( m_pParam->bCalibration == PARAM_Scan &&
!usb_MapDownload( dev, m_pParam->bDataType)) ||
/* !usb_LinearMapDownload( dev )) || */
!usb_DownloadShadingData( dev, m_pParam->bCalibration ))
return SANE_FALSE;
@ -1337,8 +1367,8 @@ static SANE_Bool usb_ScanBegin( pPlustek_Device dev, SANE_Bool fAutoPark )
return SANE_TRUE;
}
/*.............................................................................
*
/** usb_ScanEnd
* stop all the processing stuff and reposition sensor back home
*/
static SANE_Bool usb_ScanEnd( pPlustek_Device dev )
{

Wyświetl plik

@ -12,6 +12,7 @@
* 0.41 - minor fixes
* - added workaround stuff for EPSON1250
* 0.42 - added workaround stuff for UMAX 3400
* 0.43 - added call to usb_switchLamp before reading dark data
*
*.............................................................................
*
@ -82,11 +83,11 @@ static double dMCLK, dExpect, dMax;
static double dMCLK_ADF;
static double dRed, dGreen, dBlue;
static u_short m_wHilight = 0; /* check the windows registry... */
static u_short m_wShadow = 0; /* check the windows registry... */
static u_short m_wHilight = 4 /*0*/; /* check the windows registry... */
static u_short m_wShadow = 4 /*0*/; /* check the windows registry... */
/*.............................................................................
*
/** usb_SetDarkShading
* download the dark shading data to Merlins' DRAM
*/
static SANE_Bool usb_SetDarkShading( int fd, u_char channel,
void *lpCoeff, u_short wCount )
@ -122,8 +123,8 @@ static SANE_Bool usb_SetDarkShading( int fd, u_char channel,
return SANE_FALSE;
}
/*.............................................................................
*
/** usb_SetWhiteShading
* download the white shading data to Merlins' DRAM
*/
static SANE_Bool usb_SetWhiteShading( int fd, u_char channel,
void *lpData, u_short wCount )
@ -158,8 +159,10 @@ static SANE_Bool usb_SetWhiteShading( int fd, u_char channel,
return SANE_FALSE;
}
/*.............................................................................
*
/** usb_GetSoftwareOffsetGain
* preset the offset and gain parameter for fine calibration.
* Adjustment on these defaults is done for negative and transparency
* scanning...
*/
static void usb_GetSoftwareOffsetGain( pPlustek_Device dev )
{
@ -167,8 +170,13 @@ static void usb_GetSoftwareOffsetGain( pPlustek_Device dev )
pDCapsDef sCaps = &dev->usbDev.Caps;
pHWDef hw = &dev->usbDev.HwSetting;
pParam->swOffset[0] = pParam->swOffset[1] = pParam->swOffset[2] = 0;
pParam->swGain[0] = pParam->swGain[1] = pParam->swGain[2] = 1000;
pParam->swOffset[0] = 0;
pParam->swOffset[1] = 0;
pParam->swOffset[2] = 0;
pParam->swGain[0] = 1000;
pParam->swGain[1] = 1000;
pParam->swGain[2] = 1000;
if( pParam->bSource != SOURCE_Reflection )
return;
@ -202,7 +210,7 @@ static void usb_GetSoftwareOffsetGain( pPlustek_Device dev )
pParam->swGain[1] = 980;
pParam->swGain[2] = 1000;
}
} else if( hw->ScannerModel == MODEL_KaoHsiung ) {
} else if( hw->motorModel == MODEL_KaoHsiung ) {
pParam->swOffset[0] = 1950;
pParam->swOffset[1] = 1700;
pParam->swOffset[2] = 1250;
@ -321,7 +329,7 @@ static void usb_GetSoftwareOffsetGain( pPlustek_Device dev )
pParam->swGain[1] = 920;
pParam->swGain[2] = 980;
}
else if( hw->ScannerModel == MODEL_HuaLien && pParam->PhyDpi.x > 800)
else if( hw->motorModel == MODEL_HuaLien && pParam->PhyDpi.x > 800)
{
pParam->swOffset[0] = 0;
pParam->swOffset[1] = 0;
@ -405,7 +413,15 @@ static u_char usb_GetNewGain( u_short wMax )
}
}
/*.............................................................................
/** usb_AdjustGain
* function to perform the "coarse calibration step" part 1.
* We scan reference image pixels to determine the optimum coarse gain settings
* for R, G, B. (Analog gain and offset prior to ADC). These coefficients are
* applied at the line rate during normal scanning.
* The scanned line should contain a white strip with some black at the
* beginning. The function searches for the maximum value which corresponds to
* the maximum white value.
* Affects register 0x3b, 0x3c and 0x3d
*
*/
static SANE_Bool usb_AdjustGain( pPlustek_Device dev, int fNegative )
@ -415,12 +431,16 @@ static SANE_Bool usb_AdjustGain( pPlustek_Device dev, int fNegative )
pHWDef hw = &dev->usbDev.HwSetting;
u_long dw;
SANE_Bool fRepeatITA = SANE_TRUE;
struct timeval t;
if( usb_IsEscPressed())
return SANE_FALSE;
bMaxITA = 0xff;
/*
* define the strip to scan for coarse calibration
*/
m_ScanParam.Size.dwLines = 1; /* for gain */
m_ScanParam.Size.dwPixels = scaps->Normal.Size.x *
scaps->OpticDpi.x / 300UL;
@ -433,14 +453,37 @@ static SANE_Bool usb_AdjustGain( pPlustek_Device dev, int fNegative )
TOGAIN:
m_ScanParam.dMCLK = dMCLK;
if( !usb_SetScanParameters( dev, &m_ScanParam ) || (usleep(50*1000),
!usb_ScanBegin( dev, SANE_FALSE)) ||
if( !usb_SetScanParameters( dev, &m_ScanParam ))
return SANE_FALSE;
/*
* wait until warmup period has been elapsed
*/
gettimeofday( &t, NULL);
dw = t.tv_sec - dev->usbDev.dwTicksLampOn;
if( dw < dev->usbDev.dwWarmup )
DBG(_DBG_INFO,"Warmup: Waiting %lu seconds\n",dev->usbDev.dwWarmup );
do {
gettimeofday( &t, NULL);
dw = t.tv_sec - dev->usbDev.dwTicksLampOn;
if( usb_IsEscPressed()) {
DBG( _DBG_INFO, "ReadImage() - Cancel detected...\n" );
return 0;
}
} while( dw < dev->usbDev.dwWarmup );
if( !usb_ScanBegin( dev, SANE_FALSE) ||
!usb_ScanReadImage( dev, pScanBuffer, m_ScanParam.Size.dwPhyBytes ) ||
!usb_ScanEnd( dev )) {
DBG( _DBG_ERROR, "usb_AdjustGain() failed\n" );
return SANE_FALSE;
}
usb_Swap((u_short *)pScanBuffer, m_ScanParam.Size.dwPhyBytes );
if( fNegative ) {
@ -515,8 +558,10 @@ TOGAIN:
rgb.Red = rgb.Green = rgb.Blue = 0;
/* find out the max pixel value for R, G, B */
for( dw = 0; dwLoop1; dwLoop1-- ) {
/* do some averaging... */
for (dwLoop2 = dwDiv, dwR = dwG = dwB = 0; dwLoop2; dwLoop2--, dw++)
{
dwR += ((pRGBUShortDef)pScanBuffer)[dw].Red;
@ -537,21 +582,21 @@ TOGAIN:
m_dwIdealGain = 0xf000; /* min(min(rgb.wRed, rgb.wGreen), rgb.wBlue) */
a_bRegs[0x3b] = usb_GetNewGain(rgb.Red);
a_bRegs[0x3c] = usb_GetNewGain(rgb.Green);
a_bRegs[0x3d] = usb_GetNewGain(rgb.Blue);
a_bRegs[0x3b] = usb_GetNewGain( rgb.Red );
a_bRegs[0x3c] = usb_GetNewGain( rgb.Green );
a_bRegs[0x3d] = usb_GetNewGain( rgb.Blue );
/* for MODEL KaoHsiung 1200 scanner multi-straight-line bug at
* 1200 dpi color mode
*/
if( hw->ScannerModel == MODEL_KaoHsiung && scaps->bCCD==kNEC3778 &&
if( hw->motorModel == MODEL_KaoHsiung && scaps->bCCD == kNEC3778 &&
dMCLK >= 5.5 && !a_bRegs[0x3c] ) {
a_bRegs[0x3b] = a_bRegs[0x3c] = a_bRegs[0x3d] = 1;
scanning->sParam.dMCLK = dMCLK = dMCLK - 1.5;
goto TOGAIN;
} else if( hw->ScannerModel == MODEL_HuaLien &&
} else if( hw->motorModel == MODEL_HuaLien &&
scaps->bCCD == kNEC3799 && fRepeatITA ) {
if((!a_bRegs[0x3b] ||
@ -586,12 +631,13 @@ TOGAIN:
return SANE_TRUE;
}
/*.............................................................................
/** usb_GetNewOffset
*
*/
static void usb_GetNewOffset( u_long *pdwSum, u_long *pdwDiff, char *pcOffset,
u_char *pIdeal, u_long dw, char cAdjust )
{
/* IDEAL_Offset is currently set to 0x1000 = 4096 */
u_long dwIdealOffset = IDEAL_Offset;
if( pdwSum[dw] > dwIdealOffset ) {
@ -623,7 +669,12 @@ static void usb_GetNewOffset( u_long *pdwSum, u_long *pdwDiff, char *pcOffset,
a_bRegs[0x38 + dw] = (u_char)(32 - pcOffset[dw]);
}
/*.............................................................................
/** usb_AdjustOffset
* function to perform the "coarse calibration step" part 2.
* We scan reference image pixels to determine the optimum coarse offset settings
* for R, G, B. (Analog gain and offset prior to ADC). These coefficients are
* applied at the line rate during normal scanning.
* Affects register 0x38, 0x39 and 0x3a
*
*/
static SANE_Bool usb_AdjustOffset( pPlustek_Device dev )
@ -662,6 +713,9 @@ static SANE_Bool usb_AdjustOffset( pPlustek_Device dev )
while( cAdjust ) {
/*
* read data (a white calibration strip - hopefully ;-)
*/
if((!usb_ScanBegin(dev, SANE_FALSE)) ||
(!usb_ScanReadImage(dev,pScanBuffer,m_ScanParam.Size.dwPhyBytes)) ||
!usb_ScanEnd( dev )) {
@ -679,12 +733,16 @@ static SANE_Bool usb_AdjustOffset( pPlustek_Device dev )
dwSum[1] += (u_long)_HILO2WORD(((pColorWordDef)pScanBuffer)[dw].HiLo[1]);
dwSum[2] += (u_long)_HILO2WORD(((pColorWordDef)pScanBuffer)[dw].HiLo[2]);
}
/* do averaging for each channel */
dwSum[0] /= dwPixels;
dwSum[1] /= dwPixels;
dwSum[2] /= dwPixels;
usb_GetNewOffset( dwSum, dwDiff, cOffset, bExpect, 0, cAdjust );
usb_GetNewOffset( dwSum, dwDiff, cOffset, bExpect, 1, cAdjust );
usb_GetNewOffset( dwSum, dwDiff, cOffset, bExpect, 2, cAdjust );
} else {
dwSum[0] = 0;
@ -710,7 +768,7 @@ static SANE_Bool usb_AdjustOffset( pPlustek_Device dev )
return SANE_TRUE;
}
/*.............................................................................
/** this
*
*/
static void usb_GetDarkShading( pPlustek_Device dev, u_short *pwDest,
@ -722,12 +780,11 @@ static void usb_GetDarkShading( pPlustek_Device dev, u_short *pwDest,
pDCapsDef scaps = &dev->usbDev.Caps;
pHWDef hw = &dev->usbDev.HwSetting;
/* HEINER: check that */
#if 0
if(Registry.GetEvenOdd() == 2)
if( scaps->workaroundFlag & _WAF_BLACKFINE )
{
u_short w;
u_short w;
/* here we use the source buffer + a static offset */
for (dw = 0; dw < dwPixels; dw++, pSrce += dwAdd)
{
w = (u_short)((int)_PHILO2WORD(pSrce) + iOffset);
@ -736,7 +793,6 @@ static void usb_GetDarkShading( pPlustek_Device dev, u_short *pwDest,
}
else
{
#endif
dwSum [0] = dwSum [1] = 0;
if( hw->bSensorConfiguration & 0x04 ) {
@ -772,11 +828,14 @@ static void usb_GetDarkShading( pPlustek_Device dev, u_short *pwDest,
u_long dwEnd = 0;
/* Standard CCD */
/* do some averaging on the line */
for( dw = dwEnd; dw < dwPixels; dw++, pSrce += dwAdd )
dwSum[0] += (u_long)_PHILO2WORD(pSrce);
dwSum [0] /= (dwPixels - dwEnd);
/* add our offset... */
dwSum [0] = (int)dwSum[0] + iOffset;
if((int)dwSum[0] < 0)
dwSum [0] = 0;
@ -784,14 +843,18 @@ static void usb_GetDarkShading( pPlustek_Device dev, u_short *pwDest,
dwSum[0] = (u_long)_LOBYTE(_LOWORD(dwSum[0])) * 256UL +
_HIBYTE(_LOWORD(dwSum[0]));
/* fill the shading data */
for( dw = dwEnd; dw < dwPixels; dw++ )
pwDest[dw] = (u_short)dwSum [0];
}
/* } */
}
}
/*.............................................................................
*
/** usb_AdjustDarkShading
* fine calibration part 1 - read the black calibration area and write
* the black line data to the offset coefficient data in Merlins' DRAM
* If there's no black line available, we can use the min pixel value
* from coarse calibration...
*/
static SANE_Bool usb_AdjustDarkShading( pPlustek_Device dev )
{
@ -811,6 +874,7 @@ static SANE_Bool usb_AdjustDarkShading( pPlustek_Device dev )
m_ScanParam.dMCLK = dMCLK;
if( _LM9831 == hw->chip ) {
m_ScanParam.UserDpi.x = usb_SetAsicDpiX( dev, m_ScanParam.UserDpi.x);
if( m_ScanParam.UserDpi.x < 100)
m_ScanParam.UserDpi.x = 150;
@ -827,28 +891,26 @@ static SANE_Bool usb_AdjustDarkShading( pPlustek_Device dev )
m_ScanParam.UserDpi.x / scanning->sParam.UserDpi.x;
} else {
m_ScanParam.Size.dwBytes = m_ScanParam.Size.dwPixels *
2 * m_ScanParam.bChannels;
2 * m_ScanParam.bChannels;
}
/* switch lamp off to read dark data... */
a_bRegs[0x29] = 0;
usb_switchLamp( dev, SANE_FALSE );
usb_SetScanParameters( dev, &m_ScanParam );
if((!usb_SetScanParameters( dev, &m_ScanParam)) ||
(!usb_ScanBegin(dev, SANE_FALSE)) ||
/* wait until really out ;-) - after glow !!! */
#if 0
usleep( 2000 * 1000 );
#endif
if((!usb_ScanBegin(dev, SANE_FALSE)) ||
(!usb_ScanReadImage(dev,pScanBuffer,m_ScanParam.Size.dwPhyBytes)) ||
(!usb_ScanEnd( dev ))) {
/* on error, reset the lamp settings*/
a_bRegs[0x29] = hw->bReg_0x29;
if(_WAF_MISC_IO6_LAMP==(_WAF_MISC_IO6_LAMP & scaps->workaroundFlag)) {
a_bRegs[0x5b] = 0x94;
usbio_WriteReg( dev->fd, 0x5b, a_bRegs[0x5b] );
} else if( _WAF_MISC_IO3_LAMP ==
(_WAF_MISC_IO3_LAMP & scaps->workaroundFlag)) {
a_bRegs[0x5a] |= 0x08;
usbio_WriteReg( dev->fd, 0x5a, a_bRegs[0x5a] );
}
usb_switchLamp( dev, SANE_TRUE );
usbio_WriteReg( dev->fd, 0x29, a_bRegs[0x29] );
DBG( _DBG_ERROR, "usb_AdjustDarkShading() failed\n" );
@ -856,20 +918,10 @@ static SANE_Bool usb_AdjustDarkShading( pPlustek_Device dev )
}
/*
* set illumination mode to 1 or 3 on EPSON
* set illumination mode and switch lamp on again
*/
a_bRegs[0x29] = hw->bReg_0x29;
if( _WAF_MISC_IO6_LAMP == (_WAF_MISC_IO6_LAMP & scaps->workaroundFlag)) {
a_bRegs[0x5b] = 0x94;
usbio_WriteReg( dev->fd, 0x5b, a_bRegs[0x5b] );
} else if( _WAF_MISC_IO3_LAMP ==
(_WAF_MISC_IO3_LAMP & scaps->workaroundFlag)) {
a_bRegs[0x5a] |= 0x08;
usbio_WriteReg( dev->fd, 0x5a, a_bRegs[0x5a] );
}
usb_switchLamp( dev, SANE_TRUE );
if( !usbio_WriteReg( dev->fd, 0x29, a_bRegs[0x29])) {
DBG( _DBG_ERROR, "usb_AdjustDarkShading() failed\n" );
@ -907,7 +959,9 @@ static SANE_Bool usb_AdjustDarkShading( pPlustek_Device dev )
return SANE_TRUE;
}
/*.............................................................................
/** usb_AdjustWhiteShading
* fine calibration part 2 - read the white calibration area and calculate
* the gain coefficient for each pixel
*
*/
static SANE_Bool usb_AdjustWhiteShading( pPlustek_Device dev )
@ -919,6 +973,7 @@ static SANE_Bool usb_AdjustWhiteShading( pPlustek_Device dev )
u_long dw, dwLines, dwRead;
pMonoWordDef pValue;
u_long* pdw;
int i;
m_pAvColor = (pRGBUShortDef)pScanBuffer;
m_pAvMono = (u_short*)pScanBuffer;
@ -1132,8 +1187,6 @@ static SANE_Bool usb_AdjustWhiteShading( pPlustek_Device dev )
/* Software gain */
if( scanning->sParam.bSource != SOURCE_Negative ) {
int i;
for( i = 0; i < 3; i++ ) {
@ -1155,7 +1208,7 @@ static SANE_Bool usb_AdjustWhiteShading( pPlustek_Device dev )
}
} else {
for( dw = m_ScanParam.Size.dwPhyPixels * 3; dw; dw--, pValue++, pdw++)
pValue->Mono = (u_short)(*pdw / (dwShadingLines/*SHADING_Lines*/ - m_wHilight - m_wShadow));
pValue->Mono = (u_short)(*pdw / (dwShadingLines - m_wHilight - m_wShadow));
}
} else {
@ -1229,11 +1282,11 @@ static SANE_Bool usb_AdjustWhiteShading( pPlustek_Device dev )
} else{
for( dw = 0; dw < m_ScanParam.Size.dwPhyPixels; dw++ )
pValue[dw].Mono = (u_short)(pdw[dw] /
(dwShadingLines/*SHADING_Lines*/ - m_wHilight - m_wShadow));
(dwShadingLines - m_wHilight - m_wShadow));
}
}
if( hw->ScannerModel != MODEL_Tokyo600 ) {
if( hw->motorModel != MODEL_Tokyo600 ) {
usb_ModuleMove( dev, MOVE_Forward, hw->wMotorDpi / 5 );
usb_ModuleToHome( dev, SANE_TRUE );
}
@ -1272,7 +1325,40 @@ static void usb_ResizeWhiteShading( double dAmp, u_short *pwShading, int iGain )
}
}
/*.............................................................................
/** usb_SetMCLK
* get the MCLK out of our table
*/
static void usb_SetMCLK( pPlustek_Device dev )
{
int idx, i;
pClkMotorDef clk;
pScanDef scanning = &dev->scanning;
pHWDef hw = &dev->usbDev.HwSetting;
clk = usb_GetMotorSet( hw->motorModel );
idx = 0;
for( i = 0; i < _MAX_CLK; i++ ) {
if( scanning->sParam.PhyDpi.x <= dpi_ranges[i] )
break;
idx++;
}
if( idx >= _MAX_CLK )
idx = _MAX_CLK - 1;
if( scanning->sParam.bDataType != SCANDATATYPE_Color )
dMCLK = clk->gray_mclk[idx];
else
dMCLK = clk->color_mclk[idx];
scanning->sParam.dMCLK = dMCLK;
DBG( _DBG_INFO, "SETMCLK[%u/%u], using entry %u: %f, %u\n",
hw->motorModel, scanning->sParam.bDataType,
idx, dMCLK, scanning->sParam.PhyDpi.x );
}
/** usb_DoCalibration
*
*/
static int usb_DoCalibration( pPlustek_Device dev )
@ -1284,7 +1370,7 @@ static int usb_DoCalibration( pPlustek_Device dev )
DBG( _DBG_INFO, "usb_DoCalibration()\n" );
if( SANE_TRUE == scanning->fCalibrated )
return 0;
return SANE_TRUE;
usb_GetSoftwareOffsetGain( dev );
@ -1303,19 +1389,20 @@ static int usb_DoCalibration( pPlustek_Device dev )
else
m_ScanParam.bDataType = SCANDATATYPE_Gray;
/* preset these registers offset/gain */
a_bRegs[0x38] = a_bRegs[0x39] = a_bRegs[0x3a] = 0;
a_bRegs[0x3b] = a_bRegs[0x3c] = a_bRegs[0x3d] = 1;
a_bRegs[0x45] &= ~0x10;
/* Go to shading position
* Wait for function implemented
*/
DBG( _DBG_INFO, "goto shading position\n" );
/* HEINER: Currently not clear why Plustek didn't use the ShadingOriginY
* for all modes
* It should be okay to remove thisand reference to the ShadingOriginY
*/
#if 1
#if 0
if( scanning->sParam.bSource == SOURCE_Negative ) {
DBG( _DBG_INFO, "DataOrigin.x=%u, DataOrigin.y=%u\n",
@ -1331,7 +1418,7 @@ static int usb_DoCalibration( pPlustek_Device dev )
DBG( _DBG_INFO, "ShadingOriginY=%lu\n",
(u_long)dev->usbDev.pSource->ShadingOriginY );
if((hw->ScannerModel == MODEL_HuaLien) && (scaps->OpticDpi.x == 600)) {
if((hw->motorModel == MODEL_HuaLien) && (scaps->OpticDpi.x == 600)) {
if (!usb_ModuleMove(dev, MOVE_ToShading,
(u_long)dev->usbDev.pSource->ShadingOriginY)) {
return _E_LAMP_NOT_IN_POS;
@ -1342,7 +1429,7 @@ static int usb_DoCalibration( pPlustek_Device dev )
return _E_LAMP_NOT_IN_POS;
}
}
}
/* }*/
DBG( _DBG_INFO, "shading position reached\n" );
@ -1373,7 +1460,7 @@ static int usb_DoCalibration( pPlustek_Device dev )
Gain_Reg.Green = a_bRegs[0x3c];
Gain_Reg.Blue = a_bRegs[0x3d];
Gain_NegHilight = Gain_Hilight;
#if 1
#if 0
if( !usb_ModuleMove( dev, MOVE_Backward,
dev->usbDev.pSource->DataOrigin.y +
dev->usbDev.pSource->Size.y / 2 -
@ -1388,8 +1475,8 @@ static int usb_DoCalibration( pPlustek_Device dev )
if(!usb_AdjustGain( dev, 1 ))
return _E_INTERNAL;
a_bRegs[0x3b] = a_bRegs[0x3c] = a_bRegs[0x3d] = 1;
/* a_bRegs[0x3b] = a_bRegs[0x3c] = a_bRegs[0x3d] = 1;
*/
DBG( _DBG_INFO, "Settings done, so start...\n" );
if( !usb_AdjustOffset(dev) || !usb_AdjustDarkShading(dev) ||
!usb_AdjustWhiteShading(dev)) {
@ -1423,7 +1510,7 @@ static int usb_DoCalibration( pPlustek_Device dev )
case SOURCE_ADF:
DBG( _DBG_INFO, "ADF Shading\n" );
m_dwIdealGain = IDEAL_GainPositive;
if( scanning->sParam.bDataType == SCANDATATYPE_BW ) {
if( scanning->sParam.bDataType == SCANDATATYPE_BW ) {
if( scanning->sParam.PhyDpi.x <= 200 ) {
scanning->sParam.dMCLK = 4.5;
dMCLK = 4.0;
@ -1479,18 +1566,15 @@ static int usb_DoCalibration( pPlustek_Device dev )
break;
default:
if( dev->usbDev.Caps.OpticDpi.x == 600 ) {
if( !_IS_PLUSTEKMOTOR(hw->motorModel)) {
DBG( _DBG_INFO, "No Plustek model: %udpi\n",
scanning->sParam.PhyDpi.x );
usb_SetMCLK( dev );
} else if( dev->usbDev.Caps.OpticDpi.x == 600 ) {
DBG( _DBG_INFO, "Default Shading (600dpi)\n" );
if( MODEL_NOPLUSTEK == hw->ScannerModel ) {
DBG( _DBG_INFO, "No Plustek model\n" );
if( scanning->sParam.PhyDpi.x > 300 )
scanning->sParam.dMCLK = dMCLK = ((scanning->sParam.bDataType == SCANDATATYPE_Color)? 3: 9);
else
scanning->sParam.dMCLK = dMCLK = ((scanning->sParam.bDataType == SCANDATATYPE_Color)? 2: 6);
} else if( dev->usbDev.Caps.bCCD == kSONY548 ) {
if( dev->usbDev.Caps.bCCD == kSONY548 ) {
DBG( _DBG_INFO, "CCD - SONY548\n" );
if( scanning->sParam.PhyDpi.x <= 75 ) {
@ -1543,7 +1627,7 @@ static int usb_DoCalibration( pPlustek_Device dev )
DBG( _DBG_INFO, "CAPS - Buttons\n" );
scanning->sParam.dMCLK = dMCLK = ((scanning->sParam.bDataType == SCANDATATYPE_Color)?3: 6);
if( dev->usbDev.HwSetting.ScannerModel == MODEL_KaoHsiung ) {
if( dev->usbDev.HwSetting.motorModel == MODEL_KaoHsiung ) {
if( dev->usbDev.Caps.bCCD == kNEC3799 ) {
if( scanning->sParam.PhyDpi.x > 300 )
scanning->sParam.dMCLK = dMCLK = ((scanning->sParam.bDataType == SCANDATATYPE_Color)? 6: 13);
@ -1554,7 +1638,7 @@ static int usb_DoCalibration( pPlustek_Device dev )
} else {
scanning->sParam.dMCLK = dMCLK = ((scanning->sParam.bDataType == SCANDATATYPE_Color)?3: 6);
}
} else { /* ScannerModel == MODEL_Hualien */
} else { /* motorModel == MODEL_Hualien */
/* IMPORTANT !!!!
* for Hualien 600 dpi scanner big noise
*/
@ -1610,9 +1694,16 @@ static int usb_DoCalibration( pPlustek_Device dev )
m_dwIdealGain = IDEAL_GainNormal;
DBG( _DBG_INFO, "Settings done, so start...\n" );
if( !usb_AdjustGain(dev, 0) || !usb_AdjustOffset(dev) ||
!usb_AdjustDarkShading(dev) || !usb_AdjustWhiteShading(dev)) {
DBG( _DBG_ERROR, "Shading failed!!!\n" );
if( !usb_AdjustGain(dev, 0)) {
DBG( _DBG_ERROR, "Coarse Calibration failed!!!\n" );
return _E_INTERNAL;
}
if( !usb_AdjustOffset(dev)) {
DBG( _DBG_ERROR, "Coarse Calibration failed!!!\n" );
return _E_INTERNAL;
}
if( !usb_AdjustDarkShading(dev) || !usb_AdjustWhiteShading(dev)) {
DBG( _DBG_ERROR, "Fine Calibration!!!\n" );
return _E_INTERNAL;
}
break;
@ -1620,12 +1711,22 @@ static int usb_DoCalibration( pPlustek_Device dev )
scanning->fCalibrated = SANE_TRUE;
DBG( _DBG_INFO, "Calibration done\n-----------------------\n" );
DBG( _DBG_INFO, "Static Gain:\n" );
DBG( _DBG_INFO, "REG[0x3b] = %u\n", a_bRegs[0x3b] );
DBG( _DBG_INFO, "REG[0x3c] = %u\n", a_bRegs[0x3c] );
DBG( _DBG_INFO, "REG[0x3d] = %u\n", a_bRegs[0x3d] );
DBG( _DBG_INFO, "Static Offset:\n" );
DBG( _DBG_INFO, "REG[0x38] = %u\n", a_bRegs[0x38] );
DBG( _DBG_INFO, "REG[0x39] = %u\n", a_bRegs[0x39] );
DBG( _DBG_INFO, "REG[0x3a] = %u\n", a_bRegs[0x3a] );
DBG( _DBG_INFO, "-----------------------\n" );
return SANE_TRUE;
}
/*.............................................................................
*
/** usb_DownloadShadingData
* according to the job id, different registers or DRAM areas are set
* in preparation for calibration or scanning
*/
static SANE_Bool usb_DownloadShadingData( pPlustek_Device dev, u_char bJobID )
{
@ -1651,6 +1752,12 @@ static SANE_Bool usb_DownloadShadingData( pPlustek_Device dev, u_char bJobID )
}
a_bRegs[0x40] = 0x40;
a_bRegs[0x41] = 0x00;
/* set RAM configuration AND
* Gain = Multiplier Coefficient/16384
* CFG Register 0x40/0x41 for Multiplier Coefficient Source
* External DRAM for Offset Coefficient Source
*/
a_bRegs[0x42] = (u_char)(( hw->wDRAMSize > 512)? 0x64: 0x24);
_UIO(sanei_lm983x_write( dev->fd, 0x40,
@ -1662,7 +1769,7 @@ static SANE_Bool usb_DownloadShadingData( pPlustek_Device dev, u_char bJobID )
if( _LM9831 != hw->chip )
m_dwPixels = m_ScanParam.Size.dwPhyPixels;
/* Download the dark & white shadings to LM9831 */
/* Download the dark & white shadings to LM983x */
if( pParam->bDataType == SCANDATATYPE_Color ) {
usb_SetDarkShading( dev->fd, CHANNEL_red, a_wDarkShading,
(u_short)m_ScanParam.Size.dwPhyPixels * 2);
@ -1693,7 +1800,12 @@ static SANE_Bool usb_DownloadShadingData( pPlustek_Device dev, u_char bJobID )
usb_SetWhiteShading( dev->fd,CHANNEL_green,a_wWhiteShading,
(u_short)m_ScanParam.Size.dwPhyPixels * 2);
}
/* set RAM configuration AND
* Gain = Multiplier Coefficient/16384
* External DRAM for Multiplier Coefficient Source
* External DRAM for Offset Coefficient Source
*/
a_bRegs[0x42] = (u_char)((hw->wDRAMSize > 512)? 0x66: 0x26);
if( !usbio_WriteReg( dev->fd, 0x42, a_bRegs[0x42]))
@ -1702,10 +1814,17 @@ static SANE_Bool usb_DownloadShadingData( pPlustek_Device dev, u_char bJobID )
break;
default:
a_bRegs[0x3E] = 0;
a_bRegs[0x3F] = 0;
/* for coarse calibration and "black fine"*/
a_bRegs[0x3e] = 0;
a_bRegs[0x3f] = 0;
a_bRegs[0x40] = 0x40;
a_bRegs[0x41] = 0x00;
/* set RAM configuration AND
* Bypass Multiplier
* CFG Register 0x40/0x41 for Multiplier Coefficient Source
* CFG Register 0x3e/0x3f for Offset Coefficient Source
*/
a_bRegs[0x42] = (u_char)((hw->wDRAMSize > 512)? 0x60: 0x20);
_UIO(sanei_lm983x_write( dev->fd, 0x3e, &a_bRegs[0x3e],

Wyświetl plik

@ -49,6 +49,7 @@
* fixed a bug that causes segfault when using the autodetection for USB
* devices
* added OS/2 switch to disable the USB stuff for OS/2
* 0.43 - added support for PREVIEW flag
*
*.............................................................................
*
@ -140,6 +141,7 @@
#define _DBG_INFO 5
#define _DBG_PROC 7
#define _DBG_SANE_INIT 10
#define _DBG_INFO2 13
#define _DBG_READ 15
/*****************************************************************************/
@ -593,7 +595,9 @@ static SANE_Status do_cancel( Plustek_Scanner *scanner, SANE_Bool closepipe )
*/
static SANE_Status limitResolution( Plustek_Device *dev )
{
dev->dpi_range.min = _DEF_DPI;
dev->dpi_range.min = /*lens.rDpiY.wMin; */ _DEF_DPI;
if( dev->dpi_range.min < _DEF_DPI )
dev->dpi_range.min = _DEF_DPI;
/*
* CHANGE: limit resolution to max. physical available one
@ -804,6 +808,13 @@ static SANE_Status init_options( Plustek_Scanner *s )
s->opt[OPT_CUSTOM_GAMMA].type = SANE_TYPE_BOOL;
s->val[OPT_CUSTOM_GAMMA].w = SANE_FALSE;
/* preview */
s->opt[OPT_PREVIEW].name = SANE_NAME_PREVIEW;
s->opt[OPT_PREVIEW].title = SANE_TITLE_PREVIEW;
s->opt[OPT_PREVIEW].desc = SANE_DESC_PREVIEW;
s->opt[OPT_PREVIEW].cap = SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT;
s->val[OPT_PREVIEW].w = 0;
/* "Geometry" group: */
s->opt[OPT_GEOMETRY_GROUP].name = "geometry-group";
s->opt[OPT_GEOMETRY_GROUP].title = SANE_I18N("Geometry");
@ -1151,7 +1162,7 @@ static SANE_Status attach( const char *dev_name, pCnfDef cnf,
dev->getCaps = usbDev_getCaps;
dev->getLensInfo = usbDev_getLensInfo;
dev->getCropInfo = usbDev_getCropInfo;
dev->putImgInfo = usbDev_putImgInfo;
dev->putImgInfo = NULL;
dev->setScanEnv = usbDev_setScanEnv;
dev->startScan = usbDev_startScan;
dev->stopScan = usbDev_stopScan;
@ -1349,8 +1360,9 @@ SANE_Status sane_init( SANE_Int *version_code, SANE_Auth_Callback authorize )
decodeVal( str, "warmup", _INT, &config.adj.warmup, &ival);
decodeVal( str, "lampOff", _INT, &config.adj.lampOff, &ival);
decodeVal( str, "lOffOnEnd", _INT, &config.adj.lampOffOnEnd,&ival);
ival = 0;
decodeVal( str, "enableTPA", _INT, &config.adj.enableTpa, &ival );
decodeVal( str, "posOffX", _INT, &config.adj.pos.x, &ival );
decodeVal( str, "posOffY", _INT, &config.adj.pos.y, &ival );
@ -1626,6 +1638,7 @@ SANE_Status sane_control_option( SANE_Handle handle, SANE_Int option,
case SANE_ACTION_GET_VALUE:
switch (option) {
case OPT_PREVIEW:
case OPT_NUM_OPTS:
case OPT_RESOLUTION:
case OPT_TL_X:
@ -1706,6 +1719,8 @@ SANE_Status sane_control_option( SANE_Handle handle, SANE_Int option,
break;
}
case OPT_PREVIEW:
case OPT_TL_X:
case OPT_TL_Y:
case OPT_BR_X:
@ -2112,11 +2127,18 @@ SANE_Status sane_start( SANE_Handle handle )
sinfo.ImgDef.wLens = s->hw->caps.wLens;
result = s->hw->putImgInfo( s->hw, &sinfo.ImgDef );
if( result < 0 ) {
DBG( _DBG_ERROR, "dev->putImgInfo failed(%d)\n", result );
s->hw->close( s->hw );
return SANE_STATUS_IO_ERROR;
/* only for parallel-port devices */
if( s->hw->putImgInfo ) {
result = s->hw->putImgInfo( s->hw, &sinfo.ImgDef );
if( result < 0 ) {
DBG( _DBG_ERROR, "dev->putImgInfo failed(%d)\n", result );
s->hw->close( s->hw );
return SANE_STATUS_IO_ERROR;
}
} else {
memcpy( &(crop.ImgDef), &sinfo.ImgDef, sizeof(ImgDef));
}
result = s->hw->getCropInfo( s->hw, &crop );
@ -2134,6 +2156,12 @@ SANE_Status sane_start( SANE_Handle handle )
/* build a SCANINFO block and get ready to scan it */
sinfo.ImgDef.dwFlag |= (SCANDEF_BuildBwMap | SCANDEF_QualityScan);
/* remove that for preview scans (USB only) */
if( _ASIC_IS_USB == s->hw->caps.AsicID ) {
if( s->val[OPT_PREVIEW].w )
sinfo.ImgDef.dwFlag &= (~SCANDEF_QualityScan);
}
/* set adjustments for brightness and contrast */
sinfo.siBrightness = s->val[OPT_BRIGHTNESS].w;
sinfo.siContrast = s->val[OPT_CONTRAST].w;

Wyświetl plik

@ -77,6 +77,13 @@ option greenGamma 1.0
option blueGamma 1.0
option grayGamma 1.0
#
# to enable TPA (non Plustek devices only)
# 0 means default behaviour as specified in the internal tables
# 1 means enable
#
enableTPA 0
#
# and of course the device-name
#

Wyświetl plik

@ -35,6 +35,7 @@
* 0.42 - added custom gamma tables
* changed usbId to static array
* added _MAX_ID_LEN
* 0.43 - no changes
*
*.............................................................................
*
@ -127,6 +128,7 @@ enum {
OPT_MODE,
OPT_EXT_MODE,
OPT_RESOLUTION,
OPT_PREVIEW,
OPT_GEOMETRY_GROUP,
OPT_TL_X,
OPT_TL_Y,

Wyświetl plik

@ -10,7 +10,7 @@
;
:backend "plustek" ; name of backend
:version "0.42" ; version of backend
:version "0.43" ; version of backend
:status :stable ; :alpha, :beta, :stable, :new
:manpage "sane-plustek" ; name of manpage (if it exists)
@ -29,99 +29,105 @@
;name models for above-specified mfg.
:model "OpticPro 4800P"
:interface "Parport (SPP, EPP)"
:comment "OK"
:status :stable
:model "OpticPro 4830P"
:interface "Parport (SPP, EPP)"
:comment "OK"
:status :stable
:model "OpticPro 600P/6000P"
:interface "Parport (SPP, EPP)"
:comment "OK"
:status :stable
:model "OpticPro 4831P"
:interface "Parport (SPP, EPP)"
:comment "OK"
:status :stable
:model "OpticPro 9630P"
:interface "Parport (SPP, EPP)"
:comment "OK"
:status :stable
:model "OpticPro 9630PL"
:interface "Parport (SPP, EPP)"
:comment "OK - use driver-switch mov=1"
:status :stable
:comment "use driver-switch mov=1"
:model "OpticPro 9600P"
:interface "Parport (SPP, EPP)"
:comment "OK"
:status :stable
:model "OpticPro 1236P"
:interface "Parport (SPP, EPP)"
:comment "OK - reported as OpticPro 12000P/96000P"
:status :stable
:comment "reported as OpticPro 12000P/96000P"
:model "OpticPro 12000P/96000P"
:interface "Parport (SPP, EPP)"
:comment "OK"
:status :stable
:model "OpticPro 9636P"
:interface "Parport (SPP, EPP)"
:comment "OK - use driver-switch mov=4"
:status :stable
:comment "use driver-switch mov=4"
:model "OpticPro 9636P+/Turbo"
:interface "Parport (SPP, EPP)"
:comment "OK - use driver-switch mov=3"
:status :stable
:comment "use driver-switch mov=3"
:model "OpticPro 9636T"
:interface "Parport (SPP, EPP)"
:comment "OK"
:status :stable
:model "OpticPro 12000T"
:interface "Parport (SPP, EPP)"
:comment "OK"
:status :stable
:model "OpticPro AI3"
:interface "Parport (SPP, EPP)"
:comment "OK - use driver-switch mov=5"
:status :stable
:comment "use driver-switch mov=5"
:model "OpticPro P8"
:interface "Parport"
:comment "Not tested."
:status :untested
:model "OpticPro P12"
:interface "Parport (SPP, EPP)"
:comment "OK"
:status :stable
:model "OpticPro PT12"
:interface "Parport (SPP, EPP)"
:comment "OK."
:status :stable
:model "OpticPro 19200S"
:interface "SCSI"
:status :unsupported
:comment "rebadged Artec AM12S (supported by Artec Backend)"
:model "OpticPro 1212U"
:interface "USB"
:comment "not supported."
:status :unsupported
:model "OpticPro U12"
:interface "USB"
:comment "OK."
:status :stable
:model "OpticPro UT12"
:interface "USB"
:comment "OK."
:status :stable
:model "OpticPro UT16"
:interface "USB"
:comment "OK."
:status :stable
:model "OpticPro U24"
:interface "USB"
:comment "OK."
:status :stable
:model "OpticPro UT24"
:interface "USB"
:comment "OK."
:status :stable
:mfg "Primax" ; name of manufacturer
@ -130,46 +136,54 @@
;name models for above-specified mfg.
:model "Colorado 4800"
:interface "Parport (SPP, EPP)"
:comment "Not tested, (same as OP4800P)"
:status :untested
:comment "same as OpticPro 4800P"
:model "Compact 4800 Direct"
:interface "Parport (SPP, EPP)"
:comment "OK - use driver-switch mov=2"
:status :stable
:comment "use driver-switch mov=2"
:model "Compact 4800 Direct-30"
:interface "Parport (SPP, EPP)"
:comment "Not tested, (same as OP4830P)"
:status :untested
:comment "same as OpticPro 4830P"
:model "Compact 9600 Direct-30"
:interface "Parport (SPP, EPP)"
:comment "OK - (same as OP9630P)"
:status :stable
:comment "same as OpticPro 9630P"
:mfg "Aries" ; name of manufacturer
:model "Scan-It Pro 4800"
:interface "Parport (SPP, EPP)"
:comment "OK - use driver-switch mov=2"
:status :stable
:comment "use driver-switch mov=2"
:mfg "KYE - Genius" ; name of manufacturer
:mfg "Genius" ; name of manufacturer
:url "http://www.geniusnet.com.tw/"
:model "Colorpage Vivid III V2"
:interface "Parport (SPP, EPP)"
:comment "OK - Reported as PT12"
:status :stable
:comment "Reported as PT12"
:model "Colorpage Vivid Pro II Film"
:interface "Parport (SPP, EPP)"
:comment "OK - Reported as OP9636T/12000T"
:status :stable
:comment "Reported as OP9636T/12000T"
:model "Colorpage HR6 V2"
:interface "USB"
:comment "OK"
:status :stable
:mfg "BrightScan"
:model "BrighScan OpticPro"
:interface "Parport (SPP, EPP)"
:comment "OK - Reported as P12"
:status :stable
:comment "Reported as P12"
:mfg "Mustek" ; name of manufacturer
:url "http://www.mustek.com/"
@ -177,39 +191,43 @@
;name models for above-specified mfg.
:model "BearPaw 1200"
:interface "USB"
:comment "Mostly OK"
:status :stable
:model "BearPaw 2400"
:interface "USB"
:status :stable
:comment "Mostly OK"
:mfg "Hewlett-Packard" ; name of manufacturer
:url "http://www.hp.com/"
:model "HP ScanJet 2100C"
:model "ScanJet 2100C"
:interface "USB"
:comment "Mostly OK"
:status :stable
:model "HP ScanJet 2200C"
:model "ScanJet 2200C"
:interface "USB"
:comment "Mostly OK"
:status :stable
:mfg "Epson" ; name of manufacturer
:url "http://www.epson.com/"
:model "Perfection 1250"
:interface "USB"
:status :stable
:comment "Mostly OK"
:model "Perfection 1250Photo"
:interface "USB"
:comment "Mostly OK - TPU not supported"
:status :stable
:comment "Mostly OK - use enableTPA"
:mfg "Umax" ; name of manufacturer
:url "http://www.umax.com/"
:model "UMAX 3400"
:interface "USB"
:status :stable
:comment "Mostly OK"
; :comment and :url specifiers are optional after :mfg, :model, :desc,

Wyświetl plik

@ -1,34 +1,35 @@
# translation of saneopts.es.po to Castellano
# Translation file for common options from the file saneopts.h
# Copyright (C) 2002 Henning Meier-Geinitz <henning@meier-geinitz.de>
# Based on the translation file for the UMAX and Mustek backends
# Gustavo D. Vranjes <gvranjes@abaconet.com.ar>, 2002
msgid ""
msgstr ""
"Project-Id-Version: sane-backends 1.0.7\n"
"Project-Id-Version: saneopts.es\n"
"POT-Creation-Date: 2002-01-18 22:49+0100\n"
"PO-Revision-Date: 2002-03-05 01:45GMT\n"
"PO-Revision-Date: 2002-06-06 22:24GMT\n"
"Last-Translator: Gustavo D. Vranjes <gvranjes@abaconet.com.ar>\n"
"Language-Team: Castellano <es@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ISO-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 0.9.5\n"
"X-Generator: KBabel 1.0beta1\n"
#: .tmp/saneopts.h:105
msgid "Number of options"
msgstr "Número de opciones"
#: .tmp/saneopts.h:106
msgid "Preview"
msgstr "Previsualizar"
#: .tmp/saneopts.h:107
msgid "Force monochrome preview"
msgstr ""
msgstr "Forzar vista previa monocroma"
#: .tmp/saneopts.h:108
msgid "Bit depth"
msgstr ""
msgstr "Profundidad de bit"
# Scanmodus
#: .tmp/saneopts.h:109
@ -45,7 +46,7 @@ msgstr "Fuente de Escaneo"
#: .tmp/saneopts.h:112
msgid "Force backtracking"
msgstr ""
msgstr "Forzar backtracking"
#: .tmp/saneopts.h:113
msgid "Top-left x"
@ -100,17 +101,16 @@ msgid "Brightness"
msgstr "Brillo"
#: .tmp/saneopts.h:126
msgid "Contrast"
msgstr "Contraste"
#: .tmp/saneopts.h:127
msgid "Grain size"
msgstr ""
msgstr "Tamaño del grano"
#: .tmp/saneopts.h:128
msgid "Halftoning"
msgstr ""
msgstr "Mediostonos"
#: .tmp/saneopts.h:129
msgid "Black level"
@ -121,7 +121,6 @@ msgid "White level"
msgstr "Nivel de Blanco"
#: .tmp/saneopts.h:131
msgid "Shadow"
msgstr "Sombra"
@ -154,22 +153,18 @@ msgid "Highlight for blue"
msgstr "Resaltado para azul"
#: .tmp/saneopts.h:139
msgid "Hue"
msgstr "Tono"
#: .tmp/saneopts.h:140
msgid "Saturation"
msgstr "Saturación"
#: .tmp/saneopts.h:141
msgid "Filename"
msgstr "Nombre de archivo"
#: .tmp/saneopts.h:142
msgid "Halftone pattern size"
msgstr "Medida del patrón de mediotono"
@ -182,7 +177,6 @@ msgid "Bind X and Y resolution"
msgstr "Enlazar resoluciones X e Y"
#: .tmp/saneopts.h:145
msgid "Negative"
msgstr "Negativo"
@ -192,11 +186,11 @@ msgstr "Calibraci
#: .tmp/saneopts.h:147
msgid "Double Optical Resolution"
msgstr ""
msgstr "Doble Resolución Óptica"
#: .tmp/saneopts.h:148
msgid "Bind RGB"
msgstr ""
msgstr "Enlazar RGB"
#: .tmp/saneopts.h:149
msgid "Threshold"
@ -204,39 +198,39 @@ msgstr "Umbral"
#: .tmp/saneopts.h:150
msgid "Analog gamma correction"
msgstr ""
msgstr "Corrección de gamma analógica"
#: .tmp/saneopts.h:151
msgid "Analog gamma red"
msgstr ""
msgstr "Gamma analógico rojo"
#: .tmp/saneopts.h:152
msgid "Analog gamma green"
msgstr ""
msgstr "Gamma analógico verde"
#: .tmp/saneopts.h:153
msgid "Analog gamma blue"
msgstr ""
msgstr "Gamma analógico azul"
#: .tmp/saneopts.h:154
msgid "Bind analog gamma"
msgstr ""
msgstr "Enlazar gamma analógico"
#: .tmp/saneopts.h:155
msgid "Smear"
msgstr ""
msgstr "Tiznar"
#: .tmp/saneopts.h:156
msgid "10 bit-mode"
msgstr ""
msgstr "Modo de 10 bits"
#: .tmp/saneopts.h:157
msgid "12 bit-mode"
msgstr ""
msgstr "Modo de 12 bits"
#: .tmp/saneopts.h:158
msgid "Warmup lamp"
msgstr ""
msgstr "Lámpara de calentamiento"
#: .tmp/saneopts.h:159
msgid "Preview patch"
@ -569,7 +563,7 @@ msgstr "Definir tiempo de exposici
#: .tmp/saneopts.h:354
msgid "Enable selection of exposure-time"
msgstr ""
msgstr "Establecer selección del tiempo de exposición"
#: .tmp/saneopts.h:356
msgid "Define lamp density for calibration"
@ -581,5 +575,5 @@ msgstr "Definir densidad de la l
#: .tmp/saneopts.h:360
msgid "Enable selection of lamp density"
msgstr ""
msgstr "Establecer selección de la densidad de la lámpara"