Minor fixes, esp. CanoScan LiDE30 color/gray bug.

merge-requests/1/head
Gerhard Jaeger 2003-09-24 20:20:30 +00:00
rodzic 0612bceb16
commit 60b90f6bba
6 zmienionych plików z 39 dodań i 19 usunięć

Wyświetl plik

@ -814,7 +814,7 @@ static int usbDev_setScanEnv( Plustek_Device *dev, pScanInfo si )
dev->scanning.fGrayFromColor = 2;
si->ImgDef.wDataType = COLOR_TRUE24;
DBG( _DBG_INFO, "Gray from color set!\n" );
DBG( _DBG_INFO, "* Gray from color set!\n" );
}
}
@ -827,9 +827,9 @@ static int usbDev_setScanEnv( Plustek_Device *dev, pScanInfo si )
SCANFLAG_StillModule | SCANDEF_Adf | SCANDEF_ContinuousScan);
if( !(SCANDEF_QualityScan & si->ImgDef.dwFlag)) {
DBG( _DBG_INFO, "Preview Mode set!\n" );
DBG( _DBG_INFO, "* Preview Mode set!\n" );
} else {
DBG( _DBG_INFO, "Preview Mode NOT set!\n" );
DBG( _DBG_INFO, "* Preview Mode NOT set!\n" );
dev->scanning.dwFlag |= SCANDEF_QualityScan;
}
@ -1034,6 +1034,7 @@ static int usbDev_Prepare( struct Plustek_Device *dev, SANE_Byte *buf )
if( dev->adj.cacheCalData )
usb_SaveCalData( dev );
DBG( _DBG_INFO, "calibration done.\n" );
if( !( scanning->dwFlag & SCANFLAG_Scanning )) {

Wyświetl plik

@ -585,7 +585,7 @@ static SANE_Bool cano_AdjustGain( pPlustek_Device dev )
}
adj = cano_adjGainSetting(min,max,a_bRegs+0x3c,w_max);
a_bRegs[0x3a] = (a_bRegs[0x3d] = a_bRegs[0x3c]);
a_bRegs[0x3b] = (a_bRegs[0x3d] = a_bRegs[0x3c]);
DBG(_DBG_INFO2, "MAX(G)= 0x%04x(%u)\n", w_max, w_max );

Wyświetl plik

