Many small fixes and documentation update.

DEVEL_2_0_BRANCH-1
Gerhard Jaeger 2002-10-15 18:02:53 +00:00
rodzic 23dd9c65ef
commit eff5c115cb
16 zmienionych plików z 448 dodań i 134 usunięć

Wyświetl plik

@ -1,3 +1,15 @@
2002-10-15 Gerhard Jaeger <gerhard@gjaeger.de>
* doc/sane-plustek.man: Major update
* doc/descriptions/plustek.desc: Added EPSON 1260 entry
* backend/plustek.conf updated options
* backend/plustek.c backend/plustek-devs.c backend/plustek-usb.c
backend/plustek-usbhw.c backend/plustek-pp.c
backend/plustek-usbmap.c backend/plustek-usbimg.c
backend/plustek-usbscan.c backend/plustek-usbshading.c
backend/plustek.h backend/plustek-share.h backend/plustek-usb.h
Bug fixes and workarounds
2002-10-15 Henning Meier-Geinitz <henning@meier-geinitz.de>
* doc/sane.tex: Backend behaviour is undefined if sane_init

Wyświetl plik

@ -28,7 +28,7 @@
* added Genius Model strings
* added Canon N670U entry
* added bStepsToReverse to the HwDesc structure
* tweaked EPSON1250 settings for TPA (negative origins)
* tweaked EPSON1250 settings for TPA (thanks to Till Kamppeter)
*
*.............................................................................
*
@ -590,13 +590,17 @@ static DCapsDef Cap0x0400_0x1001_0 =
};
/* Epson Perfection/Photo1250 (thanks to Gene Heskett and Reinhard Max)
* Epson Perfection/Photo1260 (thanks to Till Kamppeter)
* NS9832 + 4 Buttons + CCD????
*/
static DCapsDef Cap0x04B8_0x010F_0 =
{
{{ 25, 80}, 10, {2550, 3508}, { 100, 100 }, COLOR_BW },
{{ 965, 350}, 543, { 473, 414}, { 150, 150 }, COLOR_GRAY16 },
{{1004 + 20, 744 - 20}, 543, { 567, 414}, { 150, 150 }, COLOR_GRAY16 },
/* Normal */
{{ 25, 80}, 10, {2550, 3508}, { 100, 100 }, COLOR_BW },
/* Positive */
{{ 1100, 972}, 810, { 473, 414}, { 150, 150 }, COLOR_GRAY16 },
/* Negative */
{{ 1116, 1049}, 810, { 567, 414}, { 150, 150 }, COLOR_GRAY16 },
{{ 0, 0}, 0, {0, 0}, { 0, 0 }, 0 },
{1200, 1200},
0,
@ -1532,7 +1536,7 @@ static HWDef Hw0x04B8_0x010F_0 =
0x41, /* ok misc io12 (reg 0x59) */
0x44, /* ok misc io34 (reg 0x5a) */
0x94, /* ok misc io56 (reg 0x5b) */
0x14, /* ok misc io56 (reg 0x5b) */
0, /* ok test mode ADC Output CODE MSB (reg 0x5c) */
0, /* ok test mode ADC Output CODE LSB (reg 0x5d) */
0, /* ok test mode (reg 0x5e) */

Wyświetl plik

@ -17,7 +17,7 @@
* 0.42 - added setmap function
* fixed the stopscan problem, that causes a crash in the kernel module
* 0.43 - no changes
* 0.44 - no changes
* 0.44 - added initialized setting
*
*.............................................................................
*
@ -70,6 +70,7 @@ static int ppDev_open( const char *dev_name, void *misc )
int result;
int handle;
CompatAdjDef compatAdj;
PPAdjDef adj;
unsigned short version = _PTDRV_IOCTL_VERSION;
Plustek_Device *dev = (Plustek_Device *)misc;
@ -120,7 +121,23 @@ static int ppDev_open( const char *dev_name, void *misc )
return result;
}
_IOCTL( handle, _PTDRV_ADJUST, &dev->adj );
memset( &adj, 0, sizeof(PPAdjDef));
adj.lampOff = dev->adj.lampOff;
adj.lampOffOnEnd = dev->adj.lampOffOnEnd;
adj.warmup = dev->adj.warmup;
memcpy( &adj.pos, &dev->adj.pos, sizeof(OffsDef));
memcpy( &adj.neg, &dev->adj.neg, sizeof(OffsDef));
memcpy( &adj.tpa, &dev->adj.tpa, sizeof(OffsDef));
adj.rgamma = dev->adj.rgamma;
adj.ggamma = dev->adj.ggamma;
adj.bgamma = dev->adj.bgamma;
adj.graygamma = dev->adj.graygamma;
_IOCTL( handle, _PTDRV_ADJUST, &adj );
dev->initialized = SANE_TRUE;
return handle;
}

Wyświetl plik

