Re: Starting a discussion about SANE and TWAIN...

Nick Lamb (njl98r@ecs.soton.ac.uk)
Sun, 15 Aug 1999 01:20:05 +0100 (GMT)

On Sat, 14 Aug 1999, Stephen Williams wrote:

> However, I want to be able to write SANE front-ends that can drive my
> back-end at those sorts of rates. I have put considerable effort into
> making sure the kernel mode device driver does *not* copy lots of image
> buffers around (app mmaps the image buffer which the card can access
> via DMA) and I don't want to see a SANE standard that does gratuitous
> copies.

Image data goes through sane_read, which is defined as:

sane_read (SANE_Handle h, SANE_Byte * buf, SANE_Int maxlen, SANE_Int * len);

This means that the backend is required to copy at most maxlen bytes
into the buffer (buf) which was provided by the frontend. This interface
is not optional, and should incur exactly one copy, which I don't think
is unreasonable.

In a typical localhost scenario the backend is a dynamically loaded
shared object, added to the frontend at runtime, and sharing the same
process space. Most such backends seem to fork() in order to do the
heavy lifting in a separate process, but that's entirely optional.

Does this sound alright, or is Zero Copy absolutely a must for your
proposed application?

Nick.

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