@ -545,7 +545,7 @@ static DCapsDef Cap0x0400_0x1001_0 =
static DCapsDef Cap0x04B8_0x010F_0 =
{
/* Normal */
{{ 25, 85}, 10, -1, {2550, 3508}, { 100, 100 }, COLOR_BW },
{{ 25, 85}, 10, -1, {2550, 3508}, { 100, 100 }, COLOR_BW },
/* Positive */
{{ 1100, 972}, 720, -1, { 473, 414}, { 150, 150 }, COLOR_GRAY16 },
/* Negative */

Wyświetl plik

@ -28,7 +28,8 @@
* - fixed NULL pointer problem in lamp-off ISR
* - added usb_AdjustCISLampSettings()
* - skipping warmup for CIS devices
* - 0.46 - no changes
* - 0.46 - fixed problem in usb_GetLampStatus for CIS devices, as we
* read back reg[0x29] to wrong position
* .
* <hr>
* This file is part of the SANE package.
@ -695,12 +696,15 @@ static void usb_AdjustCISLampSettings( Plustek_Device *dev, SANE_Bool on )
if((dev->scanning.sParam.bDataType == SCANDATATYPE_Gray) ||
(dev->scanning.sParam.bDataType == SCANDATATYPE_BW)) {
DBG( _DBG_INFO2, " * setting mono mode\n" );
hw->bReg_0x29 = hw->illu_mono.mode;
memcpy( &hw->red_lamp_on,
&hw->illu_mono.red_lamp_on, sizeof(u_short) * 6 );
} else {
DBG( _DBG_INFO2, " * setting color mode\n" );
hw->bReg_0x29 = hw->illu_color.mode;
memcpy( &hw->red_lamp_on,
@ -788,10 +792,14 @@ static int usb_GetLampStatus( pPlustek_Device dev )
usb_GetLampRegAndMask( sc->lamp, &reg, &msk );
if( 0 == reg ) {
#if 0
/* probably not correct, esp. when changing from color to gray...*/
usbio_ReadReg( dev->fd, 0x29, &a_bRegs[0x29] );
if( a_bRegs[0x29] & 3)
if( a_bRegs[0x29] & 3 )
#else
usbio_ReadReg( dev->fd, 0x29, &reg );
if( reg & 3 )
#endif
iLampStatus |= DEV_LampReflection;
} else {

Wyświetl plik

@ -682,7 +682,11 @@ static SANE_Bool usb_AdjustGain( pPlustek_Device dev, int fNegative )
m_ScanParam.Size.dwLines = 1; /* for gain */
m_ScanParam.Size.dwPixels = scaps->Normal.Size.x *
scaps->OpticDpi.x / 300UL;
/*for TPA tests*/
#if 0
m_ScanParam.Size.dwPixels = dev->usbDev.pSource->Size.x *
scaps->OpticDpi.x / 300UL;
#endif
m_ScanParam.Size.dwBytes = m_ScanParam.Size.dwPixels *
2 * m_ScanParam.bChannels;
@ -693,6 +697,11 @@ static SANE_Bool usb_AdjustGain( pPlustek_Device dev, int fNegative )
m_ScanParam.Origin.x = (u_short)((u_long) hw->wActivePixelsStart *
300UL / scaps->OpticDpi.x);
/*for TPA tests*/
#if 0
m_ScanParam.Origin.x = (u_short)((u_long)dev->usbDev.pSource->DataOrigin.x *
300UL / scaps->OpticDpi.x);
#endif
m_ScanParam.bCalibration = PARAM_Gain;
DBG( _DBG_INFO2, "Coarse Calibration Strip:\n" );
@ -788,8 +797,9 @@ TOGAIN:
Gain_Hilight.Red = Gain_Hilight.Green =
Gain_Hilight.Blue = (u_short)(dwMax / 20UL);
Gain_Reg.Red = Gain_Reg.Green = Gain_Reg.Blue =
a_bRegs[0x3b] = a_bRegs[0x3c] = a_bRegs[0x3d] = usb_GetNewGain(Gain_Hilight.Green);
Gain_Reg.Red = Gain_Reg.Green =
Gain_Reg.Blue = a_bRegs[0x3b] =
a_bRegs[0x3c] = a_bRegs[0x3d] = usb_GetNewGain(Gain_Hilight.Green);
}
} else {
@ -807,8 +817,8 @@ TOGAIN:
for( dw = 0; dwLoop1; dwLoop1-- ) {
/* do some averaging... */
for (dwLoop2 = dwDiv, dwR = dwG = dwB = 0; dwLoop2; dwLoop2--, dw++)
{
for (dwLoop2 = dwDiv, dwR = dwG = dwB = 0;
dwLoop2; dwLoop2--, dw++) {
if( hw->bReg_0x26 & _ONE_CH_COLOR ) {
dwR += ((u_short*)pScanBuffer)[dw];
dwG += ((u_short*)pScanBuffer)

Wyświetl plik

@ -202,6 +202,7 @@ static ModeParam mode_params[] =
{1, 16, COLOR_TRUE48}
};
/* HEINER
static const SANE_String_Const mode_list[] =
{
SANE_I18N("Binary"),
@ -210,7 +211,7 @@ static const SANE_String_Const mode_list[] =
SANE_I18N("Color"),
NULL
};
*/
static const SANE_String_Const mode_usb_list[] =
{
SANE_I18N("Binary"),
@ -1803,16 +1804,16 @@ SANE_Status sane_control_option( SANE_Handle handle, SANE_Int option,
s->val[OPT_BR_X].w = SANE_FIX(_DEFAULT_NEG_BRX);
s->val[OPT_BR_Y].w = SANE_FIX(_DEFAULT_NEG_BRY);
}
/* HEINER
if( s->hw->caps.dwFlag & SFLAG_TPA ) {
*/
s->opt[OPT_MODE].constraint.string_list =
&mode_usb_list[_TPAModeSupportMin];
} else {
/* HEINER } else {
s->opt[OPT_MODE].constraint.string_list =
&mode_list[_TPAModeSupportMin];
}
s->val[OPT_MODE].w = 0; /* COLOR_24 is the default */
*/ s->val[OPT_MODE].w = 0; /* COLOR_24 is the default */
}
s->opt[OPT_HALFTONE].cap |= SANE_CAP_INACTIVE;