@ -23,7 +23,7 @@
* changed IOCTL interface to allow downloadable MAPS
* added error codes
* 0.43 - added tpa entry for AdjDef
* 0.44 - no changes
* 0.44 - extended AdjDef
*
*.............................................................................
*
@ -215,7 +215,7 @@ typedef struct {
} OffsDef, *pOffsDef;
/*
* for compatiblitiy to version 0x0102 drivers
* for compatiblity to version 0x0102 drivers
*/
typedef struct {
@ -230,7 +230,7 @@ typedef struct {
} CompatAdjDef, *pCompatAdjDef;
/*
* for adjusting the drivers
* for adjusting the parport-drivers
*/
typedef struct {
int lampOff;
@ -249,6 +249,38 @@ typedef struct {
double graygamma;
} PPAdjDef, *pPPAdjDef;
/*
* for adjusting the usb stuff
*/
typedef struct {
int lampOff;
int lampOffOnEnd;
int warmup;
int enableTpa;
int skipCalibration;
int invertNegatives;
int rgain;
int ggain;
int bgain;
OffsDef pos; /* for adjusting normal scan area */
OffsDef tpa; /* for adjusting transparency scan area */
OffsDef neg; /* for adjusting negative scan area */
int posShadingY;
int tpaShadingY;
int negShadingY;
/* for adjusting the default gamma settings */
double rgamma;
double ggamma;
double bgamma;
double graygamma;
} AdjDef, *pAdjDef;
/*
@ -259,8 +291,6 @@ typedef struct {
char *desc;
} TabDef, *pTabDef;
/* NOTE: needs to be kept in sync with table below */
#define MODELSTR static char *ModelStr[] = { \
"unknown", \

Wyświetl plik

@ -84,7 +84,8 @@ static void usb_initDev( pPlustek_Device dev, int idx, int handle, int vendor )
int i;
ScanParam sParam;
DBG( _DBG_INFO, "usb_initDev(%d,0x%04x)\n", idx, vendor );
DBG( _DBG_INFO, "usb_initDev(%d,0x%04x,%u)\n",
idx, vendor, dev->initialized );
memcpy( &dev->usbDev.Caps, Settings[idx].pDevCaps, sizeof(DCapsDef));
memcpy( &dev->usbDev.HwSetting, Settings[idx].pHwDef, sizeof(HWDef));
@ -97,6 +98,12 @@ static void usb_initDev( pPlustek_Device dev, int idx, int handle, int vendor )
if( dev->adj.lampOffOnEnd >= 0 )
dev->usbDev.bLampOffOnEnd = dev->adj.lampOffOnEnd;
if( dev->adj.skipCalibration > 0 )
dev->usbDev.Caps.workaroundFlag |= _WAF_BYPASS_CALIBRATION;
if( dev->adj.invertNegatives > 0 )
dev->usbDev.Caps.workaroundFlag |= _WAF_INV_NEGATIVE_MAP;
/*
* adjust data origin
@ -108,7 +115,19 @@ static void usb_initDev( pPlustek_Device dev, int idx, int handle, int vendor )
dev->usbDev.Caps.Negative.DataOrigin.y -= dev->adj.neg.y;
dev->usbDev.Caps.Normal.DataOrigin.x -= dev->adj.pos.x;
dev->usbDev.Caps.Normal.DataOrigin.y -= dev->adj.pos.y;
dev->usbDev.Caps.Normal.DataOrigin.y -= dev->adj.pos.y;
/*
* adjust shading position
*/
if( dev->adj.posShadingY >= 0 )
dev->usbDev.Caps.Normal.ShadingOriginY = dev->adj.posShadingY;
if( dev->adj.tpaShadingY >= 0 )
dev->usbDev.Caps.Positive.ShadingOriginY = dev->adj.tpaShadingY;
if( dev->adj.negShadingY >= 0 )
dev->usbDev.Caps.Negative.ShadingOriginY = dev->adj.negShadingY;
/*
* the following you normally get from the registry...
@ -165,6 +184,9 @@ static void usb_initDev( pPlustek_Device dev, int idx, int handle, int vendor )
/* check and move sensor to its home position */
usb_ModuleToHome( dev, SANE_FALSE );
/* set the global flag, that we are initialized so far */
dev->initialized = SANE_TRUE;
}
/*.............................................................................

Wyświetl plik

@ -18,6 +18,7 @@
* added CLKDef
* 0.44 - added vendor and product ID to struct DeviceDef
* added _WAF_BYPASS_CALIBRATION
* added _WAF_INV_NEGATIVE_MAP
*
*.............................................................................
*
@ -175,7 +176,8 @@ enum _WORKAROUNDS
_WAF_BSHIFT7_BUG = 0x00000001, /* to fix U12 bug in 14bit mode */
_WAF_MISC_IO_LAMPS = 0x00000002, /* special lamp switching */
_WAF_BLACKFINE = 0x00000004, /* use black calibration strip */
_WAF_BYPASS_CALIBRATION = 0x00000008 /* no calibration,use linear gamma */
_WAF_BYPASS_CALIBRATION = 0x00000008, /* no calibration,use linear gamma */
_WAF_INV_NEGATIVE_MAP = 0x00000010 /* the backend does the neg. stuff */
};
enum _LAMPS

Wyświetl plik

