Patch for MUSTEK scanner driver

Heiko_Schroeder@t-online.de
Sun, 11 Oct 1998 17:34:51 +0200 (MEST)

---1463811839-1804289383-908120091=:589
Content-Type: TEXT/plain; CHARSET=US-ASCII

Hi!

When trying sane-0.74 with my old MFS-6000CX scanner, I recognized
that resolutions above 300dpi don't work. The problem is the way
this scanner encodes the resolution: For resolutions above 300dpi,
this scanner wants dpi/2 to be stored in the usual encoding and bit
7 of byte 4 of the start scan data to be set. (This information comes
from trial and error, so all I can say is that it works for me...)

The scanner identifies itself as MSF-06000CZ, Rev. 4.0.

Attached is a patch to adapt mustek.c and mustek.h to work with the
scanner.

CU
Heiko

-- 
+-------------------------------+------------------------------------+
|Email:                         | Snail-mail:  Heiko Schroeder       |
|                               |              Bremer Strasse 123    |
|  Heiko_Schroeder@t-online.de  |              26382 Wilhelmshaven   |
|                               |              GERMANY               |
+-------------------------------+------------------------------------+

---1463811839-1804289383-908120091=:589 Content-Type: TEXT/plain; CHARSET=US-ASCII Content-Description: mustek.diff

--- mustek.c.orig Sun Oct 11 17:22:34 1998 +++ mustek.c Sun Oct 11 14:16:40 1998 @@ -640,7 +640,7 @@ dev->x_range.max = SANE_FIX (8.5 * MM_PER_INCH); dev->y_range.max = SANE_FIX (14.0 * MM_PER_INCH); dev->dpi_range.max = SANE_FIX (600); - dev->flags |= MUSTEK_FLAG_USE_EIGHTS; + dev->flags |= MUSTEK_FLAG_USE_EIGHTS | MUSTEK_FLAG_DOUBLE_RES; } else { @@ -765,10 +765,20 @@ } else { - /* quantize to 10% step: */ - quant = (half_res / 10); - code = (dpi + quant / 2) / quant; - code |= 0x100; /* indicate 10% quantization */ + if (s->hw->flags & MUSTEK_FLAG_DOUBLE_RES) { + /* MSF-06000CZ is different... */ + quant = half_res / 100; + code = (dpi/2 + quant/2) / quant; + if (code < 1) + code = 1; + /* 0x100 indicates doubled resolution */ + } else { + /* quantize to 10% step: */ + quant = (half_res / 10); + code = (dpi + quant / 2) / quant; + /* 0x100 indicates 10% quantization */ + } + code |= 0x100; } } return code; --- mustek.h.orig Sun Oct 11 17:23:26 1998 +++ mustek.h Sun Oct 11 14:12:52 1998 @@ -53,6 +53,7 @@ #define MUSTEK_FLAG_LD_NONE (1 << 7) /* no line-distance corr? */ #define MUSTEK_FLAG_LINEART_FIX (1 << 8) /* lineart fix/hack */ #define MUSTEK_FLAG_PP (1 << 9) /* //-port scanner? */ +#define MUSTEK_FLAG_DOUBLE_RES (1 << 10) /* MSF-06000CZ res. encoding */ /* source values: */ #define MUSTEK_SOURCE_FLATBED 0

---1463811839-1804289383-908120091=:589--

--
Source code, list archive, and docs: http://www.mostang.com/sane/
To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com