[sane-devel] Need help analyzing USBSnoopy logs for Microtek Scanmaker 5600

Henning Meier-Geinitz henning@meier-geinitz.de
Mon, 18 Oct 2004 18:21:03 +0200


On Mon, Oct 18, 2004 at 09:03:55AM -0700, Susheel Yadav wrote:
> Some good news on the Microtek Scanmaker 5600 front -
> with Karsten's and Bertrik's help, I have been able to
> decode the usb protocol for setting/reading status,
> setting scan window and other scan parameters etc.
> Using javax-usb, I have been able to read image data
> through bulk transfer. I will start developing the
> sane backend very soon. As a template, I plan to use
> the sm3600 usb code.

Good news. But please don't use direct calls to libusb as done in
sm3600. Instead use the sanei_usb_* functions that are provided by
sanei/sanei_usb.c. If backends use direct calls to libusb, they can't
be used with other USB access methods and every backend muste be
changed if e.g. a new USB access library is to be supported by SANE.

> I have a couple of questions regarding sane
> integration:
> 1. Once I have the raw image data, what do I do with
> it?

In the SANE backend, you implement the function sane_read() which is
called by the frontend to get the data from the backend. 

> 2. How do I process the raw image data to create
> usable image?

Depending on the scanner you may need to do line calibration
(correction of the brightness difference of every single CCD/CIS
pixel) and/or line distance correction (in color mode). More
intelligent scanners do that internally, however.

After that you process the image data to be compatible with the SANE
protocol (see SANE standard) and return it by sane_read().

> 3. Is there any common core sane code to handle the
> raw image data like saving it in different formats?

That's done by the frontend. As a backend author you don't need to
care about that.