@ -20,6 +20,8 @@
* modified getLampStatus function for CIS devices
* added usb_Wait4Warmup()
* moved usb_IsEscPressed to this file
* added usb_switchLampX
* do now not reinitialized MISC I/O pins upon reset registers
*
*.............................................................................
*
@ -691,11 +693,11 @@ static int usb_GetLampStatus( pPlustek_Device dev )
if( NULL == hw ) {
DBG( _DBG_ERROR, "NULL-Pointer detected: usb_GetLampStatus()\n" );
return -1;
}
}
/* do we use the misc I/O pins for switching the lamp ? */
if( _WAF_MISC_IO_LAMPS & sc->workaroundFlag ) {
usb_GetLampRegAndMask( sc->lamp, &reg, &msk );
if( 0 == reg ) {
@ -724,9 +726,9 @@ static int usb_GetLampStatus( pPlustek_Device dev )
iLampStatus |= DEV_LampTPA;
}
}
} else {
sanei_lm983x_read(dev->fd, 0x29,&a_bRegs[0x29],0x37-0x29+1,SANE_TRUE);
if((a_bRegs[0x29] & 3) == 1) {
@ -743,7 +745,7 @@ static int usb_GetLampStatus( pPlustek_Device dev )
if((a_bRegs[0x36] * 256 + a_bRegs[0x37]) > hw->wLineEnd )
iLampStatus |= DEV_LampTPA;
}
}
}
}
@ -751,36 +753,6 @@ static int usb_GetLampStatus( pPlustek_Device dev )
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_switchLampX
* used for all devices that use some misc I/O pins to switch the lamp
*/
@ -798,7 +770,7 @@ static SANE_Bool usb_switchLampX( pPlustek_Device dev,
if( 0 == reg )
return SANE_FALSE; /* no need to switch something */
DBG( _DBG_INFO, "usb_switchLampX(ON=%u,TPA=%u)", on, tpa );
DBG( _DBG_INFO, "usb_switchLampX(ON=%u,TPA=%u)\n", on, tpa );
if( on )
a_bRegs[reg] |= msk;
@ -812,6 +784,23 @@ static SANE_Bool usb_switchLampX( pPlustek_Device dev,
return SANE_TRUE;
}
/** 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_Bool result;
if((dev->scanning.sParam.bSource == SOURCE_Negative) ||
(dev->scanning.sParam.bSource == SOURCE_Transparency)) {
result = usb_switchLampX( dev, on, SANE_TRUE );
} else {
result = usb_switchLampX( dev, on, SANE_FALSE );
}
return result;
}
/** usb_LedOn
*
*/
@ -1007,11 +996,11 @@ static SANE_Bool usb_LampOn( pPlustek_Device dev,
* it should contain all we need
* @return - Nothing
*/
static void usb_ResetRegisters( pPlustek_Device dev )
static void usb_ResetRegisters( pPlustek_Device dev )
{
pHWDef hw = &dev->usbDev.HwSetting;
DBG( _DBG_INFO, "RESETTING REGISTERS\n" );
DBG( _DBG_INFO, "RESETTING REGISTERS(%u)\n", dev->initialized );
memset( a_bRegs, 0, sizeof(a_bRegs));
memcpy( a_bRegs+0x0b, &hw->bSensorConfiguration, 4 );
@ -1028,7 +1017,20 @@ static void usb_ResetRegisters( pPlustek_Device dev )
a_bRegs[0x50] = hw->bStepsToReverse;
a_bRegs[0x51] = hw->bReg_0x51;
memcpy( a_bRegs+0x54, &hw->bReg_0x54, 0x5e - 0x54 + 1 );
/* if already initialized, we ignore the MISC I/O settings as
* they are used to determine the current lamp settings...
*/
if( dev->initialized ) {
memcpy( a_bRegs+0x54, &hw->bReg_0x54, 0x58 - 0x54 + 1 );
a_bRegs[0x5c] = hw->bReg_0x5c;
a_bRegs[0x5d] = hw->bReg_0x5d;
a_bRegs[0x5e] = hw->bReg_0x5e;
sanei_lm983x_read( dev->fd, 0x59, &a_bRegs[0x59], 3, SANE_TRUE );
} else {
memcpy( a_bRegs+0x54, &hw->bReg_0x54, 0x5e - 0x54 + 1 );
}
DBG( _DBG_INFO, "MISC I/O after RESET: 0%02x, 0%02x, 0%02x\n",
a_bRegs[0x59], a_bRegs[0x5a], a_bRegs[0x5b] );
}
/** usb_ModuleStatus

Wyświetl plik

@ -1335,7 +1335,7 @@ static SANE_Int usb_ReadData( struct Plustek_Device *dev )
DBG( _DBG_READ, "usb_ReadData()\n" );
dwAdjust = 1;
dwAdjust = 1;
/* for 1 channel color, we have to adjust the phybytes... */
if( hw->bReg_0x26 & _ONE_CH_COLOR ) {

Wyświetl plik

@ -12,7 +12,7 @@
* 0.41 - fixed brightness problem for lineart mode
* 0.42 - removed preset of linear gamma tables
* 0.43 - no changes
* 0.44 - no changes
* 0.44 - map inversion for negatatives now only upon user request
*
*.............................................................................
*
@ -113,6 +113,7 @@ static void usb_MapAdjust( pPlustek_Device dev )
static SANE_Bool usb_MapDownload( pPlustek_Device dev, u_char bDataType )
{
pScanDef scanning = &dev->scanning;
pDCapsDef sc = &dev->usbDev.Caps;
int color, maxColor; /* loop counters */
int i, iThreshold;
@ -175,7 +176,8 @@ static SANE_Bool usb_MapDownload( pPlustek_Device dev, u_char bDataType )
}
if( /*scanning->dwFlag & SCANFLAG_Pseudo48 && */
scanning->sParam.bSource == SOURCE_Negative ) {
(scanning->sParam.bSource == SOURCE_Negative) &&
(sc->workaroundFlag &_WAF_INV_NEGATIVE_MAP)) {
fInverse ^= 1;
}

Wyświetl plik

@ -1298,7 +1298,7 @@ static SANE_Bool usb_SetScanParameters( pPlustek_Device dev, pScanParam pParam )
memset( &a_bRegs[0x03], 0, 3 );
memset( &a_bRegs[0x5C], 0, 0x7F-0x5C+1 );
/* 0x08 - 0x5E */
/* 0x08 - 0x5a */
_UIO(sanei_lm983x_write( dev->fd, 0x08, &a_bRegs[0x08], 0x5a - 0x08+1, SANE_TRUE));
/* 0x03 - 0x05 */

Wyświetl plik

@ -392,7 +392,7 @@ static void usb_GetSoftwareOffsetGain( pPlustek_Device dev )
}
}
/*.............................................................................
/** as the name says..
*
*/
static void usb_Swap( u_short *pw, u_long dwBytes )
@ -450,6 +450,20 @@ static u_char usb_GetNewGain( u_short wMax )
}
}
/** limit and set register given by address
*
*/
static void setAdjGain( int gain, u_char *reg )
{
if( gain >= 0 ) {
if( gain > 0x3f )
*reg = 0x3f;
else
*reg = gain;
}
}
/** usb_AdjustGain
* function to perform the "coarse calibration step" part 1.
* We scan reference image pixels to determine the optimum coarse gain settings
@ -492,9 +506,9 @@ static SANE_Bool usb_AdjustGain( pPlustek_Device dev, int fNegative )
if( hw->bReg_0x26 & _ONE_CH_COLOR )
m_ScanParam.Size.dwBytes *=3;
m_ScanParam.Origin.x = (u_short)((u_long) hw->wActivePixelsStart *
m_ScanParam.Origin.x = (u_short)((u_long) hw->wActivePixelsStart *
300UL / scaps->OpticDpi.x);
m_ScanParam.bCalibration = PARAM_Gain;
m_ScanParam.bCalibration = PARAM_Gain;
DBG( _DBG_INFO2, "Coarse Calibration Strip:\n" );
DBG( _DBG_INFO2, "Lines = %lu\n", m_ScanParam.Size.dwLines );
@ -709,6 +723,16 @@ TOGAIN:
DBG( _DBG_INFO2, "REG[0x3b] = %u\n", a_bRegs[0x3b] );
DBG( _DBG_INFO2, "REG[0x3c] = %u\n", a_bRegs[0x3c] );
DBG( _DBG_INFO2, "REG[0x3d] = %u\n", a_bRegs[0x3d] );
setAdjGain( dev->adj.rgain, &a_bRegs[0x3b] );
setAdjGain( dev->adj.ggain, &a_bRegs[0x3c] );
setAdjGain( dev->adj.bgain, &a_bRegs[0x3d] );
DBG( _DBG_INFO2, "after tweaking:\n" );
DBG( _DBG_INFO2, "REG[0x3b] = %u\n", a_bRegs[0x3b] );
DBG( _DBG_INFO2, "REG[0x3c] = %u\n", a_bRegs[0x3c] );
DBG( _DBG_INFO2, "REG[0x3d] = %u\n", a_bRegs[0x3d] );
DBG( _DBG_INFO2, "usb_AdjustGain() done.\n" );
return SANE_TRUE;
@ -717,8 +741,9 @@ TOGAIN:
/** usb_GetNewOffset
*
*/
static void usb_GetNewOffset( u_long *pdwSum, u_long *pdwDiff, char *pcOffset,
u_char *pIdeal, u_long dw, char cAdjust )
static void usb_GetNewOffset( u_long *pdwSum, u_long *pdwDiff,
signed char *pcOffset, u_char *pIdeal,
u_long dw, signed char cAdjust )
{
/* IDEAL_Offset is currently set to 0x1000 = 4096 */
u_long dwIdealOffset = IDEAL_Offset;
@ -762,13 +787,13 @@ static void usb_GetNewOffset( u_long *pdwSum, u_long *pdwDiff, char *pcOffset,
*/
static SANE_Bool usb_AdjustOffset( pPlustek_Device dev )
{
char tmp[40];
char cAdjust = 16;
char cOffset[3];
u_char bExpect[3];
int i;
u_long dw, dwPixels;
u_long dwDiff[3], dwSum[3];
char tmp[40];
signed char cAdjust = 16;
signed char cOffset[3];
u_char bExpect[3];
int i;
u_long dw, dwPixels, bytes2get;
u_long dwDiff[3], dwSum[3];
pHWDef hw = &dev->usbDev.HwSetting;
@ -804,13 +829,18 @@ static SANE_Bool usb_AdjustOffset( pPlustek_Device dev )
}
i = 0;
bytes2get = m_ScanParam.Size.dwPhyBytes;
if( hw->bReg_0x26 & _ONE_CH_COLOR )
bytes2get *=3;
while( cAdjust ) {
/*
* read data (a white calibration strip - hopefully ;-)
*/
if((!usb_ScanBegin(dev, SANE_FALSE)) ||
(!usb_ScanReadImage(dev,pScanBuffer,m_ScanParam.Size.dwPhyBytes)) ||
(!usb_ScanReadImage(dev,pScanBuffer,bytes2get)) ||
!usb_ScanEnd( dev )) {
DBG( _DBG_ERROR, "usb_AdjustOffset() failed\n" );
return SANE_FALSE;
@ -819,7 +849,7 @@ static SANE_Bool usb_AdjustOffset( pPlustek_Device dev )
sprintf( tmp, "coarse-off-%u.raw", i++ );
dumpPic( tmp, NULL, 0 );
dumpPic( tmp, pScanBuffer, m_ScanParam.Size.dwPhyBytes );
dumpPic( tmp, pScanBuffer, bytes2get );
if( m_ScanParam.bDataType == SCANDATATYPE_Color ) {
@ -1146,35 +1176,34 @@ static SANE_Bool usb_AdjustWhiteShading( pPlustek_Device dev )
DBG( _DBG_INFO2, "Origin.X = %u\n", m_ScanParam.Origin.x );
for( dw = dwShadingLines /*SHADING_Lines*/,
dwRead = 0; dw; dw -= m_ScanParam.Size.dwLines ) {
dwRead = 0; dw; dw -= m_ScanParam.Size.dwLines ) {
if( usb_SetScanParameters( dev, &m_ScanParam) &&
usb_ScanBegin( dev, SANE_FALSE )) {
if( _LM9831 == hw->chip ) {
/* Delay for white shading hold for 9831-1200 scanner */
usleep(250 * 10000);
usleep(250 * 10000);
}
if( usb_ScanReadImage( dev, pBuf + dwRead,
m_ScanParam.Size.dwBytes *
m_ScanParam.Size.dwLines)) {
m_ScanParam.Size.dwTotalBytes)) {
if( _LM9831 == hw->chip ) {
/* Delay for white shading hold for 9831-1200 scanner */
usleep(10 * 1000);
usleep(10 * 1000);
}
dumpPic( tmp, pBuf + dwRead, m_ScanParam.Size.dwBytes *
m_ScanParam.Size.dwLines );
m_ScanParam.Size.dwTotalBytes );
if( usb_ScanEnd( dev )) {
dwRead += m_ScanParam.Size.dwBytes;
dwRead += m_ScanParam.Size.dwTotalBytes;
continue;
}
}
}
DBG( _DBG_ERROR, "usb_AdjustWhiteShading() failed\n" );
return SANE_FALSE;
}
@ -1409,23 +1438,6 @@ static SANE_Bool usb_AdjustWhiteShading( pPlustek_Device dev )
}
}
if( hw->motorModel != MODEL_Tokyo600 ) {
usb_ModuleMove( dev, MOVE_Forward, hw->wMotorDpi / 5 );
usb_ModuleToHome( dev, SANE_TRUE );
}
if( scanning->sParam.bSource == SOURCE_ADF ) {
if( scaps->bCCD == kNEC3778 )
usb_ModuleMove( dev, MOVE_Forward, 1000 );
else /* if( scaps->bCCD == kNEC3799) */
usb_ModuleMove( dev, MOVE_Forward, 3 * 300 + 38 );
usb_MotorOn( dev->fd, SANE_FALSE );
}
return SANE_TRUE;
}
@ -1473,7 +1485,8 @@ static int usb_DoCalibration( pPlustek_Device dev )
m_ScanParam.bChannels = scanning->sParam.bChannels;
m_ScanParam.bBitDepth = 16;
m_ScanParam.bSource = scanning->sParam.bSource;
m_ScanParam.Origin.y = 0;
m_ScanParam.Origin.y = 0;
if( scanning->sParam.bDataType == SCANDATATYPE_Color )
m_ScanParam.bDataType = SCANDATATYPE_Color;
else
@ -1539,10 +1552,18 @@ static int usb_DoCalibration( pPlustek_Device dev )
DBG( _DBG_INFO, "--> BYPASS\n" );
a_bRegs[0x38] = a_bRegs[0x39] = a_bRegs[0x3a] = 1;
a_bRegs[0x3b] = a_bRegs[0x3c] = a_bRegs[0x3d] = 1;
setAdjGain( dev->adj.rgain, &a_bRegs[0x3b] );
setAdjGain( dev->adj.ggain, &a_bRegs[0x3c] );
setAdjGain( dev->adj.bgain, &a_bRegs[0x3d] );
a_bRegs[0x45] |= 0x10;
usb_SetMCLK( dev, &scanning->sParam );
dumpregs( dev->fd, a_bRegs );
DBG( _DBG_INFO2, "REG[0x3b] = %u\n", a_bRegs[0x3b] );
DBG( _DBG_INFO2, "REG[0x3c] = %u\n", a_bRegs[0x3c] );
DBG( _DBG_INFO2, "REG[0x3d] = %u\n", a_bRegs[0x3d] );
DBG( _DBG_INFO, "<-- BYPASS\n" );
return SANE_TRUE;
}
@ -1823,6 +1844,26 @@ static int usb_DoCalibration( pPlustek_Device dev )
break;
}
/*
* home the sensor after calibration
*/
if( hw->motorModel != MODEL_Tokyo600 ) {
usb_ModuleMove( dev, MOVE_Forward, hw->wMotorDpi / 5 );
usb_ModuleToHome( dev, SANE_TRUE );
}
if( scanning->sParam.bSource == SOURCE_ADF ) {
if( scaps->bCCD == kNEC3778 )
usb_ModuleMove( dev, MOVE_Forward, 1000 );
else /* if( scaps->bCCD == kNEC3799) */
usb_ModuleMove( dev, MOVE_Forward, 3 * 300 + 38 );
usb_MotorOn( dev->fd, SANE_FALSE );
}
scanning->fCalibrated = SANE_TRUE;
DBG( _DBG_INFO, "Calibration done\n-----------------------\n" );
DBG( _DBG_INFO, "Static Gain:\n" );

