summaryrefslogtreecommitdiff
path: root/backend/plustek-usbmap.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2019-07-31 17:00:58 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2019-07-31 17:00:58 +0200
commitd087d778ffb62e2713cb848540bcc819470365bd (patch)
treed69692a274dd1c7d0672e6bb7155a0fc106f9d49 /backend/plustek-usbmap.c
parentc8bd2513ecba169cff44c09c8058c36987357b18 (diff)
parent3759ce55ba79b8d3b9d8ed247a252273ee7dade3 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'backend/plustek-usbmap.c')
-rw-r--r--backend/plustek-usbmap.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/backend/plustek-usbmap.c b/backend/plustek-usbmap.c
index 1e54789..c979345 100644
--- a/backend/plustek-usbmap.c
+++ b/backend/plustek-usbmap.c
@@ -75,7 +75,7 @@ static void usb_MapAdjust( Plustek_Device *dev )
{
int i, tabLen;
double b, c, tmp;
-
+
tabLen = _MAP_SIZE;
/* adjust brightness (b) and contrast (c) using the function:
@@ -125,11 +125,11 @@ static SANE_Bool usb_MapDownload( Plustek_Device *dev )
int i, threshold;
SANE_Byte value;
SANE_Bool fInverse = 0;
-
+
DBG( _DBG_INFO, "usb_MapDownload()\n" );
/* the maps are have been already set */
-
+
/* do the brightness and contrast adjustment ... */
if( scanning->sParam.bDataType != SCANDATATYPE_BW )
usb_MapAdjust( dev );
@@ -141,7 +141,7 @@ static SANE_Bool usb_MapDownload( Plustek_Device *dev )
* into trouble elsewhere on CanoScan models using gray mode
*/
for( color = 0; color < 3; color++) {
-
+
/* select color */
value = (color << 2)+2;
@@ -161,13 +161,13 @@ static SANE_Bool usb_MapDownload( Plustek_Device *dev )
threshold = 0;
if(threshold > (int)_MAP_SIZE)
threshold = _MAP_SIZE;
-
+
DBG(_DBG_INFO, "* Threshold is at %u brightness=%i\n",
threshold, scanning->sParam.brightness );
for(i = 0; i < threshold; i++)
a_bMap[color*_MAP_SIZE + i] = 0;
-
+
for(i = threshold; i < _MAP_SIZE; i++)
a_bMap[color*_MAP_SIZE + i] = 255;
@@ -184,23 +184,23 @@ static SANE_Bool usb_MapDownload( Plustek_Device *dev )
}
if( fInverse ) {
-
+
u_char map[_MAP_SIZE];
u_char *pMap = a_bMap+color*_MAP_SIZE;
-
+
DBG( _DBG_INFO, "* Inverting Map\n" );
-
+
for( i = 0; i < _MAP_SIZE; i++, pMap++ )
map[i] = ~*pMap;
-
+
sanei_lm983x_write( dev->fd, 0x06, map, _MAP_SIZE, SANE_FALSE );
-
+
} else {
DBG( _DBG_INFO, "* downloading map %u...\n", color );
sanei_lm983x_write( dev->fd, 0x06, a_bMap+color*_MAP_SIZE,
_MAP_SIZE, SANE_FALSE );
}
-
+
} /* for each color */
DBG( _DBG_INFO, "usb_MapDownload() done.\n" );