kopia lustrzana https://gitlab.com/sane-project/backends
sm3600: fixed gain table transfer
rodzic
1664d516d8
commit
c8b840399a
|
@ -13,6 +13,8 @@
|
||||||
out by Mattias Ellert, thanks: Waiting longer for DoJog() command
|
out by Mattias Ellert, thanks: Waiting longer for DoJog() command
|
||||||
completion, new function for transmitting the line gain correction
|
completion, new function for transmitting the line gain correction
|
||||||
data with correct endianess, Chassis-Gray-Level lowered.
|
data with correct endianess, Chassis-Gray-Level lowered.
|
||||||
|
* backend/sm3600.c : Fixed off-by-one-error in p->lines
|
||||||
|
backend/sm3600-scanmtek: Fixed just broken UploadGainCorrection()
|
||||||
|
|
||||||
2004-04-14 Karl Heinz Kremer <khk@khk.net>
|
2004-04-14 Karl Heinz Kremer <khk@khk.net>
|
||||||
|
|
||||||
|
|
|
@ -271,7 +271,7 @@ TState StartScanColor(TInstance *this)
|
||||||
UploadGammaTable(this,0x4000,this->agammaB);
|
UploadGammaTable(this,0x4000,this->agammaB);
|
||||||
INST_ASSERT();
|
INST_ASSERT();
|
||||||
|
|
||||||
UploadGainCorrection(this);
|
UploadGainCorrection(this,0x6000);
|
||||||
INST_ASSERT();
|
INST_ASSERT();
|
||||||
|
|
||||||
/* enough for 1/100 inch sensor distance */
|
/* enough for 1/100 inch sensor distance */
|
||||||
|
|
|
@ -346,7 +346,7 @@ TState StartScanGray(TInstance *this)
|
||||||
RegWrite(this,0x40,1,0x20); /* FIFO at 0x08000 */
|
RegWrite(this,0x40,1,0x20); /* FIFO at 0x08000 */
|
||||||
UploadGammaTable(this,0,this->agammaY); INST_ASSERT();
|
UploadGammaTable(this,0,this->agammaY); INST_ASSERT();
|
||||||
|
|
||||||
UploadGainCorrection(this);
|
UploadGainCorrection(this, 0x2000);
|
||||||
INST_ASSERT();
|
INST_ASSERT();
|
||||||
|
|
||||||
/* for halftone dithering we need one history line */
|
/* for halftone dithering we need one history line */
|
||||||
|
|
|
@ -280,16 +280,13 @@ UploadGainCorrection()
|
||||||
********************************************************************** */
|
********************************************************************** */
|
||||||
|
|
||||||
__SM3600EXPORT__
|
__SM3600EXPORT__
|
||||||
TState UploadGainCorrection(TInstance *this)
|
TState UploadGainCorrection(TInstance *this, int iTableOffset)
|
||||||
{
|
{
|
||||||
#ifndef SM3600_NO_GAIN_CORRECTION
|
|
||||||
RegWrite(this,0x3D,1,0x0F | 0x80); /* 10XXXXXX : one offset table */
|
|
||||||
RegWrite(this,0x3F,1,0x18); /* 16KB gain at 0x06000 */
|
|
||||||
{
|
{
|
||||||
struct TGain {
|
struct TGain {
|
||||||
unsigned char uchLow;
|
unsigned char uchLow;
|
||||||
unsigned char uchHigh;
|
unsigned char uchHigh;
|
||||||
} aGain[8192];
|
} aGain[0x2000]; /* 16 KB */
|
||||||
int i,iOff;
|
int i,iOff;
|
||||||
unsigned short uwGain;
|
unsigned short uwGain;
|
||||||
|
|
||||||
|
@ -297,16 +294,17 @@ TState UploadGainCorrection(TInstance *this)
|
||||||
Oopsi: correction data starts at the left of the scanning window!
|
Oopsi: correction data starts at the left of the scanning window!
|
||||||
*/
|
*/
|
||||||
iOff=this->param.x/2+this->calibration.xMargin;
|
iOff=this->param.x/2+this->calibration.xMargin;
|
||||||
memset(aGain,0,sizeof(aGain));
|
memset(aGain,0xFF,sizeof(aGain));
|
||||||
|
RegWrite(this,0x3D,1,0x0F | 0x80); /* 10XXXXXX : one offset table */
|
||||||
|
RegWrite(this,0x3F,1, iTableOffset==0x6000 ? 0x18 : 0x08); /* 16KB gain at 0x06000 or 0x02000 */
|
||||||
for (i=iOff; i<MAX_PIXEL_PER_SCANLINE; i++)
|
for (i=iOff; i<MAX_PIXEL_PER_SCANLINE; i++)
|
||||||
{
|
{
|
||||||
uwGain=this->calibration.achStripeY[i]<<4;
|
uwGain=this->calibration.achStripeY[i]<<4;
|
||||||
aGain[i-iOff].uchLow =(unsigned char)(uwGain&0xFF);
|
aGain[i-iOff].uchLow =(unsigned char)(uwGain&0xFF);
|
||||||
aGain[i-iOff].uchHigh=(unsigned char)(uwGain>>8);
|
aGain[i-iOff].uchHigh=(unsigned char)(uwGain>>8);
|
||||||
}
|
}
|
||||||
for (i=0; i<0x2000; i+=0x1000)
|
for (i=0; i<0x4000; i+=0x1000)
|
||||||
MemWriteArray(this,(0x6000+i)>>1,0x1000,(unsigned char*)(aGain+i));
|
MemWriteArray(this,(iTableOffset+i)>>1,0x1000,((unsigned char*)aGain)+i);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return SANE_STATUS_GOOD;
|
return SANE_STATUS_GOOD;
|
||||||
}
|
}
|
||||||
|
|
|
@ -283,7 +283,7 @@ __SM3600EXPORT__ TState DoLampSwitch(TInstance *this,int nPattern);
|
||||||
#endif
|
#endif
|
||||||
__SM3600EXPORT__ TState DoCalibration(TInstance *this);
|
__SM3600EXPORT__ TState DoCalibration(TInstance *this);
|
||||||
__SM3600EXPORT__ TState UploadGammaTable(TInstance *this, int iByteAddress, SANE_Int *pnGamma);
|
__SM3600EXPORT__ TState UploadGammaTable(TInstance *this, int iByteAddress, SANE_Int *pnGamma);
|
||||||
__SM3600EXPORT__ TState UploadGainCorrection(TInstance *this);
|
__SM3600EXPORT__ TState UploadGainCorrection(TInstance *this, int iTableOffset);
|
||||||
|
|
||||||
/* sm3600-scanusb.c */
|
/* sm3600-scanusb.c */
|
||||||
__SM3600EXPORT__ TState RegWrite(TInstance *this,int iRegister, int cb, unsigned long ulValue);
|
__SM3600EXPORT__ TState RegWrite(TInstance *this,int iRegister, int cb, unsigned long ulValue);
|
||||||
|
|
Ładowanie…
Reference in New Issue