Wyświetl plik

@ -120,7 +120,7 @@
#include "sane/sanei.h"
#include "sane/saneopts.h"
#define BACKEND_VERSION "0.44-3"
#define BACKEND_VERSION "0.44-9"
#define BACKEND_NAME plustek
#include "sane/sanei_backend.h"
#include "sane/sanei_config.h"
@ -280,22 +280,30 @@ static SANE_Auth_Callback auth = NULL;
static void show_cnf( pCnfDef cnf )
{
DBG( _DBG_SANE_INIT, "Device configuration:\n" );
DBG( _DBG_SANE_INIT, "device name : >%s<\n", cnf->devName );
DBG( _DBG_SANE_INIT, "porttype : %d\n", cnf->porttype );
DBG( _DBG_SANE_INIT, "USB-ID : >%s<\n", cnf->usbId );
DBG( _DBG_SANE_INIT, "warmup : %ds\n", cnf->adj.warmup );
DBG( _DBG_SANE_INIT, "lampOff : %d\n", cnf->adj.lampOff );
DBG( _DBG_SANE_INIT, "lampOffOnEnd : %d\n", cnf->adj.lampOffOnEnd );
DBG( _DBG_SANE_INIT, "pos_x : %d\n", cnf->adj.pos.x );
DBG( _DBG_SANE_INIT, "pos_y : %d\n", cnf->adj.pos.y );
DBG( _DBG_SANE_INIT, "neg_x : %d\n", cnf->adj.neg.x );
DBG( _DBG_SANE_INIT, "neg_y : %d\n", cnf->adj.neg.y );
DBG( _DBG_SANE_INIT, "tpa_x : %d\n", cnf->adj.tpa.x );
DBG( _DBG_SANE_INIT, "tpa_y : %d\n", cnf->adj.tpa.y );
DBG( _DBG_SANE_INIT, "red Gamma : %.2f\n", cnf->adj.rgamma );
DBG( _DBG_SANE_INIT, "green Gamma : %.2f\n", cnf->adj.ggamma );
DBG( _DBG_SANE_INIT, "blue Gamma : %.2f\n", cnf->adj.bgamma );
DBG( _DBG_SANE_INIT, "gray Gamma : %.2f\n", cnf->adj.graygamma );
DBG( _DBG_SANE_INIT, "device name : >%s<\n", cnf->devName );
DBG( _DBG_SANE_INIT, "porttype : %d\n", cnf->porttype );
DBG( _DBG_SANE_INIT, "USB-ID : >%s<\n", cnf->usbId );
DBG( _DBG_SANE_INIT, "warmup : %ds\n", cnf->adj.warmup );
DBG( _DBG_SANE_INIT, "lampOff : %d\n", cnf->adj.lampOff );
DBG( _DBG_SANE_INIT, "lampOffOnEnd : %d\n", cnf->adj.lampOffOnEnd );
DBG( _DBG_SANE_INIT, "skipCalibr. : %d\n", cnf->adj.skipCalibration );
DBG( _DBG_SANE_INIT, "invertNegs. : %d\n", cnf->adj.invertNegatives );
DBG( _DBG_SANE_INIT, "pos_x : %d\n", cnf->adj.pos.x );
DBG( _DBG_SANE_INIT, "pos_y : %d\n", cnf->adj.pos.y );
DBG( _DBG_SANE_INIT, "pos_shading_y: %d\n", cnf->adj.posShadingY );
DBG( _DBG_SANE_INIT, "neg_x : %d\n", cnf->adj.neg.x );
DBG( _DBG_SANE_INIT, "neg_y : %d\n", cnf->adj.neg.y );
DBG( _DBG_SANE_INIT, "neg_shading_y: %d\n", cnf->adj.negShadingY );
DBG( _DBG_SANE_INIT, "tpa_x : %d\n", cnf->adj.tpa.x );
DBG( _DBG_SANE_INIT, "tpa_y : %d\n", cnf->adj.tpa.y );
DBG( _DBG_SANE_INIT, "tpa_shading_y: %d\n", cnf->adj.tpaShadingY );
DBG( _DBG_SANE_INIT, "red gain : %d\n", cnf->adj.rgain );
DBG( _DBG_SANE_INIT, "green gain : %d\n", cnf->adj.ggain );
DBG( _DBG_SANE_INIT, "blue gain : %d\n", cnf->adj.bgain );
DBG( _DBG_SANE_INIT, "red Gamma : %.2f\n", cnf->adj.rgamma );
DBG( _DBG_SANE_INIT, "green Gamma : %.2f\n", cnf->adj.ggamma );
DBG( _DBG_SANE_INIT, "blue Gamma : %.2f\n", cnf->adj.bgamma );
DBG( _DBG_SANE_INIT, "gray Gamma : %.2f\n", cnf->adj.graygamma );
DBG( _DBG_SANE_INIT, "---------------------\n" );
}
@ -1135,6 +1143,7 @@ static SANE_Status attach( const char *dev_name, pCnfDef cnf,
dev->name = strdup(dev_name); /* hold it double to avoid */
dev->sane.name = dev->name; /* compiler warnings */
dev->sane.vendor = "Plustek";
dev->initialized = SANE_FALSE;
memcpy( &dev->adj, &cnf->adj, sizeof(AdjDef));
@ -1299,6 +1308,13 @@ static void init_config_struct( pCnfDef cnf )
cnf->adj.lampOff = -1;
cnf->adj.lampOffOnEnd = -1;
cnf->adj.posShadingY = -1;
cnf->adj.tpaShadingY = -1;
cnf->adj.negShadingY = -1;
cnf->adj.rgain = -1;
cnf->adj.ggain = -1;
cnf->adj.bgain = -1;
cnf->adj.graygamma = 1.0;
cnf->adj.rgamma = 1.0;
cnf->adj.ggamma = 1.0;
@ -1368,9 +1384,20 @@ 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);
decodeVal( str, "posShadingY",_INT, &config.adj.posShadingY,&ival);
decodeVal( str, "tpaShadingY",_INT, &config.adj.tpaShadingY,&ival);
decodeVal( str, "negShadingY",_INT, &config.adj.negShadingY,&ival);
decodeVal( str, "red_gain", _INT, &config.adj.rgain, &ival);
decodeVal( str, "green_gain", _INT, &config.adj.ggain, &ival);
decodeVal( str, "blue_gain", _INT, &config.adj.bgain, &ival);
ival = 0;
decodeVal( str, "enableTPA", _INT, &config.adj.enableTpa, &ival );
decodeVal( str, "enableTPA", _INT, &config.adj.enableTpa, &ival);
decodeVal( str, "skipCalibration",
_INT, &config.adj.skipCalibration,&ival);
decodeVal( str, "invertNegatives",
_INT, &config.adj.invertNegatives,&ival);
decodeVal( str, "posOffX", _INT, &config.adj.pos.x, &ival );
decodeVal( str, "posOffY", _INT, &config.adj.pos.y, &ival );

