kopia lustrzana https://gitlab.com/sane-project/backends
correcting vertical scanning start point
rodzic
1414cd8f44
commit
1c1479d919
|
@ -1,3 +1,9 @@
|
||||||
|
2004-10-18 Ullrich Sigwanz <usigwanz@freesurf.ch>
|
||||||
|
|
||||||
|
* backend/niash_core.c:
|
||||||
|
* backend/niash.c: correcting vertical scanning start
|
||||||
|
point for changed max. page height
|
||||||
|
|
||||||
2004-10-17 Ullrich Sigwanz <usigwanz@freesurf.ch>
|
2004-10-17 Ullrich Sigwanz <usigwanz@freesurf.ch>
|
||||||
|
|
||||||
* backend/niash_core.c: using exact number of lines
|
* backend/niash_core.c: using exact number of lines
|
||||||
|
|
|
@ -1290,7 +1290,7 @@ sane_start (SANE_Handle h)
|
||||||
|
|
||||||
s->ScanParams.iWidth = par.pixels_per_line * iScaleDown;
|
s->ScanParams.iWidth = par.pixels_per_line * iScaleDown;
|
||||||
s->ScanParams.iHeight = par.lines * iScaleDown;
|
s->ScanParams.iHeight = par.lines * iScaleDown;
|
||||||
s->ScanParams.iBottom = 14200UL;
|
s->ScanParams.iBottom = HP3300C_BOTTOM;
|
||||||
s->ScanParams.fCalib = SANE_FALSE;
|
s->ScanParams.fCalib = SANE_FALSE;
|
||||||
|
|
||||||
/* perform a simple calibration just before scanning */
|
/* perform a simple calibration just before scanning */
|
||||||
|
|
|
@ -977,6 +977,20 @@ CircBufferGetLine (int iHandle, TDataPipe * p, unsigned char *pabLine,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* try to keep the number of transfers the same, but make them all
|
||||||
|
as good as possible the same size to avoid cranking in critical
|
||||||
|
situations
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
_OptimizeXferSize (int iLines, int iLinesPerXfer)
|
||||||
|
{
|
||||||
|
int iXfers;
|
||||||
|
iXfers = (iLines + iLinesPerXfer - 1) / iLinesPerXfer;
|
||||||
|
while (--iLinesPerXfer > 0
|
||||||
|
&& (iLines + iLinesPerXfer - 1) / iLinesPerXfer == iXfers);
|
||||||
|
return iLinesPerXfer + 1;
|
||||||
|
}
|
||||||
|
|
||||||
STATIC void
|
STATIC void
|
||||||
CircBufferInit (int iHandle, TDataPipe * p,
|
CircBufferInit (int iHandle, TDataPipe * p,
|
||||||
int iWidth, int iHeight,
|
int iWidth, int iHeight,
|
||||||
|
@ -1052,6 +1066,10 @@ CircBufferInit (int iHandle, TDataPipe * p,
|
||||||
{
|
{
|
||||||
p->iLinesPerXferBuf = MAX_LINES_PER_XFERBUF;
|
p->iLinesPerXferBuf = MAX_LINES_PER_XFERBUF;
|
||||||
}
|
}
|
||||||
|
/* final optimization to keep critical scans smooth */
|
||||||
|
p->iLinesPerXferBuf =
|
||||||
|
_OptimizeXferSize (p->iLinesLeft, p->iLinesPerXferBuf);
|
||||||
|
|
||||||
DBG (DBG_MSG, "_iXFerSize = %d for %d transfer(s)\n",
|
DBG (DBG_MSG, "_iXFerSize = %d for %d transfer(s)\n",
|
||||||
(int) p->iLinesPerXferBuf * p->iBytesPerLine,
|
(int) p->iLinesPerXferBuf * p->iBytesPerLine,
|
||||||
(p->iLinesLeft + p->iLinesPerXferBuf - 1) / p->iLinesPerXferBuf);
|
(p->iLinesLeft + p->iLinesPerXferBuf - 1) / p->iLinesPerXferBuf);
|
||||||
|
|
Ładowanie…
Reference in New Issue