Wyświetl plik

@ -69,6 +69,29 @@ option tpaOffY 0
option negOffX 0
option negOffY 0
#
# for setting the calibration strip position
# (WARNING: there's no internal range check!!!)
# -1 means use built in
#
option posShadingY -1
option tpaShadingY -1
option negShadingY -1
#
# to invert the negatives, 0 disables the feature
#
option invertNegatives 0
# for skipping calibration step
option skipCalibration 0
# for replacing the gain values found during
# calibration
option red_gain -1
option green_gain -1
option blue_gain -1
#
# for adjusting the default gamma values
# use values of 2.5 for CanoScan

Wyświetl plik

@ -36,7 +36,7 @@
* changed usbId to static array
* added _MAX_ID_LEN
* 0.43 - no changes
* 0.44 - no changes
* 0.44 - added flag initialized
*
*.............................................................................
*
@ -158,6 +158,7 @@ typedef enum {
typedef struct Plustek_Device
{
SANE_Bool initialized; /* device already initialized? */
struct Plustek_Device *next; /* pointer to next dev in list */
int fd; /* device handle */
char *name; /* (to avoid compiler warnings!)*/

Wyświetl plik

@ -220,7 +220,17 @@
:model "Perfection 1250Photo"
:interface "USB"
:status :stable
:comment "Mostly OK - use enableTPA"
:comment "Mostly OK - use option enableTPA"
:model "Perfection 1260"
:interface "USB"
:status :stable
:comment "Mostly OK"
:model "Perfection 1260Photo"
:interface "USB"
:status :stable
:comment "Mostly OK - use option enableTPA"
:mfg "Umax" ; name of manufacturer
:url "http://www.umax.com/"

Wyświetl plik

@ -1,4 +1,4 @@
.TH sane-plustek 5 "27 September 2002"
.TH sane-plustek 5 "14 October 2002"
.IX sane-plustek
.SH NAME
sane-plustek \- SANE backend for Plustek parallel port and
@ -13,6 +13,9 @@ parallel port scanners you will need a kernel module, called
pt_drv which currently can be downloaded from
.br
.B http://www.gjaeger.de/scanner/plustek.html
.PP
.B !!!Please note that you need the kernel module only for
.B parallel port scanners!!!
.SH "PARALLEL PORT SUPPORT"
@ -35,9 +38,9 @@ OpticPro 12000P Turbo 98001 600x1200 dpi 36bit 512Kb
.br
OpticPro 9636P+/Turbo 98001 600x1200 dpi 36bit 512Kb
.br
OpticPro 9636P 98001 600x1200 dpi 36bit 512Kb
OpticPro 9636P 96003 600x1200 dpi 36bit 128Kb
.br
OpticPro 12000P/96000P 96003 600x1200 dpi 30bit 128Kb
OpticPro 12000P/96000P 96003 600x1200 dpi 36bit 128Kb
.br
OpticPro 1236P 96003 600x1200 dpi 30bit 128Kb
.br
@ -47,7 +50,7 @@ OpticPro 9630P/FBIV 96003 600x1200 dpi 30bit 128Kb
.br
OpticPro 9630PL (14") 96003 600x1200 dpi 30bit 128Kb
.br
OpticPro A3I 96003 400x800 dpi 30bit 128Kb
OpticPro A3I 96003 400x800 dpi 36bit 128Kb
.br
OpticPro 600P/6000P 96003 300x600 dpi 30bit 32Kb
.br
@ -122,7 +125,10 @@ BrightScan OpticPro OpticPro P12
The Backend is able to support USB scanner based on the National
Semiconductor chipset LM9831, LM9832 and LM9833. The following tables
show various devices which are currently reported to work.
show various devices which are currently reported to work. If your
Plustek scanner has another Product ID, then the device is
.B NOT
supported, as it contains unsupported ASICs inside.
.br
Vendor Plustek - ID: 0x07B3
@ -135,6 +141,8 @@ USB Model: ASIC: Properties: Prod-ID
.br
OpticPro U12 LM9831 600x1200dpi 42bit 512Kb 0x0010
.br
OpticPro UT12 LM9831 600x1200dpi 42bit 512Kb 0x0013
.br
OpticPro UT12 LM9832 600x1200dpi 42bit 512Kb 0x0017
.br
OpticPro UT16 LM9832 600x1200dpi 42bit 512Kb 0x0017
@ -155,6 +163,16 @@ USB Model: ASIC: Properties: Prod-ID
----------------------------------------------------------
.br
Colorpage HR6 V2 LM9832 600x1200dpi 42bit 512Kb 0x2007
.br
Colorpage HR6 V2 LM9832 600x1200dpi 42bit 512Kb 0x2008
.br
Colorpage HR6A LM9832 600x1200dpi 42bit 512Kb 0x2009
.br
Colorpage HR7 LM9832 600x1200dpi 42bit 512Kb 0x2013
.br
Colorpage HR7LE LM9832 600x1200dpi 42bit 512Kb 0x2015
.br
Colorpage HR6X LM9832 600x1200dpi 42bit 512Kb 0x2016
.PP
Vendor Hewlett-Packard - ID: 0x03F0
@ -202,9 +220,9 @@ USB Model: ASIC: Properties: Prod-ID
.br
----------------------------------------------------------
.br
CanoScan N650/656U LM9832 1200x2400dpi 42bit 512Kb 0x2206
CanoScan N650/656U LM9832 1200x2400dpi 48bit 512Kb 0x2206
.br
CanoScan N670/676U LM9832 1200x2400dpi 42bit 512Kb 0x220D
CanoScan N670/676U LM9832 1200x2400dpi 48bit 512Kb 0x220D
.PP
.SH "OTHER PLUSTEK SCANNERS"
@ -215,8 +233,8 @@ and is supported by the
backend.
.br
Only the National Semiconductor LM9831/2 based devices of Plustek
are supported by this driver. Older versions of the UT12, the U1212
and U1248 (GrandTech chipset are not supported)
are supported by this driver. Older versions of the U12, the UT12,
the U1212 and U1248 (GrandTech chipset are not supported)
.PP
.SH "DEVICE NAMES"
@ -260,7 +278,7 @@ The configuration of this backend can be divided into two sections:
.PP
.br
Please make sure, that the configuration matches the real world,
namely your configuration.
namely your configuration. And note again, .I pt_drv is only needed
.PP
.SH "CONFIGURATION - PARALLEL PORT SCANNER"
@ -438,6 +456,111 @@ tells the backend, that the following devicename (here
) has to be interpreted as USB scanner device. If vendor- and
product-id has not been specified, the backend tries to
detect this by its own.
.PP
.B
The Options:
.PP
option warmup t
.RS
.I t
specifies the warmup period in seconds
.RE
.PP
option lampOff t
.RS
.I t
is the time in seconds for switching off the lamps in
standby mode
.RE
.PP
option lOffonEnd b
.RS
.I b
specifies the behaviour when closing the backend, 1 --> switch
lamps off, 0 --> do not change lamp status
.RE
.PP
option invertNegatives b
.RS
.I b
0 --> do not invert the picture during negativ scans,
1 --> invert picture
.RE
.PP
option skipCalibration b
.RS
.I b
0 --> perform calibration,
1 --> skip calibration (only non Plustek devices)
.RE
.PP
option enableTPA b
.RS
.I b
0 --> default behaviour, specified by the internal tables,
1 --> override internal tables and allow TPA mode (EPSON only)
.RE
.PP
option posOffX x
.br
option posOffY y
.br
option tpaOffX x
.br
option tpaOffY y
.br
option negOffX x
.br
option negOffY y
.RS
.I x y
By using this settings, the user can adjust the given image
positions.
.B Please note, that there's no internal range checking for
.B this feature.
.RE
.PP
option posShadingY p
.br
option tpaShadingY p
.br
option negShadingY p
.RS
.I p
overrides the internal shading position. The values are in steps.
.B Please note, that there's no internal range checking for
.B this feature.
.RE
.PP
option redGamma r
.br
option greenGamma g
.br
option blueGamma b
.br
option grayGamma gr
.RS
.I r g b gr
.RE
By using these values, the internal linear gamma table (r,g,b,gr = 1.0)
can be adjusted.
.PP
option red_gain r
.br
option green_gain g
.br
option blue_gain b
.RS
.I r g b
These values can be used to adjust the internally detected gain values of
the AFE for each channel. The range is between 0 and 63.
.RE
.PP
See the plustek.conf file for examples.
.PP
@ -499,7 +622,7 @@ or directly from the projects' homepage at:
.B http://www.gjaeger.de/scanner/plustek.html
.PP
.SH "BUGS & RESTRICTIONS"
.SH "KNOWN BUGS & RESTRICTIONS"
.PP
.br
* The Halftoning works, but the quality is poor
@ -568,7 +691,5 @@ USB models:
the model list above and compare the product-id to
.br
the one your device has.
.br
* Negative scanning quality is poor.